rebase
This commit is contained in:
@@ -34,6 +34,7 @@ public sealed class MetabolizerSystem : SharedMetabolizerSystem
|
||||
[Dependency] private readonly SharedEntityConditionsSystem _entityConditions = default!;
|
||||
[Dependency] private readonly SharedEntityEffectsSystem _entityEffects = default!;
|
||||
[Dependency] private readonly SharedSolutionContainerSystem _solutionContainerSystem = default!;
|
||||
[Dependency] private readonly Content.Shared.StatusEffectNew.StatusEffectsSystem _statusEffects = default!;
|
||||
|
||||
private EntityQuery<OrganComponent> _organQuery;
|
||||
private EntityQuery<SolutionContainerManagerComponent> _solutionQuery;
|
||||
@@ -129,7 +130,7 @@ public sealed class MetabolizerSystem : SharedMetabolizerSystem
|
||||
if (solutionEntityUid is null
|
||||
|| soln is null
|
||||
|| solution is null
|
||||
|| solution.Contents.Count == 0)
|
||||
|| (solution.Contents.Count == 0 && ent.Comp1.MetabolizingReagents.Count == 0 && ent.Comp1.Metabolites.Count == 0)) // Offbrand - we need to ensure we clear out metabolizing reagents
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -139,6 +140,7 @@ public sealed class MetabolizerSystem : SharedMetabolizerSystem
|
||||
var list = solution.Contents.ToArray();
|
||||
_random.Shuffle(list);
|
||||
|
||||
var metabolized = new HashSet<ProtoId<ReagentPrototype>>(); // Offbrand
|
||||
int reagents = 0;
|
||||
foreach (var (reagent, quantity) in list)
|
||||
{
|
||||
@@ -156,10 +158,13 @@ public sealed class MetabolizerSystem : SharedMetabolizerSystem
|
||||
continue;
|
||||
}
|
||||
|
||||
// Offbrand - keep processing for status effects and metabolites
|
||||
// we're done here entirely if this is true
|
||||
if (reagents >= ent.Comp1.MaxReagentsProcessable)
|
||||
return;
|
||||
// if (reagents >= ent.Comp1.MaxReagentsProcessable)
|
||||
// return;
|
||||
|
||||
metabolized.Add(reagent.Prototype);
|
||||
// End Offbrand
|
||||
|
||||
// loop over all our groups and see which ones apply
|
||||
if (ent.Comp1.MetabolismGroups is null)
|
||||
@@ -194,6 +199,16 @@ public sealed class MetabolizerSystem : SharedMetabolizerSystem
|
||||
|
||||
var actualEntity = ent.Comp2?.Body ?? solutionEntityUid.Value;
|
||||
|
||||
// Begin Offbrand - status effects
|
||||
foreach (var effect in entry.StatusEffects)
|
||||
{
|
||||
if (!_entityConditions.TryConditions(actualEntity, effect.Conditions))
|
||||
_statusEffects.TryRemoveStatusEffect(actualEntity, effect.StatusEffect);
|
||||
else
|
||||
_statusEffects.TryUpdateStatusEffectDuration(actualEntity, effect.StatusEffect, out _);
|
||||
}
|
||||
// End Offbrand - status effects
|
||||
|
||||
// do all effects, if conditions apply
|
||||
foreach (var effect in entry.Effects)
|
||||
{
|
||||
@@ -232,13 +247,80 @@ public sealed class MetabolizerSystem : SharedMetabolizerSystem
|
||||
// remove a certain amount of reagent
|
||||
if (mostToRemove > FixedPoint2.Zero)
|
||||
{
|
||||
solution.RemoveReagent(reagent, mostToRemove);
|
||||
var removed = solution.RemoveReagent(reagent, mostToRemove); // Offbrand
|
||||
|
||||
// We have processed a reagant, so count it towards the cap
|
||||
reagents += 1;
|
||||
|
||||
// Begin Offbrand - track metabbolites
|
||||
if (!ent.Comp1.Metabolites.ContainsKey(reagent.Prototype))
|
||||
ent.Comp1.Metabolites[reagent.Prototype] = 0;
|
||||
ent.Comp1.Metabolites[reagent.Prototype] += removed;
|
||||
// End Offbrand - track metabbolites
|
||||
}
|
||||
}
|
||||
|
||||
// Begin Offbrand
|
||||
foreach (var reagent in ent.Comp1.MetabolizingReagents)
|
||||
{
|
||||
if (metabolized.Contains(reagent))
|
||||
continue;
|
||||
|
||||
var proto = _prototypeManager.Index(reagent);
|
||||
var actualEntity = ent.Comp2?.Body ?? solutionEntityUid.Value;
|
||||
|
||||
if (ent.Comp1.MetabolismGroups is null)
|
||||
continue;
|
||||
|
||||
foreach (var group in ent.Comp1.MetabolismGroups)
|
||||
{
|
||||
if (proto.Metabolisms is null)
|
||||
continue;
|
||||
|
||||
if (!proto.Metabolisms.TryGetValue(group.Id, out var entry))
|
||||
continue;
|
||||
|
||||
foreach (var effect in entry.StatusEffects)
|
||||
{
|
||||
_statusEffects.TryRemoveStatusEffect(actualEntity, effect.StatusEffect);
|
||||
}
|
||||
}
|
||||
}
|
||||
ent.Comp1.MetabolizingReagents = metabolized;
|
||||
|
||||
foreach (var metaboliteReagent in ent.Comp1.Metabolites.Keys)
|
||||
{
|
||||
if (ent.Comp1.MetabolizingReagents.Contains(metaboliteReagent))
|
||||
continue;
|
||||
|
||||
if (!_prototypeManager.Resolve(metaboliteReagent, out var proto) || proto.Metabolisms is not { } metabolisms)
|
||||
continue;
|
||||
|
||||
if (ent.Comp1.MetabolismGroups is null)
|
||||
continue;
|
||||
|
||||
ReagentEffectsEntry? entry = null;
|
||||
var metabolismRateModifier = FixedPoint2.Zero;
|
||||
foreach (var group in ent.Comp1.MetabolismGroups)
|
||||
{
|
||||
if (!proto.Metabolisms.TryGetValue(group.Id, out entry))
|
||||
continue;
|
||||
|
||||
metabolismRateModifier = group.MetabolismRateModifier;
|
||||
break;
|
||||
}
|
||||
|
||||
if (entry is not { } metabolismEntry)
|
||||
continue;
|
||||
|
||||
var rate = metabolismEntry.MetabolismRate * metabolismRateModifier * ent.Comp1.MetaboliteDecayFactor;
|
||||
ent.Comp1.Metabolites[metaboliteReagent] -= rate;
|
||||
|
||||
if (ent.Comp1.Metabolites[metaboliteReagent] <= 0)
|
||||
ent.Comp1.Metabolites.Remove(metaboliteReagent);
|
||||
}
|
||||
// End Offbrand
|
||||
|
||||
_solutionContainerSystem.UpdateChemicals(soln.Value);
|
||||
}
|
||||
|
||||
|
||||
@@ -259,12 +259,12 @@ namespace Content.Server.Zombies
|
||||
args.Handled = true;
|
||||
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<ZombifyOnDeathComponent>(entity);
|
||||
EnsureComp<PendingZombieComponent>(uid);
|
||||
EnsureComp<ZombifyOnDeathComponent>(uid);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,48 +1,50 @@
|
||||
using Content.Server.Body.Components;
|
||||
using Content.Shared._Offbrand.EntityEffects;
|
||||
using Content.Shared.EntityEffects;
|
||||
using Content.Shared.Body.Organ;
|
||||
using Content.Shared.Chemistry.Components.SolutionManager;
|
||||
using Content.Shared.Chemistry.Components;
|
||||
using Content.Shared.Chemistry.EntitySystems;
|
||||
using Content.Shared.EntityConditions;
|
||||
using Content.Shared.FixedPoint;
|
||||
|
||||
namespace Content.Server._Offbrand.EntityEffects;
|
||||
|
||||
public sealed class MetaboliteThresholdSystem : EntitySystem
|
||||
public sealed class MetaboliteThresholdEntityConditionSystem : EntityConditionSystem<MetabolizerComponent, MetaboliteThresholdCondition>
|
||||
{
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
[Dependency] private readonly SharedSolutionContainerSystem _solutionContainer = default!;
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private void OnCheckMetaboliteThreshold(ref CheckEntityEffectConditionEvent<MetaboliteThreshold> args)
|
||||
protected override void Condition(Entity<MetabolizerComponent> ent, ref EntityConditionEvent<MetaboliteThresholdCondition> args)
|
||||
{
|
||||
if (args.Args is not EntityEffectReagentArgs reagentArgs)
|
||||
throw new NotImplementedException();
|
||||
|
||||
var reagent = args.Condition.Reagent;
|
||||
if (reagent == null)
|
||||
reagent = reagentArgs.Reagent?.ID;
|
||||
|
||||
if (reagent is not { } metaboliteReagent)
|
||||
{
|
||||
args.Result = true;
|
||||
return;
|
||||
}
|
||||
|
||||
if (!TryComp<MetabolizerComponent>(reagentArgs.OrganEntity, out var metabolizer))
|
||||
{
|
||||
args.Result = true;
|
||||
return;
|
||||
}
|
||||
|
||||
var metabolites = metabolizer.Metabolites;
|
||||
var metabolites = ent.Comp.Metabolites;
|
||||
|
||||
var quant = FixedPoint2.Zero;
|
||||
metabolites.TryGetValue(metaboliteReagent, out quant);
|
||||
metabolites.TryGetValue(reagent, out quant);
|
||||
|
||||
if (args.Condition.IncludeBloodstream && reagentArgs.Source != null)
|
||||
if (args.Condition.IncludeBloodstream && GetSolution((ent, ent.Comp, null)) is { } solution)
|
||||
{
|
||||
quant += reagentArgs.Source.GetTotalPrototypeQuantity(metaboliteReagent);
|
||||
quant += solution.GetTotalPrototypeQuantity(reagent);
|
||||
}
|
||||
|
||||
args.Result = quant >= args.Condition.Min && quant <= args.Condition.Max;
|
||||
|
||||
@@ -4,19 +4,12 @@ using Content.Shared.EntityEffects;
|
||||
|
||||
namespace Content.Server._Offbrand.EntityEffects;
|
||||
|
||||
public sealed class ZombifySystem : EntitySystem
|
||||
public sealed class ZombifySystem : EntityEffectSystem<MetaDataComponent, Zombify>
|
||||
{
|
||||
[Dependency] private readonly ZombieSystem _zombie = default!;
|
||||
|
||||
public override void Initialize()
|
||||
protected override void Effect(Entity<MetaDataComponent> ent, ref EntityEffectEvent<Zombify> args)
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
SubscribeLocalEvent<ExecuteEntityEffectEvent<Zombify>>(OnExecuteZombify);
|
||||
}
|
||||
|
||||
private void OnExecuteZombify(ref ExecuteEntityEffectEvent<Zombify> args)
|
||||
{
|
||||
_zombie.ZombifyEntity(args.Args.TargetEntity);
|
||||
_zombie.ZombifyEntity(ent);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
using Content.Server.Chat.Systems;
|
||||
using Content.Server.EUI;
|
||||
using Content.Shared._Offbrand.MMI;
|
||||
using Content.Shared._Offbrand.Wounds;
|
||||
using Content.Shared.Body.Components;
|
||||
using Content.Shared.Body.Systems;
|
||||
using Content.Shared.Chat;
|
||||
using Content.Shared.Containers.ItemSlots;
|
||||
using Content.Shared.DoAfter;
|
||||
using Content.Shared.Interaction;
|
||||
@@ -17,12 +17,12 @@ namespace Content.Server._Offbrand.MMI;
|
||||
public sealed class MMIExtractorSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly BrainDamageSystem _brainDamage = default!;
|
||||
[Dependency] private readonly ChatSystem _chat = default!;
|
||||
[Dependency] private readonly EntityWhitelistSystem _whitelist = default!;
|
||||
[Dependency] private readonly EuiManager _eui = default!;
|
||||
[Dependency] private readonly ISharedPlayerManager _player = default!;
|
||||
[Dependency] private readonly ItemSlotsSystem _slots = default!;
|
||||
[Dependency] private readonly SharedBodySystem _body = default!;
|
||||
[Dependency] private readonly SharedChatSystem _chat = default!;
|
||||
[Dependency] private readonly SharedDoAfterSystem _doAfter = default!;
|
||||
[Dependency] private readonly SharedMindSystem _mind = default!;
|
||||
|
||||
|
||||
@@ -298,25 +298,11 @@ namespace Content.Shared.Chemistry.Reagent
|
||||
public sealed partial class ReagentStatusEffectEntry
|
||||
{
|
||||
[DataField]
|
||||
public EntityEffectCondition[]? Conditions;
|
||||
public Content.Shared.EntityConditions.EntityCondition[]? Conditions;
|
||||
|
||||
[DataField]
|
||||
public EntProtoId StatusEffect;
|
||||
|
||||
public bool ShouldApplyStatusEffect(EntityEffectBaseArgs args)
|
||||
{
|
||||
if (Conditions != null)
|
||||
{
|
||||
foreach (var cond in Conditions)
|
||||
{
|
||||
if (!cond.Condition(args))
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public string? Describe(IPrototypeManager prototype, IEntitySystemManager entSys)
|
||||
{
|
||||
if (!prototype.Resolve(StatusEffect, out var effectProtoData))
|
||||
@@ -325,7 +311,7 @@ namespace Content.Shared.Chemistry.Reagent
|
||||
return Loc.GetString("reagent-guidebook-status-effect", ("effect", effectProtoData.Name ?? string.Empty),
|
||||
("conditionCount", Conditions?.Length ?? 0),
|
||||
("conditions",
|
||||
Content.Shared.Localizations.ContentLocalizationManager.FormatList(Conditions?.Select(x => x.GuidebookExplanation(prototype)).ToList() ??
|
||||
Content.Shared.Localizations.ContentLocalizationManager.FormatList(Conditions?.Select(x => x.EntityConditionGuidebookText(prototype)).ToList() ??
|
||||
new List<string>())));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,12 +41,13 @@ public sealed partial class DamageableSystem
|
||||
bool ignoreResistances = false,
|
||||
bool interruptsDoAfters = true,
|
||||
EntityUid? origin = null,
|
||||
bool ignoreGlobalModifiers = false
|
||||
bool ignoreGlobalModifiers = false,
|
||||
bool forceRefresh = false // Offbrand
|
||||
)
|
||||
{
|
||||
//! Empty just checks if the DamageSpecifier is _literally_ empty, as in, is internal dictionary of damage types is empty.
|
||||
// If you deal 0.0 of some damage type, Empty will be false!
|
||||
return !TryChangeDamage(ent, damage, out _, ignoreResistances, interruptsDoAfters, origin, ignoreGlobalModifiers);
|
||||
return !TryChangeDamage(ent, damage, out _, ignoreResistances, interruptsDoAfters, origin, ignoreGlobalModifiers, forceRefresh); // Offbrand
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -67,12 +68,13 @@ public sealed partial class DamageableSystem
|
||||
bool ignoreResistances = false,
|
||||
bool interruptsDoAfters = true,
|
||||
EntityUid? origin = null,
|
||||
bool ignoreGlobalModifiers = false
|
||||
bool ignoreGlobalModifiers = false,
|
||||
bool forceRefresh = false // Offbrand
|
||||
)
|
||||
{
|
||||
//! Empty just checks if the DamageSpecifier is _literally_ empty, as in, is internal dictionary of damage types is empty.
|
||||
// If you deal 0.0 of some damage type, Empty will be false!
|
||||
newDamage = ChangeDamage(ent, damage, ignoreResistances, interruptsDoAfters, origin, ignoreGlobalModifiers);
|
||||
newDamage = ChangeDamage(ent, damage, ignoreResistances, interruptsDoAfters, origin, ignoreGlobalModifiers, forceRefresh); // Offbrand
|
||||
return !damage.Empty;
|
||||
}
|
||||
|
||||
@@ -93,7 +95,8 @@ public sealed partial class DamageableSystem
|
||||
bool ignoreResistances = false,
|
||||
bool interruptsDoAfters = true,
|
||||
EntityUid? origin = null,
|
||||
bool ignoreGlobalModifiers = false
|
||||
bool ignoreGlobalModifiers = false,
|
||||
bool forceRefresh = false // Offbrand
|
||||
)
|
||||
{
|
||||
var damageDone = new DamageSpecifier();
|
||||
@@ -101,7 +104,7 @@ public sealed partial class DamageableSystem
|
||||
if (!_damageableQuery.Resolve(ent, ref ent.Comp, false))
|
||||
return damageDone;
|
||||
|
||||
if (damage.Empty)
|
||||
if (damage.Empty && !forceRefresh)
|
||||
return damageDone;
|
||||
|
||||
var before = new BeforeDamageChangedEvent(damage, origin);
|
||||
@@ -125,13 +128,18 @@ public sealed partial class DamageableSystem
|
||||
RaiseLocalEvent(ent, ev);
|
||||
damage = ev.Damage;
|
||||
|
||||
if (damage.Empty)
|
||||
if (damage.Empty && !forceRefresh) // Offbrand
|
||||
return damageDone;
|
||||
}
|
||||
|
||||
if (!ignoreGlobalModifiers)
|
||||
damage = ApplyUniversalAllModifiers(damage);
|
||||
|
||||
// Begin Offbrand
|
||||
var beforeCommit = new Content.Shared._Offbrand.Wounds.BeforeDamageCommitEvent(damage, forceRefresh);
|
||||
RaiseLocalEvent(ent.Owner, ref beforeCommit);
|
||||
damage = beforeCommit.Damage;
|
||||
// End Offbrand
|
||||
|
||||
damageDone.DamageDict.EnsureCapacity(damage.DamageDict.Count);
|
||||
|
||||
@@ -151,7 +159,7 @@ public sealed partial class DamageableSystem
|
||||
}
|
||||
|
||||
if (!damageDone.Empty)
|
||||
OnEntityDamageChanged((ent, ent.Comp), damageDone, interruptsDoAfters, origin);
|
||||
OnEntityDamageChanged((ent, ent.Comp), damageDone, interruptsDoAfters, origin, forceRefresh); // Offbrand
|
||||
|
||||
return damageDone;
|
||||
}
|
||||
|
||||
@@ -261,16 +261,23 @@ public sealed class DamageChangedEvent : EntityEventArgs
|
||||
/// </summary>
|
||||
public readonly EntityUid? Origin;
|
||||
|
||||
/// <summary>
|
||||
/// Offbrand - If this damage changed happened as part of a forced refresh
|
||||
/// </summary>
|
||||
public readonly bool ForcedRefresh;
|
||||
|
||||
public DamageChangedEvent(
|
||||
DamageableComponent damageable,
|
||||
DamageSpecifier? damageDelta,
|
||||
bool interruptsDoAfters,
|
||||
EntityUid? origin
|
||||
EntityUid? origin,
|
||||
bool forcedRefresh // Offbrand
|
||||
)
|
||||
{
|
||||
Damageable = damageable;
|
||||
DamageDelta = damageDelta;
|
||||
Origin = origin;
|
||||
ForcedRefresh = forcedRefresh; // Offbrand
|
||||
|
||||
if (DamageDelta is null)
|
||||
return;
|
||||
|
||||
@@ -47,7 +47,8 @@ public sealed partial class DamageableSystem : EntitySystem
|
||||
Entity<DamageableComponent> ent,
|
||||
DamageSpecifier? damageDelta = null,
|
||||
bool interruptsDoAfters = true,
|
||||
EntityUid? origin = null
|
||||
EntityUid? origin = null,
|
||||
bool forceRefresh = false // Offbrand
|
||||
)
|
||||
{
|
||||
ent.Comp.Damage.GetDamagePerGroup(_prototypeManager, ent.Comp.DamagePerGroup);
|
||||
@@ -66,7 +67,7 @@ public sealed partial class DamageableSystem : EntitySystem
|
||||
|
||||
// TODO DAMAGE
|
||||
// byref struct event.
|
||||
RaiseLocalEvent(ent, new DamageChangedEvent(ent.Comp, damageDelta, interruptsDoAfters, origin));
|
||||
RaiseLocalEvent(ent, new DamageChangedEvent(ent.Comp, damageDelta, interruptsDoAfters, origin, forceRefresh)); // Offbrand
|
||||
}
|
||||
|
||||
private void DamageableGetState(Entity<DamageableComponent> ent, ref ComponentGetState args)
|
||||
|
||||
@@ -44,7 +44,7 @@ public sealed partial class StatusEffectsSystem
|
||||
SubscribeLocalEvent<StatusEffectContainerComponent, Content.Shared._Offbrand.Weapons.RelayedGetMeleeDamageEvent>(RefRelayStatusEffectEvent); // Offbrand
|
||||
SubscribeLocalEvent<StatusEffectContainerComponent, Content.Shared._Offbrand.Weapons.RelayedGetMeleeAttackRateEvent>(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.CanSeeAttemptEvent>(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.Weapons.Ranged.Events.SelfBeforeGunShotEvent>(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.Verbs.GetVerbsEvent<Content.Shared.Verbs.AlternativeVerb>>(RelayStatusEffectEvent); // Offbrand
|
||||
}
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
using Content.Shared.Chemistry.Components;
|
||||
using Content.Shared.Chemistry.EntitySystems;
|
||||
using Content.Shared.Chemistry.Reagent;
|
||||
using Content.Shared.EntityEffects;
|
||||
using Content.Shared.FixedPoint;
|
||||
@@ -8,7 +10,7 @@ using Robust.Shared.Timing;
|
||||
|
||||
namespace Content.Shared._Offbrand.EntityEffects;
|
||||
|
||||
public sealed partial class AdjustReagentGaussian : EntityEffect
|
||||
public sealed partial class AdjustReagentGaussian : EntityEffectBase<AdjustReagentGaussian>
|
||||
{
|
||||
[DataField(required: true)]
|
||||
public ProtoId<ReagentPrototype> Reagent;
|
||||
@@ -19,32 +21,10 @@ public sealed partial class AdjustReagentGaussian : EntityEffect
|
||||
[DataField(required: true)]
|
||||
public double σ;
|
||||
|
||||
public override void Effect(EntityEffectBaseArgs args)
|
||||
{
|
||||
if (args is not EntityEffectReagentArgs reagentArgs)
|
||||
throw new NotImplementedException();
|
||||
|
||||
if (reagentArgs.Source == null)
|
||||
return;
|
||||
|
||||
var timing = IoCManager.Resolve<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)
|
||||
public override string? EntityEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys)
|
||||
{
|
||||
var proto = prototype.Index(Reagent);
|
||||
return Loc.GetString("reagent-effect-guidebook-adjust-reagent-gaussian",
|
||||
return Loc.GetString("entity-effect-guidebook-adjust-reagent-gaussian",
|
||||
("chance", Probability),
|
||||
("deltasign", Math.Sign(μ)),
|
||||
("reagent", proto.LocalizedName),
|
||||
@@ -52,3 +32,25 @@ public sealed partial class AdjustReagentGaussian : EntityEffect
|
||||
("sigma", Math.Abs(σ)));
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class AdjustReagentGaussianEntityEffectSystem : EntityEffectSystem<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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,19 @@
|
||||
using Content.Shared._Offbrand.Wounds;
|
||||
using Content.Shared.EntityEffects;
|
||||
using Content.Shared.EntityConditions;
|
||||
using Content.Shared.FixedPoint;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Shared._Offbrand.EntityEffects;
|
||||
|
||||
public sealed partial class BrainDamage : EntityEffectCondition
|
||||
public sealed class BrainDamageEntityConditionSystem : EntityConditionSystem<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]
|
||||
public FixedPoint2 Max = FixedPoint2.MaxValue;
|
||||
@@ -13,19 +21,9 @@ public sealed partial class BrainDamage : EntityEffectCondition
|
||||
[DataField]
|
||||
public FixedPoint2 Min = FixedPoint2.Zero;
|
||||
|
||||
public override bool Condition(EntityEffectBaseArgs args)
|
||||
public override string EntityConditionGuidebookText(IPrototypeManager prototype)
|
||||
{
|
||||
if (args.EntityManager.TryGetComponent<BrainDamageComponent>(args.TargetEntity, out var brain))
|
||||
{
|
||||
return brain.Damage >= Min && brain.Damage <= Max;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public override string GuidebookExplanation(IPrototypeManager prototype)
|
||||
{
|
||||
return Loc.GetString("reagent-effect-condition-guidebook-brain-damage",
|
||||
return Loc.GetString("entity-condition-guidebook-brain-damage",
|
||||
("max", Max == FixedPoint2.MaxValue ? (float) int.MaxValue : Max.Float()),
|
||||
("min", Min.Float()));
|
||||
}
|
||||
|
||||
@@ -5,19 +5,23 @@ using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Shared._Offbrand.EntityEffects;
|
||||
|
||||
public sealed partial class ClampWounds : EntityEffect
|
||||
public sealed partial class ClampWounds : EntityEffectBase<ClampWounds>
|
||||
{
|
||||
[DataField(required: true)]
|
||||
public float Chance;
|
||||
|
||||
protected override string ReagentEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys)
|
||||
public override string? EntityEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys)
|
||||
{
|
||||
return Loc.GetString("reagent-effect-guidebook-clamp-wounds", ("probability", Probability), ("chance", Chance));
|
||||
}
|
||||
|
||||
public override void Effect(EntityEffectBaseArgs args)
|
||||
{
|
||||
args.EntityManager.System<WoundableSystem>()
|
||||
.ClampWounds(args.TargetEntity, Chance);
|
||||
return Loc.GetString("entity-effect-guidebook-clamp-wounds", ("probability", Probability), ("chance", Chance));
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class ClampWoundsEntityEffectSystem : EntityEffectSystem<WoundableComponent, ClampWounds>
|
||||
{
|
||||
[Dependency] private readonly WoundableSystem _woundable = default!;
|
||||
|
||||
protected override void Effect(Entity<WoundableComponent> ent, ref EntityEffectEvent<ClampWounds> args)
|
||||
{
|
||||
_woundable.ClampWounds(ent, args.Effect.Chance);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
using Content.Shared._Offbrand.Wounds;
|
||||
using Content.Shared.EntityEffects;
|
||||
using Content.Shared.EntityConditions;
|
||||
using Content.Shared.FixedPoint;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Shared._Offbrand.EntityEffects;
|
||||
|
||||
public sealed partial class HeartDamage : EntityEffectCondition
|
||||
public sealed partial class HeartDamageCondition : EntityConditionBase<HeartDamageCondition>
|
||||
{
|
||||
[DataField]
|
||||
public FixedPoint2 Max = FixedPoint2.MaxValue;
|
||||
@@ -13,20 +13,18 @@ public sealed partial class HeartDamage : EntityEffectCondition
|
||||
[DataField]
|
||||
public FixedPoint2 Min = FixedPoint2.Zero;
|
||||
|
||||
public override bool Condition(EntityEffectBaseArgs args)
|
||||
{
|
||||
if (args.EntityManager.TryGetComponent<HeartrateComponent>(args.TargetEntity, out var heartrate))
|
||||
{
|
||||
return heartrate.Damage >= Min && heartrate.Damage <= Max;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public override string GuidebookExplanation(IPrototypeManager prototype)
|
||||
public override string EntityConditionGuidebookText(IPrototypeManager prototype)
|
||||
{
|
||||
return Loc.GetString("reagent-effect-condition-guidebook-heart-damage",
|
||||
("max", Max == FixedPoint2.MaxValue ? (float) int.MaxValue : Max.Float()),
|
||||
("min", Min.Float()));
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class HeartDamageEntityConditionSystem : EntityConditionSystem<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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
using Content.Shared.EntityEffects;
|
||||
using Content.Shared.EntityConditions;
|
||||
using Content.Shared.Zombies;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Shared._Offbrand.EntityEffects;
|
||||
|
||||
public sealed partial class IsZombie : EntityEffectCondition
|
||||
public sealed partial class IsZombieCondition : EntityConditionBase<IsZombieCondition>
|
||||
{
|
||||
[DataField]
|
||||
public bool Invert = false;
|
||||
|
||||
public override bool Condition(EntityEffectBaseArgs args)
|
||||
public override string EntityConditionGuidebookText(IPrototypeManager prototype)
|
||||
{
|
||||
return args.EntityManager.HasComponent<ZombieComponent>(args.TargetEntity) ^ Invert;
|
||||
}
|
||||
|
||||
public override string GuidebookExplanation(IPrototypeManager prototype)
|
||||
{
|
||||
return Loc.GetString("reagent-effect-condition-guidebook-is-zombie", ("invert", Invert));
|
||||
return Loc.GetString("entity-condition-guidebook-is-zombie", ("invert", Inverted));
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class IsZombieConditionEntitySystem : EntityConditionSystem<MetaDataComponent, IsZombieCondition>
|
||||
{
|
||||
protected override void Condition(Entity<MetaDataComponent> ent, ref EntityConditionEvent<IsZombieCondition> args)
|
||||
{
|
||||
args.Result = HasComp<ZombieComponent>(ent);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
using Content.Shared.EntityEffects;
|
||||
using Content.Shared.EntityConditions;
|
||||
using Content.Shared.Zombies;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Shared._Offbrand.EntityEffects;
|
||||
|
||||
public sealed partial class IsZombieImmune : EntityEffectCondition
|
||||
public sealed partial class IsZombieImmuneCondition : EntityConditionBase<IsZombieImmuneCondition>
|
||||
{
|
||||
[DataField]
|
||||
public bool Invert = false;
|
||||
|
||||
public override bool Condition(EntityEffectBaseArgs args)
|
||||
public override string EntityConditionGuidebookText(IPrototypeManager prototype)
|
||||
{
|
||||
return args.EntityManager.HasComponent<ZombieImmuneComponent>(args.TargetEntity) ^ Invert;
|
||||
}
|
||||
|
||||
public override string GuidebookExplanation(IPrototypeManager prototype)
|
||||
{
|
||||
return Loc.GetString("reagent-effect-condition-guidebook-is-zombie-immune", ("invert", Invert));
|
||||
return Loc.GetString("entity-condition-guidebook-is-zombie-immune", ("invert", Inverted));
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class IsZombieImmuneConditionEntitySystem : EntityConditionSystem<MetaDataComponent, IsZombieImmuneCondition>
|
||||
{
|
||||
protected override void Condition(Entity<MetaDataComponent> ent, ref EntityConditionEvent<IsZombieImmuneCondition> args)
|
||||
{
|
||||
args.Result = HasComp<ZombieImmuneComponent>(ent) ^ args.Condition.Invert;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
using Content.Shared._Offbrand.Wounds;
|
||||
using Content.Shared.EntityEffects;
|
||||
using Content.Shared.EntityConditions;
|
||||
using Content.Shared.FixedPoint;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Shared._Offbrand.EntityEffects;
|
||||
|
||||
public sealed partial class LungDamage : EntityEffectCondition
|
||||
public sealed partial class LungDamageCondition : EntityConditionBase<LungDamageCondition>
|
||||
{
|
||||
[DataField]
|
||||
public FixedPoint2 Max = FixedPoint2.MaxValue;
|
||||
@@ -13,20 +13,18 @@ public sealed partial class LungDamage : EntityEffectCondition
|
||||
[DataField]
|
||||
public FixedPoint2 Min = FixedPoint2.Zero;
|
||||
|
||||
public override bool Condition(EntityEffectBaseArgs args)
|
||||
public override string EntityConditionGuidebookText(IPrototypeManager prototype)
|
||||
{
|
||||
if (args.EntityManager.TryGetComponent<LungDamageComponent>(args.TargetEntity, out var lungDamage))
|
||||
{
|
||||
return lungDamage.Damage >= Min && lungDamage.Damage <= Max;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public override string GuidebookExplanation(IPrototypeManager prototype)
|
||||
{
|
||||
return Loc.GetString("reagent-effect-condition-guidebook-lung-damage",
|
||||
return Loc.GetString("entity-condition-guidebook-lung-damage",
|
||||
("max", Max == FixedPoint2.MaxValue ? (float) int.MaxValue : Max.Float()),
|
||||
("min", Min.Float()));
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class LungDamageConditionEntitySystem : EntityConditionSystem<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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
using Content.Shared.Chemistry.Reagent;
|
||||
using Content.Shared.EntityConditions;
|
||||
using Content.Shared.FixedPoint;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Content.Shared.EntityEffects;
|
||||
|
||||
namespace Content.Shared._Offbrand.EntityEffects;
|
||||
|
||||
public sealed partial class MetaboliteThreshold : EventEntityEffectCondition<MetaboliteThreshold>
|
||||
public sealed partial class MetaboliteThresholdCondition : EntityConditionBase<MetaboliteThresholdCondition>
|
||||
{
|
||||
[DataField]
|
||||
public FixedPoint2 Min = FixedPoint2.Zero;
|
||||
@@ -13,29 +13,27 @@ public sealed partial class MetaboliteThreshold : EventEntityEffectCondition<Met
|
||||
[DataField]
|
||||
public FixedPoint2 Max = FixedPoint2.MaxValue;
|
||||
|
||||
[DataField]
|
||||
public ProtoId<ReagentPrototype>? Reagent;
|
||||
[DataField(required: true)]
|
||||
public ProtoId<ReagentPrototype> Reagent;
|
||||
|
||||
[DataField]
|
||||
public bool IncludeBloodstream = true;
|
||||
|
||||
public override string GuidebookExplanation(IPrototypeManager prototype)
|
||||
public override string EntityConditionGuidebookText(IPrototypeManager prototype)
|
||||
{
|
||||
ReagentPrototype? reagentProto = null;
|
||||
if (Reagent is { } reagent)
|
||||
prototype.TryIndex(reagent, out reagentProto);
|
||||
var reagentProto = prototype.Index(Reagent);
|
||||
|
||||
if (IncludeBloodstream)
|
||||
{
|
||||
return Loc.GetString("reagent-effect-condition-guidebook-total-dosage-threshold",
|
||||
("reagent", reagentProto?.LocalizedName ?? Loc.GetString("reagent-effect-condition-guidebook-this-reagent")),
|
||||
return Loc.GetString("entity-condition-guidebook-total-dosage-threshold",
|
||||
("reagent", reagentProto.LocalizedName),
|
||||
("max", Max == FixedPoint2.MaxValue ? (float) int.MaxValue : Max.Float()),
|
||||
("min", Min.Float()));
|
||||
}
|
||||
else
|
||||
{
|
||||
return Loc.GetString("reagent-effect-condition-guidebook-metabolite-threshold",
|
||||
("reagent", reagentProto?.LocalizedName ?? Loc.GetString("reagent-effect-condition-guidebook-this-metabolite")),
|
||||
return Loc.GetString("entity-condition-guidebook-metabolite-threshold",
|
||||
("reagent", reagentProto.LocalizedName ?? Loc.GetString("entity-condition-guidebook-this-metabolite")),
|
||||
("max", Max == FixedPoint2.MaxValue ? (float) int.MaxValue : Max.Float()),
|
||||
("min", Min.Float()));
|
||||
}
|
||||
|
||||
@@ -5,27 +5,26 @@ using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Shared._Offbrand.EntityEffects;
|
||||
|
||||
public sealed partial class ModifyBrainDamage : EntityEffect
|
||||
public sealed partial class ModifyBrainDamage : EntityEffectBase<ModifyBrainDamage>
|
||||
{
|
||||
[DataField(required: true)]
|
||||
public FixedPoint2 Amount;
|
||||
|
||||
protected override string ReagentEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys)
|
||||
public override string? EntityEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys)
|
||||
{
|
||||
if (Amount < FixedPoint2.Zero)
|
||||
return Loc.GetString("reagent-effect-guidebook-modify-brain-damage-heals", ("chance", Probability), ("amount", -Amount));
|
||||
return Loc.GetString("entity-effect-guidebook-modify-brain-damage-heals", ("chance", Probability), ("amount", -Amount));
|
||||
else
|
||||
return Loc.GetString("reagent-effect-guidebook-modify-brain-damage-deals", ("chance", Probability), ("amount", Amount));
|
||||
}
|
||||
|
||||
public override void Effect(EntityEffectBaseArgs args)
|
||||
{
|
||||
var scale = FixedPoint2.New(1);
|
||||
|
||||
if (args is EntityEffectReagentArgs reagentArgs)
|
||||
scale = reagentArgs.Scale;
|
||||
|
||||
args.EntityManager.System<BrainDamageSystem>()
|
||||
.TryChangeBrainDamage(args.TargetEntity, Amount * scale);
|
||||
return Loc.GetString("entity-effect-guidebook-modify-brain-damage-deals", ("chance", Probability), ("amount", Amount));
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class ModifyBrainDamageEntityEffectSystem : EntityEffectSystem<BrainDamageComponent, ModifyBrainDamage>
|
||||
{
|
||||
[Dependency] private readonly BrainDamageSystem _brainDamage = default!;
|
||||
|
||||
protected override void Effect(Entity<BrainDamageComponent> ent, ref EntityEffectEvent<ModifyBrainDamage> args)
|
||||
{
|
||||
_brainDamage.TryChangeBrainDamage(ent.AsNullable(), args.Effect.Amount * args.Scale);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,27 +5,26 @@ using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Shared._Offbrand.EntityEffects;
|
||||
|
||||
public sealed partial class ModifyBrainOxygen : EntityEffect
|
||||
public sealed partial class ModifyBrainOxygen : EntityEffectBase<ModifyBrainOxygen>
|
||||
{
|
||||
[DataField(required: true)]
|
||||
public FixedPoint2 Amount;
|
||||
|
||||
protected override string ReagentEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys)
|
||||
public override string? EntityEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys)
|
||||
{
|
||||
if (Amount > FixedPoint2.Zero)
|
||||
return Loc.GetString("reagent-effect-guidebook-modify-brain-oxygen-heals", ("chance", Probability), ("amount", Amount));
|
||||
return Loc.GetString("entity-effect-guidebook-modify-brain-oxygen-heals", ("chance", Probability), ("amount", Amount));
|
||||
else
|
||||
return Loc.GetString("reagent-effect-guidebook-modify-brain-oxygen-deals", ("chance", Probability), ("amount", -Amount));
|
||||
}
|
||||
|
||||
public override void Effect(EntityEffectBaseArgs args)
|
||||
{
|
||||
var scale = FixedPoint2.New(1);
|
||||
|
||||
if (args is EntityEffectReagentArgs reagentArgs)
|
||||
scale = reagentArgs.Scale;
|
||||
|
||||
args.EntityManager.System<BrainDamageSystem>()
|
||||
.TryChangeBrainOxygenation(args.TargetEntity, Amount * scale);
|
||||
return Loc.GetString("entity-effect-guidebook-modify-brain-oxygen-deals", ("chance", Probability), ("amount", -Amount));
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class ModifyBrainOxygenEntityEffectSystem : EntityEffectSystem<BrainDamageComponent, ModifyBrainOxygen>
|
||||
{
|
||||
[Dependency] private readonly BrainDamageSystem _brainDamage = default!;
|
||||
|
||||
protected override void Effect(Entity<BrainDamageComponent> ent, ref EntityEffectEvent<ModifyBrainOxygen> args)
|
||||
{
|
||||
_brainDamage.TryChangeBrainOxygenation(ent, args.Effect.Amount * args.Scale);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,27 +5,26 @@ using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Shared._Offbrand.EntityEffects;
|
||||
|
||||
public sealed partial class ModifyHeartDamage : EntityEffect
|
||||
public sealed partial class ModifyHeartDamage : EntityEffectBase<ModifyHeartDamage>
|
||||
{
|
||||
[DataField(required: true)]
|
||||
public FixedPoint2 Amount;
|
||||
|
||||
protected override string ReagentEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys)
|
||||
public override string? EntityEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys)
|
||||
{
|
||||
if (Amount < FixedPoint2.Zero)
|
||||
return Loc.GetString("reagent-effect-guidebook-modify-heart-damage-heals", ("chance", Probability), ("amount", -Amount));
|
||||
return Loc.GetString("entity-effect-guidebook-modify-heart-damage-heals", ("chance", Probability), ("amount", -Amount));
|
||||
else
|
||||
return Loc.GetString("reagent-effect-guidebook-modify-heart-damage-deals", ("chance", Probability), ("amount", Amount));
|
||||
}
|
||||
|
||||
public override void Effect(EntityEffectBaseArgs args)
|
||||
{
|
||||
var scale = FixedPoint2.New(1);
|
||||
|
||||
if (args is EntityEffectReagentArgs reagentArgs)
|
||||
scale = reagentArgs.Scale;
|
||||
|
||||
args.EntityManager.System<HeartSystem>()
|
||||
.ChangeHeartDamage(args.TargetEntity, Amount * scale);
|
||||
return Loc.GetString("entity-effect-guidebook-modify-heart-damage-deals", ("chance", Probability), ("amount", Amount));
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class ModifyHeartDamageEntityEffectSystem : EntityEffectSystem<HeartrateComponent, ModifyHeartDamage>
|
||||
{
|
||||
[Dependency] private readonly HeartSystem _heart = default!;
|
||||
|
||||
protected override void Effect(Entity<HeartrateComponent> ent, ref EntityEffectEvent<ModifyHeartDamage> args)
|
||||
{
|
||||
_heart.ChangeHeartDamage(ent.AsNullable(), args.Effect.Amount * args.Scale);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,27 +5,26 @@ using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Shared._Offbrand.EntityEffects;
|
||||
|
||||
public sealed partial class ModifyLungDamage : EntityEffect
|
||||
public sealed partial class ModifyLungDamage : EntityEffectBase<ModifyLungDamage>
|
||||
{
|
||||
[DataField(required: true)]
|
||||
public FixedPoint2 Amount;
|
||||
|
||||
protected override string ReagentEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys)
|
||||
public override string? EntityEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys)
|
||||
{
|
||||
if (Amount < FixedPoint2.Zero)
|
||||
return Loc.GetString("reagent-effect-guidebook-modify-lung-damage-heals", ("chance", Probability), ("amount", -Amount));
|
||||
return Loc.GetString("entity-effect-guidebook-modify-lung-damage-heals", ("chance", Probability), ("amount", -Amount));
|
||||
else
|
||||
return Loc.GetString("reagent-effect-guidebook-modify-lung-damage-deals", ("chance", Probability), ("amount", Amount));
|
||||
}
|
||||
|
||||
public override void Effect(EntityEffectBaseArgs args)
|
||||
{
|
||||
var scale = FixedPoint2.New(1);
|
||||
|
||||
if (args is EntityEffectReagentArgs reagentArgs)
|
||||
scale = reagentArgs.Scale;
|
||||
|
||||
args.EntityManager.System<LungDamageSystem>()
|
||||
.TryModifyDamage(args.TargetEntity, Amount * scale);
|
||||
return Loc.GetString("entity-effect-guidebook-modify-lung-damage-deals", ("chance", Probability), ("amount", Amount));
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class ModifyLungDamageEntityEffectSystem : EntityEffectSystem<LungDamageComponent, ModifyLungDamage>
|
||||
{
|
||||
[Dependency] private readonly LungDamageSystem _lungDamage = default!;
|
||||
|
||||
protected override void Effect(Entity<LungDamageComponent> ent, ref EntityEffectEvent<ModifyLungDamage> args)
|
||||
{
|
||||
_lungDamage.TryModifyDamage(ent.AsNullable(), args.Effect.Amount * args.Scale);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,24 +1,29 @@
|
||||
using Content.Shared.EntityEffects;
|
||||
using Content.Shared.StatusEffectNew.Components;
|
||||
using Content.Shared.StatusEffectNew;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Shared._Offbrand.EntityEffects;
|
||||
|
||||
public sealed partial class RemoveStatusEffect : EntityEffect
|
||||
public sealed partial class RemoveStatusEffect : EntityEffectBase<RemoveStatusEffect>
|
||||
{
|
||||
[DataField(required: true)]
|
||||
public EntProtoId EffectProto;
|
||||
|
||||
public override void Effect(EntityEffectBaseArgs args)
|
||||
{
|
||||
args.EntityManager.System<StatusEffectsSystem>()
|
||||
.TryRemoveStatusEffect(args.TargetEntity, EffectProto);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override string? ReagentEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys) =>
|
||||
public override string? EntityEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys) =>
|
||||
Loc.GetString(
|
||||
"reagent-effect-guidebook-status-effect-remove",
|
||||
"entity-effect-guidebook-status-effect-remove",
|
||||
("chance", Probability),
|
||||
("key", prototype.Index(EffectProto).Name));
|
||||
}
|
||||
|
||||
public sealed class RemoveStatusEffectEntityEffectSystem : EntityEffectSystem<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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,16 +4,20 @@ using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Shared._Offbrand.EntityEffects;
|
||||
|
||||
public sealed partial class StartHeart : EntityEffect
|
||||
public sealed partial class StartHeart : EntityEffectBase<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));
|
||||
}
|
||||
|
||||
public override void Effect(EntityEffectBaseArgs args)
|
||||
{
|
||||
args.EntityManager.System<HeartSystem>()
|
||||
.TryRestartHeart(args.TargetEntity);
|
||||
return Loc.GetString("entity-effect-guidebook-start-heart", ("chance", Probability));
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class StartHeartEntityEffectSystem : EntityEffectSystem<HeartrateComponent, StartHeart>
|
||||
{
|
||||
[Dependency] private readonly HeartSystem _heart = default!;
|
||||
|
||||
protected override void Effect(Entity<HeartrateComponent> ent, ref EntityEffectEvent<StartHeart> args)
|
||||
{
|
||||
_heart.TryRestartHeart(ent.AsNullable());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
}
|
||||
@@ -3,8 +3,8 @@ using Robust.Shared.Prototypes;
|
||||
|
||||
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)
|
||||
=> Loc.GetString("reagent-effect-guidebook-zombify", ("chance", Probability));
|
||||
public override string? EntityEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys)
|
||||
=> Loc.GetString("entity-effect-guidebook-zombify", ("chance", Probability));
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ public sealed class CauseStatusEffectRandomlyStatusEffectSystem : EntitySystem
|
||||
randomEffects.NextUpdate = _timing.CurTime + randomEffects.UpdateInterval;
|
||||
Dirty(uid, randomEffects);
|
||||
|
||||
var seed = SharedRandomExtensions.HashCodeCombine(new() { (int)_timing.CurTick.Value, GetNetEntity(uid).Id });
|
||||
var seed = SharedRandomExtensions.HashCodeCombine((int)_timing.CurTick.Value, GetNetEntity(uid).Id);
|
||||
var rand = new System.Random(seed);
|
||||
|
||||
if (!rand.Prob(randomEffects.Probability))
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Content.Shared.Damage.Systems;
|
||||
using Content.Shared.Damage;
|
||||
using Content.Shared.StatusEffectNew.Components;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
using Content.Shared.CombatMode;
|
||||
using Content.Shared.Damage;
|
||||
using Content.Shared.Damage.Systems;
|
||||
using Content.Shared.Mobs.Components;
|
||||
using Content.Shared.StatusEffectNew.Components;
|
||||
using Content.Shared.StatusEffectNew;
|
||||
|
||||
@@ -38,7 +38,7 @@ public sealed class GunBackfireStatusEffectSystem : EntitySystem
|
||||
if (args.Args.Cancelled)
|
||||
return;
|
||||
|
||||
var seed = SharedRandomExtensions.HashCodeCombine(new() { (int)_timing.CurTick.Value, GetNetEntity(args.Args.Gun).Id });
|
||||
var seed = SharedRandomExtensions.HashCodeCombine((int)_timing.CurTick.Value, GetNetEntity(args.Args.Gun).Id);
|
||||
var rand = new System.Random(seed);
|
||||
if (!rand.Prob(ent.Comp.Probability))
|
||||
return;
|
||||
|
||||
@@ -32,7 +32,7 @@ public sealed class HyposprayBackfireStatusEffectSystem : EntitySystem
|
||||
if (args.Args.TargetGettingInjected == args.Args.EntityUsingHypospray)
|
||||
return;
|
||||
|
||||
var seed = SharedRandomExtensions.HashCodeCombine(new() { (int)_timing.CurTick.Value, GetNetEntity(ent).Id });
|
||||
var seed = SharedRandomExtensions.HashCodeCombine((int)_timing.CurTick.Value, GetNetEntity(ent).Id);
|
||||
var rand = new System.Random(seed);
|
||||
if (!rand.Prob(ent.Comp.Probability))
|
||||
return;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using Content.Shared.Damage;
|
||||
using Content.Shared.Damage.Systems;
|
||||
using Content.Shared.Movement.Systems;
|
||||
using Content.Shared.StatusEffectNew;
|
||||
|
||||
|
||||
@@ -88,9 +88,9 @@ public sealed class TriggerOnDoAfterSystem : EntitySystem
|
||||
{
|
||||
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;
|
||||
}
|
||||
else
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
using Content.Shared.Damage.Components;
|
||||
using Content.Shared.Damage.Systems;
|
||||
using Content.Shared.Damage;
|
||||
using Content.Shared.FixedPoint;
|
||||
|
||||
|
||||
@@ -121,11 +121,9 @@ public sealed partial class BrainDamageSystem : EntitySystem
|
||||
var overlays = new PotentiallyUpdateDamageOverlayEvent(ent);
|
||||
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);
|
||||
Dirty(ent);
|
||||
|
||||
@@ -229,7 +227,7 @@ public sealed partial class BrainDamageSystem : EntitySystem
|
||||
{
|
||||
var oxygenation = _heart.Spo2((ent.Owner, ent.Comp3));
|
||||
|
||||
var seed = SharedRandomExtensions.HashCodeCombine(new() { (int)_timing.CurTick.Value, GetNetEntity(ent).Id });
|
||||
var seed = SharedRandomExtensions.HashCodeCombine((int)_timing.CurTick.Value, GetNetEntity(ent).Id);
|
||||
var rand = new System.Random(seed);
|
||||
|
||||
DoOxygen(ent, oxygenation, rand);
|
||||
|
||||
@@ -54,7 +54,7 @@ public sealed class CprSystem : EntitySystem
|
||||
{
|
||||
_statusEffects.TryAddStatusEffectDuration(ent, ent.Comp.Effect, ent.Comp.EffectDuration);
|
||||
|
||||
var seed = SharedRandomExtensions.HashCodeCombine(new() { (int)_timing.CurTick.Value, GetNetEntity(ent).Id });
|
||||
var seed = SharedRandomExtensions.HashCodeCombine((int)_timing.CurTick.Value, GetNetEntity(ent).Id);
|
||||
var rand = new System.Random(seed);
|
||||
|
||||
if (rand.Prob(ent.Comp.WoundProbability) && TryComp<WoundableComponent>(ent, out var woundable))
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
using Content.Server.Temperature.Components;
|
||||
using Content.Shared._Offbrand.Wounds;
|
||||
using Content.Shared.Body.Events;
|
||||
using Content.Shared.Body.Systems;
|
||||
using Content.Shared.Medical.Cryogenics;
|
||||
using Content.Shared.Temperature.Components;
|
||||
using Content.Shared.Temperature;
|
||||
|
||||
namespace Content.Server._Offbrand.Wounds;
|
||||
@@ -1,3 +1,5 @@
|
||||
using Content.Shared.Damage.Components;
|
||||
using Content.Shared.Damage.Systems;
|
||||
using Content.Shared.Damage;
|
||||
using Content.Shared.FixedPoint;
|
||||
|
||||
|
||||
@@ -89,7 +89,7 @@ public sealed partial class HeartSystem : EntitySystem
|
||||
var threshold = heartrate.StrainDamageThresholds.HighestMatch(Strain((uid, heartrate)));
|
||||
if (threshold is (var chance, var amount))
|
||||
{
|
||||
var seed = SharedRandomExtensions.HashCodeCombine(new() { (int)_timing.CurTick.Value, GetNetEntity(uid).Id });
|
||||
var seed = SharedRandomExtensions.HashCodeCombine((int)_timing.CurTick.Value, GetNetEntity(uid).Id);
|
||||
var rand = new System.Random(seed);
|
||||
|
||||
if (rand.Prob(chance))
|
||||
@@ -151,7 +151,7 @@ public sealed partial class HeartSystem : EntitySystem
|
||||
|
||||
private void OnHeartBeatStrain(Entity<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);
|
||||
|
||||
if (_statusEffects.HasEffectComp<PreventHeartStopFromStrainStatusEffectComponent>(ent))
|
||||
@@ -316,7 +316,7 @@ public sealed partial class HeartSystem : EntitySystem
|
||||
if (!ent.Comp.Running)
|
||||
return 0;
|
||||
|
||||
var seed = SharedRandomExtensions.HashCodeCombine(new() { (int)_timing.CurTick.Value, GetNetEntity(ent).Id });
|
||||
var seed = SharedRandomExtensions.HashCodeCombine((int)_timing.CurTick.Value, GetNetEntity(ent).Id);
|
||||
var rand = new System.Random(seed);
|
||||
|
||||
var deviation = rand.Next(-ent.Comp.HeartRateDeviation, ent.Comp.HeartRateDeviation);
|
||||
@@ -326,7 +326,7 @@ public sealed partial class HeartSystem : EntitySystem
|
||||
|
||||
public (int, int) BloodPressure(Entity<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 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)
|
||||
{
|
||||
var seed = SharedRandomExtensions.HashCodeCombine(new() { (int)_timing.CurTick.Value, GetNetEntity(ent).Id });
|
||||
var seed = SharedRandomExtensions.HashCodeCombine((int)_timing.CurTick.Value, GetNetEntity(ent).Id);
|
||||
var rand = new System.Random(seed);
|
||||
|
||||
var deviation = rand.Next(-ent.Comp.Etco2Deviation, ent.Comp.Etco2Deviation);
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using Content.Shared.Damage.Components;
|
||||
using Content.Shared.Damage;
|
||||
|
||||
namespace Content.Shared._Offbrand.Wounds;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Content.Shared.Alert;
|
||||
using Content.Shared.Damage.Components;
|
||||
using Content.Shared.Damage;
|
||||
using Content.Shared.FixedPoint;
|
||||
using Content.Shared.Rejuvenate;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using Content.Server.Temperature.Components;
|
||||
using Content.Shared.Temperature.Components;
|
||||
using Content.Shared._Offbrand.Wounds;
|
||||
|
||||
namespace Content.Server._Offbrand.Wounds;
|
||||
namespace Content.Shared._Offbrand.Wounds;
|
||||
|
||||
public sealed class LungDamageTemperatureSystem : EntitySystem
|
||||
{
|
||||
@@ -1,3 +1,4 @@
|
||||
using Content.Shared.Damage.Components;
|
||||
using Content.Shared.Damage;
|
||||
using Content.Shared.FixedPoint;
|
||||
using Robust.Shared.Timing;
|
||||
|
||||
@@ -141,9 +141,9 @@ public sealed class TendingSystem : EntitySystem
|
||||
var hasMoreItems = true;
|
||||
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;
|
||||
}
|
||||
else
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
using Content.Shared.Damage.Components;
|
||||
using Content.Shared.Damage.Systems;
|
||||
using Content.Shared.Damage;
|
||||
using Content.Shared.Random.Helpers;
|
||||
using Robust.Shared.Random;
|
||||
@@ -22,7 +24,7 @@ public sealed partial class UniqueWoundOnDamageSystem : EntitySystem
|
||||
if (args.DamageDelta is not { } delta || !args.DamageIncreased)
|
||||
return;
|
||||
|
||||
var seed = SharedRandomExtensions.HashCodeCombine(new() { (int)_timing.CurTick.Value, GetNetEntity(ent).Id });
|
||||
var seed = SharedRandomExtensions.HashCodeCombine((int)_timing.CurTick.Value, GetNetEntity(ent).Id);
|
||||
var rand = new System.Random(seed);
|
||||
|
||||
var damageable = Comp<DamageableComponent>(ent);
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
using System.Linq;
|
||||
using Content.Shared.Body.Systems;
|
||||
using Content.Shared.Damage.Components;
|
||||
using Content.Shared.Damage.Prototypes;
|
||||
using Content.Shared.Damage.Systems;
|
||||
using Content.Shared.Damage;
|
||||
using Content.Shared.FixedPoint;
|
||||
using Content.Shared.HealthExaminable;
|
||||
@@ -199,7 +201,7 @@ public sealed class WoundableSystem : EntitySystem
|
||||
if (ent.Comp.Damage.Empty)
|
||||
return;
|
||||
|
||||
_damageable.TryChangeDamage(args.Target, -ent.Comp.Damage.ToSpecifier(), true, false, null, null, forceRefresh: true);
|
||||
_damageable.TryChangeDamage(args.Target, -ent.Comp.Damage.ToSpecifier(), true, false, forceRefresh: true);
|
||||
ValidateWounds(args.Target, null);
|
||||
}
|
||||
|
||||
@@ -260,7 +262,7 @@ public sealed class WoundableSystem : EntitySystem
|
||||
comp.CreatedAt = _timing.CurTime;
|
||||
|
||||
if (refreshDamage)
|
||||
_damageable.TryChangeDamage(ent.Owner, new(), true, true, null, null, forceRefresh: true);
|
||||
_damageable.TryChangeDamage(ent.Owner, new(), true, true, null, forceRefresh: true);
|
||||
|
||||
Dirty(wound.Value, comp);
|
||||
return true;
|
||||
@@ -350,7 +352,7 @@ public sealed class WoundableSystem : EntitySystem
|
||||
return bleedAddition * ratio;
|
||||
}
|
||||
|
||||
public void ClampWounds(Entity<WoundableComponent?> ent, float probability)
|
||||
public void ClampWounds(Entity<WoundableComponent> ent, float probability)
|
||||
{
|
||||
var evt = new ClampWoundsEvent(probability);
|
||||
RaiseLocalEvent(ent, ref evt);
|
||||
@@ -361,7 +363,7 @@ public sealed class WoundableSystem : EntitySystem
|
||||
if (ent.Comp.Clamped)
|
||||
return;
|
||||
|
||||
var seed = SharedRandomExtensions.HashCodeCombine(new() { (int)_timing.CurTick.Value, GetNetEntity(ent).Id });
|
||||
var seed = SharedRandomExtensions.HashCodeCombine((int)_timing.CurTick.Value, GetNetEntity(ent).Id);
|
||||
var rand = new System.Random(seed);
|
||||
|
||||
if (!rand.Prob(args.Args.Probability))
|
||||
@@ -455,8 +457,8 @@ public sealed class WoundableSystem : EntitySystem
|
||||
changeBy.TrimZeros();
|
||||
if (changeBy.AnyNegative())
|
||||
{
|
||||
var actualDelta = _damageable.TryChangeDamage(woundable, changeBy, true, false, null, null, forceRefresh: true);
|
||||
DebugTools.Assert(actualDelta is not null);
|
||||
var actualDelta = _damageable.ChangeDamage(woundable.Owner, changeBy, true, false, null, forceRefresh: true);
|
||||
DebugTools.Assert(!actualDelta.Empty);
|
||||
DebugTools.Assert(changeBy.Equals(actualDelta!), $"{changeBy} == {actualDelta!}");
|
||||
}
|
||||
|
||||
|
||||
@@ -3,86 +3,86 @@ reagent-guidebook-status-effect = Causes { $effect } during metabolism{ $conditi
|
||||
*[other] {" "}when { $conditions }.
|
||||
}
|
||||
|
||||
reagent-effect-guidebook-status-effect-remove = { $chance ->
|
||||
entity-effect-guidebook-status-effect-remove = { $chance ->
|
||||
[1] Removes { LOC($key) }
|
||||
*[other] remove { LOC($key) }
|
||||
}
|
||||
|
||||
reagent-effect-guidebook-modify-brain-damage-heals = { $chance ->
|
||||
entity-effect-guidebook-modify-brain-damage-heals = { $chance ->
|
||||
[1] Heals { $amount } brain activity
|
||||
*[other] heal { $amount } brain activity
|
||||
}
|
||||
reagent-effect-guidebook-modify-brain-damage-deals = { $chance ->
|
||||
entity-effect-guidebook-modify-brain-damage-deals = { $chance ->
|
||||
[1] Deals { $amount } brain damage
|
||||
*[other] deal { $amount } brain damage
|
||||
}
|
||||
reagent-effect-guidebook-modify-heart-damage-heals = { $chance ->
|
||||
entity-effect-guidebook-modify-heart-damage-heals = { $chance ->
|
||||
[1] Heals { $amount } heart health
|
||||
*[other] heal { $amount } heart health
|
||||
}
|
||||
reagent-effect-guidebook-modify-heart-damage-deals = { $chance ->
|
||||
entity-effect-guidebook-modify-heart-damage-deals = { $chance ->
|
||||
[1] Deals { $amount } heart damage
|
||||
*[other] deal { $amount } heart damage
|
||||
}
|
||||
reagent-effect-guidebook-modify-lung-damage-heals = { $chance ->
|
||||
entity-effect-guidebook-modify-lung-damage-heals = { $chance ->
|
||||
[1] Heals { $amount } lung health
|
||||
*[other] heal { $amount } lung health
|
||||
}
|
||||
reagent-effect-guidebook-modify-lung-damage-deals = { $chance ->
|
||||
entity-effect-guidebook-modify-lung-damage-deals = { $chance ->
|
||||
[1] Deals { $amount } lung damage
|
||||
*[other] deal { $amount } lung damage
|
||||
}
|
||||
reagent-effect-guidebook-clamp-wounds = { $probability ->
|
||||
entity-effect-guidebook-clamp-wounds = { $probability ->
|
||||
[1] Stops bleeding in wounds with { NATURALPERCENT($chance, 2) } chance per wound
|
||||
*[other] stop bleeding in wounds with { NATURALPERCENT($chance, 2) } chance per wound
|
||||
}
|
||||
reagent-effect-condition-guidebook-heart-damage = { $max ->
|
||||
entity-condition-guidebook-heart-damage = { $max ->
|
||||
[2147483648] it has at least {NATURALFIXED($min, 2)} heart damage
|
||||
*[other] { $min ->
|
||||
[0] it has at most {NATURALFIXED($max, 2)} heart damage
|
||||
*[other] it has between {NATURALFIXED($min, 2)} and {NATURALFIXED($max, 2)} heart damage
|
||||
}
|
||||
}
|
||||
reagent-effect-condition-guidebook-lung-damage = { $max ->
|
||||
entity-condition-guidebook-lung-damage = { $max ->
|
||||
[2147483648] it has at least {NATURALFIXED($min, 2)} lung damage
|
||||
*[other] { $min ->
|
||||
[0] it has at most {NATURALFIXED($max, 2)} lung damage
|
||||
*[other] it has between {NATURALFIXED($min, 2)} and {NATURALFIXED($max, 2)} lung damage
|
||||
}
|
||||
}
|
||||
reagent-effect-condition-guidebook-brain-damage = { $max ->
|
||||
entity-condition-guidebook-brain-damage = { $max ->
|
||||
[2147483648] it has at least {NATURALFIXED($min, 2)} brain damage
|
||||
*[other] { $min ->
|
||||
[0] it has at most {NATURALFIXED($max, 2)} brain damage
|
||||
*[other] it has between {NATURALFIXED($min, 2)} and {NATURALFIXED($max, 2)} brain damage
|
||||
}
|
||||
}
|
||||
reagent-effect-condition-guidebook-total-group-damage = { $max ->
|
||||
entity-condition-guidebook-total-group-damage = { $max ->
|
||||
[2147483648] it has at least {NATURALFIXED($min, 2)} { $name } damage
|
||||
*[other] { $min ->
|
||||
[0] it has at most {NATURALFIXED($max, 2)} { $name } damage
|
||||
*[other] it has between {NATURALFIXED($min, 2)} and {NATURALFIXED($max, 2)} { $name } damage
|
||||
}
|
||||
}
|
||||
reagent-effect-guidebook-modify-brain-oxygen-heals = { $chance ->
|
||||
entity-effect-guidebook-modify-brain-oxygen-heals = { $chance ->
|
||||
[1] Replenishes { $amount } brain oxygenation
|
||||
*[other] replenish { $amount } brain oxygenation
|
||||
}
|
||||
reagent-effect-guidebook-modify-brain-oxygen-deals = { $chance ->
|
||||
entity-effect-guidebook-modify-brain-oxygen-deals = { $chance ->
|
||||
[1] Depletes { $amount } brain oxygenation
|
||||
*[other] deplete { $amount } brain oxygenation
|
||||
}
|
||||
|
||||
reagent-effect-guidebook-start-heart = { $chance ->
|
||||
entity-effect-guidebook-start-heart = { $chance ->
|
||||
[1] Restarts the target's heart
|
||||
*[other] restart the target's heart
|
||||
}
|
||||
reagent-effect-guidebook-zombify = { $chance ->
|
||||
entity-effect-guidebook-zombify = { $chance ->
|
||||
[1] Zombifies the target
|
||||
*[other] zombify the target
|
||||
}
|
||||
|
||||
reagent-effect-condition-guidebook-total-dosage-threshold =
|
||||
entity-condition-guidebook-total-dosage-threshold =
|
||||
{ $max ->
|
||||
[2147483648] the total dosage of {$reagent} is at least {NATURALFIXED($min, 2)}u
|
||||
*[other] { $min ->
|
||||
@@ -91,7 +91,7 @@ reagent-effect-condition-guidebook-total-dosage-threshold =
|
||||
}
|
||||
}
|
||||
|
||||
reagent-effect-condition-guidebook-metabolite-threshold =
|
||||
entity-condition-guidebook-metabolite-threshold =
|
||||
{ $max ->
|
||||
[2147483648] there's at least {NATURALFIXED($min, 2)}u of {$reagent} metabolites
|
||||
*[other] { $min ->
|
||||
@@ -100,21 +100,21 @@ reagent-effect-condition-guidebook-metabolite-threshold =
|
||||
}
|
||||
}
|
||||
|
||||
reagent-effect-condition-guidebook-is-zombie-immune =
|
||||
entity-condition-guidebook-is-zombie-immune =
|
||||
the target { $invert ->
|
||||
[true] is not immunized against zombie infections
|
||||
*[false] is immunized against zombie infections
|
||||
}
|
||||
|
||||
reagent-effect-condition-guidebook-is-zombie =
|
||||
entity-condition-guidebook-is-zombie =
|
||||
the target { $invert ->
|
||||
[true] is not a zombie
|
||||
*[false] is a zombie
|
||||
}
|
||||
|
||||
reagent-effect-condition-guidebook-this-metabolite = this reagent's
|
||||
entity-condition-guidebook-this-metabolite = this reagent's
|
||||
|
||||
reagent-effect-guidebook-adjust-reagent-gaussian =
|
||||
entity-effect-guidebook-adjust-reagent-gaussian =
|
||||
{ $chance ->
|
||||
[1] { $deltasign ->
|
||||
[1] Typically adds
|
||||
|
||||
@@ -215,11 +215,12 @@
|
||||
type: Add
|
||||
- !type:ModifyStatusEffect
|
||||
conditions:
|
||||
- !type:ReagentThreshold
|
||||
- !type:ReagentCondition
|
||||
reagent: Ethanol
|
||||
min: 15
|
||||
- !type:OrganType
|
||||
type: Dwarf
|
||||
shouldHave: false
|
||||
- !type:MetabolizerTypeCondition
|
||||
type: [ Dwarf ]
|
||||
inverted: true
|
||||
effectProto: StatusEffectPainkillersMildEthanolOverdose
|
||||
time: 2
|
||||
type: Add
|
||||
|
||||
@@ -128,8 +128,8 @@
|
||||
statusEffects:
|
||||
- statusEffect: StatusEffectPainkillersNegligibleRobustHarvest
|
||||
conditions:
|
||||
- !type:OrganType
|
||||
type: Plant
|
||||
- !type:MetabolizerTypeCondition
|
||||
type: [Plant]
|
||||
effects:
|
||||
- !type:HealthChange
|
||||
damage:
|
||||
@@ -163,7 +163,7 @@
|
||||
conditions:
|
||||
- !type:MetabolizerTypeCondition
|
||||
type: [Plant]
|
||||
- !type:MetaboliteThreshold # Offbrand
|
||||
- !type:MetaboliteThresholdCondition # Offbrand
|
||||
reagent: RobustHarvest
|
||||
min: 80
|
||||
|
||||
@@ -193,20 +193,22 @@
|
||||
damage:
|
||||
types:
|
||||
Poison: 2
|
||||
- !type:CreateEntityReactionEffect
|
||||
- !type:SpawnEntity
|
||||
entity: MobDionaNymph
|
||||
conditions:
|
||||
- !type:OrganType
|
||||
type: Plant
|
||||
- !type:ReagentThreshold
|
||||
- !type:MetabolizerTypeCondition
|
||||
type: [Plant]
|
||||
- !type:ReagentCondition
|
||||
reagent: Sedin
|
||||
min: 40
|
||||
- !type:AdjustReagent
|
||||
reagent: Sedin
|
||||
amount: -20
|
||||
conditions:
|
||||
- !type:OrganType
|
||||
type: Plant
|
||||
- !type:ReagentThreshold
|
||||
- !type:MetabolizerTypeCondition
|
||||
type: [Plant]
|
||||
- !type:ReagentCondition
|
||||
reagent: Sedin
|
||||
min: 40
|
||||
# End Offbrand
|
||||
|
||||
@@ -258,14 +260,14 @@
|
||||
Caustic: 1
|
||||
# Begin Offbrand
|
||||
conditions:
|
||||
- !type:OrganType
|
||||
type: Plant
|
||||
shouldHave: false
|
||||
- !type:MetabolizerTypeCondition
|
||||
type: [Plant]
|
||||
inverted: true
|
||||
- !type:SatiateHunger
|
||||
factor: 1
|
||||
conditions:
|
||||
- !type:OrganType
|
||||
type: Plant
|
||||
- !type:MetabolizerTypeCondition
|
||||
type: [Plant]
|
||||
# End Offbrand
|
||||
Gas:
|
||||
effects:
|
||||
@@ -353,9 +355,9 @@
|
||||
# Begin Offbrand
|
||||
Caustic: 0.5
|
||||
conditions:
|
||||
- !type:OrganType
|
||||
type: Plant
|
||||
shouldHave: false
|
||||
- !type:MetabolizerTypeCondition
|
||||
type: [ Plant ]
|
||||
inverted: true
|
||||
- !type:HealthChange
|
||||
damage:
|
||||
types:
|
||||
@@ -363,6 +365,6 @@
|
||||
Cold: -0.5
|
||||
Shock: -0.5
|
||||
conditions:
|
||||
- !type:OrganType
|
||||
type: Plant
|
||||
- !type:MetabolizerTypeCondition
|
||||
type: [ Plant ]
|
||||
# End Offbrand
|
||||
|
||||
@@ -333,12 +333,12 @@
|
||||
type: Update
|
||||
- !type:ModifyStatusEffect # Offbrand
|
||||
conditions:
|
||||
- !type:ReagentThreshold
|
||||
- !type:ReagentCondition
|
||||
reagent: NitrousOxide
|
||||
min: 1.8
|
||||
- !type:OrganType
|
||||
type: Slime
|
||||
shouldHave: false
|
||||
- !type:MetabolizerTypeCondition
|
||||
type: [ Slime ]
|
||||
inverted: false
|
||||
effectProto: StatusEffectPainSuppressionNitrousOxide
|
||||
time: 3
|
||||
type: Add
|
||||
|
||||
@@ -1379,7 +1379,7 @@
|
||||
- !type:ModifyBrainOxygen
|
||||
amount: 0.5
|
||||
conditions:
|
||||
- !type:Temperature
|
||||
- !type:TemperatureCondition
|
||||
max: 150.0
|
||||
# End Offbrand Additions
|
||||
# Begin Offbrand Removals
|
||||
@@ -1415,7 +1415,7 @@
|
||||
- !type:ReduceRotting
|
||||
seconds: 20
|
||||
conditions:
|
||||
- !type:Temperature
|
||||
- !type:TemperatureCondition
|
||||
max: 213.0
|
||||
# End Offbrand - Derotting moved to necrosol
|
||||
- !type:HealthChange
|
||||
@@ -1478,16 +1478,19 @@
|
||||
emote: Scream
|
||||
probability: 0.2
|
||||
conditions:
|
||||
- !type:ReagentThreshold
|
||||
- !type:ReagentCondition
|
||||
reagent: Mannitol
|
||||
min: 10.5
|
||||
- !type:ChemVomit
|
||||
- !type:Vomit
|
||||
conditions:
|
||||
- !type:ReagentThreshold
|
||||
- !type:ReagentCondition
|
||||
reagent: Mannitol
|
||||
min: 15
|
||||
probability: 0.1
|
||||
- !type:HealthChange
|
||||
conditions:
|
||||
- !type:ReagentThreshold
|
||||
- !type:ReagentCondition
|
||||
reagent: Mannitol
|
||||
min: 10.5
|
||||
damage:
|
||||
types:
|
||||
|
||||
@@ -480,21 +480,22 @@
|
||||
statusEffects:
|
||||
- statusEffect: StatusEffectHeartStrainRomerol
|
||||
conditions:
|
||||
- !type:MetaboliteThreshold
|
||||
- !type:MetaboliteThresholdCondition
|
||||
reagent: Romerol
|
||||
min: 15
|
||||
effects:
|
||||
- !type:AdjustReagent
|
||||
reagent: Romerol
|
||||
amount: -10
|
||||
conditions:
|
||||
- !type:IsZombie
|
||||
- !type:IsZombieCondition
|
||||
- !type:AdjustReagentGaussian
|
||||
reagent: Romerol
|
||||
μ: 0.35
|
||||
σ: 0.1
|
||||
conditions:
|
||||
- !type:IsZombieImmune
|
||||
invert: true
|
||||
- !type:IsZombieImmuneCondition
|
||||
inverted: true
|
||||
- !type:PopupMessage
|
||||
type: Local
|
||||
visualType: MediumCaution
|
||||
@@ -505,14 +506,16 @@
|
||||
- zombification-30-message-4
|
||||
probability: 0.05
|
||||
conditions:
|
||||
- !type:MetaboliteThreshold
|
||||
- !type:MetaboliteThresholdCondition
|
||||
reagent: Romerol
|
||||
min: 15
|
||||
- !type:HealthChange
|
||||
damage:
|
||||
types:
|
||||
Poison: 0.15
|
||||
conditions:
|
||||
- !type:MetaboliteThreshold
|
||||
- !type:MetaboliteThresholdCondition
|
||||
reagent: Romerol
|
||||
min: 15
|
||||
- !type:ModifyHeartDamage
|
||||
amount: 2
|
||||
@@ -533,39 +536,46 @@
|
||||
mobstate: Critical
|
||||
- !type:Zombify
|
||||
conditions:
|
||||
- !type:BrainDamage
|
||||
- !type:BrainDamageCondition
|
||||
min: 70
|
||||
- !type:MetaboliteThreshold
|
||||
- !type:MetaboliteThresholdCondition
|
||||
reagent: Romerol
|
||||
min: 15
|
||||
- !type:ModifyBrainDamage
|
||||
amount: 0.5
|
||||
conditions:
|
||||
- !type:MetaboliteThreshold
|
||||
- !type:MetaboliteThresholdCondition
|
||||
reagent: Romerol
|
||||
min: 15
|
||||
- !type:ModifyHeartDamage
|
||||
amount: 0.2
|
||||
conditions:
|
||||
- !type:MetaboliteThreshold
|
||||
- !type:MetaboliteThresholdCondition
|
||||
reagent: Romerol
|
||||
min: 15
|
||||
- !type:ModifyLungDamage
|
||||
amount: 0.2
|
||||
conditions:
|
||||
- !type:MetaboliteThreshold
|
||||
- !type:MetaboliteThresholdCondition
|
||||
reagent: Romerol
|
||||
min: 15
|
||||
- !type:AdjustTemperature
|
||||
amount: 3000
|
||||
conditions:
|
||||
- !type:MetaboliteThreshold
|
||||
- !type:MetaboliteThresholdCondition
|
||||
reagent: Romerol
|
||||
min: 15
|
||||
- !type:Jitter
|
||||
probability: 0.25
|
||||
conditions:
|
||||
- !type:MetaboliteThreshold
|
||||
- !type:MetaboliteThresholdCondition
|
||||
reagent: Romerol
|
||||
min: 30
|
||||
- !type:AdjustTemperature
|
||||
amount: 6000
|
||||
conditions:
|
||||
- !type:MetaboliteThreshold
|
||||
- !type:MetaboliteThresholdCondition
|
||||
reagent: Romerol
|
||||
min: 30
|
||||
- !type:PopupMessage
|
||||
type: Local
|
||||
@@ -577,12 +587,14 @@
|
||||
- zombification-60-message-4
|
||||
probability: 0.05
|
||||
conditions:
|
||||
- !type:MetaboliteThreshold
|
||||
- !type:MetaboliteThresholdCondition
|
||||
reagent: Romerol
|
||||
min: 30
|
||||
- !type:ModifyBrainDamage
|
||||
amount: 0.25
|
||||
conditions:
|
||||
- !type:MetaboliteThreshold
|
||||
- !type:MetaboliteThresholdCondition
|
||||
reagent: Romerol
|
||||
min: 45
|
||||
- !type:HealthChange
|
||||
damage:
|
||||
@@ -591,7 +603,8 @@
|
||||
Blunt: 0.15
|
||||
Piercing: 0.15
|
||||
conditions:
|
||||
- !type:MetaboliteThreshold
|
||||
- !type:MetaboliteThresholdCondition
|
||||
reagent: Romerol
|
||||
min: 45
|
||||
- !type:PopupMessage
|
||||
type: Local
|
||||
@@ -603,12 +616,14 @@
|
||||
- zombification-90-message-4
|
||||
probability: 0.05
|
||||
conditions:
|
||||
- !type:MetaboliteThreshold
|
||||
- !type:MetaboliteThresholdCondition
|
||||
reagent: Romerol
|
||||
min: 45
|
||||
- !type:ModifyBrainDamage
|
||||
amount: 0.5
|
||||
conditions:
|
||||
- !type:MetaboliteThreshold
|
||||
- !type:MetaboliteThresholdCondition
|
||||
reagent: Romerol
|
||||
min: 60
|
||||
- !type:PopupMessage
|
||||
type: Local
|
||||
@@ -620,12 +635,14 @@
|
||||
- zombification-120-message-4
|
||||
probability: 0.05
|
||||
conditions:
|
||||
- !type:MetaboliteThreshold
|
||||
- !type:MetaboliteThresholdCondition
|
||||
reagent: Romerol
|
||||
min: 60
|
||||
- !type:ModifyBrainDamage
|
||||
amount: 5
|
||||
conditions:
|
||||
- !type:MetaboliteThreshold
|
||||
- !type:MetaboliteThresholdCondition
|
||||
reagent: Romerol
|
||||
min: 70
|
||||
- !type:Zombify
|
||||
conditions:
|
||||
|
||||
@@ -12,20 +12,22 @@
|
||||
statusEffects:
|
||||
- statusEffect: StatusEffectPainkillersMildParacetamol
|
||||
conditions:
|
||||
- !type:ReagentThreshold
|
||||
- !type:ReagentCondition
|
||||
reagent: Tramadol
|
||||
max: 1
|
||||
- !type:ReagentThreshold
|
||||
- !type:ReagentCondition
|
||||
reagent: Oxycodone
|
||||
max: 1
|
||||
- statusEffect: StatusEffectPainkillersMildParacetamolOverdose
|
||||
conditions:
|
||||
- !type:ReagentThreshold
|
||||
- !type:ReagentCondition
|
||||
reagent: Paracetamol
|
||||
min: 10
|
||||
effects:
|
||||
- !type:HealthChange
|
||||
conditions:
|
||||
- !type:ReagentThreshold
|
||||
- !type:ReagentCondition
|
||||
reagent: Paracetamol
|
||||
min: 10
|
||||
damage:
|
||||
types:
|
||||
@@ -46,32 +48,35 @@
|
||||
- statusEffect: StatusEffectPainkillersTramadol
|
||||
- statusEffect: StatusEffectPainkillersTramadolOverdose
|
||||
conditions:
|
||||
- !type:ReagentThreshold
|
||||
- !type:ReagentCondition
|
||||
reagent: Tramadol
|
||||
min: 15
|
||||
- !type:ReagentThreshold
|
||||
- !type:ReagentCondition
|
||||
reagent: Oxycodone
|
||||
max: 1
|
||||
- statusEffect: StatusEffectHeartStrainTramadolAlcohol
|
||||
conditions:
|
||||
- !type:ReagentThreshold
|
||||
- !type:ReagentCondition
|
||||
reagent: Ethanol
|
||||
min: 1
|
||||
effects:
|
||||
- !type:Drunk
|
||||
boozePower: 1
|
||||
conditions:
|
||||
- !type:ReagentThreshold
|
||||
- !type:ReagentCondition
|
||||
reagent: Tramadol
|
||||
min: 15.5
|
||||
- !type:HealthChange
|
||||
conditions:
|
||||
- !type:ReagentThreshold
|
||||
- !type:ReagentCondition
|
||||
reagent: Tramadol
|
||||
min: 25
|
||||
damage:
|
||||
types:
|
||||
Asphyxiation: 0.5
|
||||
- !type:HealthChange
|
||||
conditions:
|
||||
- !type:ReagentThreshold
|
||||
- !type:ReagentCondition
|
||||
reagent: Ethanol
|
||||
min: 1
|
||||
damage:
|
||||
@@ -93,29 +98,32 @@
|
||||
- statusEffect: StatusEffectPainkillersStrongOxycodone
|
||||
- statusEffect: StatusEffectPainkillersStrongOxycodoneOverdose
|
||||
conditions:
|
||||
- !type:ReagentThreshold
|
||||
- !type:ReagentCondition
|
||||
reagent: Oxycodone
|
||||
min: 10
|
||||
- statusEffect: StatusEffectHeartStrainOxycodoneAlcohol
|
||||
conditions:
|
||||
- !type:ReagentThreshold
|
||||
- !type:ReagentCondition
|
||||
reagent: Ethanol
|
||||
min: 1
|
||||
effects:
|
||||
- !type:Drunk
|
||||
boozePower: 2
|
||||
conditions:
|
||||
- !type:ReagentThreshold
|
||||
- !type:ReagentCondition
|
||||
reagent: Oxycodone
|
||||
min: 10
|
||||
- !type:HealthChange
|
||||
conditions:
|
||||
- !type:ReagentThreshold
|
||||
- !type:ReagentCondition
|
||||
reagent: Oxycodone
|
||||
min: 15
|
||||
damage:
|
||||
types:
|
||||
Asphyxiation: 0.5
|
||||
- !type:HealthChange
|
||||
conditions:
|
||||
- !type:ReagentThreshold
|
||||
- !type:ReagentCondition
|
||||
reagent: Ethanol
|
||||
min: 1
|
||||
damage:
|
||||
@@ -148,7 +156,8 @@
|
||||
- !type:ModifyBloodLevel
|
||||
amount: 6
|
||||
conditions:
|
||||
- !type:ReagentThreshold
|
||||
- !type:ReagentCondition
|
||||
reagent: Sanguine
|
||||
max: 1
|
||||
|
||||
- type: reagent
|
||||
@@ -167,27 +176,30 @@
|
||||
- !type:ModifyHeartDamage
|
||||
amount: -0.4
|
||||
conditions:
|
||||
- !type:HeartDamage
|
||||
- !type:HeartDamageCondition
|
||||
max: 50
|
||||
- !type:ModifyLungDamage
|
||||
amount: -0.4
|
||||
conditions:
|
||||
- !type:LungDamage
|
||||
- !type:LungDamageCondition
|
||||
max: 50
|
||||
- !type:HealthChange
|
||||
conditions:
|
||||
- !type:ReagentThreshold
|
||||
- !type:ReagentCondition
|
||||
reagent: Peridaxon
|
||||
min: 5.5
|
||||
damage:
|
||||
types:
|
||||
Poison: 0.05
|
||||
- !type:Jitter
|
||||
conditions:
|
||||
- !type:ReagentThreshold
|
||||
- !type:ReagentCondition
|
||||
reagent: Peridaxon
|
||||
min: 5.5
|
||||
- !type:ChemVomit
|
||||
- !type:Vomit
|
||||
conditions:
|
||||
- !type:ReagentThreshold
|
||||
- !type:ReagentCondition
|
||||
reagent: Peridaxon
|
||||
min: 5.5
|
||||
probability: 0.1
|
||||
|
||||
@@ -204,26 +216,26 @@
|
||||
statusEffects:
|
||||
- statusEffect: StatusEffectMajorOxygenationCloneoxadone
|
||||
conditions:
|
||||
- !type:Temperature
|
||||
- !type:TemperatureCondition
|
||||
max: 170.0
|
||||
- statusEffect: StatusEffectHeartStabilizationCloneoxadone
|
||||
conditions:
|
||||
- !type:Temperature
|
||||
- !type:TemperatureCondition
|
||||
max: 170.0
|
||||
effects:
|
||||
- !type:ModifyHeartDamage
|
||||
amount: -0.6
|
||||
conditions:
|
||||
- !type:Temperature
|
||||
- !type:TemperatureCondition
|
||||
max: 170.0
|
||||
- !type:ModifyLungDamage
|
||||
amount: -0.6
|
||||
conditions:
|
||||
- !type:Temperature
|
||||
- !type:TemperatureCondition
|
||||
max: 170.0
|
||||
- !type:EvenHealthChange
|
||||
conditions:
|
||||
- !type:Temperature
|
||||
- !type:TemperatureCondition
|
||||
max: 170.0
|
||||
damage:
|
||||
Airloss: -12
|
||||
@@ -247,17 +259,20 @@
|
||||
- !type:SatiateThirst
|
||||
factor: 3
|
||||
conditions:
|
||||
- !type:ReagentThreshold
|
||||
- !type:ReagentCondition
|
||||
reagent: SalineGlucose
|
||||
max: 1
|
||||
- !type:ModifyBloodLevel
|
||||
amount: 0.5
|
||||
conditions:
|
||||
- !type:ReagentThreshold
|
||||
- !type:ReagentCondition
|
||||
reagent: SalineGlucose
|
||||
max: 1
|
||||
- !type:SatiateHunger
|
||||
factor: 0.5
|
||||
conditions:
|
||||
- !type:ReagentThreshold
|
||||
- !type:ReagentCondition
|
||||
reagent: SalineGlucose
|
||||
max: 1
|
||||
- !type:HealthChange
|
||||
damage:
|
||||
@@ -269,7 +284,8 @@
|
||||
Shock: -0.6
|
||||
Cold: -0.6
|
||||
conditions:
|
||||
- !type:ReagentThreshold
|
||||
- !type:ReagentCondition
|
||||
reagent: SalineGlucose
|
||||
max: 1
|
||||
|
||||
- type: reagent
|
||||
@@ -306,13 +322,15 @@
|
||||
- !type:RemoveStatusEffect
|
||||
effectProto: WoundFracture
|
||||
conditions:
|
||||
- !type:MetaboliteThreshold
|
||||
- !type:MetaboliteThresholdCondition
|
||||
reagent: Osseous
|
||||
min: 5
|
||||
- !type:AdjustReagent
|
||||
reagent: Osseous
|
||||
amount: -5
|
||||
conditions:
|
||||
- !type:MetaboliteThreshold
|
||||
- !type:MetaboliteThresholdCondition
|
||||
reagent: Osseous
|
||||
min: 5
|
||||
|
||||
- type: reagent
|
||||
@@ -332,8 +350,8 @@
|
||||
Asphyxiation: -4
|
||||
Blunt: 1
|
||||
conditions:
|
||||
- !type:TotalGroupDamage
|
||||
group: Airloss
|
||||
- !type:DamageGroupCondition
|
||||
damageGroup: Airloss
|
||||
min: 4
|
||||
- !type:HealthChange
|
||||
damage:
|
||||
@@ -341,10 +359,11 @@
|
||||
Asphyxiation: -4
|
||||
Blunt: 1
|
||||
conditions:
|
||||
- !type:MetaboliteThreshold
|
||||
- !type:MetaboliteThresholdCondition
|
||||
reagent: Convermol
|
||||
min: 10
|
||||
- !type:TotalGroupDamage
|
||||
group: Airloss
|
||||
- !type:DamageGroupCondition
|
||||
damageGroup: Airloss
|
||||
min: 4
|
||||
- !type:ModifyLungDamage
|
||||
amount: 0.05
|
||||
@@ -363,43 +382,47 @@
|
||||
statusEffects:
|
||||
- statusEffect: StatusEffectPainkillersSalicylicAcid
|
||||
conditions:
|
||||
- !type:TotalGroupDamage
|
||||
group: Brute
|
||||
- !type:DamageGroupCondition
|
||||
damageGroup: Brute
|
||||
min: 35
|
||||
effects:
|
||||
- !type:EvenHealthChange
|
||||
damage:
|
||||
Brute: -2
|
||||
conditions:
|
||||
- !type:TotalGroupDamage
|
||||
group: Brute
|
||||
- !type:DamageGroupCondition
|
||||
damageGroup: Brute
|
||||
min: 35
|
||||
- !type:MetaboliteThreshold
|
||||
- !type:MetaboliteThresholdCondition
|
||||
reagent: SalicylicAcid
|
||||
max: 15
|
||||
- !type:EvenHealthChange
|
||||
damage:
|
||||
Brute: -2
|
||||
Burn: 2
|
||||
conditions:
|
||||
- !type:MetaboliteThreshold
|
||||
- !type:MetaboliteThresholdCondition
|
||||
reagent: SalicylicAcid
|
||||
min: 15
|
||||
- !type:EvenHealthChange
|
||||
damage:
|
||||
Brute: -0.5
|
||||
conditions:
|
||||
- !type:TotalGroupDamage
|
||||
group: Brute
|
||||
- !type:DamageGroupCondition
|
||||
damageGroup: Brute
|
||||
max: 35
|
||||
- !type:RemoveStatusEffect
|
||||
effectProto: WoundBoneDeath
|
||||
conditions:
|
||||
- !type:MetaboliteThreshold
|
||||
- !type:MetaboliteThresholdCondition
|
||||
reagent: SalicylicAcid
|
||||
min: 50
|
||||
- !type:EvenHealthChange
|
||||
damage:
|
||||
Burn: 1
|
||||
conditions:
|
||||
- !type:MetaboliteThreshold
|
||||
- !type:MetaboliteThresholdCondition
|
||||
reagent: SalicylicAcid
|
||||
min: 35
|
||||
|
||||
- type: reagent
|
||||
@@ -416,41 +439,45 @@
|
||||
statusEffects:
|
||||
- statusEffect: StatusEffectPainkillersOxandrolone
|
||||
conditions:
|
||||
- !type:TotalGroupDamage
|
||||
group: Burn
|
||||
- !type:DamageGroupCondition
|
||||
damageGroup: Burn
|
||||
min: 35
|
||||
effects:
|
||||
- !type:EvenHealthChange
|
||||
damage:
|
||||
Burn: -3
|
||||
conditions:
|
||||
- !type:TotalGroupDamage
|
||||
group: Burn
|
||||
- !type:DamageGroupCondition
|
||||
damageGroup: Burn
|
||||
min: 35
|
||||
- !type:MetaboliteThreshold
|
||||
- !type:MetaboliteThresholdCondition
|
||||
reagent: Oxandrolone
|
||||
max: 15
|
||||
- !type:EvenHealthChange
|
||||
damage:
|
||||
Burn: -3
|
||||
Brute: 3
|
||||
conditions:
|
||||
- !type:MetaboliteThreshold
|
||||
- !type:MetaboliteThresholdCondition
|
||||
reagent: Oxandrolone
|
||||
min: 15
|
||||
- !type:EvenHealthChange
|
||||
damage:
|
||||
Burn: -0.5
|
||||
conditions:
|
||||
- !type:TotalGroupDamage
|
||||
group: Burn
|
||||
- !type:DamageGroupCondition
|
||||
damageGroup: Burn
|
||||
max: 35
|
||||
- !type:RemoveStatusEffect
|
||||
effectProto: WoundHusking
|
||||
conditions:
|
||||
- !type:MetaboliteThreshold
|
||||
- !type:MetaboliteThresholdCondition
|
||||
reagent: Oxandrolone
|
||||
min: 50
|
||||
- !type:EvenHealthChange
|
||||
damage:
|
||||
Brute: 1
|
||||
conditions:
|
||||
- !type:MetaboliteThreshold
|
||||
- !type:MetaboliteThresholdCondition
|
||||
reagent: Oxandrolone
|
||||
min: 35
|
||||
|
||||
Reference in New Issue
Block a user