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>
77 lines
2.8 KiB
C#
77 lines
2.8 KiB
C#
using Content.Server.Actions;
|
|
using Content.Server.Popups;
|
|
using Content.Server.Stunnable;
|
|
using Content.Shared._EE.Shadowling;
|
|
using Content.Shared.Damage;
|
|
using Content.Shared.Humanoid;
|
|
using Content.Shared.Mobs.Components;
|
|
using Content.Shared.Popups;
|
|
using Content.Shared.Silicon.Components;
|
|
using Content.Shared.Tag;
|
|
using Robust.Server.Audio;
|
|
using Robust.Server.GameObjects;
|
|
|
|
|
|
namespace Content.Server._EE.Shadowling;
|
|
|
|
|
|
/// <summary>
|
|
/// This handles the Sonic Screech ability logic.
|
|
/// Sonic Screech "confuses" and "deafens" (flash effect + tinnitus sound) nearby people, damages windows, and stuns silicons/borgs. All in one pack!
|
|
/// </summary>
|
|
public sealed class ShadowlingSonicScreechSystem : EntitySystem
|
|
{
|
|
/// <inheritdoc/>
|
|
[Dependency] private readonly EntityLookupSystem _lookup = default!;
|
|
[Dependency] private readonly StunSystem _stun = default!;
|
|
[Dependency] private readonly TagSystem _tag = default!;
|
|
[Dependency] private readonly DamageableSystem _damageable = default!;
|
|
[Dependency] private readonly ActionsSystem _actions = default!;
|
|
[Dependency] private readonly PopupSystem _popups = default!;
|
|
[Dependency] private readonly AudioSystem _audio = default!;
|
|
[Dependency] private readonly TransformSystem _transform = default!;
|
|
|
|
public override void Initialize()
|
|
{
|
|
base.Initialize();
|
|
|
|
SubscribeLocalEvent<ShadowlingSonicScreechComponent, SonicScreechEvent>(OnSonicScreech);
|
|
}
|
|
|
|
private void OnSonicScreech(EntityUid uid, ShadowlingSonicScreechComponent component, SonicScreechEvent args)
|
|
{
|
|
_actions.StartUseDelay(args.Action);
|
|
_popups.PopupEntity(Loc.GetString("shadowling-sonic-screech-complete"), uid, uid, PopupType.Medium);
|
|
_audio.PlayPvs(component.ScreechSound, uid);
|
|
|
|
var effectEnt = Spawn(component.SonicScreechEffect, _transform.GetMapCoordinates(uid));
|
|
_transform.SetParent(effectEnt, uid);
|
|
|
|
foreach (var entity in _lookup.GetEntitiesInRange(uid, component.Range))
|
|
{
|
|
if (_tag.HasTag(entity, component.WindowTag) &&
|
|
TryComp<DamageableComponent>(entity, out var damageableComponent))
|
|
{
|
|
_damageable.TryChangeDamage(entity, component.WindowDamage, true, damageable: damageableComponent);
|
|
continue;
|
|
}
|
|
|
|
if (!HasComp<MobStateComponent>(entity))
|
|
continue;
|
|
|
|
if (HasComp<ThrallComponent>(entity) ||
|
|
HasComp<ShadowlingComponent>(entity))
|
|
continue;
|
|
|
|
if (HasComp<SiliconComponent>(entity))
|
|
{
|
|
_stun.TryParalyze(entity, component.SiliconStunTime, false);
|
|
continue;
|
|
}
|
|
|
|
if (HasComp<HumanoidAppearanceComponent>(entity))
|
|
EntityManager.SpawnAtPosition(component.ProtoFlash, Transform(entity).Coordinates);
|
|
}
|
|
}
|
|
}
|