27 lines
672 B
C++
27 lines
672 B
C++
// Fill out your copyright notice in the Description page of Project Settings.
|
|
|
|
|
|
#include "DamageDown.h"
|
|
|
|
void UDamageDown::Invoke(AActor* Character, float TimeOfExpiry)
|
|
{
|
|
CombatSystem = Cast<ATurnBaseCombatV2>(GetWorld()->GetGameState());
|
|
CombatSystem->EnemyBaseDamageMultiplier -= EnemyDamageMultiplierDecreaseAmount;
|
|
}
|
|
|
|
void UDamageDown::OnExpiry(AActor* Character)
|
|
{
|
|
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);
|
|
}
|
|
}
|