ExoWest/Source/Exo/Public/Player/ExoPlayerController.h
Kubson96 9e7fab3544 feat: add simple shooting component
Added interface for damage.
Added shooting component with simple shooting system.
Fix missing action bindings in player controller.
Added cylinder mesh to ExoEnemy and place him on TestMap.
2025-02-21 20:42:52 +01:00

132 lines
3.6 KiB
C++

// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "GameFramework/PlayerController.h"
#include <Player/InteractionComponent.h>
#include <Characters/Components/ShootingComponent.h>
#include "ExoPlayerController.generated.h"
class AExoPlayerCharacter;
class UInputMappingContext;
class UInputAction;
struct FInputActionValue;
UCLASS()
class EXO_API AExoPlayerController : public APlayerController
{
GENERATED_BODY()
public:
AExoPlayerController();
virtual void BeginPlay() override;
virtual void PlayerTick(float DeltaTime) override;
protected:
virtual void SetupInputComponent() override;
// Moja propozycja sterowania po prawej [Hubert]
UFUNCTION(BlueprintCallable, Category = "Input")
void Move(const FInputActionValue& InputActionValue); //WSAD
UFUNCTION(BlueprintCallable, Category = "Input")
void Look(const FInputActionValue& InputActionValue); // MouseXY
UFUNCTION(BlueprintCallable, Category = "Input")
void Interact(); // E
UFUNCTION(BlueprintCallable, Category = "Input")
void PlayerJump(); // Space
UFUNCTION(BlueprintCallable, Category = "Input")
void PlayerDodge(); // LShift(Pressed)
UFUNCTION(BlueprintCallable, Category = "Input")
void ResetDodge();
UFUNCTION(BlueprintCallable, Category = "Input")
void PlayerCrouch(); // LCtrl\C\X
UFUNCTION(BlueprintCallable, Category = "Input")
void PlayerSprint(); // LShift(Hold)
UFUNCTION(BlueprintCallable, Category = "Input")
void PlayerShoot(); // LPM
UFUNCTION(BlueprintCallable, Category = "Input")
void PlayerAim(); // PPM
UFUNCTION(BlueprintCallable, Category = "Input")
void PlayerMeleAttack(); // V
UFUNCTION(BlueprintCallable, Category = "Input")
void PlayerChangeWeapon(); // 1\2\MouseScroll
UFUNCTION(BlueprintCallable, Category = "Input")
void PlayerReload(); // R
protected:
UPROPERTY(EditAnywhere, Category = "Input")
TObjectPtr<UInputMappingContext> InputContext;
UPROPERTY(EditAnywhere, Category= "Input")
TObjectPtr<UInputAction> MoveAction;
UPROPERTY(EditAnywhere, Category = "Input")
TObjectPtr<UInputAction> InteractAction;
UPROPERTY(EditAnywhere, Category = "Input")
TObjectPtr<UInputAction> LookAction;
UPROPERTY(EditAnywhere, Category = "Input")
TObjectPtr<UInputAction> JumpAction;
UPROPERTY(EditAnywhere, Category = "Input")
TObjectPtr<UInputAction> SprintAction;
UPROPERTY(EditAnywhere, Category = "Input")
TObjectPtr<UInputAction> CrouchAction;
UPROPERTY(EditAnywhere, Category = "Input")
TObjectPtr<UInputAction> DodgeAction;
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Dodge Properties")
FTimerHandle DodgeCooldownTimer;
UPROPERTY(EditAnywhere, Category = "Dodge Properties")
float DodgeForce = 5000.f; // Move to player if future for better modification
UPROPERTY(EditAnywhere, Category = "Dodge Properties")
float DodgeCooldown = 2.f; // Move to player too.
UPROPERTY(EditAnywhere, Category = "Dodge Properties")
bool CanDodge = true;
UPROPERTY(EditAnywhere, Category = "Input")
TObjectPtr<UInputAction> ShootAction;
UPROPERTY(EditAnywhere, Category = "Input")
TObjectPtr<UInputAction> ReloadAction;
UPROPERTY(EditAnywhere, Category = "Input")
TObjectPtr<UInputAction> AimAction;
UPROPERTY(EditAnywhere, Category = "Input")
TObjectPtr<UInputAction> MeleAction;
UPROPERTY(EditAnywhere, Category = "Input")
TObjectPtr<UInputAction> ChangeWeaponAction;
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Character")
TObjectPtr<AExoPlayerCharacter> PlayerCharacter;
private:
UInteractionComponent* InteractionComponent;
UShootingComponent* ShootingComponent;
};