18 lines
505 B
C++
18 lines
505 B
C++
// Fill out your copyright notice in the Description page of Project Settings.
|
|
|
|
|
|
#include "DamageOverTime.h"
|
|
#include <the_twilight_abyss/TurnBasedCombatV2/TurnBaseCombatV2.h>
|
|
|
|
void UDamageOverTime::OnEnemyTurn(AActor* Enemy, AActor* Character)
|
|
{
|
|
ATurnBaseCombatV2* CombatSystem = Cast<ATurnBaseCombatV2>(GetWorld()->GetGameState());
|
|
CombatSystem->DamageEnemy(DamagePerTurn, "DOT");
|
|
BaseDuration -= 1.0f;
|
|
Super::OnEnemyTurn(Enemy, Character);
|
|
if (BaseDuration <= 0.0f)
|
|
{
|
|
OnExpiry(Character);
|
|
}
|
|
}
|