Exposed Base Damage for Enemies

This commit is contained in:
Philip W 2023-05-11 04:12:00 +01:00
parent dc9e149381
commit 53126c6b10
4 changed files with 12 additions and 7 deletions

BIN
Content/BlueprintAI/AI/AIBruh.uasset (Stored with Git LFS)

Binary file not shown.

BIN
Content/BlueprintAI/AI/AIBruh_Boss.uasset (Stored with Git LFS)

Binary file not shown.

BIN
Content/Levels/Build.umap (Stored with Git LFS)

Binary file not shown.

View File

@ -734,7 +734,12 @@ void ATurnBaseCombatV2::EnableButtons() const
void ATurnBaseCombatV2::EnemyTurn()
{
if (FMath::RandRange(1, 100) > 30) DamagePlayer(10);
if (FMath::RandRange(1, 100) > 30)
{
const FProperty* EnemyBaseDamageProperty = EnemyActor->GetClass()->FindPropertyByName(FName("BaseDamage"));
const int* EnemyBaseDamageSpeedPtr = EnemyBaseDamageProperty->ContainerPtrToValuePtr<int>(EnemyActor);
DamagePlayer(*EnemyBaseDamageSpeedPtr);
}
else
{
StatusTextBlock->SetText(FText::FromString("Missed"));