Updated Combat to Change the Chance to Miss Based on Enemy Type
This commit is contained in:
parent
88f73fe5db
commit
aa2f1fabcb
@ -734,7 +734,12 @@ void ATurnBaseCombatV2::EnableButtons() const
|
||||
|
||||
void ATurnBaseCombatV2::EnemyTurn()
|
||||
{
|
||||
if (FMath::RandRange(1, 100) > 30)
|
||||
int ChanceToMiss;
|
||||
FProperty* IsBossProperty = FindFieldChecked<FProperty>(EnemyActor->GetClass(), "IsBoss");
|
||||
const FBoolProperty* IsBossBoolProperty = CastFieldChecked<FBoolProperty>(IsBossProperty);
|
||||
if (IsBossBoolProperty->GetPropertyValue_InContainer(EnemyActor)) ChanceToMiss = 5;
|
||||
else ChanceToMiss = 30;
|
||||
if (FMath::RandRange(1, 100) > ChanceToMiss)
|
||||
{
|
||||
const FProperty* EnemyBaseDamageProperty = EnemyActor->GetClass()->FindPropertyByName(FName("BaseDamage"));
|
||||
const int* EnemyBaseDamageSpeedPtr = EnemyBaseDamageProperty->ContainerPtrToValuePtr<int>(EnemyActor);
|
||||
|
Loading…
Reference in New Issue
Block a user