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;
|
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]
|
[RegisterComponent, NetworkedComponent]
|
||||||
[Access(typeof(WoundableSystem))]
|
[Access(typeof(WoundableSystem))]
|
||||||
public sealed partial class BleedingWoundComponent : Component
|
public sealed partial class BleedingWoundComponent : Component
|
||||||
@@ -166,3 +177,9 @@ public record struct GetBleedLevelEvent(float BleedLevel);
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
[ByRefEvent]
|
[ByRefEvent]
|
||||||
public record struct ModifyBleedLevelEvent(float BleedLevel);
|
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.FixedPoint;
|
||||||
using Content.Shared.HealthExaminable;
|
using Content.Shared.HealthExaminable;
|
||||||
using Content.Shared.IdentityManagement;
|
using Content.Shared.IdentityManagement;
|
||||||
|
using Content.Shared.Random.Helpers;
|
||||||
using Content.Shared.StatusEffectNew.Components;
|
using Content.Shared.StatusEffectNew.Components;
|
||||||
using Content.Shared.StatusEffectNew;
|
using Content.Shared.StatusEffectNew;
|
||||||
using Robust.Shared.Network;
|
using Robust.Shared.Network;
|
||||||
using Robust.Shared.Prototypes;
|
using Robust.Shared.Prototypes;
|
||||||
|
using Robust.Shared.Random;
|
||||||
using Robust.Shared.Timing;
|
using Robust.Shared.Timing;
|
||||||
using Robust.Shared.Utility;
|
using Robust.Shared.Utility;
|
||||||
|
|
||||||
@@ -38,6 +40,7 @@ public sealed class WoundableSystem : EntitySystem
|
|||||||
SubscribeLocalEvent<PainfulWoundComponent, StatusEffectRelayedEvent<GetPainEvent>>(OnGetPain);
|
SubscribeLocalEvent<PainfulWoundComponent, StatusEffectRelayedEvent<GetPainEvent>>(OnGetPain);
|
||||||
SubscribeLocalEvent<HealableWoundComponent, StatusEffectRelayedEvent<HealWoundsEvent>>(OnHealHealableWounds);
|
SubscribeLocalEvent<HealableWoundComponent, StatusEffectRelayedEvent<HealWoundsEvent>>(OnHealHealableWounds);
|
||||||
SubscribeLocalEvent<BleedingWoundComponent, StatusEffectRelayedEvent<GetBleedLevelEvent>>(OnGetBleedLevel);
|
SubscribeLocalEvent<BleedingWoundComponent, StatusEffectRelayedEvent<GetBleedLevelEvent>>(OnGetBleedLevel);
|
||||||
|
SubscribeLocalEvent<ClampableWoundComponent, StatusEffectRelayedEvent<ClampWoundsEvent>>(OnClampWounds);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnShutdown(Entity<WoundableComponent> ent, ref ComponentShutdown args)
|
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)
|
if (TryComp<TendableWoundComponent>(ent, out var tendable) && tendable.Tended)
|
||||||
return 0f;
|
return 0f;
|
||||||
|
|
||||||
|
if (TryComp<ClampableWoundComponent>(ent, out var clampable) && clampable.Clamped)
|
||||||
|
return 0f;
|
||||||
|
|
||||||
if (wound.Damage.GetTotal() < ent.Comp.StartsBleedingAbove)
|
if (wound.Damage.GetTotal() < ent.Comp.StartsBleedingAbove)
|
||||||
return 0f;
|
return 0f;
|
||||||
|
|
||||||
@@ -344,6 +350,27 @@ public sealed class WoundableSystem : EntitySystem
|
|||||||
return bleedAddition * ratio;
|
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)
|
private void OnGetBleedLevel(Entity<BleedingWoundComponent> ent, ref StatusEffectRelayedEvent<GetBleedLevelEvent> args)
|
||||||
{
|
{
|
||||||
args.Args = args.Args with { BleedLevel = args.Args.BleedLevel + BleedLevel(ent) };
|
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 }.
|
*[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 ->
|
reagent-effect-guidebook-modify-brain-damage-heals = { $chance ->
|
||||||
[1] Heals { $amount } brain damage
|
[1] Heals { $amount } brain damage
|
||||||
*[other] heal { $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
|
[1] Deals { $amount } heart damage
|
||||||
*[other] deal { $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 ->
|
reagent-effect-condition-guidebook-heart-damage = { $max ->
|
||||||
[2147483648] it has at least {NATURALFIXED($min, 2)} heart damage
|
[2147483648] it has at least {NATURALFIXED($min, 2)} heart damage
|
||||||
*[other] { $min ->
|
*[other] { $min ->
|
||||||
|
|||||||
@@ -21,3 +21,9 @@ reagent-desc-peridaxon = A beady medicine that encourages internal organs to rec
|
|||||||
|
|
||||||
reagent-name-synthflesh = synthflesh
|
reagent-name-synthflesh = synthflesh
|
||||||
reagent-desc-synthflesh = A resorbable collagen and protein mixture used for synthesizing equivalents to various bodily materials.
|
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"
|
color: "#ba7d7d"
|
||||||
metabolisms:
|
metabolisms:
|
||||||
Medicine:
|
Medicine:
|
||||||
|
metabolismRate: 0.2
|
||||||
effects:
|
effects:
|
||||||
# Medium-large quantities can hurt you instead,
|
# Medium-large quantities can hurt you instead,
|
||||||
# but still technically stop your bleeding.
|
# but still technically stop your bleeding.
|
||||||
@@ -848,6 +849,8 @@
|
|||||||
damage:
|
damage:
|
||||||
types:
|
types:
|
||||||
Bloodloss: 3
|
Bloodloss: 3
|
||||||
|
- !type:ClampWounds
|
||||||
|
chance: 0.3
|
||||||
|
|
||||||
- type: reagent
|
- type: reagent
|
||||||
id: Tricordrazine
|
id: Tricordrazine
|
||||||
|
|||||||
@@ -90,7 +90,7 @@
|
|||||||
damageProbabilityCoefficient: 0.25
|
damageProbabilityCoefficient: 0.25
|
||||||
damageProbabilityConstant: 0
|
damageProbabilityConstant: 0
|
||||||
- damageTypes: [Slash, Blunt, Piercing]
|
- damageTypes: [Slash, Blunt, Piercing]
|
||||||
minimumDamage: 100
|
minimumDamage: 120
|
||||||
minimumTotalDamage: 0
|
minimumTotalDamage: 0
|
||||||
woundPrototype: WoundBoneDeath
|
woundPrototype: WoundBoneDeath
|
||||||
woundDamages:
|
woundDamages:
|
||||||
|
|||||||
@@ -103,3 +103,27 @@
|
|||||||
amount: 1
|
amount: 1
|
||||||
products:
|
products:
|
||||||
Romerol: 1
|
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:
|
conditions:
|
||||||
- !type:ReagentThreshold
|
- !type:ReagentThreshold
|
||||||
max: 1
|
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
|
Cold: 0.2
|
||||||
Caustic: 0.2
|
Caustic: 0.2
|
||||||
- type: TendableWound
|
- type: TendableWound
|
||||||
|
- type: ClampableWound
|
||||||
- type: BleedingWound
|
- type: BleedingWound
|
||||||
bleedingCoefficients:
|
bleedingCoefficients:
|
||||||
Blunt: 0.015
|
Blunt: 0.015
|
||||||
|
|||||||
Reference in New Issue
Block a user