From 1282d3eb688bfe9231a5b901a34cbb7d35856102 Mon Sep 17 00:00:00 2001 From: Nemanja <98561806+EmoGarbage404@users.noreply.github.com> Date: Sun, 3 Sep 2023 00:03:05 -0400 Subject: [PATCH] bloody microwaves (#19647) --- Content.Server/Body/Systems/BodySystem.cs | 8 ++++++-- .../Kitchen/EntitySystems/MicrowaveSystem.cs | 6 ++++-- .../Kitchen/Components/SharedMicrowave.cs | 3 ++- .../Entities/Structures/Machines/microwave.yml | 17 +++++++++++++++++ .../Machines/microwave.rsi/mwbloody0.png | Bin 374 -> 268 bytes .../Machines/microwave.rsi/mwbloody1.png | Bin 438 -> 230 bytes 6 files changed, 29 insertions(+), 5 deletions(-) diff --git a/Content.Server/Body/Systems/BodySystem.cs b/Content.Server/Body/Systems/BodySystem.cs index 31d43f00ff..aa9fd4dd91 100644 --- a/Content.Server/Body/Systems/BodySystem.cs +++ b/Content.Server/Body/Systems/BodySystem.cs @@ -10,6 +10,7 @@ using Content.Shared.Body.Organ; using Content.Shared.Body.Part; using Content.Shared.Body.Systems; using Content.Shared.Humanoid; +using Content.Shared.Kitchen.Components; using Content.Shared.Mind; using Content.Shared.Mobs.Systems; using Content.Shared.Movement.Events; @@ -29,7 +30,9 @@ public sealed class BodySystem : SharedBodySystem [Dependency] private readonly HumanoidAppearanceSystem _humanoidSystem = default!; [Dependency] private readonly MobStateSystem _mobState = default!; [Dependency] private readonly SharedAudioSystem _audio = default!; - [Dependency] private readonly MindSystem _mindSystem = default!; + [Dependency] private readonly SharedAppearanceSystem _appearance = default!; + [Dependency] private readonly SharedMindSystem _mindSystem = default!; + [Dependency] private readonly SharedTransformSystem _transform = default!; public override void Initialize() { @@ -127,7 +130,8 @@ public sealed class BodySystem : SharedBodySystem return; // Don't microwave animals, kids - Transform(uid).AttachToGridOrMap(); + _transform.AttachToGridOrMap(uid); + _appearance.SetData(args.Microwave, MicrowaveVisualState.Bloody, true); GibBody(uid, false, component); args.Handled = true; diff --git a/Content.Server/Kitchen/EntitySystems/MicrowaveSystem.cs b/Content.Server/Kitchen/EntitySystems/MicrowaveSystem.cs index fe8064381b..41a32775d9 100644 --- a/Content.Server/Kitchen/EntitySystems/MicrowaveSystem.cs +++ b/Content.Server/Kitchen/EntitySystems/MicrowaveSystem.cs @@ -297,10 +297,12 @@ namespace Content.Server.Kitchen.EntitySystems )); } - public void SetAppearance(EntityUid uid, MicrowaveVisualState state, MicrowaveComponent component) + public void SetAppearance(EntityUid uid, MicrowaveVisualState state, MicrowaveComponent? component = null, AppearanceComponent? appearanceComponent = null) { + if (!Resolve(uid, ref component, ref appearanceComponent, false)) + return; var display = component.Broken ? MicrowaveVisualState.Broken : state; - _appearance.SetData(uid, PowerDeviceVisuals.VisualState, display); + _appearance.SetData(uid, PowerDeviceVisuals.VisualState, display, appearanceComponent); } public static bool HasContents(MicrowaveComponent component) diff --git a/Content.Shared/Kitchen/Components/SharedMicrowave.cs b/Content.Shared/Kitchen/Components/SharedMicrowave.cs index 6a5c10efa5..c625987ae7 100644 --- a/Content.Shared/Kitchen/Components/SharedMicrowave.cs +++ b/Content.Shared/Kitchen/Components/SharedMicrowave.cs @@ -70,7 +70,8 @@ namespace Content.Shared.Kitchen.Components { Idle, Cooking, - Broken + Broken, + Bloody } [NetSerializable, Serializable] diff --git a/Resources/Prototypes/Entities/Structures/Machines/microwave.yml b/Resources/Prototypes/Entities/Structures/Machines/microwave.yml index 38e123870d..48ac7c3393 100644 --- a/Resources/Prototypes/Entities/Structures/Machines/microwave.yml +++ b/Resources/Prototypes/Entities/Structures/Machines/microwave.yml @@ -8,6 +8,13 @@ - type: Appearance - type: GenericVisualizer visuals: + enum.MicrowaveVisualState.Bloody: + bloody: + True: { visible: true } + False: { visible: false } + bloodyunshaded: + True: { visible: true } + False: { visible: false } enum.PowerDeviceVisuals.VisualState: enum.MicrowaveVisualizerLayers.Base: Idle: { state: "mw" } @@ -17,6 +24,9 @@ Idle: { state: "mw_unlit" } Broken: { state: "mw_unlit" } Cooking: { state: "mw_running_unlit" } + bloodyunshaded: + Idle: { visible: false } + Broken: { visible: false } enum.PowerDeviceVisuals.Powered: enum.MicrowaveVisualizerLayers.BaseUnlit: True: { visible: true } @@ -49,6 +59,13 @@ - state: mw_unlit shader: unshaded map: ["enum.MicrowaveVisualizerLayers.BaseUnlit"] + - state: mwbloody0 + map: ["bloody"] + visible: false + - state: mwbloody1 + shader: unshaded + map: ["bloodyunshaded"] + visible: false - type: Destructible thresholds: - trigger: diff --git a/Resources/Textures/Structures/Machines/microwave.rsi/mwbloody0.png b/Resources/Textures/Structures/Machines/microwave.rsi/mwbloody0.png index 3bd4401547b4d1f1bf1dea27ef66e37449fe5b1f..a51302a2537666447aab9729ffd9e99629aed1ba 100644 GIT binary patch delta 142 zcmV;90CE5J0*nHXF_A%7e{M-cK~y-6<&aAXz%U3z1B2ks``@N+K10TNF{uh`WAK+!+gVo8Aa8U6`eSZ+D84XWr>00000NkvXX1g=70f)XY>oB#j- delta 246 zcmVxsF%1M~K}|sb0I`n?{9y%=E?a*Ia7bBm000ic000ic0Tn1pfB*mh zvq?ljR5(xVkjoN-FbG9S2?|No|Nq-wjE*FIZM*2XXu-{xC4g{G8L4n z)hJ#l`TX|1m3zs=x21JgBb-jd$9(U&yKJgbCUxaOY04e4ps!&lH)&Kwi07*qoM6N<$f@F?s#Q*>R diff --git a/Resources/Textures/Structures/Machines/microwave.rsi/mwbloody1.png b/Resources/Textures/Structures/Machines/microwave.rsi/mwbloody1.png index 8136ad7a96b505ab7969e6a5764fb9ee47a26192..8cfdf34281a32ce8dd087a52b77d1284ec461e3c 100644 GIT binary patch delta 213 zcmV;`04o2s1Lgsc8Gi-<0047(dh`GQ00DDSM?wIu&K&6g005v#L_t(oh3%3t3IZ_@ zMPKY>Z(*s}dKGOwSuEG9#4^OvTUf`!2?h~11cJ?f5Pl{Z<`0vA5JHFrJY;}m8Xzag z!D4Uwk~f4@nf=|oXjyZ0-&5bUHt~Eb2ViUGH(&xHaB8ge%}#15!9(7Gn=11Qa0eb{ zzUgspZQu;9JVP|&HJ>T$t&w33B%444j+N=vG?)(M*GDXItwIPPgy`V~UsOqbLDUsg P00000NkvXXu0mjf(_mID literal 438 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE3?yBabR7dyjKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCilQ1AIbUwY9Ym?%KL^a&t8ULt}Af90S9d1#%1x3=IDn<})xnJgt9~f#K(u zB`;5=TQV@50tqvSi;MgF`@6cju3%tTv0_C-LqkerAkaLEyv;g5O0p!#FZe$Wz`$t2 zwH>I4v%n*=n1O-s5C}7hYIp%{WH|5X;uvD#|8~M{zGelUw%1%n8jBQy@BjC_Ue)1I zw&U*6eJuOh zqx}4&b$%^3$FUh+1y>4Vr)4W{2v845KRL-_+WZyO4xTS`FJ35idJ-fRtjUs5>wZM= zW^j!QtHiRPi0TDCl_#D&77;vFxMto0J^n`pheS;M7`+|6n|w5bHwe6HIqiP*i0zV+ z%um0r8np&+6gOV`ojA{bp~{=x1swB#a7)Lxq*gL{+n8Uy_F