Added Function Stub for Turn Events
This commit is contained in:
parent
e496cf07e9
commit
775f3b4945
@ -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")));
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user