This commit is contained in:
Janet Blackquill
2025-11-21 00:32:28 -05:00
parent 340f6b02b3
commit d1d939a898
53 changed files with 577 additions and 475 deletions

View File

@@ -34,6 +34,7 @@ public sealed class MetabolizerSystem : SharedMetabolizerSystem
[Dependency] private readonly SharedEntityConditionsSystem _entityConditions = default!; [Dependency] private readonly SharedEntityConditionsSystem _entityConditions = default!;
[Dependency] private readonly SharedEntityEffectsSystem _entityEffects = default!; [Dependency] private readonly SharedEntityEffectsSystem _entityEffects = default!;
[Dependency] private readonly SharedSolutionContainerSystem _solutionContainerSystem = default!; [Dependency] private readonly SharedSolutionContainerSystem _solutionContainerSystem = default!;
[Dependency] private readonly Content.Shared.StatusEffectNew.StatusEffectsSystem _statusEffects = default!;
private EntityQuery<OrganComponent> _organQuery; private EntityQuery<OrganComponent> _organQuery;
private EntityQuery<SolutionContainerManagerComponent> _solutionQuery; private EntityQuery<SolutionContainerManagerComponent> _solutionQuery;
@@ -129,7 +130,7 @@ public sealed class MetabolizerSystem : SharedMetabolizerSystem
if (solutionEntityUid is null if (solutionEntityUid is null
|| soln is null || soln is null
|| solution 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; return;
} }
@@ -139,6 +140,7 @@ public sealed class MetabolizerSystem : SharedMetabolizerSystem
var list = solution.Contents.ToArray(); var list = solution.Contents.ToArray();
_random.Shuffle(list); _random.Shuffle(list);
var metabolized = new HashSet<ProtoId<ReagentPrototype>>(); // Offbrand
int reagents = 0; int reagents = 0;
foreach (var (reagent, quantity) in list) foreach (var (reagent, quantity) in list)
{ {
@@ -156,10 +158,13 @@ public sealed class MetabolizerSystem : SharedMetabolizerSystem
continue; continue;
} }
// Offbrand - keep processing for status effects and metabolites
// we're done here entirely if this is true // we're done here entirely if this is true
if (reagents >= ent.Comp1.MaxReagentsProcessable) // if (reagents >= ent.Comp1.MaxReagentsProcessable)
return; // return;
metabolized.Add(reagent.Prototype);
// End Offbrand
// loop over all our groups and see which ones apply // loop over all our groups and see which ones apply
if (ent.Comp1.MetabolismGroups is null) if (ent.Comp1.MetabolismGroups is null)
@@ -194,6 +199,16 @@ public sealed class MetabolizerSystem : SharedMetabolizerSystem
var actualEntity = ent.Comp2?.Body ?? solutionEntityUid.Value; var actualEntity = ent.Comp2?.Body ?? solutionEntityUid.Value;
// Begin Offbrand - status effects
foreach (var effect in entry.StatusEffects)
{
if (!_entityConditions.TryConditions(actualEntity, effect.Conditions))
_statusEffects.TryRemoveStatusEffect(actualEntity, effect.StatusEffect);
else
_statusEffects.TryUpdateStatusEffectDuration(actualEntity, effect.StatusEffect, out _);
}
// End Offbrand - status effects
// do all effects, if conditions apply // do all effects, if conditions apply
foreach (var effect in entry.Effects) foreach (var effect in entry.Effects)
{ {
@@ -232,13 +247,80 @@ public sealed class MetabolizerSystem : SharedMetabolizerSystem
// remove a certain amount of reagent // remove a certain amount of reagent
if (mostToRemove > FixedPoint2.Zero) 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 // We have processed a reagant, so count it towards the cap
reagents += 1; reagents += 1;
// Begin Offbrand - track metabbolites
if (!ent.Comp1.Metabolites.ContainsKey(reagent.Prototype))
ent.Comp1.Metabolites[reagent.Prototype] = 0;
ent.Comp1.Metabolites[reagent.Prototype] += removed;
// End Offbrand - track metabbolites
} }
} }
// Begin Offbrand
foreach (var reagent in ent.Comp1.MetabolizingReagents)
{
if (metabolized.Contains(reagent))
continue;
var proto = _prototypeManager.Index(reagent);
var actualEntity = ent.Comp2?.Body ?? solutionEntityUid.Value;
if (ent.Comp1.MetabolismGroups is null)
continue;
foreach (var group in ent.Comp1.MetabolismGroups)
{
if (proto.Metabolisms is null)
continue;
if (!proto.Metabolisms.TryGetValue(group.Id, out var entry))
continue;
foreach (var effect in entry.StatusEffects)
{
_statusEffects.TryRemoveStatusEffect(actualEntity, effect.StatusEffect);
}
}
}
ent.Comp1.MetabolizingReagents = metabolized;
foreach (var metaboliteReagent in ent.Comp1.Metabolites.Keys)
{
if (ent.Comp1.MetabolizingReagents.Contains(metaboliteReagent))
continue;
if (!_prototypeManager.Resolve(metaboliteReagent, out var proto) || proto.Metabolisms is not { } metabolisms)
continue;
if (ent.Comp1.MetabolismGroups is null)
continue;
ReagentEffectsEntry? entry = null;
var metabolismRateModifier = FixedPoint2.Zero;
foreach (var group in ent.Comp1.MetabolismGroups)
{
if (!proto.Metabolisms.TryGetValue(group.Id, out entry))
continue;
metabolismRateModifier = group.MetabolismRateModifier;
break;
}
if (entry is not { } metabolismEntry)
continue;
var rate = metabolismEntry.MetabolismRate * metabolismRateModifier * ent.Comp1.MetaboliteDecayFactor;
ent.Comp1.Metabolites[metaboliteReagent] -= rate;
if (ent.Comp1.Metabolites[metaboliteReagent] <= 0)
ent.Comp1.Metabolites.Remove(metaboliteReagent);
}
// End Offbrand
_solutionContainerSystem.UpdateChemicals(soln.Value); _solutionContainerSystem.UpdateChemicals(soln.Value);
} }

View File

@@ -259,12 +259,12 @@ namespace Content.Server.Zombies
args.Handled = true; args.Handled = true;
continue; continue;
} }
else if (!HasComp<WoundableComponent>(entity)) // Offbrand else if (!HasComp<WoundableComponent>(uid)) // Offbrand
{ {
if (!HasComp<ZombieImmuneComponent>(entity) && !HasComp<NonSpreaderZombieComponent>(args.User) && _random.Prob(GetZombieInfectionChance(entity, component))) if (!HasComp<ZombieImmuneComponent>(uid) && !cannotSpread && _random.Prob(GetZombieInfectionChance(uid, entity.Comp)))
{ {
EnsureComp<PendingZombieComponent>(entity); EnsureComp<PendingZombieComponent>(uid);
EnsureComp<ZombifyOnDeathComponent>(entity); EnsureComp<ZombifyOnDeathComponent>(uid);
} }
} }

View File

