Fix monkey kitchen spike dragdrop (#3450)

* Fix monkey kitchen spike dragdrop

I also aligned the behavior with tg (need combat mode on + mob alive).
It still needs to do damage over time and buckle the target but baby steps.

* Cleanup

* Fix kitchenspike layers

Co-authored-by: Metal Gear Sloth <metalgearsloth@gmail.com>
This commit is contained in:
metalgearsloth
2021-03-08 21:24:34 +11:00
committed by GitHub
parent 0a6a23b86f
commit 362c6de742
7 changed files with 72 additions and 55 deletions

View File

@@ -5,6 +5,7 @@ using Content.Server.GameObjects.EntitySystems.DoAfter;
using Content.Server.Interfaces.Chat;
using Content.Server.Interfaces.GameObjects;
using Content.Server.Utility;
using Content.Shared.GameObjects.Components.Nutrition;
using Content.Shared.Interfaces;
using Content.Shared.Interfaces.GameObjects.Components;
using Content.Shared.Kitchen;
@@ -69,7 +70,7 @@ namespace Content.Server.GameObjects.Components.Kitchen
return true;
}
private bool Spikeable(IEntity user, IEntity victim, [NotNullWhen(true)] out ButcherableComponent? butcherable)
private bool Spikeable(IEntity user, IEntity victim, [NotNullWhen(true)] out SharedButcherableComponent? butcherable)
{
butcherable = null;
@@ -93,7 +94,7 @@ namespace Content.Server.GameObjects.Components.Kitchen
var victimUid = victim.Uid;
if (_beingButchered.Contains(victimUid)) return;
ButcherableComponent? butcherable;
SharedButcherableComponent? butcherable;
if (!Spikeable(user, victim, out butcherable)) return;
@@ -143,8 +144,11 @@ namespace Content.Server.GameObjects.Components.Kitchen
}
Owner.PopupMessageEveryone(Loc.GetString("{0:theName} has forced {1:theName} onto the spike, killing them instantly!", user, victim));
// TODO: Need to be able to leave them on the spike to do DoT, see ss13.
victim.Delete();
return;
if (SpikeSound != null)
EntitySystem.Get<AudioSystem>().PlayFromEntity(SpikeSound, Owner);
}
SuicideKind ISuicideAct.Suicide(IEntity victim, IChatManager chat)