Commit Graph

123 Commits

Author SHA1 Message Date
Juanma Serrano
98dcac1d8b Gen 1: Fix (de)boost behaviour
The routine for burn and para drops is checked after applying boosts to the Pokémon whose turn is not, regardless of the target of the move, when a Pokémon uses a move that results in a stat change.
2015-05-26 18:12:06 +02:00
Juanma Serrano
825fc4b92e Gen 1: Fix bug with stat modifiers over +2 2015-05-26 17:58:37 +02:00
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
SolarisFox
29b961ff69 Style fix: indexOf() comparisons 2015-05-18 15:55:57 -07:00
Juanma Serrano
9e119fa279 Gen 1: Fix status and stats interaction
Stats are recalculated from 0 with a boost, status ignored.
Status drops only applied if status is successfully set.
2015-05-14 10:47:24 +02:00
Juanma Serrano
124ffd0ab0 Gen 1: Implement Rage bug properly 2015-05-13 11:05:44 +02:00
Joimer
ede8c2da7c Fix crash in Gen 1 2015-05-12 18:57:09 +02:00
Juanma Serrano
14cc0ce5fb Gen 1: Refactor stat calculation
In order to emulate Gen 1 perfectly and to let the metagame adapt to the correct mechanics, stat calculation has been refactored.
Burn and Paralyse drop are applied whenever a Pokémon switches in with the status.
Also whenever a Pokémon gets a stat boost, if the Pokémon whose turn is not has the status.
Stat boosts recalculate that stat, minus burn and para drops (that's why Agility ignores para drop and Rest keeps drops).
Additionally, Reflect and Light Screen are only calculated in damage calculation.

Part of this code has been added to battle-engine.js with a gen === 1 conditional to avoid a ton of code repetition that would have been necessary otherwise.
Keep in mind that .modifiedStats for a BattlePokemon and the modifyStat function must only be available for gen 1 games.
2015-05-12 17:58:00 +02:00
Konrad Borowski
2e8e0e0620 Disallow Fissure with Horn Drill in Gen1 randbats. 2015-05-10 18:25:26 +02:00
Marty-D
dca8a8c81a Gen I: Fix explosions on subs with immunity 2015-05-05 16:56:26 -04:00
Juanma Serrano
125144e07e Gen 1: Fix self-destructing moves on immunity
Forgot to mention this change for c53d022e4b
2015-05-05 10:48:56 +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
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
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
Juanma Serrano
9c0288a2f3 Gen 1: Fix Counter interaction with residuals
Residual damages do not clear previous direct damage, so Counter still works as intended.
2015-04-06 13:52:11 +02:00
The Immortal
1c9fb89988 Remove isTwoTurnMove property and use charge flag 2015-04-05 03:27:32 +04:00
Juanma Serrano
e4cef0739d Gen 1 CC: Avoid having gen 2 moves 2015-03-31 16:07:31 +02:00
Juanma Serrano
a9343c3839 Implement challenge option for Gen 1 Challenge Cup
Following the RoA project to have all formats for past gens and the desire of gen 1 players to have available a truly random format.
2015-03-31 11:38:14 +02: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
Juanma Serrano
573673ef35 Gen 1: Pass mocha tests
Accuracy, if true, should not be increased.
2015-03-18 17:35:16 +01:00
Juanma Serrano
73dd9eeecf Gen 1: Self targetting moves do not have 1/256 miss chance
Post: http://www.smogon.com/forums/threads/past-gens-research-thread.3506992/#post-5878612

See:
jp z,asm_3d74b ; for moves with 0 BP, skip any further damage calculation and, for now, skip MoveHitTest
; for these moves, accuracy tests will only occur if they are called as part of the effect itself
2015-03-18 17:12:00 +01:00
Juanma Serrano
cde53e7fea Gen 1: Reorder and document code
Put the functions in the order they are found in scripts.js and battle-engine.js.
Use main addQueue and runDecision options, minor past gens change are dealt with in there.
Add comments on what everything does and relevant Gen 1 mechanics for ease of understanding.
2015-03-17 16:41:00 +01:00
Juanma Serrano
53a2083471 Gen 1 RandBats: Improve move selection
Make better move selection for Weepinbel and Rapidash.
Improve rejection on status moves.
2015-03-13 11:00:16 +01:00
Juanma Serrano
eb446c6b8b Gen 1 RandBats: Improve Tangela and avoid double status sets
Make Tangela's set more variable, not using sleep powder as a staple.
Avoid Sleep Powder and Stun Spore together on the same set.
Make Growth be unable to be in the same set as Swords Dance.
2015-03-05 13:46:07 +01:00
Juanma Serrano
7e4b90c7d6 Gen 1 RandBats: Update level balance in specific cases
Also note Staryu's proper tier in formats data.
Some wrap-move using Pokémon have a higher tier due to being better in a Wrap meta. Increase their level.
Staryu is tiered as LC but should have NFE level due to its typing, stats, and movepool.
2015-03-05 10:59:35 +01:00
Joimer
dfe3f4813a Gen 1 RandBats: Update balance
Make Fire Blast mandatory on Moltres.
Remove use of Poisonpowder.
Increase OU and Ubers levels a bit.
2015-03-01 18:40:14 +01:00
Juanma Serrano
98e7efc217 Gen 1: Proper critical hit interaction with burn 2015-02-27 10:22:47 +01:00
Juanma Serrano
a4a380d8ab Gen 1: Remove onCriticalHit call
It is never used on gen 1.
If a hit is critical on damage calculation on gen 1, it remains critical.
2015-02-27 10:15:07 +01:00
Juanma Serrano
784126c16b Gen 1: Remove unused event call
onModify for stats is not used in gen 1 and the call just slows the code down.
2015-02-27 10:13:04 +01:00
Juanma Serrano
c9fdf78901 Gen 1 RandBats: Balance update
Improve level scales.
Use Fire Blast as the main Fire-type attack.
Limit team to 2 Pokémon sharing the same main weakness (Thunderbolt, Surf, Psychic, Blizzard).
2015-02-27 10:10:32 +01:00
Juanma Serrano
3491f5a7c0 Gen 1: Make sure last damage is cleared properly on misses 2015-02-16 10:47:29 +01:00
Juanma Serrano
892719ddbe Update Gen 1 Random Battle 2015-01-28 10:47:07 +01:00
Juanma Serrano
d9de43ca9b Gen 1: Update Counter mechanics
There are some moves which do not reset last battle damage counter.
See: http://www.smogon.com/forums/threads/random-battles.3526564/page-3#post-6012489
2015-01-27 17:56:28 +01:00
Juanma Serrano
042fae42db Update Gen 1 Random Battles
Change mandatory move to essential move, as it's not literally mandatory but a move without which the Pokémon is much worse in any format it plays.
Buff all shitmons to level 99.
Nerf Amnesia Mewtwo to level 68.
Update level scale for better balance.
Halve the chance to have two Pokémon of the same type.
Halve the chance to get more than 2 NFE/LC/UU Pokémon.
Forbid Slash and Swords Dance in the same set explicitly.
All shitmons grant now the chance to get both Ubers.
Update several movesets, including lowering the chance to get a partial trapping set since those make games longer but not funnier.
2015-01-27 11:06:34 +01:00
The Immortal
ec777b33dd Gen 1: Fix error in randomCCTeam
Mew is now possible.
2015-01-18 20:41:53 +04:00
Juanma Serrano
426d101a2a Gen 1 RandBats: Add a mandatory move for some Pokémon
Some Pokémon with over 4 moves in the pool need a mandatory move.
Usually, this move makes a difference between them being decent and them being horrible.
2015-01-16 10:06:19 +01:00
Joimer
262c1918a8 Gen 1: Wrap should deduct PP on target change
If the target changes, Wrap continues and should use a PP.
If it misses, it should use a PP nonetheless.
2015-01-15 19:52:24 +01:00
Juanma Serrano
d9c367ff65 Fix more Travis Build Errors
Add a spaces after tests.
2015-01-15 09:31:36 +01:00
Juanma Serrano
30614d0c6c Gen 1: Fix Substitute interaction with partial trapping 2015-01-14 13:44:34 +01:00
Juanma Serrano
68c57590a4 Gen 1 RandBats: Add sets for NFEs/LCs, improve set maker 2015-01-14 09:19:48 +01:00
Juanma Serrano
45b063db54 Gen 1 RandBats: Improve team selection
The team selector will now bias teams.
You will now only get 0-1 LC Pokémon.
You are limited to either Mewtwo or Mew, if you get any, unless you get a Magikarp.
You're strictly limited to two Pokémon of the same type. This makes all teams type varied.
NFEs and UUs are less likely to be gotten after you have two of those (or LC).
2015-01-12 17:17:12 +01:00
Juanma Serrano
6db16ffd56 Gen 1 RandBats: Improve the set maker vastly
Make the first move on their random battle movesets mandatory unless explictly rejected.
Some Pokémon are viable or usable just because of a single move (ie. Slash on Farfetch'd).
Never reject Amnesia.
Remove unused code.
Avoid useless computing when a moveset is under five moves (just add them, no need to check them).
Growth is a special setup inferior to amnesia on gen 1.
Make Surf and Hydro Pump mutually exclusive. No moveset with those has less than five moves.
2015-01-12 16:50:11 +01:00
Juanma Serrano
e253ea3e7d Gen 1: Fix two turn moves
This fixes two turn moves as latest changes maonde this necessary.
Related to 7977b2c3cd
2015-01-12 12:19:09 +01:00
Juanma Serrano
aaed2fd6df Gen 1 RandBats: Reject setup with no attacking moves 2015-01-12 09:07:31 +01:00
Joimer
5050a7efc8 Gen 1: Make sure partial trapping lock ends after faint
Partial trapping lock on user disappears if target is fainted mid-duration
2015-01-09 15:54:27 +01:00
Juanma Serrano
0e5a854dee Gen 1 RandBats: Overhaul the set generator
Update a lot of possible moves.
Reject Sharpen and Sword Dance if the Pokémon has Special attacks only.
Reject Sharpen and Growth if Pokémon has better setup.
Make recovery mons always get their recovery move.
Prefer Thunder Wave to Body Slam on movesets in which is used to paralyse mainly.
Avoid Slash with setup moves on the same set.
2015-01-09 11:29:18 +01:00
Juanma Serrano
470ab938f0 Gen 1 RandBats: Update moves and balance 2015-01-09 10:49:34 +01:00
Juanma Serrano
adf11a9036 Gen 1: Last used move is stored after deducting a PP 2015-01-09 09:55:59 +01:00
Guangcong Luo
2a3c4e71dd Gen 1-3: Fix faint mechanics
Faint mechanics are now handled in the battle engine, instead of
hackily in the data files.

This also makes it so the case of Pokemon fainting mid-turn in
gen 3 singles correctly ends the turn.
2015-01-09 01:45:19 -05:00