pokerogue/src/test/abilities
flx-sta 4389bff5d0
[Bug] Fix stat-protection-attribute not taking inverts (e.g. Contrary) into account (#4031)
* add generic types to`Pokemon.getAbilityAttrs()`

* add invert check to `ProtectStatAbAttr.apply...`

This makes sure that a stat is only protected if no other ability inverts the change. E.g. `Contrary` inverts any decrease to an increase

* migrate contrary.test.ts to game.classicMode

* move `StatStageChangeMultiplierAbAttr` resolve above `ProtectStatAbAttr`

The effect of StatStageChangeMultiplierAbAttr is now applied before resolving any ProtectStatAbAttr. Thus the stage (level) of the BattleStat change was properly altered at the time of resolving the protection

* revert ability.ts changes

* add automated tests for `Clear Body` + `Contrary`

* StateStageChangePhase replace ~~`IntegerHolder`~~ with `NumberHolder`

Update Utils import and replace all occurcences of `Utils.`

* contrary.test.ts: remove `js` import
2024-09-17 19:14:41 -07:00
..
ability_timing.test.ts [Test] Tests now default to using "Set" battle style (#3728) 2024-09-01 23:32:31 -04:00
aura_break.test.ts [Dev] Make OPP_MOVESET_OVERRIDE fully override the enemy's moveset (#4062) 2024-09-09 12:55:11 -04:00
battery.test.ts [Dev] Make OPP_MOVESET_OVERRIDE fully override the enemy's moveset (#4062) 2024-09-09 12:55:11 -04:00
battle_bond.test.ts [Test] Replace doAttack() with move.select() in tests (#3567) 2024-08-22 06:49:33 -07:00
beast_boost.test.ts [Dev] Make OPP_MOVESET_OVERRIDE fully override the enemy's moveset (#4062) 2024-09-09 12:55:11 -04:00
contrary.test.ts [Bug] Fix stat-protection-attribute not taking inverts (e.g. Contrary) into account (#4031) 2024-09-17 19:14:41 -07:00
costar.test.ts [Dev] Make OPP_MOVESET_OVERRIDE fully override the enemy's moveset (#4062) 2024-09-09 12:55:11 -04:00
dancer.test.ts [Dev] Make OPP_MOVESET_OVERRIDE fully override the enemy's moveset (#4062) 2024-09-09 12:55:11 -04:00
disguise.test.ts [Dev] Make OPP_MOVESET_OVERRIDE fully override the enemy's moveset (#4062) 2024-09-09 12:55:11 -04:00
dry_skin.test.ts [Dev] Make OPP_MOVESET_OVERRIDE fully override the enemy's moveset (#4062) 2024-09-09 12:55:11 -04:00
flash_fire.test.ts [Dev] Make OPP_MOVESET_OVERRIDE fully override the enemy's moveset (#4062) 2024-09-09 12:55:11 -04:00
flower_gift.test.ts [Dev] Make OPP_MOVESET_OVERRIDE fully override the enemy's moveset (#4062) 2024-09-09 12:55:11 -04:00
forecast.test.ts [Dev] Make OPP_MOVESET_OVERRIDE fully override the enemy's moveset (#4062) 2024-09-09 12:55:11 -04:00
galvanize.test.ts [Dev] Make OPP_MOVESET_OVERRIDE fully override the enemy's moveset (#4062) 2024-09-09 12:55:11 -04:00
gorilla_tactics.test.ts [Test] Fix throat chop and gorilla tactics tests (#4140) 2024-09-09 16:03:29 -04:00
gulp_missile.test.ts [Dev] Make OPP_MOVESET_OVERRIDE fully override the enemy's moveset (#4062) 2024-09-09 12:55:11 -04:00
heatproof.test.ts [Dev] Make OPP_MOVESET_OVERRIDE fully override the enemy's moveset (#4062) 2024-09-09 12:55:11 -04:00
hustle.test.ts [Dev] Make OPP_MOVESET_OVERRIDE fully override the enemy's moveset (#4062) 2024-09-09 12:55:11 -04:00
hyper_cutter.test.ts [Dev] Make OPP_MOVESET_OVERRIDE fully override the enemy's moveset (#4062) 2024-09-09 12:55:11 -04:00
ice_face.test.ts [Test] Replace doAttack() with move.select() in tests (#3567) 2024-08-22 06:49:33 -07:00
imposter.test.ts [Dev] Make OPP_MOVESET_OVERRIDE fully override the enemy's moveset (#4062) 2024-09-09 12:55:11 -04:00
intimidate.test.ts [Dev] Make OPP_MOVESET_OVERRIDE fully override the enemy's moveset (#4062) 2024-09-09 12:55:11 -04:00
intrepid_sword.test.ts [Refactor/Bug/Move] Overhaul Stats and Battle Items, Implement Several Stat Moves (#2699) 2024-09-02 22:12:34 -04:00
libero.test.ts [Dev] Make OPP_MOVESET_OVERRIDE fully override the enemy's moveset (#4062) 2024-09-09 12:55:11 -04:00
magic_guard.test.ts [Dev] Make OPP_MOVESET_OVERRIDE fully override the enemy's moveset (#4062) 2024-09-09 12:55:11 -04:00
moody.test.ts [Dev] Make OPP_MOVESET_OVERRIDE fully override the enemy's moveset (#4062) 2024-09-09 12:55:11 -04:00
moxie.test.ts [Dev] Make OPP_MOVESET_OVERRIDE fully override the enemy's moveset (#4062) 2024-09-09 12:55:11 -04:00
mycelium_might.test.ts [Refactor/Bug/Move] Overhaul Stats and Battle Items, Implement Several Stat Moves (#2699) 2024-09-02 22:12:34 -04:00
parental_bond.test.ts [Dev] Make OPP_MOVESET_OVERRIDE fully override the enemy's moveset (#4062) 2024-09-09 12:55:11 -04:00
pastel_veil.test.ts [Dev] Make OPP_MOVESET_OVERRIDE fully override the enemy's moveset (#4062) 2024-09-09 12:55:11 -04:00
power_construct.test.ts [Test] Replace doAttack() with move.select() in tests (#3567) 2024-08-22 06:49:33 -07:00
power_spot.test.ts [Dev] Make OPP_MOVESET_OVERRIDE fully override the enemy's moveset (#4062) 2024-09-09 12:55:11 -04:00
protean.test.ts [Dev] Make OPP_MOVESET_OVERRIDE fully override the enemy's moveset (#4062) 2024-09-09 12:55:11 -04:00
quick_draw.test.ts [Dev] Make OPP_MOVESET_OVERRIDE fully override the enemy's moveset (#4062) 2024-09-09 12:55:11 -04:00
sand_spit.test.ts [Dev] Make OPP_MOVESET_OVERRIDE fully override the enemy's moveset (#4062) 2024-09-09 12:55:11 -04:00
sand_veil.test.ts [Refactor/Bug/Move] Overhaul Stats and Battle Items, Implement Several Stat Moves (#2699) 2024-09-02 22:12:34 -04:00
sap_sipper.test.ts [Dev] Make OPP_MOVESET_OVERRIDE fully override the enemy's moveset (#4062) 2024-09-09 12:55:11 -04:00
schooling.test.ts [Test] Replace doAttack() with move.select() in tests (#3567) 2024-08-22 06:49:33 -07:00
screen_cleaner.test.ts [Test] Replace doAttack() with move.select() in tests (#3567) 2024-08-22 06:49:33 -07:00
serene_grace.test.ts [Refactor/Bug/Move] Overhaul Stats and Battle Items, Implement Several Stat Moves (#2699) 2024-09-02 22:12:34 -04:00
sheer_force.test.ts [Refactor/Bug/Move] Overhaul Stats and Battle Items, Implement Several Stat Moves (#2699) 2024-09-02 22:12:34 -04:00
shield_dust.test.ts [Refactor/Bug/Move] Overhaul Stats and Battle Items, Implement Several Stat Moves (#2699) 2024-09-02 22:12:34 -04:00
shields_down.test.ts [Test] Replace doAttack() with move.select() in tests (#3567) 2024-08-22 06:49:33 -07:00
simple.test.ts [Dev] Make OPP_MOVESET_OVERRIDE fully override the enemy's moveset (#4062) 2024-09-09 12:55:11 -04:00
stall.test.ts [Refactor] Improvements on getOrder() (#3547) 2024-09-01 15:23:25 -07:00
steely_spirit.test.ts [Dev] Make OPP_MOVESET_OVERRIDE fully override the enemy's moveset (#4062) 2024-09-09 12:55:11 -04:00
sturdy.test.ts [Test] Replace doAttack() with move.select() in tests (#3567) 2024-08-22 06:49:33 -07:00
sweet_veil.test.ts [Dev] Make OPP_MOVESET_OVERRIDE fully override the enemy's moveset (#4062) 2024-09-09 12:55:11 -04:00
tera_shell.test.ts [Dev] Make OPP_MOVESET_OVERRIDE fully override the enemy's moveset (#4062) 2024-09-09 12:55:11 -04:00
unseen_fist.test.ts [Move] Implement Substitute (#2559) 2024-09-13 12:46:22 -04:00
volt_absorb.test.ts [Refactor/Bug/Move] Overhaul Stats and Battle Items, Implement Several Stat Moves (#2699) 2024-09-02 22:12:34 -04:00
wind_power.test.ts [Dev] Make OPP_MOVESET_OVERRIDE fully override the enemy's moveset (#4062) 2024-09-09 12:55:11 -04:00
wind_rider.test.ts [Dev] Make OPP_MOVESET_OVERRIDE fully override the enemy's moveset (#4062) 2024-09-09 12:55:11 -04:00
wonder_skin.test.ts [Dev] Make OPP_MOVESET_OVERRIDE fully override the enemy's moveset (#4062) 2024-09-09 12:55:11 -04:00
zen_mode.test.ts [Refactor/Bug/Move] Overhaul Stats and Battle Items, Implement Several Stat Moves (#2699) 2024-09-02 22:12:34 -04:00
zero_to_hero.test.ts [Dev] Make OPP_MOVESET_OVERRIDE fully override the enemy's moveset (#4062) 2024-09-09 12:55:11 -04:00