mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-10-09 10:21:18 +03:00
Add check if mouth is covered for changeling devour (#44677)
* no more eating in solars * forgor to remove unused import * address review * clean --------- Co-authored-by: ScarKy0 <scarky0@onet.eu>
This commit is contained in:
parent
9752cf5239
commit
1bb82f6fa0
3 changed files with 14 additions and 2 deletions
|
|
@ -58,12 +58,23 @@ public sealed partial class IngestionSystem
|
|||
return AttemptIngest(user, user, ingested, false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Check if the action user has an unblocked mouth.
|
||||
/// </summary>
|
||||
/// <param name="user">The mouth action's user to check</param>
|
||||
/// <param name="flags">The slots to check that are not being blocked.</param>
|
||||
/// <returns>True if the user has a free mouth, otherwise False</returns>
|
||||
public bool HasMouthAvailable(EntityUid user, SlotFlags flags = DefaultFlags)
|
||||
{
|
||||
return HasMouthAvailable(user, user, flags);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Check whether we have an open pie-hole that's in range.
|
||||
/// </summary>
|
||||
/// <param name="user">The one performing the action</param>
|
||||
/// <param name="target">The target whose mouth is checked</param>
|
||||
/// <returns></returns>
|
||||
/// <returns>True if the user has a free mouth that can reach the target, otherwise False</returns>
|
||||
public bool HasMouthAvailable(EntityUid user, EntityUid target)
|
||||
{
|
||||
return HasMouthAvailable(user, target, DefaultFlags);
|
||||
|
|
|
|||
|
|
@ -543,7 +543,7 @@ public sealed partial class IngestionSystem : EntitySystem
|
|||
|
||||
private void OnMouthUncoveredActionAttempt(Entity<ActionRequireMouthUncoveredComponent> ent, ref ActionAttemptEvent args)
|
||||
{
|
||||
if (!HasMouthAvailable(args.User, args.User, ent.Comp.Slots))
|
||||
if (!HasMouthAvailable(args.User, ent.Comp.Slots))
|
||||
args.Cancelled = true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -47,6 +47,7 @@
|
|||
iconOn: { sprite : Interface/Actions/changeling.rsi, state: "devour_on" }
|
||||
itemIconStyle: BigAction
|
||||
priority: 1
|
||||
- type: ActionRequireMouthUncovered
|
||||
- type: TargetAction
|
||||
- type: EntityTargetAction
|
||||
event: !type:ChangelingDevourActionEvent
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue