mirror of
https://github.com/WWhiteDreamProject/wwdpublic.git
synced 2026-05-02 04:57:17 +03:00
<!-- 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]? --> Ports Shadowlings from SS13 to SS14 with a remake to make them fun to play. Minimal Design Doc (not up-to-date, read comments in this repo for updates): https://github.com/Lumminal/SS14-Design-Docs-Lumminal/blob/main/Shadowling.md --- - Abilities - [X] Hatch - [x] Glare - [X] Enthrall - [x] Veil - [x] Shadow Walk - [x] Icy Veins - [x] Collective Mind - [x] Rapid Re-Hatch - [x] Destroy Engines - [x] Sonic Screech - [x] Blindness Smoke - [x] Null Charge - [x] Black Recuperation - [x] Empowered Enthrall - [x] Nox Imperii - [x] Ascension - [x] Annihilate - [x] Hypnosis - [x] Plane-Shift - [x] Lighting Storm - [x] Ascendant Broadcast - Antags - [X] Thrall - [x] Guise - [x] Thrall Darksight - [x] Lesser Shadowling - Passive - [x] Light Resistance Scaling - [x] Shadowmind - [x] Damage on Light - Other - [x] Sounds - [x] Sprites - [x] Psionic Interactions - [x] Handle Edge Cases --- <details><summary><h1>Media</h1></summary> <p> https://www.youtube.com/watch?v=H-Ee5wuRINc </p> </details> --- 🆑 - add: The shadows have awakened, and their ascendance is soon to follow. Do not enter maints. --------- Signed-off-by: Lumminal <81829924+Lumminal@users.noreply.github.com>
72 lines
2.4 KiB
C#
72 lines
2.4 KiB
C#
using Content.Server.Actions;
|
|
using Content.Server.DoAfter;
|
|
using Content.Server.Popups;
|
|
using Content.Shared._EE.Shadowling;
|
|
using Content.Shared.DoAfter;
|
|
using Content.Shared.Popups;
|
|
|
|
|
|
namespace Content.Server._EE.Shadowling;
|
|
|
|
|
|
/// <summary>
|
|
/// This handles Empowered Enthrall.
|
|
/// Empowered enthrall is like the basic enthrall, however it can bypass Mindshields, has slightly longer range.
|
|
/// It also takes less time to enthrall someone.
|
|
/// </summary>
|
|
public sealed class ShadowlingEmpoweredEnthrallSystem : EntitySystem
|
|
{
|
|
[Dependency] private readonly DoAfterSystem _doAfter = default!;
|
|
[Dependency] private readonly ShadowlingSystem _shadowling = default!;
|
|
[Dependency] private readonly PopupSystem _popup = default!;
|
|
[Dependency] private readonly ActionsSystem _actions = default!;
|
|
|
|
/// <inheritdoc/>
|
|
public override void Initialize()
|
|
{
|
|
base.Initialize();
|
|
|
|
SubscribeLocalEvent<ShadowlingEmpoweredEnthrallComponent, EmpoweredEnthrallEvent>(OnEmpEnthrall);
|
|
SubscribeLocalEvent<ShadowlingEmpoweredEnthrallComponent, EmpoweredEnthrallDoAfterEvent>(OnEmpEnthrallDoAfter);
|
|
|
|
SubscribeLocalEvent<ShadowlingEmpoweredEnthrallComponent, ComponentStartup>(OnStartup);
|
|
}
|
|
|
|
private void OnStartup(EntityUid uid, ShadowlingEmpoweredEnthrallComponent component, ComponentStartup args)
|
|
{
|
|
// We no longer need the previous Enthrall
|
|
if (!TryComp<ShadowlingComponent>(uid, out var sling))
|
|
return;
|
|
_actions.RemoveAction(uid, sling.ActionEnthrallEntity);
|
|
RemComp<ShadowlingEnthrallComponent>(uid);
|
|
}
|
|
|
|
private void OnEmpEnthrall(EntityUid uid, ShadowlingEmpoweredEnthrallComponent component, EmpoweredEnthrallEvent args)
|
|
{
|
|
var target = args.Target;
|
|
var doAfterArgs = new DoAfterArgs(
|
|
EntityManager,
|
|
uid,
|
|
component.EnthrallTime,
|
|
new EmpoweredEnthrallDoAfterEvent(),
|
|
uid,
|
|
target)
|
|
{
|
|
CancelDuplicate = true,
|
|
BreakOnDamage = true,
|
|
};
|
|
|
|
if (!_shadowling.CanEnthrall(uid, target))
|
|
return;
|
|
|
|
_popup.PopupEntity(Loc.GetString("shadowling-target-being-thralled"), uid, target, PopupType.SmallCaution);
|
|
|
|
_doAfter.TryStartDoAfter(doAfterArgs);
|
|
}
|
|
|
|
private void OnEmpEnthrallDoAfter(EntityUid uid, ShadowlingEmpoweredEnthrallComponent component, EmpoweredEnthrallDoAfterEvent args)
|
|
{
|
|
_shadowling.DoEnthrall(uid, args);
|
|
}
|
|
}
|