Commit Graph

24 Commits

Author SHA1 Message Date
Bill Meltsner
ff985c96fd Make sure to recalculate the target after both ModifyMove events. 2012-08-19 16:58:14 -05:00
Guangcong Luo
a0f10fe811 Two-turn move bugs: pretty much all fixed 2012-08-12 16:31:06 -07:00
Guangcong Luo
01add9ab91 Fix crash in CC with no learnset 2012-08-08 15:14:14 -07:00
Bill Meltsner
643c1c60bd Add Toxic Boost check to the random team algorithm. 2012-07-28 16:47:08 -05:00
Bill Meltsner
e32e4d0660 Fix two-turn move immunities persisting beyond the preparation turn. 2012-07-19 17:34:01 -05:00
Bill Meltsner
ba4148cfc7 Fix two-turn moves (mostly).
Two-turn moves are now controlled by a volatile, twoturnmove, which determines whether a Pokemon executes the charge turn or the move turn of a two-turn move. This handles mechanics like Truant Pokemon being unable to use two-turn moves, as the execution turn is their truancy turn. It also handles various edge cases involving moves that call other moves (e.g. Metronome) and Encore.

These changes add a new event, onChargeMove, in which one can return false to "skip" the charging turn and execute the move in full immediately. For example, Solarbeam returns false in onChargeMove if the weather is sunny, and Power Herb returns false if the Pokemon uses its item successfully. (Actually, those are the only two examples at present.)

This implementation is complete except for one issue, an inversion of a previous problem: whereas before, moves like Assist calling two-turn moves would execute them immediately, now, only the charge turn will be executed, and the Pokemon will not be locked into the move. This is due to be fixed soon.
2012-07-18 21:27:43 -05:00
Guangcong Luo
2804901d16 Make sure to only allow valid teams 2012-07-15 21:43:18 -07:00
Marty-D
17a6cb4ba8 Multi-hit moves end if the user faints during use. 2012-07-14 13:03:34 -03:00
Bill Meltsner
563433bd8f Also don't execute an accuracy check if there's no target. 2012-07-13 10:07:23 -05:00
Bill Meltsner
dd8f7641bf Only execute an accuracy check if one is actually necessary. 2012-07-13 09:41:57 -05:00
Bill Meltsner
2e75e80bc0 Enable happiness when creating a Pokemon, and actually derive Frustration/Return's base power from it. 2012-07-10 18:16:13 -05:00
Antar1011
023183a133 Took out debug line 2012-07-10 09:58:49 -04:00
Antar1011
0d5db9483a Challenge Cup 2012-07-10 09:47:35 -04:00
Guangcong Luo
e1eddbd77f Pass the team around very carefully
- teams were passed around a lot more haphazardly before
- a race condition may have caused the team issue in LC earlier
- teams are now passed very carefully from search to battle start
2012-07-08 15:28:17 -04:00
Bill Meltsner
6f9469c898 Fix NFE level scaling in randbats. 2012-07-08 12:23:47 -05:00
Guangcong Luo
c571bf94b3 Updated random battle level scale 2012-07-07 13:20:11 -04:00
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