Commit Graph

124 Commits

Author SHA1 Message Date
pyuk-bot
ee9677b0b6
Mycelium Might makes called moves ignore abilities (#9028) 2022-11-23 13:39:51 -05:00
Alexander B
667c3fa072
Unit Tests: Transition to Gen 9 (#9009)
* Fix Tera STAB test

* Remove old comments
2022-11-18 21:34:40 -08:00
Sergio
8225c4fad1
Trigger Emergency Exit after Mind Blown (#8976) 2022-11-10 07:45:03 -06:00
Annika
3eda79ccb2 Remove unnecessary RNG roll for targeting
This should make singles battles faster and more accurate
2022-11-04 17:03:16 -07:00
Sergio
a6dd79ba90
Fix Neutralizing Gas Primal weather interaction (#8930) 2022-10-15 13:55:17 -05:00
Leonard Craft III
05faddbc93 Correct super Sitrus Berry HP restoration amount 2022-10-08 14:50:35 -05:00
Leonard Craft III
1de7cddb44
Add various mechanics tests (#8915) 2022-10-05 21:59:34 -05:00
Karthik
eb49ac32ef
Fix Slow Start not halving Sp. Atk for special Z-Moves (#8739) 2022-04-28 14:03:57 -05:00
Karthik
d8edc4d71e
Fix Counter/Mirror Coat/Metal Burst failure timing (#8723) 2022-04-18 22:33:21 -05:00
Leonard Craft III
11ed145db5
Implement secondaries stat chance overflow (#8629) 2022-01-20 19:17:16 -06:00
pyuk-bot
3f542a9115
Deduct Pressure PP from caller moves like Assist (#8582) 2021-12-26 18:56:19 -06:00
Leonard Craft III
26ef4d3746
Fix interaction of Transformed Neutralizing Gas (#8576) 2021-12-20 07:54:41 -06:00
pyuk-bot
fdd775b3f1
Re-fix Frisk's interaction with Neturalizing Gas (#8526) 2021-11-10 10:30:20 -08:00
Leonard Craft III
ba07a7c75d
Add various mechanics tests (#8494) 2021-11-05 13:28:45 -05:00
Leonard Craft III
25910ed66d
Fix timing of freeze thaws (#8453) 2021-09-29 20:29:26 -04:00
tofa
21182025ce
Fix Ice Face's interaction with Neutralizing Gas (#8479) 2021-09-23 20:50:03 -05:00
Leonard Craft III
dd27caf23d Remove debug print 2021-09-19 17:19:02 -05:00
Leonard Craft III
3ce53a63b8 Add more Ice Face tests 2021-09-19 17:16:24 -05:00
Karthik
d99779ba8a
Gen III-IV: Fix interaction between Liquid Ooze / Dream Eater (#8467) 2021-09-19 10:28:22 -04:00
Karthik
faa37924ee
Fix Emergency Exit not activating after recoil damage (#8441) 2021-08-21 13:17:23 -05:00
Karthik
a36b74dbd1
Gen 3: Type boosting items should boost the attacking stat (#8402) 2021-07-17 13:36:56 -04:00
Leonard Craft III
606576f453
Add various mechanics tests (#8313)
* Standardize Photon Geyser tests
* Add Gulp Missile tests
* Add Berserk Dragon Darts test
* Add Ring Target tests
* Add and improve Metronome tests
* Add Sparkling Aria tests
* Add additional Fling tests
* Standardize Mummy tests
* Add Rollout submove targeting test
* Improve Flower Veil tests
* Add Acupressure tests
* Improve Sky Drop tests
* Add Future Sight tests
* Improve Wandering Spirit tests
* Improve Rapid Spin tests
* Add Rocky Helmet victory test
* Improve Focus Punch tests
* Add a skipped Stomping Tantrum test
2021-05-20 08:43:08 -04:00
Leonard Craft III
a2513173f3
Fix Neutralizing Gas ending if another is active (#8305) 2021-05-15 08:44:33 -07:00
Annika
1c3f6402f0
Tests: Use assert.equal and assert.notEqual more (#8276) 2021-05-07 23:51:18 -07:00
Karthik
b6d5fff24b
Unfix interaction between Gluttony and Neutralizing Gas ending (#8273)
Reverts #8250, but will keep gluttony test file and add more tests to it. This is being done because indirect sources of damages are not causing gluttony to trigger (such as belly drum).
2021-05-05 13:44:59 -04:00
Karthik
f453d37817
Fix interaction between Gluttony and Neutralizing Gas ending (#8250) 2021-05-03 11:25:47 -04:00
Leonard Craft III
d49a40feb2 Tests: Improve G-Max Volcalith Sea of Fire test 2021-04-26 22:52:59 -05:00
Guangcong Luo
f9fdc73133
Support per-pokemon Residual handlers in Side/Field conditions (#8222)
For side conditions, `onStart`/`onRestart`/`onResidual`/`onEnd`
have been renamed `onSideStart`/`onSideRestart`/`onSideResidual`/`onSideEnd`,
with the `onResidualOrder` properties renamed `onSideResidualOrder`.

For field conditions, `onStart`/`onRestart`/`onResidual`/`onEnd`
have been renamed `onFieldStart`/`onFieldRestart`/`onFieldResidual`/`onFieldEnd`,
with the `onResidualOrder` properties renamed `onFieldResidualOrder`.

(The `onField` and `onSide` part helps make it clear to the type system
that the first argument is a Field or Side, not a Pokemon.)

Side and field conditions can now use `onResidual` to tick separately
on each pokemon in Speed order. `onResidualOrder` (the per-pokemon
tick) can be timed separate from `onSideResidualOrder` (the
per-condition tick), allowing conditions to end at a different priority
than they tick per-pokemon.

Relatedly, `onTeamPreview` and `onStart` in formats now need to be
`onFieldTeamPreview` and `onFieldStart`.

Unrelatedly, `effectData` has been renamed `effectState`, and the
corresponding state containers (`pokemon.statusData`,
`pokemon.speciesData`, `pokemon.itemData`, `pokemon.abilityData`,
`field.weatherData`, `field.terrainData`) have been similarly renamed. I
renamed the types a while ago, but I was holding off renaming the fields
because it would be a breaking change. But this is a breaking change
anyway, so we might as well do it now.

Note: `onResidual` will tick even on `onSideEnd` turns, although
`onSideResidual` won't. When refactoring weather, remember to
check `this.state.duration` so you don't deal weather damage on the
ending turn.

Intended as a better fix for #8216
2021-04-25 10:55:54 -07:00
pyuk-bot
66c547432b
Fix Parental Bond to modify damage, not base power (#8226) 2021-04-25 12:06:27 -04:00
Karthik
adb164ad51
Fix Magician activation timing (#8202)
Use onAfterMoveSecondarySelf so Weakness Policy happens first
Fixes #8104
2021-04-17 12:26:29 -04:00
Guangcong Luo
13189fdb02
Update Dex API (#8181)
This is the change that renames:

- `Dex.getMove` -> `Dex.moves.get`
- `Dex.getAbility` -> `Dex.abilities.get`
- `Dex.getItem` -> `Dex.items.get`
- `Dex.getSpecies` -> `Dex.species.get`
- `Dex.getEffect` -> `Dex.conditions.get`
- `Dex.getNature` -> `Dex.natures.get`
- `Dex.getType` -> `Dex.types.get`
- `Dex.getFormat` -> `Dex.formats.get`

In addition, some other APIs have been updated:

- `getByID` methods have also been added to every other table.
- `Dex.moves.all()` now gets an array of all moves
  - Plus equivalent methods for `abilities`, `items`, `species`, `formats`, `natures`, `types`
  - Note: there's no `Dex.conditions.all()`
- new API: `Dex.stats` for naming/iterating stats
- `Dex.getEffectByID` -> `Dex.conditions.getByID`
- `Dex.getType` -> `Dex.types.get`
- `Dex.data.Formats` -> `Dex.data.Rulesets`
- `Dex.formats` -> now an array `Dex.formats.all()`
- `Dex.getRuleTable` -> `Dex.formats.getRuleTable`
- `Dex.validateFormat` -> `Dex.formats.validate`

Team functions have been split off into a new `sim/teams` package:

- `Dex.packTeam` -> `Teams.pack`
- `Dex.fastUnpackTeam` -> `Teams.unpack`
- `Dex.generateTeam` -> `Teams.generate`
- `Dex.stringifyTeam` -> `Teams.export`

`Teams.export` has also been rewritten to better match how it works in client.

This implements #8178
2021-04-08 03:00:37 -07:00
Karthik
3b1d3844dd
Negate Unburden while Neutralizing Gas is active (#8182) 2021-04-06 12:13:05 -04:00
urkerab
d4e6fb227c
Fix Aromatherapy failing if the right slot has a Substitute (#8151) 2021-04-02 17:35:04 -04:00
Karthik
19ae4f693f
Check for Berserk before eating Berries (#8147) 2021-04-02 17:30:34 -04:00
Karthik
258269348c
Allow Berries to be used between Unnerve switching to Unnerve (#8145) 2021-03-31 10:07:36 -04:00
Leonard Craft III
9db5e91afa Improve Thick Fat tests 2021-03-19 21:46:54 -05:00
Leonard Craft III
3e702fdc40 Add Slow Start tests 2021-02-16 16:48:29 -06:00
pyuk-bot
ccb92de32b
Set abilityOrder before entrance effects activate (#8010) 2021-02-11 16:14:59 -05:00
Leonard Craft III
0d78f967d6 Fix Ripen's interaction with Jaboca/Rowap Berries 2021-01-26 20:36:25 -06:00
urkerab
80d652d59b Sturdy should trigger before Focus Sash but after False Swipe 2021-01-05 16:58:03 +00:00
urkerab
4192201d60 Pressure should deduct additional PP from Z-moves and Max moves 2021-01-05 13:17:27 +00:00
urkerab
845b4386c4 Pressure should not deduct additional PP from Sticky Web 2021-01-05 13:14:56 +00:00
urkerab
6ba98478a6 Cursed Body should be able to disable Z-moves 2021-01-05 13:06:40 +00:00
Leonard Craft III
bed1f4ac99
Add various mechanics tests (#7857)
* Improve Volcalith tests readability

* Add G-Max Volcalith recoil damage order test

* Add 1 HP priority tests

* Add charge move targeting test

* Correct assertions of Ripen / Sturdy

* Skip failing tests

* Add Volcalith Black Sludge test

* Add Pressure Max / Z-move tests

* Add Pressure submove test

* Add NGas speed test

* Skip NGas speed test

* Add White Herb double Intimidate test

* Remove debug log

* Remove duplicate Pressure test

* Improve White Herb Intimidate test title

* Add Rollout Storage tests

* Add spread move Rollout storage test

* Add Magician Weakness Policy test

* Add Sleep tests

* Add Shell Bell spread move test

* Add Synchronize Lum Berry test

* oh yeah it doesn't work

* Remove duplicate test

* Add Sunsteel Strike tests

* Add Leech Seed ally switch test

* Add Primal weather Natural Gift test

* Add Emergency Exit hazards test

* Add generic hazards tests

* Add and standardize Arceus tests

* Add Transform ability test

* Add and standardize Parting Shot tests

* Add Memento tests

* Add Me First test

* Add Cursed Body Z-move test

* Add Assurance targeting test

* Clarify Assurance test description

* Add double faint switch test

* Add Receiver KO boost ability

* Add double Unnerve test

* Add Dynamax Eject Pack test

* Improve Dynamax forced switchout test

* Add Protective Pads Perish Body test

* Add Sticky Web Pressure test

* Add Speed modifier lower bound test

* Add Cloud Nine Hydration test

* Correct Cursed Body test

* Add Grassy Terrain Leftovers test

* Remove leftover debug

* Add additional Receiver and Soul-Heart tests

* Add Spite tests

* mish

* Add Shell Bell multihit test

* Add WP Dragon Tail test

Co-authored-by: The Immortal <the_immortal123@live.com>
2021-01-04 23:47:10 -08:00
Adam Tran
fbda1e5d92
Fix Protean/Libero on first of two turn moves (#7870) 2021-01-03 09:42:08 -05:00
urkerab
fa78e2a31c
Make Unnerve activate after Skill Swap and Neutralizing Gas wearing off (#7866) 2021-01-02 14:39:54 -05:00
Adam Tran
0f724acb03
Fix Neutralizing Gas ending issues (#7860) 2021-01-01 18:39:19 -05:00
The Immortal
d9c2ee8d39 Lum Berry activates after Synchronize
Thanks @DaWoblefet!
2020-12-31 21:58:36 +04:00
Leonard Craft III
653ca9d4ae Victory Star tests are Victory Star 2020-12-16 06:41:11 -06:00
Leonard Craft III
8fc481b65a Add Victory Star tests 2020-12-15 19:13:04 -06:00