Improve Operating Tables (#4333)
* Improve Operating Tables * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * There is no god. We suffer. * Add Anesthesia Component to Optable * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Less shitified code * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * GoodCode™️ * Rename Systemfile --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
parent
f0ee57048b
commit
d2539322ed
|
|
@ -25,11 +25,11 @@ public sealed class ComponentTogglerSystem : EntitySystem
|
|||
|
||||
ent.Comp.Target = target;
|
||||
|
||||
EntityManager.AddComponents(target, ent.Comp.Components);
|
||||
|
||||
// Begin DeltaV - allow swapping components
|
||||
if (ent.Comp.DeactivatedComponents is { } deactivatedComps)
|
||||
EntityManager.RemoveComponents(target, deactivatedComps);
|
||||
|
||||
EntityManager.AddComponents(target, ent.Comp.Components);
|
||||
// End DeltaV
|
||||
}
|
||||
else
|
||||
|
|
|
|||
|
|
@ -0,0 +1,16 @@
|
|||
using Robust.Shared.GameStates;
|
||||
|
||||
namespace Content.Shared._DV.Surgery;
|
||||
|
||||
/// <summary>
|
||||
/// Exists for strap entities to apply surgical anesthesia to the patient upon being buckled.
|
||||
/// </summary>
|
||||
[RegisterComponent, NetworkedComponent]
|
||||
public sealed partial class AnesthesiaOnBuckleComponent : Component
|
||||
{
|
||||
/// <summary>
|
||||
/// Check whether the buckled entity was anesthetized already.
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public bool HadAnesthesia;
|
||||
}
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
using Content.Shared.Buckle.Components;
|
||||
using Content.Shared.Examine;
|
||||
|
||||
namespace Content.Shared._DV.Surgery;
|
||||
|
||||
public sealed class AnesthesiaOnBuckleSystem : EntitySystem
|
||||
{
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
SubscribeLocalEvent<AnesthesiaOnBuckleComponent, StrappedEvent>(OnStrapped);
|
||||
SubscribeLocalEvent<AnesthesiaOnBuckleComponent, UnstrappedEvent>(OnUnstrapped);
|
||||
SubscribeLocalEvent<AnesthesiaOnBuckleComponent, ExaminedEvent>(OnExamine);
|
||||
}
|
||||
private void OnStrapped(Entity<AnesthesiaOnBuckleComponent> strap, ref StrappedEvent args)
|
||||
{
|
||||
strap.Comp.HadAnesthesia = HasComp<AnesthesiaComponent>(args.Buckle.Owner);
|
||||
EnsureComp<AnesthesiaComponent>(args.Buckle.Owner);
|
||||
}
|
||||
private void OnUnstrapped(Entity<AnesthesiaOnBuckleComponent> strap, ref UnstrappedEvent args)
|
||||
{
|
||||
if (!strap.Comp.HadAnesthesia)
|
||||
RemComp<AnesthesiaComponent>(args.Buckle.Owner);
|
||||
}
|
||||
private void OnExamine(Entity<AnesthesiaOnBuckleComponent> ent, ref ExaminedEvent args)
|
||||
{
|
||||
args.PushMarkup(Loc.GetString("anesthesia-on-buckle"));
|
||||
}
|
||||
}
|
||||
|
|
@ -1,5 +1,7 @@
|
|||
advanced-operating-table-stasis-mode = It is currently [color=lightblue]slowing down decay[/color] of patients strapped to it.
|
||||
advanced-operating-table-surgery-mode = It is currently [color=lightgreen]speeding up surgery[/color].
|
||||
advanced-operating-table-stasis-mode = It is currently [color=lightgreen]slowing down decay[/color] of patients strapped to it.
|
||||
advanced-operating-table-surgery-mode = It is currently [color=lightblue]speeding up surgery[/color].
|
||||
|
||||
advanced-operating-table-verb-activate-stasis = Switch to stasis mode
|
||||
advanced-operating-table-verb-activate-surgery = Switch to stabilization mode
|
||||
|
||||
anesthesia-on-buckle = This device automatically puts buckled entities under surgical anesthesia without putting them to sleep.
|
||||
|
|
|
|||
|
|
@ -5,11 +5,11 @@
|
|||
description: Used for advanced medical procedures. # Shitmed
|
||||
components:
|
||||
- type: Sprite
|
||||
sprite: Structures/Furniture/Tables/optable.rsi
|
||||
sprite: _DV/Structures/Furniture/Tables/optable.rsi # DeltaV - Improve Operating Tables
|
||||
state: operating_table
|
||||
noRot: true
|
||||
- type: Icon
|
||||
sprite: Structures/Furniture/Tables/optable.rsi
|
||||
sprite: _DV/Structures/Furniture/Tables/optable.rsi # DeltaV - Improve Operating Tables
|
||||
state: operating_table
|
||||
- type: OperatingTable
|
||||
# Begin Shitmed Changes
|
||||
|
|
@ -33,3 +33,5 @@
|
|||
ports:
|
||||
- OperatingTable
|
||||
# End Shitmed Changes
|
||||
- type: SurgerySpeedModifier # DeltaV - Improve Operating Tables
|
||||
speedModifier: 1.25
|
||||
|
|
|
|||
|
|
@ -1,14 +1,11 @@
|
|||
- type: entity
|
||||
id: OperatingTableAdvanced
|
||||
parent: OperatingTable
|
||||
parent: [ MedicalBed, OperatingTable ]
|
||||
name: advanced operating table
|
||||
description: An operating table specially built to keep the patient precisely still, allowing the surgeon to work faster with confidence.
|
||||
components:
|
||||
- type: Machine
|
||||
board: OperatingTableAdvancedCircuitboard
|
||||
- type: SurgerySpeedModifier
|
||||
speedModifier: 1.25
|
||||
# Begin DeltaV Additions - toggle between stasis and surgery speed
|
||||
- type: ItemToggle
|
||||
verbToggleOn: advanced-operating-table-verb-activate-stasis
|
||||
verbToggleOff: advanced-operating-table-verb-activate-surgery
|
||||
|
|
@ -17,10 +14,31 @@
|
|||
- type: ItemToggleExamine
|
||||
on: advanced-operating-table-stasis-mode
|
||||
off: advanced-operating-table-surgery-mode
|
||||
- type: SurgerySpeedModifier
|
||||
speedModifier: 1.5
|
||||
- type: AnesthesiaOnBuckle
|
||||
- type: ComponentToggler
|
||||
components:
|
||||
- type: AntiRotOnBuckle
|
||||
deactivatedComponents:
|
||||
- type: SurgerySpeedModifier
|
||||
speedModifier: 1.25
|
||||
# End DeltaV Additions
|
||||
deactivatedComponents:
|
||||
- type: SurgerySpeedModifier
|
||||
speedModifier: 1.5
|
||||
- type: Sprite
|
||||
sprite: _DV/Structures/Furniture/Tables/advanced_optable.rsi
|
||||
noRot: true
|
||||
layers:
|
||||
- state: state_unpowered
|
||||
- state: state_speed
|
||||
shader: unshaded
|
||||
- state: state_stasis
|
||||
map: [ "enum.ToggleableVisuals.Layer" ]
|
||||
shader: unshaded
|
||||
- type: Appearance
|
||||
- type: GenericVisualizer
|
||||
visuals:
|
||||
enum.ToggleableVisuals.Enabled:
|
||||
enum.ToggleableVisuals.Layer:
|
||||
True: { visible: True }
|
||||
False: { visible: False }
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
"version": 1,
|
||||
"license": "CC-BY-SA-3.0",
|
||||
"copyright": "Sprited by Sir_Warock on Discord",
|
||||
"size": {
|
||||
"x": 32,
|
||||
"y": 32
|
||||
},
|
||||
"states": [
|
||||
{
|
||||
"name": "state_unpowered"
|
||||
},
|
||||
{
|
||||
"name": "state_speed"
|
||||
},
|
||||
{
|
||||
"name": "state_stasis"
|
||||
}
|
||||
]
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 267 B |
Binary file not shown.
|
After Width: | Height: | Size: 255 B |
Binary file not shown.
|
After Width: | Height: | Size: 489 B |
|
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
"version": 1,
|
||||
"license": "CC-BY-SA-3.0",
|
||||
"copyright": "Sprited by Sir_Warock on Discord",
|
||||
"size": {
|
||||
"x": 32,
|
||||
"y": 32
|
||||
},
|
||||
"states": [
|
||||
{
|
||||
"name": "operating_table"
|
||||
}
|
||||
]
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 424 B |
Loading…
Reference in New Issue