mirror of
https://github.com/WWhiteDreamProject/wwdpublic.git
synced 2026-04-18 14:07:53 +03:00
<!-- This is a semi-strict format, you can add/remove sections as needed but the order/format should be kept the same Remove these comments before submitting --> <!-- Explain this PR in as much detail as applicable Some example prompts to consider: How might this affect the game? The codebase? What might be some alternatives to this? How/Who does this benefit/hurt [the game/codebase]? --> This PR ports https://github.com/Goob-Station/Goob-Station/pull/2409 https://github.com/Goob-Station/Goob-Station/pull/2591 https://github.com/Goob-Station/Goob-Station/pull/2599 This PR was initially intended to be merged into White Dream repo, so my changes are marked as WD edit. <!-- A list of everything you have to do before this PR is "complete" You probably won't have to complete everything before merging but it's good to leave future references --> - [ ] Port pain numbness - [ ] Port nullrods - [ ] Port tile movement --- <!-- This is default collapsed, readers click to expand it and see all your media The PR media section can get very large at times, so this is a good way to keep it clean The title is written using HTML tags The title must be within the <summary> tags or you won't see it --> <details><summary><h1>Media</h1></summary> <p>     </p> </details> --- <!-- You can add an author after the `🆑` to change the name that appears in the changelog (ex: `🆑 Death`) Leaving it blank will default to your GitHub display name This includes all available types for the changelog --> 🆑 - add: Ported Devil antag from Goobstation --------- Signed-off-by: Kai5 <68296202+Kai518@users.noreply.github.com> Signed-off-by: VMSolidus <evilexecutive@gmail.com> Co-authored-by: Solstice <solsticeofthewinter@gmail.com> Co-authored-by: VMSolidus <evilexecutive@gmail.com>
80 lines
3.1 KiB
C#
80 lines
3.1 KiB
C#
// SPDX-FileCopyrightText: 2025 GoobBot <uristmchands@proton.me>
|
|
// SPDX-FileCopyrightText: 2025 Solstice <solsticeofthewinter@gmail.com>
|
|
// SPDX-FileCopyrightText: 2025 SolsticeOfTheWinter <solsticeofthewinter@gmail.com>
|
|
// SPDX-FileCopyrightText: 2025 TheBorzoiMustConsume <197824988+TheBorzoiMustConsume@users.noreply.github.com>
|
|
//
|
|
// SPDX-License-Identifier: AGPL-3.0-or-later
|
|
|
|
using Content.Shared._Goobstation.Devil;
|
|
using Content.Shared._Goobstation.Religion;
|
|
using Content.Server.Chat.Systems;
|
|
using Content.Server.Speech.EntitySystems;
|
|
using Content.Shared.Actions;
|
|
using Content.Shared.Chat;
|
|
using Content.Shared.Damage.Systems;
|
|
using Content.Shared.Interaction;
|
|
using Content.Shared.StatusEffect;
|
|
using Content.Shared.Stunnable;
|
|
using Content.Shared.Whitelist;
|
|
using Robust.Shared.Audio.Systems;
|
|
|
|
namespace Content.Server._Goobstation.Devil.Grip;
|
|
|
|
public sealed class DevilGripSystem : EntitySystem
|
|
{
|
|
[Dependency] private readonly StaminaSystem _stamina = default!;
|
|
[Dependency] private readonly SharedStunSystem _stun = default!;
|
|
[Dependency] private readonly SharedAudioSystem _audio = default!;
|
|
[Dependency] private readonly ChatSystem _chat = default!;
|
|
[Dependency] private readonly RatvarianLanguageSystem _language = default!;
|
|
[Dependency] private readonly EntityWhitelistSystem _whitelist = default!;
|
|
[Dependency] private readonly SharedActionsSystem _actions = default!;
|
|
[Dependency] private readonly DivineInterventionSystem _divineIntervention = default!;
|
|
|
|
public override void Initialize()
|
|
{
|
|
base.Initialize();
|
|
|
|
SubscribeLocalEvent<DevilGripComponent, AfterInteractEvent>(OnAfterInteract);
|
|
}
|
|
|
|
private void OnAfterInteract(Entity<DevilGripComponent> ent, ref AfterInteractEvent args)
|
|
{
|
|
if (!args.CanReach
|
|
|| args.Target is not { } target
|
|
|| args.Target == args.User
|
|
|| _whitelist.IsBlacklistPass(ent.Comp.Blacklist, target)
|
|
|| !TryComp<DevilComponent>(args.User, out var devilComp))
|
|
return;
|
|
|
|
if (_divineIntervention.ShouldDeny(target))
|
|
{
|
|
_actions.SetCooldown(devilComp.DevilGrip, ent.Comp.CooldownAfterUse);
|
|
devilComp.DevilGrip = null;
|
|
InvokeGrasp(args.User, ent);
|
|
QueueDel(ent);
|
|
args.Handled = true;
|
|
return;
|
|
}
|
|
|
|
if (TryComp(target, out StatusEffectsComponent? status))
|
|
{
|
|
_stun.TryStun(target, ent.Comp.KnockdownTime, true, status);
|
|
_stamina.TakeStaminaDamage(target, ent.Comp.StaminaDamage);
|
|
_language.DoRatvarian(target, ent.Comp.SpeechTime, true, status);
|
|
}
|
|
|
|
_actions.SetCooldown(devilComp.DevilGrip, ent.Comp.CooldownAfterUse);
|
|
devilComp.DevilGrip = null;
|
|
InvokeGrasp(args.User, ent);
|
|
QueueDel(ent);
|
|
args.Handled = true;
|
|
}
|
|
|
|
public void InvokeGrasp(EntityUid user, Entity<DevilGripComponent> ent)
|
|
{
|
|
_audio.PlayPvs(ent.Comp.Sound, user);
|
|
_chat.TrySendInGameICMessage(user, Loc.GetString(ent.Comp.Invocation), InGameICChatType.Speak, false);
|
|
}
|
|
}
|