Skip to content

Commit

Permalink
Gens 1 & 2: Fix Counter
Browse files Browse the repository at this point in the history
Some inherited functions from gen 6 were messing with the proper functionality.
  • Loading branch information
Joimer committed Jan 7, 2015
1 parent 45babe4 commit eac5f93
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion mods/gen1/moves.js
Expand Up @@ -204,7 +204,7 @@ exports.BattleMovedex = {
damageCallback: function (pokemon, target) {
// Counter mechanics on gen 1 might be hard to understand.
// It will fail if the last move selected by the opponent has base power 0 or is not Normal or Fighting Type.
// If both are true, counter will deal twice the last damage dealt in battle.
// If both are true, counter will deal twice the last damage dealt in battle, no matter what was the move.
// That means that, if opponent switches, counter will use last counter damage * 2.
var lastUsedMove = this.getMove(target.side.lastMove);
if (lastUsedMove && lastUsedMove.basePower > 0 && lastUsedMove.type in {'Normal': 1, 'Fighting': 1} && target.battle.lastDamage > 0) {
Expand Down
5 changes: 4 additions & 1 deletion mods/gen2/moves.js
Expand Up @@ -24,7 +24,10 @@ exports.BattleMovedex = {
return 2 * pokemon.lastAttackedBy.damage;
}
return false;
}
},
beforeTurnCallback: function () {},
onTryHit: function () {},
effect: {}
},
encore: {
inherit: true,
Expand Down

0 comments on commit eac5f93

Please sign in to comment.