Loc func fix

This commit is contained in:
Charlotte Tezuka
2026-05-15 19:18:07 +02:00
parent 227151c12b
commit 88ea73a366
9 changed files with 62 additions and 37 deletions
@@ -328,7 +328,9 @@ namespace Content.Shared.Chemistry.Reagent
if (!prototype.Resolve(StatusEffect, out var effectProtoData))
return null;
return Loc.GetString("reagent-guidebook-status-effect", ("effect", effectProtoData.Name ?? string.Empty),
var locName = Loc.GetString(effectProtoData.Name); //WL-Changes-offbrand-ftl-fix
return Loc.GetString("reagent-guidebook-status-effect", ("effect", locName), //WL-Changes-offbrand-ftl-fix // effectProtoData.Name ?? string.Empty -> locName
("conditionCount", Conditions?.Length ?? 0),
("conditions",
Content.Shared.Localizations.ContentLocalizationManager.FormatList(Conditions?.Select(x => x.EntityConditionGuidebookText(prototype)).ToList() ??
@@ -24,12 +24,18 @@ public sealed partial class AdjustReagentGaussian : EntityEffectBase<AdjustReage
public override string? EntityEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys)
{
var proto = prototype.Index(Reagent);
var locMu = string.Format("{0:2}", Math.Abs(μ)).Replace('.', ',').TrimEnd('0').TrimEnd(',');
var locSigma = string.Format("{0:2}", Math.Abs(σ)).Replace('.', ',').TrimEnd('0').TrimEnd(',');
return Loc.GetString("entity-effect-guidebook-adjust-reagent-gaussian",
("chance", Probability),
("deltasign", Math.Sign(μ)),
("reagent", proto.LocalizedName),
("mu", Math.Abs(μ)),
("sigma", Math.Abs(σ)));
("sigma", Math.Abs(σ)),
("locMu", locMu),
("locSigma", locSigma));
}
}
@@ -23,8 +23,13 @@ public sealed partial class BrainDamageCondition : EntityConditionBase<BrainDama
public override string EntityConditionGuidebookText(IPrototypeManager prototype)
{
var tMax = Max == FixedPoint2.MaxValue ? (float) int.MaxValue : Max.Float();
var locMax = string.Format("{0:2}", tMax).Replace('.', ',').TrimEnd('0').TrimEnd(',');
var locMin = string.Format("{0:2}", Min.Float()).Replace('.', ',').TrimEnd('0').TrimEnd(',');
return Loc.GetString("entity-condition-guidebook-brain-damage",
("max", Max == FixedPoint2.MaxValue ? (float) int.MaxValue : Max.Float()),
("min", Min.Float()));
("min", Min.Float()),
("locMin", locMin),
("locMax", locMax));
}
}
@@ -12,7 +12,8 @@ public sealed partial class ClampWounds : EntityEffectBase<ClampWounds>
public override string? EntityEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys)
{
return Loc.GetString("entity-effect-guidebook-clamp-wounds", ("probability", Probability), ("chance", Chance));
var locChance = string.Format("{0:2}", Chance*100).Replace('.', ',').TrimEnd('0').TrimEnd(',') + "%";
return Loc.GetString("entity-effect-guidebook-clamp-wounds", ("probability", Probability), ("chance", locChance));
}
}
@@ -15,9 +15,14 @@ public sealed partial class HeartDamageCondition : EntityConditionBase<HeartDama
public override string EntityConditionGuidebookText(IPrototypeManager prototype)
{
var tMax = Max == FixedPoint2.MaxValue ? (float) int.MaxValue : Max.Float();
var locMax = string.Format("{0:2}", tMax).Replace('.', ',').TrimEnd('0').TrimEnd(',');
var locMin = string.Format("{0:2}", Min.Float()).Replace('.', ',').TrimEnd('0').TrimEnd(',');
return Loc.GetString("reagent-effect-condition-guidebook-heart-damage",
("max", Max == FixedPoint2.MaxValue ? (float) int.MaxValue : Max.Float()),
("min", Min.Float()));
("min", Min.Float()),
("locMin", locMin),
("locMax", locMax));
}
}
@@ -15,9 +15,14 @@ public sealed partial class LungDamageCondition : EntityConditionBase<LungDamage
public override string EntityConditionGuidebookText(IPrototypeManager prototype)
{
var tMax = Max == FixedPoint2.MaxValue ? (float) int.MaxValue : Max.Float();
var locMax = string.Format("{0:2}", tMax).Replace('.', ',').TrimEnd('0').TrimEnd(',');
var locMin = string.Format("{0:2}", Min.Float()).Replace('.', ',').TrimEnd('0').TrimEnd(',');
return Loc.GetString("entity-condition-guidebook-lung-damage",
("max", Max == FixedPoint2.MaxValue ? (float) int.MaxValue : Max.Float()),
("min", Min.Float()));
("min", Min.Float()),
("locMin", locMin),
("locMax", locMax));
}
}
@@ -23,19 +23,27 @@ public sealed partial class MetaboliteThresholdCondition : EntityConditionBase<M
{
var reagentProto = prototype.Index(Reagent);
var tMax = Max == FixedPoint2.MaxValue ? (float) int.MaxValue : Max.Float();
var locMax = string.Format("{0:2}", tMax).Replace('.', ',').TrimEnd('0').TrimEnd(',');
var locMin = string.Format("{0:2}", Min.Float()).Replace('.', ',').TrimEnd('0').TrimEnd(',');
if (IncludeBloodstream)
{
return Loc.GetString("entity-condition-guidebook-total-dosage-threshold",
("reagent", reagentProto.LocalizedName),
("max", Max == FixedPoint2.MaxValue ? (float) int.MaxValue : Max.Float()),
("min", Min.Float()));
("min", Min.Float()),
("locMin", locMin),
("locMax", locMax));
}
else
{
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()));
("min", Min.Float()),
("locMin", locMin),
("locMax", locMax));
}
}
}
@@ -15,7 +15,7 @@ public sealed partial class RemoveStatusEffect : EntityEffectBase<RemoveStatusEf
Loc.GetString(
"entity-effect-guidebook-status-effect-remove",
("chance", Probability),
("key", prototype.Index(EffectProto).Name));
("key", Loc.GetString(prototype.Index(EffectProto).Name))); // WL-Changes: Loc fix
}
public sealed partial class RemoveStatusEffectEntityEffectSystem : EntityEffectSystem<StatusEffectContainerComponent, RemoveStatusEffect>
+21 -28
View File
@@ -4,8 +4,8 @@ reagent-guidebook-status-effect = Causes { $effect } during metabolism{ $conditi
}
entity-effect-guidebook-status-effect-remove = { $chance ->
[1] Removes { LOC($key) }
*[other] remove { LOC($key) }
[1] Removes { $key }
*[other] remove { $key }
}
entity-effect-guidebook-modify-brain-damage-heals = { $chance ->
@@ -33,35 +33,28 @@ entity-effect-guidebook-modify-lung-damage-deals = { $chance ->
*[other] deal { $amount } lung damage
}
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
[1] Stops bleeding in wounds with { $chance } chance per wound
*[other] stop bleeding in wounds with { $chance } chance per wound
}
entity-condition-guidebook-heart-damage = { $max ->
[2147483648] it has at least {NATURALFIXED($min, 2)} heart damage
[2147483648] it has at least { $locMin } 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
[0] it has at most { $locMax } heart damage
*[other] it has between { $locMin } and { $locMax } heart damage
}
}
entity-condition-guidebook-lung-damage = { $max ->
[2147483648] it has at least {NATURALFIXED($min, 2)} lung damage
[2147483648] it has at least { $locMin } 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
[0] it has at most { $locMax } lung damage
*[other] it has between { $locMin } and { $locMax } lung damage
}
}
entity-condition-guidebook-brain-damage = { $max ->
[2147483648] it has at least {NATURALFIXED($min, 2)} brain damage
[2147483648] it has at least { $locMin } 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
}
}
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
[0] it has at most { $locMax } brain damage
*[other] it has between { $locMin } and { $locMax } brain damage
}
}
entity-effect-guidebook-modify-brain-oxygen-heals = { $chance ->
@@ -84,19 +77,19 @@ entity-effect-guidebook-zombify = { $chance ->
entity-condition-guidebook-total-dosage-threshold =
{ $max ->
[2147483648] the total dosage of {$reagent} is at least {NATURALFIXED($min, 2)}u
[2147483648] the total dosage of {$reagent} is at least { $locMin }u
*[other] { $min ->
[0] the total dosage of {$reagent} is at most {NATURALFIXED($max, 2)}u
*[other] the total dosage of {$reagent} is between {NATURALFIXED($min, 2)}u and {NATURALFIXED($max, 2)}u
[0] the total dosage of {$reagent} is at most { $locMax }u
*[other] the total dosage of {$reagent} is between { $locMin }u and { $locMax }u
}
}
entity-condition-guidebook-metabolite-threshold =
{ $max ->
[2147483648] there's at least {NATURALFIXED($min, 2)}u of {$reagent} metabolites
[2147483648] there's at least { $locMin }u of {$reagent} metabolites
*[other] { $min ->
[0] there's at most {NATURALFIXED($max, 2)}u of {$reagent} metabolites
*[other] there's between {NATURALFIXED($min, 2)}u and {NATURALFIXED($max, 2)}u of {$reagent} metabolites
[0] there's at most { $locMax }u of {$reagent} metabolites
*[other] there's between { $locMin }u and { $locMax }u of {$reagent} metabolites
}
}
@@ -125,7 +118,7 @@ entity-effect-guidebook-adjust-reagent-gaussian =
[1] typically add
*[-1] typically remove
}
} {NATURALFIXED($mu, 2)}u of {$reagent} { $deltasign ->
} { $locMu }u of {$reagent} { $deltasign ->
[1] to
*[-1] from
} the solution, with the actual amount varying by around {NATURALFIXED($sigma, 2)}u
} the solution, with the actual amount varying by around { $locSigma }u