2023-05-12 19:44:46 +00:00
|
|
|
// 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());
|
2023-05-12 19:44:46 +00:00
|
|
|
CombatSystem->EnemyBaseDamageMultiplier -= EnemyDamageMultiplierDecreaseAmount;
|
|
|
|
}
|
|
|
|
|
|
|
|
void UDamageDown::OnExpiry(AActor* Character)
|
|
|
|
{
|
2023-05-14 20:09:34 +00:00
|
|
|
ATurnBaseCombatV2* CombatSystem = Cast<ATurnBaseCombatV2>(GetWorld()->GetGameState());
|
2023-05-12 19:44:46 +00:00
|
|
|
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);
|
|
|
|
}
|
|
|
|
}
|