tumbling.xml
<abilities>
<ability>
<name>Tumbling</name>
<key>tumbling</key>
<skill>athletics</skill>
<icon>tumbling</icon>
<tagline>"The ground is my ally. It will catch me when I fall."</tagline>
<description>
Whenever an enemy would hit you with a melee attack, you have a 15% chance to roll aside and avoid the
attack, plus 0.5% per Athletics level.
[p]Costs ⮃2⮃ energy per turn and ⮃5 energy per roll⮃.
[p]Each successful roll increases roll chance by 2% and adds 1 energy cost. Resets when toggled off.
</description>
<type>toggle</type>
<cost>2.0</cost>
<cooldown>2</cooldown>
<toggleInfo>
<xpGain>
<skill>athletics</skill>
<displayAmount>{xp} xp on tumble</displayAmount>
<amount>0.0</amount>
<amountToDisplay>5.0</amountToDisplay>
</xpGain>
<description>
Consume {{global_flag -> key:tumbling_energy_cost}} energy on roll.
</description>
<modifiers>
<modifiers>
<type>EscapeAttackChance</type>
<amount>0.15</amount>
</modifiers>
<modifiers>
<type>EscapeAttackChance</type>
<amount>0.0</amount>
<modifierConversion>
<type>Flag</type>
<flag>tumbling_roll_bonus</flag>
<multiplier>0.02</multiplier>
</modifierConversion>
</modifiers>
<modifiers>
<type>EscapeAttackChance</type>
<amount>0.005</amount>
<multiplier>Athletics</multiplier>
</modifiers>
</modifiers>
<triggers>
<triggers>
KEY tumbling_trigger;
WHEN PlayerEscapeAttacks;
THEN RewardExperience -> skill:athletics, xp:5, reason:Tumbling;
THEN GiveEnergy -> amount:-{{G:tumbling_energy_cost}}, target:player;
THEN ModifyGlobalFlag -> global_flag:tumbling_energy_cost, operation:add, amount:1;
THEN ModifyGlobalFlag -> global_flag:tumbling_roll_bonus, operation:add, amount:1;
</triggers>
</triggers>
<onEffects>
<onEffects>
ModifyGlobalFlag -> global_flag:tumbling_energy_cost, operation:set, amount:5;
ModifyGlobalFlag -> global_flag:tumbling_roll_bonus, operation:set, amount:0;
</onEffects>
</onEffects>
</toggleInfo>
<unlockInfo>
<autoUnlock>-1</autoUnlock>
<autoDiscover>0</autoDiscover>
<unlockRequirements>
<requiredPoints>2</requiredPoints>
</unlockRequirements>
</unlockInfo>
</ability>
</abilities>