feat: toggle for advanced operating tables preventing rot (#3968)
* feat: allow using autodocs with stasis beds * feat: let advanced operating tables work as stasis beds instead * Slightly better operating table verbs * Really weird test flake * refactor: address review - Missing end DeltaV comment - Merge new ToggleComponent fields to DeactivatedComponents * Tweak advanced operating table wording
This commit is contained in:
parent
83849492df
commit
62d5d4dd29
|
|
@ -26,6 +26,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);
|
||||
// End DeltaV
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -36,6 +41,11 @@ public sealed class ComponentTogglerSystem : EntitySystem
|
|||
return;
|
||||
|
||||
EntityManager.RemoveComponents(ent.Comp.Target.Value, ent.Comp.RemoveComponents ?? ent.Comp.Components);
|
||||
|
||||
// Begin DeltaV - allow swapping components
|
||||
if (ent.Comp.DeactivatedComponents is { } reactivatedComps)
|
||||
EntityManager.AddComponents(ent.Comp.Target.Value, reactivatedComps);
|
||||
// End DeltaV
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,13 @@
|
|||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Shared.Item.ItemToggle.Components;
|
||||
|
||||
public sealed partial class ComponentTogglerComponent
|
||||
{
|
||||
/// <summary>
|
||||
/// Components that are removed on activation, and added back on deactivation.
|
||||
/// Allows for "toggling" between two components.
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public ComponentRegistry? DeactivatedComponents;
|
||||
}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
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-verb-activate-stasis = Switch to stasis mode
|
||||
advanced-operating-table-verb-activate-surgery = Switch to stabilization mode
|
||||
|
|
@ -8,3 +8,19 @@
|
|||
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
|
||||
soundActivate: /Audio/Machines/machine_switch.ogg
|
||||
soundDeactivate: /Audio/Machines/machine_switch.ogg
|
||||
- type: ItemToggleExamine
|
||||
on: advanced-operating-table-stasis-mode
|
||||
off: advanced-operating-table-surgery-mode
|
||||
- type: ComponentToggler
|
||||
components:
|
||||
- type: AntiRotOnBuckle
|
||||
deactivatedComponents:
|
||||
- type: SurgerySpeedModifier
|
||||
speedModifier: 1.25
|
||||
# End DeltaV Additions
|
||||
|
|
|
|||
Loading…
Reference in New Issue