mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-09-23 15:03:24 +02:00
Add blacklist of moves that can't be forced STAB.
This commit is contained in:
parent
df223bfbc8
commit
0c272a3a89
@ -3209,9 +3209,51 @@ export abstract class Pokemon extends Phaser.GameObjects.Container {
|
||||
Math.ceil(Math.pow(m[1], weightMultiplier) * 100),
|
||||
]);
|
||||
|
||||
const STAB_BLACKLIST = [
|
||||
MoveId.SHELL_TRAP,
|
||||
MoveId.FUTURE_SIGHT,
|
||||
MoveId.UPPER_HAND,
|
||||
MoveId.SKY_DROP,
|
||||
MoveId.STEEL_ROLLER,
|
||||
MoveId.BELCH,
|
||||
MoveId.FAKE_OUT,
|
||||
MoveId.LAST_RESORT,
|
||||
MoveId.SYNCHRONOISE,
|
||||
MoveId.DREAM_EATER,
|
||||
MoveId.DOOM_DESIRE,
|
||||
MoveId.FOCUS_PUNCH,
|
||||
MoveId.NIGHT_SHADE,
|
||||
MoveId.DRAGON_RAGE,
|
||||
MoveId.SONIC_BOOM,
|
||||
MoveId.BIDE,
|
||||
MoveId.COMEUPPANCE,
|
||||
MoveId.MIRROR_COAT,
|
||||
MoveId.METAL_BURST,
|
||||
MoveId.COUNTER,
|
||||
MoveId.FLING,
|
||||
MoveId.NATURAL_GIFT,
|
||||
MoveId.SPIT_UP,
|
||||
MoveId.FISSURE,
|
||||
MoveId.SHEER_COLD,
|
||||
MoveId.HORN_DRILL,
|
||||
MoveId.GUILLOTINE,
|
||||
MoveId.ENDEAVOR,
|
||||
MoveId.NATURES_MADNESS,
|
||||
MoveId.RUINATION,
|
||||
MoveId.SUPER_FANG,
|
||||
MoveId.SNORE,
|
||||
MoveId.HOLD_BACK,
|
||||
MoveId.BEAT_UP,
|
||||
MoveId.PSYWAVE,
|
||||
MoveId.FIRST_IMPRESSION,
|
||||
];
|
||||
|
||||
// All Pokemon force a STAB move first
|
||||
const stabMovePool = baseWeights.filter(
|
||||
m => allMoves[m[0]].category !== MoveCategory.STATUS && this.isOfType(allMoves[m[0]].type),
|
||||
m =>
|
||||
allMoves[m[0]].category !== MoveCategory.STATUS &&
|
||||
this.isOfType(allMoves[m[0]].type) &&
|
||||
!STAB_BLACKLIST.includes(m[0]),
|
||||
);
|
||||
|
||||
if (stabMovePool.length > 0) {
|
||||
@ -3224,7 +3266,9 @@ export abstract class Pokemon extends Phaser.GameObjects.Container {
|
||||
this.moveset.push(new PokemonMove(stabMovePool[index][0]));
|
||||
} else {
|
||||
// If there are no damaging STAB moves, just force a random damaging move
|
||||
const attackMovePool = baseWeights.filter(m => allMoves[m[0]].category !== MoveCategory.STATUS);
|
||||
const attackMovePool = baseWeights.filter(
|
||||
m => allMoves[m[0]].category !== MoveCategory.STATUS && !STAB_BLACKLIST.includes(m[0]),
|
||||
);
|
||||
if (attackMovePool.length > 0) {
|
||||
const totalWeight = attackMovePool.reduce((v, m) => v + m[1], 0);
|
||||
let rand = randSeedInt(totalWeight);
|
||||
@ -3261,7 +3305,7 @@ export abstract class Pokemon extends Phaser.GameObjects.Container {
|
||||
} else if (allMoves[m[0]].category !== MoveCategory.STATUS) {
|
||||
ret = Math.ceil(
|
||||
(m[1] / Math.max(Math.pow(4, this.moveset.filter(mo => (mo.getMove().power ?? 0) > 1).length) / 8, 0.5))
|
||||
* (this.isOfType(allMoves[m[0]].type) ? 20 : 1),
|
||||
* (this.isOfType(allMoves[m[0]].type) && !STAB_BLACKLIST.includes(m[0]) ? 20 : 1),
|
||||
);
|
||||
} else {
|
||||
ret = m[1];
|
||||
|
Loading…
Reference in New Issue
Block a user