Skip to content

Commit

Permalink
Merge pull request #2812 from CombatExtended-Continued/AdditionalTran…
Browse files Browse the repository at this point in the history
…slationKeys

tr key for armor durability and bipod stat
  • Loading branch information
N7Huntsman authored Oct 17, 2023
2 parents 1a4540f + 76eb876 commit 180c18e
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 27 deletions.
10 changes: 10 additions & 0 deletions Languages/English/Keyed/ArmorDurability.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<LanguageData>

<!-- Partial armor statworker -->
<CE_ArmorDurability>Armor durability: </CE_ArmorDurability>
<CE_RepairArmorDurability>Repair armor</CE_RepairArmorDurability>
<CE_ArmorDurability_CannotRepairUndamaged>Can't repair natural armor, armor is undamaged</CE_ArmorDurability_CannotRepairUndamaged>
<CE_ArmorDurability_CannonRepairNoResource>Can't repair natural armor, no resources</CE_ArmorDurability_CannonRepairNoResource>

</LanguageData>
12 changes: 12 additions & 0 deletions Languages/English/Keyed/BipodStatWorker.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<LanguageData>

<CE_BipodSetupTime>Time to set up bipod: </CE_BipodSetupTime>
<CE_BipodAutoSetupMode>Auto sets up in firemode: </CE_BipodAutoSetupMode>
<CE_BipodStatWhenSetUp>Stats when set up: </CE_BipodStatWhenSetUp>
<CE_BipodStatWhenNotSetUp>Stats when NOT set up: </CE_BipodStatWhenNotSetUp>
<CE_BipodStatRange>Range</CE_BipodStatRange>
<CE_BipodStatWarmUp>Warm up</CE_BipodStatWarmUp>
<CE_BipodHoverOverStat>Hover over to display</CE_BipodHoverOverStat>

</LanguageData>
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ public override void PostExposeData()

public override string CompInspectStringExtra()
{
return "Armor durability: " + curDurability.ToString() + "/" + maxDurability.ToString() + " (" + curDurabilityPercent.ToStringPercent() + ")";
return "CE_ArmorDurability".Translate() + curDurability.ToString() + "/" + maxDurability.ToString() + " (" + curDurabilityPercent.ToStringPercent() + ")";
}

public override void PostPreApplyDamage(DamageInfo dinfo, out bool absorbed)
Expand Down Expand Up @@ -193,7 +193,7 @@ public override IEnumerable<FloatMenuOption> CompFloatMenuOptions(Pawn selPawn)

