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

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)
{
Super::OnEnemyTurn(Enemy, Character);
ATurnBaseCombatV2* CombatSystem = Cast<ATurnBaseCombatV2>(GetWorld()->GetGameState());
CombatSystem->DamageEnemy(DamagePerTurn, "DOT");
BaseDuration -= 1.0f;
if (BaseDuration <= 0.0f)
{
OnExpiry(Character);
}
}