bigmodifier=2
smallmodifier=1.5

modify '<Talent identifier="bountyhunter">!anyvalue="(?<xpbonus>!num)"!anyvalue="(?<moneybonus>!num)"!anymultiplyvalue="(?<xpbonusmul>!num)"!anymultiplyvalue="(?<moneybonusmul>!num)"' \
"xpbonus=round(xpbonus*$bigmodifier,2)
moneybonus=round(moneybonus*$bigmodifier,2)
xpbonusmul=round(1+xpbonus/100,2)
moneybonusmul=round(1+moneybonus/100,2)" \
**/TalentsCaptain.xml

modify '<Talent identifier="inspirationalleader">!anyvalue="(?<xpbonus>!num)"' \
"xpbonus=round(xpbonus*$bigmodifier,2)" \
**/TalentsCaptain.xml
modify '<Affliction!anyidentifier="inspirationalleader"!anystattype="SkillGainSpeed" value="(?<xpbonus>!num)"\/>' \
"xpbonus=round(xpbonus*$bigmodifier,2)" \
**/AfflictionsCaptain.xml

modify '<Talent identifier="logisticsexpert">!anyvalue="(?<xpbonus>!num)"!anyvalue="(?<moneybonus>!num)"!anymultiplyvalue="(?<moneybonusmul>!num)"\/>!anymultiplyvalue="(?<xpbonusmul>!num)"\/>' \
"xpbonus=round(xpbonus*$bigmodifier,2)
moneybonus=round(moneybonus*$bigmodifier,2)
xpbonusmul=round(1+xpbonus/100,2)
moneybonusmul=round(1+moneybonus/100,2)" \
**/TalentsCaptain.xml

modify '<Talent identifier="prodigy">!anyvalue="(?<xpbonus>!num)"!anyvalue="(?<xpbonusmul>!num)"' \
"xpbonus=round(xpbonus*$bigmodifier,2)
xpbonusmul=round(1+xpbonus/100,2)" \
**/TalentsCaptain.xml

modify '<Talent identifier="travelingtradesman">!anyvalue="(?<itemsellvalue>!num)"!anyvalue="(?<extraitems>!num)"!anystattype="ExtraSpecialSalesCount" value="(?<extraitemsmul>!num)"!anystattype="StoreSellMultiplier" value="(?<itemssellvaluemul>!num)"' \
"itemsellvalue=round(itemsellvalue*$bigmodifier,2)
extraitems=round(extraitems*$bigmodifier,2)
extraitemsmul=extraitems
itemssellvaluemul=round(itemsellvalue/100,2)" \
**/TalentsCaptain.xml

modify '<Talent identifier="veteran">!anyvalue="(?<helmbonus>!num)"!anyvalue="(?<otherbonus>!num)"!anyvalue="(?<repairspeed>!num)"!anyHelmSkillBonus" value="(?<helmbonusv>!num)"!anyvalue="(?<electricalbonusv>!num)"!anyvalue="(?<mechanicalbonusv>!num)"!anyvalue="(?<medicalbonusv>!num)"!anyvalue="(?<weaponsbonusv>!num)"!anyvalue="(?<repairspeedv>!num)"' \
"helmbonus=round(helmbonus*$bigmodifier,2)
otherbonus=round(helmbonus/$bigmodifier,2)
repairspeed=round(repairspeed*$bigmodifier,2)
helmbonusv=round(helmbonusv*$bigmodifier,2)
electricalbonusv=round(helmbonusv/$bigmodifier,2)
mechanicalbonusv=electricalbonusv
medicalbonusv=electricalbonusv
weaponsbonusv=electricalbonusv
repairspeedv=round(repairspeedv*$bigmodifier,2)" \
**/TalentsCaptain.xml

modify '<Talent identifier="camaraderie">!anyvalue="(?<xpbonus>!num)"!anyvalue="(?<damageres>!num)"!anyvalue="(?<xpbonusv>!num)"' \
"xpbonus=round(xpbonus*$bigmodifier,2)
damageres=round(damageres*$bigmodifier,2)
xpbonusv=round(1+xpbonus/100,2)" \
**/TalentsCaptain.xml
modify '<Affliction!anyidentifier="camaraderie"!anyminresistance="(?<damageresmin>!num)"!anymaxresistance="(?<damageresmax>!num)"' \
"damageresmin=round(damageresmin*$bigmodifier,2)
damageresmax=round(damageresmax*$bigmodifier,2)" \
**/AfflictionsCaptain.xml