@@ -1,48 +1,50 @@
using Content.Server.Body.Components; using Content.Server.Body.Components;
using Content.Shared._Offbrand.EntityEffects; using Content.Shared._Offbrand.EntityEffects;
using Content.Shared.EntityEffects; using Content.Shared.Body.Organ;
using Content.Shared.Chemistry.Components.SolutionManager;
using Content.Shared.Chemistry.Components;
using Content.Shared.Chemistry.EntitySystems;
using Content.Shared.EntityConditions;
using Content.Shared.FixedPoint; using Content.Shared.FixedPoint;
namespace Content.Server._Offbrand.EntityEffects; namespace Content.Server._Offbrand.EntityEffects;
public sealed class MetaboliteThresholdSystem : EntitySystem public sealed class MetaboliteThresholdEntityConditionSystem : EntityConditionSystem<MetabolizerComponent, MetaboliteThresholdCondition>
{ {
public override void Initialize() [Dependency] private readonly SharedSolutionContainerSystem _solutionContainer = default!;
{
base.Initialize();
SubscribeLocalEvent<CheckEntityEffectConditionEvent<MetaboliteThreshold>>(OnCheckMetaboliteThreshold); private Solution? GetSolution(Entity<MetabolizerComponent, OrganComponent?> ent)
{
if (!Resolve(ent, ref ent.Comp2, false))
return null;
if (ent.Comp1.SolutionOnBody)
{
if (ent.Comp2.Body is { } body && _solutionContainer.TryGetSolution(body, ent.Comp1.SolutionName, out _, out var solution))
return solution;
return null;
}
else
{
if (_solutionContainer.TryGetSolution(ent.Owner, ent.Comp1.SolutionName, out _, out var solution))
return solution;
} }
private void OnCheckMetaboliteThreshold(ref CheckEntityEffectConditionEvent<MetaboliteThreshold> args) return null;
{ }
if (args.Args is not EntityEffectReagentArgs reagentArgs)
throw new NotImplementedException();
protected override void Condition(Entity<MetabolizerComponent> ent, ref EntityConditionEvent<MetaboliteThresholdCondition> args)
{
var reagent = args.Condition.Reagent; var reagent = args.Condition.Reagent;
if (reagent == null) var metabolites = ent.Comp.Metabolites;
reagent = reagentArgs.Reagent?.ID;
if (reagent is not { } metaboliteReagent)
{
args.Result = true;
return;
}
if (!TryComp<MetabolizerComponent>(reagentArgs.OrganEntity, out var metabolizer))
{
args.Result = true;
return;
}
var metabolites = metabolizer.Metabolites;
var quant = FixedPoint2.Zero; var quant = FixedPoint2.Zero;
metabolites.TryGetValue(metaboliteReagent, out quant); metabolites.TryGetValue(reagent, out quant);
if (args.Condition.IncludeBloodstream && reagentArgs.Source != null) if (args.Condition.IncludeBloodstream && GetSolution((ent, ent.Comp, null)) is { } solution)
{ {
quant += reagentArgs.Source.GetTotalPrototypeQuantity(metaboliteReagent); quant += solution.GetTotalPrototypeQuantity(reagent);
} }
args.Result = quant >= args.Condition.Min && quant <= args.Condition.Max; args.Result = quant >= args.Condition.Min && quant <= args.Condition.Max;

View File

@@ -4,19 +4,12 @@ using Content.Shared.EntityEffects;
namespace Content.Server._Offbrand.EntityEffects; namespace Content.Server._Offbrand.EntityEffects;
public sealed class ZombifySystem : EntitySystem public sealed class ZombifySystem : EntityEffectSystem<MetaDataComponent, Zombify>
{ {
[Dependency] private readonly ZombieSystem _zombie = default!; [Dependency] private readonly ZombieSystem _zombie = default!;
public override void Initialize() protected override void Effect(Entity<MetaDataComponent> ent, ref EntityEffectEvent<Zombify> args)
{ {
base.Initialize(); _zombie.ZombifyEntity(ent);
SubscribeLocalEvent<ExecuteEntityEffectEvent<Zombify>>(OnExecuteZombify);
}
private void OnExecuteZombify(ref ExecuteEntityEffectEvent<Zombify> args)
{
_zombie.ZombifyEntity(args.Args.TargetEntity);
} }
} }

View File

@@ -1,9 +1,9 @@
using Content.Server.Chat.Systems;
using Content.Server.EUI; using Content.Server.EUI;
using Content.Shared._Offbrand.MMI; using Content.Shared._Offbrand.MMI;
using Content.Shared._Offbrand.Wounds; using Content.Shared._Offbrand.Wounds;
using Content.Shared.Body.Components; using Content.Shared.Body.Components;
using Content.Shared.Body.Systems; using Content.Shared.Body.Systems;
using Content.Shared.Chat;
using Content.Shared.Containers.ItemSlots; using Content.Shared.Containers.ItemSlots;
using Content.Shared.DoAfter; using Content.Shared.DoAfter;
using Content.Shared.Interaction; using Content.Shared.Interaction;
@@ -17,12 +17,12 @@ namespace Content.Server._Offbrand.MMI;
public sealed class MMIExtractorSystem : EntitySystem public sealed class MMIExtractorSystem : EntitySystem
{ {
[Dependency] private readonly BrainDamageSystem _brainDamage = default!; [Dependency] private readonly BrainDamageSystem _brainDamage = default!;
[Dependency] private readonly ChatSystem _chat = default!;
[Dependency] private readonly EntityWhitelistSystem _whitelist = default!; [Dependency] private readonly EntityWhitelistSystem _whitelist = default!;
[Dependency] private readonly EuiManager _eui = default!; [Dependency] private readonly EuiManager _eui = default!;
[Dependency] private readonly ISharedPlayerManager _player = default!; [Dependency] private readonly ISharedPlayerManager _player = default!;
[Dependency] private readonly ItemSlotsSystem _slots = default!; [Dependency] private readonly ItemSlotsSystem _slots = default!;
[Dependency] private readonly SharedBodySystem _body = default!; [Dependency] private readonly SharedBodySystem _body = default!;
[Dependency] private readonly SharedChatSystem _chat = default!;
[Dependency] private readonly SharedDoAfterSystem _doAfter = default!; [Dependency] private readonly SharedDoAfterSystem _doAfter = default!;
[Dependency] private readonly SharedMindSystem _mind = default!; [Dependency] private readonly SharedMindSystem _mind = default!;

View File

@@ -298,25 +298,11 @@ namespace Content.Shared.Chemistry.Reagent
public sealed partial class ReagentStatusEffectEntry public sealed partial class ReagentStatusEffectEntry
{ {
[DataField] [DataField]
public EntityEffectCondition[]? Conditions; public Content.Shared.EntityConditions.EntityCondition[]? Conditions;
[DataField] [DataField]
public EntProtoId StatusEffect; public EntProtoId StatusEffect;
public bool ShouldApplyStatusEffect(EntityEffectBaseArgs args)
{
if (Conditions != null)
{
foreach (var cond in Conditions)
{
if (!cond.Condition(args))
return false;
}
}
return true;
}
public string? Describe(IPrototypeManager prototype, IEntitySystemManager entSys) public string? Describe(IPrototypeManager prototype, IEntitySystemManager entSys)
{ {
if (!prototype.Resolve(StatusEffect, out var effectProtoData)) if (!prototype.Resolve(StatusEffect, out var effectProtoData))
@@ -325,7 +311,7 @@ namespace Content.Shared.Chemistry.Reagent
return Loc.GetString("reagent-guidebook-status-effect", ("effect", effectProtoData.Name ?? string.Empty), return Loc.GetString("reagent-guidebook-status-effect", ("effect", effectProtoData.Name ?? string.Empty),
("conditionCount", Conditions?.Length ?? 0), ("conditionCount", Conditions?.Length ?? 0),
("conditions", ("conditions",
Content.Shared.Localizations.ContentLocalizationManager.FormatList(Conditions?.Select(x => x.GuidebookExplanation(prototype)).ToList() ?? Content.Shared.Localizations.ContentLocalizationManager.FormatList(Conditions?.Select(x => x.EntityConditionGuidebookText(prototype)).ToList() ??
new List<string>()))); new List<string>())));
} }
} }

View File

@@ -41,12 +41,13 @@ public sealed partial class DamageableSystem
bool ignoreResistances = false, bool ignoreResistances = false,
bool interruptsDoAfters = true, bool interruptsDoAfters = true,
EntityUid? origin = null, EntityUid? origin = null,
bool ignoreGlobalModifiers = false bool ignoreGlobalModifiers = false,
bool forceRefresh = false // Offbrand
) )
{ {
//! Empty just checks if the DamageSpecifier is _literally_ empty, as in, is internal dictionary of damage types is empty. //! Empty just checks if the DamageSpecifier is _literally_ empty, as in, is internal dictionary of damage types is empty.
// If you deal 0.0 of some damage type, Empty will be false! // If you deal 0.0 of some damage type, Empty will be false!
return !TryChangeDamage(ent, damage, out _, ignoreResistances, interruptsDoAfters, origin, ignoreGlobalModifiers); return !TryChangeDamage(ent, damage, out _, ignoreResistances, interruptsDoAfters, origin, ignoreGlobalModifiers, forceRefresh); // Offbrand
} }
/// <summary> /// <summary>
@@ -67,12 +68,13 @@ public sealed partial class DamageableSystem
bool ignoreResistances = false, bool ignoreResistances = false,
bool interruptsDoAfters = true, bool interruptsDoAfters = true,
EntityUid? origin = null, EntityUid? origin = null,
bool ignoreGlobalModifiers = false bool ignoreGlobalModifiers = false,
bool forceRefresh = false // Offbrand
) )
{ {
//! Empty just checks if the DamageSpecifier is _literally_ empty, as in, is internal dictionary of damage types is empty. //! Empty just checks if the DamageSpecifier is _literally_ empty, as in, is internal dictionary of damage types is empty.
// If you deal 0.0 of some damage type, Empty will be false! // If you deal 0.0 of some damage type, Empty will be false!
newDamage = ChangeDamage(ent, damage, ignoreResistances, interruptsDoAfters, origin, ignoreGlobalModifiers); newDamage = ChangeDamage(ent, damage, ignoreResistances, interruptsDoAfters, origin, ignoreGlobalModifiers, forceRefresh); // Offbrand
return !damage.Empty; return !damage.Empty;
} }
@@ -93,7 +95,8 @@ public sealed partial class DamageableSystem
bool ignoreResistances = false, bool ignoreResistances = false,
bool interruptsDoAfters = true, bool interruptsDoAfters = true,
EntityUid? origin = null, EntityUid? origin = null,
bool ignoreGlobalModifiers = false bool ignoreGlobalModifiers = false,
bool forceRefresh = false // Offbrand
) )
{ {
var damageDone = new DamageSpecifier(); var damageDone = new DamageSpecifier();
@@ -101,7 +104,7 @@ public sealed partial class DamageableSystem
if (!_damageableQuery.Resolve(ent, ref ent.Comp, false)) if (!_damageableQuery.Resolve(ent, ref ent.Comp, false))
return damageDone; return damageDone;
if (damage.Empty) if (damage.Empty && !forceRefresh)
return damageDone; return damageDone;
var before = new BeforeDamageChangedEvent(damage, origin); var before = new BeforeDamageChangedEvent(damage, origin);
@@ -125,13 +128,18 @@ public sealed partial class DamageableSystem
RaiseLocalEvent(ent, ev); RaiseLocalEvent(ent, ev);
damage = ev.Damage; damage = ev.Damage;
if (damage.Empty) if (damage.Empty && !forceRefresh) // Offbrand
return damageDone; return damageDone;
} }
if (!ignoreGlobalModifiers) if (!ignoreGlobalModifiers)
damage = ApplyUniversalAllModifiers(damage); damage = ApplyUniversalAllModifiers(damage);
// Begin Offbrand
var beforeCommit = new Content.Shared._Offbrand.Wounds.BeforeDamageCommitEvent(damage, forceRefresh);
RaiseLocalEvent(ent.Owner, ref beforeCommit);
damage = beforeCommit.Damage;
// End Offbrand
damageDone.DamageDict.EnsureCapacity(damage.DamageDict.Count); damageDone.DamageDict.EnsureCapacity(damage.DamageDict.Count);
@@ -151,7 +159,7 @@ public sealed partial class DamageableSystem
} }
if (!damageDone.Empty) if (!damageDone.Empty)
OnEntityDamageChanged((ent, ent.Comp), damageDone, interruptsDoAfters, origin); OnEntityDamageChanged((ent, ent.Comp), damageDone, interruptsDoAfters, origin, forceRefresh); // Offbrand
return damageDone; return damageDone;
} }

View File

@@ -261,16 +261,23 @@ public sealed class DamageChangedEvent : EntityEventArgs
/// </summary> /// </summary>
public readonly EntityUid? Origin; public readonly EntityUid? Origin;
/// <summary>
/// Offbrand - If this damage changed happened as part of a forced refresh
/// </summary>
public readonly bool ForcedRefresh;
public DamageChangedEvent( public DamageChangedEvent(
DamageableComponent damageable, DamageableComponent damageable,
DamageSpecifier? damageDelta, DamageSpecifier? damageDelta,
bool interruptsDoAfters, bool interruptsDoAfters,
EntityUid? origin EntityUid? origin,
bool forcedRefresh // Offbrand
) )
{ {
Damageable = damageable; Damageable = damageable;
DamageDelta = damageDelta; DamageDelta = damageDelta;
Origin = origin; Origin = origin;
ForcedRefresh = forcedRefresh; // Offbrand
if (DamageDelta is null) if (DamageDelta is null)
return; return;

View File

@@ -47,7 +47,8 @@ public sealed partial class DamageableSystem : EntitySystem
Entity<DamageableComponent> ent, Entity<DamageableComponent> ent,
DamageSpecifier? damageDelta = null, DamageSpecifier? damageDelta = null,
bool interruptsDoAfters = true, bool interruptsDoAfters = true,
EntityUid? origin = null EntityUid? origin = null,
bool forceRefresh = false // Offbrand
) )
{ {
ent.Comp.Damage.GetDamagePerGroup(_prototypeManager, ent.Comp.DamagePerGroup); ent.Comp.Damage.GetDamagePerGroup(_prototypeManager, ent.Comp.DamagePerGroup);
@@ -66,7 +67,7 @@ public sealed partial class DamageableSystem : EntitySystem
// TODO DAMAGE // TODO DAMAGE
// byref struct event. // byref struct event.
RaiseLocalEvent(ent, new DamageChangedEvent(ent.Comp, damageDelta, interruptsDoAfters, origin)); RaiseLocalEvent(ent, new DamageChangedEvent(ent.Comp, damageDelta, interruptsDoAfters, origin, forceRefresh)); // Offbrand
} }
private void DamageableGetState(Entity<DamageableComponent> ent, ref ComponentGetState args) private void DamageableGetState(Entity<DamageableComponent> ent, ref ComponentGetState args)

View File

@@ -44,7 +44,7 @@ public sealed partial class StatusEffectsSystem
SubscribeLocalEvent<StatusEffectContainerComponent, Content.Shared._Offbrand.Weapons.RelayedGetMeleeDamageEvent>(RefRelayStatusEffectEvent); // Offbrand SubscribeLocalEvent<StatusEffectContainerComponent, Content.Shared._Offbrand.Weapons.RelayedGetMeleeDamageEvent>(RefRelayStatusEffectEvent); // Offbrand
SubscribeLocalEvent<StatusEffectContainerComponent, Content.Shared._Offbrand.Weapons.RelayedGetMeleeAttackRateEvent>(RefRelayStatusEffectEvent); // Offbrand SubscribeLocalEvent<StatusEffectContainerComponent, Content.Shared._Offbrand.Weapons.RelayedGetMeleeAttackRateEvent>(RefRelayStatusEffectEvent); // Offbrand
SubscribeLocalEvent<StatusEffectContainerComponent, Content.Shared._Offbrand.Weapons.RelayedGunRefreshModifiersEvent>(RefRelayStatusEffectEvent); // Offbrand SubscribeLocalEvent<StatusEffectContainerComponent, Content.Shared._Offbrand.Weapons.RelayedGunRefreshModifiersEvent>(RefRelayStatusEffectEvent); // Offbrand
SubscribeLocalEvent<StatusEffectContainerComponent, Content.Shared.Damage.ModifySlowOnDamageSpeedEvent>(RefRelayStatusEffectEvent); // Offbrand SubscribeLocalEvent<StatusEffectContainerComponent, Content.Shared.Damage.Systems.ModifySlowOnDamageSpeedEvent>(RefRelayStatusEffectEvent); // Offbrand
SubscribeLocalEvent<StatusEffectContainerComponent, Content.Shared.Eye.Blinding.Systems.GetBlurEvent>(RelayStatusEffectEvent); // Offbrand SubscribeLocalEvent<StatusEffectContainerComponent, Content.Shared.Eye.Blinding.Systems.GetBlurEvent>(RelayStatusEffectEvent); // Offbrand
SubscribeLocalEvent<StatusEffectContainerComponent, Content.Shared.Eye.Blinding.Systems.CanSeeAttemptEvent>(RelayStatusEffectEvent); // Offbrand SubscribeLocalEvent<StatusEffectContainerComponent, Content.Shared.Eye.Blinding.Systems.CanSeeAttemptEvent>(RelayStatusEffectEvent); // Offbrand
SubscribeLocalEvent<StatusEffectContainerComponent, Content.Shared.IdentityManagement.Components.SeeIdentityAttemptEvent>(RelayStatusEffectEvent); // Offbrand SubscribeLocalEvent<StatusEffectContainerComponent, Content.Shared.IdentityManagement.Components.SeeIdentityAttemptEvent>(RelayStatusEffectEvent); // Offbrand
@@ -52,7 +52,7 @@ public sealed partial class StatusEffectsSystem
SubscribeLocalEvent<StatusEffectContainerComponent, Content.Shared.Movement.Pulling.Events.PullStoppedMessage>(RelayStatusEffectEvent); // Offbrand SubscribeLocalEvent<StatusEffectContainerComponent, Content.Shared.Movement.Pulling.Events.PullStoppedMessage>(RelayStatusEffectEvent); // Offbrand
SubscribeLocalEvent<StatusEffectContainerComponent, Content.Shared.Weapons.Ranged.Events.SelfBeforeGunShotEvent>(RelayStatusEffectEvent); // Offbrand SubscribeLocalEvent<StatusEffectContainerComponent, Content.Shared.Weapons.Ranged.Events.SelfBeforeGunShotEvent>(RelayStatusEffectEvent); // Offbrand
SubscribeLocalEvent<StatusEffectContainerComponent, Content.Shared.Chemistry.Hypospray.Events.SelfBeforeHyposprayInjectsEvent>(RelayStatusEffectEvent); // Offbrand SubscribeLocalEvent<StatusEffectContainerComponent, Content.Shared.Chemistry.Hypospray.Events.SelfBeforeHyposprayInjectsEvent>(RelayStatusEffectEvent); // Offbrand
SubscribeLocalEvent<StatusEffectContainerComponent, Content.Shared.Damage.DamageChangedEvent>(RelayStatusEffectEvent); // Offbrand SubscribeLocalEvent<StatusEffectContainerComponent, Content.Shared.Damage.Systems.DamageChangedEvent>(RelayStatusEffectEvent); // Offbrand
SubscribeLocalEvent<StatusEffectContainerComponent, Content.Shared.Examine.ExaminedEvent>(RelayStatusEffectEvent); // Offbrand SubscribeLocalEvent<StatusEffectContainerComponent, Content.Shared.Examine.ExaminedEvent>(RelayStatusEffectEvent); // Offbrand
SubscribeLocalEvent<StatusEffectContainerComponent, Content.Shared.Verbs.GetVerbsEvent<Content.Shared.Verbs.AlternativeVerb>>(RelayStatusEffectEvent); // Offbrand SubscribeLocalEvent<StatusEffectContainerComponent, Content.Shared.Verbs.GetVerbsEvent<Content.Shared.Verbs.AlternativeVerb>>(RelayStatusEffectEvent); // Offbrand
} }

