From 3ed6a528ceebbaf0d1ea021c12db36c44e69f79e Mon Sep 17 00:00:00 2001 From: SkaldetSkaeg Date: Tue, 10 Dec 2024 20:00:16 +0700 Subject: [PATCH] add new sprite --- .../MiGo/CultYoggHealVisualizerSystem.cs | 49 ++++++++++++++++++ .../SS220/CultYogg/MiGo/CultYoggHealSystem.cs | 12 ++--- .../SS220/CultYogg/Rave/RaveSystem.cs | 6 +-- .../EntityEffects/Effects/ChemMiGomicelium.cs | 2 +- .../CultYogg/MiGo/CultYoggHealComponent.cs | 8 ++- .../SS220/CultYogg/MiGo/MiGoComponent.cs | 2 +- .../CultYogg/MiGo/SharedCultYoggHealSystem.cs | 6 +-- .../CultYogg/Pod/CultYoggPodComponent.cs | 2 +- Resources/Prototypes/SS220/CultYogg/pond.yml | 5 +- .../cult_yogg_healing.rsi/healingEffect.png | Bin 0 -> 3480 bytes .../Effects/cult_yogg_healing.rsi/meta.json | 49 ++++++++++++++++++ .../CultYogg/yoggaltar.rsi/meta.json | 4 +- .../Structures/CultYogg/yoggpod.rsi/meta.json | 4 +- .../CultYogg/yoggpond.rsi/meta.json | 14 +++++ .../Structures/CultYogg/yoggpond.rsi/pond.png | Bin 0 -> 1009 bytes 15 files changed, 139 insertions(+), 24 deletions(-) create mode 100644 Content.Client/SS220/CultYogg/MiGo/CultYoggHealVisualizerSystem.cs create mode 100644 Resources/Textures/SS220/Effects/cult_yogg_healing.rsi/healingEffect.png create mode 100644 Resources/Textures/SS220/Effects/cult_yogg_healing.rsi/meta.json create mode 100644 Resources/Textures/SS220/Structures/CultYogg/yoggpond.rsi/meta.json create mode 100644 Resources/Textures/SS220/Structures/CultYogg/yoggpond.rsi/pond.png diff --git a/Content.Client/SS220/CultYogg/MiGo/CultYoggHealVisualizerSystem.cs b/Content.Client/SS220/CultYogg/MiGo/CultYoggHealVisualizerSystem.cs new file mode 100644 index 00000000000000..cf8abdff46d6ee --- /dev/null +++ b/Content.Client/SS220/CultYogg/MiGo/CultYoggHealVisualizerSystem.cs @@ -0,0 +1,49 @@ +using Content.Shared.SS220.CultYogg.MiGo; +using Robust.Client.GameObjects; + +namespace Content.Client.SS220.CultYogg.MiGo; + +/// +/// +public sealed class CultYoggHealVisualizerSystem : VisualizerSystem +{ + public override void Initialize() + { + base.Initialize(); + + SubscribeLocalEvent(OnComponentInit); + SubscribeLocalEvent(OnShutdown); + } + + private void OnShutdown(Entity uid, ref ComponentShutdown args) + { + // Need LayerMapTryGet because Init fails if there's no existing sprite / appearancecomp + // which means in some setups (most frequently no AppearanceComp) the layer never exists. + if (TryComp(uid, out var sprite) && + sprite.LayerMapTryGet(HealVisualLayers.Particles, out var layer)) + { + sprite.RemoveLayer(layer); + } + } + + private void OnComponentInit(Entity uid, ref ComponentInit args) + { + if (!TryComp(uid, out var sprite) || !TryComp(uid, out AppearanceComponent? appearance)) + return; + + sprite.LayerMapReserveBlank(HealVisualLayers.Particles); + sprite.LayerSetVisible(HealVisualLayers.Particles, true); + sprite.LayerSetShader(HealVisualLayers.Particles, "unshaded"); + + if (uid.Comp.Sprite != null) + { + sprite.LayerSetRSI(HealVisualLayers.Particles, uid.Comp.Sprite.RsiPath); + sprite.LayerSetState(HealVisualLayers.Particles, uid.Comp.Sprite.RsiState); + } + } +} + +public enum HealVisualLayers : byte +{ + Particles +} diff --git a/Content.Server/SS220/CultYogg/MiGo/CultYoggHealSystem.cs b/Content.Server/SS220/CultYogg/MiGo/CultYoggHealSystem.cs index 575f6338819732..b7b4dbc912d259 100644 --- a/Content.Server/SS220/CultYogg/MiGo/CultYoggHealSystem.cs +++ b/Content.Server/SS220/CultYogg/MiGo/CultYoggHealSystem.cs @@ -11,6 +11,7 @@ using Content.Shared.Mobs.Systems; using Content.Shared.Popups; using Content.Shared.SS220.CultYogg.MiGo; +using Robust.Shared.Timing; namespace Content.Server.SS220.CultYogg.MiGo; @@ -24,6 +25,7 @@ public sealed class CultYoggHealSystem : SharedCultYoggHealSystem [Dependency] private readonly MobThresholdSystem _mobThreshold = default!; [Dependency] private readonly PopupSystem _popup = default!; [Dependency] private readonly SharedMindSystem _mind = default!; + [Dependency] private readonly IGameTiming _time = default!; public override void Initialize() { @@ -33,23 +35,21 @@ public override void Initialize() } private void SetupMiGoHeal(Entity uid, ref ComponentStartup args) { - uid.Comp.NextIncidentTime = uid.Comp.TimeBetweenIncidents; + uid.Comp.NextIncidentTime = _time.CurTime + uid.Comp.TimeBetweenIncidents; } - public override void Update(float frameTime)//ToDo rewrite as Timespan + public override void Update(float frameTime) { base.Update(frameTime); var query = EntityQueryEnumerator(); while (query.MoveNext(out var uid, out var healComp, out var _)) { - healComp.NextIncidentTime -= frameTime; - - if (healComp.NextIncidentTime > 0) + if (healComp.NextIncidentTime > _time.CurTime) continue; Heal(uid, healComp); - healComp.NextIncidentTime += healComp.TimeBetweenIncidents; + healComp.NextIncidentTime = _time.CurTime + healComp.TimeBetweenIncidents; } } public void Heal(EntityUid uid, CultYoggHealComponent component) diff --git a/Content.Server/SS220/CultYogg/Rave/RaveSystem.cs b/Content.Server/SS220/CultYogg/Rave/RaveSystem.cs index e6f062e9593b34..febdfc56ecbe64 100644 --- a/Content.Server/SS220/CultYogg/Rave/RaveSystem.cs +++ b/Content.Server/SS220/CultYogg/Rave/RaveSystem.cs @@ -71,18 +71,18 @@ private void OnExamined(Entity uid, ref ExaminedEvent args) args.PushMarkup($"[color=green]{Loc.GetString("cult-yogg-shroom-markup", ("ent", uid))}[/color]"); } - public void TryApplyRavenness(EntityUid uid, float time, StatusEffectsComponent? status = null) + public void TryApplyRavenness(EntityUid uid, TimeSpan time, StatusEffectsComponent? status = null) { if (!Resolve(uid, ref status, false)) return; if (!_statusEffectsSystem.HasStatusEffect(uid, EffectKey, status)) { - _statusEffectsSystem.TryAddStatusEffect(uid, EffectKey, TimeSpan.FromSeconds(time), true, status); + _statusEffectsSystem.TryAddStatusEffect(uid, EffectKey, time, true, status); } else { - _statusEffectsSystem.TryAddTime(uid, EffectKey, TimeSpan.FromSeconds(time), status); + _statusEffectsSystem.TryAddTime(uid, EffectKey, time, status); } } diff --git a/Content.Server/SS220/EntityEffects/Effects/ChemMiGomicelium.cs b/Content.Server/SS220/EntityEffects/Effects/ChemMiGomicelium.cs index 85eb85902b41af..e1f504518ddb98 100644 --- a/Content.Server/SS220/EntityEffects/Effects/ChemMiGomicelium.cs +++ b/Content.Server/SS220/EntityEffects/Effects/ChemMiGomicelium.cs @@ -50,7 +50,7 @@ public override void Effect(EntityEffectBaseArgs args) if (entityManager.HasComponent(args.TargetEntity)) { - entityManager.System().TryApplyRavenness(args.TargetEntity, time); + entityManager.System().TryApplyRavenness(args.TargetEntity, TimeSpan.FromSeconds(time)); } } //ToDo check the guidebook diff --git a/Content.Shared/SS220/CultYogg/MiGo/CultYoggHealComponent.cs b/Content.Shared/SS220/CultYogg/MiGo/CultYoggHealComponent.cs index 12c43675ccbeca..bcca8c0054a3fc 100644 --- a/Content.Shared/SS220/CultYogg/MiGo/CultYoggHealComponent.cs +++ b/Content.Shared/SS220/CultYogg/MiGo/CultYoggHealComponent.cs @@ -2,6 +2,7 @@ using Robust.Shared.GameStates; using System.Text.Json.Serialization; using Content.Shared.Damage; +using Robust.Shared.Utility; namespace Content.Shared.SS220.CultYogg.MiGo; @@ -33,7 +34,10 @@ public sealed partial class CultYoggHealComponent : Component /// /// Time between each healing incident /// - public float TimeBetweenIncidents = 2.5f; // most balanced value + public TimeSpan TimeBetweenIncidents = TimeSpan.FromSeconds(2.5); // most balanced value - public float NextIncidentTime;//ToDo make it timespan + public TimeSpan? NextIncidentTime; + + [DataField("sprite")] + public SpriteSpecifier.Rsi Sprite = new(new("SS220/Effects/cult_yogg_healing.rsi"), "healingEffect"); } diff --git a/Content.Shared/SS220/CultYogg/MiGo/MiGoComponent.cs b/Content.Shared/SS220/CultYogg/MiGo/MiGoComponent.cs index 81b15ea0f8a121..0fd369064e0f67 100644 --- a/Content.Shared/SS220/CultYogg/MiGo/MiGoComponent.cs +++ b/Content.Shared/SS220/CultYogg/MiGo/MiGoComponent.cs @@ -60,7 +60,7 @@ public sealed partial class MiGoComponent : Component /// ///Erect variables /// - public float HealingEffectTime = 15;//How long heal effect will occure + public TimeSpan HealingEffectTime = TimeSpan.FromSeconds(15);//How long heal effect will occure /// ///Erect variables diff --git a/Content.Shared/SS220/CultYogg/MiGo/SharedCultYoggHealSystem.cs b/Content.Shared/SS220/CultYogg/MiGo/SharedCultYoggHealSystem.cs index bce04731d7d49f..dce9febd961d8e 100644 --- a/Content.Shared/SS220/CultYogg/MiGo/SharedCultYoggHealSystem.cs +++ b/Content.Shared/SS220/CultYogg/MiGo/SharedCultYoggHealSystem.cs @@ -14,18 +14,18 @@ public override void Initialize() { base.Initialize(); } - public void TryApplyMiGoHeal(EntityUid uid, float time, StatusEffectsComponent? statusComp = null) + public void TryApplyMiGoHeal(EntityUid uid, TimeSpan time, StatusEffectsComponent? statusComp = null) { if (!Resolve(uid, ref statusComp, false)) return; if (!_statusEffectsSystem.HasStatusEffect(uid, EffectkKey, statusComp)) { - _statusEffectsSystem.TryAddStatusEffect(uid, EffectkKey, TimeSpan.FromSeconds(time), true, statusComp); + _statusEffectsSystem.TryAddStatusEffect(uid, EffectkKey, time, true, statusComp); } else { - _statusEffectsSystem.TryAddTime(uid, EffectkKey, TimeSpan.FromSeconds(time), statusComp); + _statusEffectsSystem.TryAddTime(uid, EffectkKey, time, statusComp); } } diff --git a/Content.Shared/SS220/CultYogg/Pod/CultYoggPodComponent.cs b/Content.Shared/SS220/CultYogg/Pod/CultYoggPodComponent.cs index e3e26ff0a87c44..49267fcaf27ad5 100644 --- a/Content.Shared/SS220/CultYogg/Pod/CultYoggPodComponent.cs +++ b/Content.Shared/SS220/CultYogg/Pod/CultYoggPodComponent.cs @@ -13,7 +13,7 @@ public sealed partial class CultYoggPodComponent : Component /// Time between each healing incident /// [DataField] - public float HealingFreq = 0.5f; + public TimeSpan HealingFreq = TimeSpan.FromSeconds(1); [DataField] public DamageSpecifier Heal = new DamageSpecifier // god forgive me for hardcoding values diff --git a/Resources/Prototypes/SS220/CultYogg/pond.yml b/Resources/Prototypes/SS220/CultYogg/pond.yml index 5b0b484fb785bf..385a3582c7636f 100644 --- a/Resources/Prototypes/SS220/CultYogg/pond.yml +++ b/Resources/Prototypes/SS220/CultYogg/pond.yml @@ -30,9 +30,8 @@ - type: DrawableSolution solution: drink - type: Sprite - sprite: Structures/Storage/tanks.rsi - layers: - - state: watertank-2 + sprite: SS220/Structures/CultYogg/yoggpond.rsi + state: pond - type: InteractionOutline - type: Transform noRot: true diff --git a/Resources/Textures/SS220/Effects/cult_yogg_healing.rsi/healingEffect.png b/Resources/Textures/SS220/Effects/cult_yogg_healing.rsi/healingEffect.png new file mode 100644 index 0000000000000000000000000000000000000000..e1798e1caff5ff2bda150e0c8a965330bc924cb1 GIT binary patch literal 3480 zcmV;J4QKL+P)IIr-}jM{W_Nb?eSAdx`R2zz{nX3* zw}1b!JKyt-nKMT`k|>5|W;In{RAlq6GDVLCGe%k3S3Zu;l?pExS%L*lw5YRRV%bR2VB@2 z)XG#qZLn2E`p^<9g`&t&G+2s`0?ZLaN3Apk{|MkSz;@?=3;P*lz=sm> zMWF5wU;pkOpJ4g^^WXoyhOuDSSR1FE$3zN;f8srvjr6-U)Tqs-6}1t^l(G;!4jZO22a| zaM}iuE^Vp(s^u&NJ8jWsM7>JkX1J$MDnKi6yRCqhB4N7M;2^?q zmBNWgdmF>8z&l^YcTnJVTY-ayw+U&o;nzP3r21=Xlz7xQBoIn| z0|WEJYls(Kb9q9)(_gQ0PDl&36TTNfTV1Vx58I9i7|<4|7#u(+Zz4FOT2jxp5;9haQaZWF0sDv%1K0-FM>Y$e!XzEXj9 z-}I!wY3?dYOzojO>;LWV|M~dhC)b}U*z-WAEAyo z|JAwjO;ZdQ=8KJe_x%rS5i$RgpHqZdFc_oo-~MC$z&iGA-!H%ToX5W>5{Cc;-d=0{ zd)Rt;>zt&4uz1@1L;mgwFjmdj5TLWamj6tF-?kv>HUsrI%QgdX*XzPx(**2oh5}H=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