AzureAbyss/Source/the_twilight_abyss/TurnBasedCombatV2/StatusEffects/Thorns.cpp

29 lines
675 B
C++
Raw Normal View History

2023-02-27 04:55:12 +00:00
// Fill out your copyright notice in the Description page of Project Settings.
#include "Thorns.h"
#include "the_twilight_abyss/TurnBasedCombatV2/TurnBaseCombatV2.h"
2023-02-27 04:55:12 +00:00
void UThorns::Invoke(AActor* Character, float TimeOfExpiry)
{
Super::Invoke(Character, TimeOfExpiry);
}
void UThorns::OnExpiry(AActor* Character)
{
Super::OnExpiry(Character);
}
void UThorns::OnEnemyTurn(AActor* Enemy, AActor* Character)
{
ATurnBaseCombatV2* CombatSystem = Cast<ATurnBaseCombatV2>(GetWorld()->GetGameState());
CombatSystem->DamageEnemy(DamagePerTurn, "thorns");
BaseDuration -= 1.0f;
Super::OnEnemyTurn(Enemy, Character);
if (BaseDuration <= 0.0f)
{
OnExpiry(Character);
}
}