Added Function Stub for Turn Events

This commit is contained in:
Philip W 2023-02-27 17:32:34 +00:00
parent e496cf07e9
commit 775f3b4945
2 changed files with 17 additions and 4 deletions

View File

@ -21,12 +21,19 @@ void UStatusEffect::OnExpiry(AActor* Character)
StatusSystem->RemoveStatusEffect(this);
}
void UStatusEffect::OnPlayerTurn(AActor* Character)
{
return;
}
void UStatusEffect::OnEnemyTurn(AActor* Character)
{
return;
}
void UStatusEffect::CheckForExpiry(const float TimeOfExpiry, AActor* Character)
{
if (TimeOfExpiry <= UGameplayStatics::GetRealTimeSeconds(GetWorld()))
{
OnExpiry(Character);
}
if (TimeOfExpiry <= UGameplayStatics::GetRealTimeSeconds(GetWorld())) OnExpiry(Character);
UStatusSystem* StatusSystem = Cast<UStatusSystem>(Character->GetComponentByClass(UStatusSystem::StaticClass()));
if (StatusSystem->GetActiveStatusEffect(this).StatusIcon == nullptr) return;
UTextBlock* StatusText = Cast<UTextBlock>(StatusSystem->GetActiveStatusEffect(this).StatusIcon->GetWidgetFromName(TEXT("DurationText")));

View File

@ -30,6 +30,12 @@ public:
UFUNCTION()
virtual void OnExpiry(AActor* Character);
UFUNCTION()
virtual void OnPlayerTurn(AActor* Character);
UFUNCTION()
virtual void OnEnemyTurn(AActor* Character);
protected:
UPROPERTY()
FTimerHandle ExpiryTimerHandle;