From 72308aabb075bfce6d0741e642fbca86c379af72 Mon Sep 17 00:00:00 2001 From: PHILIP White Date: Sat, 13 May 2023 00:42:38 +0100 Subject: [PATCH] Updated Boss to Add Combat Variation (Scream) --- Content/BlueprintAI/AI/AIBruh_Boss.uasset | 4 ++-- Content/Levels/Build.umap | 4 ++-- .../StatusEffects/DamageDownPlayer.cpp | 2 +- .../TurnBasedCombatV2/TurnBaseCombatV2.cpp | 24 ++++++++++++++++--- 4 files changed, 26 insertions(+), 8 deletions(-) diff --git a/Content/BlueprintAI/AI/AIBruh_Boss.uasset b/Content/BlueprintAI/AI/AIBruh_Boss.uasset index d30b839..3be9d93 100644 --- a/Content/BlueprintAI/AI/AIBruh_Boss.uasset +++ b/Content/BlueprintAI/AI/AIBruh_Boss.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:90f4a4f0c3472446fbeb54c61b4977f840aabd4bd85b7d8307ee1770d8584617 -size 143048 +oid sha256:def3f3390079faca86cbe8342b33a46714823cf2b80a2388a275805c700a2eb0 +size 143166 diff --git a/Content/Levels/Build.umap b/Content/Levels/Build.umap index 22e78d4..0efd646 100644 --- a/Content/Levels/Build.umap +++ b/Content/Levels/Build.umap @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:c364294675786ad9831270b6ff1a6214ff60e00c5bd67e8b68b685a449f97449 -size 4952061 +oid sha256:e98ba4125a82a9b676d2c5c8494c4cbc4569df261e179c47cd6e49e6cae8f77b +size 4956885 diff --git a/Source/the_twilight_abyss/TurnBasedCombatV2/StatusEffects/DamageDownPlayer.cpp b/Source/the_twilight_abyss/TurnBasedCombatV2/StatusEffects/DamageDownPlayer.cpp index a0ba615..fee30a6 100644 --- a/Source/the_twilight_abyss/TurnBasedCombatV2/StatusEffects/DamageDownPlayer.cpp +++ b/Source/the_twilight_abyss/TurnBasedCombatV2/StatusEffects/DamageDownPlayer.cpp @@ -11,8 +11,8 @@ void UDamageDownPlayer::Invoke(AActor* Character, float TimeOfExpiry) void UDamageDownPlayer::OnExpiry(AActor* Character) { - Super::OnExpiry(Character); CombatSystem->BaseDamageMultiplier += PlayerDamageMultiplierDecreaseAmount; + Super::OnExpiry(Character); } void UDamageDownPlayer::OnEnemyTurn(AActor* Enemy, AActor* Character) diff --git a/Source/the_twilight_abyss/TurnBasedCombatV2/TurnBaseCombatV2.cpp b/Source/the_twilight_abyss/TurnBasedCombatV2/TurnBaseCombatV2.cpp index e0c006b..82ed1cb 100644 --- a/Source/the_twilight_abyss/TurnBasedCombatV2/TurnBaseCombatV2.cpp +++ b/Source/the_twilight_abyss/TurnBasedCombatV2/TurnBaseCombatV2.cpp @@ -778,9 +778,27 @@ void ATurnBaseCombatV2::EnemyTurn() else ChanceToMiss = 30; if (FMath::RandRange(1, 100) > ChanceToMiss) { - const FProperty* EnemyBaseDamageProperty = EnemyActor->GetClass()->FindPropertyByName(FName("BaseDamage")); - const int* EnemyBaseDamageSpeedPtr = EnemyBaseDamageProperty->ContainerPtrToValuePtr(EnemyActor); - DamagePlayer(*EnemyBaseDamageSpeedPtr); + if (IsBossBoolProperty->GetPropertyValue_InContainer(EnemyActor) && FMath::RandRange(1, 100) > 10) + { + FOutputDeviceNull AR; + UStatusSystem* StatusSystem = Cast(PlayerActor->GetComponentByClass(UStatusSystem::StaticClass())); + UStatusEffect* TempPlayerDamageDownStatusEffect = NewObject(PlayerActor, DamageDownPlayerStatusEffect); + StatusSystem->AddStatusEffect(TempPlayerDamageDownStatusEffect, 1, true); + StatusEffects.Add(TempPlayerDamageDownStatusEffect); + AddBattleLogMessage("Player Damage Down"); + StatusTextBlock->SetColorAndOpacity(FSlateColor(FLinearColor(1.0f, 0.0f, 0.0f, 1.0f))); + StatusTextBlock->SetText(FText::FromString("Player Damage Down")); + const FString Command3 = FString::Printf(TEXT("PlayStatusAnimation")); + HUD->CallFunctionByNameWithArguments(*Command3, AR, nullptr, true); + const FString Command4 = FString::Printf(TEXT("TriggerScreamAnimation")); + EnemyActor->CallFunctionByNameWithArguments(*Command4, AR, nullptr, true); + } + else + { + const FProperty* EnemyBaseDamageProperty = EnemyActor->GetClass()->FindPropertyByName(FName("BaseDamage")); + const int* EnemyBaseDamagePtr = EnemyBaseDamageProperty->ContainerPtrToValuePtr(EnemyActor); + DamagePlayer(*EnemyBaseDamagePtr); + } } else {