Chem guidebook (#17123)
* im good at atomizing. welcome to half-finished chem guides. * wagh * e * save work * aa * woweee UI * finishing the last of it * don't actually update the engine :( --------- Co-authored-by: moonheart08 <moonheart08@users.noreply.github.com>
This commit is contained in:
@@ -16,6 +16,10 @@ namespace Content.Server.Chemistry.ReactionEffects
|
||||
/// </summary>
|
||||
[DataField("temperature", required: true)] private float _temperature;
|
||||
|
||||
protected override string? ReagentEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys)
|
||||
=> Loc.GetString("reagent-effect-guidebook-set-solution-temperature-effect",
|
||||
("chance", Probability), ("temperature", _temperature));
|
||||
|
||||
public override void Effect(ReagentEffectArgs args)
|
||||
{
|
||||
var solution = args.Source;
|
||||
@@ -52,6 +56,10 @@ namespace Content.Server.Chemistry.ReactionEffects
|
||||
/// </summary>
|
||||
[DataField("scaled")] private bool _scaled;
|
||||
|
||||
protected override string? ReagentEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys)
|
||||
=> Loc.GetString("reagent-effect-guidebook-adjust-solution-temperature-effect",
|
||||
("chance", Probability), ("deltasign", MathF.Sign(_delta)), ("mintemp", _minTemp), ("maxtemp", _maxTemp));
|
||||
|
||||
public override void Effect(ReagentEffectArgs args)
|
||||
{
|
||||
var solution = args.Source;
|
||||
@@ -101,11 +109,15 @@ namespace Content.Server.Chemistry.ReactionEffects
|
||||
|
||||
var heatCap = solution.GetHeatCapacity(null);
|
||||
var deltaT = _scaled
|
||||
? _delta / heatCap * (float) args.Quantity
|
||||
? _delta / heatCap * (float) args.Quantity
|
||||
: _delta / heatCap;
|
||||
|
||||
solution.Temperature = Math.Clamp(solution.Temperature + deltaT, _minTemp, _maxTemp);
|
||||
}
|
||||
|
||||
protected override string? ReagentEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys)
|
||||
=> Loc.GetString("reagent-effect-guidebook-adjust-solution-temperature-effect",
|
||||
("chance", Probability), ("deltasign", MathF.Sign(_delta)), ("mintemp", _minTemp), ("maxtemp", _maxTemp));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user