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;
|
if (HUD->IsInViewport()) return;
|
||||||
HUD->AddToViewport();
|
HUD->AddToViewport();
|
||||||
|
EnemyActor = Enemy;
|
||||||
|
|
||||||
if (APlayerController* PC = Cast<APlayerController>(GetWorld()->GetFirstPlayerController()))
|
if (APlayerController* PC = Cast<APlayerController>(GetWorld()->GetFirstPlayerController()))
|
||||||
{
|
{
|
||||||
@ -93,7 +94,13 @@ void ATurnBaseCombat::ExecuteCast(FString Combo)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
//End Combat if either the player or enemy is dead
|
//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();
|
EndCombat();
|
||||||
return;
|
return;
|
||||||
|
@ -30,7 +30,8 @@ public:
|
|||||||
int ActiveActionPoints = 0;
|
int ActiveActionPoints = 0;
|
||||||
|
|
||||||
// AActor* PlayerActor;
|
// AActor* PlayerActor;
|
||||||
// AActor* EnemyActor;
|
UPROPERTY(VisibleAnywhere)
|
||||||
|
AActor* EnemyActor;
|
||||||
// AActor* ActiveActor;
|
// AActor* ActiveActor;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -52,7 +53,7 @@ public:
|
|||||||
FString BattleLog;
|
FString BattleLog;
|
||||||
|
|
||||||
UFUNCTION(BlueprintCallable)
|
UFUNCTION(BlueprintCallable)
|
||||||
void StartCombat();
|
void StartCombat(AActor* Enemy);
|
||||||
UFUNCTION(BlueprintCallable)
|
UFUNCTION(BlueprintCallable)
|
||||||
void EndCombat();
|
void EndCombat();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user