Skip to content

Commit

Permalink
Check sourceEffect instead of lastMove in Trump Card
Browse files Browse the repository at this point in the history
This allows moving the .moveUsed() call after .useMove() when running moves
Refs #4558
  • Loading branch information
Slayer95 committed Apr 8, 2018
1 parent 52746ac commit cb6630e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 22 deletions.
8 changes: 4 additions & 4 deletions data/moves.js
Original file line number Diff line number Diff line change
Expand Up @@ -18020,11 +18020,11 @@ let BattleMovedex = {
num: 376,
accuracy: true,
basePower: 0,
basePowerCallback: function (pokemon) {
// @ts-ignore
let move = pokemon.getMoveData(pokemon.lastMove.id); // Account for calling Trump Card via other moves
basePowerCallback: function (source, target, move) {
const callerMoveId = move.sourceEffect || move.id;
const moveSlot = source.getMoveData(callerMoveId);
// @ts-ignore
switch (move.pp) {
switch (moveSlot.pp) {
case 0:
return 200;
case 1:
Expand Down
18 changes: 0 additions & 18 deletions mods/linked/moves.js
Original file line number Diff line number Diff line change
Expand Up @@ -492,24 +492,6 @@ exports.BattleMovedex = {
},
},
},
trumpcard: {
inherit: true,
basePowerCallback: function (pokemon) {
let move = pokemon.getMoveData(pokemon.getLastMoveAbsolute()); // Account for calling Trump Card via other moves
switch (move.pp) {
case 0:
return 200;
case 1:
return 80;
case 2:
return 60;
case 3:
return 50;
default:
return 40;
}
},
},

/**
* Moves that check `pokemon.moveThisTurn`
Expand Down

0 comments on commit cb6630e

Please sign in to comment.