Commit Graph

131 Commits

Author SHA1 Message Date
Guangcong Luo
5d3cd8263c More updates to Endless Battle Clause
- Gen 1 PP overflow makes a Pokemon stale
- Staleness warnings now specify the staleness source
- Half-staleness also warns, if another pokemon is already stale

Warning on half-staleness helps remind people who seem to think
they've beaten Endless Battle Clause after 5-ish turns, when it
takes 10-20 turns for some staleness verdics, especially if
there's a lot of switching going on.
2015-07-24 03:33:28 -04:00
Ivo Julca
15b925f7e4 RBY-GSC Randbats: Fix high incidence of later gen Pokémon 2015-07-16 13:33:42 -05:00
Ivo Julca
baadd0a92f Overhaul old-gen random team builders
Mainly follow-up for 1deedc595, but also fixes a few bugs.
- BW/GSC/RBY - randomSet: fixed and renamed slot argument.
- BW - randomTeam: crashlogger relative path was set incorrectly.
- BW - randomTeam: PotD Magikarp and Delibird used outdated randomBattleMoves data format.
- RBY - randomTeam: builder was too reject-happy regarding weaknesses (counters prematurely updated).

An improvement of 130% more op/s is observed for RBY randomCCTeam,
with no significative performance regression for randomTeam in any gen.
2015-07-16 12:03:14 -05:00
Marty-D
0f7f238a10 Gen I: Prevent Cosplay Pikachu from appearing in Challenge Cup 2015-07-08 20:27:09 -04:00
Ivo Julca
f18eef39ca Fix Travis build 2015-06-12 03:41:22 -05:00
The Immortal
a4a09021b2 Gen 1: Fix Wrap deducting extra PP
It currently deducts an extra PP on a switch. According to the comment,
PP is not deducted earlier, which is why it was being deducted here.
But this is incorrect. PP is deducted earlier on a switch.
2015-06-09 19:12:43 +04:00
Juanma Serrano
3a4abaf0fc Gen 1: Implement NU listing
Where as SmogDex does not list the NU tier, it is been a long-standing existing tier within Smogon and rby2k10 communities.
The NU tiering serves for Random Battle balance purposes mainly, as there is no UU format.
One could use the change to build a Gen 1 NU tier or similar, though.
2015-06-09 13:42:36 +02:00
Marty-D
29e56b1043 Fix confusion timing after rampage moves
- Gen 1, 2, 5, and 6 cause confusion immediately after the move on the
last turn
- Gen 3 and 4 cause confusion at the end of the turn on the last turn
2015-06-04 09:55:30 -04:00
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