Commit Graph

152 Commits

Author SHA1 Message Date
Marty-D
1e5b241c0d Gen I, II: Fix rampage moves
- The lock starts even if the move is blocked by Protect, misses, or the
target is immune
- The lock ends without causing confusion whenever the move cannot be
executed
- When the lock ends normally, confusion begins even if the user is
already confused, and there is no indication that confusion has started
- In Gen 1 the duration is 3-4 turns
2015-05-22 14:30:44 -04:00
Guangcong Luo
1824125753 Merge pull request #1887 from SolarisFox/patch-5
Style fix: indexOf() comparisons
2015-05-20 18:59:18 +00:00
Marty-D
0e2606b9b9 Fix failure message showing for self effects 2015-05-20 10:45:17 -04:00
Marty-D
c1a1ce85df Fix failure message showing for secondary effects 2015-05-19 15:49:45 -04:00
SolarisFox
29b961ff69 Style fix: indexOf() comparisons 2015-05-18 15:55:57 -07:00
Marty-D
a8daa10618 Gen II: Correct Low Kick 2015-05-14 16:07:13 -04:00
Juanma Serrano
c3a28abc61 Gen 2: Proper chain breeding learnset check
This is quite complex.
In gen 2, the egg moves pass through father and species through mother.
Therefore, we must check that:
1. Two egg moves come from the same father or are learned in another way.
2. If two egg moves come from the same father, check if the father can learn those two as well.
Also, we must keep track of the state of egg and machine moves in the learnset in order to properly reject them when the problem is found.