View File

@@ -1,3 +1,5 @@
using Content.Shared.Chemistry.Components;
using Content.Shared.Chemistry.EntitySystems;
using Content.Shared.Chemistry.Reagent; using Content.Shared.Chemistry.Reagent;
using Content.Shared.EntityEffects; using Content.Shared.EntityEffects;
using Content.Shared.FixedPoint; using Content.Shared.FixedPoint;
@@ -8,7 +10,7 @@ using Robust.Shared.Timing;
namespace Content.Shared._Offbrand.EntityEffects; namespace Content.Shared._Offbrand.EntityEffects;
public sealed partial class AdjustReagentGaussian : EntityEffect public sealed partial class AdjustReagentGaussian : EntityEffectBase<AdjustReagentGaussian>
{ {
[DataField(required: true)] [DataField(required: true)]
public ProtoId<ReagentPrototype> Reagent; public ProtoId<ReagentPrototype> Reagent;
@@ -19,32 +21,10 @@ public sealed partial class AdjustReagentGaussian : EntityEffect
[DataField(required: true)] [DataField(required: true)]
public double σ; public double σ;
public override void Effect(EntityEffectBaseArgs args) public override string? EntityEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys)
{
if (args is not EntityEffectReagentArgs reagentArgs)
throw new NotImplementedException();
if (reagentArgs.Source == null)
return;
var timing = IoCManager.Resolve<IGameTiming>();
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); var proto = prototype.Index(Reagent);
return Loc.GetString("reagent-effect-guidebook-adjust-reagent-gaussian", return Loc.GetString("entity-effect-guidebook-adjust-reagent-gaussian",
("chance", Probability), ("chance", Probability),
("deltasign", Math.Sign(μ)), ("deltasign", Math.Sign(μ)),
("reagent", proto.LocalizedName), ("reagent", proto.LocalizedName),
@@ -52,3 +32,25 @@ public sealed partial class AdjustReagentGaussian : EntityEffect
("sigma", Math.Abs(σ))); ("sigma", Math.Abs(σ)));
} }
} }
public sealed class AdjustReagentGaussianEntityEffectSystem : EntityEffectSystem<SolutionComponent, AdjustReagentGaussian>
{
[Dependency] private readonly IGameTiming _timing = default!;
[Dependency] private readonly IRobustRandom _random = default!;
[Dependency] private readonly SharedSolutionContainerSystem _solutionContainer = default!;
protected override void Effect(Entity<SolutionComponent> ent, ref EntityEffectEvent<AdjustReagentGaussian> args)
{
var seed = SharedRandomExtensions.HashCodeCombine((int)_timing.CurTick.Value, GetNetEntity(ent).Id);
var rand = new System.Random(seed);
var amount = rand.NextGaussian(args.Effect.μ, args.Effect.σ);
amount *= args.Scale;
var reagent = args.Effect.Reagent;
if (amount < 0)
_solutionContainer.RemoveReagent(ent, reagent, -amount);
else if (amount > 0)
_solutionContainer.TryAddReagent(ent, reagent, amount);
}
}

View File

@@ -1,11 +1,19 @@
using Content.Shared._Offbrand.Wounds; using Content.Shared._Offbrand.Wounds;
using Content.Shared.EntityEffects; using Content.Shared.EntityConditions;
using Content.Shared.FixedPoint; using Content.Shared.FixedPoint;
using Robust.Shared.Prototypes; using Robust.Shared.Prototypes;
namespace Content.Shared._Offbrand.EntityEffects; namespace Content.Shared._Offbrand.EntityEffects;
public sealed partial class BrainDamage : EntityEffectCondition public sealed class BrainDamageEntityConditionSystem : EntityConditionSystem<BrainDamageComponent, BrainDamageCondition>
{
protected override void Condition(Entity<BrainDamageComponent> ent, ref EntityConditionEvent<BrainDamageCondition> args)
{
args.Result = ent.Comp.Damage >= args.Condition.Min && ent.Comp.Damage <= args.Condition.Max;
}
}
public sealed partial class BrainDamageCondition : EntityConditionBase<BrainDamageCondition>
{ {
[DataField] [DataField]
public FixedPoint2 Max = FixedPoint2.MaxValue; public FixedPoint2 Max = FixedPoint2.MaxValue;
@@ -13,19 +21,9 @@ public sealed partial class BrainDamage : EntityEffectCondition
[DataField] [DataField]
public FixedPoint2 Min = FixedPoint2.Zero; public FixedPoint2 Min = FixedPoint2.Zero;
public override bool Condition(EntityEffectBaseArgs args) public override string EntityConditionGuidebookText(IPrototypeManager prototype)
{ {
if (args.EntityManager.TryGetComponent<BrainDamageComponent>(args.TargetEntity, out var brain)) return Loc.GetString("entity-condition-guidebook-brain-damage",
{
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()), ("max", Max == FixedPoint2.MaxValue ? (float) int.MaxValue : Max.Float()),
("min", Min.Float())); ("min", Min.Float()));
} }

View File

@@ -5,19 +5,23 @@ using Robust.Shared.Prototypes;
namespace Content.Shared._Offbrand.EntityEffects; namespace Content.Shared._Offbrand.EntityEffects;
public sealed partial class ClampWounds : EntityEffect public sealed partial class ClampWounds : EntityEffectBase<ClampWounds>
{ {
[DataField(required: true)] [DataField(required: true)]
public float Chance; public float Chance;
protected override string ReagentEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys) public override string? EntityEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys)
{ {
return Loc.GetString("reagent-effect-guidebook-clamp-wounds", ("probability", Probability), ("chance", Chance)); return Loc.GetString("entity-effect-guidebook-clamp-wounds", ("probability", Probability), ("chance", Chance));
}
} }
public override void Effect(EntityEffectBaseArgs args) public sealed class ClampWoundsEntityEffectSystem : EntityEffectSystem<WoundableComponent, ClampWounds>
{ {
args.EntityManager.System<WoundableSystem>() [Dependency] private readonly WoundableSystem _woundable = default!;
.ClampWounds(args.TargetEntity, Chance);
protected override void Effect(Entity<WoundableComponent> ent, ref EntityEffectEvent<ClampWounds> args)
{
_woundable.ClampWounds(ent, args.Effect.Chance);
} }
} }

View File

@@ -1,11 +1,11 @@
using Content.Shared._Offbrand.Wounds; using Content.Shared._Offbrand.Wounds;
using Content.Shared.EntityEffects; using Content.Shared.EntityConditions;
using Content.Shared.FixedPoint; using Content.Shared.FixedPoint;
using Robust.Shared.Prototypes; using Robust.Shared.Prototypes;
namespace Content.Shared._Offbrand.EntityEffects; namespace Content.Shared._Offbrand.EntityEffects;
public sealed partial class HeartDamage : EntityEffectCondition public sealed partial class HeartDamageCondition : EntityConditionBase<HeartDamageCondition>
{ {
[DataField] [DataField]
public FixedPoint2 Max = FixedPoint2.MaxValue; public FixedPoint2 Max = FixedPoint2.MaxValue;
@@ -13,20 +13,18 @@ public sealed partial class HeartDamage : EntityEffectCondition
[DataField] [DataField]
public FixedPoint2 Min = FixedPoint2.Zero; public FixedPoint2 Min = FixedPoint2.Zero;
public override bool Condition(EntityEffectBaseArgs args) public override string EntityConditionGuidebookText(IPrototypeManager prototype)
{
if (args.EntityManager.TryGetComponent<HeartrateComponent>(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", return Loc.GetString("reagent-effect-condition-guidebook-heart-damage",
("max", Max == FixedPoint2.MaxValue ? (float) int.MaxValue : Max.Float()), ("max", Max == FixedPoint2.MaxValue ? (float) int.MaxValue : Max.Float()),
("min", Min.Float())); ("min", Min.Float()));
} }
} }
public sealed class HeartDamageEntityConditionSystem : EntityConditionSystem<HeartrateComponent, HeartDamageCondition>
{
protected override void Condition(Entity<HeartrateComponent> ent, ref EntityConditionEvent<HeartDamageCondition> args)
{
args.Result = ent.Comp.Damage >= args.Condition.Min && ent.Comp.Damage <= args.Condition.Max;
}
}

View File

@@ -1,21 +1,21 @@
using Content.Shared.EntityEffects; using Content.Shared.EntityConditions;
using Content.Shared.Zombies; using Content.Shared.Zombies;
using Robust.Shared.Prototypes; using Robust.Shared.Prototypes;
namespace Content.Shared._Offbrand.EntityEffects; namespace Content.Shared._Offbrand.EntityEffects;
public sealed partial class IsZombie : EntityEffectCondition public sealed partial class IsZombieCondition : EntityConditionBase<IsZombieCondition>
{ {
[DataField] public override string EntityConditionGuidebookText(IPrototypeManager prototype)
public bool Invert = false;
public override bool Condition(EntityEffectBaseArgs args)
{ {
return args.EntityManager.HasComponent<ZombieComponent>(args.TargetEntity) ^ Invert; return Loc.GetString("entity-condition-guidebook-is-zombie", ("invert", Inverted));
}
} }
public override string GuidebookExplanation(IPrototypeManager prototype) public sealed class IsZombieConditionEntitySystem : EntityConditionSystem<MetaDataComponent, IsZombieCondition>
{ {
return Loc.GetString("reagent-effect-condition-guidebook-is-zombie", ("invert", Invert)); protected override void Condition(Entity<MetaDataComponent> ent, ref EntityConditionEvent<IsZombieCondition> args)
{
args.Result = HasComp<ZombieComponent>(ent);
} }
} }

View File

@@ -1,21 +1,21 @@
using Content.Shared.EntityEffects; using Content.Shared.EntityConditions;
using Content.Shared.Zombies; using Content.Shared.Zombies;
using Robust.Shared.Prototypes; using Robust.Shared.Prototypes;
namespace Content.Shared._Offbrand.EntityEffects; namespace Content.Shared._Offbrand.EntityEffects;
public sealed partial class IsZombieImmune : EntityEffectCondition public sealed partial class IsZombieImmuneCondition : EntityConditionBase<IsZombieImmuneCondition>
{ {
[DataField] public override string EntityConditionGuidebookText(IPrototypeManager prototype)
public bool Invert = false;
public override bool Condition(EntityEffectBaseArgs args)
{ {
return args.EntityManager.HasComponent<ZombieImmuneComponent>(args.TargetEntity) ^ Invert; return Loc.GetString("entity-condition-guidebook-is-zombie-immune", ("invert", Inverted));
}
} }
public override string GuidebookExplanation(IPrototypeManager prototype) public sealed class IsZombieImmuneConditionEntitySystem : EntityConditionSystem<MetaDataComponent, IsZombieImmuneCondition>
{ {
return Loc.GetString("reagent-effect-condition-guidebook-is-zombie-immune", ("invert", Invert)); protected override void Condition(Entity<MetaDataComponent> ent, ref EntityConditionEvent<IsZombieImmuneCondition> args)
{
args.Result = HasComp<ZombieImmuneComponent>(ent) ^ args.Condition.Invert;
} }
} }

View File

