From f15fbe5c52011c400da962672289350e6a7bbda4 Mon Sep 17 00:00:00 2001 From: Charlotte Tezuka Date: Wed, 19 Nov 2025 18:58:18 +0200 Subject: [PATCH] Mega fixes --- .../Tooltips/BloodOxygenationTooltip.xaml.cs | 1 + .../UI/Tooltips/HeartRateTooltip.xaml.cs | 1 + .../Body/Systems/MetabolizerSystem.cs | 390 +++++------------- .../EntitySystems/RevenantSystem.Abilities.cs | 2 +- Content.Server/Zombies/ZombieSystem.cs | 14 +- .../MetaboliteThresholdSystem.cs | 26 +- .../_Offbrand/EntityEffects/ZombifySystem.cs | 4 +- .../_Offbrand/MMI/MMIExtractorSystem.cs | 2 + .../Wounds/CryostasisFactorSystem.cs | 2 +- .../Wounds/LungDamageTemperatureSystem.cs | 2 +- .../Chemistry/Reagent/ReagentPrototype.cs | 25 +- .../Damage/Systems/DamageableSystem.API.cs | 2 +- .../Damage/Systems/DamageableSystem.Events.cs | 2 +- .../Body/MobStateEntityConditionSystem.cs | 6 +- .../Effects/ZombieEntityEffectsSystem.cs | 2 +- .../StatusEffectSystem.Relay.cs | 4 +- .../EntityEffects/AdjustReagentGaussian.cs | 54 --- .../_Offbrand/EntityEffects/BrainDamage.cs | 32 -- .../_Offbrand/EntityEffects/ClampWounds.cs | 23 -- .../Conditions/BrainDamageCondition.cs | 33 ++ .../Conditions/HeartDamageCondition.cs | 33 ++ .../Conditions/IsZombieCondition.cs | 27 ++ .../Conditions/IsZombieImmuneCondition.cs | 28 ++ .../Conditions/LungDamageCondition.cs | 34 ++ .../MetaboliteCondition.cs} | 12 +- .../Conditions/TotalGroupDamageCondition.cs | 45 ++ .../Effects/AdjustReagentGaussian.cs | 61 +++ .../EntityEffects/Effects/ClampWounds.cs | 31 ++ .../Effects/ModifyBrainDamage.cs | 33 ++ .../Effects/ModifyBrainOxygen.cs | 34 ++ .../Effects/ModifyHeartDamage.cs | 34 ++ .../EntityEffects/Effects/ModifyLungDamage.cs | 34 ++ .../Effects/RemoveStatusEffect.cs | 33 ++ .../EntityEffects/Effects/StartHeart.cs | 27 ++ .../EntityEffects/Effects/Zombify.cs | 21 + .../_Offbrand/EntityEffects/HeartDamage.cs | 32 -- .../_Offbrand/EntityEffects/IsZombie.cs | 21 - .../_Offbrand/EntityEffects/IsZombieImmune.cs | 21 - .../_Offbrand/EntityEffects/LungDamage.cs | 32 -- .../EntityEffects/ModifyBrainDamage.cs | 31 -- .../EntityEffects/ModifyBrainOxygen.cs | 31 -- .../EntityEffects/ModifyHeartDamage.cs | 31 -- .../EntityEffects/ModifyLungDamage.cs | 31 -- .../EntityEffects/RemoveStatusEffect.cs | 24 -- .../_Offbrand/EntityEffects/StartHeart.cs | 19 - .../EntityEffects/TotalGroupDamage.cs | 40 -- .../_Offbrand/EntityEffects/Zombify.cs | 10 - ...eStatusEffectRandomlyStatusEffectSystem.cs | 2 +- .../DamageOverTimeStatusEffectSystem.cs | 1 + .../DisruptOnAttackStatusEffectSystem.cs | 1 + .../GunBackfireStatusEffectSystem.cs | 2 +- .../HyposprayBackfireStatusEffectSystem.cs | 2 +- .../SlowOnDamageModifierStatusEffectSystem.cs | 1 + .../Triggers/TriggerOnDoAfterSystem.cs | 4 +- .../Wounds/BrainDamageOnDamageSystem.cs | 2 + .../_Offbrand/Wounds/BrainDamageSystem.cs | 2 +- Content.Shared/_Offbrand/Wounds/CprSystem.cs | 2 +- .../Wounds/HeartDamageOnDamageSystem.cs | 2 + .../_Offbrand/Wounds/HeartSystem.cs | 13 +- .../_Offbrand/Wounds/IntrinsicPainSystem.cs | 1 + .../_Offbrand/Wounds/MaximumDamageSystem.cs | 1 + .../_Offbrand/Wounds/TendingSystem.cs | 4 +- .../Wounds/UniqueWoundOnDamageSystem.cs | 4 +- .../_Offbrand/Wounds/WoundableSystem.cs | 14 +- .../objects/specific/chemistry-bottles.ftl | 6 - Resources/Prototypes/Reagents/botany.yml | 40 +- Resources/Prototypes/Reagents/gases.yml | 8 +- Resources/Prototypes/Reagents/medicine.yml | 21 +- Resources/Prototypes/Reagents/toxins.yml | 75 ++-- Resources/Prototypes/_Offbrand/reagents.yml | 138 ++++--- .../_WL/Entities/Mobs/Species/base.yml | 2 +- 71 files changed, 870 insertions(+), 915 deletions(-) delete mode 100644 Content.Shared/_Offbrand/EntityEffects/AdjustReagentGaussian.cs delete mode 100644 Content.Shared/_Offbrand/EntityEffects/BrainDamage.cs delete mode 100644 Content.Shared/_Offbrand/EntityEffects/ClampWounds.cs create mode 100644 Content.Shared/_Offbrand/EntityEffects/Conditions/BrainDamageCondition.cs create mode 100644 Content.Shared/_Offbrand/EntityEffects/Conditions/HeartDamageCondition.cs create mode 100644 Content.Shared/_Offbrand/EntityEffects/Conditions/IsZombieCondition.cs create mode 100644 Content.Shared/_Offbrand/EntityEffects/Conditions/IsZombieImmuneCondition.cs create mode 100644 Content.Shared/_Offbrand/EntityEffects/Conditions/LungDamageCondition.cs rename Content.Shared/_Offbrand/EntityEffects/{MetaboliteThreshold.cs => Conditions/MetaboliteCondition.cs} (73%) create mode 100644 Content.Shared/_Offbrand/EntityEffects/Conditions/TotalGroupDamageCondition.cs create mode 100644 Content.Shared/_Offbrand/EntityEffects/Effects/AdjustReagentGaussian.cs create mode 100644 Content.Shared/_Offbrand/EntityEffects/Effects/ClampWounds.cs create mode 100644 Content.Shared/_Offbrand/EntityEffects/Effects/ModifyBrainDamage.cs create mode 100644 Content.Shared/_Offbrand/EntityEffects/Effects/ModifyBrainOxygen.cs create mode 100644 Content.Shared/_Offbrand/EntityEffects/Effects/ModifyHeartDamage.cs create mode 100644 Content.Shared/_Offbrand/EntityEffects/Effects/ModifyLungDamage.cs create mode 100644 Content.Shared/_Offbrand/EntityEffects/Effects/RemoveStatusEffect.cs create mode 100644 Content.Shared/_Offbrand/EntityEffects/Effects/StartHeart.cs create mode 100644 Content.Shared/_Offbrand/EntityEffects/Effects/Zombify.cs delete mode 100644 Content.Shared/_Offbrand/EntityEffects/HeartDamage.cs delete mode 100644 Content.Shared/_Offbrand/EntityEffects/IsZombie.cs delete mode 100644 Content.Shared/_Offbrand/EntityEffects/IsZombieImmune.cs delete mode 100644 Content.Shared/_Offbrand/EntityEffects/LungDamage.cs delete mode 100644 Content.Shared/_Offbrand/EntityEffects/ModifyBrainDamage.cs delete mode 100644 Content.Shared/_Offbrand/EntityEffects/ModifyBrainOxygen.cs delete mode 100644 Content.Shared/_Offbrand/EntityEffects/ModifyHeartDamage.cs delete mode 100644 Content.Shared/_Offbrand/EntityEffects/ModifyLungDamage.cs delete mode 100644 Content.Shared/_Offbrand/EntityEffects/RemoveStatusEffect.cs delete mode 100644 Content.Shared/_Offbrand/EntityEffects/StartHeart.cs delete mode 100644 Content.Shared/_Offbrand/EntityEffects/TotalGroupDamage.cs delete mode 100644 Content.Shared/_Offbrand/EntityEffects/Zombify.cs diff --git a/Content.Client/HealthAnalyzer/UI/Tooltips/BloodOxygenationTooltip.xaml.cs b/Content.Client/HealthAnalyzer/UI/Tooltips/BloodOxygenationTooltip.xaml.cs index a76ccc9b45..83745a7d2f 100644 --- a/Content.Client/HealthAnalyzer/UI/Tooltips/BloodOxygenationTooltip.xaml.cs +++ b/Content.Client/HealthAnalyzer/UI/Tooltips/BloodOxygenationTooltip.xaml.cs @@ -1,5 +1,6 @@ using Content.Shared._Offbrand.Wounds; using Content.Shared.Damage; +using Content.Shared.Damage.Components; using Content.Shared.FixedPoint; using Content.Shared.MedicalScanner; using Robust.Client.AutoGenerated; diff --git a/Content.Client/HealthAnalyzer/UI/Tooltips/HeartRateTooltip.xaml.cs b/Content.Client/HealthAnalyzer/UI/Tooltips/HeartRateTooltip.xaml.cs index 334557f628..f1d9110200 100644 --- a/Content.Client/HealthAnalyzer/UI/Tooltips/HeartRateTooltip.xaml.cs +++ b/Content.Client/HealthAnalyzer/UI/Tooltips/HeartRateTooltip.xaml.cs @@ -1,5 +1,6 @@ using Content.Shared._Offbrand.Wounds; using Content.Shared.Damage; +using Content.Shared.Damage.Components; using Content.Shared.FixedPoint; using Content.Shared.MedicalScanner; using Robust.Client.AutoGenerated; diff --git a/Content.Server/Body/Systems/MetabolizerSystem.cs b/Content.Server/Body/Systems/MetabolizerSystem.cs index ab4dd51cc7..522703212e 100644 --- a/Content.Server/Body/Systems/MetabolizerSystem.cs +++ b/Content.Server/Body/Systems/MetabolizerSystem.cs @@ -1,4 +1,5 @@ using Content.Server.Body.Components; +using Content.Shared.Administration.Logs; using Content.Shared.Body.Events; using Content.Shared.Body.Organ; using Content.Shared.Body.Prototypes; @@ -34,6 +35,10 @@ public sealed class MetabolizerSystem : SharedMetabolizerSystem [Dependency] private readonly SharedEntityConditionsSystem _entityConditions = default!; [Dependency] private readonly SharedEntityEffectsSystem _entityEffects = default!; [Dependency] private readonly SharedSolutionContainerSystem _solutionContainerSystem = default!; + //Start Offbrand WL + [Dependency] private readonly ISharedAdminLogManager _adminLogger = default!; + [Dependency] private readonly Content.Shared.StatusEffectNew.StatusEffectsSystem _statusEffects = default!; + //End Offbrand WL private EntityQuery _organQuery; private EntityQuery _solutionQuery; @@ -41,21 +46,14 @@ public sealed class MetabolizerSystem : SharedMetabolizerSystem public override void Initialize() { - [Dependency] private readonly IGameTiming _gameTiming = default!; - [Dependency] private readonly IPrototypeManager _prototypeManager = default!; - [Dependency] private readonly IRobustRandom _random = default!; - [Dependency] private readonly ISharedAdminLogManager _adminLogger = default!; - [Dependency] private readonly MobStateSystem _mobStateSystem = default!; - [Dependency] private readonly SharedSolutionContainerSystem _solutionContainerSystem = default!; - [Dependency] private readonly Content.Shared.StatusEffectNew.StatusEffectsSystem _statusEffects = default!; - base.Initialize(); - _organQuery = GetEntityQuery(); _solutionQuery = GetEntityQuery(); SubscribeLocalEvent(OnMetabolizerInit); SubscribeLocalEvent(OnMapInit); SubscribeLocalEvent(OnApplyMetabolicMultiplier); + + //base.Initialize(); } private void OnMapInit(Entity ent, ref MapInitEvent args) @@ -71,262 +69,13 @@ public sealed class MetabolizerSystem : SharedMetabolizerSystem } else if (_organQuery.CompOrNull(entity)?.Body is { } body) { - ent.Comp.NextUpdate = _gameTiming.CurTime + ent.Comp.AdjustedUpdateInterval; + entity.Comp.NextUpdate = _gameTiming.CurTime + entity.Comp.AdjustedUpdateInterval; } + } - private void OnUnpaused(Entity ent, ref EntityUnpausedEvent args) - { - ent.Comp.NextUpdate += args.PausedTime; - } - - private void OnMetabolizerInit(Entity entity, ref ComponentInit args) - { - if (!entity.Comp.SolutionOnBody) - { - _solutionContainerSystem.EnsureSolution(entity.Owner, entity.Comp.SolutionName, out _); - } - else if (_organQuery.CompOrNull(entity)?.Body is { } body) - { - _solutionContainerSystem.EnsureSolution(body, entity.Comp.SolutionName, out _); - } - } - - private void OnApplyMetabolicMultiplier(Entity ent, ref ApplyMetabolicMultiplierEvent args) - { - ent.Comp.UpdateIntervalMultiplier = args.Multiplier; - } - - public override void Update(float frameTime) - { - base.Update(frameTime); - - var metabolizers = new ValueList<(EntityUid Uid, MetabolizerComponent Component)>(Count()); - var query = EntityQueryEnumerator(); - - while (query.MoveNext(out var uid, out var comp)) - { - metabolizers.Add((uid, comp)); - } - - foreach (var (uid, metab) in metabolizers) - { - // Only update as frequently as it should - if (_gameTiming.CurTime < metab.NextUpdate) - continue; - - metab.NextUpdate += metab.AdjustedUpdateInterval; - TryMetabolize((uid, metab)); - } - } - - private void TryMetabolize(Entity ent) - { - _organQuery.Resolve(ent, ref ent.Comp2, logMissing: false); - - // First step is get the solution we actually care about - var solutionName = ent.Comp1.SolutionName; - Solution? solution = null; - Entity? soln = default!; - EntityUid? solutionEntityUid = null; - - if (ent.Comp1.SolutionOnBody) - { - if (ent.Comp2?.Body is { } body) - { - if (!_solutionQuery.Resolve(body, ref ent.Comp3, logMissing: false)) - return; - - _solutionContainerSystem.TryGetSolution((body, ent.Comp3), solutionName, out soln, out solution); - solutionEntityUid = body; - } - } - else - { - if (!_solutionQuery.Resolve(ent, ref ent.Comp3, logMissing: false)) - return; - - _solutionContainerSystem.TryGetSolution((ent, ent), solutionName, out soln, out solution); - solutionEntityUid = ent; - } - - if (solutionEntityUid is null - || soln is null - || solution is null - || (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; - } - - // randomize the reagent list so we don't have any weird quirks - // like alphabetical order or insertion order mattering for processing - var list = solution.Contents.ToArray(); - _random.Shuffle(list); - - var metabolized = new HashSet>(); - int reagents = 0; - foreach (var (reagent, quantity) in list) - { - if (!_prototypeManager.TryIndex(reagent.Prototype, out var proto)) - continue; - - var mostToRemove = FixedPoint2.Zero; - if (proto.Metabolisms is null) - { - if (ent.Comp1.RemoveEmpty) - { - solution.RemoveReagent(reagent, FixedPoint2.New(1)); - } - - continue; - } - - // Begin Offbrand - No we're not - // we're done here entirely if this is true - // if (reagents >= ent.Comp1.MaxReagentsProcessable) - // return; - // End Offbrand - metabolized.Add(reagent.Prototype); // Offbrand - - // loop over all our groups and see which ones apply - if (ent.Comp1.MetabolismGroups is null) - continue; - - foreach (var group in ent.Comp1.MetabolismGroups) - { - if (!proto.Metabolisms.TryGetValue(group.Id, out var entry)) - continue; - - var rate = entry.MetabolismRate * group.MetabolismRateModifier; - - // Remove $rate, as long as there's enough reagent there to actually remove that much - mostToRemove = FixedPoint2.Clamp(rate, 0, quantity); - - float scale = (float) mostToRemove / (float) rate; - - // if it's possible for them to be dead, and they are, - // then we shouldn't process any effects, but should probably - // still remove reagents - if (TryComp(solutionEntityUid.Value, out var state)) - { - if (!proto.WorksOnTheDead && _mobStateSystem.IsDead(solutionEntityUid.Value, state)) - continue; - } - - var actualEntity = ent.Comp2?.Body ?? solutionEntityUid.Value; - var args = new EntityEffectReagentArgs(actualEntity, EntityManager, ent, solution, mostToRemove, proto, null, scale); - - // Begin Offbrand - foreach (var effect in entry.StatusEffects) - { - if (!effect.ShouldApplyStatusEffect(args)) - _statusEffects.TryRemoveStatusEffect(actualEntity, effect.StatusEffect); - else - _statusEffects.TryUpdateStatusEffectDuration(actualEntity, effect.StatusEffect, out _); - } - // End Offbrand - - // do all effects, if conditions apply - foreach (var effect in entry.Effects) - { - if (!effect.ShouldApply(args, _random)) - continue; - - if (effect.ShouldLog) - { - _adminLogger.Add( - LogType.ReagentEffect, - effect.LogImpact, - $"Metabolism effect {effect.GetType().Name:effect}" - + $" of reagent {proto.LocalizedName:reagent}" - + $" applied on entity {actualEntity:entity}" - + $" at {Transform(actualEntity).Coordinates:coordinates}" - ); - } - - effect.Effect(args); - } - } - - // remove a certain amount of reagent - if (mostToRemove > FixedPoint2.Zero) - { - var removed = solution.RemoveReagent(reagent, mostToRemove); // Offbrand - - // We have processed a reagant, so count it towards the cap - reagents += 1; - - // Begin Offbrand - if (!ent.Comp1.Metabolites.ContainsKey(reagent.Prototype)) - ent.Comp1.Metabolites[reagent.Prototype] = 0; - - ent.Comp1.Metabolites[reagent.Prototype] += removed; - // End Offbrand - } - } - - // 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.EnsureSolution(body, entity.Comp.SolutionName, out _); - } + private void OnUnpaused(Entity ent, ref EntityUnpausedEvent args) + { + ent.Comp.NextUpdate += args.PausedTime; } private void OnApplyMetabolicMultiplier(Entity ent, ref ApplyMetabolicMultiplierEvent args) @@ -390,7 +139,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; } @@ -400,6 +149,7 @@ public sealed class MetabolizerSystem : SharedMetabolizerSystem var list = solution.Contents.ToArray(); _random.Shuffle(list); + var metabolized = new HashSet>(); int reagents = 0; foreach (var (reagent, quantity) in list) { @@ -417,16 +167,17 @@ public sealed class MetabolizerSystem : SharedMetabolizerSystem continue; } + // Begin Offbrand - No we're not // we're done here entirely if this is true - if (reagents >= ent.Comp1.MaxReagentsProcessable) - return; - + // if (reagents >= ent.Comp1.MaxReagentsProcessable) + // return; + // End Offbrand + metabolized.Add(reagent.Prototype); // Offbrand // loop over all our groups and see which ones apply if (ent.Comp1.MetabolismGroups is null) continue; - // TODO: Kill MetabolismGroups! foreach (var group in ent.Comp1.MetabolismGroups) { if (!proto.Metabolisms.TryGetValue(group.Id, out var entry)) @@ -437,12 +188,7 @@ public sealed class MetabolizerSystem : SharedMetabolizerSystem // Remove $rate, as long as there's enough reagent there to actually remove that much mostToRemove = FixedPoint2.Clamp(rate, 0, quantity); - var scale = (float) mostToRemove; - - // TODO: This is a very stupid workaround to lungs heavily relying on scale = reagent quantity. Needs lung and metabolism refactors to remove. - // TODO: Lungs just need to have their scale be equal to the mols consumed, scale needs to be not hardcoded either and configurable per metabolizer... - if (group.Id != Gas) - scale /= (float) entry.MetabolismRate; + float scale = (float) mostToRemove / (float) rate; // if it's possible for them to be dead, and they are, // then we shouldn't process any effects, but should probably @@ -454,6 +200,19 @@ public sealed class MetabolizerSystem : SharedMetabolizerSystem } var actualEntity = ent.Comp2?.Body ?? solutionEntityUid.Value; + //var args = new EntityEffectReagentArgs(actualEntity, EntityManager, ent, solution, mostToRemove, proto, null, scale); + + // Begin Offbrand + /* + foreach (var effect in entry.StatusEffects) + { + if (!effect.ShouldApplyStatusEffect(args)) + _statusEffects.TryRemoveStatusEffect(actualEntity, effect.StatusEffect); + else + _statusEffects.TryUpdateStatusEffectDuration(actualEntity, effect.StatusEffect, out _); + } + */ + // End Offbrand // do all effects, if conditions apply foreach (var effect in entry.Effects) @@ -469,7 +228,6 @@ public sealed class MetabolizerSystem : SharedMetabolizerSystem continue; ApplyEffect(effect); - } // TODO: We should have to do this with metabolism. ReagentEffect struct needs refactoring and so does metabolism! @@ -493,25 +251,86 @@ 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 + if (!ent.Comp1.Metabolites.ContainsKey(reagent.Prototype)) + ent.Comp1.Metabolites[reagent.Prototype] = 0; + + ent.Comp1.Metabolites[reagent.Prototype] += removed; + // End Offbrand } } + // 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); } - /// - /// Public API to check if a certain metabolism effect can be applied to an entity. - /// TODO: With metabolism refactor make this logic smarter and unhardcode the old hardcoding entity effects used to have for metabolism! - /// - /// The body metabolizing the effects - /// The organ doing the metabolizing - /// The solution we are metabolizing from - /// The conditions that need to be met to metabolize - /// True if we can metabolize! False if we cannot! public bool CanMetabolizeEffect(EntityUid body, EntityUid organ, Entity solution, EntityCondition[] conditions) { foreach (var condition in conditions) @@ -540,4 +359,3 @@ public sealed class MetabolizerSystem : SharedMetabolizerSystem return true; } } - diff --git a/Content.Server/Revenant/EntitySystems/RevenantSystem.Abilities.cs b/Content.Server/Revenant/EntitySystems/RevenantSystem.Abilities.cs index d1cb98f15c..74e98bb235 100644 --- a/Content.Server/Revenant/EntitySystems/RevenantSystem.Abilities.cs +++ b/Content.Server/Revenant/EntitySystems/RevenantSystem.Abilities.cs @@ -211,7 +211,7 @@ public sealed partial class RevenantSystem //KILL THEMMMM - _damage.TryChangeDamage(args.Args.Target, component.HarvestDamage, true, origin: uid); // Offbrand - use a fixed amount + _damage.TryChangeDamage(args.Args.Target.Value, component.HarvestDamage, true, origin: uid); // Offbrand - use a fixed amount args.Handled = true; } diff --git a/Content.Server/Zombies/ZombieSystem.cs b/Content.Server/Zombies/ZombieSystem.cs index c1ea610b2d..c49cdeb729 100644 --- a/Content.Server/Zombies/ZombieSystem.cs +++ b/Content.Server/Zombies/ZombieSystem.cs @@ -275,15 +275,15 @@ namespace Content.Server.Zombies { if (HasComp(uid) || cannotSpread) continue; - - if (_mobState.IsIncapacitated(entity, mobState) && !HasComp(entity) && !HasComp(entity) && !HasComp(entity)) // Offbrand - { - ZombifyEntity(entity); - args.BonusDamage = -args.BaseDamage; } - else if (mobState.CurrentState == MobState.Alive) //heals when zombies bite live entities + else { - _damageable.TryChangeDamage(uid, component.HealingOnBite, true, false); + if (HasComp(uid) || cannotSpread) + continue; + + // If the target is dead and can be infected, infect. + ZombifyEntity(uid); + args.Handled = true; } } } diff --git a/Content.Server/_Offbrand/EntityEffects/MetaboliteThresholdSystem.cs b/Content.Server/_Offbrand/EntityEffects/MetaboliteThresholdSystem.cs index 2471128216..a387f7c999 100644 --- a/Content.Server/_Offbrand/EntityEffects/MetaboliteThresholdSystem.cs +++ b/Content.Server/_Offbrand/EntityEffects/MetaboliteThresholdSystem.cs @@ -1,6 +1,8 @@ using Content.Server.Body.Components; using Content.Shared._Offbrand.EntityEffects; +using Content.Shared.Chemistry.Components; using Content.Shared.EntityEffects; +using Content.Shared.EntityConditions; using Content.Shared.FixedPoint; namespace Content.Server._Offbrand.EntityEffects; @@ -11,38 +13,32 @@ public sealed class MetaboliteThresholdSystem : EntitySystem { base.Initialize(); - SubscribeLocalEvent>(OnCheckMetaboliteThreshold); + SubscribeLocalEvent>(OnCheckMetaboliteThreshold); } - private void OnCheckMetaboliteThreshold(ref CheckEntityEffectConditionEvent args) + private void OnCheckMetaboliteThreshold(Entity entity, 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; + return; if (reagent is not { } metaboliteReagent) - { - args.Result = true; return; - } - if (!TryComp(reagentArgs.OrganEntity, out var metabolizer)) - { - args.Result = true; + if (!TryComp(entity, out var metabolizer)) + return; + + if (!TryComp(entity, out var solution)) return; - } var metabolites = metabolizer.Metabolites; var quant = FixedPoint2.Zero; metabolites.TryGetValue(metaboliteReagent, out quant); - if (args.Condition.IncludeBloodstream && reagentArgs.Source != null) + if (args.Condition.IncludeBloodstream && solution.Solution != null) { - quant += reagentArgs.Source.GetTotalPrototypeQuantity(metaboliteReagent); + quant += solution.Solution.GetTotalPrototypeQuantity(metaboliteReagent); } 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..7f77d69c1f 100644 --- a/Content.Server/_Offbrand/EntityEffects/ZombifySystem.cs +++ b/Content.Server/_Offbrand/EntityEffects/ZombifySystem.cs @@ -1,3 +1,4 @@ +/* using Content.Server.Zombies; using Content.Shared._Offbrand.EntityEffects; using Content.Shared.EntityEffects; @@ -15,8 +16,9 @@ public sealed class ZombifySystem : EntitySystem SubscribeLocalEvent>(OnExecuteZombify); } - private void OnExecuteZombify(ref ExecuteEntityEffectEvent args) + private void OnExecuteZombify(ref EntityEffectEvent args) { _zombie.ZombifyEntity(args.Args.TargetEntity); } } +*/ diff --git a/Content.Server/_Offbrand/MMI/MMIExtractorSystem.cs b/Content.Server/_Offbrand/MMI/MMIExtractorSystem.cs index 7f18de21e3..e5f3a2e7d1 100644 --- a/Content.Server/_Offbrand/MMI/MMIExtractorSystem.cs +++ b/Content.Server/_Offbrand/MMI/MMIExtractorSystem.cs @@ -3,7 +3,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; diff --git a/Content.Server/_Offbrand/Wounds/CryostasisFactorSystem.cs b/Content.Server/_Offbrand/Wounds/CryostasisFactorSystem.cs index e25aa338c0..5932347e9d 100644 --- a/Content.Server/_Offbrand/Wounds/CryostasisFactorSystem.cs +++ b/Content.Server/_Offbrand/Wounds/CryostasisFactorSystem.cs @@ -1,9 +1,9 @@ -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; +using Content.Shared.Temperature.Components; namespace Content.Server._Offbrand.Wounds; diff --git a/Content.Server/_Offbrand/Wounds/LungDamageTemperatureSystem.cs b/Content.Server/_Offbrand/Wounds/LungDamageTemperatureSystem.cs index cc97ecfe42..b20a47b37b 100644 --- a/Content.Server/_Offbrand/Wounds/LungDamageTemperatureSystem.cs +++ b/Content.Server/_Offbrand/Wounds/LungDamageTemperatureSystem.cs @@ -1,4 +1,4 @@ -using Content.Server.Temperature.Components; +using Content.Shared.Temperature.Components; using Content.Shared._Offbrand.Wounds; namespace Content.Server._Offbrand.Wounds; diff --git a/Content.Shared/Chemistry/Reagent/ReagentPrototype.cs b/Content.Shared/Chemistry/Reagent/ReagentPrototype.cs index dca42dbf19..7927c2bc79 100644 --- a/Content.Shared/Chemistry/Reagent/ReagentPrototype.cs +++ b/Content.Shared/Chemistry/Reagent/ReagentPrototype.cs @@ -6,6 +6,7 @@ using Content.Shared.Body.Prototypes; using Content.Shared.Chemistry.Reaction; using Content.Shared.Contraband; using Content.Shared.EntityEffects; +using Content.Shared.EntityConditions; using Content.Shared.Localizations; using Content.Shared.Nutrition; using Content.Shared.Roles; @@ -208,9 +209,10 @@ namespace Content.Shared.Chemistry.Reagent return removed; } - public IEnumerable GuidebookReagentEffectsDescription(IPrototypeManager prototype, IEntitySystemManager entSys, IEnumerable effects, FixedPoint2? metabolism = null) + public IEnumerable GuidebookReagentEffectsDescription(IPrototypeManager prototype, IEntitySystemManager entSys, IEnumerable effects, FixedPoint2? metabolism = null/*WL-Offbrand start*List StatusEffects = new()*WL-Offbrand end*/) { return effects.Select(x => GuidebookReagentEffectDescription(prototype, entSys, x, metabolism)) + //.Concat(StatusEffects.Select(x => x.Describe(prototype, entSys))) // Offbrand .Where(x => x is not null) .Select(x => x!) .ToArray(); @@ -275,8 +277,8 @@ namespace Content.Shared.Chemistry.Reagent /// /// Offbrand: Status effects to apply whilst this reagent is metabolising /// - [DataField] - public List StatusEffects = new(); + //[DataField] + //public List StatusEffects = new(); /// /// A list of effects to apply when these reagents are metabolized. @@ -289,27 +291,22 @@ namespace Content.Shared.Chemistry.Reagent public ReagentEffectsGuideEntry MakeGuideEntry(IPrototypeManager prototype, IEntitySystemManager entSys, ReagentPrototype proto) { - return new ReagentEffectsGuideEntry(MetabolismRate, - Effects - .Select(x => x.GuidebookEffectDescription(prototype, entSys)) // hate. - .Concat(StatusEffects.Select(x => x.Describe(prototype, entSys))) // Offbrand - .Where(x => x is not null) - .Select(x => x!) - .ToArray()); + return new ReagentEffectsGuideEntry(MetabolismRate, proto.GuidebookReagentEffectsDescription(prototype, entSys, Effects, MetabolismRate).ToArray()); } } // Begin Offbrand + /* [DataDefinition] public sealed partial class ReagentStatusEffectEntry { [DataField] - public EntityEffectCondition[]? Conditions; + public EntityConditionBase[]? Conditions; [DataField] public EntProtoId StatusEffect; - public bool ShouldApplyStatusEffect(EntityEffectBaseArgs args) + public bool ShouldApplyStatusEffect(EntityEffectBase args) { if (Conditions != null) { @@ -333,10 +330,10 @@ namespace Content.Shared.Chemistry.Reagent return Loc.GetString("reagent-guidebook-status-effect", ("effect", locName), //WL-Changes-offbrand-ftl-fix // effectProtoData.Name ?? string.Empty -> locName ("conditionCount", Conditions?.Length ?? 0), ("conditions", - Content.Shared.Localizations.ContentLocalizationManager.FormatList(Conditions?.Select(x => x.GuidebookExplanation(prototype)).ToList() ?? - new List()))); + Content.Shared.Localizations.ContentLocalizationManager.FormatList(Conditions?.Select(x => x.GuidebookExplanation(prototype)).ToList() ?? new List()))); } } + */ // End Offbrand [Serializable, NetSerializable] diff --git a/Content.Shared/Damage/Systems/DamageableSystem.API.cs b/Content.Shared/Damage/Systems/DamageableSystem.API.cs index 01ab2805d6..cd81cf5cc6 100644 --- a/Content.Shared/Damage/Systems/DamageableSystem.API.cs +++ b/Content.Shared/Damage/Systems/DamageableSystem.API.cs @@ -139,7 +139,7 @@ public sealed partial class DamageableSystem // Begin Offbrand var beforeCommit = new Content.Shared._Offbrand.Wounds.BeforeDamageCommitEvent(damage, forceRefresh); - RaiseLocalEvent(uid.Value, ref beforeCommit); + RaiseLocalEvent(ent, ref beforeCommit); damage = beforeCommit.Damage; // End Offbrand diff --git a/Content.Shared/Damage/Systems/DamageableSystem.Events.cs b/Content.Shared/Damage/Systems/DamageableSystem.Events.cs index 4874ef2bd0..44b017e2f5 100644 --- a/Content.Shared/Damage/Systems/DamageableSystem.Events.cs +++ b/Content.Shared/Damage/Systems/DamageableSystem.Events.cs @@ -272,7 +272,7 @@ public sealed class DamageChangedEvent : EntityEventArgs DamageSpecifier? damageDelta, bool interruptsDoAfters, EntityUid? origin, - ForcedRefresh = forcedRefresh; // Offbrand + bool forcedRefresh = false // Offbrand ) { Damageable = damageable; diff --git a/Content.Shared/EntityConditions/Conditions/Body/MobStateEntityConditionSystem.cs b/Content.Shared/EntityConditions/Conditions/Body/MobStateEntityConditionSystem.cs index fe9d57afc6..c13c65699f 100644 --- a/Content.Shared/EntityConditions/Conditions/Body/MobStateEntityConditionSystem.cs +++ b/Content.Shared/EntityConditions/Conditions/Body/MobStateEntityConditionSystem.cs @@ -1,3 +1,4 @@ +using Content.Shared._Offbrand.Wounds; using Content.Shared.Mobs; using Content.Shared.Mobs.Components; using Robust.Shared.Prototypes; @@ -10,6 +11,8 @@ namespace Content.Shared.EntityConditions.Conditions.Body; /// public sealed partial class MobStateEntityConditionSystem : EntityConditionSystem { + [Dependency] private readonly HealthRankingSystem _healthRanking = default!; //Offbrand + protected override void Condition(Entity entity, ref EntityConditionEvent args) { if (entity.Comp.CurrentState == args.Condition.Mobstate) @@ -17,8 +20,7 @@ public sealed partial class MobStateEntityConditionSystem : EntityConditionSyste // Begin Offbrand if (args.Condition.Mobstate == MobState.Critical) { - if (args.EntityManager.System() - .IsCritical(args.TargetEntity)) + if (_healthRanking.IsCritical(entity)) { args.Result = true; } diff --git a/Content.Shared/EntityEffects/Effects/ZombieEntityEffectsSystem.cs b/Content.Shared/EntityEffects/Effects/ZombieEntityEffectsSystem.cs index ea0e6f0e34..7dae4afd86 100644 --- a/Content.Shared/EntityEffects/Effects/ZombieEntityEffectsSystem.cs +++ b/Content.Shared/EntityEffects/Effects/ZombieEntityEffectsSystem.cs @@ -1,4 +1,4 @@ -using Content.Shared.Mobs.Components; +using Content.Shared.Mobs.Components; using Content.Shared.Zombies; using Robust.Shared.Prototypes; diff --git a/Content.Shared/StatusEffectNew/StatusEffectSystem.Relay.cs b/Content.Shared/StatusEffectNew/StatusEffectSystem.Relay.cs index 8c52aaa031..180f294010 100644 --- a/Content.Shared/StatusEffectNew/StatusEffectSystem.Relay.cs +++ b/Content.Shared/StatusEffectNew/StatusEffectSystem.Relay.cs @@ -42,7 +42,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 @@ -50,7 +50,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 deleted file mode 100644 index 7de38fe6e2..0000000000 --- a/Content.Shared/_Offbrand/EntityEffects/AdjustReagentGaussian.cs +++ /dev/null @@ -1,54 +0,0 @@ -using Content.Shared.Chemistry.Reagent; -using Content.Shared.EntityEffects; -using Content.Shared.FixedPoint; -using Content.Shared.Random.Helpers; -using Robust.Shared.Prototypes; -using Robust.Shared.Random; -using Robust.Shared.Timing; - -namespace Content.Shared._Offbrand.EntityEffects; - -public sealed partial class AdjustReagentGaussian : EntityEffect -{ - [DataField(required: true)] - public ProtoId Reagent; - - [DataField(required: true)] - public double μ; - - [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) - { - var proto = prototype.Index(Reagent); - return Loc.GetString("reagent-effect-guidebook-adjust-reagent-gaussian", - ("chance", Probability), - ("deltasign", Math.Sign(μ)), - ("reagent", proto.LocalizedName), - ("mu", Math.Abs(μ)), - ("sigma", Math.Abs(σ))); - } -} diff --git a/Content.Shared/_Offbrand/EntityEffects/BrainDamage.cs b/Content.Shared/_Offbrand/EntityEffects/BrainDamage.cs deleted file mode 100644 index 98f6d8126c..0000000000 --- a/Content.Shared/_Offbrand/EntityEffects/BrainDamage.cs +++ /dev/null @@ -1,32 +0,0 @@ -using Content.Shared._Offbrand.Wounds; -using Content.Shared.EntityEffects; -using Content.Shared.FixedPoint; -using Robust.Shared.Prototypes; - -namespace Content.Shared._Offbrand.EntityEffects; - -public sealed partial class BrainDamage : EntityEffectCondition -{ - [DataField] - public FixedPoint2 Max = FixedPoint2.MaxValue; - - [DataField] - public FixedPoint2 Min = FixedPoint2.Zero; - - public override bool Condition(EntityEffectBaseArgs args) - { - 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", - ("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 deleted file mode 100644 index 01822d37d9..0000000000 --- a/Content.Shared/_Offbrand/EntityEffects/ClampWounds.cs +++ /dev/null @@ -1,23 +0,0 @@ -using Content.Shared._Offbrand.Wounds; -using Content.Shared.EntityEffects; -using Content.Shared.FixedPoint; -using Robust.Shared.Prototypes; - -namespace Content.Shared._Offbrand.EntityEffects; - -public sealed partial class ClampWounds : EntityEffect -{ - [DataField(required: true)] - public float Chance; - - protected override string ReagentEffectGuidebookText(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); - } -} diff --git a/Content.Shared/_Offbrand/EntityEffects/Conditions/BrainDamageCondition.cs b/Content.Shared/_Offbrand/EntityEffects/Conditions/BrainDamageCondition.cs new file mode 100644 index 0000000000..a98d985e69 --- /dev/null +++ b/Content.Shared/_Offbrand/EntityEffects/Conditions/BrainDamageCondition.cs @@ -0,0 +1,33 @@ +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 BrainDamageConditionSystem : EntityConditionSystem +{ + protected override void Condition(Entity entity, ref EntityConditionEvent args) + { + var damage = entity.Comp.Damage; + + args.Result = damage >= args.Condition.Min && damage <= args.Condition.Max; + } +} + +public sealed partial class BrainDamageCondition : EntityConditionBase +{ + [DataField] + public FixedPoint2 Max = FixedPoint2.MaxValue; + + [DataField] + public FixedPoint2 Min = FixedPoint2.Zero; + + public override string EntityConditionGuidebookText(IPrototypeManager prototype) + { + return Loc.GetString("reagent-effect-condition-guidebook-brain-damage", + ("max", Max == FixedPoint2.MaxValue ? (float) int.MaxValue : Max.Float()), + ("min", Min.Float())); + } +} diff --git a/Content.Shared/_Offbrand/EntityEffects/Conditions/HeartDamageCondition.cs b/Content.Shared/_Offbrand/EntityEffects/Conditions/HeartDamageCondition.cs new file mode 100644 index 0000000000..a6e839fc94 --- /dev/null +++ b/Content.Shared/_Offbrand/EntityEffects/Conditions/HeartDamageCondition.cs @@ -0,0 +1,33 @@ +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 HeartDamageConditionSystem : EntityConditionSystem +{ + protected override void Condition(Entity entity, ref EntityConditionEvent args) + { + var damage = entity.Comp.Damage; + + args.Result = damage >= args.Condition.Min && damage <= args.Condition.Max; + } +} + +public sealed partial class HeartDamageCondition : EntityConditionBase +{ + [DataField] + public FixedPoint2 Max = FixedPoint2.MaxValue; + + [DataField] + public FixedPoint2 Min = FixedPoint2.Zero; + + 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())); + } +} diff --git a/Content.Shared/_Offbrand/EntityEffects/Conditions/IsZombieCondition.cs b/Content.Shared/_Offbrand/EntityEffects/Conditions/IsZombieCondition.cs new file mode 100644 index 0000000000..0706f8f2eb --- /dev/null +++ b/Content.Shared/_Offbrand/EntityEffects/Conditions/IsZombieCondition.cs @@ -0,0 +1,27 @@ +using Content.Shared.EntityConditions; +using Content.Shared.EntityEffects; +using Content.Shared.Mobs.Components; +using Content.Shared.Zombies; +using Robust.Shared.Prototypes; + +namespace Content.Shared._Offbrand.EntityEffects; + +/// +public sealed partial class IsZombieConditionSystem : EntityConditionSystem +{ + protected override void Condition(Entity entity, ref EntityConditionEvent args) + { + args.Result = HasComp(entity) ^ args.Condition.Invert; + } +} + +public sealed partial class IsZombieCondition : EntityConditionBase +{ + [DataField] + public bool Invert = false; + + public override string EntityConditionGuidebookText(IPrototypeManager prototype) + { + return Loc.GetString("reagent-effect-condition-guidebook-is-zombie", ("invert", Invert)); + } +} diff --git a/Content.Shared/_Offbrand/EntityEffects/Conditions/IsZombieImmuneCondition.cs b/Content.Shared/_Offbrand/EntityEffects/Conditions/IsZombieImmuneCondition.cs new file mode 100644 index 0000000000..f4d4daffb7 --- /dev/null +++ b/Content.Shared/_Offbrand/EntityEffects/Conditions/IsZombieImmuneCondition.cs @@ -0,0 +1,28 @@ +using Content.Shared.EntityConditions; +using Content.Shared.EntityEffects; +using Content.Shared.Mobs.Components; +using Content.Shared.Zombies; +using Robust.Shared.Prototypes; + +namespace Content.Shared._Offbrand.EntityEffects; + +/// +public sealed partial class IsZombieImmuneConditionSystem : EntityConditionSystem +{ + protected override void Condition(Entity entity, ref EntityConditionEvent args) + { + args.Result = HasComp(entity) ^ args.Condition.Invert; + } +} + +public sealed partial class IsZombieImmuneCondition : EntityConditionBase +{ + [DataField] + public bool Invert = false; + + public override string EntityConditionGuidebookText(IPrototypeManager prototype) + { + return Loc.GetString("reagent-effect-condition-guidebook-is-zombie", ("invert", Invert)); + } +} + diff --git a/Content.Shared/_Offbrand/EntityEffects/Conditions/LungDamageCondition.cs b/Content.Shared/_Offbrand/EntityEffects/Conditions/LungDamageCondition.cs new file mode 100644 index 0000000000..4cd2cea409 --- /dev/null +++ b/Content.Shared/_Offbrand/EntityEffects/Conditions/LungDamageCondition.cs @@ -0,0 +1,34 @@ +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 LungDamageConditionSystem : EntityConditionSystem +{ + protected override void Condition(Entity entity, ref EntityConditionEvent args) + { + var damage = entity.Comp.Damage; + + args.Result = damage >= args.Condition.Min && damage <= args.Condition.Max; + } +} + +public sealed partial class LungDamageCondition : EntityConditionBase +{ + [DataField] + public FixedPoint2 Max = FixedPoint2.MaxValue; + + [DataField] + public FixedPoint2 Min = FixedPoint2.Zero; + + public override string EntityConditionGuidebookText(IPrototypeManager prototype) + { + return Loc.GetString("reagent-effect-condition-guidebook-lung-damage", + ("max", Max == FixedPoint2.MaxValue ? (float) int.MaxValue : Max.Float()), + ("min", Min.Float())); + } +} + diff --git a/Content.Shared/_Offbrand/EntityEffects/MetaboliteThreshold.cs b/Content.Shared/_Offbrand/EntityEffects/Conditions/MetaboliteCondition.cs similarity index 73% rename from Content.Shared/_Offbrand/EntityEffects/MetaboliteThreshold.cs rename to Content.Shared/_Offbrand/EntityEffects/Conditions/MetaboliteCondition.cs index 600f910a8c..6af7df708f 100644 --- a/Content.Shared/_Offbrand/EntityEffects/MetaboliteThreshold.cs +++ b/Content.Shared/_Offbrand/EntityEffects/Conditions/MetaboliteCondition.cs @@ -1,11 +1,19 @@ using Content.Shared.Chemistry.Reagent; +using Content.Shared.Chemistry.Components; using Content.Shared.FixedPoint; using Robust.Shared.Prototypes; using Content.Shared.EntityEffects; +using Content.Shared.EntityConditions; namespace Content.Shared._Offbrand.EntityEffects; -public sealed partial class MetaboliteThreshold : EventEntityEffectCondition +public sealed partial class MetaboliteConditionSystem : EntityConditionSystem +{ + protected override void Condition(Entity entity, ref EntityConditionEvent args) + { } +} + +public sealed partial class MetaboliteCondition : EntityConditionBase { [DataField] public FixedPoint2 Min = FixedPoint2.Zero; @@ -19,7 +27,7 @@ public sealed partial class MetaboliteThreshold : EventEntityEffectCondition +{ + [Dependency] private readonly IEntityManager _entityManager = default!; + + protected override void Condition(Entity entity, ref EntityConditionEvent args) + { + var prototype = IoCManager.Resolve(); + var group = prototype.Index(args.Condition.Group); + + var total = FixedPoint2.Zero; + entity.Comp.Damage.TryGetDamageInGroup(group, out total); + args.Result = total >= args.Condition.Min && total <= args.Condition.Max; + } +} + +public sealed partial class TotalGroupDamageCondition : EntityConditionBase +{ + [DataField(required: true)] + public ProtoId Group; + + [DataField] + public FixedPoint2 Max = FixedPoint2.MaxValue; + + [DataField] + public FixedPoint2 Min = FixedPoint2.Zero; + + + public override string EntityConditionGuidebookText(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/Effects/AdjustReagentGaussian.cs b/Content.Shared/_Offbrand/EntityEffects/Effects/AdjustReagentGaussian.cs new file mode 100644 index 0000000000..fb9a3f1eb3 --- /dev/null +++ b/Content.Shared/_Offbrand/EntityEffects/Effects/AdjustReagentGaussian.cs @@ -0,0 +1,61 @@ +using Content.Shared.Chemistry.Reagent; +using Content.Shared.Chemistry.Components; +using Content.Shared.Chemistry.EntitySystems; +using Content.Shared.EntityEffects; +using Content.Shared.FixedPoint; +using Content.Shared.Random.Helpers; +using Robust.Shared.Prototypes; +using Robust.Shared.Random; +using Robust.Shared.Timing; + +namespace Content.Shared._Offbrand.EntityEffects; + +public sealed partial class AdjustReagentGaussianEntityEffectSystem : EntityEffectSystem +{ + [Dependency] private readonly SharedSolutionContainerSystem _solutionContainer = default!; + [Dependency] private readonly IEntityManager _entityManager = default!; + + protected override void Effect(Entity entity, ref EntityEffectEvent args) + { + var timing = IoCManager.Resolve(); + + var seed = SharedRandomExtensions.HashCodeCombine((int)timing.CurTick.Value, _entityManager.GetNetEntity(entity).Id); + var rand = new System.Random(seed); + + var amount = rand.NextGaussian(args.Effect.μ, args.Effect.σ); + amount *= (double)args.Scale; + + var reagent = args.Effect.Reagent; + + if (amount > 0) + _solutionContainer.TryAddReagent(entity, reagent, amount); + else + _solutionContainer.RemoveReagent(entity, reagent, -amount); + } +} + +public sealed partial class AdjustReagentGaussian : EntityEffectBase +{ + /// + /// The reagent ID to add or remove. + /// + [DataField(required: true)] + public ProtoId Reagent; + + [DataField(required: true)] + public double μ; + + [DataField(required: true)] + public double σ; + + public override string? EntityEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys) + { + var proto = prototype.Index(Reagent); + return Loc.GetString("reagent-effect-guidebook-adjust-reagent-gaussian", + ("chance", Probability), + ("deltasign", Math.Sign(μ)), + ("reagent", proto.LocalizedName), + ("mu", Math.Abs(μ)), + ("sigma", Math.Abs(σ))); + } +} diff --git a/Content.Shared/_Offbrand/EntityEffects/Effects/ClampWounds.cs b/Content.Shared/_Offbrand/EntityEffects/Effects/ClampWounds.cs new file mode 100644 index 0000000000..7772ddfcc3 --- /dev/null +++ b/Content.Shared/_Offbrand/EntityEffects/Effects/ClampWounds.cs @@ -0,0 +1,31 @@ +using Content.Shared._Offbrand.Wounds; +using Content.Shared.EntityEffects; +using Content.Shared.FixedPoint; +using Robust.Shared.Prototypes; + +namespace Content.Shared._Offbrand.EntityEffects; + +/// +public sealed partial class ClampWoundEffectSystem : EntityEffectSystem +{ + [Dependency] private readonly IEntityManager _entityManager = default!; + + protected override void Effect(Entity entity, ref EntityEffectEvent args) + { + var nullable = new Entity(entity, entity.Comp); + _entityManager.System() + .ClampWounds(nullable, args.Effect.Chance); + } +} + +/// +public sealed partial class ClampWounds: EntityEffectBase +{ + [DataField(required: true)] + public float Chance; + + public override string? EntityEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys) + { + return Loc.GetString("reagent-effect-guidebook-clamp-wounds", ("probability", Probability), ("chance", Chance)); + } +} diff --git a/Content.Shared/_Offbrand/EntityEffects/Effects/ModifyBrainDamage.cs b/Content.Shared/_Offbrand/EntityEffects/Effects/ModifyBrainDamage.cs new file mode 100644 index 0000000000..15d0fb38b1 --- /dev/null +++ b/Content.Shared/_Offbrand/EntityEffects/Effects/ModifyBrainDamage.cs @@ -0,0 +1,33 @@ +using Content.Shared._Offbrand.Wounds; +using Content.Shared.EntityEffects; +using Content.Shared.FixedPoint; +using Robust.Shared.Prototypes; + +namespace Content.Shared._Offbrand.EntityEffects; + +/// +public sealed partial class ModifyBrainDamageEffectSystem : EntityEffectSystem +{ + [Dependency] private readonly IEntityManager _entityManager = default!; + + protected override void Effect(Entity entity, ref EntityEffectEvent args) + { + var nullable = new Entity(entity, entity.Comp); + _entityManager.System() + .TryChangeBrainDamage(nullable, args.Effect.Amount * args.Scale); + } +} + +public sealed partial class ModifyBrainDamage : EntityEffectBase +{ + [DataField(required: true)] + public FixedPoint2 Amount; + + 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)); + else + return Loc.GetString("reagent-effect-guidebook-modify-brain-damage-deals", ("chance", Probability), ("amount", Amount)); + } +} diff --git a/Content.Shared/_Offbrand/EntityEffects/Effects/ModifyBrainOxygen.cs b/Content.Shared/_Offbrand/EntityEffects/Effects/ModifyBrainOxygen.cs new file mode 100644 index 0000000000..2e71d6b48a --- /dev/null +++ b/Content.Shared/_Offbrand/EntityEffects/Effects/ModifyBrainOxygen.cs @@ -0,0 +1,34 @@ +using Content.Shared._Offbrand.Wounds; +using Content.Shared.EntityEffects; +using Content.Shared.FixedPoint; +using Robust.Shared.Prototypes; + +namespace Content.Shared._Offbrand.EntityEffects; + +/// +public sealed partial class ModifyBrainOxygenEffectSystem : EntityEffectSystem +{ + [Dependency] private readonly IEntityManager _entityManager = default!; + + protected override void Effect(Entity entity, ref EntityEffectEvent args) + { + var nullable = new Entity(entity, entity.Comp); + _entityManager.System() + .TryChangeBrainOxygenation(nullable, args.Effect.Amount * args.Scale); + } +} + +public sealed partial class ModifyBrainOxygen : EntityEffectBase +{ + [DataField(required: true)] + public FixedPoint2 Amount; + + 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)); + else + return Loc.GetString("reagent-effect-guidebook-modify-brain-oxygen-deals", ("chance", Probability), ("amount", -Amount)); + } +} + diff --git a/Content.Shared/_Offbrand/EntityEffects/Effects/ModifyHeartDamage.cs b/Content.Shared/_Offbrand/EntityEffects/Effects/ModifyHeartDamage.cs new file mode 100644 index 0000000000..6c30990311 --- /dev/null +++ b/Content.Shared/_Offbrand/EntityEffects/Effects/ModifyHeartDamage.cs @@ -0,0 +1,34 @@ +using Content.Shared._Offbrand.Wounds; +using Content.Shared.EntityEffects; +using Content.Shared.FixedPoint; +using Robust.Shared.Prototypes; + +namespace Content.Shared._Offbrand.EntityEffects; + +/// +public sealed partial class ModifyHeartDamageEffectSystem : EntityEffectSystem +{ + [Dependency] private readonly IEntityManager _entityManager = default!; + + protected override void Effect(Entity entity, ref EntityEffectEvent args) + { + var nullable = new Entity(entity, entity.Comp); + _entityManager.System() + .ChangeHeartDamage(nullable, args.Effect.Amount * args.Scale); + } +} + +public sealed partial class ModifyHeartDamage : EntityEffectBase +{ + [DataField(required: true)] + public FixedPoint2 Amount; + + 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)); + else + return Loc.GetString("reagent-effect-guidebook-modify-heart-damage-deals", ("chance", Probability), ("amount", Amount)); + } +} + diff --git a/Content.Shared/_Offbrand/EntityEffects/Effects/ModifyLungDamage.cs b/Content.Shared/_Offbrand/EntityEffects/Effects/ModifyLungDamage.cs new file mode 100644 index 0000000000..cdac6275c1 --- /dev/null +++ b/Content.Shared/_Offbrand/EntityEffects/Effects/ModifyLungDamage.cs @@ -0,0 +1,34 @@ +using Content.Shared._Offbrand.Wounds; +using Content.Shared.EntityEffects; +using Content.Shared.FixedPoint; +using Robust.Shared.Prototypes; + +namespace Content.Shared._Offbrand.EntityEffects; + +/// +public sealed partial class ModifyLungDamageEffectSystem : EntityEffectSystem +{ + [Dependency] private readonly IEntityManager _entityManager = default!; + + protected override void Effect(Entity entity, ref EntityEffectEvent args) + { + var nullable = new Entity(entity, entity.Comp); + _entityManager.System() + .TryModifyDamage(nullable, args.Effect.Amount * args.Scale); + } +} + +public sealed partial class ModifyLungDamage : EntityEffectBase +{ + [DataField(required: true)] + public FixedPoint2 Amount; + + 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)); + else + return Loc.GetString("reagent-effect-guidebook-modify-lung-damage-deals", ("chance", Probability), ("amount", Amount)); + } +} + diff --git a/Content.Shared/_Offbrand/EntityEffects/Effects/RemoveStatusEffect.cs b/Content.Shared/_Offbrand/EntityEffects/Effects/RemoveStatusEffect.cs new file mode 100644 index 0000000000..725e18dcb0 --- /dev/null +++ b/Content.Shared/_Offbrand/EntityEffects/Effects/RemoveStatusEffect.cs @@ -0,0 +1,33 @@ +using Content.Shared.EntityEffects; +using Content.Shared.StatusEffectNew; +using Content.Shared.StatusEffectNew.Components; +using Robust.Shared.Prototypes; + +namespace Content.Shared._Offbrand.EntityEffects; + +/// +public sealed partial class RemoveStatusEffectEntityEffectSystem : EntityEffectSystem +{ + [Dependency] private readonly IEntityManager _entityManager = default!; + + protected override void Effect(Entity entity, ref EntityEffectEvent args) + { + _entityManager.System() + .TryRemoveStatusEffect(entity, args.Effect.EffectProto); + } +} + +public sealed partial class RemoveStatusEffect : EntityEffectBase +{ + [DataField(required: true)] + public EntProtoId EffectProto; + + /// + public override string? EntityEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys) + { + return Loc.GetString( + "reagent-effect-guidebook-status-effect-remove", + ("chance", Probability), + ("key", prototype.Index(EffectProto).Name)); + } +} diff --git a/Content.Shared/_Offbrand/EntityEffects/Effects/StartHeart.cs b/Content.Shared/_Offbrand/EntityEffects/Effects/StartHeart.cs new file mode 100644 index 0000000000..26fe676e28 --- /dev/null +++ b/Content.Shared/_Offbrand/EntityEffects/Effects/StartHeart.cs @@ -0,0 +1,27 @@ +using Content.Shared._Offbrand.Wounds; +using Content.Shared.EntityEffects; +using Content.Shared.FixedPoint; +using Robust.Shared.Prototypes; + +namespace Content.Shared._Offbrand.EntityEffects; + +/// +public sealed partial class StartHeartEntityEffectSystem : EntityEffectSystem +{ + [Dependency] private readonly IEntityManager _entityManager = default!; + + protected override void Effect(Entity entity, ref EntityEffectEvent args) + { + var nullable = new Entity(entity, entity.Comp); + _entityManager.System() + .TryRestartHeart(nullable); + } +} + +public sealed partial class StartHeart : EntityEffectBase +{ + public override string? EntityEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys) + { + return Loc.GetString("reagent-effect-guidebook-start-heart", ("chance", Probability)); + } +} diff --git a/Content.Shared/_Offbrand/EntityEffects/Effects/Zombify.cs b/Content.Shared/_Offbrand/EntityEffects/Effects/Zombify.cs new file mode 100644 index 0000000000..6ff1f2b991 --- /dev/null +++ b/Content.Shared/_Offbrand/EntityEffects/Effects/Zombify.cs @@ -0,0 +1,21 @@ +using Content.Shared.EntityEffects; +using Content.Shared.FixedPoint; +using Content.Shared.Mobs.Components; +using Robust.Shared.Prototypes; + +namespace Content.Shared._Offbrand.EntityEffects; + +/// +public sealed partial class ZombidyEntityEffectSystem : EntityEffectSystem +{ + protected override void Effect(Entity entity, ref EntityEffectEvent args) + { } +} + +public sealed partial class Zombify : EntityEffectBase +{ + public override string? EntityEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys) + { + return Loc.GetString("reagent-effect-guidebook-zombify", ("chance", Probability)); + } +} diff --git a/Content.Shared/_Offbrand/EntityEffects/HeartDamage.cs b/Content.Shared/_Offbrand/EntityEffects/HeartDamage.cs deleted file mode 100644 index 9b070e22ff..0000000000 --- a/Content.Shared/_Offbrand/EntityEffects/HeartDamage.cs +++ /dev/null @@ -1,32 +0,0 @@ -using Content.Shared._Offbrand.Wounds; -using Content.Shared.EntityEffects; -using Content.Shared.FixedPoint; -using Robust.Shared.Prototypes; - -namespace Content.Shared._Offbrand.EntityEffects; - -public sealed partial class HeartDamage : EntityEffectCondition -{ - [DataField] - public FixedPoint2 Max = FixedPoint2.MaxValue; - - [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) - { - return Loc.GetString("reagent-effect-condition-guidebook-heart-damage", - ("max", Max == FixedPoint2.MaxValue ? (float) int.MaxValue : Max.Float()), - ("min", Min.Float())); - } -} diff --git a/Content.Shared/_Offbrand/EntityEffects/IsZombie.cs b/Content.Shared/_Offbrand/EntityEffects/IsZombie.cs deleted file mode 100644 index 990dc94f02..0000000000 --- a/Content.Shared/_Offbrand/EntityEffects/IsZombie.cs +++ /dev/null @@ -1,21 +0,0 @@ -using Content.Shared.EntityEffects; -using Content.Shared.Zombies; -using Robust.Shared.Prototypes; - -namespace Content.Shared._Offbrand.EntityEffects; - -public sealed partial class IsZombie : EntityEffectCondition -{ - [DataField] - public bool Invert = false; - - public override bool Condition(EntityEffectBaseArgs args) - { - return args.EntityManager.HasComponent(args.TargetEntity) ^ Invert; - } - - public override string GuidebookExplanation(IPrototypeManager prototype) - { - return Loc.GetString("reagent-effect-condition-guidebook-is-zombie", ("invert", Invert)); - } -} diff --git a/Content.Shared/_Offbrand/EntityEffects/IsZombieImmune.cs b/Content.Shared/_Offbrand/EntityEffects/IsZombieImmune.cs deleted file mode 100644 index 71cdbc7243..0000000000 --- a/Content.Shared/_Offbrand/EntityEffects/IsZombieImmune.cs +++ /dev/null @@ -1,21 +0,0 @@ -using Content.Shared.EntityEffects; -using Content.Shared.Zombies; -using Robust.Shared.Prototypes; - -namespace Content.Shared._Offbrand.EntityEffects; - -public sealed partial class IsZombieImmune : EntityEffectCondition -{ - [DataField] - public bool Invert = false; - - public override bool Condition(EntityEffectBaseArgs args) - { - 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)); - } -} diff --git a/Content.Shared/_Offbrand/EntityEffects/LungDamage.cs b/Content.Shared/_Offbrand/EntityEffects/LungDamage.cs deleted file mode 100644 index 7c9e8584ac..0000000000 --- a/Content.Shared/_Offbrand/EntityEffects/LungDamage.cs +++ /dev/null @@ -1,32 +0,0 @@ -using Content.Shared._Offbrand.Wounds; -using Content.Shared.EntityEffects; -using Content.Shared.FixedPoint; -using Robust.Shared.Prototypes; - -namespace Content.Shared._Offbrand.EntityEffects; - -public sealed partial class LungDamage : EntityEffectCondition -{ - [DataField] - public FixedPoint2 Max = FixedPoint2.MaxValue; - - [DataField] - public FixedPoint2 Min = FixedPoint2.Zero; - - public override bool Condition(EntityEffectBaseArgs args) - { - 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", - ("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 deleted file mode 100644 index 1a186b1cd3..0000000000 --- a/Content.Shared/_Offbrand/EntityEffects/ModifyBrainDamage.cs +++ /dev/null @@ -1,31 +0,0 @@ -using Content.Shared._Offbrand.Wounds; -using Content.Shared.EntityEffects; -using Content.Shared.FixedPoint; -using Robust.Shared.Prototypes; - -namespace Content.Shared._Offbrand.EntityEffects; - -public sealed partial class ModifyBrainDamage : EntityEffect -{ - [DataField(required: true)] - public FixedPoint2 Amount; - - protected override string ReagentEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys) - { - if (Amount < FixedPoint2.Zero) - return Loc.GetString("reagent-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); - } -} diff --git a/Content.Shared/_Offbrand/EntityEffects/ModifyBrainOxygen.cs b/Content.Shared/_Offbrand/EntityEffects/ModifyBrainOxygen.cs deleted file mode 100644 index 112e92357e..0000000000 --- a/Content.Shared/_Offbrand/EntityEffects/ModifyBrainOxygen.cs +++ /dev/null @@ -1,31 +0,0 @@ -using Content.Shared._Offbrand.Wounds; -using Content.Shared.EntityEffects; -using Content.Shared.FixedPoint; -using Robust.Shared.Prototypes; - -namespace Content.Shared._Offbrand.EntityEffects; - -public sealed partial class ModifyBrainOxygen : EntityEffect -{ - [DataField(required: true)] - public FixedPoint2 Amount; - - protected override string ReagentEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys) - { - if (Amount > FixedPoint2.Zero) - return Loc.GetString("reagent-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); - } -} diff --git a/Content.Shared/_Offbrand/EntityEffects/ModifyHeartDamage.cs b/Content.Shared/_Offbrand/EntityEffects/ModifyHeartDamage.cs deleted file mode 100644 index 2b4a1bfd7e..0000000000 --- a/Content.Shared/_Offbrand/EntityEffects/ModifyHeartDamage.cs +++ /dev/null @@ -1,31 +0,0 @@ -using Content.Shared._Offbrand.Wounds; -using Content.Shared.EntityEffects; -using Content.Shared.FixedPoint; -using Robust.Shared.Prototypes; - -namespace Content.Shared._Offbrand.EntityEffects; - -public sealed partial class ModifyHeartDamage : EntityEffect -{ - [DataField(required: true)] - public FixedPoint2 Amount; - - protected override string ReagentEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys) - { - if (Amount < FixedPoint2.Zero) - return Loc.GetString("reagent-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); - } -} diff --git a/Content.Shared/_Offbrand/EntityEffects/ModifyLungDamage.cs b/Content.Shared/_Offbrand/EntityEffects/ModifyLungDamage.cs deleted file mode 100644 index ae1d579ba5..0000000000 --- a/Content.Shared/_Offbrand/EntityEffects/ModifyLungDamage.cs +++ /dev/null @@ -1,31 +0,0 @@ -using Content.Shared._Offbrand.Wounds; -using Content.Shared.EntityEffects; -using Content.Shared.FixedPoint; -using Robust.Shared.Prototypes; - -namespace Content.Shared._Offbrand.EntityEffects; - -public sealed partial class ModifyLungDamage : EntityEffect -{ - [DataField(required: true)] - public FixedPoint2 Amount; - - protected override string ReagentEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys) - { - if (Amount < FixedPoint2.Zero) - return Loc.GetString("reagent-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); - } -} diff --git a/Content.Shared/_Offbrand/EntityEffects/RemoveStatusEffect.cs b/Content.Shared/_Offbrand/EntityEffects/RemoveStatusEffect.cs deleted file mode 100644 index 39887e240e..0000000000 --- a/Content.Shared/_Offbrand/EntityEffects/RemoveStatusEffect.cs +++ /dev/null @@ -1,24 +0,0 @@ -using Content.Shared.EntityEffects; -using Content.Shared.StatusEffectNew; -using Robust.Shared.Prototypes; - -namespace Content.Shared._Offbrand.EntityEffects; - -public sealed partial class RemoveStatusEffect : EntityEffect -{ - [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) => - Loc.GetString( - "reagent-effect-guidebook-status-effect-remove", - ("chance", Probability), - ("key", prototype.Index(EffectProto).Name)); -} diff --git a/Content.Shared/_Offbrand/EntityEffects/StartHeart.cs b/Content.Shared/_Offbrand/EntityEffects/StartHeart.cs deleted file mode 100644 index 25a524662c..0000000000 --- a/Content.Shared/_Offbrand/EntityEffects/StartHeart.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Content.Shared._Offbrand.Wounds; -using Content.Shared.EntityEffects; -using Robust.Shared.Prototypes; - -namespace Content.Shared._Offbrand.EntityEffects; - -public sealed partial class StartHeart : EntityEffect -{ - protected override string ReagentEffectGuidebookText(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); - } -} 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 deleted file mode 100644 index b863571b8c..0000000000 --- a/Content.Shared/_Offbrand/EntityEffects/Zombify.cs +++ /dev/null @@ -1,10 +0,0 @@ -using Content.Shared.EntityEffects; -using Robust.Shared.Prototypes; - -namespace Content.Shared._Offbrand.EntityEffects; - -public sealed partial class Zombify : EventEntityEffect -{ - protected override string? ReagentEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys) - => Loc.GetString("reagent-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..f30920c1b4 100644 --- a/Content.Shared/_Offbrand/StatusEffects/DamageOverTimeStatusEffectSystem.cs +++ b/Content.Shared/_Offbrand/StatusEffects/DamageOverTimeStatusEffectSystem.cs @@ -1,4 +1,5 @@ using Content.Shared.Damage; +using Content.Shared.Damage.Systems; using Content.Shared.StatusEffectNew.Components; using Robust.Shared.Prototypes; using Robust.Shared.Timing; diff --git a/Content.Shared/_Offbrand/StatusEffects/DisruptOnAttackStatusEffectSystem.cs b/Content.Shared/_Offbrand/StatusEffects/DisruptOnAttackStatusEffectSystem.cs index 5d842f48fd..bf228ba8f8 100644 --- a/Content.Shared/_Offbrand/StatusEffects/DisruptOnAttackStatusEffectSystem.cs +++ b/Content.Shared/_Offbrand/StatusEffects/DisruptOnAttackStatusEffectSystem.cs @@ -1,5 +1,6 @@ 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..0ae564ce5d 100644 --- a/Content.Shared/_Offbrand/StatusEffects/SlowOnDamageModifierStatusEffectSystem.cs +++ b/Content.Shared/_Offbrand/StatusEffects/SlowOnDamageModifierStatusEffectSystem.cs @@ -1,4 +1,5 @@ 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..9fa4d586e4 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.TryUse(used, 1); - if (_stack.GetCount(used, stackComp) <= 0) + if (_stack.GetCount(used) <= 0) hasMoreItems = false; } else diff --git a/Content.Shared/_Offbrand/Wounds/BrainDamageOnDamageSystem.cs b/Content.Shared/_Offbrand/Wounds/BrainDamageOnDamageSystem.cs index 6fc0deed95..e1c152046f 100644 --- a/Content.Shared/_Offbrand/Wounds/BrainDamageOnDamageSystem.cs +++ b/Content.Shared/_Offbrand/Wounds/BrainDamageOnDamageSystem.cs @@ -1,4 +1,6 @@ using Content.Shared.Damage; +using Content.Shared.Damage.Components; +using Content.Shared.Damage.Systems; using Content.Shared.FixedPoint; namespace Content.Shared._Offbrand.Wounds; diff --git a/Content.Shared/_Offbrand/Wounds/BrainDamageSystem.cs b/Content.Shared/_Offbrand/Wounds/BrainDamageSystem.cs index 12907051fd..80e908f219 100644 --- a/Content.Shared/_Offbrand/Wounds/BrainDamageSystem.cs +++ b/Content.Shared/_Offbrand/Wounds/BrainDamageSystem.cs @@ -223,7 +223,7 @@ public sealed partial class BrainDamageSystem : EntitySystem { var oxygenation = _heart.BloodOxygenation((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.Shared/_Offbrand/Wounds/HeartDamageOnDamageSystem.cs b/Content.Shared/_Offbrand/Wounds/HeartDamageOnDamageSystem.cs index 1011a68f01..d85c9ba454 100644 --- a/Content.Shared/_Offbrand/Wounds/HeartDamageOnDamageSystem.cs +++ b/Content.Shared/_Offbrand/Wounds/HeartDamageOnDamageSystem.cs @@ -1,4 +1,6 @@ using Content.Shared.Damage; +using Content.Shared.Damage.Components; +using Content.Shared.Damage.Systems; using Content.Shared.FixedPoint; namespace Content.Shared._Offbrand.Wounds; diff --git a/Content.Shared/_Offbrand/Wounds/HeartSystem.cs b/Content.Shared/_Offbrand/Wounds/HeartSystem.cs index 1fa4c92c12..c57f12217d 100644 --- a/Content.Shared/_Offbrand/Wounds/HeartSystem.cs +++ b/Content.Shared/_Offbrand/Wounds/HeartSystem.cs @@ -4,6 +4,7 @@ using Content.Shared.Body.Components; using Content.Shared.Body.Events; using Content.Shared.Chemistry.EntitySystems; using Content.Shared.Damage; +using Content.Shared.Damage.Components; using Content.Shared.FixedPoint; using Content.Shared.Medical; using Content.Shared.Random.Helpers; @@ -102,7 +103,7 @@ public sealed partial class HeartSystem : EntitySystem var threshold = heartrate.StrainDamageThresholds.HighestMatch(HeartStrain((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)) @@ -170,7 +171,7 @@ public sealed partial class HeartSystem : EntitySystem private void OnHeartBeatHypovolemia(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); var volume = BloodVolume((ent.Owner, Comp(ent))); @@ -179,7 +180,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)) @@ -191,7 +192,7 @@ public sealed partial class HeartSystem : EntitySystem private void OnHeartBeatBrain(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)) @@ -351,7 +352,7 @@ public sealed partial class HeartSystem : EntitySystem public (FixedPoint2, FixedPoint2) 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 volume = BloodCirculation(ent); @@ -370,7 +371,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 strain = HeartStrain(ent); diff --git a/Content.Shared/_Offbrand/Wounds/IntrinsicPainSystem.cs b/Content.Shared/_Offbrand/Wounds/IntrinsicPainSystem.cs index eddada09f1..85a6af60db 100644 --- a/Content.Shared/_Offbrand/Wounds/IntrinsicPainSystem.cs +++ b/Content.Shared/_Offbrand/Wounds/IntrinsicPainSystem.cs @@ -1,4 +1,5 @@ using Content.Shared.Damage; +using Content.Shared.Damage.Components; namespace Content.Shared._Offbrand.Wounds; diff --git a/Content.Shared/_Offbrand/Wounds/MaximumDamageSystem.cs b/Content.Shared/_Offbrand/Wounds/MaximumDamageSystem.cs index 5d412b4f85..76c1e22d21 100644 --- a/Content.Shared/_Offbrand/Wounds/MaximumDamageSystem.cs +++ b/Content.Shared/_Offbrand/Wounds/MaximumDamageSystem.cs @@ -1,4 +1,5 @@ using Content.Shared.Damage; +using Content.Shared.Damage.Components; using Content.Shared.FixedPoint; using Robust.Shared.Timing; using Robust.Shared.Utility; diff --git a/Content.Shared/_Offbrand/Wounds/TendingSystem.cs b/Content.Shared/_Offbrand/Wounds/TendingSystem.cs index 2c3441ec8b..974f7218ca 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.TryUse(args.Used.Value, 1); - if (_stack.GetCount(args.Used.Value, stackComp) <= 0) + if (_stack.GetCount(args.Used.Value) <= 0) hasMoreItems = false; } else diff --git a/Content.Shared/_Offbrand/Wounds/UniqueWoundOnDamageSystem.cs b/Content.Shared/_Offbrand/Wounds/UniqueWoundOnDamageSystem.cs index 4bd7721647..98670539e7 100644 --- a/Content.Shared/_Offbrand/Wounds/UniqueWoundOnDamageSystem.cs +++ b/Content.Shared/_Offbrand/Wounds/UniqueWoundOnDamageSystem.cs @@ -1,4 +1,6 @@ using Content.Shared.Damage; +using Content.Shared.Damage.Systems; +using Content.Shared.Damage.Components; using Content.Shared.Random.Helpers; using Robust.Shared.Random; using Robust.Shared.Timing; @@ -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..7a2df0681d 100644 --- a/Content.Shared/_Offbrand/Wounds/WoundableSystem.cs +++ b/Content.Shared/_Offbrand/Wounds/WoundableSystem.cs @@ -1,7 +1,9 @@ using System.Linq; using Content.Shared.Body.Systems; using Content.Shared.Damage.Prototypes; +using Content.Shared.Damage.Systems; using Content.Shared.Damage; +using Content.Shared.Damage.Components; using Content.Shared.FixedPoint; using Content.Shared.HealthExaminable; using Content.Shared.IdentityManagement; @@ -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, null, 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; @@ -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)) @@ -453,14 +455,16 @@ public sealed class WoundableSystem : EntitySystem var changeBy = damage - remainder.ToSpecifier(); changeBy.TrimZeros(); + TryComp(woundable, out var comp); + var damageable = new Entity(woundable, comp); if (changeBy.AnyNegative()) { - var actualDelta = _damageable.TryChangeDamage(woundable, changeBy, true, false, null, null, forceRefresh: true); + _damageable.TryChangeDamage(damageable, changeBy, out var actualDelta, true, false, null, forceRefresh: true); DebugTools.Assert(actualDelta is not null); DebugTools.Assert(changeBy.Equals(actualDelta!), $"{changeBy} == {actualDelta!}"); } - ValidateWounds(woundable, null); + ValidateWounds(damageable, null); } Dirty(ent); } diff --git a/Resources/Locale/ru-RU/ss14-ru/prototypes/entities/objects/specific/chemistry-bottles.ftl b/Resources/Locale/ru-RU/ss14-ru/prototypes/entities/objects/specific/chemistry-bottles.ftl index 481eb9266f..c5e10beff5 100644 --- a/Resources/Locale/ru-RU/ss14-ru/prototypes/entities/objects/specific/chemistry-bottles.ftl +++ b/Resources/Locale/ru-RU/ss14-ru/prototypes/entities/objects/specific/chemistry-bottles.ftl @@ -176,12 +176,6 @@ ent-ChemistryBottleLeft4Zed = { ent-BaseChemistryBottleFilled } .desc = { ent-BaseChemistryBottleFilled.desc } .suffix = Аритразин -ent-ChemistryBottleBarozine = { ent-BaseChemistryBottleFilled } - .desc = { ent-BaseChemistryBottleFilled.desc } - .suffix = Барозин - -ent-ChemistryBottleBicaridine = { ent-BaseChemistryBottleFilled } - .desc = { ent-BaseChemistryBottleFilled.desc } ent-ChemistryBottleEphedrine = { ent-BaseChemistryBottleFilled } .suffix = Эфедрин .desc = { ent-BaseChemistryBottleFilled.desc } diff --git a/Resources/Prototypes/Reagents/botany.yml b/Resources/Prototypes/Reagents/botany.yml index d0a7a7ba5d..d91885d346 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: @@ -191,20 +191,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 @@ -256,14 +258,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: @@ -354,9 +356,9 @@ # Begin Offbrand Caustic: 0.5 conditions: - - !type:OrganType - type: Plant - shouldHave: false + - !type:MetabolizerTypeCondition + type: [Plant] + inverted: true - !type:HealthChange damage: types: @@ -364,6 +366,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 c0a5b0600d..f9b7b66f82 100644 --- a/Resources/Prototypes/Reagents/gases.yml +++ b/Resources/Prototypes/Reagents/gases.yml @@ -377,12 +377,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: true effectProto: StatusEffectPainSuppressionNitrousOxide time: 3 type: Add diff --git a/Resources/Prototypes/Reagents/medicine.yml b/Resources/Prototypes/Reagents/medicine.yml index d3a63b97fc..a511d17ac5 100644 --- a/Resources/Prototypes/Reagents/medicine.yml +++ b/Resources/Prototypes/Reagents/medicine.yml @@ -293,11 +293,11 @@ statusEffects: - statusEffect: StatusEffectMinorOxygenationCryoxadone conditions: - - !type:Temperature + - !type:TemperatureCondition max: 213.0 - statusEffect: StatusEffectHeartStabilizationCryoxadone conditions: - - !type:Temperature + - !type:TemperatureCondition max: 213.0 effects: - !type:ModifyHeartDamage @@ -313,7 +313,7 @@ - !type:ModifyLungDamage amount: -0.3 conditions: - - !type:Temperature + - !type:TemperatureCondition max: 213.0 # WL species start - !type:MetabolizerTypeCondition @@ -322,7 +322,7 @@ # WL species end - !type:EvenHealthChange conditions: - - !type:Temperature + - !type:TemperatureCondition max: 213.0 # WL species start - !type:MetabolizerTypeCondition @@ -2113,7 +2113,7 @@ - !type:ReduceRotting seconds: 20 conditions: - - !type:Temperature + - !type:TemperatureCondition max: 213.0 # End Offbrand - Derotting moved to necrosol - !type:HealthChange @@ -2188,15 +2188,17 @@ boozePower: 1 - !type:Jitter conditions: - - !type:ReagentThreshold + - !type:ReagentCondition + reagent: Mannitol min: 10.5 - !type:Emote emote: Scream probability: 0.2 conditions: - - !type:ReagentThreshold + - !type:ReagentCondition + reagent: Mannitol min: 10.5 - - !type:ChemVomit + - !type:Vomit conditions: - !type:ReagentCondition reagent: Mannitol @@ -2204,7 +2206,8 @@ 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 1e29c39f96..1758a7fd4e 100644 --- a/Resources/Prototypes/Reagents/toxins.yml +++ b/Resources/Prototypes/Reagents/toxins.yml @@ -425,28 +425,18 @@ groups: Airloss: 10 # WL species start - # Android conditions: - !type:MetabolizerTypeCondition - type: [ Biorobotic ] - inverted: true - # Golem - - !type:MetabolizerTypeCondition - type: [ Golem ] + type: [ Biorobotic, Golem] inverted: true # WL species end - !type:ModifyLungDamage # Offbrand amount: 2 # WL species start - # Android conditions: - - !type:OrganType - type: Biorobotic - shouldHave: false - # Golem - - !type:OrganType - type: Golem - shouldHave: false + - !type:MetabolizerTypeCondition + type: [ Biorobotic, Golem] + inverted: true # WL species end @@ -651,20 +641,21 @@ statusEffects: - statusEffect: StatusEffectHeartStrainRomerol conditions: - - !type:MetaboliteThreshold + - !type:MetaboliteCondition + 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 + - !type:IsZombieImmuneCondition invert: true - !type:PopupMessage type: Local @@ -676,14 +667,16 @@ - zombification-30-message-4 probability: 0.05 conditions: - - !type:MetaboliteThreshold + - !type:MetaboliteCondition + reagent: Romerol min: 15 - !type:HealthChange damage: types: Poison: 0.15 conditions: - - !type:MetaboliteThreshold + - !type:MetaboliteCondition + reagent: Romerol min: 15 - !type:ModifyHeartDamage amount: 2 @@ -704,39 +697,46 @@ mobstate: Critical - !type:Zombify conditions: - - !type:BrainDamage + - !type:BrainDamageCondition min: 70 - - !type:MetaboliteThreshold + - !type:MetaboliteCondition + reagent: Romerol min: 15 - !type:ModifyBrainDamage amount: 0.5 conditions: - - !type:MetaboliteThreshold + - !type:MetaboliteCondition + reagent: Romerol min: 15 - !type:ModifyHeartDamage amount: 0.2 conditions: - - !type:MetaboliteThreshold + - !type:MetaboliteCondition + reagent: Romerol min: 15 - !type:ModifyLungDamage amount: 0.2 conditions: - - !type:MetaboliteThreshold + - !type:MetaboliteCondition + reagent: Romerol min: 15 - !type:AdjustTemperature amount: 3000 conditions: - - !type:MetaboliteThreshold + - !type:MetaboliteCondition + reagent: Romerol min: 15 - !type:Jitter probability: 0.25 conditions: - - !type:MetaboliteThreshold + - !type:MetaboliteCondition + reagent: Romerol min: 30 - !type:AdjustTemperature amount: 6000 conditions: - - !type:MetaboliteThreshold + - !type:MetaboliteCondition + reagent: Romerol min: 30 - !type:PopupMessage type: Local @@ -748,12 +748,14 @@ - zombification-60-message-4 probability: 0.05 conditions: - - !type:MetaboliteThreshold + - !type:MetaboliteCondition + reagent: Romerol min: 30 - !type:ModifyBrainDamage amount: 0.25 conditions: - - !type:MetaboliteThreshold + - !type:MetaboliteCondition + reagent: Romerol min: 45 - !type:HealthChange damage: @@ -762,7 +764,8 @@ Blunt: 0.15 Piercing: 0.15 conditions: - - !type:MetaboliteThreshold + - !type:MetaboliteCondition + reagent: Romerol min: 45 - !type:PopupMessage type: Local @@ -774,12 +777,14 @@ - zombification-90-message-4 probability: 0.05 conditions: - - !type:MetaboliteThreshold + - !type:MetaboliteCondition + reagent: Romerol min: 45 - !type:ModifyBrainDamage amount: 0.5 conditions: - - !type:MetaboliteThreshold + - !type:MetaboliteCondition + reagent: Romerol min: 60 - !type:PopupMessage type: Local @@ -791,12 +796,14 @@ - zombification-120-message-4 probability: 0.05 conditions: - - !type:MetaboliteThreshold + - !type:MetaboliteCondition + reagent: Romerol min: 60 - !type:ModifyBrainDamage amount: 5 conditions: - - !type:MetaboliteThreshold + - !type:MetaboliteCondition + reagent: Romerol min: 70 - !type:Zombify conditions: diff --git a/Resources/Prototypes/_Offbrand/reagents.yml b/Resources/Prototypes/_Offbrand/reagents.yml index 115de97268..498d74bbbc 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 @@ -287,7 +303,8 @@ effects: - !type:ClampWounds chance: 0.4 - - !type:RemoveStatusEffect + - !type:ModifyStatusEffect + type: Remove effectProto: WoundArterialBleeding probability: 0.2 @@ -303,16 +320,18 @@ metabolisms: Medicine: effects: - - !type:RemoveStatusEffect + - !type:ModifyStatusEffect + type: Remove effectProto: WoundFracture conditions: - - !type:MetaboliteThreshold + - !type:MetaboliteCondition + reagent: Osseous min: 5 - !type:AdjustReagent reagent: Osseous amount: -5 conditions: - - !type:MetaboliteThreshold + - !type:MetaboliteCondition min: 5 - type: reagent @@ -332,7 +351,7 @@ Asphyxiation: -4 Blunt: 1 conditions: - - !type:TotalGroupDamage + - !type:TotalGroupDamageCondition group: Airloss min: 4 - !type:HealthChange @@ -341,9 +360,10 @@ Asphyxiation: -4 Blunt: 1 conditions: - - !type:MetaboliteThreshold + - !type:MetaboliteCondition + reagent: Convermol min: 10 - - !type:TotalGroupDamage + - !type:TotalGroupDamageCondition group: Airloss min: 4 - !type:ModifyLungDamage @@ -363,7 +383,7 @@ statusEffects: - statusEffect: StatusEffectPainkillersSalicylicAcid conditions: - - !type:TotalGroupDamage + - !type:TotalGroupDamageCondition group: Brute min: 35 effects: @@ -371,35 +391,40 @@ damage: Brute: -2 conditions: - - !type:TotalGroupDamage + - !type:TotalGroupDamageCondition group: Brute min: 35 - - !type:MetaboliteThreshold + - !type:MetaboliteCondition + reagent: SalicylicAcid max: 15 - !type:EvenHealthChange damage: Brute: -2 Burn: 2 conditions: - - !type:MetaboliteThreshold + - !type:MetaboliteCondition + reagent: SalicylicAcid min: 15 - !type:EvenHealthChange damage: Brute: -0.5 conditions: - - !type:TotalGroupDamage + - !type:TotalGroupDamageCondition group: Brute max: 35 - - !type:RemoveStatusEffect + - !type:ModifyStatusEffect effectProto: WoundBoneDeath + type: Remove conditions: - - !type:MetaboliteThreshold + - !type:MetaboliteCondition + reagent: SalicylicAcid min: 50 - !type:EvenHealthChange damage: Burn: 1 conditions: - - !type:MetaboliteThreshold + - !type:MetaboliteCondition + reagent: SalicylicAcid min: 35 - type: reagent @@ -416,7 +441,7 @@ statusEffects: - statusEffect: StatusEffectPainkillersOxandrolone conditions: - - !type:TotalGroupDamage + - !type:TotalGroupDamageCondition group: Burn min: 35 effects: @@ -424,33 +449,38 @@ damage: Burn: -3 conditions: - - !type:TotalGroupDamage + - !type:TotalGroupDamageCondition group: Burn min: 35 - - !type:MetaboliteThreshold + - !type:MetaboliteCondition + reagent: Oxandrolone max: 15 - !type:EvenHealthChange damage: Burn: -3 Brute: 3 conditions: - - !type:MetaboliteThreshold + - !type:MetaboliteCondition + reagent: Oxandrolone min: 15 - !type:EvenHealthChange damage: Burn: -0.5 conditions: - - !type:TotalGroupDamage + - !type:TotalGroupDamageCondition group: Burn max: 35 - - !type:RemoveStatusEffect + - !type:ModifyStatusEffect + type: Remove effectProto: WoundHusking conditions: - - !type:MetaboliteThreshold + - !type:MetaboliteCondition + reagent: Oxandrolone min: 50 - !type:EvenHealthChange damage: Brute: 1 conditions: - - !type:MetaboliteThreshold + - !type:MetaboliteCondition + reagent: Oxandrolone min: 35 diff --git a/Resources/Prototypes/_WL/Entities/Mobs/Species/base.yml b/Resources/Prototypes/_WL/Entities/Mobs/Species/base.yml index c5d119b1c1..026cc49e38 100644 --- a/Resources/Prototypes/_WL/Entities/Mobs/Species/base.yml +++ b/Resources/Prototypes/_WL/Entities/Mobs/Species/base.yml @@ -123,7 +123,7 @@ - reagents: [Water, SpaceCleaner] methods: [Touch] effects: - - !type:WashCreamPieReaction + - !type:WashCreamPie - type: StatusEffects allowed: - Electrocution