Commit Graph

23714 Commits

Author SHA1 Message Date
Marty-D
4ae61cfbf6 Slowpoke can't learn Ice Punch. 2013-03-12 20:32:08 -04:00
Marty-D
24994745cc Fix Grip Claw. 2013-03-12 18:01:49 -04:00
Cathy J. Fitzpatrick
7609ec2871 Remove User.prototype.token 2013-03-10 23:50:38 -06:00
Cathy J. Fitzpatrick
54ecef6591 Connection objects don't need an id 2013-03-10 13:56:19 -06:00
Guangcong Luo
63b40395d6 Merge pull request #183 from Joimer/patch-9
Doubles: Fix bug of resist berries working on Sub
2013-03-10 12:20:39 -07:00
Cathy J. Fitzpatrick
321236215f Fix presumably accidental global youUser in app.js 2013-03-10 12:25:55 -06:00
Joim
a2deb423ce Doubles: Fix bug of resist berries working on Sub
Damage halving Berries were being used on Substitute being hit.
This was not correct, so if the user has a Substitue volatile 
the berry will not be consumed.
2013-03-10 18:24:06 +01:00
Cathy J. Fitzpatrick
c94fb26f77 Implement pruning of User objects 2013-03-10 06:04:02 -06:00
Cathy J. Fitzpatrick
27f6b17f6f Merge pull request #182 from Joimer/patch-3
Gen I: Rest fix. One turn less
2013-03-10 04:34:45 -07:00
Joim
70b4521154 Gen I: Rest fix. One turn less
In gen 1, Rest just lasts two turns asleep, the turn of cast, 
and the next one, as in the next turn it will be awake at 
the end of the turn.
2013-03-10 12:30:39 +01:00
Cathy J. Fitzpatrick
9275df13a7 Fix Connection memory leak
Analysis of a heap dump from the live main server disclosed that over 20,000
`Connection` objects were present in the heap. A `Connection` object should
only exist for a current connection to the server, so this indicated a
rather large memory leak.

The problem turned out to be that all `Connection` objects are retained in
a global `connections` array in users.js and never deleted from that arary,
and hence, are never garbage collected, even after no `User` object is using
the connection. Each `Connection` object was also retaining a
`SockJSConnection` for additional memory leakage.