modify '<Talent identifier="downwiththeship">!anyswimming!anyvalue="(?<swimmingboost>!num)"!anyvalue="(?<repairspeed>!num)"!anyvalue="(?<duration>!num)"' \
"swimmingboost=round(swimmingboost*$bigmodifier,2)
repairspeed=round(repairspeed*$bigmodifier,2)
duration=round(duration*$smallmodifier,2)" \
**/TalentsCaptain.xml
modify '<Affliction!anyidentifier="downwiththeship"!anyduration="(?<duration>!num)"!anyvalue="(?<repairspeed>!num)"!anyvalue="(?<swimmingboost>!num)"' \
"duration=round(duration*$bigmodifier,2)
repairspeed=round(repairspeed*$bigmodifier,2)
swimmingboost=round(swimmingboost*$bigmodifier,2)" \
**/AfflictionsCaptain.xml

modify '<Affliction!anyidentifier="evasivemaneuvers"!anyduration="(?<duration>!num)"' \
"duration=round(duration*$smallmodifier,2)" \
**/AfflictionsCaptain.xml

modify '<Talent identifier="sailorwithnoname">!anyvalue="(?<medicalbonus>!num)"!anyMedicalSkillBonus" value="(?<medicalbonusv>!num)"' \
"medicalbonus=round(medicalbonus*$bigmodifier,2)
medicalbonusv=medicalbonus" \
**/TalentsCaptain.xml

modify '<Talent identifier="steadytune">!anybuffduration!anyvalue="(?<buffduration>!num)"!anyrange="(?<buffrange>!num)"!anyimmunity!anyamount="(?<buffdurationv>!num)"' \
"buffduration=round(buffduration*$smallmodifier,2)
buffdurationv=buffduration
buffrange=round(buffrange*$bigmodifier,2)" \
**/TalentsCaptain.xml

modify '<Talent identifier="quickdraw">!anyvalue="(?<secondsafk>!num)"!anyvalue="(?<damagebonus>!num)"!anyvalue="(?<duelwieldpenaltyreduction>!num)"!anyaddeddamagemultiplier="(?<addeddamagemultiplier>!num)"!anyDualWieldingPenaltyReduction" value="(?<duelwieldpenaltyreductionv>!num)"' \
"damagebonus=round(damagebonus*$bigmodifier,2)
duelwieldpenaltyreduction=round(duelwieldpenaltyreduction*$smallmodifier,2)
addeddamagemultiplier=round(damagebonus/100,2)
duelwieldpenaltyreductionv=round(duelwieldpenaltyreduction/100,2)" \
**/TalentsCaptain.xml

modify '<Talent identifier="deputy">!anyvalue="(?<skillbonus1>!num)"!anyvalue="(?<skillbonus2>!num)"' \
"skillbonus1=round(skillbonus1*$bigmodifier,2)
skillbonus2=round(skillbonus2*$bigmodifier,2)" \
**/TalentsCaptain.xml
modify '<Affliction!anyidentifier="deputy"!anyvalue="(?<skillbonus1>!num)"!anyvalue="(?<skillbonus2>!num)"!anyvalue="(?<xpbonus1>!num)"!anyvalue="(?<xpbonus2>!num)"' \
"skillbonus1=round(skillbonus1*$bigmodifier,2)
skillbonus2=round(skillbonus2*$bigmodifier,2)
xpbonus1=round(xpbonus1*$bigmodifier,2)
xpbonus2=round(xpbonus2*$bigmodifier,2)" \
**/AfflictionsCaptain.xml

modify '<Talent identifier="lonewolf">!anyamount!anyvalue="(?<damageres>!num)"!anyamount!anyvalue="(?<stunres>!num)"!anyamount!anyvalue="(?<meleedamage>!num)"!anydistance="(?<distance>!num)"' \
"damageres=round(damageres*$bigmodifier,2)
stunres=round(stunres*$bigmodifier,2)
meleedamage=round(meleedamage*$bigmodifier,2)
distance=round(distance/$bigmodifier,2)" \
**/TalentsCaptain.xml
modify '<Affliction!anyidentifier="lonewolf"!anyminresistance="(?<minresistance>!num)"!anymaxresistance="(?<maxresistance>!num)"!anyStatValue stattype="MeleeAttackMultiplier" value="(?<meleedamage>!num)"' \
"minresistance=round(minresistance*$bigmodifier,2)
maxresistance=round(maxresistance*$bigmodifier,2)
meleedamage=round(meleedamage*$bigmodifier,2)" \
**/AfflictionsCaptain.xml

modify '<Talent identifier="drunkensailor">!anyvalue="(?<stunresistance>!num)"!anymultiplier="(?<stunresistancev>!num)"' \
"stunresistance=round(stunresistance*1.25,2)
stunresistancev=round(1-(stunresistance/100),2)" \
**/TalentsCaptain.xml

