Ok, here is an edited version.
I did nothing but sub in a new skillname for an old skillname in three places, and rename the fLuck to fGrap reflecting new role. Mainly, because this guarantees I can't mess up balance by accidentally changing too much or doing something wrong.
If someone wants to introduce random effects or something more complicated, I have no opposition to random effects at all, I'm just limiting myself to things that can't mess things up as the simplest initial solution. I would find it cleaner if we kept luck out of it, and made it random--luck has enough effects elsewhere, and it make it easier if we want to long-term move away from magical luck later, we won't have to edit the same file.
I doubled effect of grappling by counting it twice, once in place of luck. I think that grappling SHOULD have twice the effect of other skills in determining the ability to effectivelly board enemy vessels and force surrender, no? Presumably you plan your attacks better by deck and organize things better to force surrenders. Twice the influence seems right, and presuming luck and grappling roughly equal (grappling from bosun, luck from doctor), it should work out similar in balance. If we think that grappling gets much higher than luck regularly, we could change it to 5/3 times grappling and no luck influence, but I'll leave that to others to decide if needed.
Code:
defeat = makeint((rand(makeint(GetShipSkill(mchr,SKILL_GRAPPLING)+GetShipSkill(mchr,SKILL_GRAPPLING)))+rand(9)+1)*((GetShipSkill(mchr,SKILL_LEADERSHIP)+CalcCharacterSkill(mchr,SKILL_FENCING))/2)); // NK TY edited to make grappling have principal role, luck removed
fLuck to fGrap, skill changed to grappling, comment added to explain. Basically, leadership and accuracy already have a pretty good effect, and grappling should have some influence in terms of positioning the ships and timing the musket volley, after all Bosun is the one that gets musket volley perk
Code:
float fGrap = 0.5 * GetShipSkill(chr1, SKILL_GRAPPLING) / SKILL_MAX; //TY subbing in grapplng for luck, influence of better managing the boarding and ship position to ensure maximum effect musket volley, after all bosun is in charge of this perk
float fShipDefense = 0.0;
if (GetOfficersPerkUsing(chr2, "BasicBattleState")) fShipDefense = 0.15;
if (GetOfficersPerkUsing(chr2, "AdvancedBattleState")) fShipDefense = 0.25;
if (GetOfficersPerkUsing(chr2, "ShipDefenceProfessional")) fShipDefense = 0.40;
float fCharDefence = makefloat(GetShipSkill(chr2, SKILL_DEFENCE)) / SKILL_MAX;
int musketkills = makeint(0.25*ecrew * (1.0+delta+fGrap-fShipDefense-fCharDefence)+0.5);
if (musketkills < 0) musketkills = 0; // just in case
// SDLogIt("Musket Fire - delta=" + f2s2(delta) + " sneak=" + fGrap + " ShipDef=" + fShipDefense + " CharDef= " + fCharDefence);
I then subbed grappling with luck for this check
Code:
if (losing < GetShipSkill(&mchr,SKILL_GRAPPLING)) losing = GetShipSkill(&mchr,SKILL_GRAPPLING); // NK skill // Defence against weird negative value TY change to grappling
I then used winmerge to confirm these are the only changes to the file, otherwise perfectly in sync with the just uploaded commenting out of soldier weapons and grappling reduction for surrender.
How does this look? It removes luck and restores grappling to a more prominent role in these mechanics than other skills, and ensures the officer in charge of musket volleys, the bosun, actually contributes some skill to their success.
File attached, for either considering as is or for someone to program a random effect if they think it needs it, or whatever else is desired. Or maybe the simple solution would work.