- name: ballastdenizen
  regex: <Talent identifier="ballastdenizen">!anyvalue="(?<holdbreathmultiplier>!num)"!anyCharacterAbilityGiveStat stattype="HoldBreathMultiplier" value="(?<holdbreathmultiplierv>!num)"
  lua: |
    holdbreathmultiplier=round(holdbreathmultiplier*2, 2)
    holdbreathmultiplierv=round(holdbreathmultiplier/100, 2)
  files:
    - '**/TalentsMechanic.xml'

- name: engineengineer
  regex: <Talent identifier="engineengineer">!anyvalue="(?<enginemaxspeedperlevel>!num)"!anyvalue="(?<enginemaxspeedmaxvalue>!num)"!anyvalue="(?<enginemaxspeedv>!num)"!anyvalue="(?<enginemaxspeedv2>!num)"!anyvalue="(?<enginemaxspeedv3>!num)"!anyvalue="(?<enginemaxspeedv4>!num)"!anyvalue="(?<enginemaxspeedv5>!num)"!anyvalue="(?<enginemaxspeedv6>!num)"!anyvalue="(?<enginemaxspeedv7>!num)"!anyvalue="(?<enginemaxspeedv8>!num)"
  lua: |
    enginemaxspeedperlevel=round(enginemaxspeedperlevel*2, 2)
    enginemaxspeedmaxvalue=round(enginemaxspeedmaxvalue*2, 2)
    enginemaxspeedv=round(1+enginemaxspeedperlevel/100, 2)
    enginemaxspeedv2=round(1+2*enginemaxspeedperlevel/100, 2)
    enginemaxspeedv3=round(1+3*enginemaxspeedperlevel/100, 2)
    enginemaxspeedv4=round(1+4*enginemaxspeedperlevel/100, 2)
    enginemaxspeedv5=round(1+5*enginemaxspeedperlevel/100, 2)
    enginemaxspeedv6=round(1+6*enginemaxspeedperlevel/100, 2)
    enginemaxspeedv7=round(1+7*enginemaxspeedperlevel/100, 2)
    enginemaxspeedv8=round(1+8*enginemaxspeedperlevel/100, 2)
  files:
    - '**/TalentsMechanic.xml'

- name: machinemaniac
  regex: <Talent identifier="machinemaniac"!anyamount!anyamount!anyvalue="(?<mechanicalskillbonus>!num)"!anyxpamount!anyvalue="(?<xpbonus>!num)"!anylevel!anyvalue="(?<levelbonus>!num)"!anyamount!anyvalue="(?<repairspeed>!num)"!anyCharacterAbilityGiveExperience amount="(?<experiencev>!num)"!anyCharacterAbilityGivePermanentStat stattype="MechanicalSkillBonus"!anyvalue="(?<mechanicalskillbonusv>!num)"!anyCharacterAbilityUpgradeSubmarine!anylevel="(?<levelv>!num)"!anyCharacterAbilityGivePermanentStat stattype="MechanicalRepairSpeed"!anyvalue="(?<repairspeedv>!num)"
  lua: |
    mechanicalskillbonus=round(mechanicalskillbonus*1.5, 2)
    xpbonus=round(xpbonus*2, 2)
    levelbonus=round(levelbonus*2, 2)
    repairspeed=round(repairspeed*2, 2)
    experiencev=xpbonus
    levelv=levelbonus
    mechanicalskillbonusv=mechanicalskillbonus
    repairspeedv=round(repairspeed/100, 2)
  files:
    - '**/TalentsMechanic.xml'

- name: multifunctional
  regex: <Talent identifier="multifunctional">!anyvalue="(?<addeddamagemultiplier>!num)"!anyaddeddamagemultiplier="(?<addeddamagemultiplierv>!num)"
  lua: |
    addeddamagemultiplier=round(addeddamagemultiplier*1.5, 2)
    addeddamagemultiplierv=round(addeddamagemultiplier/100, 2)
  files:
    - '**/TalentsMechanic.xml'

- name: salvagecrew
  regex: <Talent identifier="salvagecrew">!anyvalue="(?<xpbonus>!num)"!anyswimbonus!anyvalue="(?<swimbonus>!num)"!anyvalue="(?<resistanceamount>!num)"!anymultiplyvalue="(?<xpbonusv>!num)"
  lua: |
    xpbonus=round(xpbonus*2, 2)
    swimbonus=round(swimbonus*2, 2)
    resistanceamount=round(resistanceamount*1.5, 2)
    xpbonusv=round(1+xpbonus/100, 2)
  files:
    - '**/TalentsMechanic.xml'
- name: salvagecrew
  regex: <Affliction!anyidentifier="salvagecrew"!anyminresistance="(?<minresistance>!num)"!anymaxresistance="(?<maxresistance>!num)"!anySwimmingSpeed!anyvalue="(?<swimmingspeed>!num)"
  lua: |
    minresistance=round(minresistance*1.5, 2)
    maxresistance=round(maxresistance*1.5, 2)
    swimmingspeed=round(swimmingspeed*2, 2)
  files:
    - '**/AfflictionsMechanic.xml'

