pokerogue icon indicating copy to clipboard operation
pokerogue copied to clipboard

[Enhancement] Add support for simulated calls to Abilities

Open innerthunder opened this issue 6 months ago • 0 comments

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 a simulated argument for their apply function (and all variants of apply, e.g. applyPreDefend). The exported applyXAttrs functions also now have the option to run quietly (i.e. without the ability UI flyouts) with a similar simulated argument. [WIP]
  • Fixed calls to applyXAttrs in data/move, field/pokemon, phases, etc. to reflect the new simulated argument (This arg is false for all existing calls to applyXAttrs 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)
  • [n/a] Are the changes visual?
    • [n/a] Have I provided screenshots/videos of the changes?

innerthunder avatar Aug 13 '24 08:08 innerthunder