Updated TurnBaseCombat for Enemy Death onHealthZero
This commit is contained in:
parent
521ab6c089
commit
a976775e61
BIN
Content/Blueprints/Combat_UI/TestCombatCharacter.uasset
(Stored with Git LFS)
BIN
Content/Blueprints/Combat_UI/TestCombatCharacter.uasset
(Stored with Git LFS)
Binary file not shown.
@ -18,10 +18,11 @@ ATurnBaseCombat::ATurnBaseCombat()
|
||||
}
|
||||
}
|
||||
|
||||
void ATurnBaseCombat::StartCombat()
|
||||
void ATurnBaseCombat::StartCombat(AActor* Enemy)
|
||||
{
|
||||
if (HUD->IsInViewport()) return;
|
||||
HUD->AddToViewport();
|
||||
EnemyActor = Enemy;
|
||||
|
||||
if (APlayerController* PC = Cast<APlayerController>(GetWorld()->GetFirstPlayerController()))
|
||||
{
|
||||
@ -93,7 +94,13 @@ void ATurnBaseCombat::ExecuteCast(FString Combo)
|
||||
break;
|
||||
}
|
||||
//End Combat if either the player or enemy is dead
|
||||
if (PlayerHealth <= 0 || EnemyHealth <= 0)
|
||||
if (EnemyHealth <= 0)
|
||||
{
|
||||
EndCombat();
|
||||
EnemyActor->Destroy();
|
||||
return;
|
||||
}
|
||||
if (PlayerHealth <= 0)
|
||||
{
|
||||
EndCombat();
|
||||
return;
|
||||
|
@ -30,7 +30,8 @@ public:
|
||||
int ActiveActionPoints = 0;
|
||||
|
||||
// AActor* PlayerActor;
|
||||
// AActor* EnemyActor;
|
||||
UPROPERTY(VisibleAnywhere)
|
||||
AActor* EnemyActor;
|
||||
// AActor* ActiveActor;
|
||||
|
||||
/*
|
||||
@ -52,7 +53,7 @@ public:
|
||||
FString BattleLog;
|
||||
|
||||
UFUNCTION(BlueprintCallable)
|
||||
void StartCombat();
|
||||
void StartCombat(AActor* Enemy);
|
||||
UFUNCTION(BlueprintCallable)
|
||||
void EndCombat();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user