mirror of
https://github.com/WWhiteDreamProject/wwdpublic.git
synced 2026-04-23 16:48:10 +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>
73 lines
2.9 KiB
C#
73 lines
2.9 KiB
C#
using Content.Shared._Goobstation.Devil;
|
|
using Content.Shared._Goobstation.Devil.Contract;
|
|
using Content.Shared._Goobstation.Exorcism;
|
|
using Content.Shared._Goobstation.Religion;
|
|
using Content.Server.Bible.Components;
|
|
using Content.Shared.Damage;
|
|
using Content.Shared.DoAfter;
|
|
using Content.Shared.Interaction;
|
|
using Content.Shared.Mobs.Systems;
|
|
using Content.Shared.Popups;
|
|
using Content.Shared.Stunnable;
|
|
using Content.Shared.Timing;
|
|
using Robust.Shared.Audio.Systems;
|
|
|
|
namespace Content.Shared._Goobstation.Bible;
|
|
|
|
public sealed partial class GoobBibleSystem : EntitySystem
|
|
{
|
|
[Dependency] private readonly DamageableSystem _damageableSystem = default!;
|
|
[Dependency] private readonly MobStateSystem _mobStateSystem = default!;
|
|
[Dependency] private readonly SharedPopupSystem _popupSystem = default!;
|
|
[Dependency] private readonly SharedAudioSystem _audio = default!;
|
|
[Dependency] private readonly UseDelaySystem _delay = default!;
|
|
[Dependency] private readonly SharedStunSystem _stun = default!;
|
|
[Dependency] private readonly SharedDoAfterSystem _doAfter = default!;
|
|
|
|
public void TryDoSmite(EntityUid uid, BibleComponent component, AfterInteractUsingEvent args, UseDelayComponent useDelay)
|
|
{
|
|
if (args.Target is not { } target || !HasComp<WeakToHolyComponent>(args.Target) || !HasComp<BibleUserComponent>(args.User))
|
|
return;
|
|
|
|
var multiplier = 1f;
|
|
var isDevil = false;
|
|
|
|
if (TryComp<DevilComponent>(target, out var devil))
|
|
{
|
|
isDevil = true;
|
|
multiplier = devil.BibleUserDamageMultiplier;
|
|
}
|
|
|
|
if (!_mobStateSystem.IsIncapacitated(target))
|
|
{
|
|
var popup = Loc.GetString("weaktoholy-component-bible-sizzle", ("target", target), ("item", args.Used));
|
|
_popupSystem.PopupEntity(popup, target, PopupType.LargeCaution);
|
|
_audio.PlayPvs(component.SizzleSoundPath, args.Target.Value);
|
|
|
|
_damageableSystem.TryChangeDamage(target, component.SmiteDamage * multiplier, true, origin: uid);
|
|
_stun.TryParalyze(target, component.SmiteStunDuration * multiplier, false);
|
|
_delay.TryResetDelay((args.Used, useDelay));
|
|
}
|
|
else if (isDevil && HasComp<BibleUserComponent>(args.User))
|
|
{
|
|
var doAfterArgs = new DoAfterArgs(
|
|
EntityManager,
|
|
args.User,
|
|
10f,
|
|
new ExorcismDoAfterEvent(),
|
|
eventTarget: target,
|
|
target: target)
|
|
{
|
|
BreakOnMove = true,
|
|
NeedHand = true,
|
|
BlockDuplicate = true,
|
|
BreakOnDropItem = true,
|
|
};
|
|
|
|
_doAfter.TryStartDoAfter(doAfterArgs);
|
|
var popup = Loc.GetString("devil-banish-begin", ("target", target), ("user", target));
|
|
_popupSystem.PopupEntity(popup, target, PopupType.LargeCaution);
|
|
}
|
|
}
|
|
}
|