From 280a17108ea7cf10b5db7702888911fcd21beb73 Mon Sep 17 00:00:00 2001 From: n7huntsman Date: Wed, 21 Aug 2024 21:46:44 -0400 Subject: [PATCH 1/2] Add verb translation keys --- Languages/English/Keyed/Keys.xml | 16 +++++++++++++--- .../Verbs/Verb_LaunchProjectileCE.cs | 14 +++++++------- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/Languages/English/Keyed/Keys.xml b/Languages/English/Keyed/Keys.xml index 471ece0cef..65eb3e7915 100644 --- a/Languages/English/Keyed/Keys.xml +++ b/Languages/English/Keyed/Keys.xml @@ -74,6 +74,15 @@ Reloads this gun. Reloading + + Out of bounds + Can't target self + No line of sight + Blocked by roof + Shooting disallowed by + Outside of range + Within minimum range + Equipping Taking @@ -122,10 +131,10 @@ ° m Weapon penetration factor - Skill factor - Other factors + Skill factor + Other factors Adjusted for weapon - Penetration quality factor + Penetration quality factor Damage per second Damage variation Final average damage @@ -154,6 +163,7 @@ Rearm + Uncompiled CE dev build\n\nYou're running a development build of Combat Extended that is not intended for gameplay purposes, this will create a large amount of errors if you attempt to play a colony.\n\nEither download an official CE release from GitHub's Releases section, or if you need the latest development snapshot for testing purposes, get it from the link below. Get development snapshot diff --git a/Source/CombatExtended/CombatExtended/Verbs/Verb_LaunchProjectileCE.cs b/Source/CombatExtended/CombatExtended/Verbs/Verb_LaunchProjectileCE.cs index 8baabc30a0..7b8862b0a0 100644 --- a/Source/CombatExtended/CombatExtended/Verbs/Verb_LaunchProjectileCE.cs +++ b/Source/CombatExtended/CombatExtended/Verbs/Verb_LaunchProjectileCE.cs @@ -847,7 +847,7 @@ public virtual bool CanHitTargetFrom(IntVec3 root, LocalTargetInfo targ, out str } if (caster?.Map == null || !targ.Cell.InBounds(caster.Map) || !root.InBounds(caster.Map)) { - report = "Out of bounds"; + report = "CE_OutofBounds".Translate(); return false; } // Check target self @@ -855,7 +855,7 @@ public virtual bool CanHitTargetFrom(IntVec3 root, LocalTargetInfo targ, out str { if (!verbProps.targetParams.canTargetSelf) { - report = "Can't target self"; + report = "CE_NoSelfTarget".Translate(); return false; } return true; @@ -866,7 +866,7 @@ public virtual bool CanHitTargetFrom(IntVec3 root, LocalTargetInfo targ, out str RoofDef roofDef = caster.Map.roofGrid.RoofAt(targ.Cell); if (roofDef != null && roofDef.isThickRoof) { - report = "Blocked by roof"; + report = "CE_BlockedRoof".Translate(); return false; } } @@ -889,7 +889,7 @@ public virtual bool CanHitTargetFrom(IntVec3 root, LocalTargetInfo targ, out str //pawns can use turrets while wearing shield belts, but the shield is disabled for the duration via Harmony patch (see Harmony-ShieldBelt.cs) if (!current.AllowVerbCast(this) && !(current.TryGetComp() != null && isTurretOperator)) { - report = "Shooting disallowed by " + current.LabelShort; + report = "CE_BlockedShield".Translate() + current.LabelShort; return false; } } @@ -902,15 +902,15 @@ public virtual bool CanHitTargetFrom(IntVec3 root, LocalTargetInfo targ, out str float lengthHorizontalSquared = (root - targ.Cell).LengthHorizontalSquared; if (lengthHorizontalSquared > EffectiveRange * EffectiveRange) { - report = "Out of range"; + report = "CE_BlockedMaxRange".Translate(); } else if (lengthHorizontalSquared < verbProps.minRange * verbProps.minRange) { - report = "Within minimum range"; + report = "CE_BlockedMinRange".Translate(); } else { - report = "No line of sight"; + report = "CE_NoLoS".Translate(); } return false; } From be4024ed01979471754edaa3c3cdc21e8456305e Mon Sep 17 00:00:00 2001 From: n7huntsman Date: Wed, 21 Aug 2024 21:50:30 -0400 Subject: [PATCH 2/2] Some housekeeping --- Languages/English/Keyed/Keys.xml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Languages/English/Keyed/Keys.xml b/Languages/English/Keyed/Keys.xml index 65eb3e7915..bf00261847 100644 --- a/Languages/English/Keyed/Keys.xml +++ b/Languages/English/Keyed/Keys.xml @@ -46,6 +46,15 @@ Estimated hit chance + + Out of bounds + Can't target self + No line of sight + Blocked by roof + Shooting disallowed by + Outside of range + Within minimum range + Distance: {0}/{1} Tiles Distance: {0} Tiles\nselections in range: {1}/{2} @@ -74,15 +83,6 @@ Reloads this gun. Reloading - - Out of bounds - Can't target self - No line of sight - Blocked by roof - Shooting disallowed by - Outside of range - Within minimum range - Equipping Taking