using Content.Shared.Humanoid; namespace Content.Shared.Height; public sealed class HeightSystem : EntitySystem { public override void Initialize() { base.Initialize(); SubscribeLocalEvent(OnSmallHeightComponentStartup); SubscribeLocalEvent(OnBigHeightComponentStartup); SubscribeLocalEvent(OnSmallHeightComponentShutdown); SubscribeLocalEvent(OnBigHeightComponentShutdown); } private void OnSmallHeightComponentStartup(Entity ent, ref ComponentStartup args) { if (!TryComp(ent, out var humanoid)) return; ent.Comp.LastHeight = humanoid.Height; humanoid.Height = 140.0f; Dirty(ent.Owner, humanoid); } private void OnBigHeightComponentStartup(Entity ent, ref ComponentStartup args) { if (!TryComp(ent, out var humanoid)) return; ent.Comp.LastHeight = humanoid.Height; humanoid.Height = humanoid.Height < 240.0f ? 240.0f : 300.0f; Dirty(ent.Owner, humanoid); } private void OnSmallHeightComponentShutdown(Entity ent, ref ComponentShutdown args) { if (!TryComp(ent, out var humanoid) || ent.Comp.LastHeight == default) return; humanoid.Height = ent.Comp.LastHeight; Dirty(ent.Owner, humanoid); } private void OnBigHeightComponentShutdown(Entity ent, ref ComponentShutdown args) { if (!TryComp(ent, out var humanoid) || ent.Comp.LastHeight == default) return; humanoid.Height = ent.Comp.LastHeight; Dirty(ent.Owner, humanoid); } }