bloody microwaves (#19647)

This commit is contained in:
Nemanja
2023-09-03 00:03:05 -04:00
committed by GitHub
parent 32233b23ad
commit 1282d3eb68
6 changed files with 29 additions and 5 deletions

View File

@@ -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;

View File

@@ -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)

View File

@@ -70,7 +70,8 @@ namespace Content.Shared.Kitchen.Components
{
Idle,
Cooking,
Broken
Broken,
Bloody
}
[NetSerializable, Serializable]

View File

@@ -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:

Binary file not shown.

Before

Width:  |  Height:  |  Size: 374 B

After

Width:  |  Height:  |  Size: 268 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 438 B

After

Width:  |  Height:  |  Size: 230 B