Commit Graph

91 Commits

Author SHA1 Message Date
Cody Thompson
8846475f46 !== not != for security 2012-05-27 21:05:12 -04:00
Cody Thompson
4bb2ff508e Fixed up previous commit to be less invasive
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
2012-05-27 19:09:02 -04:00
Cody Thompson
93b5e537bd Curse (Not Ghost) now works with no enemy out
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.
2012-05-27 11:58:44 -04: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
5310ff23c4 Correction to last commit: healing moves (e.g. Recover, Heal Pulse) round half up (< 0.5 down, >= 0.5 up). 2012-05-23 15:38:15 -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
Bill Meltsner
39570b6224 Fix the overwhelming Arceus rate in randbats. 2012-05-21 15:41:50 -05:00
Bill Meltsner
f59053499e Prevent special PotD movesets from being used unless the Pokemon is actually the PotD.
Delibird is no longer completely useless in randbats.
2012-05-21 10:44:20 -05:00
Guangcong Luo
d351ce2f91 Fix the CAP pokemon occurrence rate in randbat 2012-05-17 01:43:58 -07: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
9a93ba04e3 Remove Limbo from the source, and revert back to using Unreleased/Illegal. 2012-05-16 00:09:49 -04:00
Bill Meltsner
fae9ce3f93 Guard against generating random Pokemon with multiple Hidden Powers. 2012-05-15 19:48:45 -04:00
Bill Meltsner
1a22ebe146 Change "Unreleased" to "Limbo" for level scaling. 2012-05-15 18:34:46 -04:00
Guangcong Luo
4401ba79df Make sure correct item is used for Arceus formes in randbat 2012-05-15 17:19:44 -04:00
Guangcong Luo
66d65de02e Update formats-data format
- viablemoves => viableMoves
- add requiredItem
- simplify eventPokemon list
2012-05-15 16:30:45 -04:00
Guangcong Luo
fedc12d35f Consolidate formats data in formats-data.js 2012-05-15 16:07:35 -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
Guangcong Luo
10df844fd8 New Baton Pass implementation:
- now works properly when called by Copycat, Metronome, etc
2012-05-07 22:35:29 -04:00
Bill Meltsner
713684818f Add a check for Unburden to the random Pokemon generator.
Unburden Pokemon, if they reach that point in the item selector, get a random Gem of the type of one of their damaging moves.
2012-05-07 20:02:30 -04:00
Bill Meltsner
3511ebe448 Remove Rotom-Fan's custom level scaling.
The maximum level of any useful Pokemon in randbats is now 90, so Rotom-Fan's should be as well.
2012-05-07 20:01:27 -04:00
Bill Meltsner
3456cae948 Add BL3 level scale to randbats.
Thanks, Jynx.
2012-05-07 20:00:11 -04:00
Bill Meltsner
e01ac393bc Beat Up is implemented now, and so can be safely selected as a viable move in randbats.
Turns out the only randbat user of Beat Up is Houndoom, so, yay?
2012-05-07 19:58:49 -04:00
Bill Meltsner
1f05dcf09a Give random Pokemon the requisite IVs for their Hidden Power if they have one.
Fixes an issue where a Hidden Power forced by another move (e.g. Encore) would be Dark type instead of the type it was supposed to be.

Really, though, this is just a stopgap until we fix Hidden Powers properly.
2012-04-23 00:19:40 -04:00
Bill Meltsner
29a36a29c8 Actually add IVs to random Pokemon sets. 2012-04-23 00:19:39 -04:00
小太
f03d2f516f Proper four spaces -> single tab 2012-04-16 14:22:08 +10:00
小太
33162d2501 Revert "Four spaces -> Single tab"
This reverts commit 8f8d387f56.
2012-04-16 14:09:07 +10:00
小太
aee9a0b41a Remove a bit of whitespace from the previous commit 2012-04-16 13:39:54 +10:00
小太
f9a9d5543b Fix a few bad replaces 2012-04-16 13:37:47 +10:00
小太
8f8d387f56 Four spaces -> Single tab 2012-04-16 12:55:40 +10:00
小太
dfca43114d Move braces to the same line as their control statements 2012-04-16 12:54:03 +10:00
小太
64d876f1ca Begone, trailing whitespace!
Also converted all line endings to UNIX format
2012-04-16 12:03:15 +10:00
Bill Meltsner
d188eb4dca Update Giratina-O to Giratina-Origin in the random team generator.
Now you can't get Giratina-O with Leftovers in random battles.
2012-04-12 14:45:41 -04:00
Guangcong Luo
3afbdd0660 Shinies can be generated in randbat:
- Probability is currently 1/1024: bit better than BW Masuda Method, but still rare enough to be special, and not as rare as wild pokemon
2012-04-11 21:47:08 -04:00
Bill Meltsner
ea16967179 Implement Odor Sleuth and Miracle Eye (and fix Foresight). 2012-04-11 18:32:16 -04:00
Guangcong Luo
807cb08b3a PotD works correctly again 2012-04-08 22:35:25 -04:00
Bill Meltsner
98022d5663 Fix some ID/name issues in the random team generator. 2012-04-07 11:28:31 -04:00
Guangcong Luo
8cf645bbdc I think this is all of the fixes for the randbat set generator 2012-04-06 01:48:06 -04:00
Guangcong Luo
5bdf0520d3 Make sure move misses are calculated correctly 2012-04-05 22:09:09 -04:00
Guangcong Luo
0126bb2820 Fix fail messages for status moves 2012-04-05 21:59:08 -04:00
Guangcong Luo
b2be50c472 Some fixes for the randbat set generator 2012-04-05 02:02:07 -04:00
Guangcong Luo
c9381b18e1 Really make sure Hidden Power conveys the correct move name 2012-04-05 02:02:07 -04:00
Guangcong Luo
50edbf076c Make sure the Hidden Power type is hidden 2012-04-04 18:17:05 -04:00
Bill Meltsner
2e82c7e742 Fix Return and Frustration. 2012-03-30 22:00:20 -05:00
Guangcong Luo
468c457177 Rely on toString more, for nicer add() calls 2012-03-30 11:03:27 -04:00
Bill Meltsner
b7f0f88d9b Upgrade several more move-related messages 2012-03-29 21:58:17 -05:00
Guangcong Luo
b5cba2933b Implement the healing message on heal moves 2012-03-29 17:49:45 -04:00
Bill Meltsner
391ed6efbd Modify selfB.add to generate the proper log message format from the passed arguments. 2012-03-29 04:04:48 -05:00
Guangcong Luo
8e54290457 New toId function to match new IDs 2012-03-29 03:07:16 -04:00