@@ -1,11 +1,11 @@
using Content.Shared._Offbrand.Wounds; using Content.Shared._Offbrand.Wounds;
using Content.Shared.EntityEffects; using Content.Shared.EntityConditions;
using Content.Shared.FixedPoint; using Content.Shared.FixedPoint;
using Robust.Shared.Prototypes; using Robust.Shared.Prototypes;
namespace Content.Shared._Offbrand.EntityEffects; namespace Content.Shared._Offbrand.EntityEffects;
public sealed partial class LungDamage : EntityEffectCondition public sealed partial class LungDamageCondition : EntityConditionBase<LungDamageCondition>
{ {
[DataField] [DataField]
public FixedPoint2 Max = FixedPoint2.MaxValue; public FixedPoint2 Max = FixedPoint2.MaxValue;
@@ -13,20 +13,18 @@ public sealed partial class LungDamage : EntityEffectCondition
[DataField] [DataField]
public FixedPoint2 Min = FixedPoint2.Zero; public FixedPoint2 Min = FixedPoint2.Zero;
public override bool Condition(EntityEffectBaseArgs args) public override string EntityConditionGuidebookText(IPrototypeManager prototype)
{ {
if (args.EntityManager.TryGetComponent<LungDamageComponent>(args.TargetEntity, out var lungDamage)) return Loc.GetString("entity-condition-guidebook-lung-damage",
{
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()), ("max", Max == FixedPoint2.MaxValue ? (float) int.MaxValue : Max.Float()),
("min", Min.Float())); ("min", Min.Float()));
} }
} }
public sealed class LungDamageConditionEntitySystem : EntityConditionSystem<LungDamageComponent, LungDamageCondition>
{
protected override void Condition(Entity<LungDamageComponent> ent, ref EntityConditionEvent<LungDamageCondition> args)
{
args.Result = ent.Comp.Damage >= args.Condition.Min && ent.Comp.Damage <= args.Condition.Max;
}
}

View File

@@ -1,11 +1,11 @@
using Content.Shared.Chemistry.Reagent; using Content.Shared.Chemistry.Reagent;
using Content.Shared.EntityConditions;
using Content.Shared.FixedPoint; using Content.Shared.FixedPoint;
using Robust.Shared.Prototypes; using Robust.Shared.Prototypes;
using Content.Shared.EntityEffects;
namespace Content.Shared._Offbrand.EntityEffects; namespace Content.Shared._Offbrand.EntityEffects;
public sealed partial class MetaboliteThreshold : EventEntityEffectCondition<MetaboliteThreshold> public sealed partial class MetaboliteThresholdCondition : EntityConditionBase<MetaboliteThresholdCondition>
{ {
[DataField] [DataField]
public FixedPoint2 Min = FixedPoint2.Zero; public FixedPoint2 Min = FixedPoint2.Zero;
@@ -13,29 +13,27 @@ public sealed partial class MetaboliteThreshold : EventEntityEffectCondition<Met
[DataField] [DataField]
public FixedPoint2 Max = FixedPoint2.MaxValue; public FixedPoint2 Max = FixedPoint2.MaxValue;
[DataField] [DataField(required: true)]
public ProtoId<ReagentPrototype>? Reagent; public ProtoId<ReagentPrototype> Reagent;
[DataField] [DataField]
public bool IncludeBloodstream = true; public bool IncludeBloodstream = true;
public override string GuidebookExplanation(IPrototypeManager prototype) public override string EntityConditionGuidebookText(IPrototypeManager prototype)
{ {
ReagentPrototype? reagentProto = null; var reagentProto = prototype.Index(Reagent);
if (Reagent is { } reagent)
prototype.TryIndex(reagent, out reagentProto);
if (IncludeBloodstream) if (IncludeBloodstream)
{ {
return Loc.GetString("reagent-effect-condition-guidebook-total-dosage-threshold", return Loc.GetString("entity-condition-guidebook-total-dosage-threshold",
("reagent", reagentProto?.LocalizedName ?? Loc.GetString("reagent-effect-condition-guidebook-this-reagent")), ("reagent", reagentProto.LocalizedName),
("max", Max == FixedPoint2.MaxValue ? (float) int.MaxValue : Max.Float()), ("max", Max == FixedPoint2.MaxValue ? (float) int.MaxValue : Max.Float()),
("min", Min.Float())); ("min", Min.Float()));
} }
else else
{ {
return Loc.GetString("reagent-effect-condition-guidebook-metabolite-threshold", return Loc.GetString("entity-condition-guidebook-metabolite-threshold",
("reagent", reagentProto?.LocalizedName ?? Loc.GetString("reagent-effect-condition-guidebook-this-metabolite")), ("reagent", reagentProto.LocalizedName ?? Loc.GetString("entity-condition-guidebook-this-metabolite")),
("max", Max == FixedPoint2.MaxValue ? (float) int.MaxValue : Max.Float()), ("max", Max == FixedPoint2.MaxValue ? (float) int.MaxValue : Max.Float()),
("min", Min.Float())); ("min", Min.Float()));
} }

View File

@@ -5,27 +5,26 @@ using Robust.Shared.Prototypes;
namespace Content.Shared._Offbrand.EntityEffects; namespace Content.Shared._Offbrand.EntityEffects;
public sealed partial class ModifyBrainDamage : EntityEffect public sealed partial class ModifyBrainDamage : EntityEffectBase<ModifyBrainDamage>
{ {
[DataField(required: true)] [DataField(required: true)]
public FixedPoint2 Amount; public FixedPoint2 Amount;
protected override string ReagentEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys) public override string? EntityEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys)
{ {
if (Amount < FixedPoint2.Zero) if (Amount < FixedPoint2.Zero)
return Loc.GetString("reagent-effect-guidebook-modify-brain-damage-heals", ("chance", Probability), ("amount", -Amount)); return Loc.GetString("entity-effect-guidebook-modify-brain-damage-heals", ("chance", Probability), ("amount", -Amount));
else else
return Loc.GetString("reagent-effect-guidebook-modify-brain-damage-deals", ("chance", Probability), ("amount", Amount)); return Loc.GetString("entity-effect-guidebook-modify-brain-damage-deals", ("chance", Probability), ("amount", Amount));
}
} }
public override void Effect(EntityEffectBaseArgs args) public sealed class ModifyBrainDamageEntityEffectSystem : EntityEffectSystem<BrainDamageComponent, ModifyBrainDamage>
{ {
var scale = FixedPoint2.New(1); [Dependency] private readonly BrainDamageSystem _brainDamage = default!;
if (args is EntityEffectReagentArgs reagentArgs) protected override void Effect(Entity<BrainDamageComponent> ent, ref EntityEffectEvent<ModifyBrainDamage> args)
scale = reagentArgs.Scale; {
_brainDamage.TryChangeBrainDamage(ent.AsNullable(), args.Effect.Amount * args.Scale);
args.EntityManager.System<BrainDamageSystem>()
.TryChangeBrainDamage(args.TargetEntity, Amount * scale);
} }
} }

View File

@@ -5,27 +5,26 @@ using Robust.Shared.Prototypes;
namespace Content.Shared._Offbrand.EntityEffects; namespace Content.Shared._Offbrand.EntityEffects;
public sealed partial class ModifyBrainOxygen : EntityEffect public sealed partial class ModifyBrainOxygen : EntityEffectBase<ModifyBrainOxygen>
{ {
[DataField(required: true)] [DataField(required: true)]
public FixedPoint2 Amount; public FixedPoint2 Amount;
protected override string ReagentEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys) public override string? EntityEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys)
{ {
if (Amount > FixedPoint2.Zero) if (Amount > FixedPoint2.Zero)
return Loc.GetString("reagent-effect-guidebook-modify-brain-oxygen-heals", ("chance", Probability), ("amount", Amount)); return Loc.GetString("entity-effect-guidebook-modify-brain-oxygen-heals", ("chance", Probability), ("amount", Amount));
else else
return Loc.GetString("reagent-effect-guidebook-modify-brain-oxygen-deals", ("chance", Probability), ("amount", -Amount)); return Loc.GetString("entity-effect-guidebook-modify-brain-oxygen-deals", ("chance", Probability), ("amount", -Amount));
}
} }
public override void Effect(EntityEffectBaseArgs args) public sealed class ModifyBrainOxygenEntityEffectSystem : EntityEffectSystem<BrainDamageComponent, ModifyBrainOxygen>
{ {
var scale = FixedPoint2.New(1); [Dependency] private readonly BrainDamageSystem _brainDamage = default!;
if (args is EntityEffectReagentArgs reagentArgs) protected override void Effect(Entity<BrainDamageComponent> ent, ref EntityEffectEvent<ModifyBrainOxygen> args)
scale = reagentArgs.Scale; {
_brainDamage.TryChangeBrainOxygenation(ent, args.Effect.Amount * args.Scale);
args.EntityManager.System<BrainDamageSystem>()
.TryChangeBrainOxygenation(args.TargetEntity, Amount * scale);
} }
} }

View File

@@ -5,27 +5,26 @@ using Robust.Shared.Prototypes;
namespace Content.Shared._Offbrand.EntityEffects; namespace Content.Shared._Offbrand.EntityEffects;
public sealed partial class ModifyHeartDamage : EntityEffect public sealed partial class ModifyHeartDamage : EntityEffectBase<ModifyHeartDamage>
{ {
[DataField(required: true)] [DataField(required: true)]
public FixedPoint2 Amount; public FixedPoint2 Amount;
protected override string ReagentEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys) public override string? EntityEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys)
{ {
if (Amount < FixedPoint2.Zero) if (Amount < FixedPoint2.Zero)
return Loc.GetString("reagent-effect-guidebook-modify-heart-damage-heals", ("chance", Probability), ("amount", -Amount)); return Loc.GetString("entity-effect-guidebook-modify-heart-damage-heals", ("chance", Probability), ("amount", -Amount));
else else
return Loc.GetString("reagent-effect-guidebook-modify-heart-damage-deals", ("chance", Probability), ("amount", Amount)); return Loc.GetString("entity-effect-guidebook-modify-heart-damage-deals", ("chance", Probability), ("amount", Amount));
}
} }
public override void Effect(EntityEffectBaseArgs args) public sealed class ModifyHeartDamageEntityEffectSystem : EntityEffectSystem<HeartrateComponent, ModifyHeartDamage>
{ {
var scale = FixedPoint2.New(1); [Dependency] private readonly HeartSystem _heart = default!;
if (args is EntityEffectReagentArgs reagentArgs) protected override void Effect(Entity<HeartrateComponent> ent, ref EntityEffectEvent<ModifyHeartDamage> args)
scale = reagentArgs.Scale; {
_heart.ChangeHeartDamage(ent.AsNullable(), args.Effect.Amount * args.Scale);
args.EntityManager.System<HeartSystem>()
.ChangeHeartDamage(args.TargetEntity, Amount * scale);
} }
} }

View File

@@ -5,27 +5,26 @@ using Robust.Shared.Prototypes;
namespace Content.Shared._Offbrand.EntityEffects; namespace Content.Shared._Offbrand.EntityEffects;
public sealed partial class ModifyLungDamage : EntityEffect public sealed partial class ModifyLungDamage : EntityEffectBase<ModifyLungDamage>
{ {
[DataField(required: true)] [DataField(required: true)]
public FixedPoint2 Amount; public FixedPoint2 Amount;
protected override string ReagentEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys) public override string? EntityEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys)
{ {
if (Amount < FixedPoint2.Zero) if (Amount < FixedPoint2.Zero)
return Loc.GetString("reagent-effect-guidebook-modify-lung-damage-heals", ("chance", Probability), ("amount", -Amount)); return Loc.GetString("entity-effect-guidebook-modify-lung-damage-heals", ("chance", Probability), ("amount", -Amount));
else else
return Loc.GetString("reagent-effect-guidebook-modify-lung-damage-deals", ("chance", Probability), ("amount", Amount)); return Loc.GetString("entity-effect-guidebook-modify-lung-damage-deals", ("chance", Probability), ("amount", Amount));
}
} }
public override void Effect(EntityEffectBaseArgs args) public sealed class ModifyLungDamageEntityEffectSystem : EntityEffectSystem<LungDamageComponent, ModifyLungDamage>
{ {
var scale = FixedPoint2.New(1); [Dependency] private readonly LungDamageSystem _lungDamage = default!;
if (args is EntityEffectReagentArgs reagentArgs) protected override void Effect(Entity<LungDamageComponent> ent, ref EntityEffectEvent<ModifyLungDamage> args)
scale = reagentArgs.Scale; {
_lungDamage.TryModifyDamage(ent.AsNullable(), args.Effect.Amount * args.Scale);
args.EntityManager.System<LungDamageSystem>()
.TryModifyDamage(args.TargetEntity, Amount * scale);
} }
} }

View File

