Commit Graph

175 Commits

Author SHA1 Message Date
Guangcong Luo
66b86f9678 Don't mark rooms as active if they're not 2012-08-01 23:23:18 -07:00
Guangcong Luo
60ca007255 Many stability improvements 2012-08-01 23:08:55 -07:00
Guangcong Luo
97a3977106 Fix team preview not working 2012-08-01 18:19:57 -07:00
Guangcong Luo
3714979815 Many fixes to multi-process system:
- crashes mostly gone
- teams work
- debug console available for battle process (use >>>)
2012-08-01 16:29:49 -07:00
Guangcong Luo
c47eb6b160 Battle process properly deallocates itself 2012-08-01 13:56:48 -07:00
Guangcong Luo
4831e68a8c Multi-process battles!
Battles now occur in a separate process.
Hopefully, this results in a substantial increase in network stability.
WARNING: Battle crashes are now practically unrecoverable.
2012-08-01 13:48:58 -07:00
Guangcong Luo
31e642c5a2 Rename simulator.js to battles.js 2012-07-31 19:48:09 -07:00
Bill Meltsner
d92c7e9ffb Update some out of date Baton Pass-related code.
Fixes Pursuit interacting incorrectly with Baton Pass (that is, at all).

I think this code breaks Baton Pass + Regenerator/Natural Cure, though.
2012-07-17 01:34:24 -05:00
Guangcong Luo
59846cc0ba Fewer debug messages:
Pokemon and Side allocation messages hidden
2012-07-16 22:52:03 -07:00
Bill Meltsner
29d4511c45 Hack in Foul Play.
This implementation sucks and should be replaced with a proper one as soon as the new damage formula is implemented.
2012-07-16 00:23:47 -05:00
TheImmortal
71a386447f Correct immunity message 2012-07-15 18:38:15 +04:00
Guangcong Luo
99aba198c9 Fix many switch-order bugs:
- In double-switches, abilities now activate before the second switch
- When starting or double-faint, abilities activate after all switches
  in speed order
- Double-switches now happen in speed order of the switch-outs
2012-07-11 18:35:43 -04:00
Guangcong Luo
d753365d8e Make sure Trace can't make the Start event happen twice
(This fixes the double-Intimidate when Traced bug)
2012-07-11 17:38:58 -04: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
Guangcong Luo
e2d0547dae Cut down on the amount of information we log 2012-07-09 13:44:12 -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
Guangcong Luo
125ede327f Gen next changes:
- several bugfixes and new features
- see GEN-NEXT.md for details
2012-07-06 16:50:20 -04:00
Guangcong Luo
ec48d36721 Gen NEXT changes:
- Too many to list. See GEN-NEXT.md for details
2012-07-06 03:31:19 -04:00
Guangcong Luo
d04d502f96 Fix a crash when deducting HP from an unspecified source 2012-07-06 02:22:05 -04:00
Guangcong Luo
f8170aa348 Make sure drain/recoil works correctly against Substitute 2012-07-05 21:01:13 -04:00
Bill Meltsner
bb50802365 Fix Intimidate's message.
We already have the "X intimidates Y!" message, that provides enough context for a straight stat drop - plus, that's how the game actually does it (albeit with an ability activation animation instead of an explicit message).
2012-07-03 05:13:36 -05:00
Bill Meltsner
39c4cd7988 Fix illusion being set to null. 2012-07-03 01:21:49 -05:00
Bill Meltsner
bdf4acda55 Fix Trace, for real this time. Honest. 2012-07-02 20:07:00 -05:00
Bill Meltsner
a133ff8037 Rewrite Illusion to run on its own event.
Fixes issues with timing and switching to an Illusion Pokemon when that Pokemon is last in your team.
2012-07-02 20:06:57 -05:00
Guangcong Luo
a23e4ec763 Limit names to 20 characters 2012-07-02 15:15:04 -04:00
Guangcong Luo
5cfa9fdd03 Report real HP values for pokemon on your own side 2012-07-02 01:36:34 -04:00
Guangcong Luo
bfe864ca0f Fix crash when getTarget is called before resolveTarget 2012-06-29 20:43:38 -04:00
Guangcong Luo
4001463370 Only show debug messages in debug mode 2012-06-23 00:59:42 -07:00
Guangcong Luo
b12702aa23 Fix for the U-turn fix... 2012-06-22 16:15:23 -07:00
Guangcong Luo
b9071e6ded Fix the U-turn race condition bug 2012-06-22 14:35:24 -07:00
Guangcong Luo
96ace339c8 Make sure the correct mod is loaded in a battle 2012-06-16 22:49:19 -07:00
Guangcong Luo
cb4aae18a3 formats.js can now list alternate gens 2012-06-16 15:50:34 -07:00
Bill Meltsner
acc8ea5c3c Update Pokemon *before* they're switched in.
This fixes Illusion.
2012-06-14 23:17:59 -05:00
Bill Meltsner
a5a658ab18 Update Pokemon as they're switched in.
Fixes Flying-types not being hit by (t)spikes under Gravity.
2012-06-14 19:17:17 -05:00
Guangcong Luo
cbde94b6a6 Let Tools install itself and scripts into Battles 2012-06-13 22:25:26 -07: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
Bill Meltsner
bf779986bc Add Battle.random, an implementation of the cartridge PRNG. 2012-06-11 20:42:10 -05:00
Bill Meltsner
95a1f6d49d Clear volatiles on switch out instead of switch in.
This has the same practical effect, but is slightly more intuitive and keeps the client better informed. For example, if a Pokemon used Skill Swap and then switched out, previously it would still display the swapped skill on mouseover; now, it displays the original skill, as it should.
2012-06-10 07:07:26 -05:00
Bill Meltsner
f4677c8535 Keep pokemon.moves in sync with pokemon.moveset. 2012-06-10 07:04:02 -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
Bill Meltsner
eae2317b79 Confusion should not be able to crit. 2012-05-28 14:49:09 -05:00
Bill Meltsner
c62d923f73 Fix a bug with the new prototype functions.
There will probably be more of these.
2012-05-24 13:13:27 -05:00
Bill Meltsner
4f729aae7f Refactor most utility functions (toId, clampIntRange, etc.) into Sugar extensions of the relevant objects. 2012-05-24 01:41:01 -05:00
Bill Meltsner
47401b9e2b Streamline and simplify the boosting function. 2012-05-23 16:15:04 -05:00
Bill Meltsner
11e8cd7602 Fix healing to be closer to the (highly idiosyncratic) games:
- Most healing is rounded down, except moves that heal directly (e.g. Recover and Heal Pulse) and draining moves, except Leech Seed
- Big Root rounds the boosted result half down (i.e. values <= 0.5 are rounded down, values > 0.5 are rounded up)
2012-05-23 14:51:38 -05:00
Guangcong Luo
3c444d3030 Use Sugar implementations of clone and shuffle, instead of rolling our own 2012-05-16 21:56:30 -07:00
Bill Meltsner
9301e2c6aa Replace custom objectKeys function with the native Object.keys function. 2012-05-16 04:56:41 -04:00
Bill Meltsner
3d74e7034f Add a new event, TrySecondaryHit.
This event behaves much like TryHit, except it's only called on the secondary effect(s) of a move, and only when it affects the target, not the user.

It is also suppressed by Mold Breaker.
2012-05-14 18:11:07 -04:00
Guangcong Luo
5f31554ef9 Fix Pressure 2012-05-12 18:12:20 -04:00
Cody Thompson
5edd404cff Fixed bug in damage calculation
- Bug removed randomness from damage dealt
2012-05-09 13:41:41 -04:00