Skip to content

Commit

Permalink
Fix Flail/Reversal BP modifier in Gen 2-3 (#10315)
Browse files Browse the repository at this point in the history
  • Loading branch information
Karthik99999 committed May 24, 2024
1 parent 7158ead commit d99f4bc
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 4 deletions.
44 changes: 44 additions & 0 deletions data/mods/gen3/moves.ts
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,28 @@ export const Moves: {[k: string]: ModdedMoveData} = {
inherit: true,
flags: {protect: 1, mirror: 1, metronome: 1},
},
flail: {
inherit: true,
basePowerCallback(pokemon) {
const ratio = Math.max(Math.floor(pokemon.hp * 48 / pokemon.maxhp), 1);
let bp;
if (ratio < 2) {
bp = 200;
} else if (ratio < 5) {
bp = 150;
} else if (ratio < 10) {
bp = 100;
} else if (ratio < 17) {
bp = 80;
} else if (ratio < 33) {
bp = 40;
} else {
bp = 20;
}
this.debug('BP: ' + bp);
return bp;
},
},
flash: {
inherit: true,
accuracy: 70,
Expand Down Expand Up @@ -532,6 +554,28 @@ export const Moves: {[k: string]: ModdedMoveData} = {
inherit: true,
pp: 20,
},
reversal: {
inherit: true,
basePowerCallback(pokemon) {
const ratio = Math.max(Math.floor(pokemon.hp * 48 / pokemon.maxhp), 1);
let bp;
if (ratio < 2) {
bp = 200;
} else if (ratio < 5) {
bp = 150;
} else if (ratio < 10) {
bp = 100;
} else if (ratio < 17) {
bp = 80;
} else if (ratio < 33) {
bp = 40;
} else {
bp = 20;
}
this.debug('BP: ' + bp);
return bp;
},
},
rocksmash: {
inherit: true,
basePower: 20,
Expand Down
4 changes: 2 additions & 2 deletions data/mods/gen4/moves.ts
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ export const Moves: {[k: string]: ModdedMoveData} = {
},
flail: {
inherit: true,
basePowerCallback(pokemon, target) {
basePowerCallback(pokemon) {
const ratio = Math.max(Math.floor(pokemon.hp * 64 / pokemon.maxhp), 1);
let bp;
if (ratio < 2) {
Expand Down Expand Up @@ -1289,7 +1289,7 @@ export const Moves: {[k: string]: ModdedMoveData} = {
},
reversal: {
inherit: true,
basePowerCallback(pokemon, target) {
basePowerCallback(pokemon) {
const ratio = Math.max(Math.floor(pokemon.hp * 64 / pokemon.maxhp), 1);
let bp;
if (ratio < 2) {
Expand Down
4 changes: 2 additions & 2 deletions data/moves.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5723,7 +5723,7 @@ export const Moves: {[moveid: string]: MoveData} = {
num: 175,
accuracy: 100,
basePower: 0,
basePowerCallback(pokemon, target) {
basePowerCallback(pokemon) {
const ratio = Math.max(Math.floor(pokemon.hp * 48 / pokemon.maxhp), 1);
let bp;
if (ratio < 2) {
Expand Down Expand Up @@ -15620,7 +15620,7 @@ export const Moves: {[moveid: string]: MoveData} = {
num: 179,
accuracy: 100,
basePower: 0,
basePowerCallback(pokemon, target) {
basePowerCallback(pokemon) {
const ratio = Math.max(Math.floor(pokemon.hp * 48 / pokemon.maxhp), 1);
let bp;
if (ratio < 2) {
Expand Down

0 comments on commit d99f4bc

Please sign in to comment.