-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDefender.h
84 lines (59 loc) · 2.19 KB
/
Defender.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#pragma once
#include "CoreMinimal.h"
#include "GameFramework/Pawn.h"
#include "Math/UnrealMathUtility.h"
#include "Defender.generated.h"
class UFloatingPawnMovement;
class UBoxComponent;
UCLASS()
class EARTHDEFENDERCPP_API ADefender : public APawn
{
GENERATED_BODY()
public:
ADefender();
virtual void Tick(float DeltaTime) override;
virtual void SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) override;
virtual void MoveCircular(float AxisValue);
virtual void Shoot();
float CenterPointX = 50.0f;
float CenterPointY = 230.0f;
float M_PI = PI;
float DegToRad = PI / 180.0f;
float RadToDeg = 180.0f / PI;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "RotateAround")
APawn* Defender;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "RotateAround")
float RotationSpeed = 2.0f;
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "RotateAround", meta = (ClampMin = "0.0", ClampMax = "6.28", UIMin = "0.0", UIMax = "6.28"))
float InitialRotationAngle = 4.71f;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Gameplay)
FVector MuzzleOffset;
UPROPERTY(VisibleAnywhere, BlueprintReadOnly)
UBoxComponent* Box_Collision;
UFUNCTION(BlueprintCallable)
void Reset();
UFUNCTION(BlueprintCallable)
void AddDefenderPoints();
UFUNCTION(BlueprintCallable)
void DamageDefender(int damagePoints);
UFUNCTION(BlueprintCallable)
int GetDefenderLifePoints();
protected:
virtual void BeginPlay() override;
float CurrentAngle = 0.0f;
float Angle = 0.0f;
UPROPERTY(VisibleAnywhere, BlueprintReadWrite)
UStaticMeshComponent* SM_Defender;
UPROPERTY(VisibleAnywhere, BlueprintReadWrite)
UFloatingPawnMovement* FloatingMovement;
UPROPERTY(EditDefaultsOnly, Category = Projectile)
TSubclassOf<class ABullet> ProjectileClass;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "LifePoints")
int DefenderLifePoints = 100;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Points")
int DefenderPoints = 0;
UFUNCTION()
void OnOverlapBegin(class UPrimitiveComponent* OverlappedComp, class AActor* OtherActor,
class UPrimitiveComponent* OtherComp, int32 OtherBodyIndexType, bool bFromSweep,
const FHitResult& SweepResult);
};