diff --git a/MortarAccuracy/Languages/English/Keyed/Keys.xml b/MortarAccuracy/Languages/English/Keyed/Keys.xml
index a0d30c5..1f891a7 100644
--- a/MortarAccuracy/Languages/English/Keyed/Keys.xml
+++ b/MortarAccuracy/Languages/English/Keyed/Keys.xml
@@ -6,6 +6,8 @@
Which skill(s) affect accuracy. If multiple skills are selected, they are averaged together.
Intellectual skill affects accuracy
Shooting skill affects accuracy
+ Highest skill affects accuracy
+ Choose whether to use the highest between intellectual or shooting for mortar accuracy or an average of the two skills.
Best accuracy\nPawns with maximum skill have their mortar accuracy improved to {0}% (vanilla is 0%, mod default is 75%, perfect accuracy is 100%)
Worst accuracy\nPawns with no skill have their mortar accuracy {0} by {1}% (vanilla is 0%, mod default is -50%)
improved
diff --git a/Source/PatsMortarAccuracy/Patches.cs b/Source/PatsMortarAccuracy/Patches.cs
index 9f36abf..425a8ab 100644
--- a/Source/PatsMortarAccuracy/Patches.cs
+++ b/Source/PatsMortarAccuracy/Patches.cs
@@ -454,6 +454,11 @@ static float GetAdjustedForcedMissRadius(Verb_LaunchProjectile shootVerb, LocalT
totalSkill += shooterPawn.skills.GetSkill(SkillDefOf.Shooting).Level;
skillsTotaled++;
}
+ if (Settings.bestSkillAffectsMotarAccuracy)
+ {
+ totalSkill = Math.Max(shooterPawn.skills.GetSkill(SkillDefOf.Intellectual).Level, shooterPawn.skills.GetSkill(SkillDefOf.Shooting).Level);
+ skillsTotaled = 1;
+ }
if (skillsTotaled > 0)
{
// get average skill
diff --git a/Source/PatsMortarAccuracy/Settings.cs b/Source/PatsMortarAccuracy/Settings.cs
index 99bdfdc..3ed4b34 100644
--- a/Source/PatsMortarAccuracy/Settings.cs
+++ b/Source/PatsMortarAccuracy/Settings.cs
@@ -7,6 +7,7 @@ public class Settings : ModSettings
{
public static bool intellectualAffectsMortarAccuracy = true;
public static bool shootingAffectsMortarAccuracy = false;
+ public static bool bestSkillAffectsMotarAccuracy = false;
public static bool weatherAffectsMortarAccuracy = true;
public static float maxSkillSpreadReduction = 0.75f;
public static float minSkillSpreadReduction = -0.4f;
@@ -17,6 +18,7 @@ public override void ExposeData()
{
Scribe_Values.Look(ref intellectualAffectsMortarAccuracy, "intellectualAffectsMortarAccuracy", true);
Scribe_Values.Look(ref shootingAffectsMortarAccuracy, "shootingAffectsMortarAccuracy", false);
+ Scribe_Values.Look(ref bestSkillAffectsMotarAccuracy, "bestSkillAffectsMortarAccuracy", false);
Scribe_Values.Look(ref weatherAffectsMortarAccuracy, "weatherAffectsMortarAccuracy", true);
Scribe_Values.Look(ref showExplosionRadius, "showExplosionRadius", true);
Scribe_Values.Look(ref maxSkillSpreadReduction, "maxSkillSpreadReduction", 0.75f);
@@ -42,6 +44,11 @@ public override void DoSettingsWindowContents(Rect inRect)
listingStandard.Label(Translator.Translate("OptionSkills"));
listingStandard.CheckboxLabeled(Translator.Translate("OptionSkillIntellectual"), ref Settings.intellectualAffectsMortarAccuracy);
listingStandard.CheckboxLabeled(Translator.Translate("OptionSkillShooting"), ref Settings.shootingAffectsMortarAccuracy);
+
+ if (Settings.intellectualAffectsMortarAccuracy && Settings.shootingAffectsMortarAccuracy)
+ listingStandard.CheckboxLabeled(Translator.Translate("OptionSkillsBest"), ref Settings.bestSkillAffectsMotarAccuracy, Translator.Translate("OptionSkillsBestTooltip"));
+ else
+ Settings.bestSkillAffectsMotarAccuracy = false;
listingStandard.Label(TranslatorFormattedStringExtensions.Translate("OptionBestAccuracy", (int)(Settings.maxSkillSpreadReduction * 100)));
Settings.maxSkillSpreadReduction = listingStandard.Slider(Settings.maxSkillSpreadReduction, 0f, 1f);