Update butchering popups (#7196)

This commit is contained in:
Leon Friedrich
2022-03-20 07:25:18 +13:00
committed by GitHub
parent e04b4f76c9
commit 8e46b8040e
2 changed files with 16 additions and 8 deletions

View File

@@ -60,11 +60,11 @@ namespace Content.Server.Kitchen.EntitySystems
if(args.Handled) if(args.Handled)
return; return;
if (!Spikeable(uid, args.User, args.Dragged, component))
return;
if (TrySpike(uid, args.User, args.Dragged, component))
args.Handled = true; args.Handled = true;
if (Spikeable(uid, args.User, args.Dragged, component))
TrySpike(uid, args.User, args.Dragged, component);
} }
private void OnInteractHand(EntityUid uid, KitchenSpikeComponent component, InteractHandEvent args) private void OnInteractHand(EntityUid uid, KitchenSpikeComponent component, InteractHandEvent args)
{ {
@@ -170,7 +170,17 @@ namespace Content.Server.Kitchen.EntitySystems
return false; return false;
} }
switch (butcherable.Type)
{
case ButcheringType.Spike:
return true; return true;
case ButcheringType.Knife:
_popupSystem.PopupEntity(Loc.GetString("comp-kitchen-spike-deny-butcher-knife", ("victim", victimUid), ("this", uid)), victimUid, Filter.Entities(userUid));
return false;
default:
_popupSystem.PopupEntity(Loc.GetString("comp-kitchen-spike-deny-butcher", ("victim", victimUid), ("this", uid)), victimUid, Filter.Entities(userUid));
return false;
}
} }
public bool TrySpike(EntityUid uid, EntityUid userUid, EntityUid victimUid, KitchenSpikeComponent? component = null, public bool TrySpike(EntityUid uid, EntityUid userUid, EntityUid victimUid, KitchenSpikeComponent? component = null,
@@ -180,9 +190,6 @@ namespace Content.Server.Kitchen.EntitySystems
!Resolve(victimUid, ref butcherable) || butcherable.BeingButchered) !Resolve(victimUid, ref butcherable) || butcherable.BeingButchered)
return false; return false;
if (butcherable.Type != ButcheringType.Spike)
return false;
// THE WHAT? (again) // THE WHAT? (again)
// Prevent dead from being spiked TODO: Maybe remove when rounds can be played and DOT is implemented // Prevent dead from being spiked TODO: Maybe remove when rounds can be played and DOT is implemented
if (Resolve(victimUid, ref mobState, false) && if (Resolve(victimUid, ref mobState, false) &&

View File

@@ -1,5 +1,6 @@
comp-kitchen-spike-deny-collect = { CAPITALIZE(THE($this)) } already has something on it, finish collecting its meat first! comp-kitchen-spike-deny-collect = { CAPITALIZE(THE($this)) } already has something on it, finish collecting its meat first!
comp-kitchen-spike-deny-butcher = { CAPITALIZE(THE($victim)) } can't be butchered on { THE($this) }. comp-kitchen-spike-deny-butcher = { CAPITALIZE(THE($victim)) } can't be butchered on { THE($this) }.
comp-kitchen-spike-deny-butcher-knife = { CAPITALIZE(THE($victim)) } can't be butchered on { THE($this) }, you need to butcher it using a knife.
comp-kitchen-spike-deny-not-dead = { CAPITALIZE(THE($victim)) } can't be butchered. { CAPITALIZE(SUBJECT($victim)) } { CONJUGATE-BE($victim) } is not dead! comp-kitchen-spike-deny-not-dead = { CAPITALIZE(THE($victim)) } can't be butchered. { CAPITALIZE(SUBJECT($victim)) } { CONJUGATE-BE($victim) } is not dead!
comp-kitchen-spike-begin-hook-victim = { THE($user) } begins dragging you onto { THE($this) }! comp-kitchen-spike-begin-hook-victim = { THE($user) } begins dragging you onto { THE($this) }!