From d1d939a8987cb2fc8d50dee2572974c39de9f128 Mon Sep 17 00:00:00 2001 From: Janet Blackquill Date: Fri, 21 Nov 2025 00:32:28 -0500 Subject: [PATCH] rebase --- .../Body/Systems/MetabolizerSystem.cs | 90 ++++++++++- Content.Server/Zombies/ZombieSystem.cs | 8 +- .../MetaboliteThresholdSystem.cs | 60 ++++---- .../_Offbrand/EntityEffects/ZombifySystem.cs | 13 +- .../_Offbrand/MMI/MMIExtractorSystem.cs | 4 +- .../Chemistry/Reagent/ReagentPrototype.cs | 18 +-- .../Damage/Systems/DamageableSystem.API.cs | 24 ++- .../Damage/Systems/DamageableSystem.Events.cs | 9 +- .../Damage/Systems/DamageableSystem.cs | 5 +- .../StatusEffectSystem.Relay.cs | 4 +- .../EntityEffects/AdjustReagentGaussian.cs | 52 ++++--- .../_Offbrand/EntityEffects/BrainDamage.cs | 26 ++-- .../_Offbrand/EntityEffects/ClampWounds.cs | 22 +-- .../_Offbrand/EntityEffects/HeartDamage.cs | 24 ++- .../_Offbrand/EntityEffects/IsZombie.cs | 24 +-- .../_Offbrand/EntityEffects/IsZombieImmune.cs | 24 +-- .../_Offbrand/EntityEffects/LungDamage.cs | 26 ++-- .../EntityEffects/MetaboliteThreshold.cs | 22 ++- .../EntityEffects/ModifyBrainDamage.cs | 29 ++-- .../EntityEffects/ModifyBrainOxygen.cs | 29 ++-- .../EntityEffects/ModifyHeartDamage.cs | 29 ++-- .../EntityEffects/ModifyLungDamage.cs | 29 ++-- .../EntityEffects/RemoveStatusEffect.cs | 23 +-- .../_Offbrand/EntityEffects/StartHeart.cs | 22 +-- .../EntityEffects/TotalGroupDamage.cs | 40 ----- .../_Offbrand/EntityEffects/Zombify.cs | 6 +- ...eStatusEffectRandomlyStatusEffectSystem.cs | 2 +- .../DamageOverTimeStatusEffectSystem.cs | 1 + .../DisruptOnAttackStatusEffectSystem.cs | 2 +- .../GunBackfireStatusEffectSystem.cs | 2 +- .../HyposprayBackfireStatusEffectSystem.cs | 2 +- .../SlowOnDamageModifierStatusEffectSystem.cs | 2 +- .../Triggers/TriggerOnDoAfterSystem.cs | 4 +- .../Wounds/BrainDamageOnDamageSystem.cs | 2 + .../_Offbrand/Wounds/BrainDamageSystem.cs | 8 +- Content.Shared/_Offbrand/Wounds/CprSystem.cs | 2 +- .../Wounds/CryostasisFactorSystem.cs | 2 +- .../Wounds/HeartDamageOnDamageSystem.cs | 2 + .../_Offbrand/Wounds/HeartSystem.cs | 10 +- .../_Offbrand/Wounds/IntrinsicPainSystem.cs | 1 + .../_Offbrand/Wounds/LungDamageSystem.cs | 1 + .../Wounds/LungDamageTemperatureSystem.cs | 4 +- .../_Offbrand/Wounds/MaximumDamageSystem.cs | 1 + .../_Offbrand/Wounds/TendingSystem.cs | 4 +- .../Wounds/UniqueWoundOnDamageSystem.cs | 4 +- .../_Offbrand/Wounds/WoundableSystem.cs | 14 +- Resources/Locale/en-US/_Offbrand/effects.ftl | 44 +++--- .../Reagents/Consumable/Drink/alcohol.yml | 9 +- Resources/Prototypes/Reagents/botany.yml | 42 ++--- Resources/Prototypes/Reagents/gases.yml | 8 +- Resources/Prototypes/Reagents/medicine.yml | 15 +- Resources/Prototypes/Reagents/toxins.yml | 59 +++++--- Resources/Prototypes/_Offbrand/reagents.yml | 143 +++++++++++------- 53 files changed, 577 insertions(+), 475 deletions(-) delete mode 100644 Content.Shared/_Offbrand/EntityEffects/TotalGroupDamage.cs rename {Content.Server => Content.Shared}/_Offbrand/Wounds/CryostasisFactorSystem.cs (96%) rename {Content.Server => Content.Shared}/_Offbrand/Wounds/LungDamageTemperatureSystem.cs (93%) diff --git a/Content.Server/Body/Systems/MetabolizerSystem.cs b/Content.Server/Body/Systems/MetabolizerSystem.cs index b5b30ae74c..06959dcf27 100644 --- a/Content.Server/Body/Systems/MetabolizerSystem.cs +++ b/Content.Server/Body/Systems/MetabolizerSystem.cs @@ -34,6 +34,7 @@ public sealed class MetabolizerSystem : SharedMetabolizerSystem [Dependency] private readonly SharedEntityConditionsSystem _entityConditions = default!; [Dependency] private readonly SharedEntityEffectsSystem _entityEffects = default!; [Dependency] private readonly SharedSolutionContainerSystem _solutionContainerSystem = default!; + [Dependency] private readonly Content.Shared.StatusEffectNew.StatusEffectsSystem _statusEffects = default!; private EntityQuery _organQuery; private EntityQuery _solutionQuery; @@ -129,7 +130,7 @@ public sealed class MetabolizerSystem : SharedMetabolizerSystem if (solutionEntityUid is null || soln is null || solution is null - || solution.Contents.Count == 0) + || (solution.Contents.Count == 0 && ent.Comp1.MetabolizingReagents.Count == 0 && ent.Comp1.Metabolites.Count == 0)) // Offbrand - we need to ensure we clear out metabolizing reagents { return; } @@ -139,6 +140,7 @@ public sealed class MetabolizerSystem : SharedMetabolizerSystem var list = solution.Contents.ToArray(); _random.Shuffle(list); + var metabolized = new HashSet>(); // Offbrand int reagents = 0; foreach (var (reagent, quantity) in list) { @@ -156,10 +158,13 @@ public sealed class MetabolizerSystem : SharedMetabolizerSystem continue; } + // Offbrand - keep processing for status effects and metabolites // we're done here entirely if this is true - if (reagents >= ent.Comp1.MaxReagentsProcessable) - return; + // if (reagents >= ent.Comp1.MaxReagentsProcessable) + // return; + metabolized.Add(reagent.Prototype); + // End Offbrand // loop over all our groups and see which ones apply if (ent.Comp1.MetabolismGroups is null) @@ -194,6 +199,16 @@ public sealed class MetabolizerSystem : SharedMetabolizerSystem var actualEntity = ent.Comp2?.Body ?? solutionEntityUid.Value; + // Begin Offbrand - status effects + foreach (var effect in entry.StatusEffects) + { + if (!_entityConditions.TryConditions(actualEntity, effect.Conditions)) + _statusEffects.TryRemoveStatusEffect(actualEntity, effect.StatusEffect); + else + _statusEffects.TryUpdateStatusEffectDuration(actualEntity, effect.StatusEffect, out _); + } + // End Offbrand - status effects + // do all effects, if conditions apply foreach (var effect in entry.Effects) { @@ -232,13 +247,80 @@ public sealed class MetabolizerSystem : SharedMetabolizerSystem // remove a certain amount of reagent if (mostToRemove > FixedPoint2.Zero) { - solution.RemoveReagent(reagent, mostToRemove); + var removed = solution.RemoveReagent(reagent, mostToRemove); // Offbrand // We have processed a reagant, so count it towards the cap reagents += 1; + + // Begin Offbrand - track metabbolites + if (!ent.Comp1.Metabolites.ContainsKey(reagent.Prototype)) + ent.Comp1.Metabolites[reagent.Prototype] = 0; + ent.Comp1.Metabolites[reagent.Prototype] += removed; + // End Offbrand - track metabbolites } } + // Begin Offbrand + foreach (var reagent in ent.Comp1.MetabolizingReagents) + { + if (metabolized.Contains(reagent)) + continue; + + var proto = _prototypeManager.Index(reagent); + var actualEntity = ent.Comp2?.Body ?? solutionEntityUid.Value; + + if (ent.Comp1.MetabolismGroups is null) + continue; + + foreach (var group in ent.Comp1.MetabolismGroups) + { + if (proto.Metabolisms is null) + continue; + + if (!proto.Metabolisms.TryGetValue(group.Id, out var entry)) + continue; + + foreach (var effect in entry.StatusEffects) + { + _statusEffects.TryRemoveStatusEffect(actualEntity, effect.StatusEffect); + } + } + } + ent.Comp1.MetabolizingReagents = metabolized; + + foreach (var metaboliteReagent in ent.Comp1.Metabolites.Keys) + { + if (ent.Comp1.MetabolizingReagents.Contains(metaboliteReagent)) + continue; + + if (!_prototypeManager.Resolve(metaboliteReagent, out var proto) || proto.Metabolisms is not { } metabolisms) + continue; + + if (ent.Comp1.MetabolismGroups is null) + continue; + + ReagentEffectsEntry? entry = null; + var metabolismRateModifier = FixedPoint2.Zero; + foreach (var group in ent.Comp1.MetabolismGroups) + { + if (!proto.Metabolisms.TryGetValue(group.Id, out entry)) + continue; + + metabolismRateModifier = group.MetabolismRateModifier; + break; + } + + if (entry is not { } metabolismEntry) + continue; + + var rate = metabolismEntry.MetabolismRate * metabolismRateModifier * ent.Comp1.MetaboliteDecayFactor; + ent.Comp1.Metabolites[metaboliteReagent] -= rate; + + if (ent.Comp1.Metabolites[metaboliteReagent] <= 0) + ent.Comp1.Metabolites.Remove(metaboliteReagent); + } + // End Offbrand + _solutionContainerSystem.UpdateChemicals(soln.Value); } diff --git a/Content.Server/Zombies/ZombieSystem.cs b/Content.Server/Zombies/ZombieSystem.cs index 7c938d9466..81f9cb3955 100644 --- a/Content.Server/Zombies/ZombieSystem.cs +++ b/Content.Server/Zombies/ZombieSystem.cs @@ -259,12 +259,12 @@ namespace Content.Server.Zombies args.Handled = true; continue; } - else if (!HasComp(entity)) // Offbrand + else if (!HasComp(uid)) // Offbrand { - if (!HasComp(entity) && !HasComp(args.User) && _random.Prob(GetZombieInfectionChance(entity, component))) + if (!HasComp(uid) && !cannotSpread && _random.Prob(GetZombieInfectionChance(uid, entity.Comp))) { - EnsureComp(entity); - EnsureComp(entity); + EnsureComp(uid); + EnsureComp(uid); } } diff --git a/Content.Server/_Offbrand/EntityEffects/MetaboliteThresholdSystem.cs b/Content.Server/_Offbrand/EntityEffects/MetaboliteThresholdSystem.cs index 2471128216..665f170320 100644 --- a/Content.Server/_Offbrand/EntityEffects/MetaboliteThresholdSystem.cs +++ b/Content.Server/_Offbrand/EntityEffects/MetaboliteThresholdSystem.cs @@ -1,48 +1,50 @@ using Content.Server.Body.Components; using Content.Shared._Offbrand.EntityEffects; -using Content.Shared.EntityEffects; +using Content.Shared.Body.Organ; +using Content.Shared.Chemistry.Components.SolutionManager; +using Content.Shared.Chemistry.Components; +using Content.Shared.Chemistry.EntitySystems; +using Content.Shared.EntityConditions; using Content.Shared.FixedPoint; namespace Content.Server._Offbrand.EntityEffects; -public sealed class MetaboliteThresholdSystem : EntitySystem +public sealed class MetaboliteThresholdEntityConditionSystem : EntityConditionSystem { - public override void Initialize() - { - base.Initialize(); + [Dependency] private readonly SharedSolutionContainerSystem _solutionContainer = default!; - SubscribeLocalEvent>(OnCheckMetaboliteThreshold); + private Solution? GetSolution(Entity ent) + { + if (!Resolve(ent, ref ent.Comp2, false)) + return null; + + if (ent.Comp1.SolutionOnBody) + { + if (ent.Comp2.Body is { } body && _solutionContainer.TryGetSolution(body, ent.Comp1.SolutionName, out _, out var solution)) + return solution; + + return null; + } + else + { + if (_solutionContainer.TryGetSolution(ent.Owner, ent.Comp1.SolutionName, out _, out var solution)) + return solution; + } + + return null; } - private void OnCheckMetaboliteThreshold(ref CheckEntityEffectConditionEvent args) + protected override void Condition(Entity ent, ref EntityConditionEvent args) { - if (args.Args is not EntityEffectReagentArgs reagentArgs) - throw new NotImplementedException(); - var reagent = args.Condition.Reagent; - if (reagent == null) - reagent = reagentArgs.Reagent?.ID; - - if (reagent is not { } metaboliteReagent) - { - args.Result = true; - return; - } - - if (!TryComp(reagentArgs.OrganEntity, out var metabolizer)) - { - args.Result = true; - return; - } - - var metabolites = metabolizer.Metabolites; + var metabolites = ent.Comp.Metabolites; var quant = FixedPoint2.Zero; - metabolites.TryGetValue(metaboliteReagent, out quant); + metabolites.TryGetValue(reagent, out quant); - if (args.Condition.IncludeBloodstream && reagentArgs.Source != null) + if (args.Condition.IncludeBloodstream && GetSolution((ent, ent.Comp, null)) is { } solution) { - quant += reagentArgs.Source.GetTotalPrototypeQuantity(metaboliteReagent); + quant += solution.GetTotalPrototypeQuantity(reagent); } args.Result = quant >= args.Condition.Min && quant <= args.Condition.Max; diff --git a/Content.Server/_Offbrand/EntityEffects/ZombifySystem.cs b/Content.Server/_Offbrand/EntityEffects/ZombifySystem.cs index b0e700c179..a359335de0 100644 --- a/Content.Server/_Offbrand/EntityEffects/ZombifySystem.cs +++ b/Content.Server/_Offbrand/EntityEffects/ZombifySystem.cs @@ -4,19 +4,12 @@ using Content.Shared.EntityEffects; namespace Content.Server._Offbrand.EntityEffects; -public sealed class ZombifySystem : EntitySystem +public sealed class ZombifySystem : EntityEffectSystem { [Dependency] private readonly ZombieSystem _zombie = default!; - public override void Initialize() + protected override void Effect(Entity ent, ref EntityEffectEvent args) { - base.Initialize(); - - SubscribeLocalEvent>(OnExecuteZombify); - } - - private void OnExecuteZombify(ref ExecuteEntityEffectEvent args) - { - _zombie.ZombifyEntity(args.Args.TargetEntity); + _zombie.ZombifyEntity(ent); } } diff --git a/Content.Server/_Offbrand/MMI/MMIExtractorSystem.cs b/Content.Server/_Offbrand/MMI/MMIExtractorSystem.cs index 090b263f00..c561dfa2dc 100644 --- a/Content.Server/_Offbrand/MMI/MMIExtractorSystem.cs +++ b/Content.Server/_Offbrand/MMI/MMIExtractorSystem.cs @@ -1,9 +1,9 @@ -using Content.Server.Chat.Systems; using Content.Server.EUI; using Content.Shared._Offbrand.MMI; using Content.Shared._Offbrand.Wounds; using Content.Shared.Body.Components; using Content.Shared.Body.Systems; +using Content.Shared.Chat; using Content.Shared.Containers.ItemSlots; using Content.Shared.DoAfter; using Content.Shared.Interaction; @@ -17,12 +17,12 @@ namespace Content.Server._Offbrand.MMI; public sealed class MMIExtractorSystem : EntitySystem { [Dependency] private readonly BrainDamageSystem _brainDamage = default!; - [Dependency] private readonly ChatSystem _chat = default!; [Dependency] private readonly EntityWhitelistSystem _whitelist = default!; [Dependency] private readonly EuiManager _eui = default!; [Dependency] private readonly ISharedPlayerManager _player = default!; [Dependency] private readonly ItemSlotsSystem _slots = default!; [Dependency] private readonly SharedBodySystem _body = default!; + [Dependency] private readonly SharedChatSystem _chat = default!; [Dependency] private readonly SharedDoAfterSystem _doAfter = default!; [Dependency] private readonly SharedMindSystem _mind = default!; diff --git a/Content.Shared/Chemistry/Reagent/ReagentPrototype.cs b/Content.Shared/Chemistry/Reagent/ReagentPrototype.cs index a586569a99..b13dd78116 100644 --- a/Content.Shared/Chemistry/Reagent/ReagentPrototype.cs +++ b/Content.Shared/Chemistry/Reagent/ReagentPrototype.cs @@ -298,25 +298,11 @@ namespace Content.Shared.Chemistry.Reagent public sealed partial class ReagentStatusEffectEntry { [DataField] - public EntityEffectCondition[]? Conditions; + public Content.Shared.EntityConditions.EntityCondition[]? Conditions; [DataField] public EntProtoId StatusEffect; - public bool ShouldApplyStatusEffect(EntityEffectBaseArgs args) - { - if (Conditions != null) - { - foreach (var cond in Conditions) - { - if (!cond.Condition(args)) - return false; - } - } - - return true; - } - public string? Describe(IPrototypeManager prototype, IEntitySystemManager entSys) { if (!prototype.Resolve(StatusEffect, out var effectProtoData)) @@ -325,7 +311,7 @@ namespace Content.Shared.Chemistry.Reagent return Loc.GetString("reagent-guidebook-status-effect", ("effect", effectProtoData.Name ?? string.Empty), ("conditionCount", Conditions?.Length ?? 0), ("conditions", - Content.Shared.Localizations.ContentLocalizationManager.FormatList(Conditions?.Select(x => x.GuidebookExplanation(prototype)).ToList() ?? + Content.Shared.Localizations.ContentLocalizationManager.FormatList(Conditions?.Select(x => x.EntityConditionGuidebookText(prototype)).ToList() ?? new List()))); } } diff --git a/Content.Shared/Damage/Systems/DamageableSystem.API.cs b/Content.Shared/Damage/Systems/DamageableSystem.API.cs index c2a1374901..fadb4a17c4 100644 --- a/Content.Shared/Damage/Systems/DamageableSystem.API.cs +++ b/Content.Shared/Damage/Systems/DamageableSystem.API.cs @@ -41,12 +41,13 @@ public sealed partial class DamageableSystem bool ignoreResistances = false, bool interruptsDoAfters = true, EntityUid? origin = null, - bool ignoreGlobalModifiers = false + bool ignoreGlobalModifiers = false, + bool forceRefresh = false // Offbrand ) { //! Empty just checks if the DamageSpecifier is _literally_ empty, as in, is internal dictionary of damage types is empty. // If you deal 0.0 of some damage type, Empty will be false! - return !TryChangeDamage(ent, damage, out _, ignoreResistances, interruptsDoAfters, origin, ignoreGlobalModifiers); + return !TryChangeDamage(ent, damage, out _, ignoreResistances, interruptsDoAfters, origin, ignoreGlobalModifiers, forceRefresh); // Offbrand } /// @@ -67,12 +68,13 @@ public sealed partial class DamageableSystem bool ignoreResistances = false, bool interruptsDoAfters = true, EntityUid? origin = null, - bool ignoreGlobalModifiers = false + bool ignoreGlobalModifiers = false, + bool forceRefresh = false // Offbrand ) { //! Empty just checks if the DamageSpecifier is _literally_ empty, as in, is internal dictionary of damage types is empty. // If you deal 0.0 of some damage type, Empty will be false! - newDamage = ChangeDamage(ent, damage, ignoreResistances, interruptsDoAfters, origin, ignoreGlobalModifiers); + newDamage = ChangeDamage(ent, damage, ignoreResistances, interruptsDoAfters, origin, ignoreGlobalModifiers, forceRefresh); // Offbrand return !damage.Empty; } @@ -93,7 +95,8 @@ public sealed partial class DamageableSystem bool ignoreResistances = false, bool interruptsDoAfters = true, EntityUid? origin = null, - bool ignoreGlobalModifiers = false + bool ignoreGlobalModifiers = false, + bool forceRefresh = false // Offbrand ) { var damageDone = new DamageSpecifier(); @@ -101,7 +104,7 @@ public sealed partial class DamageableSystem if (!_damageableQuery.Resolve(ent, ref ent.Comp, false)) return damageDone; - if (damage.Empty) + if (damage.Empty && !forceRefresh) return damageDone; var before = new BeforeDamageChangedEvent(damage, origin); @@ -125,13 +128,18 @@ public sealed partial class DamageableSystem RaiseLocalEvent(ent, ev); damage = ev.Damage; - if (damage.Empty) + if (damage.Empty && !forceRefresh) // Offbrand return damageDone; } if (!ignoreGlobalModifiers) damage = ApplyUniversalAllModifiers(damage); + // Begin Offbrand + var beforeCommit = new Content.Shared._Offbrand.Wounds.BeforeDamageCommitEvent(damage, forceRefresh); + RaiseLocalEvent(ent.Owner, ref beforeCommit); + damage = beforeCommit.Damage; + // End Offbrand damageDone.DamageDict.EnsureCapacity(damage.DamageDict.Count); @@ -151,7 +159,7 @@ public sealed partial class DamageableSystem } if (!damageDone.Empty) - OnEntityDamageChanged((ent, ent.Comp), damageDone, interruptsDoAfters, origin); + OnEntityDamageChanged((ent, ent.Comp), damageDone, interruptsDoAfters, origin, forceRefresh); // Offbrand return damageDone; } diff --git a/Content.Shared/Damage/Systems/DamageableSystem.Events.cs b/Content.Shared/Damage/Systems/DamageableSystem.Events.cs index 3e985ba204..d4f37d88bf 100644 --- a/Content.Shared/Damage/Systems/DamageableSystem.Events.cs +++ b/Content.Shared/Damage/Systems/DamageableSystem.Events.cs @@ -261,16 +261,23 @@ public sealed class DamageChangedEvent : EntityEventArgs /// public readonly EntityUid? Origin; + /// + /// Offbrand - If this damage changed happened as part of a forced refresh + /// + public readonly bool ForcedRefresh; + public DamageChangedEvent( DamageableComponent damageable, DamageSpecifier? damageDelta, bool interruptsDoAfters, - EntityUid? origin + EntityUid? origin, + bool forcedRefresh // Offbrand ) { Damageable = damageable; DamageDelta = damageDelta; Origin = origin; + ForcedRefresh = forcedRefresh; // Offbrand if (DamageDelta is null) return; diff --git a/Content.Shared/Damage/Systems/DamageableSystem.cs b/Content.Shared/Damage/Systems/DamageableSystem.cs index 2b4c5ad360..2b2660dfa9 100644 --- a/Content.Shared/Damage/Systems/DamageableSystem.cs +++ b/Content.Shared/Damage/Systems/DamageableSystem.cs @@ -47,7 +47,8 @@ public sealed partial class DamageableSystem : EntitySystem Entity ent, DamageSpecifier? damageDelta = null, bool interruptsDoAfters = true, - EntityUid? origin = null + EntityUid? origin = null, + bool forceRefresh = false // Offbrand ) { ent.Comp.Damage.GetDamagePerGroup(_prototypeManager, ent.Comp.DamagePerGroup); @@ -66,7 +67,7 @@ public sealed partial class DamageableSystem : EntitySystem // TODO DAMAGE // byref struct event. - RaiseLocalEvent(ent, new DamageChangedEvent(ent.Comp, damageDelta, interruptsDoAfters, origin)); + RaiseLocalEvent(ent, new DamageChangedEvent(ent.Comp, damageDelta, interruptsDoAfters, origin, forceRefresh)); // Offbrand } private void DamageableGetState(Entity ent, ref ComponentGetState args) diff --git a/Content.Shared/StatusEffectNew/StatusEffectSystem.Relay.cs b/Content.Shared/StatusEffectNew/StatusEffectSystem.Relay.cs index 93205c7e93..23cf05daa0 100644 --- a/Content.Shared/StatusEffectNew/StatusEffectSystem.Relay.cs +++ b/Content.Shared/StatusEffectNew/StatusEffectSystem.Relay.cs @@ -44,7 +44,7 @@ public sealed partial class StatusEffectsSystem SubscribeLocalEvent(RefRelayStatusEffectEvent); // Offbrand SubscribeLocalEvent(RefRelayStatusEffectEvent); // Offbrand SubscribeLocalEvent(RefRelayStatusEffectEvent); // Offbrand - SubscribeLocalEvent(RefRelayStatusEffectEvent); // Offbrand + SubscribeLocalEvent(RefRelayStatusEffectEvent); // Offbrand SubscribeLocalEvent(RelayStatusEffectEvent); // Offbrand SubscribeLocalEvent(RelayStatusEffectEvent); // Offbrand SubscribeLocalEvent(RelayStatusEffectEvent); // Offbrand @@ -52,7 +52,7 @@ public sealed partial class StatusEffectsSystem SubscribeLocalEvent(RelayStatusEffectEvent); // Offbrand SubscribeLocalEvent(RelayStatusEffectEvent); // Offbrand SubscribeLocalEvent(RelayStatusEffectEvent); // Offbrand - SubscribeLocalEvent(RelayStatusEffectEvent); // Offbrand + SubscribeLocalEvent(RelayStatusEffectEvent); // Offbrand SubscribeLocalEvent(RelayStatusEffectEvent); // Offbrand SubscribeLocalEvent>(RelayStatusEffectEvent); // Offbrand } diff --git a/Content.Shared/_Offbrand/EntityEffects/AdjustReagentGaussian.cs b/Content.Shared/_Offbrand/EntityEffects/AdjustReagentGaussian.cs index 7de38fe6e2..18fb009605 100644 --- a/Content.Shared/_Offbrand/EntityEffects/AdjustReagentGaussian.cs +++ b/Content.Shared/_Offbrand/EntityEffects/AdjustReagentGaussian.cs @@ -1,3 +1,5 @@ +using Content.Shared.Chemistry.Components; +using Content.Shared.Chemistry.EntitySystems; using Content.Shared.Chemistry.Reagent; using Content.Shared.EntityEffects; using Content.Shared.FixedPoint; @@ -8,7 +10,7 @@ using Robust.Shared.Timing; namespace Content.Shared._Offbrand.EntityEffects; -public sealed partial class AdjustReagentGaussian : EntityEffect +public sealed partial class AdjustReagentGaussian : EntityEffectBase { [DataField(required: true)] public ProtoId Reagent; @@ -19,32 +21,10 @@ public sealed partial class AdjustReagentGaussian : EntityEffect [DataField(required: true)] public double σ; - public override void Effect(EntityEffectBaseArgs args) - { - if (args is not EntityEffectReagentArgs reagentArgs) - throw new NotImplementedException(); - - if (reagentArgs.Source == null) - return; - - var timing = IoCManager.Resolve(); - - var seed = SharedRandomExtensions.HashCodeCombine(new() { (int)timing.CurTick.Value, args.EntityManager.GetNetEntity(args.TargetEntity).Id }); - var rand = new System.Random(seed); - - var amount = rand.NextGaussian(μ, σ); - amount *= reagentArgs.Scale.Double(); - - if (amount < 0 && reagentArgs.Source.ContainsPrototype(Reagent)) - reagentArgs.Source.RemoveReagent(Reagent, -amount); - else if (amount > 0) - reagentArgs.Source.AddReagent(Reagent, amount); - } - - protected override string? ReagentEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys) + public override string? EntityEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys) { var proto = prototype.Index(Reagent); - return Loc.GetString("reagent-effect-guidebook-adjust-reagent-gaussian", + return Loc.GetString("entity-effect-guidebook-adjust-reagent-gaussian", ("chance", Probability), ("deltasign", Math.Sign(μ)), ("reagent", proto.LocalizedName), @@ -52,3 +32,25 @@ public sealed partial class AdjustReagentGaussian : EntityEffect ("sigma", Math.Abs(σ))); } } + +public sealed class AdjustReagentGaussianEntityEffectSystem : EntityEffectSystem +{ + [Dependency] private readonly IGameTiming _timing = default!; + [Dependency] private readonly IRobustRandom _random = default!; + [Dependency] private readonly SharedSolutionContainerSystem _solutionContainer = default!; + + protected override void Effect(Entity ent, ref EntityEffectEvent args) + { + var seed = SharedRandomExtensions.HashCodeCombine((int)_timing.CurTick.Value, GetNetEntity(ent).Id); + var rand = new System.Random(seed); + + var amount = rand.NextGaussian(args.Effect.μ, args.Effect.σ); + amount *= args.Scale; + var reagent = args.Effect.Reagent; + + if (amount < 0) + _solutionContainer.RemoveReagent(ent, reagent, -amount); + else if (amount > 0) + _solutionContainer.TryAddReagent(ent, reagent, amount); + } +} diff --git a/Content.Shared/_Offbrand/EntityEffects/BrainDamage.cs b/Content.Shared/_Offbrand/EntityEffects/BrainDamage.cs index 98f6d8126c..3749a75af6 100644 --- a/Content.Shared/_Offbrand/EntityEffects/BrainDamage.cs +++ b/Content.Shared/_Offbrand/EntityEffects/BrainDamage.cs @@ -1,11 +1,19 @@ using Content.Shared._Offbrand.Wounds; -using Content.Shared.EntityEffects; +using Content.Shared.EntityConditions; using Content.Shared.FixedPoint; using Robust.Shared.Prototypes; namespace Content.Shared._Offbrand.EntityEffects; -public sealed partial class BrainDamage : EntityEffectCondition +public sealed class BrainDamageEntityConditionSystem : EntityConditionSystem +{ + protected override void Condition(Entity ent, ref EntityConditionEvent args) + { + args.Result = ent.Comp.Damage >= args.Condition.Min && ent.Comp.Damage <= args.Condition.Max; + } +} + +public sealed partial class BrainDamageCondition : EntityConditionBase { [DataField] public FixedPoint2 Max = FixedPoint2.MaxValue; @@ -13,19 +21,9 @@ public sealed partial class BrainDamage : EntityEffectCondition [DataField] public FixedPoint2 Min = FixedPoint2.Zero; - public override bool Condition(EntityEffectBaseArgs args) + public override string EntityConditionGuidebookText(IPrototypeManager prototype) { - if (args.EntityManager.TryGetComponent(args.TargetEntity, out var brain)) - { - return brain.Damage >= Min && brain.Damage <= Max; - } - - return false; - } - - public override string GuidebookExplanation(IPrototypeManager prototype) - { - return Loc.GetString("reagent-effect-condition-guidebook-brain-damage", + return Loc.GetString("entity-condition-guidebook-brain-damage", ("max", Max == FixedPoint2.MaxValue ? (float) int.MaxValue : Max.Float()), ("min", Min.Float())); } diff --git a/Content.Shared/_Offbrand/EntityEffects/ClampWounds.cs b/Content.Shared/_Offbrand/EntityEffects/ClampWounds.cs index 01822d37d9..b92f3f47b0 100644 --- a/Content.Shared/_Offbrand/EntityEffects/ClampWounds.cs +++ b/Content.Shared/_Offbrand/EntityEffects/ClampWounds.cs @@ -5,19 +5,23 @@ using Robust.Shared.Prototypes; namespace Content.Shared._Offbrand.EntityEffects; -public sealed partial class ClampWounds : EntityEffect +public sealed partial class ClampWounds : EntityEffectBase { [DataField(required: true)] public float Chance; - protected override string ReagentEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys) + public override string? EntityEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys) { - return Loc.GetString("reagent-effect-guidebook-clamp-wounds", ("probability", Probability), ("chance", Chance)); - } - - public override void Effect(EntityEffectBaseArgs args) - { - args.EntityManager.System() - .ClampWounds(args.TargetEntity, Chance); + return Loc.GetString("entity-effect-guidebook-clamp-wounds", ("probability", Probability), ("chance", Chance)); + } +} + +public sealed class ClampWoundsEntityEffectSystem : EntityEffectSystem +{ + [Dependency] private readonly WoundableSystem _woundable = default!; + + protected override void Effect(Entity ent, ref EntityEffectEvent args) + { + _woundable.ClampWounds(ent, args.Effect.Chance); } } diff --git a/Content.Shared/_Offbrand/EntityEffects/HeartDamage.cs b/Content.Shared/_Offbrand/EntityEffects/HeartDamage.cs index 9b070e22ff..2e4f39b346 100644 --- a/Content.Shared/_Offbrand/EntityEffects/HeartDamage.cs +++ b/Content.Shared/_Offbrand/EntityEffects/HeartDamage.cs @@ -1,11 +1,11 @@ using Content.Shared._Offbrand.Wounds; -using Content.Shared.EntityEffects; +using Content.Shared.EntityConditions; using Content.Shared.FixedPoint; using Robust.Shared.Prototypes; namespace Content.Shared._Offbrand.EntityEffects; -public sealed partial class HeartDamage : EntityEffectCondition +public sealed partial class HeartDamageCondition : EntityConditionBase { [DataField] public FixedPoint2 Max = FixedPoint2.MaxValue; @@ -13,20 +13,18 @@ public sealed partial class HeartDamage : EntityEffectCondition [DataField] public FixedPoint2 Min = FixedPoint2.Zero; - public override bool Condition(EntityEffectBaseArgs args) - { - if (args.EntityManager.TryGetComponent(args.TargetEntity, out var heartrate)) - { - return heartrate.Damage >= Min && heartrate.Damage <= Max; - } - - return false; - } - - public override string GuidebookExplanation(IPrototypeManager prototype) + public override string EntityConditionGuidebookText(IPrototypeManager prototype) { return Loc.GetString("reagent-effect-condition-guidebook-heart-damage", ("max", Max == FixedPoint2.MaxValue ? (float) int.MaxValue : Max.Float()), ("min", Min.Float())); } } + +public sealed class HeartDamageEntityConditionSystem : EntityConditionSystem +{ + protected override void Condition(Entity ent, ref EntityConditionEvent args) + { + args.Result = ent.Comp.Damage >= args.Condition.Min && ent.Comp.Damage <= args.Condition.Max; + } +} diff --git a/Content.Shared/_Offbrand/EntityEffects/IsZombie.cs b/Content.Shared/_Offbrand/EntityEffects/IsZombie.cs index 990dc94f02..6bf1c364da 100644 --- a/Content.Shared/_Offbrand/EntityEffects/IsZombie.cs +++ b/Content.Shared/_Offbrand/EntityEffects/IsZombie.cs @@ -1,21 +1,21 @@ -using Content.Shared.EntityEffects; +using Content.Shared.EntityConditions; using Content.Shared.Zombies; using Robust.Shared.Prototypes; namespace Content.Shared._Offbrand.EntityEffects; -public sealed partial class IsZombie : EntityEffectCondition +public sealed partial class IsZombieCondition : EntityConditionBase { - [DataField] - public bool Invert = false; - - public override bool Condition(EntityEffectBaseArgs args) + public override string EntityConditionGuidebookText(IPrototypeManager prototype) { - return args.EntityManager.HasComponent(args.TargetEntity) ^ Invert; - } - - public override string GuidebookExplanation(IPrototypeManager prototype) - { - return Loc.GetString("reagent-effect-condition-guidebook-is-zombie", ("invert", Invert)); + return Loc.GetString("entity-condition-guidebook-is-zombie", ("invert", Inverted)); + } +} + +public sealed class IsZombieConditionEntitySystem : EntityConditionSystem +{ + protected override void Condition(Entity ent, ref EntityConditionEvent args) + { + args.Result = HasComp(ent); } } diff --git a/Content.Shared/_Offbrand/EntityEffects/IsZombieImmune.cs b/Content.Shared/_Offbrand/EntityEffects/IsZombieImmune.cs index 71cdbc7243..dd3314814c 100644 --- a/Content.Shared/_Offbrand/EntityEffects/IsZombieImmune.cs +++ b/Content.Shared/_Offbrand/EntityEffects/IsZombieImmune.cs @@ -1,21 +1,21 @@ -using Content.Shared.EntityEffects; +using Content.Shared.EntityConditions; using Content.Shared.Zombies; using Robust.Shared.Prototypes; namespace Content.Shared._Offbrand.EntityEffects; -public sealed partial class IsZombieImmune : EntityEffectCondition +public sealed partial class IsZombieImmuneCondition : EntityConditionBase { - [DataField] - public bool Invert = false; - - public override bool Condition(EntityEffectBaseArgs args) + public override string EntityConditionGuidebookText(IPrototypeManager prototype) { - return args.EntityManager.HasComponent(args.TargetEntity) ^ Invert; - } - - public override string GuidebookExplanation(IPrototypeManager prototype) - { - return Loc.GetString("reagent-effect-condition-guidebook-is-zombie-immune", ("invert", Invert)); + return Loc.GetString("entity-condition-guidebook-is-zombie-immune", ("invert", Inverted)); + } +} + +public sealed class IsZombieImmuneConditionEntitySystem : EntityConditionSystem +{ + protected override void Condition(Entity ent, ref EntityConditionEvent args) + { + args.Result = HasComp(ent) ^ args.Condition.Invert; } } diff --git a/Content.Shared/_Offbrand/EntityEffects/LungDamage.cs b/Content.Shared/_Offbrand/EntityEffects/LungDamage.cs index 7c9e8584ac..6049eb48ad 100644 --- a/Content.Shared/_Offbrand/EntityEffects/LungDamage.cs +++ b/Content.Shared/_Offbrand/EntityEffects/LungDamage.cs @@ -1,11 +1,11 @@ using Content.Shared._Offbrand.Wounds; -using Content.Shared.EntityEffects; +using Content.Shared.EntityConditions; using Content.Shared.FixedPoint; using Robust.Shared.Prototypes; namespace Content.Shared._Offbrand.EntityEffects; -public sealed partial class LungDamage : EntityEffectCondition +public sealed partial class LungDamageCondition : EntityConditionBase { [DataField] public FixedPoint2 Max = FixedPoint2.MaxValue; @@ -13,20 +13,18 @@ public sealed partial class LungDamage : EntityEffectCondition [DataField] public FixedPoint2 Min = FixedPoint2.Zero; - public override bool Condition(EntityEffectBaseArgs args) + public override string EntityConditionGuidebookText(IPrototypeManager prototype) { - if (args.EntityManager.TryGetComponent(args.TargetEntity, out var lungDamage)) - { - return lungDamage.Damage >= Min && lungDamage.Damage <= Max; - } - - return false; - } - - public override string GuidebookExplanation(IPrototypeManager prototype) - { - return Loc.GetString("reagent-effect-condition-guidebook-lung-damage", + return Loc.GetString("entity-condition-guidebook-lung-damage", ("max", Max == FixedPoint2.MaxValue ? (float) int.MaxValue : Max.Float()), ("min", Min.Float())); } } + +public sealed class LungDamageConditionEntitySystem : EntityConditionSystem +{ + protected override void Condition(Entity ent, ref EntityConditionEvent args) + { + args.Result = ent.Comp.Damage >= args.Condition.Min && ent.Comp.Damage <= args.Condition.Max; + } +} diff --git a/Content.Shared/_Offbrand/EntityEffects/MetaboliteThreshold.cs b/Content.Shared/_Offbrand/EntityEffects/MetaboliteThreshold.cs index 600f910a8c..f2f4701012 100644 --- a/Content.Shared/_Offbrand/EntityEffects/MetaboliteThreshold.cs +++ b/Content.Shared/_Offbrand/EntityEffects/MetaboliteThreshold.cs @@ -1,11 +1,11 @@ using Content.Shared.Chemistry.Reagent; +using Content.Shared.EntityConditions; using Content.Shared.FixedPoint; using Robust.Shared.Prototypes; -using Content.Shared.EntityEffects; namespace Content.Shared._Offbrand.EntityEffects; -public sealed partial class MetaboliteThreshold : EventEntityEffectCondition +public sealed partial class MetaboliteThresholdCondition : EntityConditionBase { [DataField] public FixedPoint2 Min = FixedPoint2.Zero; @@ -13,29 +13,27 @@ public sealed partial class MetaboliteThreshold : EventEntityEffectCondition? Reagent; + [DataField(required: true)] + public ProtoId Reagent; [DataField] public bool IncludeBloodstream = true; - public override string GuidebookExplanation(IPrototypeManager prototype) + public override string EntityConditionGuidebookText(IPrototypeManager prototype) { - ReagentPrototype? reagentProto = null; - if (Reagent is { } reagent) - prototype.TryIndex(reagent, out reagentProto); + var reagentProto = prototype.Index(Reagent); if (IncludeBloodstream) { - return Loc.GetString("reagent-effect-condition-guidebook-total-dosage-threshold", - ("reagent", reagentProto?.LocalizedName ?? Loc.GetString("reagent-effect-condition-guidebook-this-reagent")), + return Loc.GetString("entity-condition-guidebook-total-dosage-threshold", + ("reagent", reagentProto.LocalizedName), ("max", Max == FixedPoint2.MaxValue ? (float) int.MaxValue : Max.Float()), ("min", Min.Float())); } else { - return Loc.GetString("reagent-effect-condition-guidebook-metabolite-threshold", - ("reagent", reagentProto?.LocalizedName ?? Loc.GetString("reagent-effect-condition-guidebook-this-metabolite")), + return Loc.GetString("entity-condition-guidebook-metabolite-threshold", + ("reagent", reagentProto.LocalizedName ?? Loc.GetString("entity-condition-guidebook-this-metabolite")), ("max", Max == FixedPoint2.MaxValue ? (float) int.MaxValue : Max.Float()), ("min", Min.Float())); } diff --git a/Content.Shared/_Offbrand/EntityEffects/ModifyBrainDamage.cs b/Content.Shared/_Offbrand/EntityEffects/ModifyBrainDamage.cs index 1a186b1cd3..504a065463 100644 --- a/Content.Shared/_Offbrand/EntityEffects/ModifyBrainDamage.cs +++ b/Content.Shared/_Offbrand/EntityEffects/ModifyBrainDamage.cs @@ -5,27 +5,26 @@ using Robust.Shared.Prototypes; namespace Content.Shared._Offbrand.EntityEffects; -public sealed partial class ModifyBrainDamage : EntityEffect +public sealed partial class ModifyBrainDamage : EntityEffectBase { [DataField(required: true)] public FixedPoint2 Amount; - protected override string ReagentEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys) + public override string? EntityEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys) { if (Amount < FixedPoint2.Zero) - return Loc.GetString("reagent-effect-guidebook-modify-brain-damage-heals", ("chance", Probability), ("amount", -Amount)); + return Loc.GetString("entity-effect-guidebook-modify-brain-damage-heals", ("chance", Probability), ("amount", -Amount)); else - return Loc.GetString("reagent-effect-guidebook-modify-brain-damage-deals", ("chance", Probability), ("amount", Amount)); - } - - public override void Effect(EntityEffectBaseArgs args) - { - var scale = FixedPoint2.New(1); - - if (args is EntityEffectReagentArgs reagentArgs) - scale = reagentArgs.Scale; - - args.EntityManager.System() - .TryChangeBrainDamage(args.TargetEntity, Amount * scale); + return Loc.GetString("entity-effect-guidebook-modify-brain-damage-deals", ("chance", Probability), ("amount", Amount)); + } +} + +public sealed class ModifyBrainDamageEntityEffectSystem : EntityEffectSystem +{ + [Dependency] private readonly BrainDamageSystem _brainDamage = default!; + + protected override void Effect(Entity ent, ref EntityEffectEvent args) + { + _brainDamage.TryChangeBrainDamage(ent.AsNullable(), args.Effect.Amount * args.Scale); } } diff --git a/Content.Shared/_Offbrand/EntityEffects/ModifyBrainOxygen.cs b/Content.Shared/_Offbrand/EntityEffects/ModifyBrainOxygen.cs index 112e92357e..a3ed1e1b86 100644 --- a/Content.Shared/_Offbrand/EntityEffects/ModifyBrainOxygen.cs +++ b/Content.Shared/_Offbrand/EntityEffects/ModifyBrainOxygen.cs @@ -5,27 +5,26 @@ using Robust.Shared.Prototypes; namespace Content.Shared._Offbrand.EntityEffects; -public sealed partial class ModifyBrainOxygen : EntityEffect +public sealed partial class ModifyBrainOxygen : EntityEffectBase { [DataField(required: true)] public FixedPoint2 Amount; - protected override string ReagentEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys) + public override string? EntityEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys) { if (Amount > FixedPoint2.Zero) - return Loc.GetString("reagent-effect-guidebook-modify-brain-oxygen-heals", ("chance", Probability), ("amount", Amount)); + return Loc.GetString("entity-effect-guidebook-modify-brain-oxygen-heals", ("chance", Probability), ("amount", Amount)); else - return Loc.GetString("reagent-effect-guidebook-modify-brain-oxygen-deals", ("chance", Probability), ("amount", -Amount)); - } - - public override void Effect(EntityEffectBaseArgs args) - { - var scale = FixedPoint2.New(1); - - if (args is EntityEffectReagentArgs reagentArgs) - scale = reagentArgs.Scale; - - args.EntityManager.System() - .TryChangeBrainOxygenation(args.TargetEntity, Amount * scale); + return Loc.GetString("entity-effect-guidebook-modify-brain-oxygen-deals", ("chance", Probability), ("amount", -Amount)); + } +} + +public sealed class ModifyBrainOxygenEntityEffectSystem : EntityEffectSystem +{ + [Dependency] private readonly BrainDamageSystem _brainDamage = default!; + + protected override void Effect(Entity ent, ref EntityEffectEvent args) + { + _brainDamage.TryChangeBrainOxygenation(ent, args.Effect.Amount * args.Scale); } } diff --git a/Content.Shared/_Offbrand/EntityEffects/ModifyHeartDamage.cs b/Content.Shared/_Offbrand/EntityEffects/ModifyHeartDamage.cs index 2b4a1bfd7e..38bde5d263 100644 --- a/Content.Shared/_Offbrand/EntityEffects/ModifyHeartDamage.cs +++ b/Content.Shared/_Offbrand/EntityEffects/ModifyHeartDamage.cs @@ -5,27 +5,26 @@ using Robust.Shared.Prototypes; namespace Content.Shared._Offbrand.EntityEffects; -public sealed partial class ModifyHeartDamage : EntityEffect +public sealed partial class ModifyHeartDamage : EntityEffectBase { [DataField(required: true)] public FixedPoint2 Amount; - protected override string ReagentEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys) + public override string? EntityEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys) { if (Amount < FixedPoint2.Zero) - return Loc.GetString("reagent-effect-guidebook-modify-heart-damage-heals", ("chance", Probability), ("amount", -Amount)); + return Loc.GetString("entity-effect-guidebook-modify-heart-damage-heals", ("chance", Probability), ("amount", -Amount)); else - return Loc.GetString("reagent-effect-guidebook-modify-heart-damage-deals", ("chance", Probability), ("amount", Amount)); - } - - public override void Effect(EntityEffectBaseArgs args) - { - var scale = FixedPoint2.New(1); - - if (args is EntityEffectReagentArgs reagentArgs) - scale = reagentArgs.Scale; - - args.EntityManager.System() - .ChangeHeartDamage(args.TargetEntity, Amount * scale); + return Loc.GetString("entity-effect-guidebook-modify-heart-damage-deals", ("chance", Probability), ("amount", Amount)); + } +} + +public sealed class ModifyHeartDamageEntityEffectSystem : EntityEffectSystem +{ + [Dependency] private readonly HeartSystem _heart = default!; + + protected override void Effect(Entity ent, ref EntityEffectEvent args) + { + _heart.ChangeHeartDamage(ent.AsNullable(), args.Effect.Amount * args.Scale); } } diff --git a/Content.Shared/_Offbrand/EntityEffects/ModifyLungDamage.cs b/Content.Shared/_Offbrand/EntityEffects/ModifyLungDamage.cs index ae1d579ba5..fe64430073 100644 --- a/Content.Shared/_Offbrand/EntityEffects/ModifyLungDamage.cs +++ b/Content.Shared/_Offbrand/EntityEffects/ModifyLungDamage.cs @@ -5,27 +5,26 @@ using Robust.Shared.Prototypes; namespace Content.Shared._Offbrand.EntityEffects; -public sealed partial class ModifyLungDamage : EntityEffect +public sealed partial class ModifyLungDamage : EntityEffectBase { [DataField(required: true)] public FixedPoint2 Amount; - protected override string ReagentEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys) + public override string? EntityEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys) { if (Amount < FixedPoint2.Zero) - return Loc.GetString("reagent-effect-guidebook-modify-lung-damage-heals", ("chance", Probability), ("amount", -Amount)); + return Loc.GetString("entity-effect-guidebook-modify-lung-damage-heals", ("chance", Probability), ("amount", -Amount)); else - return Loc.GetString("reagent-effect-guidebook-modify-lung-damage-deals", ("chance", Probability), ("amount", Amount)); - } - - public override void Effect(EntityEffectBaseArgs args) - { - var scale = FixedPoint2.New(1); - - if (args is EntityEffectReagentArgs reagentArgs) - scale = reagentArgs.Scale; - - args.EntityManager.System() - .TryModifyDamage(args.TargetEntity, Amount * scale); + return Loc.GetString("entity-effect-guidebook-modify-lung-damage-deals", ("chance", Probability), ("amount", Amount)); + } +} + +public sealed class ModifyLungDamageEntityEffectSystem : EntityEffectSystem +{ + [Dependency] private readonly LungDamageSystem _lungDamage = default!; + + protected override void Effect(Entity ent, ref EntityEffectEvent args) + { + _lungDamage.TryModifyDamage(ent.AsNullable(), args.Effect.Amount * args.Scale); } } diff --git a/Content.Shared/_Offbrand/EntityEffects/RemoveStatusEffect.cs b/Content.Shared/_Offbrand/EntityEffects/RemoveStatusEffect.cs index 39887e240e..c1cdad7369 100644 --- a/Content.Shared/_Offbrand/EntityEffects/RemoveStatusEffect.cs +++ b/Content.Shared/_Offbrand/EntityEffects/RemoveStatusEffect.cs @@ -1,24 +1,29 @@ using Content.Shared.EntityEffects; +using Content.Shared.StatusEffectNew.Components; using Content.Shared.StatusEffectNew; using Robust.Shared.Prototypes; namespace Content.Shared._Offbrand.EntityEffects; -public sealed partial class RemoveStatusEffect : EntityEffect +public sealed partial class RemoveStatusEffect : EntityEffectBase { [DataField(required: true)] public EntProtoId EffectProto; - public override void Effect(EntityEffectBaseArgs args) - { - args.EntityManager.System() - .TryRemoveStatusEffect(args.TargetEntity, EffectProto); - } - /// - protected override string? ReagentEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys) => + public override string? EntityEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys) => Loc.GetString( - "reagent-effect-guidebook-status-effect-remove", + "entity-effect-guidebook-status-effect-remove", ("chance", Probability), ("key", prototype.Index(EffectProto).Name)); } + +public sealed class RemoveStatusEffectEntityEffectSystem : EntityEffectSystem +{ + [Dependency] private readonly StatusEffectsSystem _statusEffects = default!; + + protected override void Effect(Entity ent, ref EntityEffectEvent args) + { + _statusEffects.TryRemoveStatusEffect(ent, args.Effect.EffectProto); + } +} diff --git a/Content.Shared/_Offbrand/EntityEffects/StartHeart.cs b/Content.Shared/_Offbrand/EntityEffects/StartHeart.cs index 25a524662c..c69ef746b6 100644 --- a/Content.Shared/_Offbrand/EntityEffects/StartHeart.cs +++ b/Content.Shared/_Offbrand/EntityEffects/StartHeart.cs @@ -4,16 +4,20 @@ using Robust.Shared.Prototypes; namespace Content.Shared._Offbrand.EntityEffects; -public sealed partial class StartHeart : EntityEffect +public sealed partial class StartHeart : EntityEffectBase { - protected override string ReagentEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys) + public override string? EntityEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys) { - return Loc.GetString("reagent-effect-guidebook-start-heart", ("chance", Probability)); - } - - public override void Effect(EntityEffectBaseArgs args) - { - args.EntityManager.System() - .TryRestartHeart(args.TargetEntity); + return Loc.GetString("entity-effect-guidebook-start-heart", ("chance", Probability)); + } +} + +public sealed class StartHeartEntityEffectSystem : EntityEffectSystem +{ + [Dependency] private readonly HeartSystem _heart = default!; + + protected override void Effect(Entity ent, ref EntityEffectEvent args) + { + _heart.TryRestartHeart(ent.AsNullable()); } } diff --git a/Content.Shared/_Offbrand/EntityEffects/TotalGroupDamage.cs b/Content.Shared/_Offbrand/EntityEffects/TotalGroupDamage.cs deleted file mode 100644 index c8a913a5ef..0000000000 --- a/Content.Shared/_Offbrand/EntityEffects/TotalGroupDamage.cs +++ /dev/null @@ -1,40 +0,0 @@ -using Content.Shared.Damage.Prototypes; -using Content.Shared.Damage; -using Content.Shared.EntityEffects; -using Content.Shared.FixedPoint; -using Robust.Shared.Prototypes; - -namespace Content.Shared._Offbrand.EntityEffects; - -public sealed partial class TotalGroupDamage : EntityEffectCondition -{ - [DataField(required: true)] - public ProtoId Group; - - [DataField] - public FixedPoint2 Max = FixedPoint2.MaxValue; - - [DataField] - public FixedPoint2 Min = FixedPoint2.Zero; - - public override bool Condition(EntityEffectBaseArgs args) - { - var prototype = IoCManager.Resolve(); - var group = prototype.Index(Group); - - if (!args.EntityManager.TryGetComponent(args.TargetEntity, out var damage)) - return false; - - var total = FixedPoint2.Zero; - damage.Damage.TryGetDamageInGroup(group, out total); - return total >= Min && total <= Max; - } - - public override string GuidebookExplanation(IPrototypeManager prototype) - { - return Loc.GetString("reagent-effect-condition-guidebook-total-group-damage", - ("max", Max == FixedPoint2.MaxValue ? (float) int.MaxValue : Max.Float()), - ("min", Min.Float()), - ("name", prototype.Index(Group).LocalizedName)); - } -} diff --git a/Content.Shared/_Offbrand/EntityEffects/Zombify.cs b/Content.Shared/_Offbrand/EntityEffects/Zombify.cs index b863571b8c..d9c243878b 100644 --- a/Content.Shared/_Offbrand/EntityEffects/Zombify.cs +++ b/Content.Shared/_Offbrand/EntityEffects/Zombify.cs @@ -3,8 +3,8 @@ using Robust.Shared.Prototypes; namespace Content.Shared._Offbrand.EntityEffects; -public sealed partial class Zombify : EventEntityEffect +public sealed partial class Zombify : EntityEffectBase { - protected override string? ReagentEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys) - => Loc.GetString("reagent-effect-guidebook-zombify", ("chance", Probability)); + public override string? EntityEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys) + => Loc.GetString("entity-effect-guidebook-zombify", ("chance", Probability)); } diff --git a/Content.Shared/_Offbrand/StatusEffects/CauseStatusEffectRandomlyStatusEffectSystem.cs b/Content.Shared/_Offbrand/StatusEffects/CauseStatusEffectRandomlyStatusEffectSystem.cs index ff770a6371..056a3bb2e3 100644 --- a/Content.Shared/_Offbrand/StatusEffects/CauseStatusEffectRandomlyStatusEffectSystem.cs +++ b/Content.Shared/_Offbrand/StatusEffects/CauseStatusEffectRandomlyStatusEffectSystem.cs @@ -27,7 +27,7 @@ public sealed class CauseStatusEffectRandomlyStatusEffectSystem : EntitySystem randomEffects.NextUpdate = _timing.CurTime + randomEffects.UpdateInterval; Dirty(uid, randomEffects); - var seed = SharedRandomExtensions.HashCodeCombine(new() { (int)_timing.CurTick.Value, GetNetEntity(uid).Id }); + var seed = SharedRandomExtensions.HashCodeCombine((int)_timing.CurTick.Value, GetNetEntity(uid).Id); var rand = new System.Random(seed); if (!rand.Prob(randomEffects.Probability)) diff --git a/Content.Shared/_Offbrand/StatusEffects/DamageOverTimeStatusEffectSystem.cs b/Content.Shared/_Offbrand/StatusEffects/DamageOverTimeStatusEffectSystem.cs index 960be8391e..74c02fc25d 100644 --- a/Content.Shared/_Offbrand/StatusEffects/DamageOverTimeStatusEffectSystem.cs +++ b/Content.Shared/_Offbrand/StatusEffects/DamageOverTimeStatusEffectSystem.cs @@ -1,3 +1,4 @@ +using Content.Shared.Damage.Systems; using Content.Shared.Damage; using Content.Shared.StatusEffectNew.Components; using Robust.Shared.Prototypes; diff --git a/Content.Shared/_Offbrand/StatusEffects/DisruptOnAttackStatusEffectSystem.cs b/Content.Shared/_Offbrand/StatusEffects/DisruptOnAttackStatusEffectSystem.cs index 5d842f48fd..3e16a1cb21 100644 --- a/Content.Shared/_Offbrand/StatusEffects/DisruptOnAttackStatusEffectSystem.cs +++ b/Content.Shared/_Offbrand/StatusEffects/DisruptOnAttackStatusEffectSystem.cs @@ -1,5 +1,5 @@ using Content.Shared.CombatMode; -using Content.Shared.Damage; +using Content.Shared.Damage.Systems; using Content.Shared.Mobs.Components; using Content.Shared.StatusEffectNew.Components; using Content.Shared.StatusEffectNew; diff --git a/Content.Shared/_Offbrand/StatusEffects/GunBackfireStatusEffectSystem.cs b/Content.Shared/_Offbrand/StatusEffects/GunBackfireStatusEffectSystem.cs index d6787b3c7d..145f4152c8 100644 --- a/Content.Shared/_Offbrand/StatusEffects/GunBackfireStatusEffectSystem.cs +++ b/Content.Shared/_Offbrand/StatusEffects/GunBackfireStatusEffectSystem.cs @@ -38,7 +38,7 @@ public sealed class GunBackfireStatusEffectSystem : EntitySystem if (args.Args.Cancelled) return; - var seed = SharedRandomExtensions.HashCodeCombine(new() { (int)_timing.CurTick.Value, GetNetEntity(args.Args.Gun).Id }); + var seed = SharedRandomExtensions.HashCodeCombine((int)_timing.CurTick.Value, GetNetEntity(args.Args.Gun).Id); var rand = new System.Random(seed); if (!rand.Prob(ent.Comp.Probability)) return; diff --git a/Content.Shared/_Offbrand/StatusEffects/HyposprayBackfireStatusEffectSystem.cs b/Content.Shared/_Offbrand/StatusEffects/HyposprayBackfireStatusEffectSystem.cs index c53bf3bddf..f59019a60c 100644 --- a/Content.Shared/_Offbrand/StatusEffects/HyposprayBackfireStatusEffectSystem.cs +++ b/Content.Shared/_Offbrand/StatusEffects/HyposprayBackfireStatusEffectSystem.cs @@ -32,7 +32,7 @@ public sealed class HyposprayBackfireStatusEffectSystem : EntitySystem if (args.Args.TargetGettingInjected == args.Args.EntityUsingHypospray) return; - var seed = SharedRandomExtensions.HashCodeCombine(new() { (int)_timing.CurTick.Value, GetNetEntity(ent).Id }); + var seed = SharedRandomExtensions.HashCodeCombine((int)_timing.CurTick.Value, GetNetEntity(ent).Id); var rand = new System.Random(seed); if (!rand.Prob(ent.Comp.Probability)) return; diff --git a/Content.Shared/_Offbrand/StatusEffects/SlowOnDamageModifierStatusEffectSystem.cs b/Content.Shared/_Offbrand/StatusEffects/SlowOnDamageModifierStatusEffectSystem.cs index f5c6de3b8e..055ac0e357 100644 --- a/Content.Shared/_Offbrand/StatusEffects/SlowOnDamageModifierStatusEffectSystem.cs +++ b/Content.Shared/_Offbrand/StatusEffects/SlowOnDamageModifierStatusEffectSystem.cs @@ -1,4 +1,4 @@ -using Content.Shared.Damage; +using Content.Shared.Damage.Systems; using Content.Shared.Movement.Systems; using Content.Shared.StatusEffectNew; diff --git a/Content.Shared/_Offbrand/Triggers/TriggerOnDoAfterSystem.cs b/Content.Shared/_Offbrand/Triggers/TriggerOnDoAfterSystem.cs index 77f7359ba8..1c861f1e5f 100644 --- a/Content.Shared/_Offbrand/Triggers/TriggerOnDoAfterSystem.cs +++ b/Content.Shared/_Offbrand/Triggers/TriggerOnDoAfterSystem.cs @@ -88,9 +88,9 @@ public sealed class TriggerOnDoAfterSystem : EntitySystem { if (TryComp(used, out var stackComp)) { - _stack.Use(used, 1, stackComp); + _stack.ReduceCount((used, stackComp), 1); - if (_stack.GetCount(used, stackComp) <= 0) + if (_stack.GetCount((used, stackComp)) <= 0) hasMoreItems = false; } else diff --git a/Content.Shared/_Offbrand/Wounds/BrainDamageOnDamageSystem.cs b/Content.Shared/_Offbrand/Wounds/BrainDamageOnDamageSystem.cs index 6fc0deed95..85d4ec3983 100644 --- a/Content.Shared/_Offbrand/Wounds/BrainDamageOnDamageSystem.cs +++ b/Content.Shared/_Offbrand/Wounds/BrainDamageOnDamageSystem.cs @@ -1,3 +1,5 @@ +using Content.Shared.Damage.Components; +using Content.Shared.Damage.Systems; using Content.Shared.Damage; using Content.Shared.FixedPoint; diff --git a/Content.Shared/_Offbrand/Wounds/BrainDamageSystem.cs b/Content.Shared/_Offbrand/Wounds/BrainDamageSystem.cs index 1213bb77d8..fa5d21e125 100644 --- a/Content.Shared/_Offbrand/Wounds/BrainDamageSystem.cs +++ b/Content.Shared/_Offbrand/Wounds/BrainDamageSystem.cs @@ -121,11 +121,9 @@ public sealed partial class BrainDamageSystem : EntitySystem var overlays = new PotentiallyUpdateDamageOverlayEvent(ent); RaiseLocalEvent(ent, ref overlays, true); } - public void TryChangeBrainOxygenation(Entity ent, FixedPoint2 amount) - { - if (!Resolve(ent, ref ent.Comp, false)) - return; + public void TryChangeBrainOxygenation(Entity ent, FixedPoint2 amount) + { ent.Comp.Oxygen = FixedPoint2.Clamp(ent.Comp.Oxygen + amount, FixedPoint2.Zero, ent.Comp.MaxOxygen); Dirty(ent); @@ -229,7 +227,7 @@ public sealed partial class BrainDamageSystem : EntitySystem { var oxygenation = _heart.Spo2((ent.Owner, ent.Comp3)); - var seed = SharedRandomExtensions.HashCodeCombine(new() { (int)_timing.CurTick.Value, GetNetEntity(ent).Id }); + var seed = SharedRandomExtensions.HashCodeCombine((int)_timing.CurTick.Value, GetNetEntity(ent).Id); var rand = new System.Random(seed); DoOxygen(ent, oxygenation, rand); diff --git a/Content.Shared/_Offbrand/Wounds/CprSystem.cs b/Content.Shared/_Offbrand/Wounds/CprSystem.cs index 2f40d3a081..b41039ce6d 100644 --- a/Content.Shared/_Offbrand/Wounds/CprSystem.cs +++ b/Content.Shared/_Offbrand/Wounds/CprSystem.cs @@ -54,7 +54,7 @@ public sealed class CprSystem : EntitySystem { _statusEffects.TryAddStatusEffectDuration(ent, ent.Comp.Effect, ent.Comp.EffectDuration); - var seed = SharedRandomExtensions.HashCodeCombine(new() { (int)_timing.CurTick.Value, GetNetEntity(ent).Id }); + var seed = SharedRandomExtensions.HashCodeCombine((int)_timing.CurTick.Value, GetNetEntity(ent).Id); var rand = new System.Random(seed); if (rand.Prob(ent.Comp.WoundProbability) && TryComp(ent, out var woundable)) diff --git a/Content.Server/_Offbrand/Wounds/CryostasisFactorSystem.cs b/Content.Shared/_Offbrand/Wounds/CryostasisFactorSystem.cs similarity index 96% rename from Content.Server/_Offbrand/Wounds/CryostasisFactorSystem.cs rename to Content.Shared/_Offbrand/Wounds/CryostasisFactorSystem.cs index e25aa338c0..dc2abf486c 100644 --- a/Content.Server/_Offbrand/Wounds/CryostasisFactorSystem.cs +++ b/Content.Shared/_Offbrand/Wounds/CryostasisFactorSystem.cs @@ -1,8 +1,8 @@ -using Content.Server.Temperature.Components; using Content.Shared._Offbrand.Wounds; using Content.Shared.Body.Events; using Content.Shared.Body.Systems; using Content.Shared.Medical.Cryogenics; +using Content.Shared.Temperature.Components; using Content.Shared.Temperature; namespace Content.Server._Offbrand.Wounds; diff --git a/Content.Shared/_Offbrand/Wounds/HeartDamageOnDamageSystem.cs b/Content.Shared/_Offbrand/Wounds/HeartDamageOnDamageSystem.cs index 1011a68f01..d255a761cb 100644 --- a/Content.Shared/_Offbrand/Wounds/HeartDamageOnDamageSystem.cs +++ b/Content.Shared/_Offbrand/Wounds/HeartDamageOnDamageSystem.cs @@ -1,3 +1,5 @@ +using Content.Shared.Damage.Components; +using Content.Shared.Damage.Systems; using Content.Shared.Damage; using Content.Shared.FixedPoint; diff --git a/Content.Shared/_Offbrand/Wounds/HeartSystem.cs b/Content.Shared/_Offbrand/Wounds/HeartSystem.cs index 733f17a01c..277dde9cca 100644 --- a/Content.Shared/_Offbrand/Wounds/HeartSystem.cs +++ b/Content.Shared/_Offbrand/Wounds/HeartSystem.cs @@ -89,7 +89,7 @@ public sealed partial class HeartSystem : EntitySystem var threshold = heartrate.StrainDamageThresholds.HighestMatch(Strain((uid, heartrate))); if (threshold is (var chance, var amount)) { - var seed = SharedRandomExtensions.HashCodeCombine(new() { (int)_timing.CurTick.Value, GetNetEntity(uid).Id }); + var seed = SharedRandomExtensions.HashCodeCombine((int)_timing.CurTick.Value, GetNetEntity(uid).Id); var rand = new System.Random(seed); if (rand.Prob(chance)) @@ -151,7 +151,7 @@ public sealed partial class HeartSystem : EntitySystem private void OnHeartBeatStrain(Entity ent, ref HeartBeatEvent args) { - var seed = SharedRandomExtensions.HashCodeCombine(new() { (int)_timing.CurTick.Value, GetNetEntity(ent).Id }); + var seed = SharedRandomExtensions.HashCodeCombine((int)_timing.CurTick.Value, GetNetEntity(ent).Id); var rand = new System.Random(seed); if (_statusEffects.HasEffectComp(ent)) @@ -316,7 +316,7 @@ public sealed partial class HeartSystem : EntitySystem if (!ent.Comp.Running) return 0; - var seed = SharedRandomExtensions.HashCodeCombine(new() { (int)_timing.CurTick.Value, GetNetEntity(ent).Id }); + var seed = SharedRandomExtensions.HashCodeCombine((int)_timing.CurTick.Value, GetNetEntity(ent).Id); var rand = new System.Random(seed); var deviation = rand.Next(-ent.Comp.HeartRateDeviation, ent.Comp.HeartRateDeviation); @@ -326,7 +326,7 @@ public sealed partial class HeartSystem : EntitySystem public (int, int) BloodPressure(Entity ent) { - var seed = SharedRandomExtensions.HashCodeCombine(new() { (int)_timing.CurTick.Value, GetNetEntity(ent).Id }); + var seed = SharedRandomExtensions.HashCodeCombine((int)_timing.CurTick.Value, GetNetEntity(ent).Id); var rand = new System.Random(seed); var deviationA = rand.Next(-ent.Comp.BloodPressureDeviation, ent.Comp.BloodPressureDeviation); @@ -340,7 +340,7 @@ public sealed partial class HeartSystem : EntitySystem public int Etco2(Entity ent) { - var seed = SharedRandomExtensions.HashCodeCombine(new() { (int)_timing.CurTick.Value, GetNetEntity(ent).Id }); + var seed = SharedRandomExtensions.HashCodeCombine((int)_timing.CurTick.Value, GetNetEntity(ent).Id); var rand = new System.Random(seed); var deviation = rand.Next(-ent.Comp.Etco2Deviation, ent.Comp.Etco2Deviation); diff --git a/Content.Shared/_Offbrand/Wounds/IntrinsicPainSystem.cs b/Content.Shared/_Offbrand/Wounds/IntrinsicPainSystem.cs index eddada09f1..a07d945576 100644 --- a/Content.Shared/_Offbrand/Wounds/IntrinsicPainSystem.cs +++ b/Content.Shared/_Offbrand/Wounds/IntrinsicPainSystem.cs @@ -1,3 +1,4 @@ +using Content.Shared.Damage.Components; using Content.Shared.Damage; namespace Content.Shared._Offbrand.Wounds; diff --git a/Content.Shared/_Offbrand/Wounds/LungDamageSystem.cs b/Content.Shared/_Offbrand/Wounds/LungDamageSystem.cs index d33b47f595..b1a951368a 100644 --- a/Content.Shared/_Offbrand/Wounds/LungDamageSystem.cs +++ b/Content.Shared/_Offbrand/Wounds/LungDamageSystem.cs @@ -1,4 +1,5 @@ using Content.Shared.Alert; +using Content.Shared.Damage.Components; using Content.Shared.Damage; using Content.Shared.FixedPoint; using Content.Shared.Rejuvenate; diff --git a/Content.Server/_Offbrand/Wounds/LungDamageTemperatureSystem.cs b/Content.Shared/_Offbrand/Wounds/LungDamageTemperatureSystem.cs similarity index 93% rename from Content.Server/_Offbrand/Wounds/LungDamageTemperatureSystem.cs rename to Content.Shared/_Offbrand/Wounds/LungDamageTemperatureSystem.cs index cc97ecfe42..ca2674628b 100644 --- a/Content.Server/_Offbrand/Wounds/LungDamageTemperatureSystem.cs +++ b/Content.Shared/_Offbrand/Wounds/LungDamageTemperatureSystem.cs @@ -1,7 +1,7 @@ -using Content.Server.Temperature.Components; +using Content.Shared.Temperature.Components; using Content.Shared._Offbrand.Wounds; -namespace Content.Server._Offbrand.Wounds; +namespace Content.Shared._Offbrand.Wounds; public sealed class LungDamageTemperatureSystem : EntitySystem { diff --git a/Content.Shared/_Offbrand/Wounds/MaximumDamageSystem.cs b/Content.Shared/_Offbrand/Wounds/MaximumDamageSystem.cs index 5d412b4f85..b2e7784816 100644 --- a/Content.Shared/_Offbrand/Wounds/MaximumDamageSystem.cs +++ b/Content.Shared/_Offbrand/Wounds/MaximumDamageSystem.cs @@ -1,3 +1,4 @@ +using Content.Shared.Damage.Components; using Content.Shared.Damage; using Content.Shared.FixedPoint; using Robust.Shared.Timing; diff --git a/Content.Shared/_Offbrand/Wounds/TendingSystem.cs b/Content.Shared/_Offbrand/Wounds/TendingSystem.cs index 2c3441ec8b..195ca3ac45 100644 --- a/Content.Shared/_Offbrand/Wounds/TendingSystem.cs +++ b/Content.Shared/_Offbrand/Wounds/TendingSystem.cs @@ -141,9 +141,9 @@ public sealed class TendingSystem : EntitySystem var hasMoreItems = true; if (TryComp(args.Used.Value, out var stackComp)) { - _stack.Use(args.Used.Value, 1, stackComp); + _stack.ReduceCount((args.Used.Value, stackComp), 1); - if (_stack.GetCount(args.Used.Value, stackComp) <= 0) + if (_stack.GetCount((args.Used.Value, stackComp)) <= 0) hasMoreItems = false; } else diff --git a/Content.Shared/_Offbrand/Wounds/UniqueWoundOnDamageSystem.cs b/Content.Shared/_Offbrand/Wounds/UniqueWoundOnDamageSystem.cs index 4bd7721647..52c23529d1 100644 --- a/Content.Shared/_Offbrand/Wounds/UniqueWoundOnDamageSystem.cs +++ b/Content.Shared/_Offbrand/Wounds/UniqueWoundOnDamageSystem.cs @@ -1,3 +1,5 @@ +using Content.Shared.Damage.Components; +using Content.Shared.Damage.Systems; using Content.Shared.Damage; using Content.Shared.Random.Helpers; using Robust.Shared.Random; @@ -22,7 +24,7 @@ public sealed partial class UniqueWoundOnDamageSystem : EntitySystem if (args.DamageDelta is not { } delta || !args.DamageIncreased) return; - var seed = SharedRandomExtensions.HashCodeCombine(new() { (int)_timing.CurTick.Value, GetNetEntity(ent).Id }); + var seed = SharedRandomExtensions.HashCodeCombine((int)_timing.CurTick.Value, GetNetEntity(ent).Id); var rand = new System.Random(seed); var damageable = Comp(ent); diff --git a/Content.Shared/_Offbrand/Wounds/WoundableSystem.cs b/Content.Shared/_Offbrand/Wounds/WoundableSystem.cs index b3a04bcd0e..99fdb3ecbc 100644 --- a/Content.Shared/_Offbrand/Wounds/WoundableSystem.cs +++ b/Content.Shared/_Offbrand/Wounds/WoundableSystem.cs @@ -1,6 +1,8 @@ using System.Linq; using Content.Shared.Body.Systems; +using Content.Shared.Damage.Components; using Content.Shared.Damage.Prototypes; +using Content.Shared.Damage.Systems; using Content.Shared.Damage; using Content.Shared.FixedPoint; using Content.Shared.HealthExaminable; @@ -199,7 +201,7 @@ public sealed class WoundableSystem : EntitySystem if (ent.Comp.Damage.Empty) return; - _damageable.TryChangeDamage(args.Target, -ent.Comp.Damage.ToSpecifier(), true, false, null, null, forceRefresh: true); + _damageable.TryChangeDamage(args.Target, -ent.Comp.Damage.ToSpecifier(), true, false, forceRefresh: true); ValidateWounds(args.Target, null); } @@ -260,7 +262,7 @@ public sealed class WoundableSystem : EntitySystem comp.CreatedAt = _timing.CurTime; if (refreshDamage) - _damageable.TryChangeDamage(ent.Owner, new(), true, true, null, null, forceRefresh: true); + _damageable.TryChangeDamage(ent.Owner, new(), true, true, null, forceRefresh: true); Dirty(wound.Value, comp); return true; @@ -350,7 +352,7 @@ public sealed class WoundableSystem : EntitySystem return bleedAddition * ratio; } - public void ClampWounds(Entity ent, float probability) + public void ClampWounds(Entity ent, float probability) { var evt = new ClampWoundsEvent(probability); RaiseLocalEvent(ent, ref evt); @@ -361,7 +363,7 @@ public sealed class WoundableSystem : EntitySystem if (ent.Comp.Clamped) return; - var seed = SharedRandomExtensions.HashCodeCombine(new() { (int)_timing.CurTick.Value, GetNetEntity(ent).Id }); + var seed = SharedRandomExtensions.HashCodeCombine((int)_timing.CurTick.Value, GetNetEntity(ent).Id); var rand = new System.Random(seed); if (!rand.Prob(args.Args.Probability)) @@ -455,8 +457,8 @@ public sealed class WoundableSystem : EntitySystem changeBy.TrimZeros(); if (changeBy.AnyNegative()) { - var actualDelta = _damageable.TryChangeDamage(woundable, changeBy, true, false, null, null, forceRefresh: true); - DebugTools.Assert(actualDelta is not null); + var actualDelta = _damageable.ChangeDamage(woundable.Owner, changeBy, true, false, null, forceRefresh: true); + DebugTools.Assert(!actualDelta.Empty); DebugTools.Assert(changeBy.Equals(actualDelta!), $"{changeBy} == {actualDelta!}"); } diff --git a/Resources/Locale/en-US/_Offbrand/effects.ftl b/Resources/Locale/en-US/_Offbrand/effects.ftl index 1f69ff8a39..c5a736d3a3 100644 --- a/Resources/Locale/en-US/_Offbrand/effects.ftl +++ b/Resources/Locale/en-US/_Offbrand/effects.ftl @@ -3,86 +3,86 @@ reagent-guidebook-status-effect = Causes { $effect } during metabolism{ $conditi *[other] {" "}when { $conditions }. } -reagent-effect-guidebook-status-effect-remove = { $chance -> +entity-effect-guidebook-status-effect-remove = { $chance -> [1] Removes { LOC($key) } *[other] remove { LOC($key) } } -reagent-effect-guidebook-modify-brain-damage-heals = { $chance -> +entity-effect-guidebook-modify-brain-damage-heals = { $chance -> [1] Heals { $amount } brain activity *[other] heal { $amount } brain activity } -reagent-effect-guidebook-modify-brain-damage-deals = { $chance -> +entity-effect-guidebook-modify-brain-damage-deals = { $chance -> [1] Deals { $amount } brain damage *[other] deal { $amount } brain damage } -reagent-effect-guidebook-modify-heart-damage-heals = { $chance -> +entity-effect-guidebook-modify-heart-damage-heals = { $chance -> [1] Heals { $amount } heart health *[other] heal { $amount } heart health } -reagent-effect-guidebook-modify-heart-damage-deals = { $chance -> +entity-effect-guidebook-modify-heart-damage-deals = { $chance -> [1] Deals { $amount } heart damage *[other] deal { $amount } heart damage } -reagent-effect-guidebook-modify-lung-damage-heals = { $chance -> +entity-effect-guidebook-modify-lung-damage-heals = { $chance -> [1] Heals { $amount } lung health *[other] heal { $amount } lung health } -reagent-effect-guidebook-modify-lung-damage-deals = { $chance -> +entity-effect-guidebook-modify-lung-damage-deals = { $chance -> [1] Deals { $amount } lung damage *[other] deal { $amount } lung damage } -reagent-effect-guidebook-clamp-wounds = { $probability -> +entity-effect-guidebook-clamp-wounds = { $probability -> [1] Stops bleeding in wounds with { NATURALPERCENT($chance, 2) } chance per wound *[other] stop bleeding in wounds with { NATURALPERCENT($chance, 2) } chance per wound } -reagent-effect-condition-guidebook-heart-damage = { $max -> +entity-condition-guidebook-heart-damage = { $max -> [2147483648] it has at least {NATURALFIXED($min, 2)} heart damage *[other] { $min -> [0] it has at most {NATURALFIXED($max, 2)} heart damage *[other] it has between {NATURALFIXED($min, 2)} and {NATURALFIXED($max, 2)} heart damage } } -reagent-effect-condition-guidebook-lung-damage = { $max -> +entity-condition-guidebook-lung-damage = { $max -> [2147483648] it has at least {NATURALFIXED($min, 2)} lung damage *[other] { $min -> [0] it has at most {NATURALFIXED($max, 2)} lung damage *[other] it has between {NATURALFIXED($min, 2)} and {NATURALFIXED($max, 2)} lung damage } } -reagent-effect-condition-guidebook-brain-damage = { $max -> +entity-condition-guidebook-brain-damage = { $max -> [2147483648] it has at least {NATURALFIXED($min, 2)} brain damage *[other] { $min -> [0] it has at most {NATURALFIXED($max, 2)} brain damage *[other] it has between {NATURALFIXED($min, 2)} and {NATURALFIXED($max, 2)} brain damage } } -reagent-effect-condition-guidebook-total-group-damage = { $max -> +entity-condition-guidebook-total-group-damage = { $max -> [2147483648] it has at least {NATURALFIXED($min, 2)} { $name } damage *[other] { $min -> [0] it has at most {NATURALFIXED($max, 2)} { $name } damage *[other] it has between {NATURALFIXED($min, 2)} and {NATURALFIXED($max, 2)} { $name } damage } } -reagent-effect-guidebook-modify-brain-oxygen-heals = { $chance -> +entity-effect-guidebook-modify-brain-oxygen-heals = { $chance -> [1] Replenishes { $amount } brain oxygenation *[other] replenish { $amount } brain oxygenation } -reagent-effect-guidebook-modify-brain-oxygen-deals = { $chance -> +entity-effect-guidebook-modify-brain-oxygen-deals = { $chance -> [1] Depletes { $amount } brain oxygenation *[other] deplete { $amount } brain oxygenation } -reagent-effect-guidebook-start-heart = { $chance -> +entity-effect-guidebook-start-heart = { $chance -> [1] Restarts the target's heart *[other] restart the target's heart } -reagent-effect-guidebook-zombify = { $chance -> +entity-effect-guidebook-zombify = { $chance -> [1] Zombifies the target *[other] zombify the target } -reagent-effect-condition-guidebook-total-dosage-threshold = +entity-condition-guidebook-total-dosage-threshold = { $max -> [2147483648] the total dosage of {$reagent} is at least {NATURALFIXED($min, 2)}u *[other] { $min -> @@ -91,7 +91,7 @@ reagent-effect-condition-guidebook-total-dosage-threshold = } } -reagent-effect-condition-guidebook-metabolite-threshold = +entity-condition-guidebook-metabolite-threshold = { $max -> [2147483648] there's at least {NATURALFIXED($min, 2)}u of {$reagent} metabolites *[other] { $min -> @@ -100,21 +100,21 @@ reagent-effect-condition-guidebook-metabolite-threshold = } } -reagent-effect-condition-guidebook-is-zombie-immune = +entity-condition-guidebook-is-zombie-immune = the target { $invert -> [true] is not immunized against zombie infections *[false] is immunized against zombie infections } -reagent-effect-condition-guidebook-is-zombie = +entity-condition-guidebook-is-zombie = the target { $invert -> [true] is not a zombie *[false] is a zombie } -reagent-effect-condition-guidebook-this-metabolite = this reagent's +entity-condition-guidebook-this-metabolite = this reagent's -reagent-effect-guidebook-adjust-reagent-gaussian = +entity-effect-guidebook-adjust-reagent-gaussian = { $chance -> [1] { $deltasign -> [1] Typically adds diff --git a/Resources/Prototypes/Reagents/Consumable/Drink/alcohol.yml b/Resources/Prototypes/Reagents/Consumable/Drink/alcohol.yml index b87bb21c06..e8b4bb177f 100644 --- a/Resources/Prototypes/Reagents/Consumable/Drink/alcohol.yml +++ b/Resources/Prototypes/Reagents/Consumable/Drink/alcohol.yml @@ -215,11 +215,12 @@ type: Add - !type:ModifyStatusEffect conditions: - - !type:ReagentThreshold + - !type:ReagentCondition + reagent: Ethanol min: 15 - - !type:OrganType - type: Dwarf - shouldHave: false + - !type:MetabolizerTypeCondition + type: [ Dwarf ] + inverted: true effectProto: StatusEffectPainkillersMildEthanolOverdose time: 2 type: Add diff --git a/Resources/Prototypes/Reagents/botany.yml b/Resources/Prototypes/Reagents/botany.yml index 7dd9c4c171..97858ef229 100644 --- a/Resources/Prototypes/Reagents/botany.yml +++ b/Resources/Prototypes/Reagents/botany.yml @@ -128,8 +128,8 @@ statusEffects: - statusEffect: StatusEffectPainkillersNegligibleRobustHarvest conditions: - - !type:OrganType - type: Plant + - !type:MetabolizerTypeCondition + type: [Plant] effects: - !type:HealthChange damage: @@ -163,7 +163,7 @@ conditions: - !type:MetabolizerTypeCondition type: [Plant] - - !type:MetaboliteThreshold # Offbrand + - !type:MetaboliteThresholdCondition # Offbrand reagent: RobustHarvest min: 80 @@ -193,20 +193,22 @@ damage: types: Poison: 2 - - !type:CreateEntityReactionEffect + - !type:SpawnEntity entity: MobDionaNymph conditions: - - !type:OrganType - type: Plant - - !type:ReagentThreshold + - !type:MetabolizerTypeCondition + type: [Plant] + - !type:ReagentCondition + reagent: Sedin min: 40 - !type:AdjustReagent reagent: Sedin amount: -20 conditions: - - !type:OrganType - type: Plant - - !type:ReagentThreshold + - !type:MetabolizerTypeCondition + type: [Plant] + - !type:ReagentCondition + reagent: Sedin min: 40 # End Offbrand @@ -258,14 +260,14 @@ Caustic: 1 # Begin Offbrand conditions: - - !type:OrganType - type: Plant - shouldHave: false + - !type:MetabolizerTypeCondition + type: [Plant] + inverted: true - !type:SatiateHunger factor: 1 conditions: - - !type:OrganType - type: Plant + - !type:MetabolizerTypeCondition + type: [Plant] # End Offbrand Gas: effects: @@ -353,9 +355,9 @@ # Begin Offbrand Caustic: 0.5 conditions: - - !type:OrganType - type: Plant - shouldHave: false + - !type:MetabolizerTypeCondition + type: [ Plant ] + inverted: true - !type:HealthChange damage: types: @@ -363,6 +365,6 @@ Cold: -0.5 Shock: -0.5 conditions: - - !type:OrganType - type: Plant + - !type:MetabolizerTypeCondition + type: [ Plant ] # End Offbrand diff --git a/Resources/Prototypes/Reagents/gases.yml b/Resources/Prototypes/Reagents/gases.yml index 66782f09e1..e96de80ec1 100644 --- a/Resources/Prototypes/Reagents/gases.yml +++ b/Resources/Prototypes/Reagents/gases.yml @@ -333,12 +333,12 @@ type: Update - !type:ModifyStatusEffect # Offbrand conditions: - - !type:ReagentThreshold + - !type:ReagentCondition reagent: NitrousOxide min: 1.8 - - !type:OrganType - type: Slime - shouldHave: false + - !type:MetabolizerTypeCondition + type: [ Slime ] + inverted: false effectProto: StatusEffectPainSuppressionNitrousOxide time: 3 type: Add diff --git a/Resources/Prototypes/Reagents/medicine.yml b/Resources/Prototypes/Reagents/medicine.yml index 3c876e7ef2..85b1230c6a 100644 --- a/Resources/Prototypes/Reagents/medicine.yml +++ b/Resources/Prototypes/Reagents/medicine.yml @@ -1379,7 +1379,7 @@ - !type:ModifyBrainOxygen amount: 0.5 conditions: - - !type:Temperature + - !type:TemperatureCondition max: 150.0 # End Offbrand Additions # Begin Offbrand Removals @@ -1415,7 +1415,7 @@ - !type:ReduceRotting seconds: 20 conditions: - - !type:Temperature + - !type:TemperatureCondition max: 213.0 # End Offbrand - Derotting moved to necrosol - !type:HealthChange @@ -1478,16 +1478,19 @@ emote: Scream probability: 0.2 conditions: - - !type:ReagentThreshold + - !type:ReagentCondition + reagent: Mannitol min: 10.5 - - !type:ChemVomit + - !type:Vomit conditions: - - !type:ReagentThreshold + - !type:ReagentCondition + reagent: Mannitol min: 15 probability: 0.1 - !type:HealthChange conditions: - - !type:ReagentThreshold + - !type:ReagentCondition + reagent: Mannitol min: 10.5 damage: types: diff --git a/Resources/Prototypes/Reagents/toxins.yml b/Resources/Prototypes/Reagents/toxins.yml index 9d650fbffe..1b3fd57e8d 100644 --- a/Resources/Prototypes/Reagents/toxins.yml +++ b/Resources/Prototypes/Reagents/toxins.yml @@ -480,21 +480,22 @@ statusEffects: - statusEffect: StatusEffectHeartStrainRomerol conditions: - - !type:MetaboliteThreshold + - !type:MetaboliteThresholdCondition + reagent: Romerol min: 15 effects: - !type:AdjustReagent reagent: Romerol amount: -10 conditions: - - !type:IsZombie + - !type:IsZombieCondition - !type:AdjustReagentGaussian reagent: Romerol μ: 0.35 σ: 0.1 conditions: - - !type:IsZombieImmune - invert: true + - !type:IsZombieImmuneCondition + inverted: true - !type:PopupMessage type: Local visualType: MediumCaution @@ -505,14 +506,16 @@ - zombification-30-message-4 probability: 0.05 conditions: - - !type:MetaboliteThreshold + - !type:MetaboliteThresholdCondition + reagent: Romerol min: 15 - !type:HealthChange damage: types: Poison: 0.15 conditions: - - !type:MetaboliteThreshold + - !type:MetaboliteThresholdCondition + reagent: Romerol min: 15 - !type:ModifyHeartDamage amount: 2 @@ -533,39 +536,46 @@ mobstate: Critical - !type:Zombify conditions: - - !type:BrainDamage + - !type:BrainDamageCondition min: 70 - - !type:MetaboliteThreshold + - !type:MetaboliteThresholdCondition + reagent: Romerol min: 15 - !type:ModifyBrainDamage amount: 0.5 conditions: - - !type:MetaboliteThreshold + - !type:MetaboliteThresholdCondition + reagent: Romerol min: 15 - !type:ModifyHeartDamage amount: 0.2 conditions: - - !type:MetaboliteThreshold + - !type:MetaboliteThresholdCondition + reagent: Romerol min: 15 - !type:ModifyLungDamage amount: 0.2 conditions: - - !type:MetaboliteThreshold + - !type:MetaboliteThresholdCondition + reagent: Romerol min: 15 - !type:AdjustTemperature amount: 3000 conditions: - - !type:MetaboliteThreshold + - !type:MetaboliteThresholdCondition + reagent: Romerol min: 15 - !type:Jitter probability: 0.25 conditions: - - !type:MetaboliteThreshold + - !type:MetaboliteThresholdCondition + reagent: Romerol min: 30 - !type:AdjustTemperature amount: 6000 conditions: - - !type:MetaboliteThreshold + - !type:MetaboliteThresholdCondition + reagent: Romerol min: 30 - !type:PopupMessage type: Local @@ -577,12 +587,14 @@ - zombification-60-message-4 probability: 0.05 conditions: - - !type:MetaboliteThreshold + - !type:MetaboliteThresholdCondition + reagent: Romerol min: 30 - !type:ModifyBrainDamage amount: 0.25 conditions: - - !type:MetaboliteThreshold + - !type:MetaboliteThresholdCondition + reagent: Romerol min: 45 - !type:HealthChange damage: @@ -591,7 +603,8 @@ Blunt: 0.15 Piercing: 0.15 conditions: - - !type:MetaboliteThreshold + - !type:MetaboliteThresholdCondition + reagent: Romerol min: 45 - !type:PopupMessage type: Local @@ -603,12 +616,14 @@ - zombification-90-message-4 probability: 0.05 conditions: - - !type:MetaboliteThreshold + - !type:MetaboliteThresholdCondition + reagent: Romerol min: 45 - !type:ModifyBrainDamage amount: 0.5 conditions: - - !type:MetaboliteThreshold + - !type:MetaboliteThresholdCondition + reagent: Romerol min: 60 - !type:PopupMessage type: Local @@ -620,12 +635,14 @@ - zombification-120-message-4 probability: 0.05 conditions: - - !type:MetaboliteThreshold + - !type:MetaboliteThresholdCondition + reagent: Romerol min: 60 - !type:ModifyBrainDamage amount: 5 conditions: - - !type:MetaboliteThreshold + - !type:MetaboliteThresholdCondition + reagent: Romerol min: 70 - !type:Zombify conditions: diff --git a/Resources/Prototypes/_Offbrand/reagents.yml b/Resources/Prototypes/_Offbrand/reagents.yml index 115de97268..31dcae65d0 100644 --- a/Resources/Prototypes/_Offbrand/reagents.yml +++ b/Resources/Prototypes/_Offbrand/reagents.yml @@ -12,20 +12,22 @@ statusEffects: - statusEffect: StatusEffectPainkillersMildParacetamol conditions: - - !type:ReagentThreshold + - !type:ReagentCondition reagent: Tramadol max: 1 - - !type:ReagentThreshold + - !type:ReagentCondition reagent: Oxycodone max: 1 - statusEffect: StatusEffectPainkillersMildParacetamolOverdose conditions: - - !type:ReagentThreshold + - !type:ReagentCondition + reagent: Paracetamol min: 10 effects: - !type:HealthChange conditions: - - !type:ReagentThreshold + - !type:ReagentCondition + reagent: Paracetamol min: 10 damage: types: @@ -46,32 +48,35 @@ - statusEffect: StatusEffectPainkillersTramadol - statusEffect: StatusEffectPainkillersTramadolOverdose conditions: - - !type:ReagentThreshold + - !type:ReagentCondition + reagent: Tramadol min: 15 - - !type:ReagentThreshold + - !type:ReagentCondition reagent: Oxycodone max: 1 - statusEffect: StatusEffectHeartStrainTramadolAlcohol conditions: - - !type:ReagentThreshold + - !type:ReagentCondition reagent: Ethanol min: 1 effects: - !type:Drunk boozePower: 1 conditions: - - !type:ReagentThreshold + - !type:ReagentCondition + reagent: Tramadol min: 15.5 - !type:HealthChange conditions: - - !type:ReagentThreshold + - !type:ReagentCondition + reagent: Tramadol min: 25 damage: types: Asphyxiation: 0.5 - !type:HealthChange conditions: - - !type:ReagentThreshold + - !type:ReagentCondition reagent: Ethanol min: 1 damage: @@ -93,29 +98,32 @@ - statusEffect: StatusEffectPainkillersStrongOxycodone - statusEffect: StatusEffectPainkillersStrongOxycodoneOverdose conditions: - - !type:ReagentThreshold + - !type:ReagentCondition + reagent: Oxycodone min: 10 - statusEffect: StatusEffectHeartStrainOxycodoneAlcohol conditions: - - !type:ReagentThreshold + - !type:ReagentCondition reagent: Ethanol min: 1 effects: - !type:Drunk boozePower: 2 conditions: - - !type:ReagentThreshold + - !type:ReagentCondition + reagent: Oxycodone min: 10 - !type:HealthChange conditions: - - !type:ReagentThreshold + - !type:ReagentCondition + reagent: Oxycodone min: 15 damage: types: Asphyxiation: 0.5 - !type:HealthChange conditions: - - !type:ReagentThreshold + - !type:ReagentCondition reagent: Ethanol min: 1 damage: @@ -148,7 +156,8 @@ - !type:ModifyBloodLevel amount: 6 conditions: - - !type:ReagentThreshold + - !type:ReagentCondition + reagent: Sanguine max: 1 - type: reagent @@ -167,27 +176,30 @@ - !type:ModifyHeartDamage amount: -0.4 conditions: - - !type:HeartDamage + - !type:HeartDamageCondition max: 50 - !type:ModifyLungDamage amount: -0.4 conditions: - - !type:LungDamage + - !type:LungDamageCondition max: 50 - !type:HealthChange conditions: - - !type:ReagentThreshold + - !type:ReagentCondition + reagent: Peridaxon min: 5.5 damage: types: Poison: 0.05 - !type:Jitter conditions: - - !type:ReagentThreshold + - !type:ReagentCondition + reagent: Peridaxon min: 5.5 - - !type:ChemVomit + - !type:Vomit conditions: - - !type:ReagentThreshold + - !type:ReagentCondition + reagent: Peridaxon min: 5.5 probability: 0.1 @@ -204,26 +216,26 @@ statusEffects: - statusEffect: StatusEffectMajorOxygenationCloneoxadone conditions: - - !type:Temperature + - !type:TemperatureCondition max: 170.0 - statusEffect: StatusEffectHeartStabilizationCloneoxadone conditions: - - !type:Temperature + - !type:TemperatureCondition max: 170.0 effects: - !type:ModifyHeartDamage amount: -0.6 conditions: - - !type:Temperature + - !type:TemperatureCondition max: 170.0 - !type:ModifyLungDamage amount: -0.6 conditions: - - !type:Temperature + - !type:TemperatureCondition max: 170.0 - !type:EvenHealthChange conditions: - - !type:Temperature + - !type:TemperatureCondition max: 170.0 damage: Airloss: -12 @@ -247,17 +259,20 @@ - !type:SatiateThirst factor: 3 conditions: - - !type:ReagentThreshold + - !type:ReagentCondition + reagent: SalineGlucose max: 1 - !type:ModifyBloodLevel amount: 0.5 conditions: - - !type:ReagentThreshold + - !type:ReagentCondition + reagent: SalineGlucose max: 1 - !type:SatiateHunger factor: 0.5 conditions: - - !type:ReagentThreshold + - !type:ReagentCondition + reagent: SalineGlucose max: 1 - !type:HealthChange damage: @@ -269,7 +284,8 @@ Shock: -0.6 Cold: -0.6 conditions: - - !type:ReagentThreshold + - !type:ReagentCondition + reagent: SalineGlucose max: 1 - type: reagent @@ -306,13 +322,15 @@ - !type:RemoveStatusEffect effectProto: WoundFracture conditions: - - !type:MetaboliteThreshold + - !type:MetaboliteThresholdCondition + reagent: Osseous min: 5 - !type:AdjustReagent reagent: Osseous amount: -5 conditions: - - !type:MetaboliteThreshold + - !type:MetaboliteThresholdCondition + reagent: Osseous min: 5 - type: reagent @@ -332,8 +350,8 @@ Asphyxiation: -4 Blunt: 1 conditions: - - !type:TotalGroupDamage - group: Airloss + - !type:DamageGroupCondition + damageGroup: Airloss min: 4 - !type:HealthChange damage: @@ -341,10 +359,11 @@ Asphyxiation: -4 Blunt: 1 conditions: - - !type:MetaboliteThreshold + - !type:MetaboliteThresholdCondition + reagent: Convermol min: 10 - - !type:TotalGroupDamage - group: Airloss + - !type:DamageGroupCondition + damageGroup: Airloss min: 4 - !type:ModifyLungDamage amount: 0.05 @@ -363,43 +382,47 @@ statusEffects: - statusEffect: StatusEffectPainkillersSalicylicAcid conditions: - - !type:TotalGroupDamage - group: Brute + - !type:DamageGroupCondition + damageGroup: Brute min: 35 effects: - !type:EvenHealthChange damage: Brute: -2 conditions: - - !type:TotalGroupDamage - group: Brute + - !type:DamageGroupCondition + damageGroup: Brute min: 35 - - !type:MetaboliteThreshold + - !type:MetaboliteThresholdCondition + reagent: SalicylicAcid max: 15 - !type:EvenHealthChange damage: Brute: -2 Burn: 2 conditions: - - !type:MetaboliteThreshold + - !type:MetaboliteThresholdCondition + reagent: SalicylicAcid min: 15 - !type:EvenHealthChange damage: Brute: -0.5 conditions: - - !type:TotalGroupDamage - group: Brute + - !type:DamageGroupCondition + damageGroup: Brute max: 35 - !type:RemoveStatusEffect effectProto: WoundBoneDeath conditions: - - !type:MetaboliteThreshold + - !type:MetaboliteThresholdCondition + reagent: SalicylicAcid min: 50 - !type:EvenHealthChange damage: Burn: 1 conditions: - - !type:MetaboliteThreshold + - !type:MetaboliteThresholdCondition + reagent: SalicylicAcid min: 35 - type: reagent @@ -416,41 +439,45 @@ statusEffects: - statusEffect: StatusEffectPainkillersOxandrolone conditions: - - !type:TotalGroupDamage - group: Burn + - !type:DamageGroupCondition + damageGroup: Burn min: 35 effects: - !type:EvenHealthChange damage: Burn: -3 conditions: - - !type:TotalGroupDamage - group: Burn + - !type:DamageGroupCondition + damageGroup: Burn min: 35 - - !type:MetaboliteThreshold + - !type:MetaboliteThresholdCondition + reagent: Oxandrolone max: 15 - !type:EvenHealthChange damage: Burn: -3 Brute: 3 conditions: - - !type:MetaboliteThreshold + - !type:MetaboliteThresholdCondition + reagent: Oxandrolone min: 15 - !type:EvenHealthChange damage: Burn: -0.5 conditions: - - !type:TotalGroupDamage - group: Burn + - !type:DamageGroupCondition + damageGroup: Burn max: 35 - !type:RemoveStatusEffect effectProto: WoundHusking conditions: - - !type:MetaboliteThreshold + - !type:MetaboliteThresholdCondition + reagent: Oxandrolone min: 50 - !type:EvenHealthChange damage: Brute: 1 conditions: - - !type:MetaboliteThreshold + - !type:MetaboliteThresholdCondition + reagent: Oxandrolone min: 35