5#include "CoreMinimal.h"
8#include "MeleeComponent.generated.h"
13UCLASS(Blueprintable, BlueprintType, ClassGroup=(BucciGames), meta=(BlueprintSpawnableComponent) )
23 UPROPERTY(BlueprintAssignable, Category="
Melee Combat")
24 FOnMeleeHit OnMeleeHit;
26 UFUNCTION(BlueprintCallable, Category = "
Melee Combat")
27 void MeleeAttack(const
bool bHoldingWeapon = false, const FVector& CustomStartLocation = FVector::ZeroVector, const USceneComponent* CustomStartPoint =
nullptr);
28 UFUNCTION(BlueprintCallable, Category = "
Melee Combat")
29 void MeleeWeaponAttack(FVector CustomStartLocation = FVector::ZeroVector);
30 UFUNCTION(BlueprintCallable, Category = "
Melee Combat")
31 void MeleeKickAttack(
bool bHoldingWeapon = false, FVector CustomStartLocation = FVector::ZeroVector);
34 UFUNCTION(BlueprintCallable, Category = "
Melee Combat")
35 void MeleeBlockStart();
36 UFUNCTION(BlueprintCallable, Category = "
Melee Combat")
37 void MeleeBlockStop();
40 UFUNCTION(BlueprintCallable, Category = "
Melee Combat")
41 void StopMeleeAttack();
42 UFUNCTION(BlueprintCallable, Category = "
Melee Combat")
43 void SetCanAttack(const
bool bValue){bCanAttack = bValue;}
45 UFUNCTION(BlueprintPure, BlueprintCallable, Category =
"Melee Combat")
46 FHitResult GetLastHitResult(){
return HitResult;};
47 UFUNCTION(BlueprintPure, BlueprintCallable, Category =
"Melee Combat")
48 bool GetIsAttacking()
const{
return bIsAttacking;};
49 UFUNCTION(BlueprintPure, BlueprintCallable, Category =
"Melee Combat")
50 bool GetIsBlocking()
const{
return bIsBlocking;};
53 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category =
"Debugging")
54 float DrawDebugTime = 2.0f;
57 UFUNCTION(BlueprintPure, BlueprintCallable, Category = "
Melee Combat")
60 UFUNCTION(BlueprintPure, BlueprintCallable, Category = "
Melee Combat")
61 bool GetCanMelee() const;
65 virtual
void OnMontageNotifyBegin(FName NotifyName, const FBranchingPointNotifyPayload& BranchingPointPayload) override;
67 void PlayFeedbackEffects() const;
73 float CalculateDamage();
75 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "
Health|Traits")
76 float StrengthDamageBase = 1.0f;
79 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="
Melee Combat|Effects")
80 bool NPCDamageFriendlies = false;
81 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="
Melee Combat")
82 float AttackRange = 75.0f;
83 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="
Melee Combat")
84 float AttackDamage = 1.0f;
85 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="
Melee Combat")
86 float AttackRadius = 40.0f;
87 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="
Melee Combat")
88 float AttackImpulse = 50000.0f;
89 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="
Melee Combat")
90 bool bLeftHand = false;
91 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="
Melee Combat")
92 bool bNonLethal = false;
94 float ComboTime = 1.0f;
97 float ComboDamageBase = 10.0f;
99 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="
Melee Combat")
100 float AttackCheckDelayTime = 1.0f;
108 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="
Melee Combat")
109 FName RightHandName = "hand_r";
110 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="
Melee Combat")
111 FName LeftHandName = "Hand_L";
112 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="
Melee Combat|Effects")
113 UForceFeedbackEffect* SingleFireControllerFeedback;
114 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="
Melee Combat|Effects")
115 TSubclassOf<UCameraShakeBase> CameraShake;
116 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="
Melee Combat|Effects")
117 float CameraShakeScale = 1.0f;
121 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="
Melee Combat")
122 class USoundBase* MeleeImpactSound;
123 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="
Melee Combat")
124 TArray<AActor*> ActorsToIgnore;
126 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="
Melee Combat")
127 UAnimMontage* MeleeAnimation;
128 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="
Melee Combat")
129 UAnimMontage* WeaponMeleeAnimation;
131 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="
Melee Combat")
132 TArray<UAnimMontage*> LeftHandMeleeAnimations;
133 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="
Melee Combat")
134 TArray<UAnimMontage*> HeavyMeleeAnimations;
135 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="
Melee Combat")
136 TArray<UAnimMontage*> JabMeleeAnimations;
139 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="
Melee Combat")
140 FName MeleeNotifyName = "
Melee";
146 void MeleeDelayCheck(const
float DelayTime);
151 UPROPERTY(VisibleAnywhere, Category="
Melee Combat")
152 bool bIsAttacking = false;
153 UPROPERTY(VisibleAnywhere, Category="
Melee Combat")
154 bool bCanAttack = true;
156 UPROPERTY(VisibleAnywhere, Category="
Melee Combat")
157 bool bIsBlocking = false;
159 FVector CustomLocation = FVector::ZeroVector;
161 const USceneComponent* CustomLocationPoint =
nullptr;
163 FHitResult HitResult;
165 FTimerHandle MeleeCheckTimerHandle;
167 FTimerHandle ComboTimerHandle;
UCLASS(Blueprintable, BlueprintType, ClassGroup=(BucciGames), meta=(BlueprintSpawnableComponent)) class CHATSYSTEM_API UChatSystemComponent
Definition ChatSystemComponent.h:13
DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FOnMeleeHit, AActor *, HitActor)
EUnarmedAttack
Definition MeleeData.h:12
EMeleeAttackType
Definition MeleeData.h:27
Definition Health.Build.cs:6
Represents a character component that can be added to an actor.