modify '<Talent identifier="bigguns">!anyvalue="(?<addeddamagemultiplier>!num)"!anyvalue="(?<dualwieldingpenaltyreduction>!num)"!anyaddeddamagemultiplier="(?<addeddamagemultiplierv>!num)"!anyDualWieldingPenaltyReduction" value="(?<dualwieldingpenaltyreductionv>!num)"' \
"addeddamagemultiplier=round(addeddamagemultiplier*$bigmodifier,2)
dualwieldingpenaltyreduction=round(dualwieldingpenaltyreduction*1.2,2)
addeddamagemultiplierv=round(addeddamagemultiplier/100,2)
dualwieldingpenaltyreductionv=round(dualwieldingpenaltyreduction/100,2)" \
**/TalentsCaptain.xml

modify '<Talent identifier="leadingbyexample">!anyamount!anyvalue="(?<repairspeed>!num)"!anyamount!anyvalue="(?<repairtoolmultiplier>!num)"!anyamount!anyvalue="(?<movementspeed>!num)"' \
"repairspeed=round(repairspeed*$bigmodifier,2)
repairtoolmultiplier=round(repairtoolmultiplier*$bigmodifier,2)
movementspeed=round(movementspeed*$bigmodifier,2)" \
**/TalentsCaptain.xml

modify '<Talent identifier="helmsman">!anyvalue="(?<helmbonus>!num)"!anyvalue="(?<speedbonus>!num)"!anyvalue="(?<helmbonusv>!num)"!anyvalue="(?<pumpspeedv>!num)"!anyvalue="(?<enginespeedv>!num)"' \
"helmbonus=round(helmbonus*$bigmodifier,2)
speedbonus=round(speedbonus*$bigmodifier,2)
helmbonusv=helmbonus
pumpspeedv=round(speedbonus/100,2)
enginespeedv=round(speedbonus/100,2)" \
**/TalentsCaptain.xml

modify '<Talent identifier="inspiringpresence">!anyvalue="(?<extralevelgain>!num)"!anyvalue="(?<movementspeed>!num)"' \
"extralevelgain=round(extralevelgain*$bigmodifier,2)
movementspeed=round(movementspeed*$bigmodifier,2)" \
**/TalentsCaptain.xml
modify '<Affliction!anyidentifier="inspiringpresence"!anyExtraLevelGain" value="(?<extralevelgain>!num)"' \
"extralevelgain=round(extralevelgain*$bigmodifier,2)" \
**/AfflictionsCaptain.xml
modify '<Affliction!anyidentifier="inspiringpresence_walkspeed"!anyWalkingSpeed" value="(?<movementspeed>!num)"' \
"movementspeed=round(movementspeed*$bigmodifier,2)" \
**/AfflictionsCaptain.xml

modify '<Talent identifier="trickledown">!anyvalue="(?<swimspeed>!num)"' \
"swimspeed=round(swimspeed*$bigmodifier,2)" \
**/TalentsCaptain.xml
modify '<Affliction!anyidentifier="trickledown"!anySwimmingSpeed" value="(?<swimmingspeed>!num)"' \
"swimmingspeed=round(swimmingspeed*$bigmodifier,2)" \
**/AfflictionsCaptain.xml

# modify '<Talent identifier="family">!anyCharacterAbilityGiveTalentPointsToAllies amount="(?<talentpoints>!num)"' \
# 'talentpoints=talentpoints*$bigmodifier' \
# **/TalentsCaptain.xml
modify '<Affliction!anyidentifier="highmorale"!anystattype="RepairSpeed" value="(?<repairspeed>!num)"!anystattype="RepairToolStructureRepairMultiplier" value="(?<repairtoolmultiplier>!num)"!anystattype="MovementSpeed" value="(?<movementspeed>!num)"' \
"repairspeed=round(repairspeed*$bigmodifier,2)
repairtoolmultiplier=round(repairtoolmultiplier*$bigmodifier,2)
movementspeed=round(movementspeed*$bigmodifier,2)" \
**/AfflictionsCaptain.xml
modify '<Affliction!anyidentifier="excellentmorale"!anystattype="RepairSpeed" value="(?<repairspeed>!num)"!anystattype="RepairToolStructureRepairMultiplier" value="(?<repairtoolmultiplier>!num)"!anystattype="MovementSpeed" value="(?<movementspeed>!num)"' \
"repairspeed=round(repairspeed*$bigmodifier,2)
repairtoolmultiplier=round(repairtoolmultiplier*$bigmodifier,2)
movementspeed=round(movementspeed*$bigmodifier,2)" \
**/AfflictionsCaptain.xml

