Commit Graph

8 Commits

Author SHA1 Message Date
Bill Meltsner
98b5775198 Reorder the various checks about whether a move hits or not, and add an immunity check before any move calculations are done.
A move cannot "miss" if there is no target, and if the target is immune to an attack, the game always displays the immunity message - the move will never register as "missing".

This fixes a bug where a Pokemon with a type-absorbing ability (e.g. Volt Absorb) behind a Substitute would not absorb status moves (e.g. Thunder Wave) - they'd be blocked by the Substitute before the immunity check was ever run.

There is still a graphical glitch where if a move fails its accuracy check against an immune opponent, the animation will still be that of the move missing, even though the text will be the immunity text. I'm not sure how to fix that given the current move message format.
2012-07-03 05:25:29 -05:00
Guangcong Luo
cb4aae18a3 formats.js can now list alternate gens 2012-06-16 15:50:34 -07:00
Guangcong Luo
b3054fefdf Load all data using tools.js
- the original names BattleItems etc have been deprecated; please use:
  - Tools.getItem() accessor method if possible
  - Tools.data.Items for lower-level access (e.g. iteration)
- app.js was also rearranged a bit
2012-06-13 22:51:37 -07:00
Guangcong Luo
cbde94b6a6 Let Tools install itself and scripts into Battles 2012-06-13 22:25:26 -07:00
Bill Meltsner
26669add8a Don't swap out rejected abilities if the alternative is also useless. 2012-06-12 22:18:02 -05:00
Bill Meltsner
9bbb0b8d56 Convert battles to use the new, cartridge-simulating RNG.
Non-battle randomness is still based off of Math.random().
2012-06-12 03:47:14 -05:00
Guangcong Luo
7009b3a4bb Revert bmelts's hasty porting of Id etc to Sugar.js extensions
- The reverted utility functions, toId/toUserid/sanitize/clampIntRange, were designed to handle unsanitized data gracefully
2012-06-08 15:44:49 -07:00
Guangcong Luo
e73c587e7d Move a bunch of files into data/
also take this opportunity to rename movedex.js -> moves.js
2012-06-08 14:25:45 -07:00