thusd refactoring
This commit is contained in:
@@ -90,8 +90,8 @@ namespace Content.Client.HealthAnalyzer.UI
|
|||||||
// Begin Offbrand Tooltips
|
// Begin Offbrand Tooltips
|
||||||
_brainHealthTooltip.Update(msg);
|
_brainHealthTooltip.Update(msg);
|
||||||
_bloodPressureTooltip.Update(msg);
|
_bloodPressureTooltip.Update(msg);
|
||||||
_bloodOxygenationTooltip.Update(msg, (target.Value, damageable));
|
_bloodOxygenationTooltip.Update(msg, (target.Value, damageable, _entityManager.GetComponentOrNull<HeartrateComponent>(target)));
|
||||||
_heartRateTooltip.Update(msg, (target.Value, damageable));
|
_heartRateTooltip.Update(msg, (target.Value, damageable, _entityManager.GetComponentOrNull<HeartrateComponent>(target)));
|
||||||
_bloodFlowTooltip.Update(msg);
|
_bloodFlowTooltip.Update(msg);
|
||||||
_heartHealthTooltip.Update(msg);
|
_heartHealthTooltip.Update(msg);
|
||||||
_temperatureTooltip.Update(msg, (target.Value, _entityManager.GetComponentOrNull<CryostasisFactorComponent>(target)));
|
_temperatureTooltip.Update(msg, (target.Value, _entityManager.GetComponentOrNull<CryostasisFactorComponent>(target)));
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
using Content.Shared._Offbrand.Wounds;
|
||||||
using Content.Shared.Damage;
|
using Content.Shared.Damage;
|
||||||
using Content.Shared.FixedPoint;
|
using Content.Shared.FixedPoint;
|
||||||
using Content.Shared.MedicalScanner;
|
using Content.Shared.MedicalScanner;
|
||||||
@@ -16,13 +17,16 @@ public sealed partial class BloodOxygenationTooltip : PanelContainer
|
|||||||
RobustXamlLoader.Load(this);
|
RobustXamlLoader.Load(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Update(HealthAnalyzerScannedUserMessage msg, Entity<DamageableComponent> ent)
|
public void Update(HealthAnalyzerScannedUserMessage msg, Entity<DamageableComponent, HeartrateComponent?> ent)
|
||||||
{
|
{
|
||||||
if (msg.WoundableData is not { } woundable)
|
if (msg.WoundableData is not { } woundable)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (ent.Comp2?.AsphyxiationDamage is not { } damageType)
|
||||||
|
return;
|
||||||
|
|
||||||
var asphyxiation = FixedPoint2.Zero;
|
var asphyxiation = FixedPoint2.Zero;
|
||||||
ent.Comp.Damage.DamageDict.TryGetValue("Asphyxiation", out asphyxiation);
|
ent.Comp1.Damage.DamageDict.TryGetValue(damageType, out asphyxiation);
|
||||||
var (systolic, diastolic) = woundable.BloodPressure;
|
var (systolic, diastolic) = woundable.BloodPressure;
|
||||||
|
|
||||||
Label.Text = Loc.GetString("health-analyzer-blood-saturation-tooltip", ("rating", woundable.BloodOxygenationRating), ("systolic", systolic), ("diastolic", diastolic), ("asphyxiation", asphyxiation));
|
Label.Text = Loc.GetString("health-analyzer-blood-saturation-tooltip", ("rating", woundable.BloodOxygenationRating), ("systolic", systolic), ("diastolic", diastolic), ("asphyxiation", asphyxiation));
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
using Content.Shared._Offbrand.Wounds;
|
||||||
using Content.Shared.Damage;
|
using Content.Shared.Damage;
|
||||||
using Content.Shared.FixedPoint;
|
using Content.Shared.FixedPoint;
|
||||||
using Content.Shared.MedicalScanner;
|
using Content.Shared.MedicalScanner;
|
||||||
@@ -16,13 +17,16 @@ public sealed partial class HeartRateTooltip : PanelContainer
|
|||||||
RobustXamlLoader.Load(this);
|
RobustXamlLoader.Load(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Update(HealthAnalyzerScannedUserMessage msg, Entity<DamageableComponent> ent)
|
public void Update(HealthAnalyzerScannedUserMessage msg, Entity<DamageableComponent, HeartrateComponent?> ent)
|
||||||
{
|
{
|
||||||
if (msg.WoundableData is not { } woundable)
|
if (msg.WoundableData is not { } woundable)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (ent.Comp2?.AsphyxiationDamage is not { } damageType)
|
||||||
|
return;
|
||||||
|
|
||||||
var asphyxiation = FixedPoint2.Zero;
|
var asphyxiation = FixedPoint2.Zero;
|
||||||
ent.Comp.Damage.DamageDict.TryGetValue("Asphyxiation", out asphyxiation);
|
ent.Comp1.Damage.DamageDict.TryGetValue(damageType, out asphyxiation);
|
||||||
|
|
||||||
Label.Text = Loc.GetString("health-analyzer-heart-rate-tooltip", ("asphyxiation", asphyxiation));
|
Label.Text = Loc.GetString("health-analyzer-heart-rate-tooltip", ("asphyxiation", asphyxiation));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ public sealed class DamageOverlayUiController : UIController
|
|||||||
SubscribeLocalEvent<LocalPlayerDetachedEvent>(OnPlayerDetached);
|
SubscribeLocalEvent<LocalPlayerDetachedEvent>(OnPlayerDetached);
|
||||||
SubscribeLocalEvent<MobStateChangedEvent>(OnMobStateChanged);
|
SubscribeLocalEvent<MobStateChangedEvent>(OnMobStateChanged);
|
||||||
SubscribeLocalEvent<MobThresholdChecked>(OnThresholdCheck);
|
SubscribeLocalEvent<MobThresholdChecked>(OnThresholdCheck);
|
||||||
SubscribeLocalEvent<PotentiallyUpdateDamageOverlay>(OnPotentiallyUpdateDamageOverlay); // Offbrand
|
SubscribeLocalEvent<bPotentiallyUpdateDamageOverlayEventb>(OnPotentiallyUpdateDamageOverlay); // Offbrand
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnPlayerAttach(LocalPlayerAttachedEvent args)
|
private void OnPlayerAttach(LocalPlayerAttachedEvent args)
|
||||||
@@ -86,7 +86,7 @@ public sealed class DamageOverlayUiController : UIController
|
|||||||
TryUpdateWoundableOverlays(entity);
|
TryUpdateWoundableOverlays(entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnPotentiallyUpdateDamageOverlay(ref PotentiallyUpdateDamageOverlay args)
|
private void OnPotentiallyUpdateDamageOverlay(ref bPotentiallyUpdateDamageOverlayEventb args)
|
||||||
{
|
{
|
||||||
if (args.Target != _playerManager.LocalEntity)
|
if (args.Target != _playerManager.LocalEntity)
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -17,9 +17,14 @@ public sealed class SurgeryGuideBoundUserInterface : BoundUserInterface
|
|||||||
{
|
{
|
||||||
base.Open();
|
base.Open();
|
||||||
|
|
||||||
|
if (!EntMan.TryGetComponent<SurgeryGuideTargetComponent>(Owner, out var comp))
|
||||||
|
return;
|
||||||
|
|
||||||
_menu = this.CreateWindow<SurgeryGuideMenu>();
|
_menu = this.CreateWindow<SurgeryGuideMenu>();
|
||||||
|
_menu.Category = comp.Category;
|
||||||
_menu.OnSurgerySelected += OnSurgerySelected;
|
_menu.OnSurgerySelected += OnSurgerySelected;
|
||||||
_menu.OnCleanUp += OnCleanUp;
|
_menu.OnCleanUp += OnCleanUp;
|
||||||
|
_menu.Populate();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnSurgerySelected(ProtoId<ConstructionPrototype> surgery)
|
private void OnSurgerySelected(ProtoId<ConstructionPrototype> surgery)
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ public sealed partial class SurgeryGuideMenu : FancyWindow
|
|||||||
public event Action? OnCleanUp;
|
public event Action? OnCleanUp;
|
||||||
|
|
||||||
private ConstructionPrototype? _selectedSurgery;
|
private ConstructionPrototype? _selectedSurgery;
|
||||||
|
public string Category = string.Empty;
|
||||||
|
|
||||||
public SurgeryGuideMenu()
|
public SurgeryGuideMenu()
|
||||||
{
|
{
|
||||||
@@ -53,8 +54,6 @@ public sealed partial class SurgeryGuideMenu : FancyWindow
|
|||||||
|
|
||||||
PossibleSurgeries.GenerateItem += GenerateButton;
|
PossibleSurgeries.GenerateItem += GenerateButton;
|
||||||
PossibleSurgeries.ItemKeyBindDown += OnSelectSurgery;
|
PossibleSurgeries.ItemKeyBindDown += OnSelectSurgery;
|
||||||
|
|
||||||
Populate();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void ExitedTree()
|
protected override void ExitedTree()
|
||||||
@@ -129,14 +128,22 @@ public sealed partial class SurgeryGuideMenu : FancyWindow
|
|||||||
|
|
||||||
foreach (var proto in _prototypeManager.EnumeratePrototypes<ConstructionPrototype>())
|
foreach (var proto in _prototypeManager.EnumeratePrototypes<ConstructionPrototype>())
|
||||||
{
|
{
|
||||||
if (proto.Category != "Surgery")
|
if (proto.Category != Category)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
listData.Add(new SurgeryListData(proto));
|
listData.Add(new SurgeryListData(proto));
|
||||||
}
|
}
|
||||||
|
|
||||||
listData.Sort((
|
listData.Sort((a, b) =>
|
||||||
a, b) => string.Compare(Loc.GetString(a.Construction.SetName!.Value), Loc.GetString(b.Construction.SetName!.Value), StringComparison.InvariantCulture));
|
{
|
||||||
|
if (a.Construction.SetName is not { } aName)
|
||||||
|
throw new InvalidOperationException($"Construction {a.Construction.ID} does not have a name");
|
||||||
|
|
||||||
|
if (b.Construction.SetName is not { } bName)
|
||||||
|
throw new InvalidOperationException($"Construction {b.Construction.ID} does not have a name");
|
||||||
|
|
||||||
|
return string.Compare(Loc.GetString(aName), Loc.GetString(bName), StringComparison.InvariantCulture);
|
||||||
|
});
|
||||||
|
|
||||||
PossibleSurgeries.PopulateList(listData);
|
PossibleSurgeries.PopulateList(listData);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -138,7 +138,7 @@ namespace Content.IntegrationTests.Tests.Construction
|
|||||||
foreach (var proto in protoMan.EnumeratePrototypes<ConstructionPrototype>())
|
foreach (var proto in protoMan.EnumeratePrototypes<ConstructionPrototype>())
|
||||||
{
|
{
|
||||||
// Begin Offbrand
|
// Begin Offbrand
|
||||||
if (proto.Type == ConstructionType.Surgery)
|
if (proto.Type == ConstructionType.NodeToNode)
|
||||||
continue;
|
continue;
|
||||||
// End Offbrand
|
// End Offbrand
|
||||||
var start = proto.StartNode;
|
var start = proto.StartNode;
|
||||||
|
|||||||
@@ -274,7 +274,7 @@ namespace Content.Server.Body.Systems
|
|||||||
if (ent.Comp1.MetabolizingReagents.Contains(metaboliteReagent))
|
if (ent.Comp1.MetabolizingReagents.Contains(metaboliteReagent))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (!_prototypeManager.TryIndex(metaboliteReagent, out var proto) || proto.Metabolisms is not { } metabolisms)
|
if (!_prototypeManager.Resolve(metaboliteReagent, out var proto) || proto.Metabolisms is not { } metabolisms)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (ent.Comp1.MetabolismGroups is null)
|
if (ent.Comp1.MetabolismGroups is null)
|
||||||
|
|||||||
@@ -146,7 +146,7 @@ public sealed class SolutionInjectOnCollideSystem : EntitySystem
|
|||||||
foreach (var targetBloodstream in targetBloodstreams)
|
foreach (var targetBloodstream in targetBloodstreams)
|
||||||
{
|
{
|
||||||
// Begin Offbrand
|
// Begin Offbrand
|
||||||
var beforeInject = new Content.Shared._Offbrand.Chemistry.BeforeInjectOnEventEvent { InjectionAmount = volumePerBloodstream };
|
var beforeInject = new Content.Shared._Offbrand.Chemistry.BeforeInjectOnEventEvent(volumePerBloodstream);
|
||||||
RaiseLocalEvent(targetBloodstream, ref beforeInject);
|
RaiseLocalEvent(targetBloodstream, ref beforeInject);
|
||||||
if (beforeInject.InjectionAmount < 0)
|
if (beforeInject.InjectionAmount < 0)
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
@@ -88,19 +88,13 @@ namespace Content.Server.Construction
|
|||||||
args.PushMarkup(Loc.GetString("deconstruction-header-text") + "\n");
|
args.PushMarkup(Loc.GetString("deconstruction-header-text") + "\n");
|
||||||
}
|
}
|
||||||
// Begin Offbrand
|
// Begin Offbrand
|
||||||
else if (target.SurgeryName is { } surgery)
|
|
||||||
{
|
|
||||||
args.PushMarkup(Loc.GetString(
|
|
||||||
"construction-component-to-perform-header",
|
|
||||||
("name", Loc.GetString(surgery))) + "\n");
|
|
||||||
}
|
|
||||||
// End Offbrand
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
args.PushMarkup(Loc.GetString(
|
args.PushMarkup(Loc.GetString(
|
||||||
"construction-component-to-create-header",
|
target.Header,
|
||||||
("targetName", target.Name)) + "\n");
|
("targetName", target.LocalizedName is { } name ? Loc.GetString(name) : target.Name)) + "\n");
|
||||||
}
|
}
|
||||||
|
// End Offbrand
|
||||||
}
|
}
|
||||||
|
|
||||||
if (component.EdgeIndex == null && GetTargetEdge(uid, component) is {} targetEdge)
|
if (component.EdgeIndex == null && GetTargetEdge(uid, component) is {} targetEdge)
|
||||||
@@ -175,7 +169,7 @@ namespace Content.Server.Construction
|
|||||||
{
|
{
|
||||||
Localization = construction.Type switch {
|
Localization = construction.Type switch {
|
||||||
ConstructionType.Structure => "construction-presenter-to-build",
|
ConstructionType.Structure => "construction-presenter-to-build",
|
||||||
ConstructionType.Surgery => "construction-presenter-to-surgery",
|
ConstructionType.NodeToNode => "construction-presenter-to-node-to-node", // Offbrand
|
||||||
_ => "construction-presenter-to-craft",
|
_ => "construction-presenter-to-craft",
|
||||||
},
|
},
|
||||||
EntryNumber = step,
|
EntryNumber = step,
|
||||||
@@ -194,7 +188,7 @@ namespace Content.Server.Construction
|
|||||||
return null;
|
return null;
|
||||||
|
|
||||||
// First steps are handled specially.
|
// First steps are handled specially.
|
||||||
if (step == 1 && construction.Category != "Surgery") // Offbrand
|
if (step == 1 && construction.Type != ConstructionType.NodeToNode) // Offbrand
|
||||||
{
|
{
|
||||||
foreach (var graphStep in edge.Steps)
|
foreach (var graphStep in edge.Steps)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -211,13 +211,7 @@ public sealed partial class RevenantSystem
|
|||||||
|
|
||||||
//KILL THEMMMM
|
//KILL THEMMMM
|
||||||
|
|
||||||
// Begin Offbrand Removals
|
_damage.TryChangeDamage(args.Args.Target, component.HarvestDamage, true, origin: uid); // Offbrand - use a fixed amount
|
||||||
// if (!_mobThresholdSystem.TryGetThresholdForState(args.Args.Target.Value, MobState.Dead, out var damage))
|
|
||||||
// return;
|
|
||||||
// End Offbrand Removals
|
|
||||||
DamageSpecifier dspec = new();
|
|
||||||
dspec.DamageDict.Add("Cold", component.HarvestColdDamage); // Offbrand - use a fixed amount of cold
|
|
||||||
_damage.TryChangeDamage(args.Args.Target, dspec, true, origin: uid);
|
|
||||||
|
|
||||||
args.Handled = true;
|
args.Handled = true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,9 @@ using Robust.Shared.Prototypes;
|
|||||||
|
|
||||||
namespace Content.Server._Offbrand.Surgery;
|
namespace Content.Server._Offbrand.Surgery;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Sets the current node of the construction graph, and clears the pathfinding target if the repeat conditions are not met
|
||||||
|
/// </summary>
|
||||||
[DataDefinition]
|
[DataDefinition]
|
||||||
public sealed partial class SetNode : IGraphAction
|
public sealed partial class SetNode : IGraphAction
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ public sealed class SurgeryGuideTargetSystem : SharedSurgeryGuideTargetSystem
|
|||||||
protected override void OnStartSurgery(Entity<SurgeryGuideTargetComponent> ent, ref SurgeryGuideStartSurgeryMessage args)
|
protected override void OnStartSurgery(Entity<SurgeryGuideTargetComponent> ent, ref SurgeryGuideStartSurgeryMessage args)
|
||||||
{
|
{
|
||||||
base.OnStartSurgery(ent, ref args);
|
base.OnStartSurgery(ent, ref args);
|
||||||
if (!_prototype.TryIndex(args.Prototype, out var construction))
|
if (!_prototype.Resolve(args.Prototype, out var construction))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
_construction.SetPathfindingTarget(ent, construction.TargetNode);
|
_construction.SetPathfindingTarget(ent, construction.TargetNode);
|
||||||
|
|||||||
@@ -8,9 +8,15 @@ namespace Content.Server._Offbrand.VariationPass;
|
|||||||
[RegisterComponent]
|
[RegisterComponent]
|
||||||
public sealed partial class SupplyNearLatheVariationPassComponent : Component
|
public sealed partial class SupplyNearLatheVariationPassComponent : Component
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// The prototype of the lathe to look for
|
||||||
|
/// </summary>
|
||||||
[DataField(required: true)]
|
[DataField(required: true)]
|
||||||
public EntProtoId LathePrototype;
|
public EntProtoId LathePrototype;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The entity to spawn on said lathe
|
||||||
|
/// </summary>
|
||||||
[DataField(required: true)]
|
[DataField(required: true)]
|
||||||
public EntProtoId EntityToSpawn;
|
public EntProtoId EntityToSpawn;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -329,7 +329,7 @@ namespace Content.Shared.Chemistry.Reagent
|
|||||||
|
|
||||||
public string? Describe(IPrototypeManager prototype, IEntitySystemManager entSys)
|
public string? Describe(IPrototypeManager prototype, IEntitySystemManager entSys)
|
||||||
{
|
{
|
||||||
if (!prototype.TryIndex(StatusEffect, out var effectProtoData))
|
if (!prototype.Resolve(StatusEffect, out var effectProtoData))
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
return Loc.GetString("reagent-guidebook-status-effect", ("effect", effectProtoData.Name ?? string.Empty),
|
return Loc.GetString("reagent-guidebook-status-effect", ("effect", effectProtoData.Name ?? string.Empty),
|
||||||
|
|||||||
@@ -33,7 +33,10 @@ namespace Content.Shared.Construction
|
|||||||
|
|
||||||
// Begin Offbrand
|
// Begin Offbrand
|
||||||
[DataField]
|
[DataField]
|
||||||
public LocId? SurgeryName;
|
public LocId? LocalizedName;
|
||||||
|
|
||||||
|
[DataField]
|
||||||
|
public LocId Header = "construction-component-to-create-header";
|
||||||
// End Offbrand
|
// End Offbrand
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -98,5 +98,5 @@ public enum ConstructionType
|
|||||||
{
|
{
|
||||||
Structure,
|
Structure,
|
||||||
Item,
|
Item,
|
||||||
Surgery, // Offbrand
|
NodeToNode, // Offbrand
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -443,7 +443,7 @@ public sealed class MobThresholdSystem : EntitySystem
|
|||||||
// Begin Offbrand
|
// Begin Offbrand
|
||||||
private void MobThresholdMapInit(Entity<MobThresholdsComponent> ent, ref MapInitEvent args)
|
private void MobThresholdMapInit(Entity<MobThresholdsComponent> ent, ref MapInitEvent args)
|
||||||
{
|
{
|
||||||
var overlayUpdate = new Content.Shared._Offbrand.Wounds.PotentiallyUpdateDamageOverlay(ent);
|
var overlayUpdate = new Content.Shared._Offbrand.Wounds.bPotentiallyUpdateDamageOverlayEventb(ent);
|
||||||
RaiseLocalEvent(ent, ref overlayUpdate);
|
RaiseLocalEvent(ent, ref overlayUpdate);
|
||||||
}
|
}
|
||||||
// End Offbrand
|
// End Offbrand
|
||||||
|
|||||||
@@ -221,5 +221,11 @@ public sealed partial class RevenantComponent : Component
|
|||||||
/// Offbrand - how much cold damage to deal on harvest
|
/// Offbrand - how much cold damage to deal on harvest
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[DataField]
|
[DataField]
|
||||||
public FixedPoint2 HarvestColdDamage = 200;
|
public Content.Shared.Damage.DamageSpecifier HarvestDamage = new()
|
||||||
|
{
|
||||||
|
DamageDict = new()
|
||||||
|
{
|
||||||
|
{ "Cold", 200 },
|
||||||
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,9 @@ using Robust.Shared.Prototypes;
|
|||||||
|
|
||||||
namespace Content.Shared._Offbrand.Buckle;
|
namespace Content.Shared._Offbrand.Buckle;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Applies a status effect to the strapped entity whilst it is strapped
|
||||||
|
/// </summary>
|
||||||
[RegisterComponent, NetworkedComponent]
|
[RegisterComponent, NetworkedComponent]
|
||||||
[Access(typeof(StatusEffectOnStrapSystem))]
|
[Access(typeof(StatusEffectOnStrapSystem))]
|
||||||
public sealed partial class StatusEffectOnStrapComponent : Component
|
public sealed partial class StatusEffectOnStrapComponent : Component
|
||||||
|
|||||||
@@ -2,8 +2,11 @@ using Content.Shared.FixedPoint;
|
|||||||
|
|
||||||
namespace Content.Shared._Offbrand.Chemistry;
|
namespace Content.Shared._Offbrand.Chemistry;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Event raised before injecting in response to an event, to allow modifying how much is injected
|
||||||
|
/// </summary>
|
||||||
[ByRefEvent]
|
[ByRefEvent]
|
||||||
public struct BeforeInjectOnEventEvent
|
public struct BeforeInjectOnEventEvent(FixedPoint2 injectionAmount)
|
||||||
{
|
{
|
||||||
public FixedPoint2 InjectionAmount;
|
public FixedPoint2 InjectionAmount = injectionAmount;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,10 @@
|
|||||||
using Content.Shared.Chemistry.Reagent;
|
using Content.Shared.Chemistry.Reagent;
|
||||||
using Content.Shared.EntityEffects;
|
using Content.Shared.EntityEffects;
|
||||||
using Content.Shared.FixedPoint;
|
using Content.Shared.FixedPoint;
|
||||||
|
using Content.Shared.Random.Helpers;
|
||||||
using Robust.Shared.Prototypes;
|
using Robust.Shared.Prototypes;
|
||||||
using Robust.Shared.Random;
|
using Robust.Shared.Random;
|
||||||
|
using Robust.Shared.Timing;
|
||||||
|
|
||||||
namespace Content.Shared._Offbrand.EntityEffects;
|
namespace Content.Shared._Offbrand.EntityEffects;
|
||||||
|
|
||||||
@@ -25,7 +27,11 @@ public sealed partial class AdjustReagentGaussian : EntityEffect
|
|||||||
if (reagentArgs.Source == null)
|
if (reagentArgs.Source == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var rand = IoCManager.Resolve<IRobustRandom>();
|
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(μ, σ);
|
var amount = rand.NextGaussian(μ, σ);
|
||||||
amount *= reagentArgs.Scale.Double();
|
amount *= reagentArgs.Scale.Double();
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,11 @@ using Robust.Shared.Serialization;
|
|||||||
namespace Content.Shared._Offbrand.Surgery;
|
namespace Content.Shared._Offbrand.Surgery;
|
||||||
|
|
||||||
[RegisterComponent]
|
[RegisterComponent]
|
||||||
public sealed partial class SurgeryGuideTargetComponent : Component;
|
public sealed partial class SurgeryGuideTargetComponent : Component
|
||||||
|
{
|
||||||
|
[DataField]
|
||||||
|
public string Category = "Surgery";
|
||||||
|
}
|
||||||
|
|
||||||
[Serializable, NetSerializable]
|
[Serializable, NetSerializable]
|
||||||
public enum SurgeryGuideUiKey : byte
|
public enum SurgeryGuideUiKey : byte
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ public sealed partial class BrainDamageSystem : EntitySystem
|
|||||||
var notifDamage = new AfterBrainDamageChanged();
|
var notifDamage = new AfterBrainDamageChanged();
|
||||||
RaiseLocalEvent(ent, ref notifDamage);
|
RaiseLocalEvent(ent, ref notifDamage);
|
||||||
|
|
||||||
var overlays = new PotentiallyUpdateDamageOverlay(ent);
|
var overlays = new bPotentiallyUpdateDamageOverlayEventb(ent);
|
||||||
RaiseLocalEvent(ent, ref overlays, true);
|
RaiseLocalEvent(ent, ref overlays, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -97,7 +97,7 @@ public sealed partial class BrainDamageSystem : EntitySystem
|
|||||||
var notifDamage = new AfterBrainDamageChanged();
|
var notifDamage = new AfterBrainDamageChanged();
|
||||||
RaiseLocalEvent(ent, ref notifDamage);
|
RaiseLocalEvent(ent, ref notifDamage);
|
||||||
|
|
||||||
var overlays = new PotentiallyUpdateDamageOverlay(ent);
|
var overlays = new bPotentiallyUpdateDamageOverlayEventb(ent);
|
||||||
RaiseLocalEvent(ent, ref overlays, true);
|
RaiseLocalEvent(ent, ref overlays, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -112,7 +112,7 @@ public sealed partial class BrainDamageSystem : EntitySystem
|
|||||||
var notif = new AfterBrainDamageChanged();
|
var notif = new AfterBrainDamageChanged();
|
||||||
RaiseLocalEvent(ent, ref notif);
|
RaiseLocalEvent(ent, ref notif);
|
||||||
|
|
||||||
var overlays = new PotentiallyUpdateDamageOverlay(ent);
|
var overlays = new bPotentiallyUpdateDamageOverlayEventb(ent);
|
||||||
RaiseLocalEvent(ent, ref overlays, true);
|
RaiseLocalEvent(ent, ref overlays, true);
|
||||||
}
|
}
|
||||||
public void TryChangeBrainOxygenation(Entity<BrainDamageComponent?> ent, FixedPoint2 amount)
|
public void TryChangeBrainOxygenation(Entity<BrainDamageComponent?> ent, FixedPoint2 amount)
|
||||||
@@ -126,7 +126,7 @@ public sealed partial class BrainDamageSystem : EntitySystem
|
|||||||
var notif = new AfterBrainOxygenChanged();
|
var notif = new AfterBrainOxygenChanged();
|
||||||
RaiseLocalEvent(ent, ref notif);
|
RaiseLocalEvent(ent, ref notif);
|
||||||
|
|
||||||
var overlays = new PotentiallyUpdateDamageOverlay(ent);
|
var overlays = new bPotentiallyUpdateDamageOverlayEventb(ent);
|
||||||
RaiseLocalEvent(ent, ref overlays, true);
|
RaiseLocalEvent(ent, ref overlays, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -185,7 +185,7 @@ public sealed partial class BrainDamageSystem : EntitySystem
|
|||||||
var notif = new AfterBrainDamageChanged();
|
var notif = new AfterBrainDamageChanged();
|
||||||
RaiseLocalEvent(ent, ref notif);
|
RaiseLocalEvent(ent, ref notif);
|
||||||
|
|
||||||
var overlays = new PotentiallyUpdateDamageOverlay(ent);
|
var overlays = new bPotentiallyUpdateDamageOverlayEventb(ent);
|
||||||
RaiseLocalEvent(ent, ref overlays, true);
|
RaiseLocalEvent(ent, ref overlays, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -215,7 +215,7 @@ public sealed partial class BrainDamageSystem : EntitySystem
|
|||||||
var notif = new AfterBrainDamageChanged();
|
var notif = new AfterBrainDamageChanged();
|
||||||
RaiseLocalEvent(ent, ref notif);
|
RaiseLocalEvent(ent, ref notif);
|
||||||
|
|
||||||
var overlays = new PotentiallyUpdateDamageOverlay(ent);
|
var overlays = new bPotentiallyUpdateDamageOverlayEventb(ent);
|
||||||
RaiseLocalEvent(ent, ref overlays, true);
|
RaiseLocalEvent(ent, ref overlays, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ public sealed partial class BrainDamageThresholdsSystem : EntitySystem
|
|||||||
ent.Comp.CurrentDamageEffect = damageEffect;
|
ent.Comp.CurrentDamageEffect = damageEffect;
|
||||||
Dirty(ent);
|
Dirty(ent);
|
||||||
|
|
||||||
var overlays = new PotentiallyUpdateDamageOverlay(ent);
|
var overlays = new bPotentiallyUpdateDamageOverlayEventb(ent);
|
||||||
RaiseLocalEvent(ent, ref overlays, true);
|
RaiseLocalEvent(ent, ref overlays, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -92,7 +92,7 @@ public sealed partial class BrainDamageThresholdsSystem : EntitySystem
|
|||||||
ent.Comp.CurrentOxygenEffect = oxygenEffect;
|
ent.Comp.CurrentOxygenEffect = oxygenEffect;
|
||||||
Dirty(ent);
|
Dirty(ent);
|
||||||
|
|
||||||
var overlays = new PotentiallyUpdateDamageOverlay(ent);
|
var overlays = new bPotentiallyUpdateDamageOverlayEventb(ent);
|
||||||
RaiseLocalEvent(ent, ref overlays, true);
|
RaiseLocalEvent(ent, ref overlays, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -119,7 +119,7 @@ public sealed partial class BrainDamageThresholdsSystem : EntitySystem
|
|||||||
{
|
{
|
||||||
args.State = ThresholdHelpers.Max(ent.Comp.CurrentState, args.State);
|
args.State = ThresholdHelpers.Max(ent.Comp.CurrentState, args.State);
|
||||||
|
|
||||||
var overlays = new PotentiallyUpdateDamageOverlay(ent);
|
var overlays = new bPotentiallyUpdateDamageOverlayEventb(ent);
|
||||||
RaiseLocalEvent(ent, ref overlays, true);
|
RaiseLocalEvent(ent, ref overlays, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ public sealed partial class HeartSystem : EntitySystem
|
|||||||
var strainChangedEvt = new AfterStrainChangedEvent();
|
var strainChangedEvt = new AfterStrainChangedEvent();
|
||||||
RaiseLocalEvent(ent, ref strainChangedEvt);
|
RaiseLocalEvent(ent, ref strainChangedEvt);
|
||||||
|
|
||||||
var overlays = new PotentiallyUpdateDamageOverlay(ent);
|
var overlays = new bPotentiallyUpdateDamageOverlayEventb(ent);
|
||||||
RaiseLocalEvent(ent, ref overlays, true);
|
RaiseLocalEvent(ent, ref overlays, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -124,7 +124,7 @@ public sealed partial class HeartSystem : EntitySystem
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
var overlays = new PotentiallyUpdateDamageOverlay(uid);
|
var overlays = new bPotentiallyUpdateDamageOverlayEventb(uid);
|
||||||
RaiseLocalEvent(uid, ref overlays, true);
|
RaiseLocalEvent(uid, ref overlays, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ public sealed partial class PainSystem : EntitySystem
|
|||||||
var evt = new AfterShockChangeEvent();
|
var evt = new AfterShockChangeEvent();
|
||||||
RaiseLocalEvent(uid, ref evt);
|
RaiseLocalEvent(uid, ref evt);
|
||||||
|
|
||||||
var overlays = new PotentiallyUpdateDamageOverlay(uid);
|
var overlays = new bPotentiallyUpdateDamageOverlayEventb(uid);
|
||||||
RaiseLocalEvent(uid, ref overlays, true);
|
RaiseLocalEvent(uid, ref overlays, true);
|
||||||
|
|
||||||
Dirty(uid, pain);
|
Dirty(uid, pain);
|
||||||
@@ -82,7 +82,7 @@ public sealed partial class PainSystem : EntitySystem
|
|||||||
var evt = new AfterShockChangeEvent();
|
var evt = new AfterShockChangeEvent();
|
||||||
RaiseLocalEvent(ent, ref evt);
|
RaiseLocalEvent(ent, ref evt);
|
||||||
|
|
||||||
var overlays = new PotentiallyUpdateDamageOverlay(ent);
|
var overlays = new bPotentiallyUpdateDamageOverlayEventb(ent);
|
||||||
RaiseLocalEvent(ent, ref overlays, true);
|
RaiseLocalEvent(ent, ref overlays, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ public sealed partial class ShockThresholdsSystem : EntitySystem
|
|||||||
{
|
{
|
||||||
args.State = ThresholdHelpers.Max(ent.Comp.CurrentMobState, args.State);
|
args.State = ThresholdHelpers.Max(ent.Comp.CurrentMobState, args.State);
|
||||||
|
|
||||||
var overlays = new PotentiallyUpdateDamageOverlay(ent);
|
var overlays = new bPotentiallyUpdateDamageOverlayEventb(ent);
|
||||||
RaiseLocalEvent(ent, ref overlays, true);
|
RaiseLocalEvent(ent, ref overlays, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,4 +21,4 @@ public record struct BeforeDamageCommitEvent(DamageSpecifier Damage, bool ForceR
|
|||||||
/// Raised when the values for a damage overlay may have changed
|
/// Raised when the values for a damage overlay may have changed
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[ByRefEvent]
|
[ByRefEvent]
|
||||||
public record struct PotentiallyUpdateDamageOverlay(EntityUid Target);
|
public record struct bPotentiallyUpdateDamageOverlayEventb(EntityUid Target);
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
construction-presenter-to-surgery = To perform this, first you need to:
|
construction-presenter-to-node-to-node = To perform this, first you need to:
|
||||||
|
|
||||||
construction-examine-status-effect-should-have = The target needs to have { $effect }.
|
construction-examine-status-effect-should-have = The target needs to have { $effect }.
|
||||||
construction-examine-status-effect-should-not-have = The target needs to not have { $effect }.
|
construction-examine-status-effect-should-not-have = The target needs to not have { $effect }.
|
||||||
@@ -21,4 +21,4 @@ construction-step-heart-damage-range = { $max ->
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
construction-component-to-perform-header = To perform {$name}...
|
construction-component-to-perform-header = To perform {$targetName}...
|
||||||
|
|||||||
@@ -870,13 +870,15 @@
|
|||||||
- !type:TotalDamage
|
- !type:TotalDamage
|
||||||
max: 100 # Offbrand
|
max: 100 # Offbrand
|
||||||
damage:
|
damage:
|
||||||
|
# Begin Offbrand Changes
|
||||||
groups:
|
groups:
|
||||||
Brute: -0.5 # Offbrand
|
Brute: -0.3 # Offbrand
|
||||||
types:
|
types:
|
||||||
Poison: -0.5 ##Should be about what it was when it healed the toxin group
|
Poison: -0.2 ##Should be about what it was when it healed the toxin group
|
||||||
Heat: -0.33
|
Heat: -0.2
|
||||||
Shock: -0.33
|
Shock: -0.2
|
||||||
Cold: -0.33
|
Cold: -0.2
|
||||||
|
# End Offbrand Changes
|
||||||
|
|
||||||
- type: reagent
|
- type: reagent
|
||||||
id: Lipozine
|
id: Lipozine
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
startNode: Base
|
startNode: Base
|
||||||
targetNode: BoneDeathTreatment
|
targetNode: BoneDeathTreatment
|
||||||
category: Surgery
|
category: Surgery
|
||||||
objectType: Surgery
|
objectType: NodeToNode
|
||||||
|
|
||||||
- type: construction
|
- type: construction
|
||||||
hide: true
|
hide: true
|
||||||
@@ -18,7 +18,7 @@
|
|||||||
startNode: Base
|
startNode: Base
|
||||||
targetNode: HeartTreatmentSuture
|
targetNode: HeartTreatmentSuture
|
||||||
category: Surgery
|
category: Surgery
|
||||||
objectType: Surgery
|
objectType: NodeToNode
|
||||||
|
|
||||||
- type: construction
|
- type: construction
|
||||||
hide: true
|
hide: true
|
||||||
@@ -29,7 +29,7 @@
|
|||||||
startNode: Base
|
startNode: Base
|
||||||
targetNode: HeartTreatmentMedicatedSuture
|
targetNode: HeartTreatmentMedicatedSuture
|
||||||
category: Surgery
|
category: Surgery
|
||||||
objectType: Surgery
|
objectType: NodeToNode
|
||||||
|
|
||||||
- type: construction
|
- type: construction
|
||||||
hide: true
|
hide: true
|
||||||
@@ -40,7 +40,7 @@
|
|||||||
startNode: Base
|
startNode: Base
|
||||||
targetNode: HuskingTreatment
|
targetNode: HuskingTreatment
|
||||||
category: Surgery
|
category: Surgery
|
||||||
objectType: Surgery
|
objectType: NodeToNode
|
||||||
|
|
||||||
- type: construction
|
- type: construction
|
||||||
hide: true
|
hide: true
|
||||||
@@ -51,7 +51,7 @@
|
|||||||
startNode: Base
|
startNode: Base
|
||||||
targetNode: WoundFractureTreatment
|
targetNode: WoundFractureTreatment
|
||||||
category: Surgery
|
category: Surgery
|
||||||
objectType: Surgery
|
objectType: NodeToNode
|
||||||
|
|
||||||
- type: construction
|
- type: construction
|
||||||
hide: true
|
hide: true
|
||||||
@@ -62,7 +62,7 @@
|
|||||||
startNode: Base
|
startNode: Base
|
||||||
targetNode: WoundArterialTreatment
|
targetNode: WoundArterialTreatment
|
||||||
category: Surgery
|
category: Surgery
|
||||||
objectType: Surgery
|
objectType: NodeToNode
|
||||||
|
|
||||||
- type: construction
|
- type: construction
|
||||||
hide: true
|
hide: true
|
||||||
@@ -73,7 +73,7 @@
|
|||||||
startNode: Base
|
startNode: Base
|
||||||
targetNode: CavityManipulationInsert
|
targetNode: CavityManipulationInsert
|
||||||
category: Surgery
|
category: Surgery
|
||||||
objectType: Surgery
|
objectType: NodeToNode
|
||||||
|
|
||||||
- type: construction
|
- type: construction
|
||||||
hide: true
|
hide: true
|
||||||
@@ -84,4 +84,4 @@
|
|||||||
startNode: Base
|
startNode: Base
|
||||||
targetNode: CavityManipulationRemoval
|
targetNode: CavityManipulationRemoval
|
||||||
category: Surgery
|
category: Surgery
|
||||||
objectType: Surgery
|
objectType: NodeToNode
|
||||||
|
|||||||
@@ -3,7 +3,8 @@
|
|||||||
start: Base
|
start: Base
|
||||||
graph:
|
graph:
|
||||||
- node: Base
|
- node: Base
|
||||||
surgeryName: surgery-cleanup-name
|
header: construction-component-to-perform-header
|
||||||
|
localizedName: surgery-cleanup-name
|
||||||
edges:
|
edges:
|
||||||
- to: OpenIncision
|
- to: OpenIncision
|
||||||
steps:
|
steps:
|
||||||
@@ -102,13 +103,15 @@
|
|||||||
- tool: BoneMending
|
- tool: BoneMending
|
||||||
doAfter: 1
|
doAfter: 1
|
||||||
- node: WoundFractureTreatment
|
- node: WoundFractureTreatment
|
||||||
surgeryName: surgery-wound-fracture-treatment-name
|
header: construction-component-to-perform-header
|
||||||
|
localizedName: surgery-wound-fracture-treatment-name
|
||||||
actions:
|
actions:
|
||||||
- !type:SetNode
|
- !type:SetNode
|
||||||
node: RetractedIncision
|
node: RetractedIncision
|
||||||
repeatConditions: *fracture-conditions
|
repeatConditions: *fracture-conditions
|
||||||
- node: WoundArterialTreatment
|
- node: WoundArterialTreatment
|
||||||
surgeryName: surgery-wound-arterial-treatment-name
|
header: construction-component-to-perform-header
|
||||||
|
localizedName: surgery-wound-arterial-treatment-name
|
||||||
actions:
|
actions:
|
||||||
- !type:SetNode
|
- !type:SetNode
|
||||||
node: RetractedIncision
|
node: RetractedIncision
|
||||||
@@ -181,25 +184,29 @@
|
|||||||
- tool: BoneMending
|
- tool: BoneMending
|
||||||
doAfter: 1
|
doAfter: 1
|
||||||
- node: BoneDeathTreatment
|
- node: BoneDeathTreatment
|
||||||
surgeryName: surgery-bone-death-treatment-name
|
header: construction-component-to-perform-header
|
||||||
|
localizedName: surgery-bone-death-treatment-name
|
||||||
actions:
|
actions:
|
||||||
- !type:SetNode
|
- !type:SetNode
|
||||||
node: OpenRibCage
|
node: OpenRibCage
|
||||||
repeatConditions: *bone-death-conditions
|
repeatConditions: *bone-death-conditions
|
||||||
- node: HeartTreatmentSuture
|
- node: HeartTreatmentSuture
|
||||||
surgeryName: surgery-heart-treatment-suture-name
|
header: construction-component-to-perform-header
|
||||||
|
localizedName: surgery-heart-treatment-suture-name
|
||||||
actions:
|
actions:
|
||||||
- !type:SetNode
|
- !type:SetNode
|
||||||
node: OpenRibCage
|
node: OpenRibCage
|
||||||
repeatConditions: *heart-damage-conditions
|
repeatConditions: *heart-damage-conditions
|
||||||
- node: HeartTreatmentMedicatedSuture
|
- node: HeartTreatmentMedicatedSuture
|
||||||
surgeryName: surgery-heart-treatment-medicated-suture-name
|
header: construction-component-to-perform-header
|
||||||
|
localizedName: surgery-heart-treatment-medicated-suture-name
|
||||||
actions:
|
actions:
|
||||||
- !type:SetNode
|
- !type:SetNode
|
||||||
node: OpenRibCage
|
node: OpenRibCage
|
||||||
repeatConditions: *heart-damage-conditions
|
repeatConditions: *heart-damage-conditions
|
||||||
- node: HuskingTreatment
|
- node: HuskingTreatment
|
||||||
surgeryName: surgery-husking-treatment-name
|
header: construction-component-to-perform-header
|
||||||
|
localizedName: surgery-husking-treatment-name
|
||||||
actions:
|
actions:
|
||||||
- !type:SetNode
|
- !type:SetNode
|
||||||
node: OpenRibCage
|
node: OpenRibCage
|
||||||
@@ -243,12 +250,14 @@
|
|||||||
- tool: Clamping
|
- tool: Clamping
|
||||||
doAfter: 2
|
doAfter: 2
|
||||||
- node: CavityManipulationInsert
|
- node: CavityManipulationInsert
|
||||||
surgeryName: surgery-cavity-manipulation-insert-name
|
header: construction-component-to-perform-header
|
||||||
|
localizedName: surgery-cavity-manipulation-insert-name
|
||||||
actions:
|
actions:
|
||||||
- !type:SetNode
|
- !type:SetNode
|
||||||
node: CavityManipulationOpen
|
node: CavityManipulationOpen
|
||||||
- node: CavityManipulationRemoval
|
- node: CavityManipulationRemoval
|
||||||
surgeryName: surgery-cavity-manipulation-removal-name
|
header: construction-component-to-perform-header
|
||||||
|
localizedName: surgery-cavity-manipulation-removal-name
|
||||||
actions:
|
actions:
|
||||||
- !type:SetNode
|
- !type:SetNode
|
||||||
node: CavityManipulationOpen
|
node: CavityManipulationOpen
|
||||||
|
|||||||
Reference in New Issue
Block a user