OK, this is going to be a bit more complicated than I thought. If I read the modified code correctly, none of the new defence perks will work correctly!
In "PROGRAM\BATTLE_INTERFACE\BattleInterface.c":
Code:
if (sti(GetAttribute(damage_chr, "TmpPerks.Rigging"))) pMultiply = 0.8; // -20%
if (sti(GetAttribute(damage_chr, "TmpPerks.RiggingAdvance"))) pMultiply = 0.6; // -40%
This is part of the code for calculating damage to sails. Setting aside that this is using different attributes to the original code (and accessing them directly rather than through functions, the opposite of what I was instructed to do when developing "Ardent"

), this code sets the factor 'pMultiply' depending on which "rigging" perk, if any, the character has - and then doesn't use it.
In "PROGRAM\SEA_AI\AIShip.c":
Code:
float pMultiply = 1;
if (sti(GetAttribute(rCharacter, "TmpPerks.Rigging"))) pMultiply = 0.8; // -20%
if (sti(GetAttribute(rCharacter, "TmpPerks.RiggingAdvance"))) pMultiply = 0.6; // -40%
fDamage = Clampf(fDamage*pMultiply);
// if mast fall - play sound
if (fDamage >= 1.0)
{
Play3DSound("mast_fall", x, y, z);
...
'fDamage' has previously been set to 1.0 if a mast is supposed to have been knocked down. Applying the multiplier there means that if 'fDamage' was set to 1.0 and the character has a "Rigging" perk then 'fDamage' is reduced - which means if the mast was supposed to fall down, it won't fall now. The original code doesn't take ship defence perks into account when calculating mast damage.
Also in "AIShip.c":
Code:
if (sti(GetAttribute(rOurCharacter, "TmpPerks.BasicBattleState"))) fMinus = 0.08; //0.15
if (sti(GetAttribute(rOurCharacter, "TmpPerks.AdvancedBattleState"))) fMinus = 0.15; //0.25
if (sti(GetAttribute(rOurCharacter, "TmpPerks.ShipDefenceProfessional"))) fMinus = 0.25; //0.40
This is part of the code to calculate hull damage. The one place where the new damage control perks are needed, they haven't been put into place.
And the new first aid perks aren't mentioned at all, except in the code to calculate crew losses from musket fire.
All of which means sail damage, hull damage and crew damage don't take account of the new perks.
To fix these, I've rewritten those parts of "BattleInterface.c" and "AIShip.c". "BattleInterface.c" will use the same code as the original, just substituting "Rigging" for "BattleState" (and removing part of it because there are only two levels of "Rigging" as opposed to three levels of "BattleState":
Code:
if( IsCharacterPerkOn(damage_chr,"RiggingAdvance") ) { fDmgRig *= 0.6; }
else
{
if( IsCharacterPerkOn(damage_chr,"Rigging") ) { fDmgRig *= 0.8; }
}
"AIShip.c" will not use the "Rigging" perks for mast damage. "BattleState" will be replaced by "DamageControl" for hull damage. And "FirstAid" will be used for crew damage:
Code:
if (USE_REAL_CANNONS)
{
fMultiply = Bring2Range(1.0, 0.5, 0.0, 1.0, fskillDefence); // KNB was from 1.0x to 0.2x damage
if (sti(GetAttribute(rOurCharacter, "TmpPerks.BasicFirstAid"))) fMultiply *= 0.9 // 10% (15%)
if (sti(GetAttribute(rOurCharacter, "TmpPerks.AdvancedFirstAid"))) fMultiply *= 0.8 // 20% (30%)
}
else
{
fMultiply = Bring2Range(1.0, 0.2, 0.0, 1.0, fskillDefence);
if (sti(GetAttribute(rOurCharacter, "TmpPerks.BasicFirstAid"))) fMultiply *= 0.85 // 15%
if (sti(GetAttribute(rOurCharacter, "TmpPerks.AdvancedFirstAid"))) fMultiply *= 0.7 // 30%
}
All defence perks seem to have reduced effect if "USE_REAL_CANNONS" is set, so I'm doing likewise.
The doctor is about to be shortchanged. Currently he gets the three ship defence perks. Now the carpenter gets the three damage control perks, the navigator gets the rigging perks, and the doctor only gets two first aid perks. Perhaps set up a third level first aid perk? Otherwise, to compensate, I'm giving him "Iron Will" - this perks affects crew morale, which would certainly be improved if they know they'll be in the hands of a competent surgeon if they're wounded. Besides, this is the sort of surgeon who can say "You
will lie down and take the pills - doctor's orders!" even to the captain.
You're probably going to need two navigators because one of them is going to be using up his ability points to build up towards "Sea Wolf"; the second can use his points on the "Rigging" perks. Or maybe give them to the first mate instead.