diff --git a/Source/the_twilight_abyss/TurnBasedCombatV2/StatusEffects/DamageDown.cpp b/Source/the_twilight_abyss/TurnBasedCombatV2/StatusEffects/DamageDown.cpp index 80b0442..962bfb5 100644 --- a/Source/the_twilight_abyss/TurnBasedCombatV2/StatusEffects/DamageDown.cpp +++ b/Source/the_twilight_abyss/TurnBasedCombatV2/StatusEffects/DamageDown.cpp @@ -5,12 +5,13 @@ void UDamageDown::Invoke(AActor* Character, float TimeOfExpiry) { - CombatSystem = Cast(GetWorld()->GetGameState()); + ATurnBaseCombatV2* CombatSystem = Cast(GetWorld()->GetGameState()); CombatSystem->EnemyBaseDamageMultiplier -= EnemyDamageMultiplierDecreaseAmount; } void UDamageDown::OnExpiry(AActor* Character) { + ATurnBaseCombatV2* CombatSystem = Cast(GetWorld()->GetGameState()); CombatSystem->EnemyBaseDamageMultiplier += EnemyDamageMultiplierDecreaseAmount; Super::OnExpiry(Character); } diff --git a/Source/the_twilight_abyss/TurnBasedCombatV2/StatusEffects/DamageDown.h b/Source/the_twilight_abyss/TurnBasedCombatV2/StatusEffects/DamageDown.h index 23a43d0..8540223 100644 --- a/Source/the_twilight_abyss/TurnBasedCombatV2/StatusEffects/DamageDown.h +++ b/Source/the_twilight_abyss/TurnBasedCombatV2/StatusEffects/DamageDown.h @@ -21,7 +21,4 @@ public: virtual void Invoke(AActor* Character, float TimeOfExpiry) override; virtual void OnExpiry(AActor* Character) override; virtual void OnEnemyTurn(AActor* Enemy, AActor* Character) override; - -protected: - ATurnBaseCombatV2* CombatSystem; }; diff --git a/Source/the_twilight_abyss/TurnBasedCombatV2/StatusEffects/DamageDownPlayer.cpp b/Source/the_twilight_abyss/TurnBasedCombatV2/StatusEffects/DamageDownPlayer.cpp index fee30a6..a0d3a59 100644 --- a/Source/the_twilight_abyss/TurnBasedCombatV2/StatusEffects/DamageDownPlayer.cpp +++ b/Source/the_twilight_abyss/TurnBasedCombatV2/StatusEffects/DamageDownPlayer.cpp @@ -5,12 +5,13 @@ void UDamageDownPlayer::Invoke(AActor* Character, float TimeOfExpiry) { - CombatSystem = Cast(GetWorld()->GetGameState()); + ATurnBaseCombatV2* CombatSystem = Cast(GetWorld()->GetGameState()); CombatSystem->BaseDamageMultiplier -= PlayerDamageMultiplierDecreaseAmount; } void UDamageDownPlayer::OnExpiry(AActor* Character) { + ATurnBaseCombatV2* CombatSystem = Cast(GetWorld()->GetGameState()); CombatSystem->BaseDamageMultiplier += PlayerDamageMultiplierDecreaseAmount; Super::OnExpiry(Character); } diff --git a/Source/the_twilight_abyss/TurnBasedCombatV2/StatusEffects/DamageDownPlayer.h b/Source/the_twilight_abyss/TurnBasedCombatV2/StatusEffects/DamageDownPlayer.h index 8170034..51f6476 100644 --- a/Source/the_twilight_abyss/TurnBasedCombatV2/StatusEffects/DamageDownPlayer.h +++ b/Source/the_twilight_abyss/TurnBasedCombatV2/StatusEffects/DamageDownPlayer.h @@ -21,7 +21,4 @@ public: virtual void Invoke(AActor* Character, float TimeOfExpiry) override; virtual void OnExpiry(AActor* Character) override; virtual void OnEnemyTurn(AActor* Enemy, AActor* Character) override; - -protected: - ATurnBaseCombatV2* CombatSystem; }; diff --git a/Source/the_twilight_abyss/TurnBasedCombatV2/TurnBaseCombatV2.cpp b/Source/the_twilight_abyss/TurnBasedCombatV2/TurnBaseCombatV2.cpp index 7316a0b..6f72002 100644 --- a/Source/the_twilight_abyss/TurnBasedCombatV2/TurnBaseCombatV2.cpp +++ b/Source/the_twilight_abyss/TurnBasedCombatV2/TurnBaseCombatV2.cpp @@ -344,7 +344,7 @@ void ATurnBaseCombatV2::ExecuteCast(FString Combo) else if (Combo == "AI") { UStatusEffect* TempDamageDownStatusEffect = NewObject(PlayerActor, DamageDownStatusEffect); - StatusSystem->AddStatusEffect(TempDamageDownStatusEffect, 1); + StatusSystem->AddStatusEffect(TempDamageDownStatusEffect, 1, true); StatusEffects.Add(TempDamageDownStatusEffect); AddBattleLogMessage("Player Casted DamageDown"); StatusTextBlock->SetColorAndOpacity(FSlateColor(FLinearColor(1.0f, 1.0f, 1.0f, 1.0f))); @@ -789,7 +789,7 @@ void ATurnBaseCombatV2::EnemyTurn() else ChanceToMiss = 30; if (FMath::RandRange(1, 100) > ChanceToMiss) { - if (IsBossBoolProperty->GetPropertyValue_InContainer(EnemyActor) && FMath::RandRange(1, 100) > 10) + if (IsBossBoolProperty->GetPropertyValue_InContainer(EnemyActor) && FMath::RandRange(1, 100) <= 10) { FOutputDeviceNull AR; UStatusSystem* StatusSystem = Cast(PlayerActor->GetComponentByClass(UStatusSystem::StaticClass()));