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

28 lines
779 B
C++
Raw Permalink Normal View History

// Fill out your copyright notice in the Description page of Project Settings.
#include "DamageDown.h"
void UDamageDown::Invoke(AActor* Character, float TimeOfExpiry)
{
2023-05-14 20:09:34 +00:00
ATurnBaseCombatV2* CombatSystem = Cast<ATurnBaseCombatV2>(GetWorld()->GetGameState());
CombatSystem->EnemyBaseDamageMultiplier -= EnemyDamageMultiplierDecreaseAmount;
}
void UDamageDown::OnExpiry(AActor* Character)
{
2023-05-14 20:09:34 +00:00
ATurnBaseCombatV2* CombatSystem = Cast<ATurnBaseCombatV2>(GetWorld()->GetGameState());
CombatSystem->EnemyBaseDamageMultiplier += EnemyDamageMultiplierDecreaseAmount;
Super::OnExpiry(Character);
}
void UDamageDown::OnEnemyTurn(AActor* Enemy, AActor* Character)
{
BaseDuration -= 1.0f;
Super::OnEnemyTurn(Enemy, Character);
if (BaseDuration <= 0.0f)
{
OnExpiry(Character);
}
}