mirror of
https://github.com/WWhiteDreamProject/wwdpublic.git
synced 2026-04-18 14:07:53 +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>
100 lines
3.5 KiB
C#
100 lines
3.5 KiB
C#
using Content.Server.Polymorph.Systems;
|
|
using Content.Server.Popups;
|
|
using Content.Server.Storage.Components;
|
|
using Content.Server.Storage.EntitySystems;
|
|
using Content.Shared._EE.Shadowling;
|
|
using Content.Shared.Popups;
|
|
using Robust.Server.Audio;
|
|
using Robust.Shared.Audio;
|
|
using Robust.Shared.Timing;
|
|
|
|
|
|
namespace Content.Server._EE.Shadowling;
|
|
|
|
|
|
/// <summary>
|
|
/// This handles the hatching process
|
|
/// </summary>
|
|
///
|
|
public sealed class ShadowlingEggHatchSystem : EntitySystem
|
|
{
|
|
[Dependency] private readonly PolymorphSystem _polymorph = default!;
|
|
[Dependency] private readonly IGameTiming _timing = default!;
|
|
[Dependency] private readonly EntityStorageSystem _entityStorage = default!;
|
|
[Dependency] private readonly PopupSystem _popupSystem = default!;
|
|
[Dependency] private readonly AudioSystem _audio = default!;
|
|
|
|
public override void Update(float frameTime)
|
|
{
|
|
base.Update(frameTime);
|
|
|
|
if (!_timing.IsFirstTimePredicted)
|
|
return;
|
|
|
|
var query = EntityQueryEnumerator<HatchingEggComponent>();
|
|
while (query.MoveNext(out var uid, out var comp))
|
|
{
|
|
var shadowlingInside = comp.ShadowlingInside;
|
|
|
|
if (shadowlingInside != null)
|
|
{
|
|
var sUid = shadowlingInside.Value;
|
|
if (comp.CooldownTimer <= 12 && !comp.HasFirstMessageAppeared)
|
|
{
|
|
_popupSystem.PopupEntity(Loc.GetString("sling-hatch-first"), uid, sUid, PopupType.Medium);
|
|
_audio.PlayPvs(comp.CrackFirst, uid, AudioParams.Default.WithVolume(-2f));
|
|
comp.HasFirstMessageAppeared = true;
|
|
}
|
|
|
|
if (comp.CooldownTimer <= 7 && !comp.HasSecondMessageAppeared)
|
|
{
|
|
_popupSystem.PopupEntity(Loc.GetString("sling-hatch-second"), uid, sUid, PopupType.Medium);
|
|
_audio.PlayPvs(comp.CrackSecond, uid, AudioParams.Default.WithVolume(-2f));
|
|
comp.HasSecondMessageAppeared = true;
|
|
}
|
|
|
|
if (comp.CooldownTimer <= 3 && !comp.HasThirdMessageAppeared)
|
|
{
|
|
_popupSystem.PopupEntity(Loc.GetString("sling-hatch-third"), uid, sUid, PopupType.Medium);
|
|
_audio.PlayPvs(comp.CrackFirst, uid, AudioParams.Default.WithVolume(-2f).WithPitchScale(2f));
|
|
comp.HasThirdMessageAppeared = true;
|
|
}
|
|
|
|
|
|
comp.CooldownTimer -= frameTime;
|
|
if (comp.CooldownTimer <= 0)
|
|
Cycle(sUid, uid, comp);
|
|
}
|
|
}
|
|
}
|
|
|
|
public void Cycle(EntityUid sling, EntityUid egg, HatchingEggComponent comp)
|
|
{
|
|
if (comp.HasBeenHatched)
|
|
return;
|
|
|
|
if (!TryComp<ShadowlingComponent>(sling, out var shadowling))
|
|
return;
|
|
|
|
_audio.PlayPvs(comp.CrackThird, egg, AudioParams.Default.WithVolume(-2f));
|
|
|
|
// Remove sling from egg
|
|
if (TryComp<EntityStorageComponent>(egg, out var storage))
|
|
{
|
|
_entityStorage.Remove(sling, egg, storage);
|
|
_entityStorage.OpenStorage(egg, storage);
|
|
}
|
|
|
|
var newUid = _polymorph.PolymorphEntity(sling, shadowling.ShadowlingPolymorphId);
|
|
if (newUid == null)
|
|
return;
|
|
|
|
var ascendantShadowlingComp = EntityManager.GetComponent<ShadowlingComponent>(newUid.Value);
|
|
var shadowlingSystem = EntityManager.System<ShadowlingSystem>();
|
|
|
|
shadowlingSystem.OnPhaseChanged(newUid.Value, ascendantShadowlingComp, ShadowlingPhases.PostHatch);
|
|
|
|
comp.HasBeenHatched = true;
|
|
}
|
|
}
|