@@ -1,24 +1,29 @@
using Content.Shared.EntityEffects; using Content.Shared.EntityEffects;
using Content.Shared.StatusEffectNew.Components;
using Content.Shared.StatusEffectNew; using Content.Shared.StatusEffectNew;
using Robust.Shared.Prototypes; using Robust.Shared.Prototypes;
namespace Content.Shared._Offbrand.EntityEffects; namespace Content.Shared._Offbrand.EntityEffects;
public sealed partial class RemoveStatusEffect : EntityEffect public sealed partial class RemoveStatusEffect : EntityEffectBase<RemoveStatusEffect>
{ {
[DataField(required: true)] [DataField(required: true)]
public EntProtoId EffectProto; public EntProtoId EffectProto;
public override void Effect(EntityEffectBaseArgs args)
{
args.EntityManager.System<StatusEffectsSystem>()
.TryRemoveStatusEffect(args.TargetEntity, EffectProto);
}
/// <inheritdoc /> /// <inheritdoc />
protected override string? ReagentEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys) => public override string? EntityEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys) =>
Loc.GetString( Loc.GetString(
"reagent-effect-guidebook-status-effect-remove", "entity-effect-guidebook-status-effect-remove",
("chance", Probability), ("chance", Probability),
("key", prototype.Index(EffectProto).Name)); ("key", prototype.Index(EffectProto).Name));
} }
public sealed class RemoveStatusEffectEntityEffectSystem : EntityEffectSystem<StatusEffectContainerComponent, RemoveStatusEffect>
{
[Dependency] private readonly StatusEffectsSystem _statusEffects = default!;
protected override void Effect(Entity<StatusEffectContainerComponent> ent, ref EntityEffectEvent<RemoveStatusEffect> args)
{
_statusEffects.TryRemoveStatusEffect(ent, args.Effect.EffectProto);
}
}

View File

@@ -4,16 +4,20 @@ using Robust.Shared.Prototypes;
namespace Content.Shared._Offbrand.EntityEffects; namespace Content.Shared._Offbrand.EntityEffects;
public sealed partial class StartHeart : EntityEffect public sealed partial class StartHeart : EntityEffectBase<StartHeart>
{ {
protected override string ReagentEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys) public override string? EntityEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys)
{ {
return Loc.GetString("reagent-effect-guidebook-start-heart", ("chance", Probability)); return Loc.GetString("entity-effect-guidebook-start-heart", ("chance", Probability));
}
} }
public override void Effect(EntityEffectBaseArgs args) public sealed class StartHeartEntityEffectSystem : EntityEffectSystem<HeartrateComponent, StartHeart>
{ {
args.EntityManager.System<HeartSystem>() [Dependency] private readonly HeartSystem _heart = default!;
.TryRestartHeart(args.TargetEntity);
protected override void Effect(Entity<HeartrateComponent> ent, ref EntityEffectEvent<StartHeart> args)
{
_heart.TryRestartHeart(ent.AsNullable());
} }
} }

View File

@@ -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<DamageGroupPrototype> Group;
[DataField]
public FixedPoint2 Max = FixedPoint2.MaxValue;
[DataField]
public FixedPoint2 Min = FixedPoint2.Zero;
public override bool Condition(EntityEffectBaseArgs args)
{
var prototype = IoCManager.Resolve<IPrototypeManager>();
var group = prototype.Index(Group);
if (!args.EntityManager.TryGetComponent<DamageableComponent>(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));
}
}

View File

@@ -3,8 +3,8 @@ using Robust.Shared.Prototypes;
namespace Content.Shared._Offbrand.EntityEffects; namespace Content.Shared._Offbrand.EntityEffects;
public sealed partial class Zombify : EventEntityEffect<Zombify> public sealed partial class Zombify : EntityEffectBase<Zombify>
{ {
protected override string? ReagentEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys) public override string? EntityEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys)
=> Loc.GetString("reagent-effect-guidebook-zombify", ("chance", Probability)); => Loc.GetString("entity-effect-guidebook-zombify", ("chance", Probability));
} }

View File

@@ -27,7 +27,7 @@ public sealed class CauseStatusEffectRandomlyStatusEffectSystem : EntitySystem
randomEffects.NextUpdate = _timing.CurTime + randomEffects.UpdateInterval; randomEffects.NextUpdate = _timing.CurTime + randomEffects.UpdateInterval;
Dirty(uid, randomEffects); 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); var rand = new System.Random(seed);
if (!rand.Prob(randomEffects.Probability)) if (!rand.Prob(randomEffects.Probability))

View File

@@ -1,3 +1,4 @@
using Content.Shared.Damage.Systems;
using Content.Shared.Damage; using Content.Shared.Damage;
using Content.Shared.StatusEffectNew.Components; using Content.Shared.StatusEffectNew.Components;
using Robust.Shared.Prototypes; using Robust.Shared.Prototypes;

View File

@@ -1,5 +1,5 @@
using Content.Shared.CombatMode; using Content.Shared.CombatMode;
using Content.Shared.Damage; using Content.Shared.Damage.Systems;
using Content.Shared.Mobs.Components; using Content.Shared.Mobs.Components;
using Content.Shared.StatusEffectNew.Components; using Content.Shared.StatusEffectNew.Components;
using Content.Shared.StatusEffectNew; using Content.Shared.StatusEffectNew;

View File

@@ -38,7 +38,7 @@ public sealed class GunBackfireStatusEffectSystem : EntitySystem
if (args.Args.Cancelled) if (args.Args.Cancelled)
return; 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); var rand = new System.Random(seed);
if (!rand.Prob(ent.Comp.Probability)) if (!rand.Prob(ent.Comp.Probability))
return; return;

View File

@@ -32,7 +32,7 @@ public sealed class HyposprayBackfireStatusEffectSystem : EntitySystem
if (args.Args.TargetGettingInjected == args.Args.EntityUsingHypospray) if (args.Args.TargetGettingInjected == args.Args.EntityUsingHypospray)
return; 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 rand = new System.Random(seed);
if (!rand.Prob(ent.Comp.Probability)) if (!rand.Prob(ent.Comp.Probability))
return; return;

View File

@@ -1,4 +1,4 @@
using Content.Shared.Damage; using Content.Shared.Damage.Systems;
using Content.Shared.Movement.Systems; using Content.Shared.Movement.Systems;
using Content.Shared.StatusEffectNew; using Content.Shared.StatusEffectNew;

View File

