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

@@ -261,6 +261,11 @@ public abstract class SharedMeleeWeaponSystem : EntitySystem
return null;
}
public void AttemptLightAttackMiss(EntityUid user, MeleeWeaponComponent weapon, EntityCoordinates coordinates)
{
AttemptAttack(user, weapon, new LightAttackEvent(null, weapon.Owner, coordinates), null);
}
public void AttemptLightAttack(EntityUid user, MeleeWeaponComponent weapon, EntityUid target)
{
if (!TryComp<TransformComponent>(target, out var targetXform))