blaster/Source/Blaster/Character/BlasterCharacter.h

80 lines
2.2 KiB
C
Raw Normal View History

2022-04-28 10:18:21 +00:00
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
2022-05-04 09:28:00 +00:00
#include "Blaster/Types/TurningInPlace.h"
2022-04-28 10:18:21 +00:00
#include "GameFramework/Character.h"
#include "BlasterCharacter.generated.h"
UCLASS()
class BLASTER_API ABlasterCharacter : public ACharacter
{
GENERATED_BODY()
public:
ABlasterCharacter();
2022-04-28 10:41:43 +00:00
virtual void Tick(float DeltaTime) override;
virtual void SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) override;
2022-04-30 10:26:25 +00:00
virtual void GetLifetimeReplicatedProps(TArray<FLifetimeProperty>& OutLifetimeProps) const override;
2022-04-30 11:09:28 +00:00
virtual void PostInitializeComponents() override;
2022-05-04 20:13:31 +00:00
void PlayFireMontage(bool bAiming);
2022-05-04 09:28:00 +00:00
2022-04-28 10:18:21 +00:00
protected:
virtual void BeginPlay() override;
2022-04-28 12:39:36 +00:00
void MoveForward(float Value);
void MoveRight(float Value);
void Turn(float Value);
void LookUp(float Value);
2022-04-30 11:09:28 +00:00
void EquipButtonPressed();
2022-04-30 15:10:07 +00:00
void CrouchButtonPressed();
2022-04-30 15:38:03 +00:00
void AimButtonPressed();
void AimButtonReleased();
2022-05-03 21:14:04 +00:00
void AimOffset(float DeltaTime);
2022-05-04 12:57:48 +00:00
virtual void Jump() override;
2022-05-04 20:13:31 +00:00
void FireButtonPressed();
void FireButtonReleased();
2022-04-30 11:09:28 +00:00
2022-04-28 10:41:43 +00:00
private:
UPROPERTY(VisibleAnywhere, Category="Camera")
class USpringArmComponent* CameraBoom;
2022-04-28 10:18:21 +00:00
2022-04-28 10:41:43 +00:00
UPROPERTY(VisibleAnywhere, Category="Camera")
class UCameraComponent* FollowCamera;
2022-04-29 21:38:34 +00:00
UPROPERTY(EditAnywhere, BlueprintReadOnly, meta = (AllowPrivateAccess = "true"))
class UWidgetComponent* OverheadWidget;
2022-04-30 10:26:25 +00:00
UPROPERTY(ReplicatedUsing = OnRep_OverlappingWeapon)
class AWeapon* OverlappingWeapon;
UFUNCTION()
void OnRep_OverlappingWeapon(AWeapon* LastWeapon);
2022-04-30 11:09:28 +00:00
UPROPERTY(VisibleAnywhere)
class UCombatComponent* Combat;
2022-04-30 14:08:00 +00:00
UFUNCTION(Server, Reliable)
void ServerEquipButtonPressed();
2022-05-03 21:14:04 +00:00
float AO_Yaw;
2022-05-04 12:09:01 +00:00
float InterpAO_Yaw;
2022-05-03 21:14:04 +00:00
float AO_Pitch;
FRotator StartingAimRotation;
2022-05-04 09:28:00 +00:00
ETurningInPlace TurningInPlace;
void TurnInPlace(float DeltaTime);
2022-05-04 20:13:31 +00:00
UPROPERTY(EditAnywhere, Category = Combat)
class UAnimMontage* FireWeaponMontage;
2022-04-30 10:26:25 +00:00
public:
void SetOverlappingWeapon(AWeapon* Weapon);
2022-04-30 14:48:34 +00:00
bool IsWeaponEquipped();
2022-04-30 15:38:03 +00:00
bool IsAiming();
2022-05-03 21:14:04 +00:00
FORCEINLINE float GetAO_Yaw() const { return AO_Yaw; };
FORCEINLINE float GetAO_Pitch() const { return AO_Pitch; };
2022-05-03 22:43:10 +00:00
AWeapon* GetEquippedWeapon();
2022-05-04 09:28:00 +00:00
FORCEINLINE ETurningInPlace GetTurningInPlace() const { return TurningInPlace; };
2022-04-28 10:18:21 +00:00
};