@@ -88,9 +88,9 @@ public sealed class TriggerOnDoAfterSystem : EntitySystem
{ {
if (TryComp<StackComponent>(used, out var stackComp)) if (TryComp<StackComponent>(used, out var stackComp))
{ {
_stack.Use(used, 1, stackComp); _stack.ReduceCount((used, stackComp), 1);
if (_stack.GetCount(used, stackComp) <= 0) if (_stack.GetCount((used, stackComp)) <= 0)
hasMoreItems = false; hasMoreItems = false;
} }
else else

View File

@@ -1,3 +1,5 @@
using Content.Shared.Damage.Components;
using Content.Shared.Damage.Systems;
using Content.Shared.Damage; using Content.Shared.Damage;
using Content.Shared.FixedPoint; using Content.Shared.FixedPoint;

View File

@@ -121,11 +121,9 @@ public sealed partial class BrainDamageSystem : EntitySystem
var overlays = new PotentiallyUpdateDamageOverlayEvent(ent); var overlays = new PotentiallyUpdateDamageOverlayEvent(ent);
RaiseLocalEvent(ent, ref overlays, true); RaiseLocalEvent(ent, ref overlays, true);
} }
public void TryChangeBrainOxygenation(Entity<BrainDamageComponent?> ent, FixedPoint2 amount)
{
if (!Resolve(ent, ref ent.Comp, false))
return;
public void TryChangeBrainOxygenation(Entity<BrainDamageComponent> ent, FixedPoint2 amount)
{
ent.Comp.Oxygen = FixedPoint2.Clamp(ent.Comp.Oxygen + amount, FixedPoint2.Zero, ent.Comp.MaxOxygen); ent.Comp.Oxygen = FixedPoint2.Clamp(ent.Comp.Oxygen + amount, FixedPoint2.Zero, ent.Comp.MaxOxygen);
Dirty(ent); Dirty(ent);
@@ -229,7 +227,7 @@ public sealed partial class BrainDamageSystem : EntitySystem
{ {
var oxygenation = _heart.Spo2((ent.Owner, ent.Comp3)); var oxygenation = _heart.Spo2((ent.Owner, ent.Comp3));
var seed = SharedRandomExtensions.HashCodeCombine(new() { (int)_timing.CurTick.Value, GetNetEntity(ent).Id }); var seed = SharedRandomExtensions.HashCodeCombine((int)_timing.CurTick.Value, GetNetEntity(ent).Id);
var rand = new System.Random(seed); var rand = new System.Random(seed);
DoOxygen(ent, oxygenation, rand); DoOxygen(ent, oxygenation, rand);

View File

@@ -54,7 +54,7 @@ public sealed class CprSystem : EntitySystem
{ {
_statusEffects.TryAddStatusEffectDuration(ent, ent.Comp.Effect, ent.Comp.EffectDuration); _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); var rand = new System.Random(seed);
if (rand.Prob(ent.Comp.WoundProbability) && TryComp<WoundableComponent>(ent, out var woundable)) if (rand.Prob(ent.Comp.WoundProbability) && TryComp<WoundableComponent>(ent, out var woundable))

View File

@@ -1,8 +1,8 @@
using Content.Server.Temperature.Components;
using Content.Shared._Offbrand.Wounds; using Content.Shared._Offbrand.Wounds;
using Content.Shared.Body.Events; using Content.Shared.Body.Events;
using Content.Shared.Body.Systems; using Content.Shared.Body.Systems;
using Content.Shared.Medical.Cryogenics; using Content.Shared.Medical.Cryogenics;
using Content.Shared.Temperature.Components;
using Content.Shared.Temperature; using Content.Shared.Temperature;
namespace Content.Server._Offbrand.Wounds; namespace Content.Server._Offbrand.Wounds;

View File

@@ -1,3 +1,5 @@
using Content.Shared.Damage.Components;
using Content.Shared.Damage.Systems;
using Content.Shared.Damage; using Content.Shared.Damage;
using Content.Shared.FixedPoint; using Content.Shared.FixedPoint;

View File

@@ -89,7 +89,7 @@ public sealed partial class HeartSystem : EntitySystem
var threshold = heartrate.StrainDamageThresholds.HighestMatch(Strain((uid, heartrate))); var threshold = heartrate.StrainDamageThresholds.HighestMatch(Strain((uid, heartrate)));
if (threshold is (var chance, var amount)) 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); var rand = new System.Random(seed);
if (rand.Prob(chance)) if (rand.Prob(chance))
@@ -151,7 +151,7 @@ public sealed partial class HeartSystem : EntitySystem
private void OnHeartBeatStrain(Entity<HeartStopOnHighStrainComponent> ent, ref HeartBeatEvent args) private void OnHeartBeatStrain(Entity<HeartStopOnHighStrainComponent> 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 rand = new System.Random(seed);
if (_statusEffects.HasEffectComp<PreventHeartStopFromStrainStatusEffectComponent>(ent)) if (_statusEffects.HasEffectComp<PreventHeartStopFromStrainStatusEffectComponent>(ent))
@@ -316,7 +316,7 @@ public sealed partial class HeartSystem : EntitySystem
if (!ent.Comp.Running) if (!ent.Comp.Running)
return 0; 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 rand = new System.Random(seed);
var deviation = rand.Next(-ent.Comp.HeartRateDeviation, ent.Comp.HeartRateDeviation); var deviation = rand.Next(-ent.Comp.HeartRateDeviation, ent.Comp.HeartRateDeviation);
@@ -326,7 +326,7 @@ public sealed partial class HeartSystem : EntitySystem
public (int, int) BloodPressure(Entity<HeartrateComponent> ent) public (int, int) BloodPressure(Entity<HeartrateComponent> 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 rand = new System.Random(seed);
var deviationA = rand.Next(-ent.Comp.BloodPressureDeviation, ent.Comp.BloodPressureDeviation); var deviationA = rand.Next(-ent.Comp.BloodPressureDeviation, ent.Comp.BloodPressureDeviation);
@@ -340,7 +340,7 @@ public sealed partial class HeartSystem : EntitySystem
public int Etco2(Entity<HeartrateComponent> ent) public int Etco2(Entity<HeartrateComponent> 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 rand = new System.Random(seed);
var deviation = rand.Next(-ent.Comp.Etco2Deviation, ent.Comp.Etco2Deviation); var deviation = rand.Next(-ent.Comp.Etco2Deviation, ent.Comp.Etco2Deviation);

View File

@@ -1,3 +1,4 @@
using Content.Shared.Damage.Components;
using Content.Shared.Damage; using Content.Shared.Damage;
namespace Content.Shared._Offbrand.Wounds; namespace Content.Shared._Offbrand.Wounds;

View File

@@ -1,4 +1,5 @@
using Content.Shared.Alert; using Content.Shared.Alert;
using Content.Shared.Damage.Components;
using Content.Shared.Damage; using Content.Shared.Damage;
using Content.Shared.FixedPoint; using Content.Shared.FixedPoint;
using Content.Shared.Rejuvenate; using Content.Shared.Rejuvenate;

View File

@@ -1,7 +1,7 @@
using Content.Server.Temperature.Components; using Content.Shared.Temperature.Components;
using Content.Shared._Offbrand.Wounds; using Content.Shared._Offbrand.Wounds;
namespace Content.Server._Offbrand.Wounds; namespace Content.Shared._Offbrand.Wounds;
public sealed class LungDamageTemperatureSystem : EntitySystem public sealed class LungDamageTemperatureSystem : EntitySystem
{ {

View File

@@ -1,3 +1,4 @@
using Content.Shared.Damage.Components;
using Content.Shared.Damage; using Content.Shared.Damage;
using Content.Shared.FixedPoint; using Content.Shared.FixedPoint;
using Robust.Shared.Timing; using Robust.Shared.Timing;

View File

@@ -141,9 +141,9 @@ public sealed class TendingSystem : EntitySystem
var hasMoreItems = true; var hasMoreItems = true;
if (TryComp<StackComponent>(args.Used.Value, out var stackComp)) if (TryComp<StackComponent>(args.Used.Value, out var stackComp))
{ {
_stack.Use(args.Used.Value, 1, stackComp); _stack.ReduceCount((args.Used.Value, stackComp), 1);
if (_stack.GetCount(args.Used.Value, stackComp) <= 0) if (_stack.GetCount((args.Used.Value, stackComp)) <= 0)
hasMoreItems = false; hasMoreItems = false;
} }
else else

View File

@@ -1,3 +1,5 @@
using Content.Shared.Damage.Components;
using Content.Shared.Damage.Systems;
using Content.Shared.Damage; using Content.Shared.Damage;
using Content.Shared.Random.Helpers; using Content.Shared.Random.Helpers;
using Robust.Shared.Random; using Robust.Shared.Random;
@@ -22,7 +24,7 @@ public sealed partial class UniqueWoundOnDamageSystem : EntitySystem
if (args.DamageDelta is not { } delta || !args.DamageIncreased) if (args.DamageDelta is not { } delta || !args.DamageIncreased)
return; 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 rand = new System.Random(seed);
var damageable = Comp<DamageableComponent>(ent); var damageable = Comp<DamageableComponent>(ent);

View File

@@ -1,6 +1,8 @@
using System.Linq; using System.Linq;
using Content.Shared.Body.Systems; using Content.Shared.Body.Systems;
using Content.Shared.Damage.Components;
using Content.Shared.Damage.Prototypes; using Content.Shared.Damage.Prototypes;
using Content.Shared.Damage.Systems;
using Content.Shared.Damage; using Content.Shared.Damage;
using Content.Shared.FixedPoint; using Content.Shared.FixedPoint;
using Content.Shared.HealthExaminable; using Content.Shared.HealthExaminable;
@@ -199,7 +201,7 @@ public sealed class WoundableSystem : EntitySystem
if (ent.Comp.Damage.Empty) if (ent.Comp.Damage.Empty)
return; return;
_damageable.TryChangeDamage(args.Target, -ent.Comp.Damage.ToSpecifier(), true, false, null, null, forceRefresh: true); _damageable.TryChangeDamage(args.Target, -ent.Comp.Damage.ToSpecifier(), true, false, forceRefresh: true);
ValidateWounds(args.Target, null); ValidateWounds(args.Target, null);
} }
@@ -260,7 +262,7 @@ public sealed class WoundableSystem : EntitySystem
comp.CreatedAt = _timing.CurTime; comp.CreatedAt = _timing.CurTime;
if (refreshDamage) 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); Dirty(wound.Value, comp);
return true; return true;
@@ -350,7 +352,7 @@ public sealed class WoundableSystem : EntitySystem
return bleedAddition * ratio; return bleedAddition * ratio;
} }
public void ClampWounds(Entity<WoundableComponent?> ent, float probability) public void ClampWounds(Entity<WoundableComponent> ent, float probability)
{ {
var evt = new ClampWoundsEvent(probability); var evt = new ClampWoundsEvent(probability);
RaiseLocalEvent(ent, ref evt); RaiseLocalEvent(ent, ref evt);
@@ -361,7 +363,7 @@ public sealed class WoundableSystem : EntitySystem
if (ent.Comp.Clamped) if (ent.Comp.Clamped)
return; 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 rand = new System.Random(seed);
if (!rand.Prob(args.Args.Probability)) if (!rand.Prob(args.Args.Probability))
@@ -455,8 +457,8 @@ public sealed class WoundableSystem : EntitySystem
changeBy.TrimZeros(); changeBy.TrimZeros();
if (changeBy.AnyNegative()) if (changeBy.AnyNegative())
{ {
var actualDelta = _damageable.TryChangeDamage(woundable, changeBy, true, false, null, null, forceRefresh: true); var actualDelta = _damageable.ChangeDamage(woundable.Owner, changeBy, true, false, null, forceRefresh: true);
DebugTools.Assert(actualDelta is not null); DebugTools.Assert(!actualDelta.Empty);
DebugTools.Assert(changeBy.Equals(actualDelta!), $"{changeBy} == {actualDelta!}"); DebugTools.Assert(changeBy.Equals(actualDelta!), $"{changeBy} == {actualDelta!}");
} }

View File

@@ -3,86 +3,86 @@ reagent-guidebook-status-effect = Causes { $effect } during metabolism{ $conditi
*[other] {" "}when { $conditions }. *[other] {" "}when { $conditions }.
} }
reagent-effect-guidebook-status-effect-remove = { $chance -> entity-effect-guidebook-status-effect-remove = { $chance ->
[1] Removes { LOC($key) } [1] Removes { LOC($key) }
*[other] remove { LOC($key) } *[other] remove { LOC($key) }
} }
reagent-effect-guidebook-modify-brain-damage-heals = { $chance -> entity-effect-guidebook-modify-brain-damage-heals = { $chance ->
[1] Heals { $amount } brain activity [1] Heals { $amount } brain activity
*[other] heal { $amount } brain activity *[other] heal { $amount } brain activity
} }
reagent-effect-guidebook-modify-brain-damage-deals = { $chance -> entity-effect-guidebook-modify-brain-damage-deals = { $chance ->
[1] Deals { $amount } brain damage [1] Deals { $amount } brain damage
*[other] deal { $amount } brain damage *[other] deal { $amount } brain damage
} }
reagent-effect-guidebook-modify-heart-damage-heals = { $chance -> entity-effect-guidebook-modify-heart-damage-heals = { $chance ->
[1] Heals { $amount } heart health [1] Heals { $amount } heart health
*[other] heal { $amount } heart health *[other] heal { $amount } heart health
} }
reagent-effect-guidebook-modify-heart-damage-deals = { $chance -> entity-effect-guidebook-modify-heart-damage-deals = { $chance ->
[1] Deals { $amount } heart damage [1] Deals { $amount } heart damage
*[other] deal { $amount } heart damage *[other] deal { $amount } heart damage
} }
reagent-effect-guidebook-modify-lung-damage-heals = { $chance -> entity-effect-guidebook-modify-lung-damage-heals = { $chance ->
[1] Heals { $amount } lung health [1] Heals { $amount } lung health
*[other] heal { $amount } lung health *[other] heal { $amount } lung health
} }
reagent-effect-guidebook-modify-lung-damage-deals = { $chance -> entity-effect-guidebook-modify-lung-damage-deals = { $chance ->
[1] Deals { $amount } lung damage [1] Deals { $amount } lung damage
*[other] deal { $amount } lung damage *[other] deal { $amount } lung damage
} }
reagent-effect-guidebook-clamp-wounds = { $probability -> entity-effect-guidebook-clamp-wounds = { $probability ->
[1] Stops bleeding in wounds with { NATURALPERCENT($chance, 2) } chance per wound [1] Stops bleeding in wounds with { NATURALPERCENT($chance, 2) } chance per wound
*[other] stop bleeding in wounds with { NATURALPERCENT($chance, 2) } chance per wound *[other] stop bleeding in wounds with { NATURALPERCENT($chance, 2) } chance per wound
} }
reagent-effect-condition-guidebook-heart-damage = { $max -> entity-condition-guidebook-heart-damage = { $max ->
[2147483648] it has at least {NATURALFIXED($min, 2)} heart damage [2147483648] it has at least {NATURALFIXED($min, 2)} heart damage
*[other] { $min -> *[other] { $min ->
[0] it has at most {NATURALFIXED($max, 2)} heart damage [0] it has at most {NATURALFIXED($max, 2)} heart damage
*[other] it has between {NATURALFIXED($min, 2)} and {NATURALFIXED($max, 2)} heart damage *[other] it has between {NATURALFIXED($min, 2)} and {NATURALFIXED($max, 2)} heart damage
} }
} }
reagent-effect-condition-guidebook-lung-damage = { $max -> entity-condition-guidebook-lung-damage = { $max ->
[2147483648] it has at least {NATURALFIXED($min, 2)} lung damage [2147483648] it has at least {NATURALFIXED($min, 2)} lung damage
*[other] { $min -> *[other] { $min ->
[0] it has at most {NATURALFIXED($max, 2)} lung damage [0] it has at most {NATURALFIXED($max, 2)} lung damage
*[other] it has between {NATURALFIXED($min, 2)} and {NATURALFIXED($max, 2)} lung damage *[other] it has between {NATURALFIXED($min, 2)} and {NATURALFIXED($max, 2)} lung damage
} }
} }
reagent-effect-condition-guidebook-brain-damage = { $max -> entity-condition-guidebook-brain-damage = { $max ->
[2147483648] it has at least {NATURALFIXED($min, 2)} brain damage [2147483648] it has at least {NATURALFIXED($min, 2)} brain damage
*[other] { $min -> *[other] { $min ->
[0] it has at most {NATURALFIXED($max, 2)} brain damage [0] it has at most {NATURALFIXED($max, 2)} brain damage
*[other] it has between {NATURALFIXED($min, 2)} and {NATURALFIXED($max, 2)} brain damage *[other] it has between {NATURALFIXED($min, 2)} and {NATURALFIXED($max, 2)} brain damage
} }
} }
reagent-effect-condition-guidebook-total-group-damage = { $max -> entity-condition-guidebook-total-group-damage = { $max ->
[2147483648] it has at least {NATURALFIXED($min, 2)} { $name } damage [2147483648] it has at least {NATURALFIXED($min, 2)} { $name } damage
*[other] { $min -> *[other] { $min ->
[0] it has at most {NATURALFIXED($max, 2)} { $name } damage [0] it has at most {NATURALFIXED($max, 2)} { $name } damage
*[other] it has between {NATURALFIXED($min, 2)} and {NATURALFIXED($max, 2)} { $name } damage *[other] it has between {NATURALFIXED($min, 2)} and {NATURALFIXED($max, 2)} { $name } damage
} }
} }
reagent-effect-guidebook-modify-brain-oxygen-heals = { $chance -> entity-effect-guidebook-modify-brain-oxygen-heals = { $chance ->
[1] Replenishes { $amount } brain oxygenation [1] Replenishes { $amount } brain oxygenation
*[other] replenish { $amount } brain oxygenation *[other] replenish { $amount } brain oxygenation
} }
reagent-effect-guidebook-modify-brain-oxygen-deals = { $chance -> entity-effect-guidebook-modify-brain-oxygen-deals = { $chance ->
[1] Depletes { $amount } brain oxygenation [1] Depletes { $amount } brain oxygenation
*[other] deplete { $amount } brain oxygenation *[other] deplete { $amount } brain oxygenation
} }
reagent-effect-guidebook-start-heart = { $chance -> entity-effect-guidebook-start-heart = { $chance ->
[1] Restarts the target's heart [1] Restarts the target's heart
*[other] restart the target's heart *[other] restart the target's heart
} }
reagent-effect-guidebook-zombify = { $chance -> entity-effect-guidebook-zombify = { $chance ->
[1] Zombifies the target [1] Zombifies the target
*[other] zombify the target *[other] zombify the target
} }
reagent-effect-condition-guidebook-total-dosage-threshold = entity-condition-guidebook-total-dosage-threshold =
{ $max -> { $max ->
[2147483648] the total dosage of {$reagent} is at least {NATURALFIXED($min, 2)}u [2147483648] the total dosage of {$reagent} is at least {NATURALFIXED($min, 2)}u
*[other] { $min -> *[other] { $min ->
@@ -91,7 +91,7 @@ reagent-effect-condition-guidebook-total-dosage-threshold =
} }
} }
reagent-effect-condition-guidebook-metabolite-threshold = entity-condition-guidebook-metabolite-threshold =
{ $max -> { $max ->
[2147483648] there's at least {NATURALFIXED($min, 2)}u of {$reagent} metabolites [2147483648] there's at least {NATURALFIXED($min, 2)}u of {$reagent} metabolites
*[other] { $min -> *[other] { $min ->
@@ -100,21 +100,21 @@ reagent-effect-condition-guidebook-metabolite-threshold =
} }
} }
reagent-effect-condition-guidebook-is-zombie-immune = entity-condition-guidebook-is-zombie-immune =
the target { $invert -> the target { $invert ->
[true] is not immunized against zombie infections [true] is not immunized against zombie infections
*[false] is immunized against zombie infections *[false] is immunized against zombie infections
} }
reagent-effect-condition-guidebook-is-zombie = entity-condition-guidebook-is-zombie =
the target { $invert -> the target { $invert ->
[true] is not a zombie [true] is not a zombie
*[false] is a zombie *[false] is a zombie
} }
reagent-effect-condition-guidebook-this-metabolite = this reagent's entity-condition-guidebook-this-metabolite = this reagent's
reagent-effect-guidebook-adjust-reagent-gaussian = entity-effect-guidebook-adjust-reagent-gaussian =
{ $chance -> { $chance ->
[1] { $deltasign -> [1] { $deltasign ->
[1] Typically adds [1] Typically adds

View File

@@ -215,11 +215,12 @@
type: Add type: Add
- !type:ModifyStatusEffect - !type:ModifyStatusEffect
conditions: conditions:
- !type:ReagentThreshold - !type:ReagentCondition
reagent: Ethanol
min: 15 min: 15
- !type:OrganType - !type:MetabolizerTypeCondition
type: Dwarf type: [ Dwarf ]
shouldHave: false inverted: true
effectProto: StatusEffectPainkillersMildEthanolOverdose effectProto: StatusEffectPainkillersMildEthanolOverdose
time: 2 time: 2
type: Add type: Add

View File

@@ -128,8 +128,8 @@
statusEffects: statusEffects:
- statusEffect: StatusEffectPainkillersNegligibleRobustHarvest - statusEffect: StatusEffectPainkillersNegligibleRobustHarvest
conditions: conditions:
- !type:OrganType - !type:MetabolizerTypeCondition
type: Plant type: [Plant]
effects: effects:
- !type:HealthChange - !type:HealthChange
damage: damage:
@@ -163,7 +163,7 @@
conditions: conditions:
- !type:MetabolizerTypeCondition - !type:MetabolizerTypeCondition
type: [Plant] type: [Plant]
- !type:MetaboliteThreshold # Offbrand - !type:MetaboliteThresholdCondition # Offbrand
reagent: RobustHarvest reagent: RobustHarvest
min: 80 min: 80
@@ -193,20 +193,22 @@
damage: damage:
types: types:
Poison: 2 Poison: 2
- !type:CreateEntityReactionEffect - !type:SpawnEntity
entity: MobDionaNymph entity: MobDionaNymph
conditions: conditions:
- !type:OrganType - !type:MetabolizerTypeCondition
type: Plant type: [Plant]
- !type:ReagentThreshold - !type:ReagentCondition
reagent: Sedin
min: 40 min: 40
- !type:AdjustReagent - !type:AdjustReagent
reagent: Sedin reagent: Sedin
amount: -20 amount: -20
conditions: conditions:
- !type:OrganType - !type:MetabolizerTypeCondition
type: Plant type: [Plant]
- !type:ReagentThreshold - !type:ReagentCondition
reagent: Sedin
min: 40 min: 40
# End Offbrand # End Offbrand
@@ -258,14 +260,14 @@
Caustic: 1 Caustic: 1
# Begin Offbrand # Begin Offbrand
conditions: conditions:
- !type:OrganType - !type:MetabolizerTypeCondition
type: Plant type: [Plant]
shouldHave: false inverted: true
- !type:SatiateHunger - !type:SatiateHunger
factor: 1 factor: 1
conditions: conditions:
- !type:OrganType - !type:MetabolizerTypeCondition
type: Plant type: [Plant]
# End Offbrand # End Offbrand
Gas: Gas:
effects: effects:
@@ -353,9 +355,9 @@
# Begin Offbrand # Begin Offbrand
Caustic: 0.5 Caustic: 0.5
conditions: conditions:
- !type:OrganType - !type:MetabolizerTypeCondition
type: Plant type: [ Plant ]
shouldHave: false inverted: true
- !type:HealthChange - !type:HealthChange
damage: damage:
types: types:
@@ -363,6 +365,6 @@
Cold: -0.5 Cold: -0.5
Shock: -0.5 Shock: -0.5
conditions: conditions:
- !type:OrganType - !type:MetabolizerTypeCondition
type: Plant type: [ Plant ]
# End Offbrand # End Offbrand

View File

@@ -333,12 +333,12 @@
type: Update type: Update
- !type:ModifyStatusEffect # Offbrand - !type:ModifyStatusEffect # Offbrand
conditions: conditions:
- !type:ReagentThreshold - !type:ReagentCondition
reagent: NitrousOxide reagent: NitrousOxide
min: 1.8 min: 1.8
- !type:OrganType - !type:MetabolizerTypeCondition
type: Slime type: [ Slime ]
shouldHave: false inverted: false
effectProto: StatusEffectPainSuppressionNitrousOxide effectProto: StatusEffectPainSuppressionNitrousOxide
time: 3 time: 3
type: Add type: Add

View File

@@ -1379,7 +1379,7 @@
- !type:ModifyBrainOxygen - !type:ModifyBrainOxygen
amount: 0.5 amount: 0.5
conditions: conditions:
- !type:Temperature - !type:TemperatureCondition
max: 150.0 max: 150.0
# End Offbrand Additions # End Offbrand Additions
# Begin Offbrand Removals # Begin Offbrand Removals
@@ -1415,7 +1415,7 @@
- !type:ReduceRotting - !type:ReduceRotting
seconds: 20 seconds: 20
conditions: conditions:
- !type:Temperature - !type:TemperatureCondition
max: 213.0 max: 213.0
# End Offbrand - Derotting moved to necrosol # End Offbrand - Derotting moved to necrosol
- !type:HealthChange - !type:HealthChange
@@ -1478,16 +1478,19 @@
emote: Scream emote: Scream
probability: 0.2 probability: 0.2
conditions: conditions:
- !type:ReagentThreshold - !type:ReagentCondition
reagent: Mannitol
min: 10.5 min: 10.5
- !type:ChemVomit - !type:Vomit
conditions: conditions:
- !type:ReagentThreshold - !type:ReagentCondition
reagent: Mannitol
min: 15 min: 15
probability: 0.1 probability: 0.1
- !type:HealthChange - !type:HealthChange
conditions: conditions:
- !type:ReagentThreshold - !type:ReagentCondition
reagent: Mannitol
min: 10.5 min: 10.5
damage: damage:
types: types:

View File

@@ -480,21 +480,22 @@
statusEffects: statusEffects:
- statusEffect: StatusEffectHeartStrainRomerol - statusEffect: StatusEffectHeartStrainRomerol
conditions: conditions:
- !type:MetaboliteThreshold - !type:MetaboliteThresholdCondition
reagent: Romerol
min: 15 min: 15
effects: effects:
- !type:AdjustReagent - !type:AdjustReagent
reagent: Romerol reagent: Romerol
amount: -10 amount: -10
conditions: conditions:
- !type:IsZombie - !type:IsZombieCondition
- !type:AdjustReagentGaussian - !type:AdjustReagentGaussian
reagent: Romerol reagent: Romerol
μ: 0.35 μ: 0.35
σ: 0.1 σ: 0.1
conditions: conditions:
- !type:IsZombieImmune - !type:IsZombieImmuneCondition
invert: true inverted: true
- !type:PopupMessage - !type:PopupMessage
type: Local type: Local
visualType: MediumCaution visualType: MediumCaution
@@ -505,14 +506,16 @@
- zombification-30-message-4 - zombification-30-message-4
probability: 0.05 probability: 0.05
conditions: conditions:
- !type:MetaboliteThreshold - !type:MetaboliteThresholdCondition
reagent: Romerol
min: 15 min: 15
- !type:HealthChange - !type:HealthChange
damage: damage:
types: types:
Poison: 0.15 Poison: 0.15
conditions: conditions:
- !type:MetaboliteThreshold - !type:MetaboliteThresholdCondition
reagent: Romerol
min: 15 min: 15
- !type:ModifyHeartDamage - !type:ModifyHeartDamage
amount: 2 amount: 2
@@ -533,39 +536,46 @@
mobstate: Critical mobstate: Critical
- !type:Zombify - !type:Zombify
conditions: conditions:
- !type:BrainDamage - !type:BrainDamageCondition
min: 70 min: 70
- !type:MetaboliteThreshold - !type:MetaboliteThresholdCondition
reagent: Romerol
min: 15 min: 15
- !type:ModifyBrainDamage - !type:ModifyBrainDamage
amount: 0.5 amount: 0.5
conditions: conditions:
- !type:MetaboliteThreshold - !type:MetaboliteThresholdCondition
reagent: Romerol
min: 15 min: 15
- !type:ModifyHeartDamage - !type:ModifyHeartDamage
amount: 0.2 amount: 0.2
conditions: conditions:
- !type:MetaboliteThreshold - !type:MetaboliteThresholdCondition
reagent: Romerol
min: 15 min: 15
- !type:ModifyLungDamage - !type:ModifyLungDamage
amount: 0.2 amount: 0.2
conditions: conditions:
- !type:MetaboliteThreshold - !type:MetaboliteThresholdCondition
reagent: Romerol
min: 15 min: 15
- !type:AdjustTemperature - !type:AdjustTemperature
amount: 3000 amount: 3000
conditions: conditions:
- !type:MetaboliteThreshold - !type:MetaboliteThresholdCondition
reagent: Romerol
min: 15 min: 15
- !type:Jitter - !type:Jitter
probability: 0.25 probability: 0.25
conditions: conditions:
- !type:MetaboliteThreshold - !type:MetaboliteThresholdCondition
reagent: Romerol
min: 30 min: 30
- !type:AdjustTemperature - !type:AdjustTemperature
amount: 6000 amount: 6000
conditions: conditions:
- !type:MetaboliteThreshold - !type:MetaboliteThresholdCondition
reagent: Romerol
min: 30 min: 30
- !type:PopupMessage - !type:PopupMessage
type: Local type: Local
@@ -577,12 +587,14 @@
- zombification-60-message-4 - zombification-60-message-4
probability: 0.05 probability: 0.05
conditions: conditions:
- !type:MetaboliteThreshold - !type:MetaboliteThresholdCondition
reagent: Romerol
min: 30 min: 30
- !type:ModifyBrainDamage - !type:ModifyBrainDamage
amount: 0.25 amount: 0.25
conditions: conditions:
- !type:MetaboliteThreshold - !type:MetaboliteThresholdCondition
reagent: Romerol
min: 45 min: 45
- !type:HealthChange - !type:HealthChange
damage: damage:
@@ -591,7 +603,8 @@
Blunt: 0.15 Blunt: 0.15
Piercing: 0.15 Piercing: 0.15
conditions: conditions:
- !type:MetaboliteThreshold - !type:MetaboliteThresholdCondition
reagent: Romerol
min: 45 min: 45
- !type:PopupMessage - !type:PopupMessage
type: Local type: Local
@@ -603,12 +616,14 @@
- zombification-90-message-4 - zombification-90-message-4
probability: 0.05 probability: 0.05
conditions: conditions:
- !type:MetaboliteThreshold - !type:MetaboliteThresholdCondition
reagent: Romerol
min: 45 min: 45
- !type:ModifyBrainDamage - !type:ModifyBrainDamage
amount: 0.5 amount: 0.5
conditions: conditions:
- !type:MetaboliteThreshold - !type:MetaboliteThresholdCondition
reagent: Romerol
min: 60 min: 60
- !type:PopupMessage - !type:PopupMessage
type: Local type: Local
@@ -620,12 +635,14 @@
- zombification-120-message-4 - zombification-120-message-4
probability: 0.05 probability: 0.05
conditions: conditions:
- !type:MetaboliteThreshold - !type:MetaboliteThresholdCondition
reagent: Romerol
min: 60 min: 60
- !type:ModifyBrainDamage - !type:ModifyBrainDamage
amount: 5 amount: 5
conditions: conditions:
- !type:MetaboliteThreshold - !type:MetaboliteThresholdCondition
reagent: Romerol
min: 70 min: 70
- !type:Zombify - !type:Zombify
conditions: conditions:

View File

@@ -12,20 +12,22 @@
statusEffects: statusEffects:
- statusEffect: StatusEffectPainkillersMildParacetamol - statusEffect: StatusEffectPainkillersMildParacetamol
conditions: conditions:
- !type:ReagentThreshold - !type:ReagentCondition
reagent: Tramadol reagent: Tramadol
max: 1 max: 1
- !type:ReagentThreshold - !type:ReagentCondition
reagent: Oxycodone reagent: Oxycodone
max: 1 max: 1
- statusEffect: StatusEffectPainkillersMildParacetamolOverdose - statusEffect: StatusEffectPainkillersMildParacetamolOverdose
conditions: conditions:
- !type:ReagentThreshold - !type:ReagentCondition
reagent: Paracetamol
min: 10 min: 10
effects: effects:
- !type:HealthChange - !type:HealthChange
conditions: conditions:
- !type:ReagentThreshold - !type:ReagentCondition
reagent: Paracetamol
min: 10 min: 10
damage: damage:
types: types:
@@ -46,32 +48,35 @@
- statusEffect: StatusEffectPainkillersTramadol - statusEffect: StatusEffectPainkillersTramadol
- statusEffect: StatusEffectPainkillersTramadolOverdose - statusEffect: StatusEffectPainkillersTramadolOverdose
conditions: conditions:
- !type:ReagentThreshold - !type:ReagentCondition
reagent: Tramadol
min: 15 min: 15
- !type:ReagentThreshold - !type:ReagentCondition
reagent: Oxycodone reagent: Oxycodone
max: 1 max: 1
- statusEffect: StatusEffectHeartStrainTramadolAlcohol - statusEffect: StatusEffectHeartStrainTramadolAlcohol
conditions: conditions:
- !type:ReagentThreshold - !type:ReagentCondition
reagent: Ethanol reagent: Ethanol
min: 1 min: 1
effects: effects:
- !type:Drunk - !type:Drunk
boozePower: 1 boozePower: 1
conditions: conditions:
- !type:ReagentThreshold - !type:ReagentCondition
reagent: Tramadol
min: 15.5 min: 15.5
- !type:HealthChange - !type:HealthChange
conditions: conditions:
- !type:ReagentThreshold - !type:ReagentCondition
reagent: Tramadol
min: 25 min: 25
damage: damage:
types: types:
Asphyxiation: 0.5 Asphyxiation: 0.5
- !type:HealthChange - !type:HealthChange
conditions: conditions:
- !type:ReagentThreshold - !type:ReagentCondition
reagent: Ethanol reagent: Ethanol
min: 1 min: 1
damage: damage:
@@ -93,29 +98,32 @@
- statusEffect: StatusEffectPainkillersStrongOxycodone - statusEffect: StatusEffectPainkillersStrongOxycodone
- statusEffect: StatusEffectPainkillersStrongOxycodoneOverdose - statusEffect: StatusEffectPainkillersStrongOxycodoneOverdose
conditions: conditions:
- !type:ReagentThreshold - !type:ReagentCondition
reagent: Oxycodone
min: 10 min: 10
- statusEffect: StatusEffectHeartStrainOxycodoneAlcohol - statusEffect: StatusEffectHeartStrainOxycodoneAlcohol
conditions: conditions:
- !type:ReagentThreshold - !type:ReagentCondition
reagent: Ethanol reagent: Ethanol
min: 1 min: 1
effects: effects:
- !type:Drunk - !type:Drunk
boozePower: 2 boozePower: 2
conditions: conditions:
- !type:ReagentThreshold - !type:ReagentCondition
reagent: Oxycodone
min: 10 min: 10
- !type:HealthChange - !type:HealthChange
conditions: conditions:
- !type:ReagentThreshold - !type:ReagentCondition
reagent: Oxycodone
min: 15 min: 15
damage: damage:
types: types:
Asphyxiation: 0.5 Asphyxiation: 0.5
- !type:HealthChange - !type:HealthChange
conditions: conditions:
- !type:ReagentThreshold - !type:ReagentCondition
reagent: Ethanol reagent: Ethanol
min: 1 min: 1
damage: damage:
@@ -148,7 +156,8 @@
- !type:ModifyBloodLevel - !type:ModifyBloodLevel
amount: 6 amount: 6
conditions: conditions:
- !type:ReagentThreshold - !type:ReagentCondition
reagent: Sanguine
max: 1 max: 1
- type: reagent - type: reagent
@@ -167,27 +176,30 @@
- !type:ModifyHeartDamage - !type:ModifyHeartDamage
amount: -0.4 amount: -0.4
conditions: conditions:
- !type:HeartDamage - !type:HeartDamageCondition
max: 50 max: 50
- !type:ModifyLungDamage - !type:ModifyLungDamage
amount: -0.4 amount: -0.4
conditions: conditions:
- !type:LungDamage - !type:LungDamageCondition
max: 50 max: 50
- !type:HealthChange - !type:HealthChange
conditions: conditions:
- !type:ReagentThreshold - !type:ReagentCondition
reagent: Peridaxon
min: 5.5 min: 5.5
damage: damage:
types: types:
Poison: 0.05 Poison: 0.05
- !type:Jitter - !type:Jitter
conditions: conditions:
- !type:ReagentThreshold - !type:ReagentCondition
reagent: Peridaxon
min: 5.5 min: 5.5
- !type:ChemVomit - !type:Vomit
conditions: conditions:
- !type:ReagentThreshold - !type:ReagentCondition
reagent: Peridaxon
min: 5.5 min: 5.5
probability: 0.1 probability: 0.1
@@ -204,26 +216,26 @@
statusEffects: statusEffects:
- statusEffect: StatusEffectMajorOxygenationCloneoxadone - statusEffect: StatusEffectMajorOxygenationCloneoxadone
conditions: conditions:
- !type:Temperature - !type:TemperatureCondition
max: 170.0 max: 170.0
- statusEffect: StatusEffectHeartStabilizationCloneoxadone - statusEffect: StatusEffectHeartStabilizationCloneoxadone
conditions: conditions:
- !type:Temperature - !type:TemperatureCondition
max: 170.0 max: 170.0
effects: effects:
- !type:ModifyHeartDamage - !type:ModifyHeartDamage
amount: -0.6 amount: -0.6
conditions: conditions:
- !type:Temperature - !type:TemperatureCondition
max: 170.0 max: 170.0
- !type:ModifyLungDamage - !type:ModifyLungDamage
amount: -0.6 amount: -0.6
conditions: conditions:
- !type:Temperature - !type:TemperatureCondition
max: 170.0 max: 170.0
- !type:EvenHealthChange - !type:EvenHealthChange
conditions: conditions:
- !type:Temperature - !type:TemperatureCondition
max: 170.0 max: 170.0
damage: damage:
Airloss: -12 Airloss: -12
@@ -247,17 +259,20 @@
- !type:SatiateThirst - !type:SatiateThirst
factor: 3 factor: 3
conditions: conditions:
- !type:ReagentThreshold - !type:ReagentCondition
reagent: SalineGlucose
max: 1 max: 1
- !type:ModifyBloodLevel - !type:ModifyBloodLevel
amount: 0.5 amount: 0.5
conditions: conditions:
- !type:ReagentThreshold - !type:ReagentCondition
reagent: SalineGlucose
max: 1 max: 1
- !type:SatiateHunger - !type:SatiateHunger
factor: 0.5 factor: 0.5
conditions: conditions:
- !type:ReagentThreshold - !type:ReagentCondition
reagent: SalineGlucose
max: 1 max: 1
- !type:HealthChange - !type:HealthChange
damage: damage:
@@ -269,7 +284,8 @@
Shock: -0.6 Shock: -0.6
Cold: -0.6 Cold: -0.6
conditions: conditions:
- !type:ReagentThreshold - !type:ReagentCondition
reagent: SalineGlucose
max: 1 max: 1
- type: reagent - type: reagent
@@ -306,13 +322,15 @@
- !type:RemoveStatusEffect - !type:RemoveStatusEffect
effectProto: WoundFracture effectProto: WoundFracture
conditions: conditions:
- !type:MetaboliteThreshold - !type:MetaboliteThresholdCondition
reagent: Osseous
min: 5 min: 5
- !type:AdjustReagent - !type:AdjustReagent
reagent: Osseous reagent: Osseous
amount: -5 amount: -5
conditions: conditions:
- !type:MetaboliteThreshold - !type:MetaboliteThresholdCondition
reagent: Osseous
min: 5 min: 5
- type: reagent - type: reagent
@@ -332,8 +350,8 @@
Asphyxiation: -4 Asphyxiation: -4
Blunt: 1 Blunt: 1
conditions: conditions:
- !type:TotalGroupDamage - !type:DamageGroupCondition
group: Airloss damageGroup: Airloss
min: 4 min: 4
- !type:HealthChange - !type:HealthChange
damage: damage:
@@ -341,10 +359,11 @@
Asphyxiation: -4 Asphyxiation: -4
Blunt: 1 Blunt: 1
conditions: conditions:
- !type:MetaboliteThreshold - !type:MetaboliteThresholdCondition
reagent: Convermol
min: 10 min: 10
- !type:TotalGroupDamage - !type:DamageGroupCondition
group: Airloss damageGroup: Airloss
min: 4 min: 4
- !type:ModifyLungDamage - !type:ModifyLungDamage
amount: 0.05 amount: 0.05
@@ -363,43 +382,47 @@
statusEffects: statusEffects:
- statusEffect: StatusEffectPainkillersSalicylicAcid - statusEffect: StatusEffectPainkillersSalicylicAcid
conditions: conditions:
- !type:TotalGroupDamage - !type:DamageGroupCondition
group: Brute damageGroup: Brute
min: 35 min: 35
effects: effects:
- !type:EvenHealthChange - !type:EvenHealthChange
damage: damage:
Brute: -2 Brute: -2
conditions: conditions:
- !type:TotalGroupDamage - !type:DamageGroupCondition
group: Brute damageGroup: Brute
min: 35 min: 35
- !type:MetaboliteThreshold - !type:MetaboliteThresholdCondition
reagent: SalicylicAcid
max: 15 max: 15
- !type:EvenHealthChange - !type:EvenHealthChange
damage: damage:
Brute: -2 Brute: -2
Burn: 2 Burn: 2
conditions: conditions:
- !type:MetaboliteThreshold - !type:MetaboliteThresholdCondition
reagent: SalicylicAcid
min: 15 min: 15
- !type:EvenHealthChange - !type:EvenHealthChange
damage: damage:
Brute: -0.5 Brute: -0.5
conditions: conditions:
- !type:TotalGroupDamage - !type:DamageGroupCondition
group: Brute damageGroup: Brute
max: 35 max: 35
- !type:RemoveStatusEffect - !type:RemoveStatusEffect
effectProto: WoundBoneDeath effectProto: WoundBoneDeath
conditions: conditions:
- !type:MetaboliteThreshold - !type:MetaboliteThresholdCondition
reagent: SalicylicAcid
min: 50 min: 50
- !type:EvenHealthChange - !type:EvenHealthChange
damage: damage:
Burn: 1 Burn: 1
conditions: conditions:
- !type:MetaboliteThreshold - !type:MetaboliteThresholdCondition
reagent: SalicylicAcid
min: 35 min: 35
- type: reagent - type: reagent
@@ -416,41 +439,45 @@
statusEffects: statusEffects:
- statusEffect: StatusEffectPainkillersOxandrolone - statusEffect: StatusEffectPainkillersOxandrolone
conditions: conditions:
- !type:TotalGroupDamage - !type:DamageGroupCondition
group: Burn damageGroup: Burn
min: 35 min: 35
effects: effects:
- !type:EvenHealthChange - !type:EvenHealthChange
damage: damage:
Burn: -3 Burn: -3
conditions: conditions:
- !type:TotalGroupDamage - !type:DamageGroupCondition
group: Burn damageGroup: Burn
min: 35 min: 35
- !type:MetaboliteThreshold - !type:MetaboliteThresholdCondition
reagent: Oxandrolone
max: 15 max: 15
- !type:EvenHealthChange - !type:EvenHealthChange
damage: damage:
Burn: -3 Burn: -3
Brute: 3 Brute: 3
conditions: conditions:
- !type:MetaboliteThreshold - !type:MetaboliteThresholdCondition
reagent: Oxandrolone
min: 15 min: 15
- !type:EvenHealthChange - !type:EvenHealthChange
damage: damage:
Burn: -0.5 Burn: -0.5
conditions: conditions:
- !type:TotalGroupDamage - !type:DamageGroupCondition
group: Burn damageGroup: Burn
max: 35 max: 35
- !type:RemoveStatusEffect - !type:RemoveStatusEffect
effectProto: WoundHusking effectProto: WoundHusking
conditions: conditions:
- !type:MetaboliteThreshold - !type:MetaboliteThresholdCondition
reagent: Oxandrolone
min: 50 min: 50
- !type:EvenHealthChange - !type:EvenHealthChange
damage: damage:
Brute: 1 Brute: 1
conditions: conditions:
- !type:MetaboliteThreshold - !type:MetaboliteThresholdCondition
reagent: Oxandrolone
min: 35 min: 35