if (curDurability < maxDurability + durabilityProps.MaxOverHeal && firstIngredientProvidedOrNotNeeded && secondIngredientProvidedOrNotNeeded)
{
yield return new FloatMenuOption("Fix natural armor", delegate
yield return new FloatMenuOption("CE_RepairArmorDurability".Translate(), delegate
{
Thing firstIngredient = null;
Thing secondIngredient = null;
Expand All @@ -213,11 +213,11 @@ public override IEnumerable<FloatMenuOption> CompFloatMenuOptions(Pawn selPawn)
}
else if (this.curDurability >= maxDurability + durabilityProps.MaxOverHeal)
{
yield return new FloatMenuOption("Can't repair natural armor, armor is undamaged", null);
yield return new FloatMenuOption("CE_ArmorDurability_CannotRepairUndamaged".Translate(), null);
}
else
{
yield return new FloatMenuOption("Can't repair natural armor, no resources", null);
yield return new FloatMenuOption("CE_ArmorDurability_CannonRepairNoResource".Translate(), null);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@ public override string GetExplanationFinalizePart(StatRequest req, ToStringNumbe
{
var BipodCompProps = bipodComp(req);
var VerbPropsCE = verbPropsCE(req);
string result = "Time to set up bipod: " + BipodCompProps.ticksToSetUp + " ticks (" + (BipodCompProps.ticksToSetUp / 60) + "s)";
string result = "CE_BipodSetupTime".Translate() + BipodCompProps.ticksToSetUp + " ticks (" + (BipodCompProps.ticksToSetUp / 60) + "s)";

if (Controller.settings.AutoSetUp)
{
result += "\n" + "Auto sets up in firemode: " + "\n";
result += "\n" + "CE_BipodAutoSetupMode".Translate() + "\n";
if (BipodCompProps.catDef.useAutoSetMode)
{
result += "- " + BipodCompProps.catDef.autosetMode.ToString() + "\n";
Expand All @@ -89,35 +89,35 @@ public override string GetExplanationFinalizePart(StatRequest req, ToStringNumbe

}

result += "\n" + "Stats when set up: ".Colorize(Color.green) + "\n";
result += "\n" + "CE_BipodStatWhenSetUp".Translate().Colorize(Color.green) + "\n";

result += "Recoil: " + Math.Round((VerbPropsCE.recoilAmount * BipodCompProps.recoilMulton), 2);
result += CE_StatDefOf.Recoil.label + ": " + Math.Round((VerbPropsCE.recoilAmount * BipodCompProps.recoilMulton), 2);
result += "\n";

result += "Sway: " + Math.Round((req.Thing.def.statBases.Find(x => x.stat == CE_StatDefOf.SwayFactor).value * BipodCompProps.swayMult), 2);
result += CE_StatDefOf.SwayFactor.label + ": " + Math.Round((req.Thing.def.statBases.Find(x => x.stat == CE_StatDefOf.SwayFactor).value * BipodCompProps.swayMult), 2);
result += "\n";

result += "Range: " + (BipodCompProps.additionalrange + VerbPropsCE.range);
result += "CE_BipodStatRange".Translate() + ": " + (BipodCompProps.additionalrange + VerbPropsCE.range);
result += "\n";

result += "Warmup Time: " + (BipodCompProps.warmupMult * VerbPropsCE.warmupTime);
result += "CE_BipodStatWarmUp".Translate() + ": " + (BipodCompProps.warmupMult * VerbPropsCE.warmupTime);
result += "\n" + "\n";

result += "Stats when NOT set up: ".Colorize(Color.red) + "\n";
result += "CE_BipodStatWhenNotSetUp".Translate().Colorize(Color.red) + "\n";

result += "Recoil: " + Math.Round((VerbPropsCE.recoilAmount * BipodCompProps.recoilMultoff), 2);
result += CE_StatDefOf.Recoil.label + ": " + Math.Round((VerbPropsCE.recoilAmount * BipodCompProps.recoilMultoff), 2);

result += "\n";

result += "Sway: " + Math.Round((req.Thing.def.statBases.Find(x => x.stat == CE_StatDefOf.SwayFactor).value * BipodCompProps.swayPenalty), 2);
result += CE_StatDefOf.SwayFactor.label + ": " + Math.Round((req.Thing.def.statBases.Find(x => x.stat == CE_StatDefOf.SwayFactor).value * BipodCompProps.swayPenalty), 2);

result += "\n";

result += "Range: " + (VerbPropsCE.range);
result += "CE_BipodStatRange".Translate() + ": " + (VerbPropsCE.range);

result += "\n";

result += "Warmup Time: " + (BipodCompProps.warmupPenalty * VerbPropsCE.warmupTime);
result += "CE_BipodStatWarmUp".Translate() + ": " + (BipodCompProps.warmupPenalty * VerbPropsCE.warmupTime);

return result;
}
Expand All @@ -132,39 +132,39 @@ public override string GetExplanationFinalizePart(StatRequest req, ToStringNumbe
return base.GetExplanationFinalizePart(req, numberSense, finalVal);
}

string result = "Time to set up bipod: " + BipodCompProps.ticksToSetUp + " ticks (" + (BipodCompProps.ticksToSetUp / 60) + "s)" + "\n" + "Stats when set up: ".Colorize(Color.green) + "\n";
string result = "CE_BipodSetupTime".Translate() + BipodCompProps.ticksToSetUp + " ticks (" + (BipodCompProps.ticksToSetUp / 60) + "s)" + "\n" + "Stats when set up: ".Colorize(Color.green) + "\n";

result += "Recoil: " + (VerbPropsCE.recoilAmount * BipodCompProps.recoilMulton);
result += CE_StatDefOf.Recoil.label + ": " + (VerbPropsCE.recoilAmount * BipodCompProps.recoilMulton);

result += "\n";

result += "Sway: " + (((ThingDef)(req.Def)).statBases.Find(x => x.stat == CE_StatDefOf.SwayFactor).value * BipodCompProps.swayPenalty);
result += CE_StatDefOf.SwayFactor.label + ": " + (((ThingDef)(req.Def)).statBases.Find(x => x.stat == CE_StatDefOf.SwayFactor).value * BipodCompProps.swayPenalty);

result += "\n";

result += "Range: " + (BipodCompProps.additionalrange + VerbPropsCE.range);
result += "CE_BipodStatRange".Translate() + ": " + (BipodCompProps.additionalrange + VerbPropsCE.range);

result += "\n";

result += "Warmup Time: " + (BipodCompProps.warmupMult * VerbPropsCE.warmupTime);
result += "CE_BipodStatWarmUp".Translate() + ": " + (BipodCompProps.warmupMult * VerbPropsCE.warmupTime);

result += "\n" + "\n";

result += "Stats when NOT set up: ".Colorize(Color.red) + "\n";
result += "CE_BipodStatWhenNotSetUp".Translate().Colorize(Color.red) + "\n";

result += "Recoil: " + (VerbPropsCE.recoilAmount * BipodCompProps.recoilMultoff);
result += CE_StatDefOf.Recoil.label + ": " + (VerbPropsCE.recoilAmount * BipodCompProps.recoilMultoff);

result += "\n";

result += "Sway: " + (((ThingDef)(req.Def)).statBases.Find(x => x.stat == CE_StatDefOf.SwayFactor).value * BipodCompProps.swayPenalty);
result += CE_StatDefOf.SwayFactor.label + ": " + (((ThingDef)(req.Def)).statBases.Find(x => x.stat == CE_StatDefOf.SwayFactor).value * BipodCompProps.swayPenalty);

result += "\n";

result += "Range: " + (VerbPropsCE.range);
result += "CE_BipodStatRange".Translate() + ": " + (VerbPropsCE.range);

result += "\n";

result += "Warmup Time: " + (BipodCompProps.warmupPenalty * VerbPropsCE.warmupTime);
result += "CE_BipodStatWarmUp".Translate() + ": " + (BipodCompProps.warmupPenalty * VerbPropsCE.warmupTime);

return result;
}
Expand All @@ -178,7 +178,7 @@ public override string ValueToString(float val, bool finalized, ToStringNumberSe
{
if (finalized)
{
return "Hover over";
return "CE_BipodHoverOverStat".Translate();
}
else
{
Expand Down

0 comments on commit 180c18e

Please sign in to comment.