Skip to content

Commit

Permalink
[Enhancement][EnemyAI] Add support for simulated damage calculations …
Browse files Browse the repository at this point in the history
…and "Search for KO" move filtering (#3975)

* Create getAttackDamage function

* Add ignoreAbility params to getBattleStat

* Rewrite Pokemon.apply

* renamed damage variables

* Add `ignoreSourceAbility` arg to `getAttackDamage`

* Enemy AI now searches for KO moves

* Add probabilistic test for KO search

* Add tests to `damage_calculation`

* "killMoves" --> "koMoves"

* Clean up `randomMultiplier`

* Clean up damage calculation test

Co-authored-by: NightKev <[email protected]>

* Fix stabMultiplier using base type for Tera bonus

* Restore simulation capabilities for Unaware

* move sourceTeraType closer to where it's used

* Add base damage test

* Exclude counter moves from KO search

---------

Co-authored-by: NightKev <[email protected]>
  • Loading branch information
innerthunder and DayKev authored Sep 14, 2024
1 parent 9d3681c commit 77f0fe6
Show file tree
Hide file tree
Showing 4 changed files with 537 additions and 284 deletions.
2 changes: 1 addition & 1 deletion src/data/move.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3977,7 +3977,7 @@ export class StatusCategoryOnAllyAttr extends VariableMoveCategoryAttr {

export class ShellSideArmCategoryAttr extends VariableMoveCategoryAttr {
apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean {
const category = (args[0] as Utils.IntegerHolder);
const category = (args[0] as Utils.NumberHolder);
const atkRatio = user.getEffectiveStat(Stat.ATK, target, move) / target.getEffectiveStat(Stat.DEF, user, move);
const specialRatio = user.getEffectiveStat(Stat.SPATK, target, move) / target.getEffectiveStat(Stat.SPDEF, user, move);

Expand Down
Loading

0 comments on commit 77f0fe6

Please sign in to comment.