- name: modularrepairs
  regex: <Talent identifier="modularrepairs">!anylevel!anyvalue="(?<levelbonus>!num)"!anylevel="(?<levelbonusv>!num)"!anylevel="(?<levelbonusv2>!num)"
  lua: |
    levelbonus=round(levelbonus*2, 2)
    levelbonusv=levelbonus
    levelbonusv2=levelbonus
  files:
    - '**/TalentsMechanic.xml'

- name: oiledmachinery
  regex: <Talent identifier="oiledmachinery">!anyvalue="(?<fabricationspeed>!num)"!anyFabricationSpeed" value="(?<fabricationspeedv>!num)"!anyDeconstructorSpeed" value="(?<deconstructorspeedv>!num)"
  lua: |
    fabricationspeed=round(fabricationspeed*2, 2)
    fabricationspeedv=round(fabricationspeed/100, 2)
    deconstructorspeedv=round(fabricationspeed/100, 2)
  files:
    - '**/TalentsMechanic.xml'

- name: pumpndump
  regex: <Talent identifier="pumpndump">!anyvalue="(?<pumpspeed>!num)"!anyPumpSpeed" value="(?<pumpspeedv>!num)"
  lua: |
    pumpspeed=round(pumpspeed*3, 2)
    pumpspeedv=round(1+pumpspeed/100, 2)
  files:
    - '**/TalentsMechanic.xml'

# Not obvious what this does
# "Unlock hull upgrades as if your submarine is one tier higher. Does not stack with multiple of the same talent."
# - name: retrofit
#   regex: <Talent identifier="retrofit">!anyvalue="(?<walllevel>!num)"
#   lua: |
#     walllevel=round(walllevel*1, 2)
#   files:
#     - '**/TalentsMechanic.xml'

- name: miner
  regex: <Talent identifier="miner">!anyvalue="(?<doubleyieldchance>!num)"!anyvalue="(?<miningspeed>!num)"!anyvalue="(?<miningspeedv>!num)"!anyrandomchance="(?<doubleyieldchancev>!num)"
  lua: |
    doubleyieldchance=round(doubleyieldchance*3.5, 2)
    miningspeed=round(miningspeed*2, 2)
    miningspeedv=round(1+miningspeed/100, 2)
    doubleyieldchancev=round(doubleyieldchance/100, 2)
  files:
    - '**/TalentsMechanic.xml'

- name: massproduction
  regex: <Talent identifier="massproduction">!anyvalue="(?<doublechance>!num)"!anyrandomChance="(?<doublechancev>!num)"
  lua: |
    doublechance=round(doublechance*1.45, 2)
    doublechancev=round(doublechance/100, 2)
  files:
    - '**/TalentsMechanic.xml'

- name: residualwaste
  regex: <Talent identifier="residualwaste">!anyvalue="(?<doublechance>!num)"!anyrandomChance="(?<doublechancev>!num)"
  lua: |
    doublechance=round(doublechance*3.45, 2)
    doublechancev=round(doublechance/100, 2)
  files:
    - '**/TalentsMechanic.xml'

- name: scrapsavant
  regex: <Talent identifier="scrapsavant">!anyvalue="(?<doublechance>!num)"!anymultiplyvalue="(?<scrapmultiplier>!num)"!anyrandomchance="(?<doublechancev>!num)"
  lua: |
    doublechance=round(doublechance*3.45, 2)
    scrapmultiplier=round(scrapmultiplier*1.5, 2)
    doublechancev=round(doublechance/100, 2)
  files:
    - '**/TalentsMechanic.xml'

- name: toolmaintenance
  regex: <Talent identifier="toolmaintenance">!anyvalue="(?<qualitybonus>!num)"!anyvalue="(?<qualitybonusv>!num)"!anyvalue="(?<qualitybonusv2>!num)"
  lua: |
    qualitybonus=round(qualitybonus*2, 2)
    qualitybonusv=qualitybonus
    qualitybonusv2=qualitybonus
  files:
    - '**/TalentsMechanic.xml'

- name: hullfixer
  regex: <Talent identifier="hullfixer">!anyvalue="(?<repairtoolstructurerepairmultiplier>!num)"!anyvalue="(?<repairtoolstructurerepairmultiplierv>!num)"
  lua: |
    repairtoolstructurerepairmultiplier=round(repairtoolstructurerepairmultiplier*2, 2)
    repairtoolstructurerepairmultiplierv=round(repairtoolstructurerepairmultiplier/100, 2)
  files:
    - '**/TalentsMechanic.xml'

- name: quickfixer
  regex: <Talent identifier="quickfixer">!anyvalue="(?<movementspeed>!num)"!anyvalue="(?<duration>!num)"!anyvalue="(?<repairspeed>!num)"!anyamount="(?<durationv>!num)"
  lua: |
    movementspeed=round(movementspeed*1.5, 2)
    duration=round(duration*2, 2)
    repairspeed=round(repairspeed*2, 2)
    durationv=duration
  files:
    - '**/TalentsMechanic.xml'
