diff --git a/Content.Server/Atmos/Rotting/RottingSystem.cs b/Content.Server/Atmos/Rotting/RottingSystem.cs index 47bac84e0ca..5070b3f197f 100644 --- a/Content.Server/Atmos/Rotting/RottingSystem.cs +++ b/Content.Server/Atmos/Rotting/RottingSystem.cs @@ -1,15 +1,9 @@ -using Content.Shared.Damage; -using Content.Shared.Atmos; using Content.Server.Atmos.EntitySystems; using Content.Server.Body.Components; using Content.Server.Temperature.Components; +using Content.Shared.Atmos; using Content.Shared.Atmos.Rotting; -using Content.Shared.Examine; -using Content.Shared.IdentityManagement; -using Content.Shared.Mobs; -using Content.Shared.Mobs.Components; -using Content.Shared.Mobs.Systems; -using Content.Shared.Rejuvenate; +using Content.Shared.Damage; using Robust.Server.Containers; using Robust.Shared.Physics.Components; using Robust.Shared.Timing; @@ -22,83 +16,16 @@ public sealed class RottingSystem : SharedRottingSystem [Dependency] private readonly AtmosphereSystem _atmosphere = default!; [Dependency] private readonly ContainerSystem _container = default!; [Dependency] private readonly DamageableSystem _damageable = default!; - [Dependency] private readonly MobStateSystem _mobState = default!; public override void Initialize() { base.Initialize(); - SubscribeLocalEvent(OnPerishableMapInit); - SubscribeLocalEvent(OnMobStateChanged); - SubscribeLocalEvent(OnPerishableExamined); - - SubscribeLocalEvent(OnShutdown); - SubscribeLocalEvent(OnRottingMobStateChanged); SubscribeLocalEvent(OnGibbed); - SubscribeLocalEvent(OnRejuvenate); SubscribeLocalEvent(OnTempIsRotting); } - private void OnPerishableMapInit(EntityUid uid, PerishableComponent component, MapInitEvent args) - { - component.RotNextUpdate = _timing.CurTime + component.PerishUpdateRate; - } - - private void OnMobStateChanged(EntityUid uid, PerishableComponent component, MobStateChangedEvent args) - { - if (args.NewMobState != MobState.Dead && args.OldMobState != MobState.Dead) - return; - - if (HasComp(uid)) - return; - - component.RotAccumulator = TimeSpan.Zero; - component.RotNextUpdate = _timing.CurTime + component.PerishUpdateRate; - } - - private void OnShutdown(EntityUid uid, RottingComponent component, ComponentShutdown args) - { - if (TryComp(uid, out var perishable)) - { - perishable.RotNextUpdate = TimeSpan.Zero; - } - } - - private void OnRottingMobStateChanged(EntityUid uid, RottingComponent component, MobStateChangedEvent args) - { - if (args.NewMobState == MobState.Dead) - return; - RemCompDeferred(uid, component); - } - - public bool IsRotProgressing(EntityUid uid, PerishableComponent? perishable) - { - // things don't perish by default. - if (!Resolve(uid, ref perishable, false)) - return false; - - // only dead things or inanimate objects can rot - if (TryComp(uid, out var mobState) && !_mobState.IsDead(uid, mobState)) - return false; - - if (_container.TryGetOuterContainer(uid, Transform(uid), out var container) && - HasComp(container.Owner)) - { - return false; - } - - var ev = new IsRottingEvent(); - RaiseLocalEvent(uid, ref ev); - - return !ev.Handled; - } - - public bool IsRotten(EntityUid uid, RottingComponent? rotting = null) - { - return Resolve(uid, ref rotting, false); - } - private void OnGibbed(EntityUid uid, RottingComponent component, BeingGibbedEvent args) { if (!TryComp(uid, out var physics)) @@ -112,36 +39,6 @@ private void OnGibbed(EntityUid uid, RottingComponent component, BeingGibbedEven tileMix?.AdjustMoles(Gas.Ammonia, molsToDump); } - private void OnPerishableExamined(Entity perishable, ref ExaminedEvent args) - { - int stage = PerishStage(perishable, MaxStages); - if (stage < 1 || stage > MaxStages) - { - // We dont push an examined string if it hasen't started "perishing" or it's already rotting - return; - } - - var isMob = HasComp(perishable); - var description = "perishable-" + stage + (!isMob ? "-nonmob" : string.Empty); - args.PushMarkup(Loc.GetString(description, ("target", Identity.Entity(perishable, EntityManager)))); - } - - /// - /// Return an integer from 0 to maxStage representing how close to rotting an entity is. Used to - /// generate examine messages for items that are starting to rot. - /// - public int PerishStage(Entity perishable, int maxStages) - { - if (perishable.Comp.RotAfter.TotalSeconds == 0 || perishable.Comp.RotAccumulator.TotalSeconds == 0) - return 0; - return (int)(1 + maxStages * perishable.Comp.RotAccumulator.TotalSeconds / perishable.Comp.RotAfter.TotalSeconds); - } - - private void OnRejuvenate(EntityUid uid, RottingComponent component, RejuvenateEvent args) - { - RemCompDeferred(uid); - } - private void OnTempIsRotting(EntityUid uid, TemperatureComponent component, ref IsRottingEvent args) { if (args.Handled) diff --git a/Content.Shared/Atmos/Rotting/SharedRottingSystem.cs b/Content.Shared/Atmos/Rotting/SharedRottingSystem.cs index 5e1758203a8..840818dee59 100644 --- a/Content.Shared/Atmos/Rotting/SharedRottingSystem.cs +++ b/Content.Shared/Atmos/Rotting/SharedRottingSystem.cs @@ -1,29 +1,85 @@ using Content.Shared.Examine; using Content.Shared.IdentityManagement; +using Content.Shared.Mobs; using Content.Shared.Mobs.Components; +using Content.Shared.Mobs.Systems; +using Content.Shared.Rejuvenate; +using Robust.Shared.Containers; +using Robust.Shared.Timing; namespace Content.Shared.Atmos.Rotting; public abstract class SharedRottingSystem : EntitySystem { + [Dependency] private readonly IGameTiming _timing = default!; + [Dependency] private readonly SharedContainerSystem _container = default!; + [Dependency] private readonly MobStateSystem _mobState = default!; + public const int MaxStages = 3; public override void Initialize() { base.Initialize(); + SubscribeLocalEvent(OnPerishableMapInit); + SubscribeLocalEvent(OnMobStateChanged); + SubscribeLocalEvent(OnPerishableExamined); + + SubscribeLocalEvent(OnShutdown); + SubscribeLocalEvent(OnRottingMobStateChanged); + SubscribeLocalEvent(OnRejuvenate); SubscribeLocalEvent(OnExamined); } - /// - /// Return the rot stage, usually from 0 to 2 inclusive. - /// - public int RotStage(EntityUid uid, RottingComponent? comp = null, PerishableComponent? perishable = null) + private void OnPerishableMapInit(EntityUid uid, PerishableComponent component, MapInitEvent args) { - if (!Resolve(uid, ref comp, ref perishable)) - return 0; + component.RotNextUpdate = _timing.CurTime + component.PerishUpdateRate; + } - return (int) (comp.TotalRotTime.TotalSeconds / perishable.RotAfter.TotalSeconds); + private void OnMobStateChanged(EntityUid uid, PerishableComponent component, MobStateChangedEvent args) + { + if (args.NewMobState != MobState.Dead && args.OldMobState != MobState.Dead) + return; + + if (HasComp(uid)) + return; + + component.RotAccumulator = TimeSpan.Zero; + component.RotNextUpdate = _timing.CurTime + component.PerishUpdateRate; + } + + private void OnPerishableExamined(Entity perishable, ref ExaminedEvent args) + { + int stage = PerishStage(perishable, MaxStages); + if (stage < 1 || stage > MaxStages) + { + // We dont push an examined string if it hasen't started "perishing" or it's already rotting + return; + } + + var isMob = HasComp(perishable); + var description = "perishable-" + stage + (!isMob ? "-nonmob" : string.Empty); + args.PushMarkup(Loc.GetString(description, ("target", Identity.Entity(perishable, EntityManager)))); + } + + private void OnShutdown(EntityUid uid, RottingComponent component, ComponentShutdown args) + { + if (TryComp(uid, out var perishable)) + { + perishable.RotNextUpdate = TimeSpan.Zero; + } + } + + private void OnRottingMobStateChanged(EntityUid uid, RottingComponent component, MobStateChangedEvent args) + { + if (args.NewMobState == MobState.Dead) + return; + RemCompDeferred(uid, component); + } + + private void OnRejuvenate(EntityUid uid, RottingComponent component, RejuvenateEvent args) + { + RemCompDeferred(uid); } private void OnExamined(EntityUid uid, RottingComponent component, ExaminedEvent args) @@ -41,4 +97,75 @@ private void OnExamined(EntityUid uid, RottingComponent component, ExaminedEvent args.PushMarkup(Loc.GetString(description, ("target", Identity.Entity(uid, EntityManager)))); } + + /// + /// Return an integer from 0 to maxStage representing how close to rotting an entity is. Used to + /// generate examine messages for items that are starting to rot. + /// + public int PerishStage(Entity perishable, int maxStages) + { + if (perishable.Comp.RotAfter.TotalSeconds == 0 || perishable.Comp.RotAccumulator.TotalSeconds == 0) + return 0; + return (int)(1 + maxStages * perishable.Comp.RotAccumulator.TotalSeconds / perishable.Comp.RotAfter.TotalSeconds); + } + + public bool IsRotProgressing(EntityUid uid, PerishableComponent? perishable) + { + // things don't perish by default. + if (!Resolve(uid, ref perishable, false)) + return false; + + // only dead things or inanimate objects can rot + if (TryComp(uid, out var mobState) && !_mobState.IsDead(uid, mobState)) + return false; + + if (_container.TryGetOuterContainer(uid, Transform(uid), out var container) && + HasComp(container.Owner)) + { + return false; + } + + var ev = new IsRottingEvent(); + RaiseLocalEvent(uid, ref ev); + + return !ev.Handled; + } + + public bool IsRotten(EntityUid uid, RottingComponent? rotting = null) + { + return Resolve(uid, ref rotting, false); + } + + public void ReduceAccumulator(EntityUid uid, TimeSpan time) + { + if (!TryComp(uid, out var perishable)) + return; + + if (!TryComp(uid, out var rotting)) + { + perishable.RotAccumulator -= time; + return; + } + var total = (rotting.TotalRotTime + perishable.RotAccumulator) - time; + + if (total < perishable.RotAfter) + { + RemCompDeferred(uid, rotting); + perishable.RotAccumulator = total; + } + + else + rotting.TotalRotTime = total - perishable.RotAfter; + } + + /// + /// Return the rot stage, usually from 0 to 2 inclusive. + /// + public int RotStage(EntityUid uid, RottingComponent? comp = null, PerishableComponent? perishable = null) + { + if (!Resolve(uid, ref comp, ref perishable)) + return 0; + + return (int) (comp.TotalRotTime.TotalSeconds / perishable.RotAfter.TotalSeconds); + } } diff --git a/Content.Shared/CCVar/CCVars.cs b/Content.Shared/CCVar/CCVars.cs index facbd1d71b6..3fc7e7247e6 100644 --- a/Content.Shared/CCVar/CCVars.cs +++ b/Content.Shared/CCVar/CCVars.cs @@ -2291,6 +2291,55 @@ public static readonly CVarDef /// public static readonly CVarDef StationGoalsChance = CVarDef.Create("game.station_goals_chance", 0.1f, CVar.SERVERONLY); + + + #region CPR System + /// + /// Controls whether the entire CPR system runs. When false, nobody can perform CPR. You should probably remove the trait too + /// if you are wishing to permanently disable the system on your server. + /// + public static readonly CVarDef EnableCPR = + CVarDef.Create("cpr.enable", true, CVar.REPLICATED | CVar.SERVER); + + /// + /// Toggles whether or not CPR reduces rot timers(As an abstraction of delaying brain death, the IRL actual purpose of CPR) + /// + public static readonly CVarDef CPRReducesRot = + CVarDef.Create("cpr.reduces_rot", true, CVar.REPLICATED | CVar.SERVER); + + /// + /// Toggles whether or not CPR heals airloss, included for completeness sake. I'm not going to stop you if your intention is to make CPR do nothing. + /// I guess it might be funny to troll your players with? I won't judge. + /// + public static readonly CVarDef CPRHealsAirloss = + CVarDef.Create("cpr.heals_airloss", true, CVar.REPLICATED | CVar.SERVER); + + /// + /// The chance for a patient to be resuscitated when CPR is successfully performed. + /// Setting this above 0 isn't very realistic, but people who see CPR in movies and TV will expect CPR to work this way. + /// + public static readonly CVarDef CPRResuscitationChance = + CVarDef.Create("cpr.resuscitation_chance", 0.05f, CVar.REPLICATED | CVar.SERVER); + + /// + /// By default, CPR reduces rot timers by an amount of seconds equal to the time spent performing CPR. This is an optional multiplier that can increase or decrease the amount + /// of rot reduction. Set it to 2 for if you want 3 seconds of CPR to reduce 6 seconds of rot. + /// + /// + /// If you're wondering why there isn't a CVar for setting the duration of the doafter, that's because it's not actually possible to have a timespan in cvar form + /// Curiously, it's also not possible for **shared** systems to set variable timespans. Which is where this system lives. + /// + public static readonly CVarDef CPRRotReductionMultiplier = + CVarDef.Create("cpr.rot_reduction_multiplier", 1f, CVar.REPLICATED | CVar.SERVER); + + /// + /// By default, CPR heals airloss by 1 point for every second spent performing CPR. Just like above, this directly multiplies the healing amount. + /// Set it to 2 to get 6 points of airloss healing for every 3 seconds of CPR. + /// + public static readonly CVarDef CPRAirlossReductionMultiplier = + CVarDef.Create("cpr.airloss_reduction_multiplier", 1f, CVar.REPLICATED | CVar.SERVER); + + #endregion #region Contests System diff --git a/Content.Shared/Medical/CPR/Components/CPRTrainingComponent.cs b/Content.Shared/Medical/CPR/Components/CPRTrainingComponent.cs new file mode 100644 index 00000000000..e01250858a1 --- /dev/null +++ b/Content.Shared/Medical/CPR/Components/CPRTrainingComponent.cs @@ -0,0 +1,33 @@ +using Robust.Shared.GameStates; +using Content.Shared.DoAfter; +using Robust.Shared.Audio; +using Robust.Shared.Serialization; + +namespace Content.Shared.Medical.CPR +{ + [RegisterComponent, NetworkedComponent] + public sealed partial class CPRTrainingComponent : Component + { + [DataField] + public SoundSpecifier CPRSound = new SoundPathSpecifier("/Audio/Effects/CPR.ogg"); + + /// + /// How long the doafter for CPR takes + /// + [DataField] + public TimeSpan DoAfterDuration = TimeSpan.FromSeconds(3); + + [DataField] + public int AirlossHeal = 6; + + [DataField] + public float CrackRibsModifier = 1f; + public EntityUid? CPRPlayingStream; + } + + [Serializable, NetSerializable] + public sealed partial class CPRDoAfterEvent : SimpleDoAfterEvent + { + + } +} diff --git a/Content.Shared/Medical/CPR/Systems/CPRSystem.CVars.cs b/Content.Shared/Medical/CPR/Systems/CPRSystem.CVars.cs new file mode 100644 index 00000000000..9840b8ffbd4 --- /dev/null +++ b/Content.Shared/Medical/CPR/Systems/CPRSystem.CVars.cs @@ -0,0 +1,27 @@ +using Content.Shared.CCVar; +using Robust.Shared.Configuration; + +namespace Content.Shared.Medical.CPR +{ + public sealed partial class CPRSystem + { + [Dependency] private readonly IConfigurationManager _cfg = default!; + + public bool EnableCPR { get; private set; } + public bool HealsAirloss { get; private set; } + public bool ReducesRot { get; private set; } + public float ResuscitationChance { get; private set; } + public float RotReductionMultiplier { get; private set; } + public float AirlossReductionMultiplier { get; private set; } + + private void InitializeCVars() + { + Subs.CVar(_cfg, CCVars.EnableCPR, value => EnableCPR = value, true); + Subs.CVar(_cfg, CCVars.CPRHealsAirloss, value => HealsAirloss = value, true); + Subs.CVar(_cfg, CCVars.CPRReducesRot, value => ReducesRot = value, true); + Subs.CVar(_cfg, CCVars.CPRResuscitationChance, value => ResuscitationChance = value, true); + Subs.CVar(_cfg, CCVars.CPRRotReductionMultiplier, value => RotReductionMultiplier = value, true); + Subs.CVar(_cfg, CCVars.CPRAirlossReductionMultiplier, value => AirlossReductionMultiplier = value, true); + } + } +} diff --git a/Content.Shared/Medical/CPR/Systems/CPRSystem.cs b/Content.Shared/Medical/CPR/Systems/CPRSystem.cs new file mode 100644 index 00000000000..799c0664a66 --- /dev/null +++ b/Content.Shared/Medical/CPR/Systems/CPRSystem.cs @@ -0,0 +1,132 @@ +using Content.Shared.Popups; +using Content.Shared.Atmos.Rotting; +using Content.Shared.Damage; +using Content.Shared.DoAfter; +using Content.Shared.Inventory; +using Content.Shared.Mobs; +using Content.Shared.Mobs.Components; +using Content.Shared.Mobs.Systems; +using Content.Shared.Verbs; +using Robust.Shared.Network; +using Robust.Shared.Utility; +using Robust.Shared.Random; +using Robust.Shared.Audio.Systems; + +namespace Content.Shared.Medical.CPR +{ + public sealed partial class CPRSystem : EntitySystem + { + [Dependency] private readonly SharedPopupSystem _popupSystem = default!; + [Dependency] private readonly SharedDoAfterSystem _doAfterSystem = default!; + [Dependency] private readonly MobStateSystem _mobStateSystem = default!; + [Dependency] private readonly DamageableSystem _damageable = default!; + [Dependency] private readonly MobThresholdSystem _mobThreshold = default!; + [Dependency] private readonly IRobustRandom _robustRandom = default!; + [Dependency] private readonly SharedRottingSystem _rottingSystem = default!; + [Dependency] private readonly InventorySystem _inventory = default!; + [Dependency] private readonly SharedAudioSystem _audio = default!; + [Dependency] private readonly INetManager _net = default!; + public override void Initialize() + { + base.Initialize(); + InitializeCVars(); + SubscribeLocalEvent>(AddCPRVerb); + SubscribeLocalEvent(OnCPRDoAfter); + } + + private void AddCPRVerb(EntityUid uid, CPRTrainingComponent component, GetVerbsEvent args) + { + if (!EnableCPR || !args.CanInteract || !args.CanAccess + || !TryComp(args.Target, out var targetState) + || targetState.CurrentState == MobState.Alive) + return; + + InnateVerb verb = new() + { + Act = () => + { + StartCPR(uid, args.Target, component); + }, + Text = Loc.GetString("cpr-verb"), + Icon = new SpriteSpecifier.Rsi(new("Interface/Alerts/human_alive.rsi"), "health4"), + Priority = 2 + }; + args.Verbs.Add(verb); + } + + private void StartCPR(EntityUid performer, EntityUid target, CPRTrainingComponent cprComponent) + { + if (HasComp(target)) + { + _popupSystem.PopupEntity(Loc.GetString("cpr-target-rotting", ("entity", target)), performer, performer); + return; + } + + if (_inventory.TryGetSlotEntity(target, "outerClothing", out var outer)) + { + _popupSystem.PopupEntity(Loc.GetString("cpr-must-remove", ("clothing", outer)), performer, performer, PopupType.MediumCaution); + return; + } + + if (_inventory.TryGetSlotEntity(target, "mask", out var mask)) + { + _popupSystem.PopupEntity(Loc.GetString("cpr-must-remove", ("clothing", mask)), performer, performer, PopupType.MediumCaution); + return; + } + + if (_inventory.TryGetSlotEntity(performer, "mask", out var maskSelf)) + { + _popupSystem.PopupEntity(Loc.GetString("cpr-must-remove-own-mask", ("clothing", maskSelf)), performer, performer, PopupType.MediumCaution); + return; + } + + if (_net.IsServer) + { + _popupSystem.PopupEntity(Loc.GetString("cpr-start-second-person", ("target", target)), target, performer, PopupType.Medium); + _popupSystem.PopupEntity(Loc.GetString("cpr-start-second-person-patient", ("user", performer)), target, target, PopupType.Medium); + cprComponent.CPRPlayingStream = _audio.PlayPvs(cprComponent.CPRSound, performer).Value.Entity; + } + + _doAfterSystem.TryStartDoAfter(new DoAfterArgs(EntityManager, performer, cprComponent.DoAfterDuration, new CPRDoAfterEvent(), performer, target, performer) + { + BreakOnTargetMove = true, + BreakOnUserMove = true, + NeedHand = true, + BlockDuplicate = true + }); + } + + private void OnCPRDoAfter(EntityUid performer, CPRTrainingComponent component, CPRDoAfterEvent args) + { + component.CPRPlayingStream = _audio.Stop(component.CPRPlayingStream); + + if (args.Target == null) + return; + + if (HealsAirloss) + { + // There is PROBABLY a better way to do this, by all means let me know + var healing = new DamageSpecifier() + { + DamageDict = new() + { + { "Asphyxiation", -component.AirlossHeal * AirlossReductionMultiplier} + } + }; + _damageable.TryChangeDamage(args.Target, healing, true, origin: performer); + } + + if (ReducesRot) + _rottingSystem.ReduceAccumulator((EntityUid) args.Target, component.DoAfterDuration * RotReductionMultiplier); + + if (_robustRandom.Prob(ResuscitationChance) + && _mobThreshold.TryGetThresholdForState((EntityUid) args.Target, MobState.Dead, out var threshold) + && TryComp(args.Target, out var damageableComponent) + && TryComp(args.Target, out var state) + && damageableComponent.TotalDamage < threshold) + { + _mobStateSystem.ChangeMobState(args.Target.Value, MobState.Critical, state, performer); + } + } + } +} diff --git a/Resources/Audio/Effects/CPR.ogg b/Resources/Audio/Effects/CPR.ogg new file mode 100644 index 00000000000..2c7cedd2033 Binary files /dev/null and b/Resources/Audio/Effects/CPR.ogg differ diff --git a/Resources/Locale/en-US/medical/components/cpr-training-component.ftl b/Resources/Locale/en-US/medical/components/cpr-training-component.ftl new file mode 100644 index 00000000000..7ed824a369f --- /dev/null +++ b/Resources/Locale/en-US/medical/components/cpr-training-component.ftl @@ -0,0 +1,6 @@ +cpr-start-second-person = You start performing CPR on {CAPITALIZE($target)}. +cpr-start-second-person-patient = {CAPITALIZE(THE($user))} starts performing CPR on you. +cpr-must-remove = You must remove {THE($clothing)} from the patient. +cpr-must-remove-own-mask = You must remove your {THE($clothing)}. +cpr-target-rotting = {CAPITALIZE($entity)} is too far gone... +cpr-verb = Perform CPR diff --git a/Resources/Locale/en-US/traits/traits.ftl b/Resources/Locale/en-US/traits/traits.ftl index 600a9834fd4..f4c4b158fce 100644 --- a/Resources/Locale/en-US/traits/traits.ftl +++ b/Resources/Locale/en-US/traits/traits.ftl @@ -35,6 +35,13 @@ trait-description-Stutter = You t-t-talk with a bit of a s-s-stutter... trait-name-Snoring = Snoring trait-description-Snoring = You will snore while sleeping. +trait-name-CPRTraining = CPR Training +trait-description-CPRTraining = At some point in your life, you have received training in how to perform CPR. + This trait is automatically given for free to medical doctors, and is intended for non-medical characters + +trait-name-NormalVisionHarpy = Trichromat Modification +trait-description-NormalVisionHarpy = Your eyes have been modified by means of advanced medicine to see in the standard colors of Red, Green, and Blue. + trait-name-Southern = Southern Drawl trait-description-Southern = You have a different way of speakin'. diff --git a/Resources/Prototypes/DeltaV/Roles/Jobs/Security/brigmedic.yml b/Resources/Prototypes/DeltaV/Roles/Jobs/Security/brigmedic.yml index daf7f1195c0..f4b2fe95e14 100644 --- a/Resources/Prototypes/DeltaV/Roles/Jobs/Security/brigmedic.yml +++ b/Resources/Prototypes/DeltaV/Roles/Jobs/Security/brigmedic.yml @@ -26,6 +26,9 @@ special: - !type:AddImplantSpecial implants: [ MindShieldImplant ] + - !type:AddComponentSpecial + components: + - type: CPRTraining - type: startingGear id: CorpsmanGear # see Prototypes/Roles/Jobs/Fun/misc_startinggear.yml for "BrigmedicGear" diff --git a/Resources/Prototypes/Roles/Jobs/Medical/chemist.yml b/Resources/Prototypes/Roles/Jobs/Medical/chemist.yml index 3fe22792092..66466352cbe 100644 --- a/Resources/Prototypes/Roles/Jobs/Medical/chemist.yml +++ b/Resources/Prototypes/Roles/Jobs/Medical/chemist.yml @@ -14,6 +14,10 @@ - Medical - Chemistry - Maintenance + special: + - !type:AddComponentSpecial + components: + - type: CPRTraining - type: startingGear id: ChemistGear diff --git a/Resources/Prototypes/Roles/Jobs/Medical/chief_medical_officer.yml b/Resources/Prototypes/Roles/Jobs/Medical/chief_medical_officer.yml index 4a65b791283..61b1df7784f 100644 --- a/Resources/Prototypes/Roles/Jobs/Medical/chief_medical_officer.yml +++ b/Resources/Prototypes/Roles/Jobs/Medical/chief_medical_officer.yml @@ -44,6 +44,7 @@ components: - type: PsionicBonusChance #Nyano - Summary: makes it more likely to become psionic. flatBonus: 0.025 + - type: CPRTraining - type: startingGear id: CMOGear diff --git a/Resources/Prototypes/Roles/Jobs/Medical/medical_doctor.yml b/Resources/Prototypes/Roles/Jobs/Medical/medical_doctor.yml index cc048470f0c..627b0e17dc3 100644 --- a/Resources/Prototypes/Roles/Jobs/Medical/medical_doctor.yml +++ b/Resources/Prototypes/Roles/Jobs/Medical/medical_doctor.yml @@ -16,6 +16,10 @@ extendedAccess: - Chemistry - Paramedic # DeltaV - Add Paramedic access + special: + - !type:AddComponentSpecial + components: + - type: CPRTraining - type: startingGear id: DoctorGear diff --git a/Resources/Prototypes/Roles/Jobs/Medical/medical_intern.yml b/Resources/Prototypes/Roles/Jobs/Medical/medical_intern.yml index 0166a3dfadb..003eab22d25 100644 --- a/Resources/Prototypes/Roles/Jobs/Medical/medical_intern.yml +++ b/Resources/Prototypes/Roles/Jobs/Medical/medical_intern.yml @@ -15,6 +15,10 @@ access: - Medical - Maintenance + special: + - !type:AddComponentSpecial + components: + - type: CPRTraining - type: startingGear id: MedicalInternGear diff --git a/Resources/Prototypes/Roles/Jobs/Medical/paramedic.yml b/Resources/Prototypes/Roles/Jobs/Medical/paramedic.yml index 9e3484a8dcf..0937a4627ae 100644 --- a/Resources/Prototypes/Roles/Jobs/Medical/paramedic.yml +++ b/Resources/Prototypes/Roles/Jobs/Medical/paramedic.yml @@ -23,6 +23,10 @@ - Paramedic # DeltaV - Add Paramedic access extendedAccess: - Chemistry + special: + - !type:AddComponentSpecial + components: + - type: CPRTraining - type: startingGear id: ParamedicGear diff --git a/Resources/Prototypes/Roles/Jobs/Medical/senior_physician.yml b/Resources/Prototypes/Roles/Jobs/Medical/senior_physician.yml index ac6e0620f5a..d13fd18afdd 100644 --- a/Resources/Prototypes/Roles/Jobs/Medical/senior_physician.yml +++ b/Resources/Prototypes/Roles/Jobs/Medical/senior_physician.yml @@ -21,6 +21,10 @@ - Medical - Maintenance - Chemistry + special: + - !type:AddComponentSpecial + components: + - type: CPRTraining - type: startingGear id: SeniorPhysicianGear diff --git a/Resources/Prototypes/Traits/skills.yml b/Resources/Prototypes/Traits/skills.yml index 16b628a56d8..b23e0216224 100644 --- a/Resources/Prototypes/Traits/skills.yml +++ b/Resources/Prototypes/Traits/skills.yml @@ -1,3 +1,20 @@ +- type: trait + id: CPRTraining + category: Mental + points: -2 + components: + - type: CPRTraining + requirements: + - !type:CharacterJobRequirement + inverted: true + jobs: + - MedicalDoctor + - Chemist + - MedicalIntern + - Paramedic + - ChiefMedicalOfficer + - Brigmedic + - type: trait id: HeavyweightDrunk category: Physical