Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace ForcedSleep with Anesthesia for surgery #2684

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions Content.Server/_Shitmed/Medical/Surgery/SurgerySystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
using Content.Shared.Eye.Blinding.Systems;
using Content.Shared.Interaction;
using Content.Shared.Inventory;
using Content.Shared._DV.Surgery; // DeltaV: expanded anesthesia
using Content.Shared._Shitmed.Medical.Surgery;
using Content.Shared._Shitmed.Medical.Surgery.Conditions;
using Content.Shared._Shitmed.Medical.Surgery.Effects.Step;
Expand Down Expand Up @@ -143,7 +144,7 @@ private void OnSurgeryStepDamage(Entity<SurgeryTargetComponent> ent, ref Surgery
private void OnSurgeryDamageChange(Entity<SurgeryDamageChangeEffectComponent> ent, ref SurgeryStepEvent args) // DeltaV
{
var damageChange = ent.Comp.Damage;
if (HasComp<ForcedSleepingComponent>(args.Body))
if (HasComp<AnesthesiaComponent>(args.Body)) // DeltaV: anesthesia
damageChange = damageChange * ent.Comp.SleepModifier;

SetDamage(args.Body, damageChange, 0.5f, args.User, args.Part);
Expand All @@ -162,7 +163,7 @@ private void OnSurgerySpecialDamageChange(Entity<SurgerySpecialDamageChangeEffec

private void OnStepScreamComplete(Entity<SurgeryStepEmoteEffectComponent> ent, ref SurgeryStepEvent args)
{
if (HasComp<ForcedSleepingComponent>(args.Body))
if (HasComp<AnesthesiaComponent>(args.Body)) // DeltaV: anesthesia
return;

_chat.TryEmoteWithChat(args.Body, ent.Comp.Emote);
Expand Down
9 changes: 9 additions & 0 deletions Content.Shared/_DV/Surgery/AnesthesiaComponent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
using Robust.Shared.GameStates;

namespace Content.Shared._DV.Surgery;

/// <summary>
/// Exists for use as a status effect. Allows surgical operations to not cause immense pain.
/// </summary>
[RegisterComponent, NetworkedComponent]
public sealed partial class AnesthesiaComponent : Component;
2 changes: 2 additions & 0 deletions Resources/Prototypes/Entities/Mobs/NPCs/simplemob.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
- RadiationProtection
- Drowsiness
- Adrenaline
- Anesthesia # DeltaV - Anesthesia
- type: Buckle
- type: StandingState
- type: Tag
Expand Down Expand Up @@ -108,6 +109,7 @@
- RadiationProtection
- Drowsiness
- Adrenaline
- Anesthesia # DeltaV - Anesthesia
- type: Bloodstream
bloodMaxVolume: 150
- type: MobPrice
Expand Down
1 change: 1 addition & 0 deletions Resources/Prototypes/Entities/Mobs/Species/base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@
- SuppressAddiction # DeltaV - Psych med addictions system
- InPain # DeltaV - Pain system
- SuppressPain # DeltaV - Pain system
- Anesthesia # DeltaV - Anesthesia
- type: Body
prototype: Human
requiredLegs: 2
Expand Down
12 changes: 12 additions & 0 deletions Resources/Prototypes/Reagents/gases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,18 @@
component: ForcedSleeping
time: 200 # This reeks, but I guess it works LMAO
type: Add
- !type:GenericStatusEffect # DeltaV: anesthesia changes
conditions:
- !type:ReagentThreshold
reagent: NitrousOxide
min: 1
- !type:OrganType
type: Slime
Lyndomen marked this conversation as resolved.
Show resolved Hide resolved
shouldHave: false
key: Anesthesia
component: Anesthesia
time: 200
type: Add
- !type:HealthChange
conditions:
- !type:ReagentThreshold
Expand Down
5 changes: 5 additions & 0 deletions Resources/Prototypes/Reagents/narcotics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,11 @@
component: ForcedSleeping
refresh: false
type: Add
- !type:GenericStatusEffect # DeltaV: anesthesia
key: Anesthesia
component: Anesthesia
refresh: false
type: Add

- type: reagent
id: MuteToxin
Expand Down
10 changes: 10 additions & 0 deletions Resources/Prototypes/Reagents/toxins.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,16 @@
time: 4
type: Add
refresh: false
- !type:GenericStatusEffect # DeltaV: anesthesia
conditions:
- !type:ReagentThreshold
reagent: ChloralHydrate
min: 10
key: Anesthesia
component: Anesthesia
refresh: false
time: 4.0
type: Add
- !type:HealthChange
conditions:
- !type:ReagentThreshold
Expand Down
3 changes: 3 additions & 0 deletions Resources/Prototypes/_DV/status_effects.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,6 @@

- type: statusEffect
id: SuppressPain

- type: statusEffect
id: Anesthesia
Loading