mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-06-21 09:02:47 +02:00
Merge remote-tracking branch 'upstream/beta' into intim-tests
This commit is contained in:
commit
6bf8f55a7d
@ -542,6 +542,79 @@
|
||||
"volume": 100,
|
||||
"pitch": 55,
|
||||
"eventType": "AnimTimedSoundEvent"
|
||||
},
|
||||
{
|
||||
"frameIndex": 0,
|
||||
"resourceName": "PRAS- Sandstorm",
|
||||
"bgX": -50,
|
||||
"bgY": 0,
|
||||
"opacity": 0,
|
||||
"duration": 5,
|
||||
"eventType": "AnimTimedAddBgEvent"
|
||||
},
|
||||
{
|
||||
"frameIndex": 0,
|
||||
"resourceName": "",
|
||||
"bgX": -50,
|
||||
"bgY": 0,
|
||||
"opacity": 96,
|
||||
"duration": 3,
|
||||
"eventType": "AnimTimedUpdateBgEvent"
|
||||
}
|
||||
],
|
||||
"3": [
|
||||
{
|
||||
"frameIndex": 3,
|
||||
"resourceName": "",
|
||||
"bgX": -25,
|
||||
"bgY": 0,
|
||||
"opacity": 128,
|
||||
"duration": 3,
|
||||
"eventType": "AnimTimedUpdateBgEvent"
|
||||
}
|
||||
],
|
||||
"6": [
|
||||
{
|
||||
"frameIndex": 6,
|
||||
"resourceName": "",
|
||||
"bgX": 0,
|
||||
"bgY": 0,
|
||||
"opacity": 192,
|
||||
"duration": 3,
|
||||
"eventType": "AnimTimedUpdateBgEvent"
|
||||
}
|
||||
],
|
||||
"9": [
|
||||
{
|
||||
"frameIndex": 9,
|
||||
"resourceName": "",
|
||||
"bgX": 25,
|
||||
"bgY": 0,
|
||||
"opacity": 128,
|
||||
"duration": 3,
|
||||
"eventType": "AnimTimedUpdateBgEvent"
|
||||
}
|
||||
],
|
||||
"12": [
|
||||
{
|
||||
"frameIndex": 12,
|
||||
"resourceName": "",
|
||||
"bgX": 50,
|
||||
"bgY": 0,
|
||||
"opacity": 96,
|
||||
"duration": 3,
|
||||
"eventType": "AnimTimedUpdateBgEvent"
|
||||
}
|
||||
],
|
||||
"15": [
|
||||
{
|
||||
"frameIndex": 15,
|
||||
"resourceName": "",
|
||||
"bgX": 50,
|
||||
"bgY": 0,
|
||||
"opacity": 0,
|
||||
"duration": 3,
|
||||
"eventType": "AnimTimedUpdateBgEvent"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
@ -19057,8 +19057,15 @@ export const tmSpecies: TmSpecies = {
|
||||
Species.SLAKING,
|
||||
Species.HARIYAMA,
|
||||
Species.NOSEPASS,
|
||||
Species.ARON,
|
||||
Species.LAIRON,
|
||||
Species.AGGRON,
|
||||
Species.ELECTRIKE,
|
||||
Species.MANECTRIC,
|
||||
Species.GULPIN,
|
||||
Species.SWALOT,
|
||||
Species.WAILMER,
|
||||
Species.WAILORD,
|
||||
Species.NUMEL,
|
||||
Species.CAMERUPT,
|
||||
Species.TORKOAL,
|
||||
@ -19067,18 +19074,28 @@ export const tmSpecies: TmSpecies = {
|
||||
Species.ZANGOOSE,
|
||||
Species.SEVIPER,
|
||||
Species.WHISCASH,
|
||||
Species.LILEEP,
|
||||
Species.CRADILY,
|
||||
Species.ANORITH,
|
||||
Species.ARMALDO,
|
||||
Species.SHUPPET,
|
||||
Species.BANETTE,
|
||||
Species.DUSKULL,
|
||||
Species.DUSCLOPS,
|
||||
Species.TROPIUS,
|
||||
Species.CHIMECHO,
|
||||
Species.ABSOL,
|
||||
Species.SPHEAL,
|
||||
Species.SEALEO,
|
||||
Species.WALREIN,
|
||||
Species.REGIROCK,
|
||||
Species.REGICE,
|
||||
Species.REGISTEEL,
|
||||
Species.TURTWIG,
|
||||
Species.GROTLE,
|
||||
Species.TORTERRA,
|
||||
Species.BIDOOF,
|
||||
Species.BIBAREL,
|
||||
Species.CRANIDOS,
|
||||
Species.RAMPARDOS,
|
||||
Species.SHIELDON,
|
||||
@ -19120,6 +19137,11 @@ export const tmSpecies: TmSpecies = {
|
||||
Species.TEPIG,
|
||||
Species.PIGNITE,
|
||||
Species.EMBOAR,
|
||||
Species.MUNNA,
|
||||
Species.MUSHARNA,
|
||||
Species.ROGGENROLA,
|
||||
Species.BOLDORE,
|
||||
Species.GIGALITH,
|
||||
Species.DRILBUR,
|
||||
Species.EXCADRILL,
|
||||
Species.TIMBURR,
|
||||
@ -19128,28 +19150,44 @@ export const tmSpecies: TmSpecies = {
|
||||
Species.SANDILE,
|
||||
Species.KROKOROK,
|
||||
Species.KROOKODILE,
|
||||
Species.DWEBBLE,
|
||||
Species.CRUSTLE,
|
||||
Species.SCRAGGY,
|
||||
Species.SCRAFTY,
|
||||
Species.YAMASK,
|
||||
Species.COFAGRIGUS,
|
||||
Species.TRUBBISH,
|
||||
Species.GARBODOR,
|
||||
Species.SAWSBUCK,
|
||||
Species.FERROSEED,
|
||||
Species.FERROTHORN,
|
||||
Species.LITWICK,
|
||||
Species.LAMPENT,
|
||||
Species.CHANDELURE,
|
||||
Species.BEARTIC,
|
||||
Species.SHELMET,
|
||||
Species.ACCELGOR,
|
||||
Species.STUNFISK,
|
||||
Species.GOLETT,
|
||||
Species.GOLURK,
|
||||
Species.HEATMOR,
|
||||
Species.CHESPIN,
|
||||
Species.QUILLADIN,
|
||||
Species.CHESNAUGHT,
|
||||
Species.TYRUNT,
|
||||
Species.TYRANTRUM,
|
||||
Species.SYLVEON,
|
||||
Species.GOOMY,
|
||||
Species.SLIGGOO,
|
||||
Species.GOODRA,
|
||||
Species.PHANTUMP,
|
||||
Species.TREVENANT,
|
||||
Species.PUMPKABOO,
|
||||
Species.GOURGEIST,
|
||||
Species.BERGMITE,
|
||||
Species.AVALUGG,
|
||||
Species.ROWLET,
|
||||
Species.DARTRIX,
|
||||
Species.DECIDUEYE,
|
||||
Species.GUMSHOOS,
|
||||
Species.MUDBRAY,
|
||||
@ -19157,7 +19195,9 @@ export const tmSpecies: TmSpecies = {
|
||||
Species.PASSIMIAN,
|
||||
Species.SANDYGAST,
|
||||
Species.PALOSSAND,
|
||||
Species.PYUKUMUKU,
|
||||
Species.KOMALA,
|
||||
Species.TURTONATOR,
|
||||
Species.MIMIKYU,
|
||||
Species.SKWOVET,
|
||||
Species.GREEDENT,
|
||||
@ -19169,6 +19209,7 @@ export const tmSpecies: TmSpecies = {
|
||||
Species.SINISTEA,
|
||||
Species.POLTEAGEIST,
|
||||
Species.PERRSERKER,
|
||||
Species.CURSOLA,
|
||||
Species.RUNERIGUS,
|
||||
Species.PINCURCHIN,
|
||||
Species.STONJOURNER,
|
||||
@ -19236,6 +19277,7 @@ export const tmSpecies: TmSpecies = {
|
||||
Species.GALAR_WEEZING,
|
||||
Species.GALAR_SLOWKING,
|
||||
Species.GALAR_YAMASK,
|
||||
Species.GALAR_STUNFISK,
|
||||
Species.HISUI_ELECTRODE,
|
||||
Species.HISUI_TYPHLOSION,
|
||||
Species.HISUI_QWILFISH,
|
||||
|
@ -8052,10 +8052,10 @@ export class UpperHandCondition extends MoveCondition {
|
||||
}
|
||||
}
|
||||
|
||||
export class hitsSameTypeAttr extends VariableMoveTypeMultiplierAttr {
|
||||
export class HitsSameTypeAttr extends VariableMoveTypeMultiplierAttr {
|
||||
apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean {
|
||||
const multiplier = args[0] as NumberHolder;
|
||||
if (!user.getTypes().some(type => target.getTypes().includes(type))) {
|
||||
if (!user.getTypes(true).some(type => target.getTypes(true).includes(type))) {
|
||||
multiplier.value = 0;
|
||||
return true;
|
||||
}
|
||||
@ -9756,7 +9756,7 @@ export function initMoves() {
|
||||
new AttackMove(Moves.SYNCHRONOISE, PokemonType.PSYCHIC, MoveCategory.SPECIAL, 120, 100, 10, -1, 0, 5)
|
||||
.target(MoveTarget.ALL_NEAR_OTHERS)
|
||||
.condition(unknownTypeCondition)
|
||||
.attr(hitsSameTypeAttr),
|
||||
.attr(HitsSameTypeAttr),
|
||||
new AttackMove(Moves.ELECTRO_BALL, PokemonType.ELECTRIC, MoveCategory.SPECIAL, -1, 100, 10, -1, 0, 5)
|
||||
.attr(ElectroBallPowerAttr)
|
||||
.ballBombMove(),
|
||||
|
@ -3500,11 +3500,11 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
||||
}
|
||||
let weight = levelMove[0];
|
||||
// Evolution Moves
|
||||
if (weight === 0) {
|
||||
if (weight === EVOLVE_MOVE) {
|
||||
weight = 50;
|
||||
}
|
||||
// Assume level 1 moves with 80+ BP are "move reminder" moves and bump their weight
|
||||
if (weight === 1 && allMoves[levelMove[1]].power >= 80) {
|
||||
// Assume level 1 moves with 80+ BP are "move reminder" moves and bump their weight. Trainers use actual relearn moves.
|
||||
if (weight === 1 && allMoves[levelMove[1]].power >= 80 || weight === RELEARN_MOVE && this.hasTrainer()) {
|
||||
weight = 40;
|
||||
}
|
||||
if (
|
||||
@ -3609,9 +3609,9 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
||||
|
||||
// Bosses never get self ko moves or Pain Split
|
||||
if (this.isBoss()) {
|
||||
movePool = movePool.filter(m => !allMoves[m[0]].hasAttr(SacrificialAttr));
|
||||
movePool = movePool.filter(m => !allMoves[m[0]].hasAttr(HpSplitAttr));
|
||||
movePool = movePool.filter(m => !allMoves[m[0]].hasAttr(SacrificialAttr) && !allMoves[m[0]].hasAttr(HpSplitAttr));
|
||||
}
|
||||
// No one gets Memento or Final Gambit
|
||||
movePool = movePool.filter(
|
||||
m => !allMoves[m[0]].hasAttr(SacrificialAttrOnHit),
|
||||
);
|
||||
@ -3623,10 +3623,6 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
||||
m[0],
|
||||
m[1] * (allMoves[m[0]].hasAttr(SacrificialAttr) ? 0.5 : 1),
|
||||
]);
|
||||
movePool = movePool.map(m => [
|
||||
m[0],
|
||||
m[1] * (allMoves[m[0]].hasAttr(SacrificialAttrOnHit) ? 0.5 : 1),
|
||||
]);
|
||||
// Trainers get a weight bump to stat buffing moves
|
||||
movePool = movePool.map(m => [
|
||||
m[0],
|
||||
@ -3687,10 +3683,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
||||
]);
|
||||
|
||||
/** The higher this is the more the game weights towards higher level moves. At `0` all moves are equal weight. */
|
||||
let weightMultiplier = 0.9;
|
||||
if (this.hasTrainer()) {
|
||||
weightMultiplier += 0.7;
|
||||
}
|
||||
let weightMultiplier = 1.6;
|
||||
if (this.isBoss()) {
|
||||
weightMultiplier += 0.4;
|
||||
}
|
||||
@ -3699,37 +3692,21 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
||||
Math.ceil(Math.pow(m[1], weightMultiplier) * 100),
|
||||
]);
|
||||
|
||||
// Trainers and bosses always force a stab move
|
||||
if (this.hasTrainer() || this.isBoss()) {
|
||||
const stabMovePool = baseWeights.filter(
|
||||
m =>
|
||||
allMoves[m[0]].category !== MoveCategory.STATUS &&
|
||||
this.isOfType(allMoves[m[0]].type),
|
||||
);
|
||||
// All Pokemon force a STAB move first
|
||||
const stabMovePool = baseWeights.filter(
|
||||
m =>
|
||||
allMoves[m[0]].category !== MoveCategory.STATUS &&
|
||||
this.isOfType(allMoves[m[0]].type),
|
||||
);
|
||||
|
||||
if (stabMovePool.length) {
|
||||
const totalWeight = stabMovePool.reduce((v, m) => v + m[1], 0);
|
||||
let rand = randSeedInt(totalWeight);
|
||||
let index = 0;
|
||||
while (rand > stabMovePool[index][1]) {
|
||||
rand -= stabMovePool[index++][1];
|
||||
}
|
||||
this.moveset.push(new PokemonMove(stabMovePool[index][0], 0, 0));
|
||||
}
|
||||
} else {
|
||||
// Normal wild pokemon just force a random damaging move
|
||||
const attackMovePool = baseWeights.filter(
|
||||
m => allMoves[m[0]].category !== MoveCategory.STATUS,
|
||||
);
|
||||
if (attackMovePool.length) {
|
||||
const totalWeight = attackMovePool.reduce((v, m) => v + m[1], 0);
|
||||
let rand = randSeedInt(totalWeight);
|
||||
let index = 0;
|
||||
while (rand > attackMovePool[index][1]) {
|
||||
rand -= attackMovePool[index++][1];
|
||||
}
|
||||
this.moveset.push(new PokemonMove(attackMovePool[index][0], 0, 0));
|
||||
if (stabMovePool.length) {
|
||||
const totalWeight = stabMovePool.reduce((v, m) => v + m[1], 0);
|
||||
let rand = randSeedInt(totalWeight);
|
||||
let index = 0;
|
||||
while (rand > stabMovePool[index][1]) {
|
||||
rand -= stabMovePool[index++][1];
|
||||
}
|
||||
this.moveset.push(new PokemonMove(stabMovePool[index][0], 0, 0));
|
||||
}
|
||||
|
||||
while (
|
||||
@ -3741,7 +3718,11 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
||||
// 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))
|
||||
.filter(m => !this.moveset.some(
|
||||
mo =>
|
||||
m[0] === mo.moveId ||
|
||||
(allMoves[m[0]].hasAttr(SacrificialAttr) && mo.getMove().hasAttr(SacrificialAttr)) // Only one self-KO move allowed
|
||||
))
|
||||
.map(m => {
|
||||
let ret: number;
|
||||
if (
|
||||
@ -3772,7 +3753,11 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
||||
});
|
||||
} else {
|
||||
// Non-trainer pokemon just use normal weights
|
||||
movePool = baseWeights.filter(m => !this.moveset.some(mo => m[0] === mo.moveId));
|
||||
movePool = baseWeights.filter(m => !this.moveset.some(
|
||||
mo =>
|
||||
m[0] === mo.moveId ||
|
||||
(allMoves[m[0]].hasAttr(SacrificialAttr) && mo.getMove().hasAttr(SacrificialAttr)) // Only one self-KO move allowed
|
||||
));
|
||||
}
|
||||
const totalWeight = movePool.reduce((v, m) => v + m[1], 0);
|
||||
let rand = randSeedInt(totalWeight);
|
||||
@ -7104,7 +7089,6 @@ export class EnemyPokemon extends Pokemon {
|
||||
|
||||
if (!dataSource) {
|
||||
this.generateAndPopulateMoveset();
|
||||
|
||||
if (shinyLock || Overrides.OPP_SHINY_OVERRIDE === false) {
|
||||
this.shiny = false;
|
||||
} else {
|
||||
|
@ -1888,7 +1888,7 @@ export default class PokedexPageUiHandler extends MessageUiHandler {
|
||||
if (!(passiveAttr & PassiveAttr.UNLOCKED)) {
|
||||
const passiveCost = getPassiveCandyCount(speciesStarterCosts[this.starterId]);
|
||||
options.push({
|
||||
label: `x${passiveCost} ${i18next.t("pokedexUiHandler:unlockPassive")} (${allAbilities[this.passive].name})`,
|
||||
label: `x${passiveCost} ${i18next.t("pokedexUiHandler:unlockPassive")}`,
|
||||
handler: () => {
|
||||
if (Overrides.FREE_CANDY_UPGRADE_OVERRIDE || candyCount >= passiveCost) {
|
||||
starterData.passiveAttr |= PassiveAttr.UNLOCKED | PassiveAttr.ENABLED;
|
||||
|
@ -151,8 +151,10 @@ const languageSettings: { [key: string]: LanguageSetting } = {
|
||||
starterInfoXPos: 30,
|
||||
},
|
||||
ja: {
|
||||
starterInfoTextSize: "51px",
|
||||
starterInfoTextSize: "62px",
|
||||
instructionTextSize: "38px",
|
||||
starterInfoYOffset: 0.5,
|
||||
starterInfoXPos: 33,
|
||||
},
|
||||
"ca-ES": {
|
||||
starterInfoTextSize: "52px",
|
||||
@ -2182,7 +2184,7 @@ export default class StarterSelectUiHandler extends MessageUiHandler {
|
||||
if (!(passiveAttr & PassiveAttr.UNLOCKED)) {
|
||||
const passiveCost = getPassiveCandyCount(speciesStarterCosts[this.lastSpecies.speciesId]);
|
||||
options.push({
|
||||
label: `x${passiveCost} ${i18next.t("starterSelectUiHandler:unlockPassive")} (${allAbilities[this.lastSpecies.getPassiveAbility()].name})`,
|
||||
label: `x${passiveCost} ${i18next.t("starterSelectUiHandler:unlockPassive")}`,
|
||||
handler: () => {
|
||||
if (Overrides.FREE_CANDY_UPGRADE_OVERRIDE || candyCount >= passiveCost) {
|
||||
starterData.passiveAttr |= PassiveAttr.UNLOCKED | PassiveAttr.ENABLED;
|
||||
|
47
test/moves/synchronoise.test.ts
Normal file
47
test/moves/synchronoise.test.ts
Normal file
@ -0,0 +1,47 @@
|
||||
import { Abilities } from "#enums/abilities";
|
||||
import { Moves } from "#enums/moves";
|
||||
import { PokemonType } from "#enums/pokemon-type";
|
||||
import { Species } from "#enums/species";
|
||||
import GameManager from "#test/testUtils/gameManager";
|
||||
import Phaser from "phaser";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||
|
||||
describe("Moves - Synchronoise", () => {
|
||||
let phaserGame: Phaser.Game;
|
||||
let game: GameManager;
|
||||
|
||||
beforeAll(() => {
|
||||
phaserGame = new Phaser.Game({
|
||||
type: Phaser.HEADLESS,
|
||||
});
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
game.phaseInterceptor.restoreOg();
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
game = new GameManager(phaserGame);
|
||||
game.override
|
||||
.moveset([Moves.SYNCHRONOISE])
|
||||
.ability(Abilities.BALL_FETCH)
|
||||
.battleStyle("single")
|
||||
.disableCrits()
|
||||
.enemySpecies(Species.MAGIKARP)
|
||||
.enemyAbility(Abilities.BALL_FETCH)
|
||||
.enemyMoveset(Moves.SPLASH);
|
||||
});
|
||||
|
||||
it("should consider the user's tera type if it is terastallized", async () => {
|
||||
await game.classicMode.startBattle([Species.BIDOOF]);
|
||||
const playerPokemon = game.scene.getPlayerPokemon()!;
|
||||
const enemyPokemon = game.scene.getEnemyPokemon()!;
|
||||
|
||||
// force the player to be terastallized
|
||||
playerPokemon.teraType = PokemonType.WATER;
|
||||
playerPokemon.isTerastallized = true;
|
||||
game.move.select(Moves.SYNCHRONOISE);
|
||||
await game.phaseInterceptor.to("BerryPhase");
|
||||
expect(enemyPokemon.hp).toBeLessThan(enemyPokemon.getMaxHp());
|
||||
});
|
||||
});
|
Loading…
Reference in New Issue
Block a user