pokerogue
pokerogue copied to clipboard
[Enhancement] Add support for simulated calls to Abilities
What are the changes?
No user-facing changes -- this just adds a simulated
argument to all abilities' apply
functions in support of future implementation of simulated calls.
Why am I doing these changes?
As a part of an upcoming AI rework, the enemy will need to be able to simulate outcomes for each of its possible actions with no adverse effects on the battle itself. For many abilities, this would require a distinction between an in-battle apply
and a simulated apply
. This PR adds that distinction.
What did change?
-
data/ability
: All ability attributes now have asimulated
argument for theirapply
function (and all variants ofapply
, e.g.applyPreDefend
). The exportedapplyXAttrs
functions also now have the option to run quietly (i.e. without the ability UI flyouts) with a similarsimulated
argument. [WIP] - Fixed calls to
applyXAttrs
indata/move
,field/pokemon
,phases
, etc. to reflect the newsimulated
argument (This arg isfalse
for all existing calls toapplyXAttrs
atm).
Screenshots/Videos
N/A
How to test the changes?
simulated call tests are WIP
Checklist
- [x] I'm using
beta
as my base branch - [x] There is no overlap with another PR?
- [x] The PR is self-contained and cannot be split into smaller PRs?
- [x] Have I provided a clear explanation of the changes?
- [x] Have I considered writing automated tests for the issue?
- [x] Have I tested the changes (manually)?
- [x] Are all unit tests still passing? (
npm run test
)
- [x] Are all unit tests still passing? (
- [n/a] Are the changes visual?
- [n/a] Have I provided screenshots/videos of the changes?