29 lines
675 B
C++
29 lines
675 B
C++
// Fill out your copyright notice in the Description page of Project Settings.
|
|
|
|
|
|
#include "Thorns.h"
|
|
|
|
#include "the_twilight_abyss/TurnBasedCombatV2/TurnBaseCombatV2.h"
|
|
|
|
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)
|
|
{
|
|
Super::OnEnemyTurn(Enemy, Character);
|
|
ATurnBaseCombatV2* CombatSystem = Cast<ATurnBaseCombatV2>(GetWorld()->GetGameState());
|
|
CombatSystem->DamageEnemy(DamagePerTurn, "thorns");
|
|
BaseDuration -= 1.0f;
|
|
if (BaseDuration <= 0.0f)
|
|
{
|
|
OnExpiry(Character);
|
|
}
|
|
}
|