- name: quickfixer
  regex: <Affliction!anyidentifier="quickfixer"!anyvalue="(?<movementspeedv>!num)"
  lua: |
    movementspeedv=round(movementspeedv*1.5, 2)
  files:
    - '**/AfflictionsMechanic.xml'

- name: tinkerer
  regex: <Talent identifier="tinkerer">!anyvalue="(?<maxrepairconditionmultipliermechanical>!num)"!anyvalue="(?<maxrepairconditionmultipliermechanicalv>!num)"
  lua: |
    maxrepairconditionmultipliermechanical=round(maxrepairconditionmultipliermechanical*2.5, 2)
    maxrepairconditionmultipliermechanicalv=round(maxrepairconditionmultipliermechanical/100, 2)
  files:
    - '**/TalentsMechanic.xml'

- name: letitdrain
  regex: <Talent identifier="letitdrain">!anyvalue="(?<maxpumps>!num)"!anyvalue="(?<maxpumpsv>!num)"
  lua: |
    maxpumps=round(maxpumps*2, 2)
    maxpumpsv=maxpumps
  files:
    - '**/TalentsMechanic.xml'

- name: robotics
  regex: <Talent identifier="robotics">!anyvalue="(?<maxdrones>!num)"
  lua: |
    maxdrones=round(maxdrones*2, 2)
  files:
    - '**/TalentsMechanic.xml'
- name: defensebotspawner
  regex: <Item!anyidentifier="defensebotspawner"!anytotalmaxcount="(?<maxdronesv>!num)"
  lua: |
    maxdronesv=round(maxdronesv*2, 2)
  files:
    - '**/mechanic_talent_items.xml'

- name: iamthatguy
  regex: <Talent identifier="iamthatguy">!anyvalue="(?<damagebonus>!num)"!anyvalue="(?<skillbonus>!num)"!anySkillBonus" value="(?<skillbonusv>!num)"!anyaddedmultiplier="(?<damagebonusv>!num)"
  lua: |
    damagebonus=round(damagebonus*1.5, 2)
    skillbonus=round(skillbonus*1.5, 2)
    skillbonusv=skillbonus
    damagebonusv=round(damagebonus/100, 2)
  files:
    - '**/TalentsMechanic.xml'

- name: heavylifting
  regex: <Talent identifier="heavylifting">!anyvalue="(?<movementspeed>!num)"!anyvalue="(?<movementspeedv>!num)"
  lua: |
    movementspeed=round(movementspeed*1.5, 2)
    movementspeedv=round(movementspeed/100, 2)
  files:
    - '**/TalentsMechanic.xml'

- name: mudraptorwrestler
  regex: <Talent identifier="mudraptorwrestler">!anyvalue="(?<addeddamage>!num)"!anyvalue="(?<bonusresistance>!num)"!anyaddeddamagemultiplier="(?<addeddamagev>!num)"!anyCharacterAbilityGiveResistance resistanceid="damage" multiplier="(?<bonusresistancev>!num)"
  lua: |
    addeddamage=round(addeddamage*1.5, 2)
    addeddamagev=round(addeddamage/100, 2)
    bonusresistance=round(bonusresistance*1.5, 2)
    bonusresistancev=round(1-bonusresistance/100, 2)
  files:
    - '**/TalentsMechanic.xml'

- name: berserker
  regex: <Talent identifier="berserker">!anyvalue="(?<hpthreshold>!num)"!anyvalue="(?<damagebonus>!num)"!anyvitalitypercentage="(?<hpthresholdv>!num)"
  lua: |
    hpthreshold=round(hpthreshold*1.37, 2)
    damagebonus=round(damagebonus*1.5, 2)
    hpthresholdv=round(hpthreshold/100, 2)
  files:
    - '**/TalentsMechanic.xml'
- name: berserker
  regex: <Affliction!anyidentifier="berserker"!anyvalue="(?<meleedamage>!num)"
  lua: |
    meleedamage=round(meleedamage*1.5, 2)
  files:
    - '**/AfflictionsMechanic.xml'

- name: foolhardy
  regex: <Talent identifier="foolhardy">!anyvalue="(?<hpthreshold>!num)"!anyvalue="(?<resistancebonus>!num)"!anyvitalitypercentage="(?<hpthresholdv>!num)"
  lua: |
    hpthreshold=round(hpthreshold*1.37, 2)
    resistancebonus=round(resistancebonus*1.5, 2)
    hpthresholdv=round(hpthreshold/100, 2)
  files:
    - '**/TalentsMechanic.xml'
- name: foolhardy
  regex: <Affliction!anyidentifier="foolhardy"!anyresistancefor="damage" minresistance="(?<minresistance>!num)" maxresistance="(?<maxresistance>!num)"
  lua: |
    minresistance=round(minresistance*2, 2)
    maxresistance=round(maxresistance*2, 2)
  files:
    - '**/AfflictionsMechanic.xml'

# MECHanic is missing but I can't find its id...
