Add simple miss chances for NPCs (#12978)

Doesn't consider juking potential but okay for now.
This commit is contained in:
metalgearsloth
2022-12-12 00:37:09 +11:00
committed by GitHub
parent da31f9e5ee
commit 83fede79eb
6 changed files with 39 additions and 9 deletions

View File

@@ -31,6 +31,7 @@ public sealed class MeleeOperator : HTNOperator
{
base.Startup(blackboard);
var melee = _entManager.EnsureComponent<NPCMeleeCombatComponent>(blackboard.GetValue<EntityUid>(NPCBlackboard.Owner));
melee.MissChance = blackboard.GetValueOrDefault<float>(NPCBlackboard.MeleeMissChance, _entManager);
melee.Target = blackboard.GetValue<EntityUid>(TargetKey);
}