# TODO: Fix this? There's a potential bug in modify
modify '<Talent identifier="egghead">!anyvalue="(?<skillgainspeed>!num)"!anySkillGainSpeed" value="(?<skillgainspeedv>!num)"' \
'skillgainspeed=skillgainspeed*4
skillgainspeedv=skillgainspeed/100' \
**/TalentsEngineer.xml

modify '<Talent identifier="grounded">!anyvalue="(?<electricalskillbonus>!num)"!anyamount!anyvalue="(?<resistance>!num)"!anyElectricalSkillBonus" value="(?<electricalskillbonusv>!num)"!anymultiplier="(?<resistancev>!num)"' \
'electricalskillbonus=electricalskillbonus*4
resistance=resistance*2
electricalskillbonusv=electricalskillbonus
resistancev=1-(resistance/100)' \
**/TalentsEngineer.xml

modify '<Talent identifier="junctionjunkie"!anyamount!anyamount!anyvalue="(?<electricalskillbonus>!num)"!anyxpamount!anyvalue="(?<xpbonus>!num)"!anylevel!anyvalue="(?<levelbonus>!num)"!anyamount!anyvalue="(?<repairspeed>!num)"!anyCharacterAbilityGiveExperience amount="(?<experiencev>!num)"!anyCharacterAbilityGivePermanentStat stattype="ElectricalSkillBonus"!anyvalue="(?<electricalskillbonusv>!num)"!anyCharacterAbilityUpgradeSubmarine!anylevel="(?<levelv>!num)"!anyCharacterAbilityGivePermanentStat stattype="ElectricalRepairSpeed"!anyvalue="(?<repairspeedv>!num)"' \
'electricalskillbonus=electricalskillbonus*4
xpbonus=xpbonus*4
levelbonus=levelbonus*2
repairspeed=repairspeed*4
experiencev=xpbonus
levelv=levelbonus
electricalskillbonusv=electricalskillbonus
repairspeedv=repairspeed/100' \
**/TalentsEngineer.xml

modify '<Talent identifier="stationengineer">!anyvalue="(?<xpbonus>!num)"!anyvalue="(?<repairspeed>!num)"!anyvalue="(?<repairtoolmultiplier>!num)"!anyCharacterAbilityModifyValue multiplyvalue="(?<xpbonusv>!num)"' \
'xpbonus=xpbonus*4
repairspeed=repairspeed*4
repairtoolmultiplier=repairtoolmultiplier*4
xpbonusv=1+xpbonus/100' \
**/TalentsEngineer.xml
modify '<Affliction!anyidentifier="stationengineer"!anystattype="RepairSpeed" value="(?<repairspeed>!num)"!anystattype="RepairToolStructureRepairMultiplier" value="(?<repairtoolmultiplier>!num)"' \
'repairspeed=repairspeed*4
repairtoolmultiplier=repairtoolmultiplier*4' \
**/AfflictionsEngineer.xml

modify '<Talent identifier="aggressiveengineering">!anyCharacterAbilityModifyAttackData addeddamagemultiplier="(?<addeddamagemultiplier>!num)"' \
'addeddamagemultiplier=addeddamagemultiplier*2' \
**/TalentsEngineer.xml

modify '<Talent identifier="funwithfission">!anyvalue="(?<increasefabricationquality>!num)"!anyCharacterAbilityGivePermanentStat statidentifier="reactorfuel" stattype="IncreaseFabricationQuality" value="(?<increasefabricationqualityv>!num)"' \
'increasefabricationquality=increasefabricationquality*2
increasefabricationqualityv=increasefabricationquality' \
**/TalentsEngineer.xml

modify '<Talent identifier="melodicrespite">!anybuffduration!anyvalue="(?<buffduration>!num)"!anyrange="(?<buffrangev>!num)"' \
'buffduration=buffduration*2
buffrangev=buffrangev*4' \
**/TalentsEngineer.xml
modify '<Affliction!anyidentifier="melodicrespite"!anystattype="RepairSpeed" value="(?<repairspeed>!num)"' \
'repairspeed=repairspeed*4' \
**/AfflictionsEngineer.xml

modify '<Talent identifier="militaryapplications">!anyvalue="(?<weaponsskillbonus>!num)"!anyCharacterAbilityGiveStat stattype="WeaponsSkillBonus" value="(?<weaponsskillbonusv>!num)"' \
'weaponsskillbonus=weaponsskillbonus*4
weaponsskillbonusv=weaponsskillbonus' \
**/TalentsEngineer.xml

modify '<Talent identifier="weaponartisan">!anyvalue="(?<increasefabricationquality>!num)"!anyCharacterAbilityGivePermanentStat statidentifier="weapon" stattype="IncreaseFabricationQuality" value="(?<increasefabricationqualityv>!num)"' \
'increasefabricationquality=increasefabricationquality*2
increasefabricationqualityv=increasefabricationquality' \
**/TalentsEngineer.xml