Related commits: 17e8515486 and 33cc1e09eb
2015-05-13 16:45:23 +02:00
Juanma Serrano
4f246f7032 Gen 2: Remove unused code
All this code was done before the main battle-engine was reworked to have exceptions for past gens.
Furthermore, due to how inheritance works, it was messing up team preview in Stadium formats.
All what was dealt with this code is now dealt with in battle-engine.js and all future gen 2 exceptions should be there.
2015-05-12 09:50:56 +02:00
Marty-D
f9bc7594ce Gen II: Stalling moves fail behind a substitute 2015-05-09 12:30:55 -04:00
Marty-D
46adbb8f45 Gen II: Correct Counter/Mirror Coat priority 2015-05-09 12:20:36 -04:00
Marty-D
b3c0f60239 Gen II: Fix critical hit ratios
- High crit moves start at stage 2 (stage 0 being normal moves)
- Focus Energy adds 1 stage
- Lucky Punch and Stick set the stage at 2 and skip the other effects
- Sky Attack is not a high crit move
- Also fix Razor Wind's accuracy
2015-05-08 12:20:51 -04:00
Marty-D
af280660bb Gen II: Fix Dig and Fly
- Fissure can hit Dig and Whirlwind can hit Fly
- Use BasePower instead of ModifyDamage for doubled power moves
- Also correct current-gen Fly to modify damage instead of base power
2015-05-07 11:09:35 -04:00
Marty-D
15caa1a323 Gen II: Sketch cannot copy certain moves
It also doesn't do anything in Link Battles.
2015-05-06 13:40:26 -04:00
Marty-D
7edad419f3 Gen II-IV: Correct moves that cannot be encored 2015-05-06 13:19:44 -04:00
Guangcong Luo
4f708b1240 Merge pull request #1849 from ascriptmaster/move-fixes
Refactor disabling moves, other miscellaneous bug fixes
2015-05-05 05:36:06 +00:00
Kevin Lau
0ec4ff912a Battle Engine Refactor: Add a DisableMove event
The intention for this event is to remove the move disabling code away
from ModifyPokemon and to an event that can be run a fewer number of
times. Since the disabledMoves index is used to gray-out moves that cannot
be used, and not for any other purpose, there is no need for the related
code to be run at the ModifyPokemon timing, instead working better as a
once per turn event.
2015-05-04 21:17:00 -07:00
Juanma Serrano
bd06448589 Gen 2: Make Rest sleep overwrite sleep origin side
Sleep Clause should not be activated if an asleep Pokémon uses Rest through Sleep Talk, as then the sleep is overriden.
2015-05-04 11:47:17 +02:00
Marty-D
c53d022e4b Fix OHKO moves
- Fix Gen 1/Stadium's accuracy and immunity order
- Fix OHKO moves ignoring Phantom Force
- Add OHKO messages
2015-04-30 13:06:45 -04:00
Juanma Serrano
6167fc3e52 Gen 2: Remove illegal moves from learnsets
Some moves while possible in code are impossible to obtain in-game legitly:
Bulbasaur - Charm
Oddish - Charm
Staryu - Aurora Beam, Barrier, Supersonic
Snorlax - Charm
2015-04-16 12:37:23 +02:00
Kevin Lau
b6808d4476 Fix ignoreImmunity crashes in earlier gens
Unlike battle-engine.js, old gens did not check if move.ignoreImmunity was
undefined/false in their getDamage functions, causing crashes when numbers
were passed in to the function.
2015-04-14 15:22:06 -07:00
Guangcong Luo
54947b665f Merge pull request #1728 from ascriptmaster/move-fixes
Move refactor: moves/items that ignore immunity/effectiveness
2015-04-14 17:05:22 +00:00
Guernouille
b00e6d5f70 Gen 2 RandBats: Moveset fixes
Add an attacking move to Tangela, remove Sleep Talk.
Add Earthquake to Kangaskhan.
Give standard moves to Donphan.
2015-04-14 13:02:10 +02:00
Guangcong Luo
c23acb7005 Merge pull request #1773 from ascriptmaster/randoms
Gen 2 Random Battle: Fix Move Rejection Phase
2015-04-12 21:34:51 +00:00
Kevin Lau
b894bbfec9 Gen 2 Random Battle: Fix Move Rejection Phase
hasMove was not tracking moves properly, instead only tracking new moves
added in the object instead of its entire moveset. Also, there was a
line of code that caused all moves to be flagged as rejected.
2015-04-12 13:59:21 -07:00
Ivo Julca
e6332ff424 Properly do b0e7711 2015-04-11 20:19:52 -05:00
Juanma Serrano
7181ded437 Gen 2 RandBat: Update set maker slightly 2015-04-10 13:21:41 +02:00
Juanma Serrano
08aefc3535 Gen 2 RandBat: Fix issue with HP and 3-move movesets 2015-04-10 13:16:10 +02:00
unfixable ꒰*⑅˃̶͈ ৺˂̶͈⑅꒱੭ु⁾⁾·°
e961dd33ad Make Explosion + Rapid Spin illegal on Cloyster
Unable to be on the same set. Gen 1 TM + Gen 2 Egg move.
2015-04-08 20:53:45 -07:00
Kevin Lau
2e56120ad9 Move refactor: affectedByImmunities -> ignoreImmunity
While move.affectedByImmunities was always a Boolean value to denote if
the move was affected by immunities, move.ignoreImmunity can be a Boolean
value if it ignores or is affected by all type immunities, but also can
act as an object such that !!move.ignoreImmunity[type] means it ignores
immunities of that type.
2015-04-08 00:17:12 -07:00
Marty-D
815f9d8689 Remove thawsUser move property 2015-04-03 15:39:46 -04:00
Marty-D
3742d84f34 Fix thaw mechanics in all gens
- Gen 5-6: Thaw check is skipped when using a self-thaw move
- Gen 3-4: Thaw check happens before a move is used
- Gen 2: Self-thawing does not happen if the move misses
2015-04-03 09:42:08 -04:00
Guernouille
347e8692d7 Nidoran-m fix
Nidoran-m doesn't learn Earthquake / Fire Blast / Ice Beam. Not sure which moves to use instead.
2015-04-01 11:26:46 +02:00
Juanma Serrano
b718c8605d Update Gen 2 RandBat generator
Make several changes to team and set maker.
Fix bad choice of moves.
2015-03-31 17:49:21 +02:00
Juanma Serrano
1dd546b078 Gen 2 RandBats: Fix typos 2015-03-31 16:28:42 +02:00
Juanma Serrano
05d6cdc448 Gen 2 RandBats: Use sampleNoReplace to get moves 2015-03-31 14:48:59 +02:00
Juanma Serrano
95c602abcb Add missing comma from last commit 2015-03-31 14:03:14 +02:00
Juanma Serrano
b0276dd6e3 Gen 2 RandBats: Fix typo in Moonlight
Note to self: spell check set contributions
2015-03-31 13:55:09 +02:00
Juanma Serrano
2643fe486c Gen 2 RandBats: Fix Kingler's hidden power 2015-03-31 13:47:43 +02:00
Juanma Serrano
11f328b1fe Gen 2 RandBats: Check for sets with two Hidden Powers 2015-03-31 13:46:12 +02:00
Juanma Serrano
58d1314762 Gen 2 RandBats: Fix Thunder Wave in Slowbro
I can't believe this went unnoticed for so long
2015-03-31 13:14:14 +02:00
Juanma Serrano
ccaf250776 Gen 2 RandBats: Improve the set maker
Move the check for HP id and add level 99 for some shitmons
2015-03-31 13:01:50 +02:00
Juanma Serrano
d03d055ef8 Gen 2: Implement Random Battles
Implement Gen 2 Random Battles as a challenge option.
This format is not going to have a ladder anytime soon.
This format is going to help ironing out Gen 2 mechanics.
The current team and set makers are pretty much basic, they are to be improved with player input over the time.
Right now it doesn't incorporate a full Gen 2 Pokémon pool and it intends to use more offensive items than Leftovers.
2015-03-31 12:51:12 +02:00
Marty-D
2051f5f117 Gen II: Remove now unnecessary Nightmare fix
- Fixed for all gens in
7ffa583b58
2015-03-26 12:00:54 -04:00
The Immortal
cca9688b2a Implement Mirror Move correctly for gens 1 and 2
Also fixed lastMove not being an id.
2015-03-25 03:27:20 +04:00
Marty-D
ed074532c6 Make sure the flags object always exists 2015-03-21 14:29:07 -04:00
Marty-D
6ebb25d142 Gen II, IV: Fix (Hi) Jump Kick crash damage
Gen 2: 1/8 potential damage, not capped; no damage if target is immune
Gen 4: damage is 1/2 target's max HP if it is immune
2015-02-24 10:06:32 -05:00
Konrad Borowski
815909eff2 Don't skip residuals after fainting in Gen2.
The original code was wrong, as all it did was skipping residuals.
Skipping moves is handled by `faintMessages`.
2015-02-21 11:37:39 +01:00
Ivo Julca
4c069668e6 Add "Cancel Mod" ruleset
- It enables the `supportCancel` battle flag.
- Add it to all formats and standard rulesets.
2015-01-29 21:53:10 -05:00
Juanma Serrano
8062781ce0 Gen 2: Fix toxic to poison on switch in 2015-01-27 17:20:03 +01:00
Marty-D
5de159bee3 Past gens: Fix recovery moves' rounding
- Prior to Gen 5, recovery moves rounded down instead of half up
- Gen 2 weather-dependent recovery moves restore all HP in sun
2015-01-24 16:40:31 -05:00