When a Pokemon has been released but its prevos haven't (e.g. Mamoswine and Lucario), it can't learn any moves exclusive to its prevos. For instance, DW Mamoswine can't learn Ice Shard.
We're now only keeping the last 100ish messages (100 plus any that arrived between updates). There's really no good reason to keep the entire thing in memory. This should also hopefully mitigate some of the lag issues.
Happens mostly in users.js. Now, chatting is proxied through users.js, which handles throttling.
I tried to write my code to avoid race conditions, but I'm not entirely sure if I succeeded.
This time, we're using an IIFE.
Ostensibly, it's so classes can have static private data in their own scope.
Really, it's so each class gets its own block, which also makes cold folding nice.
Use 'this' instead of passing the battle to change targets
Put back the original simulators.js to guarantee that it wasn't improperly
altered
Name the new var baseMove to match PS coding conventions
This is actually a fairly invasive change that required changing the
.useMove and .runMove methods in scripts.js and simulator.js. I had to add
the battle itself to the argument list so that I could access the
.resolveTarget method if ModifyMove changed the targeting of the move.
Ideally, we may want to consider not even resolving the target until after
ModifyMove, but this is something we (aeo, bmelts, me) should discuss.
Feel free to respond to this commit or (preferably) AIM me.
Normally, this is used for OOP-style inheritance, but we're not really interested in that; mainly, we just want things to use less memory, and since Users are never garbage collected, sharing all those functions among the prototype should help cut down on memory usage considerably once you've got a few thousand people coming in and out.
- 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)
- DW-exclusive moves are now illegal on Pokemon without their DW ability.
- Released Pokemon with no DW ability (e.g. Gastly, Koffing, Chimecho) are checked as both DW and non-DW.
Gen 1-4 PKMN with mimic glitch used to be able to use their DW abilities
with mimic glitch moves due to an incorrect check in the mimic glitch
learnset checker