modify '<Talent identifier="steadytune">!anyduration!anyvalue="(?<buffduration>!num)"!anyrange="(?<buffrangev>!num)"!anyamount="(?<buffdurationv>!num)"' \
"buffduration=round(buffduration*$smallmodifier,2)
buffdurationv=buffduration
buffrangev=round(buffrangev*$bigmodifier,2)" \
**/TalentsCaptain.xml

modify '<Talent identifier="commendations">!anyvalue="(?<xpgaingain>!num)"' \
"xpgaingain=round(xpgaingain*$bigmodifier,2)" \
**/TalentsCaptain.xml
modify '<Item!anyidentifier="coalitionmedal"!anyGiveExperience amount="(?<xpgain>!num)"' \
"xpgain=round(xpgain*$bigmodifier,2)" \
**/captain_talent_items.xml
modify '<Item!anyidentifier="coalitioncommendation"!anyGiveExperience amount="(?<xpgain>!num)"' \
"xpgain=round(xpgain*$bigmodifier,2)" \
**/captain_talent_items.xml

modify '<Talent identifier="affiliation"!anyvalue="(?<reputationgainmultiplier>!num)"!anyvalue="(?<moneybonus>!num)"!anyReputationGainMultiplier" value="(?<reputationgainmultiplierv>!num)"!anyCharacterAbilityModifyValue multiplyValue="(?<missionmoneybonusv>!num)"' \
"reputationgainmultiplier=round(reputationgainmultiplier*$bigmodifier,2)
reputationgainmultiplierv=round(reputationgainmultiplier/100,2)
moneybonus=round(moneybonus*$bigmodifier,2)
missionmoneybonusv=round(moneybonus/100,2)" \
**/TalentsCaptain.xml

modify '<Talent identifier="yourreputation">!anyvalue="(?<extramoney>!num)"!anyvalue="(?<extramissioncount>!num)"!anyamount="(?<extramoneyv>!num)"' \
"extramoney=round(extramoney*$bigmodifier,2)
extramissioncount=round(extramissioncount*3,2)
extramoneyv=extramoney" \
**/TalentsCaptain.xml

modify '<Talent identifier="campaigning">!anyvalue="(?<shipyardbuymultiplier>!num)"!anyvalue="(?<shipyardbuymultiplierv>!num)"' \
"shipyardbuymultiplier=round(shipyardbuymultiplier*$bigmodifier,2)
shipyardbuymultiplierv=round(shipyardbuymultiplier/100,2)" \
**/TalentsCaptain.xml

modify '<Talent identifier="networking">!anyvalue="(?<storebuymultiplier>!num)"!anyvalue="(?<storebuymultiplierv1>!num)"!anyvalue="(?<storebuymultiplierv2>!num)"!anyvalue="(?<storebuymultiplierv3>!num)"!anyvalue="(?<storebuymultiplierv4>!num)"!anyvalue="(?<storebuymultiplierv5>!num)"' \
"storebuymultiplier=round(storebuymultiplier*$bigmodifier,2)
storebuymultiplierv1=round(storebuymultiplier/100,2)
storebuymultiplierv2=round(storebuymultiplier/100,2)
storebuymultiplierv3=round(storebuymultiplier/100,2)
storebuymultiplierv4=round(storebuymultiplier/100,2)
storebuymultiplierv5=round(storebuymultiplier/100,2)" \
**/TalentsCaptain.xml

# This talent actually uses the coalitionmedal
# So modifications to it will impact this talent
# Therefore we don't have to fuck with anything here
# But we should be careful to set coalitionmedalnegate to the same value as coalitionmedal
# It is used to negate the xp gain past a certain level
modify '<Talent identifier="figurehead">!anyvalue="(?<bonusxp>!num)"!anyvalue="(?<levelbreakpoint>!num)"!anyvalue="(?<discount>!num)"!anylevel="(?<levelbreakpointv>!num)"!anyamount="-(?<coalitionmedalnegate>!num)"!anyStoreBuyMultiplierAffiliated" value="(?<storebuymultiplier>!num)"!anyShipyardBuyMultiplierAffiliated" value="(?<shipyardbuymultiplier>!num)"' \
"bonusxp=round(bonusxp*$bigmodifier,2)
levelbreakpoint=round(levelbreakpoint*$smallmodifier,2)
discount=round(discount*$bigmodifier,2)
levelbreakpointv=levelbreakpoint
coalitionmedalnegate=round(coalitionmedalnegate*$bigmodifier,2)
storebuymultiplier=round(storebuymultiplier*$bigmodifier,2)
shipyardbuymultiplier=round(shipyardbuymultiplier*$bigmodifier,2)" \
**/TalentsCaptain.xml
