From 3a45d519dcc3679375b5239b6f1881cdd1a07344 Mon Sep 17 00:00:00 2001 From: Pieter-Jan Briers Date: Fri, 16 Feb 2024 01:26:45 +0100 Subject: [PATCH] Nuke fancification (#25297) Actually use more icon states for deployed/armed/about to explode Also unlit layer. Also examine text --- Content.Server/Nuke/NukeSystem.cs | 38 ++++++++++++++++++ Content.Shared/Nuke/SharedNuke.cs | 21 ++++++++++ .../Locale/en-US/nuke/nuke-component.ftl | 4 ++ .../Entities/Objects/Devices/nuke.yml | 17 ++++++++ .../Objects/Devices/nuke.rsi/meta.json | 3 ++ .../Devices/nuke.rsi/nuclearbomb_deployed.png | Bin 1310 -> 1328 bytes .../nuke.rsi/nuclearbomb_deployed_unlit.png | Bin 0 -> 108 bytes .../nuke.rsi/nuclearbomb_exploding.png | Bin 1614 -> 366 bytes .../Devices/nuke.rsi/nuclearbomb_timing.png | Bin 1381 -> 113 bytes 9 files changed, 83 insertions(+) create mode 100644 Resources/Textures/Objects/Devices/nuke.rsi/nuclearbomb_deployed_unlit.png diff --git a/Content.Server/Nuke/NukeSystem.cs b/Content.Server/Nuke/NukeSystem.cs index 77689c4e2b..652852ece2 100644 --- a/Content.Server/Nuke/NukeSystem.cs +++ b/Content.Server/Nuke/NukeSystem.cs @@ -9,6 +9,7 @@ using Content.Shared.Audio; using Content.Shared.Containers.ItemSlots; using Content.Shared.Coordinates.Helpers; using Content.Shared.DoAfter; +using Content.Shared.Examine; using Content.Shared.Maps; using Content.Shared.Nuke; using Content.Shared.Popups; @@ -40,6 +41,7 @@ public sealed class NukeSystem : EntitySystem [Dependency] private readonly SharedTransformSystem _transform = default!; [Dependency] private readonly StationSystem _station = default!; [Dependency] private readonly UserInterfaceSystem _ui = default!; + [Dependency] private readonly AppearanceSystem _appearance = default!; /// /// Used to calculate when the nuke song should start playing for maximum kino with the nuke sfx @@ -60,6 +62,7 @@ public sealed class NukeSystem : EntitySystem SubscribeLocalEvent(OnMapInit); SubscribeLocalEvent(OnItemSlotChanged); SubscribeLocalEvent(OnItemSlotChanged); + SubscribeLocalEvent(OnExaminedEvent); // Shouldn't need re-anchoring. SubscribeLocalEvent(OnAnchorChanged); @@ -148,6 +151,8 @@ public sealed class NukeSystem : EntitySystem // without the doafter. but that takes some effort, and it won't allow you to disarm a nuke that can't be disarmed by the doafter. DisarmBomb(uid, component); } + + UpdateAppearance(uid, component); } #endregion @@ -299,6 +304,7 @@ public sealed class NukeSystem : EntitySystem _sound.PlayGlobalOnStation(uid, _audio.GetSound(nuke.AlertSound), new AudioParams{Volume = -5f}); _sound.StopStationEventMusic(uid, StationEventMusicType.Nuke); nuke.PlayedAlertSound = true; + UpdateAppearance(uid, nuke); } if (nuke.RemainingTime <= 0) @@ -473,6 +479,7 @@ public sealed class NukeSystem : EntitySystem component.Status = NukeStatus.ARMED; UpdateUserInterface(uid, component); + UpdateAppearance(uid, component); } /// @@ -514,6 +521,7 @@ public sealed class NukeSystem : EntitySystem component.CooldownTime = component.Cooldown; UpdateUserInterface(uid, component); + UpdateAppearance(uid, component); } /// @@ -589,6 +597,36 @@ public sealed class NukeSystem : EntitySystem _popups.PopupEntity(Loc.GetString("nuke-component-doafter-warning"), user, user, PopupType.LargeCaution); } + + private void UpdateAppearance(EntityUid uid, NukeComponent nuke) + { + var xform = Transform(uid); + + _appearance.SetData(uid, NukeVisuals.Deployed, xform.Anchored); + + NukeVisualState state; + if (nuke.PlayedAlertSound) + state = NukeVisualState.YoureFucked; + else if (nuke.Status == NukeStatus.ARMED) + state = NukeVisualState.Armed; + else + state = NukeVisualState.Idle; + + _appearance.SetData(uid, NukeVisuals.State, state); + } + + private void OnExaminedEvent(EntityUid uid, NukeComponent component, ExaminedEvent args) + { + if (component.PlayedAlertSound) + args.PushMarkup(Loc.GetString("nuke-examine-exploding")); + else if (component.Status == NukeStatus.ARMED) + args.PushMarkup(Loc.GetString("nuke-examine-armed")); + + if (Transform(uid).Anchored) + args.PushMarkup(Loc.GetString("examinable-anchored")); + else + args.PushMarkup(Loc.GetString("examinable-unanchored")); + } } public sealed class NukeExplodedEvent : EntityEventArgs diff --git a/Content.Shared/Nuke/SharedNuke.cs b/Content.Shared/Nuke/SharedNuke.cs index 1c471e11c6..c845ed6c2a 100644 --- a/Content.Shared/Nuke/SharedNuke.cs +++ b/Content.Shared/Nuke/SharedNuke.cs @@ -3,6 +3,27 @@ using Robust.Shared.Serialization; namespace Content.Shared.Nuke { + public enum NukeVisualLayers + { + Base, + Unlit + } + + [NetSerializable, Serializable] + public enum NukeVisuals + { + Deployed, + State, + } + + [NetSerializable, Serializable] + public enum NukeVisualState + { + Idle, + Armed, + YoureFucked + } + [Serializable, NetSerializable] public enum NukeUiKey : byte { diff --git a/Resources/Locale/en-US/nuke/nuke-component.ftl b/Resources/Locale/en-US/nuke/nuke-component.ftl index 4a44ae88ea..b2a61dfcc2 100644 --- a/Resources/Locale/en-US/nuke/nuke-component.ftl +++ b/Resources/Locale/en-US/nuke/nuke-component.ftl @@ -41,3 +41,7 @@ nuke-codes-fax-paper-name = nuclear authentication codes # Nuke disk slot nuke-slot-component-slot-name-disk = Disk + +## Examine +nuke-examine-armed = Hey uh, why's that [color=red]red light[/color] blinking? +nuke-examine-exploding = Yeah... I think it's too late buddy. diff --git a/Resources/Prototypes/Entities/Objects/Devices/nuke.yml b/Resources/Prototypes/Entities/Objects/Devices/nuke.yml index d120621559..811210d429 100644 --- a/Resources/Prototypes/Entities/Objects/Devices/nuke.yml +++ b/Resources/Prototypes/Entities/Objects/Devices/nuke.yml @@ -11,6 +11,11 @@ noRot: true layers: - state: nuclearbomb_base + map: ["enum.NukeVisualLayers.Base"] + - state: nuclearbomb_deployed_unlit + map: ["enum.NukeVisualLayers.Unlit"] + shader: unshaded + visible: false - state: nukefestive map: ["christmas"] visible: false @@ -24,6 +29,18 @@ enum.HolidayVisuals.Holiday: christmas: festive: { visible: true } + enum.NukeVisuals.Deployed: + enum.NukeVisualLayers.Base: + False: { state: nuclearbomb_base } + True: { state: nuclearbomb_deployed } + enum.NukeVisualLayers.Unlit: + True: { visible: true } + False: { visible: false } + enum.NukeVisuals.State: + enum.NukeVisualLayers.Unlit: + Idle: { state: nuclearbomb_deployed_unlit } + Armed: { state: nuclearbomb_timing } + YoureFucked: { state: nuclearbomb_exploding } - type: Physics bodyType: Static - type: Fixtures diff --git a/Resources/Textures/Objects/Devices/nuke.rsi/meta.json b/Resources/Textures/Objects/Devices/nuke.rsi/meta.json index 2828b13ddb..4bc62a96b2 100644 --- a/Resources/Textures/Objects/Devices/nuke.rsi/meta.json +++ b/Resources/Textures/Objects/Devices/nuke.rsi/meta.json @@ -10,6 +10,9 @@ { "name": "nuclearbomb_deployed" }, + { + "name": "nuclearbomb_deployed_unlit" + }, { "name": "nukefestive", "delays": [ diff --git a/Resources/Textures/Objects/Devices/nuke.rsi/nuclearbomb_deployed.png b/Resources/Textures/Objects/Devices/nuke.rsi/nuclearbomb_deployed.png index fa39a744cdd5f07aa3637736286dd29ffeecd20e..4a01cf2d68fcba38e737bc652d4bc17c9199de74 100644 GIT binary patch delta 1309 zcmV+&1>*Xi3a|>0B!2;OQb$4nuFf3k000E)Nkl#zlqAr)C^YXMtrZJFOL%J;S(rFhtdH~w$>9-ia>d4In5DLlqwJYuL4T^LN6 z()2UOpeLdH!ypED^k&ok<{ zHslpq$l1Q0p?~3WPDWft=^2`t5@ng)$>p33`t42y8)7jNjry!~QZ*?e0DwHB4uD|q z2-fJvcOy*n)W!O>;I zw{8gm=YIqMeSMQWpDVtMnco2!fj|g6rwPsrld4JK=!t5Ay(6Tqic)@HZwf6J9`7~ za0u^kh_ zp5YMBsBiL$U!q}O?NqiO2-)@yuR^z_$qA%WyjV+jjAPk(UtfeFRaMn4DL;P|$4=Ce zXVi%(-7cR{nESqmw4)}9?@Us(ua=tkj$^TGq~f*j;sTIM0kExd9R7C0lX^t}JIYlw zet&!u$Dl`*G&(wh(U?PNNktq3`mA*R4Lu?Dr`>k}uvj+I({o-S+jjPbq7*X4u_cqy zbSnDhC3SS1QJp&V8Tt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*2Wob;r)U%4E->Lsd)x#&=Js*sH}Wl&eb;_h29$K zs?pJP4cn*G?dRY_?V;DWT0?{CZ6Yu{tX{vuYS_7ew{{#&rrjUqkp4o zfP<+DOmhV;TvSUk9RV_oc*0A29DHwU>xa_u&@3YUqzLc=#lw!k9I1dXZB7u0;_-95 ze6Vyv0kwbhcWp)Pc za4^Lz76tAlN^!}RZ)AU^DIV8G=6_&Hx%)rTi|ygyL9;LtF};1~SCeIHwolHHl;Zqi znSPHp^R+~x66kO{mJvf*=rmartJMl;Z*NG#B}~7E&fH0*!X3WuuJj~8o6V+ZncwRk z2Wu^ilzv@Q0u;U8A@0!@+apw6lED1{-VdRF0FM(nT^vOUXaE2J07*qoL9rvFzl8-v3V)?Rt$|NZG7+JQP4JYD@<);T3K F0RYitApigX literal 0 HcmV?d00001 diff --git a/Resources/Textures/Objects/Devices/nuke.rsi/nuclearbomb_exploding.png b/Resources/Textures/Objects/Devices/nuke.rsi/nuclearbomb_exploding.png index ac5c5d9654ff5a545b508efe26f5687251b3d7a7..c5861c43bcbb07bb152b4d475afe9b9cb180b53b 100644 GIT binary patch delta 339 zcmV-Z0j&Pc4DJGuB!2;OQb$4nuFf3k0003fNkltDtsP~2J~C1`oVUXax7*N?H!C+EQ$R1#W&XMZJ31xnuiV`&^f1dxKl zwj`iN$Xi_pM#i-Y*aEiyz!L;s4#nhCP_U|mc)(j=F2I%W`i&o1U^tHBIF1sn^MM1v zF0`Bo`RjiLIC;oY8&&t)vVR$nr+9#3d&|Xb+>d`F{PsWAl3#osBgGxdx z@T`QXK*@W|Elf)3=h9>CfI^Ls!`%5m&^s4k%=ZQ60xyRm`4kkaDj^>57MKfgB|I9F1Q0kxRPNO~`NJQzum*_@5H`yAXfEexi=`lFXh*@+ajbr(A z=tI<}_KF&ugit`8^HaZGR2zwrX~BsQMf2IKu*{ks1U^zU|J#csMu60WAi>sCz#5>! zUe67l?&|1cNXOofmN&xLx26}eu8 zp{c`&j+u;opA}+=ExzbQe#v)kpNvBXI|9t-x9wonr{nPV|9|nLu3-`0DY(JsKRRAkW5_qm&L*Dr zT)FKhu<7k3ISn`yL}2!sohW$;h}}0I+gO98W=3RCLfMXDWwalwb*pPU0c}YMw&pqE zW)AER0(ZM*g`zfXdQV!oa1k1s4CHB?fg6o1@!>`6WF#_g#iML@F^WELV%f4BYzOj!hfCV-+@4(j*w&eLx{^Y&ju?u79`S{e}LH*R8n{1a>_xaF6qN z?{IK)dI}D=wsPWH1%hJIZ-3yV=wgcZBM;*bNCI?>{s0tzAYb`4FYpu4fRDl-;Me=`2ZS1& zgit`8^DzDZ9*{qvuBY+z2hhQkADch0UiJr8C_8%A{rdxf2E{n|1EF`qAb%iP_6M*_ z_6H6|{DBAP58zSt2k^-I118}QupiP!MErsA^aq^E+e!EX7^6SH^EPz;KoIdz{s4U( vs9!1f;12|WMf`!0+C=<;h(9pl{DJ=gu;8G&MXS6r00000NkvXXu0mjf@%Rk1 diff --git a/Resources/Textures/Objects/Devices/nuke.rsi/nuclearbomb_timing.png b/Resources/Textures/Objects/Devices/nuke.rsi/nuclearbomb_timing.png index ee674e57dbab6224861ef747620f9486b53d2be0..b59fac42b86cb3f6ffb4a2aa447f569aa9edac96 100644 GIT binary patch delta 83 zcmaFLRX9P#m$5j=-HBn{IhmIX3=GFT&5x`B{K{*v87l(T2?m5uID|s_w@FbmW>!SfAPM_z31F>&v~Ecea^>i z-+27XrW4Q!L?w`&n=WbFMu#U>{38SkH)TrqM)9pKMHgRYoP79*>*XyhXZkTU{T zjKJ@IFe8El^)vhD;8~Rj^O_XiW;CtjWgu`<^h-)IC{^D7g2x|5B#Zz#-SkLqSmf(+ zOkv#B1{2#Iq99{bNqa^z4rB z5TSs2@sJVl)e$fHJg2Z7KQ8LrQfTB(W657~j}e!H;0;y@rYr-xzFdcjCn3dDfL8Em zaxaR^PveU&;M3|ZJ_YZTvnj~QL{D%E4!0z*`+^u(vwvO?8nrv%duTlZu4(@4bS~i0 zEU`0Uf1iY0k%@N9t(r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