In the heap snapshot, `Connection` objects were using ~11% of the server's
memory, and this was on a server that had been running for only 9 hours.
After running for days, the `Connection` objects were probably taking up a
very large ratio of the server's memory.
2013-03-10 04:34:08 -06:00
Marty-D
674e3174ab Gen I: Less confusing accuracy checking.
- Also, removal of many useless sections in moves.
2013-03-09 22:25:48 -05:00
Marty-D
4e99705b89 Gen I: More correct accuracy checking.
- Also several other move changes to prepare for additional fixes.
2013-03-09 15:53:45 -05:00
The Immortal
5a60ea4ce1 Randbat script changes
- Prevent Cotton Guard with Reflect
- Prevent Light Screen with Calm Mind
- Prevent Choice Scarf with Status moves
2013-03-10 00:17:06 +04:00
Guangcong Luo
955b890338 Merge pull request #181 from Joimer/patch-2
Fix explosion, tidy up scripts.js
2013-03-09 05:24:10 -08:00
Joim
9ffddb07d4 Fix explosion, tidy up scripts.js
Explosion should only not faint the user in case a Substitue 
fainted. If there's a Substitute but the target is Ghost-
type, the user will faint.
Attack category is dealt with in moves.js, no need to hardcode 
it in the getDamage function.
2013-03-09 10:01:47 +01:00
Guangcong Luo
47f5bef63b Merge pull request #180 from Joimer/patch-2
Fix Gen 1 bug, Sub being attacked on first turn
2013-03-08 12:20:49 -08:00
Joim
6234022971 Fix Gen 1 bug, Sub being attacked on first turn
Fix Substitute being attacked on the first turn, lastAttackedBy 
object of BattlePokemon was not set yet and crashed.
2013-03-08 21:19:20 +01:00
Guangcong Luo
c9ba79e408 Fix Pursuit bug
Previously, a failed Pursuit on switch would allow Pursuit to be tried
again at regular priority
2013-03-08 09:58:54 -08:00
Guangcong Luo
512fede377 Standardize README location for mods. 2013-03-08 09:12:38 -08:00
Guangcong Luo
57a6eb768c Add mods/gen1/formats.js 2013-03-08 09:01:43 -08:00
Guangcong Luo
9bea44a939 Fix crash in gen 1
(It wasn't updated for the stats refactor.)
2013-03-08 09:01:16 -08:00
Guangcong Luo
738804c1f9 Refactor gen 1
This is simple stuff to bring it in line with PS's coding style.

Mod-specific rules are getting moved to mods/gen1/formats.js and
formats are condensed into one Custom Game format.
2013-03-08 08:59:17 -08:00
Guangcong Luo
1a75beb806 Damage category refactor for gen 3
Damage categories are now read using .getCategory, which gen 3 overrides.

move.category can still be read directly to check if something's a status
move, but it should never be used for reading damage categories.

This also fixes a crash in gen 3 and makes it playable again.
2013-03-08 08:36:14 -08:00
Guangcong Luo
fe5ac1e2e4 Merge pull request #178 from Joimer/patch-6
Add Generation 1
2013-03-08 08:13:13 -08:00
Guangcong Luo
9e87191ce3 Fix Beat Up crash 2013-03-08 07:10:23 -08:00
Joimer
3ddc81cfbc Important bug fix: Poison weak to Bug 2013-03-08 13:06:12 +01:00
Joimer
f720dce555 Omastar learns Seismic Toss in gen 1 by TM. 2013-03-08 10:46:22 +01:00
Joimer
6795f733d1 Gyarados learns Blizzard from TM in Gen 1. 2013-03-08 10:40:03 +01:00
Guangcong Luo
e78ac6a52a Roost fix 2013-03-07 18:51:31 -08:00
Cathy J. Fitzpatrick
2318a9bd5d Clear old lobby chat with splice rather than slice 2013-03-07 19:07:04 -07:00
The Immortal
334a0048ac Fix Garchomp event and add Meloetta event 2013-03-08 00:19:35 +04:00
Guangcong Luo
bc3674c3d9 Change some aliases
!pokedex and !dex are now aliases of !data rather than !analysis
2013-03-07 10:37:20 -08:00
Guangcong Luo
f301668ed2 Cartridge-accurate implementation of Power Trick 2013-03-07 10:32:42 -08:00
Guangcong Luo
1353ba9aee Merge pull request #179 from Joimer/patch-7
Add item, move, ability support to /dex command
2013-03-07 10:31:42 -08:00
Joim
8de3ed5550 Add item, move, ability support to /dex command
Add item, move, ability support to /dex command so it links their 
Smogon page in the correspondent generation.
2013-03-07 19:16:27 +01:00
Guangcong Luo
e8ece6546c Transform copies current type
(Previously, it would copy base type.)
2013-03-07 07:43:41 -08:00
Guangcong Luo
44fcf8b8cc Fix a crash in Power Trick 2013-03-07 05:16:05 -08:00
Joimer
8433e55cfe Change in gen 1 readme 2013-03-07 11:20:54 +01:00
Joimer
1b3fb89266 Fix sub counter damage, also max damage is greater than sub hp 2013-03-06 23:45:26 +01:00
Joimer
e700169f06 Substitute breaking stops multihit moves. 2013-03-06 21:51:30 +01:00
Joimer
68745d531f Skull Bash locks the user and does not increase defense. 2013-03-06 20:11:51 +01:00
Guangcong Luo
a50c5591b2 Support userids in consoleips permission 2013-03-06 11:08:14 -08:00
Guangcong Luo
2d3f6367d1 Fix forme change bug
pokemon.formeChange now returns true on success, so forme changes are now
properly reported.
2013-03-06 10:39:01 -08:00
Guangcong Luo
4d93db5906 Restore Marty's Stockpile changes
(Previous commit accidentally overrode them)
2013-03-06 10:31:55 -08:00
Guangcong Luo
8ebe9bd3f3 typechange refactor
Type changes have been moved out of ModifyPokemon, and now are only
updated manually such as at clearVolatile or during forme changes.

This fixes interaction between: Transform, forme changes,
Conversion, Conversion2, Soak, Camouflage, Reflect Type, and
Color Change.

We're now one more step closer to getting rid of the ModifyPokemon
event.

Type changes in gen3 and gen4 will need to be redone for the new
typechange system.
2013-03-06 10:21:30 -08:00
Guangcong Luo
d54f129342 Template/stats refactor:
- Stats are now cached and recalculated every clearVolatile (switchout)
- Power Trick, Power Split, Guard Split, Transform, forme changes now
  modify the cached stat value
- This eliminates the need for pokemon.baseSet, so it's been removed
- pokemon.transformInto has been split into transformInto and formeChange
- pokemon.baseBoosts have also been eliminated, boost changes are now
  calculated on-the-fly like stats themselves
- Overall, stat changes should be a lot more like the cartridge games now
- We're also one step closer to finally getting rid of the ModifyPokemon
  event
2013-03-06 09:53:34 -08:00
Joimer
2548bef89d Add all gen 1 files 2013-03-06 12:53:53 +01:00
Joimer
0441a929c8 Allow an Illegal check without abilities.
Add callback for getStat.
2013-03-06 12:53:27 +01:00
Joim
124ae6a36a Add Gen 1 formats
Add the different Gen 1 formats. OU and CC for rated, searchShow 
formats, Ubers, UU and LC for challenge only formats.
2013-03-06 12:21:47 +01:00