The nukies update
This commit is contained in:
23
Content.Shared/_Offbrand/EntityEffects/ClampWounds.cs
Normal file
23
Content.Shared/_Offbrand/EntityEffects/ClampWounds.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using Content.Shared._Offbrand.Wounds;
|
||||
using Content.Shared.EntityEffects;
|
||||
using Content.Shared.FixedPoint;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Shared._Offbrand.EntityEffects;
|
||||
|
||||
public sealed partial class ClampWounds : EntityEffect
|
||||
{
|
||||
[DataField(required: true)]
|
||||
public float Chance;
|
||||
|
||||
protected override string ReagentEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys)
|
||||
{
|
||||
return Loc.GetString("reagent-effect-guidebook-clamp-wounds", ("probability", Probability), ("chance", Chance));
|
||||
}
|
||||
|
||||
public override void Effect(EntityEffectBaseArgs args)
|
||||
{
|
||||
args.EntityManager.System<WoundableSystem>()
|
||||
.ClampWounds(args.TargetEntity, Chance);
|
||||
}
|
||||
}
|
||||
24
Content.Shared/_Offbrand/EntityEffects/RemoveStatusEffect.cs
Normal file
24
Content.Shared/_Offbrand/EntityEffects/RemoveStatusEffect.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using Content.Shared.EntityEffects;
|
||||
using Content.Shared.StatusEffectNew;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Shared._Offbrand.EntityEffects;
|
||||
|
||||
public sealed partial class RemoveStatusEffect : EntityEffect
|
||||
{
|
||||
[DataField(required: true)]
|
||||
public EntProtoId EffectProto;
|
||||
|
||||
public override void Effect(EntityEffectBaseArgs args)
|
||||
{
|
||||
args.EntityManager.System<StatusEffectsSystem>()
|
||||
.TryRemoveStatusEffect(args.TargetEntity, EffectProto);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override string? ReagentEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys) =>
|
||||
Loc.GetString(
|
||||
"reagent-effect-guidebook-status-effect-remove",
|
||||
("chance", Probability),
|
||||
("key", prototype.Index(EffectProto).Name));
|
||||
}
|
||||
@@ -102,6 +102,17 @@ public sealed partial class TendableWoundComponent : Component
|
||||
public bool Tended;
|
||||
}
|
||||
|
||||
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
|
||||
[Access(typeof(WoundableSystem))]
|
||||
public sealed partial class ClampableWoundComponent : Component
|
||||
{
|
||||
/// <summary>
|
||||
/// Whether or not the wound has been clamped
|
||||
/// </summary>
|
||||
[DataField, AutoNetworkedField]
|
||||
public bool Clamped;
|
||||
}
|
||||
|
||||
[RegisterComponent, NetworkedComponent]
|
||||
[Access(typeof(WoundableSystem))]
|
||||
public sealed partial class BleedingWoundComponent : Component
|
||||
@@ -166,3 +177,9 @@ public record struct GetBleedLevelEvent(float BleedLevel);
|
||||
/// </summary>
|
||||
[ByRefEvent]
|
||||
public record struct ModifyBleedLevelEvent(float BleedLevel);
|
||||
|
||||
/// <summary>
|
||||
/// Raised on an entity's wounds to clamp them with the given probability
|
||||
/// </summary>
|
||||
[ByRefEvent]
|
||||
public record struct ClampWoundsEvent(float Probability);
|
||||
|
||||
@@ -5,10 +5,12 @@ using Content.Shared.Damage;
|
||||
using Content.Shared.FixedPoint;
|
||||
using Content.Shared.HealthExaminable;
|
||||
using Content.Shared.IdentityManagement;
|
||||
using Content.Shared.Random.Helpers;
|
||||
using Content.Shared.StatusEffectNew.Components;
|
||||
using Content.Shared.StatusEffectNew;
|
||||
using Robust.Shared.Network;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Random;
|
||||
using Robust.Shared.Timing;
|
||||
using Robust.Shared.Utility;
|
||||
|
||||
@@ -38,6 +40,7 @@ public sealed class WoundableSystem : EntitySystem
|
||||
SubscribeLocalEvent<PainfulWoundComponent, StatusEffectRelayedEvent<GetPainEvent>>(OnGetPain);
|
||||
SubscribeLocalEvent<HealableWoundComponent, StatusEffectRelayedEvent<HealWoundsEvent>>(OnHealHealableWounds);
|
||||
SubscribeLocalEvent<BleedingWoundComponent, StatusEffectRelayedEvent<GetBleedLevelEvent>>(OnGetBleedLevel);
|
||||
SubscribeLocalEvent<ClampableWoundComponent, StatusEffectRelayedEvent<ClampWoundsEvent>>(OnClampWounds);
|
||||
}
|
||||
|
||||
private void OnShutdown(Entity<WoundableComponent> ent, ref ComponentShutdown args)
|
||||
@@ -312,6 +315,9 @@ public sealed class WoundableSystem : EntitySystem
|
||||
if (TryComp<TendableWoundComponent>(ent, out var tendable) && tendable.Tended)
|
||||
return 0f;
|
||||
|
||||
if (TryComp<ClampableWoundComponent>(ent, out var clampable) && clampable.Clamped)
|
||||
return 0f;
|
||||
|
||||
if (wound.Damage.GetTotal() < ent.Comp.StartsBleedingAbove)
|
||||
return 0f;
|
||||
|
||||
@@ -344,6 +350,27 @@ public sealed class WoundableSystem : EntitySystem
|
||||
return bleedAddition * ratio;
|
||||
}
|
||||
|
||||
public void ClampWounds(Entity<WoundableComponent?> ent, float probability)
|
||||
{
|
||||
var evt = new ClampWoundsEvent(probability);
|
||||
RaiseLocalEvent(ent, ref evt);
|
||||
}
|
||||
|
||||
private void OnClampWounds(Entity<ClampableWoundComponent> ent, ref StatusEffectRelayedEvent<ClampWoundsEvent> args)
|
||||
{
|
||||
if (ent.Comp.Clamped)
|
||||
return;
|
||||
|
||||
var seed = SharedRandomExtensions.HashCodeCombine(new() { (int)_timing.CurTick.Value, GetNetEntity(ent).Id });
|
||||
var rand = new System.Random(seed);
|
||||
|
||||
if (!rand.Prob(args.Args.Probability))
|
||||
return;
|
||||
|
||||
ent.Comp.Clamped = true;
|
||||
Dirty(ent);
|
||||
}
|
||||
|
||||
private void OnGetBleedLevel(Entity<BleedingWoundComponent> ent, ref StatusEffectRelayedEvent<GetBleedLevelEvent> args)
|
||||
{
|
||||
args.Args = args.Args with { BleedLevel = args.Args.BleedLevel + BleedLevel(ent) };
|
||||
|
||||
@@ -3,6 +3,11 @@ reagent-guidebook-status-effect = Causes { $effect } during metabolism{ $conditi
|
||||
*[other] {" "}when { $conditions }.
|
||||
}
|
||||
|
||||
reagent-effect-guidebook-status-effect-remove = { $chance ->
|
||||
[1] Removes { LOC($key) }
|
||||
*[other] remove { LOC($key) }
|
||||
}
|
||||
|
||||
reagent-effect-guidebook-modify-brain-damage-heals = { $chance ->
|
||||
[1] Heals { $amount } brain damage
|
||||
*[other] heal { $amount } brain damage
|
||||
@@ -19,6 +24,10 @@ reagent-effect-guidebook-modify-heart-damage-deals = { $chance ->
|
||||
[1] Deals { $amount } heart damage
|
||||
*[other] deal { $amount } heart damage
|
||||
}
|
||||
reagent-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 ->
|
||||
[2147483648] it has at least {NATURALFIXED($min, 2)} heart damage
|
||||
*[other] { $min ->
|
||||
|
||||
@@ -21,3 +21,9 @@ reagent-desc-peridaxon = A beady medicine that encourages internal organs to rec
|
||||
|
||||
reagent-name-synthflesh = synthflesh
|
||||
reagent-desc-synthflesh = A resorbable collagen and protein mixture used for synthesizing equivalents to various bodily materials.
|
||||
|
||||
reagent-name-coagulant = coagulant
|
||||
reagent-desc-coagulant = An experimental medicine that causes internal and external bleeding to clot. Authorities have expressed concern over the lead content.
|
||||
|
||||
reagent-name-osseous = osseous reagent
|
||||
reagent-desc-osseous = An strange solution of pinkish gel and white shards that can heal internal bone fractures. Authorities have expressed concern over the lead content.
|
||||
|
||||
@@ -836,6 +836,7 @@
|
||||
color: "#ba7d7d"
|
||||
metabolisms:
|
||||
Medicine:
|
||||
metabolismRate: 0.2
|
||||
effects:
|
||||
# Medium-large quantities can hurt you instead,
|
||||
# but still technically stop your bleeding.
|
||||
@@ -848,6 +849,8 @@
|
||||
damage:
|
||||
types:
|
||||
Bloodloss: 3
|
||||
- !type:ClampWounds
|
||||
chance: 0.3
|
||||
|
||||
- type: reagent
|
||||
id: Tricordrazine
|
||||
|
||||
@@ -90,7 +90,7 @@
|
||||
damageProbabilityCoefficient: 0.25
|
||||
damageProbabilityConstant: 0
|
||||
- damageTypes: [Slash, Blunt, Piercing]
|
||||
minimumDamage: 100
|
||||
minimumDamage: 120
|
||||
minimumTotalDamage: 0
|
||||
woundPrototype: WoundBoneDeath
|
||||
woundDamages:
|
||||
|
||||
@@ -103,3 +103,27 @@
|
||||
amount: 1
|
||||
products:
|
||||
Romerol: 1
|
||||
|
||||
- type: reaction
|
||||
id: Coagulant
|
||||
reactants:
|
||||
TranexamicAcid:
|
||||
amount: 1
|
||||
Lead:
|
||||
amount: 1
|
||||
catalyst: true
|
||||
products:
|
||||
Coagulant: 1
|
||||
|
||||
- type: reaction
|
||||
id: Osseous
|
||||
reactants:
|
||||
Milk:
|
||||
amount: 1
|
||||
SodaWater:
|
||||
amount: 1
|
||||
Lead:
|
||||
amount: 1
|
||||
catalyst: true
|
||||
products:
|
||||
Osseous: 2
|
||||
|
||||
@@ -261,3 +261,46 @@
|
||||
conditions:
|
||||
- !type:ReagentThreshold
|
||||
max: 1
|
||||
|
||||
- type: reagent
|
||||
id: Coagulant
|
||||
name: reagent-name-coagulant
|
||||
group: Medicine
|
||||
desc: reagent-desc-coagulant
|
||||
physicalDesc: reagent-physical-desc-viscous
|
||||
flavor: metallic
|
||||
color: "#bf0000"
|
||||
contrabandSeverity: Syndicate
|
||||
metabolisms:
|
||||
Medicine:
|
||||
metabolismRate: 0.2
|
||||
effects:
|
||||
- !type:ClampWounds
|
||||
chance: 0.4
|
||||
- !type:RemoveStatusEffect
|
||||
effectProto: WoundArterialBleeding
|
||||
probability: 0.2
|
||||
|
||||
- type: reagent
|
||||
id: Osseous
|
||||
name: reagent-name-osseous
|
||||
group: Medicine
|
||||
desc: reagent-desc-osseous
|
||||
physicalDesc: reagent-physical-desc-putrid
|
||||
flavor: meaty
|
||||
color: "#c9abab"
|
||||
contrabandSeverity: Syndicate
|
||||
metabolisms:
|
||||
Medicine:
|
||||
effects:
|
||||
- !type:RemoveStatusEffect
|
||||
effectProto: WoundFracture
|
||||
conditions:
|
||||
- !type:MetaboliteThreshold
|
||||
min: 5
|
||||
- !type:AdjustReagent
|
||||
reagent: Osseous
|
||||
amount: -5
|
||||
conditions:
|
||||
- !type:MetaboliteThreshold
|
||||
min: 5
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
Cold: 0.2
|
||||
Caustic: 0.2
|
||||
- type: TendableWound
|
||||
- type: ClampableWound
|
||||
- type: BleedingWound
|
||||
bleedingCoefficients:
|
||||
Blunt: 0.015
|
||||
|
||||
Reference in New Issue
Block a user