Commit Graph

1137 Commits

Author SHA1 Message Date
The Immortal
618456f909 Random Battle: Improvements 2017-04-01 16:06:14 +04:00
MacChaeger
00d995e58d Hackmons Cup: EV limit is only in gen 6 (#3362) 2017-03-15 22:48:51 -05:00
Marty-D
368e7b5aa2 End Illusion before preparing a Z-Move 2017-03-14 10:01:48 -04:00
Guangcong Luo
fc16f4fe4f Hacked Z-moves can't be Z-boosted 2017-02-27 01:14:35 -04:00
Guangcong Luo
0bf08c2ad3 Fix calling Z-move names
e.g. Z-Sleep Talk would previously call Z-Taunt, when it should be
calling Taunt.

This was only ever a text error; it never used Z-Taunt's Z-effect.
2017-02-27 01:06:54 -04:00
MacChaeger
19b0b48ac0 Random Battle: Improve level balancing (#3293) 2017-02-26 04:37:38 +04:00
urkerab
1d4ac35d37 Simplify the way the factory tier is chosen (#3286) 2017-02-25 06:16:55 -06:00
Ivo Julca
55641c2635 Fix regressions in random team generation and improve comments
The regressions affected information handling
- Seeds used for random teams were no longer being logged.
- The seed used for generating p2's team was also used for the battle itself.
2017-02-24 20:18:59 -05:00
HoeenHero
1551ec0e98 Battle Factory: Fix issue with sides having different tiered teams (#3285) 2017-02-24 15:28:43 -06:00
Guangcong Luo
6306b5979f Fix infinite looping Dancer 2017-02-24 06:54:13 -06:00
Guangcong Luo
bb7b168355 Fix crash in PRNG 2017-02-24 05:46:51 -05:00
Guangcong Luo
8ee23475e4 Fix Dancer + Petal Dance
Dancer Petal Dance shouldn't lock. This is a horrible hack but it fixes
the problem. A real fix would involve refactoring basically all locking
moves. Which I guess I should do one day...

Fixes #2974
2017-02-24 03:25:00 -06:00
Guangcong Luo
9200062819 Improve Dancer implementation
This doesn't fix the biggest issue with Dancer (Petal Dance locking),
but it does fix every other Dancer issue, by moving it from useMove
to runMove.

This also adds improved comments on runMove and useMove.
2017-02-24 03:17:37 -06:00
Kevin Lau
05f34da175 Random Battle: Reject Sheer Force Conkeldurr (#3277)
Sheer Force only boosting one of its moves is rather mediocre compared to
Iron Fist boosting most of its moves, or Guts for even more raw power.
2017-02-23 02:04:28 -06:00
Dan Pantry
56ba782966 refactor PRNG to its own class
This removes the 'deterministic test' tools by preventing action at a
distance (namely, preventing the modification of the `init` method in
`Battle` during tests). This action at a distance is incredibly
confusing.

All this action at a distance did was discard any parameters that were
passed to `Battle` that weren't the first three (which was probably a
mistake by the original author) and also hard code `this.seed` and
`this.startingSeed` in `Battle`.

This functionality has now been moved to the `PRNG` class, so instead
users should pass a `PRNG` to `Battle` as the 5th constructor argument.
Users can also pass one as the third argument to `common.createBattle`
or use `common.createBattleWithPRNG` with the PRNG as the first
argument.

The PRNG is just an encapsulation of the pseudo-random algorithm in a
class. It is stateful, so make sure to take a `clone()` of the PRNG if
you want to re-use it.
2017-02-22 20:44:20 -05:00
Guangcong Luo
0c98319d2b Don't add "Z-" to "Extreme Evoboost"
This uses a better rule for detecting for whether or not a move is a
status Z-move.

Closes #3268
2017-02-21 01:12:11 -06:00
Kevin Lau
b8d1f0b45e Random Doubles: Use Wishiwashi-School for calculating Wishiwashi level (#3266) 2017-02-20 02:34:32 -06:00
MacChaeger
25b0e0aae3 Challenge Cup: Fix Wishiwashi's level (#3246) 2017-02-19 01:26:51 -06:00
Guangcong Luo
825b4180cd Fix Prankster/Dark hint info leak 2017-02-10 17:10:15 -05:00
Kevin Lau
41f4727df1 Random Doubles: Implement some Doubles sets (#3219) 2017-02-07 23:56:13 +04:00
Kevin Lau
0ea4363cae Random Doubles: Fix Level Scaling for Parental Bond and Protean (#3216)
EV values are balanced now, so it's better to base it on the number of
attacks.
2017-02-06 21:50:08 +04:00
The Immortal
50074f0928 Update tiers 2017-02-06 17:28:36 +04:00
Kevin Lau
7c252d7ff1 Random Doubles: Preliminary Overhaul (#3204)
Most ability checks are up to date with Random Singles, as are some of the
item checks.
2017-02-04 11:35:21 +04:00
Marty-D
687b3ae8b7 Fix multi-hit self-drop moves 2017-02-03 19:06:22 -05:00
Marty-D
e51b5f1cce Fix multi-target self-drop moves 2017-02-01 18:11:33 -05:00
Kevin Lau
f466787851 Random Doubles: Switch to 84-all EV system like Random Singles (#3199)
EV generation is incredibly lopsided in random doubles and should be more
balanced.
2017-02-01 16:52:08 +04:00
cadaeic
45070569cd Refactor fainting from sacrificial moves (#3197) 2017-01-30 14:31:05 -05:00
Kevin Lau
1c5eb528ca Random Battle: Add possibility of Flyinium Z to Talonflame (#3194)
With the Gale Wings nerf, it appreciates being able to use one additional
super-heavy priority attack before Brave Bird takes it below Gale Wings
range.
2017-01-29 19:26:59 +04:00
Kevin Lau
8f9f7d2d1f Random Battle: Improve Sub/Reversal (#3193) 2017-01-29 15:43:13 +04:00
Kevin Lau
99283f5988 Random Battle: Update some Alolan Forme Pokemon (#3085) 2017-01-29 12:05:21 +04:00
The Immortal
ced6a88dde Pokemon Bank is released 2017-01-25 07:58:41 +04:00
urkerab
66e7789067 Fix interaction between Burn Up, Powder and Primordial Sea (#3103) 2017-01-23 20:13:45 -05:00
Kevin Lau
ab8a6ea9fb Random Battle: Improve move rejection for dual STAB issues (#3104)
Reject Hex entirely if Will-o-Wisp is not present, to prevent it on the
same set as Shadow Ball.

Reject Fire Blast with Flare Blitz.
2017-01-22 19:19:24 +08:00
ScarfWynaut
46b4666fcd Random Battle: Prevent generating teams with too many Uber Pokemon 2017-01-12 17:49:21 +04:00
The Immortal
b7cab47265 Random Battle: Prevent Psycho Cut with other Psychic-type moves 2017-01-11 06:05:01 +04:00
The Immortal
71e0250806 Random Battle updates 2017-01-09 22:17:45 +04:00
Kevin Lau
88475146d3 Random Battle: Reject Pursuit with Knock Off on non-Dark Pokemon (#3082) 2017-01-09 15:17:20 +04:00
Guangcong Luo
ef3b4965ea Fix Z-move priority interaction
Priority Z-moves exist (namely, Gale Wings Supersonic Skystrike).

Quick Guard now partially protects against priority Z-moves.

Psychic Terrain now fully protects against priority Z-moves.
2017-01-08 01:44:35 -05:00
Kevin Lau
56160b18cf Random Battle: Add possibility of Z-Conversion (#3078) 2017-01-07 00:02:23 +04:00
Guangcong Luo
58865f6039 Add hint for Dark being immune to Prankster 2017-01-06 04:28:29 -05:00
Kevin Lau
cd6ccba986 Random Battle: Reject Toxic with setup (#3075) 2017-01-05 23:49:47 +04:00
The Immortal
25299882a8 Random Battle: Set "Bank" Pokemon to UU level as well 2017-01-05 18:53:24 +04:00
The Immortal
983c40d955 Random Battle: Set "New" Pokemon to UU level
And remove unneeded levels because 75 is the default
2017-01-05 18:49:17 +04:00
Ridaz
0d364ab4be Properly animate Spectral Thief (#3072)
In case of boosts, the attacking animation would play 1st, stealing the
boosts last, instead of the other way around.
This approach was chosen since Spectral Thief is the only move that
steals boosts this way, for now
2017-01-02 22:53:13 -05:00
Kevin Lau
e7feb63f6c Random Battle: Fix Various Issues with Ubers (#3069) 2017-01-03 04:56:01 +04:00
Kevin Lau
207b966861 Random Battle: Update Tapu Guardians, Araquanid, Vanilluxe (#3052) 2016-12-31 13:23:34 +04:00
Guangcong Luo
9cc8f66ab5 Fix Taunt preventing Z-move activation 2016-12-31 02:31:09 -05:00
The Immortal
d8a29ecd4c Random Battle: Improve Primarina 2016-12-29 16:05:46 +04:00
Guangcong Luo
b931969e11 Fix Z move and target tracking issues
Encore and Disable now fail when used against Z-moves.

Encore and Disable now no longer prevent Z-moves from being used.

Instruct now repeats the selected target location.

Instruct Pursuit now repeats the switched out target location, if
activated.

This refactor also simplifies some previously unnecessarily-complicated
code.
2016-12-26 16:53:10 -05:00
Guangcong Luo
0b887560cd Fix Z-status targeting
Z-status moves weren't targeting correctly. This fixes that and also
simplifies some code.
2016-12-26 16:48:15 -05:00
The Immortal
d70d7918de Random Battle: Prevent Facade with RestTalk 2016-12-24 22:49:46 +04:00
Marty-D
c2005253fd Move Z-Power activation message 2016-12-20 09:40:27 -05:00
Marty-D
3c9d6c2687 Correct crit ratio boosting Z-Effect 2016-12-18 11:06:55 -05:00
Marty-D
5638680a50 Reorder Spectral Thief's effects 2016-12-17 10:49:49 -05:00
urkerab
c1829acf64 Z-Memento and Z-Parting Shot should tell the client about the Z-power (#3029) 2016-12-16 18:23:54 -08:00
Marty-D
e1c43d4bb4 Properly fix Emergency Exit and related effects 2016-12-15 09:57:06 -05:00
The Immortal
92a9a8b9a9 Random Battle updates 2016-12-07 19:45:52 +04:00
Guangcong Luo
04cd89ab45 Support sending target in zmove data 2016-12-07 05:20:40 -05:00
The Immortal
977d676c9a Random Battle: Reject Liquid Voice without Hyper Voice 2016-12-03 03:53:44 +04:00
Kevin Lau
682e22e406 Random Battle: Add possibility of Gluttony Linoone (#2959)
With the buffs to the healing berries that confuse if a Pokemon has a
conflicting nature, it is now possible for Linoone to use them as a
substitute for Sitrus Berry, if it has Gluttony as its ability.

In Random Battles, natures are always neutral, so the any of the berries
will serve this purpose.
2016-12-02 02:13:50 +04:00
The Immortal
232112d94f Fix Monotype Random Battle 2016-12-01 19:52:24 +04:00
The Immortal
850ab0f52e Random Doubles updates 2016-11-30 20:07:29 +04:00
The Immortal
d7434ecf97 Random Battle improvements 2016-11-29 16:17:57 +04:00
Guangcong Luo
83b9e82fc7 Support calling Z moves
Z status moves like Z-Metronome and Z-Nature Power now correctly
transform called Physical/Special moves into the corresponding
Z move.
2016-11-28 20:26:28 -06:00
The Immortal
49b4eb47aa Random Battle updates 2016-11-28 04:33:58 +04:00
Ivo Julca
7ea4eeac5b Z-Moves: Various decisions fixes
- Z-Moves are always single-target, even if based on spread moves.
- Z-Moves cannot be selected if the base move has no PP.
- Z-Moves can be selected if the base move is disabled.
2016-11-27 00:27:49 -05:00
Kevin Lau
d49ce0eb64 Random Battle: Add new Oricorio sets (#2951) 2016-11-27 02:38:09 +04:00
urkerab
7347086f6a Actually send correct -zpower minor (#2952) 2016-11-26 17:20:27 -05:00
The Immortal
ba814c5c01 Fix build error 2016-11-26 18:13:48 +04:00
The Immortal
ef946414e8 Remove Pumpkaboo-Super learnset
This is unneeded because they are just level up moves. Having this
means adding exceptions in multiple places.
2016-11-26 14:08:51 +04:00
The Immortal
6bef707583 Random Battle fixes 2016-11-26 14:07:09 +04:00
Guangcong Luo
5e413c3bef Revert "Refactor Protect/etc, fixing Z move penalty"
This reverts commit fed4fefd85.
2016-11-26 02:31:29 -05:00
Guangcong Luo
fed4fefd85 Refactor Protect/etc, fixing Z move penalty
Protect is now implemented in scripts.js:runProtect, for slightly less
duplicated code.
2016-11-25 22:20:01 -06:00
urkerab
a580d7706f Add various Z-move messages (#2947) 2016-11-25 20:24:35 -05:00
Ivo Julca
a0601bdb73 Add MoveAborted event, to be run when move execution stops on BeforeMove 2016-11-25 15:23:52 -05:00
Ivo Julca
e45d4bbdac Fix turn order to account for abilities traced by Mega Evolutions 2016-11-24 22:44:27 -05:00
Marty-D
db06476c1f Fix Prankster immunity condition 2016-11-23 18:34:38 -05:00
Marty-D
70b98abcb1 Update protection-breaking with Baneful Bunker 2016-11-22 18:06:51 -05:00
The Immortal
2869cf008d Random Battle improvements 2016-11-23 00:05:02 +04:00
Kevin Lau
41a063391b Random Battle: Give Fire-type Guts Pokemon a Toxic Orb (#2934)
Because they can't get burned.
2016-11-22 23:50:39 +04:00
The Immortal
6ef8fed674 Fix Rayquaza interaction with Z-Crystals 2016-11-21 15:37:42 +04:00
The Immortal
3c0864a3df Random Battle updates 2016-11-21 02:50:26 +04:00
Kevin Lau
34e1472eec Random Battle: Fix Arceus item generation (#2919)
Z-Crystals don't affect Judgment's type, so an Arceus with Judgment as its
STAB should receive a plate only.
2016-11-20 02:30:38 -05:00
Ivo Julca
6dc9cb16ec Randbats: Adjust rate for Silvally 2016-11-20 02:27:23 -05:00
Ivo Julca
607c217d2f CC: Normal Arceus should not hold a typed Z-Crystal 2016-11-20 02:27:04 -05:00
Ivo Julca
9e46ee727e Set zMoveUsed flag only after the Z-Move could actually be used
Fixes issue when put to sleep before moving.
2016-11-20 01:31:39 -05:00
Ivo Julca
3a5348bfc9 CC: Fix rare issue of sets with illegal items being generated
Found via stress-testing with a test/simulator/misc/random-teams.js variant.
2016-11-20 01:10:45 -05:00
Ivo Julca
0a1fa67a5a Fix generation checks in random team generators 2016-11-20 00:52:36 -05:00
Guangcong Luo
ad8ef6c090 Merge/fix CC/HC random pokemon generation
Previously, the code was duplicated and buggy.

I have suspicions this doesn't fix it completely, but it should at least
crash a lot less and give more informative crash messages.
2016-11-19 23:49:33 -05:00
urkerab
3cc3217aa4 Allow Hackmons Cup for past gens (#2913) 2016-11-20 01:22:09 +04:00
Ivo Julca
7fd8283600 Introduce requiredItems as an alternative to requiredItem
The list of acceptable items can always be retrieved from `requiredItems`.
2016-11-19 15:44:57 -05:00
Ivo Julca
00ced09ba3 Revert 4aaa3cb 2016-11-19 15:44:56 -05:00
Ivo Julca
4aaa3cb260 Move .templateRequiredItem to array everywhere 2016-11-19 15:23:42 -05:00
Guangcong Luo
4abed0add6 Fix crash in random battles 2016-11-19 14:54:33 -05:00
Guangcong Luo
b9e32f1d29 Rename restoreboost to clearnegativeboost 2016-11-19 14:48:19 -05:00
Slayer95
a3e3249a8f Spectral Thief should zero boosts despite of target abilities (#2906) 2016-11-19 14:38:54 -05:00
Marty-D
fd7a1a0a35 Fix typo 2016-11-19 13:21:02 -05:00
Marty-D
e7e133f397 Fix stat restoring Z-Effect 2016-11-19 12:56:40 -05:00
The Immortal
ca665d83e9 Fix typo 2016-11-19 15:29:36 +04:00
The Immortal
0d2ed2db11 Make randomTeam work for multiple gens 2016-11-19 15:28:20 +04:00