mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-19 06:42:20 +02:00
Match formatting of pokemon.ts
This commit is contained in:
parent
57cbba1749
commit
7ddc23eb36
@ -3487,16 +3487,35 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
||||
// Sqrt the weight of any damaging moves with overlapping types. This is about a 0.05 - 0.1 multiplier.
|
||||
// Other damaging moves 2x weight if 0-1 damaging moves, 0.5x if 2, 0.125x if 3. These weights get 20x if STAB.
|
||||
// Status moves remain unchanged on weight, this encourages 1-2
|
||||
movePool = baseWeights.filter(m => !this.moveset.some(mo => m[0] === mo.moveId)).map((m) => {
|
||||
movePool = baseWeights
|
||||
.filter(m => !this.moveset.some(mo => m[0] === mo.moveId))
|
||||
.map(m => {
|
||||
let ret: number;
|
||||
if (this.moveset.some(mo => mo.getMove().category !== MoveCategory.STATUS && mo.getMove().type === allMoves[m[0]].type)) {
|
||||
if (
|
||||
this.moveset.some(
|
||||
mo =>
|
||||
mo.getMove().category !== MoveCategory.STATUS &&
|
||||
mo.getMove().type === allMoves[m[0]].type,
|
||||
)
|
||||
) {
|
||||
ret = Math.ceil(Math.sqrt(m[1]));
|
||||
} 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) ? 2 : 1));
|
||||
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),
|
||||
);
|
||||
} else {
|
||||
ret = m[1];
|
||||
}
|
||||
return [ m[0], ret ];
|
||||
return [m[0], ret];
|
||||
});
|
||||
} else {
|
||||
// Non-trainer pokemon just use normal weights
|
||||
|
Loading…
Reference in New Issue
Block a user