modify '<Talent identifier="gridmaintainer">!anyamount!anyvalue="(?<repairspeed>!num)"!anyCharacterAbilityModifyStat stattype="RepairSpeed" value="(?<repairspeedv>!num)"' \
'repairspeed=repairspeed*4
repairspeedv=repairspeed/100' \
**/TalentsEngineer.xml

modify '<Talent identifier="pyromaniac">!anyvalue="(?<damagemultiplier>!num)"!anyCharacterAbilityModifyAffliction afflictionidentifiers="burn" addedmultiplier="(?<damagemultiplierv>!num)"!anyCharacterAbilityGiveStat stattype="BallastFloraDamageMultiplier" value="(?<ballastfloradamagemultiplier>!num)"' \
'damagemultiplier=damagemultiplier*4
damagemultiplierv=damagemultiplier/100
ballastfloradamagemultiplier=damagemultiplier/100' \
**/TalentsEngineer.xml

modify '<Talent identifier="unlimitedpower">!anyvalue="(?<qualitybonus>!num)"!anyvalue="(?<batterycapacity>!num)"!anyCharacterAbilityGivePermanentStat statidentifier="mobilebattery" stattype="IncreaseFabricationQuality" value="(?<qualitybonusv>!num)"!anyvalue="(?<batterycapacityv>!num)"!anyvalue="(?<batterycapacityv2>!num)"' \
'qualitybonus=qualitybonus*2
qualitybonusv=qualitybonus
batterycapacity=batterycapacity*4
batterycapacityv=1+batterycapacity/100
batterycapacityv2=1+batterycapacity/100' \
**/TalentsEngineer.xml

modify '<Talent identifier="betterthannew">!anyvalue="(?<deteriorationratereduction>!num)"!anyCharacterAbilityGiveItemStat stattype="DetoriationSpeed" value="(?<deteriorationratereductionv>!num)"' \
'deteriorationratereduction=deteriorationratereduction*1.5
deteriorationratereductionv=deteriorationratereduction' \
**/TalentsEngineer.xml

# TODO: Fix this? There's a potential bug in modify
modify '<Talent identifier="lightningwizard">!anypowerreduction!anyvalue="(?<damagereduction>!num)"!anystunseconds!anyvalue="(?<stunseconds>!num)"!anyaddeddamagemultiplier="(?<damagereductionv>!num)"!anystun" amount="(?<stunsecondsv>!num)"' \
'damagereduction=damagereduction*1.15
stunseconds=stunseconds*2
damagereductionv=damagereduction/100
stunsecondsv=stunseconds' \
**/TalentsEngineer.xml

modify '<Talent identifier="unstoppablecuriosity">!anyvalue="(?<dooropeningspeed>!num)"!anyvalue="(?<addeddamagemultiplier>!num)"!anyaddeddamagemultiplier="(?<addeddamagemultiplierv>!num)"!anymultiplyvalue="(?<dooropeningspeedv>!num)"' \
'dooropeningspeed=dooropeningspeed*4
addeddamagemultiplier=addeddamagemultiplier*4
addeddamagemultiplierv=addeddamagemultiplier/100
dooropeningspeedv=dooropeningspeed/100' \
**/TalentsEngineer.xml

modify '<Talent identifier="buzzing">!anyvalue="(?<reactormaxoutput>!num)"!anystattype="ReactorMaxOutput" value="(?<reactormaxoutputv>!num)"!anystattype="ReactorMaxOutput" value="(?<reactormaxoutputv2>!num)"' \
'reactormaxoutput=reactormaxoutput*2
local adjusted = round(1+reactormaxoutput/100, 2)
reactormaxoutputv=adjusted
reactormaxoutputv2=adjusted' \
**/TalentsEngineer.xml

modify '<Talent identifier="cruising">!anyvalue="(?<reactorfuelconsumption>!num)"!anystattype="ReactorFuelConsumption" value="(?<reactorfuelconsumptionv>!num)"!anystattype="ReactorFuelConsumption" value="(?<reactorfuelconsumptionv2>!num)"' \
'reactorfuelconsumption=reactorfuelconsumption*2
local adjusted = round(1-reactorfuelconsumption/100, 2)
reactorfuelconsumptionv=adjusted
reactorfuelconsumptionv2=adjusted' \
**/TalentsEngineer.xml

# It is not obvious to me if we are doing 1-
# Or 1+v
# Because we're on the only value that makes it ambiguous
# 50% - 0.5
modify '<Talent identifier="dangerzone">!anyvalue="(?<radiationsicknessresistance>!num)"!anymultiplier="(?<radiationsicknessresistancev>!num)"' \
'radiationsicknessresistance=radiationsicknessresistance*1
radiationsicknessresistancev=1-radiationsicknessresistance/100' \
**/TalentsEngineer.xml

modify '<Talent identifier="phdinnuclearphysics">!anyvalue="(?<addeddamagemultiplier>!num)"!anyaddeddamagemultiplier="(?<addeddamagemultiplierv>!num)"' \
'addeddamagemultiplier=addeddamagemultiplier*2
addeddamagemultiplierv=addeddamagemultiplier/100' \
**/TalentsEngineer.xml