mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-27 10:42:25 +02:00
Merge branch 'beta' into PsychicTerrainVisualFix
This commit is contained in:
commit
d9128cf378
Binary file not shown.
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
Binary file not shown.
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.4 KiB |
Binary file not shown.
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
@ -4,6 +4,7 @@
|
||||
"3f4447": "466698",
|
||||
"de3431": "3fca9f",
|
||||
"f8f8f8": "a1e9f0",
|
||||
"f4f4f4": "d7eff4",
|
||||
"7b282e": "0e3e81",
|
||||
"6b1d1d": "206d74",
|
||||
"4ebdd9": "41a7b0",
|
||||
@ -11,7 +12,7 @@
|
||||
"bfbfbf": "8cc7d4",
|
||||
"ffb2bf": "b7e9ff",
|
||||
"bf4c60": "4386df",
|
||||
"fff0a6": "271f4c",
|
||||
"fff0a6": "208698",
|
||||
"3e7acc": "6b4592",
|
||||
"18335c": "170738",
|
||||
"f2798d": "8dcfff",
|
||||
@ -25,6 +26,7 @@
|
||||
"3f4447": "466698",
|
||||
"de3431": "9ceec6",
|
||||
"f8f8f8": "89d2b8",
|
||||
"f4f4f4": "d7eff4",
|
||||
"7b282e": "152a5c",
|
||||
"6b1d1d": "356e8d",
|
||||
"4ebdd9": "2f6e74",
|
||||
|
@ -4,6 +4,7 @@
|
||||
"3f4447": "466698",
|
||||
"de3431": "3fca9f",
|
||||
"f8f8f8": "a1e9f0",
|
||||
"f4f4f4": "d7effa",
|
||||
"7b282e": "0e3e81",
|
||||
"6b1d1d": "206d74",
|
||||
"4ebdd9": "41a7b0",
|
||||
@ -25,6 +26,7 @@
|
||||
"3f4447": "466698",
|
||||
"de3431": "9ceec6",
|
||||
"f8f8f8": "89d2b8",
|
||||
"f4f4f4": "d7effa",
|
||||
"7b282e": "152a5c",
|
||||
"6b1d1d": "356e8d",
|
||||
"4ebdd9": "2f6e74",
|
||||
|
@ -1424,6 +1424,8 @@ export default class BattleScene extends SceneBase {
|
||||
return 0;
|
||||
}
|
||||
|
||||
const isEggPhase: boolean = [ "EggLapsePhase", "EggHatchPhase" ].includes(this.getCurrentPhase()?.constructor.name ?? "");
|
||||
|
||||
switch (species.speciesId) {
|
||||
case Species.UNOWN:
|
||||
case Species.SHELLOS:
|
||||
@ -1455,7 +1457,7 @@ export default class BattleScene extends SceneBase {
|
||||
}
|
||||
return Utils.randSeedInt(8);
|
||||
case Species.EEVEE:
|
||||
if (this.currentBattle?.battleType === BattleType.TRAINER && this.currentBattle?.waveIndex < 30) {
|
||||
if (this.currentBattle?.battleType === BattleType.TRAINER && this.currentBattle?.waveIndex < 30 && !isEggPhase) {
|
||||
return 0; // No Partner Eevee for Wave 12 Preschoolers
|
||||
}
|
||||
return Utils.randSeedInt(2);
|
||||
@ -1483,7 +1485,7 @@ export default class BattleScene extends SceneBase {
|
||||
return 0;
|
||||
case Species.GIMMIGHOUL:
|
||||
// Chest form can only be found in Mysterious Chest Encounter, if this is a game mode with MEs
|
||||
if (this.gameMode.hasMysteryEncounters) {
|
||||
if (this.gameMode.hasMysteryEncounters && !isEggPhase) {
|
||||
return 1; // Wandering form
|
||||
} else {
|
||||
return Utils.randSeedInt(species.forms.length);
|
||||
|
@ -9220,7 +9220,8 @@ export function initMoves() {
|
||||
.attr(ClearWeatherAttr, WeatherType.FOG)
|
||||
.attr(ClearTerrainAttr)
|
||||
.attr(RemoveScreensAttr, false)
|
||||
.attr(RemoveArenaTrapAttr, true),
|
||||
.attr(RemoveArenaTrapAttr, true)
|
||||
.attr(RemoveArenaTagsAttr, [ ArenaTagType.MIST, ArenaTagType.SAFEGUARD ], false),
|
||||
new StatusMove(Moves.TRICK_ROOM, Type.PSYCHIC, -1, 5, -1, -7, 4)
|
||||
.attr(AddArenaTagAttr, ArenaTagType.TRICK_ROOM, 5)
|
||||
.ignoresProtect()
|
||||
|
@ -1040,7 +1040,8 @@ class SpeciesStatBoosterModifierTypeGenerator extends ModifierTypeGenerator {
|
||||
for (const p of party) {
|
||||
const speciesId = p.getSpeciesForm(true).speciesId;
|
||||
const fusionSpeciesId = p.isFusion() ? p.getFusionSpeciesForm(true).speciesId : null;
|
||||
const hasFling = p.getMoveset(true).some(m => m?.moveId === Moves.FLING);
|
||||
// TODO: Use commented boolean when Fling is implemented
|
||||
const hasFling = false; /* p.getMoveset(true).some(m => m?.moveId === Moves.FLING) */
|
||||
|
||||
for (const i in values) {
|
||||
const checkedSpecies = values[i].species;
|
||||
@ -1755,56 +1756,69 @@ const modifierPool: ModifierPool = {
|
||||
}, 12),
|
||||
new WeightedModifierType(modifierTypes.TOXIC_ORB, (party: Pokemon[]) => {
|
||||
return party.some(p => {
|
||||
const moveset = p.getMoveset(true).filter(m => !isNullOrUndefined(m)).map(m => m.moveId);
|
||||
|
||||
const canSetStatus = p.canSetStatus(StatusEffect.TOXIC, true, true, null, true);
|
||||
const isHoldingOrb = p.getHeldItems().some(i => i.type.id === "FLAME_ORB" || i.type.id === "TOXIC_ORB");
|
||||
|
||||
// Moves that take advantage of obtaining the actual status effect
|
||||
const hasStatusMoves = [ Moves.FACADE, Moves.PSYCHO_SHIFT ]
|
||||
.some(m => moveset.includes(m));
|
||||
// Moves that take advantage of being able to give the target a status orb
|
||||
// TODO: Take moves from comment they are implemented
|
||||
const hasItemMoves = [ /* Moves.TRICK, Moves.FLING, Moves.SWITCHEROO */ ]
|
||||
.some(m => moveset.includes(m));
|
||||
// Abilities that take advantage of obtaining the actual status effect
|
||||
const hasRelevantAbilities = [ Abilities.QUICK_FEET, Abilities.GUTS, Abilities.MARVEL_SCALE, Abilities.TOXIC_BOOST, Abilities.POISON_HEAL, Abilities.MAGIC_GUARD ]
|
||||
.some(a => p.hasAbility(a, false, true));
|
||||
|
||||
if (!isHoldingOrb) {
|
||||
const moveset = p.getMoveset(true).filter(m => !isNullOrUndefined(m)).map(m => m.moveId);
|
||||
const canSetStatus = p.canSetStatus(StatusEffect.TOXIC, true, true, null, true);
|
||||
|
||||
// Moves that take advantage of obtaining the actual status effect
|
||||
const hasStatusMoves = [ Moves.FACADE, Moves.PSYCHO_SHIFT ]
|
||||
.some(m => moveset.includes(m));
|
||||
// Moves that take advantage of being able to give the target a status orb
|
||||
// TODO: Take moves (Trick, Fling, Switcheroo) from comment when they are implemented
|
||||
const hasItemMoves = [ /* Moves.TRICK, Moves.FLING, Moves.SWITCHEROO */ ]
|
||||
.some(m => moveset.includes(m));
|
||||
|
||||
if (canSetStatus) {
|
||||
return hasRelevantAbilities || hasStatusMoves;
|
||||
// Abilities that take advantage of obtaining the actual status effect, separated based on specificity to the orb
|
||||
const hasGeneralAbility = [ Abilities.QUICK_FEET, Abilities.GUTS, Abilities.MARVEL_SCALE, Abilities.MAGIC_GUARD ]
|
||||
.some(a => p.hasAbility(a, false, true));
|
||||
const hasSpecificAbility = [ Abilities.TOXIC_BOOST, Abilities.POISON_HEAL ]
|
||||
.some(a => p.hasAbility(a, false, true));
|
||||
const hasOppositeAbility = [ Abilities.FLARE_BOOST ]
|
||||
.some(a => p.hasAbility(a, false, true));
|
||||
|
||||
return hasSpecificAbility || (hasGeneralAbility && !hasOppositeAbility) || hasStatusMoves;
|
||||
} else {
|
||||
return hasItemMoves;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}) ? 10 : 0;
|
||||
}, 10),
|
||||
new WeightedModifierType(modifierTypes.FLAME_ORB, (party: Pokemon[]) => {
|
||||
return party.some(p => {
|
||||
const moveset = p.getMoveset(true).filter(m => !isNullOrUndefined(m)).map(m => m.moveId);
|
||||
const canSetStatus = p.canSetStatus(StatusEffect.BURN, true, true, null, true);
|
||||
const isHoldingOrb = p.getHeldItems().some(i => i.type.id === "FLAME_ORB" || i.type.id === "TOXIC_ORB");
|
||||
|
||||
// Moves that take advantage of obtaining the actual status effect
|
||||
const hasStatusMoves = [ Moves.FACADE, Moves.PSYCHO_SHIFT ]
|
||||
.some(m => moveset.includes(m));
|
||||
// Moves that take advantage of being able to give the target a status orb
|
||||
// TODO: Take moves from comment they are implemented
|
||||
const hasItemMoves = [ /* Moves.TRICK, Moves.FLING, Moves.SWITCHEROO */ ]
|
||||
.some(m => moveset.includes(m));
|
||||
// Abilities that take advantage of obtaining the actual status effect
|
||||
const hasRelevantAbilities = [ Abilities.QUICK_FEET, Abilities.GUTS, Abilities.MARVEL_SCALE, Abilities.FLARE_BOOST, Abilities.MAGIC_GUARD ]
|
||||
.some(a => p.hasAbility(a, false, true));
|
||||
|
||||
if (!isHoldingOrb) {
|
||||
const moveset = p.getMoveset(true).filter(m => !isNullOrUndefined(m)).map(m => m.moveId);
|
||||
const canSetStatus = p.canSetStatus(StatusEffect.TOXIC, true, true, null, true);
|
||||
|
||||
// Moves that take advantage of obtaining the actual status effect
|
||||
const hasStatusMoves = [ Moves.FACADE, Moves.PSYCHO_SHIFT ]
|
||||
.some(m => moveset.includes(m));
|
||||
// Moves that take advantage of being able to give the target a status orb
|
||||
// TODO: Take moves (Trick, Fling, Switcheroo) from comment when they are implemented
|
||||
const hasItemMoves = [ /* Moves.TRICK, Moves.FLING, Moves.SWITCHEROO */ ]
|
||||
.some(m => moveset.includes(m));
|
||||
|
||||
if (canSetStatus) {
|
||||
return hasRelevantAbilities || hasStatusMoves;
|
||||
// Abilities that take advantage of obtaining the actual status effect, separated based on specificity to the orb
|
||||
const hasGeneralAbility = [ Abilities.QUICK_FEET, Abilities.GUTS, Abilities.MARVEL_SCALE, Abilities.MAGIC_GUARD ]
|
||||
.some(a => p.hasAbility(a, false, true));
|
||||
const hasSpecificAbility = [ Abilities.FLARE_BOOST ]
|
||||
.some(a => p.hasAbility(a, false, true));
|
||||
const hasOppositeAbility = [ Abilities.TOXIC_BOOST, Abilities.POISON_HEAL ]
|
||||
.some(a => p.hasAbility(a, false, true));
|
||||
|
||||
return hasSpecificAbility || (hasGeneralAbility && !hasOppositeAbility) || hasStatusMoves;
|
||||
} else {
|
||||
return hasItemMoves;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}) ? 10 : 0;
|
||||
}, 10),
|
||||
@ -1843,7 +1857,7 @@ const modifierPool: ModifierPool = {
|
||||
new WeightedModifierType(modifierTypes.BATON, 2),
|
||||
new WeightedModifierType(modifierTypes.SOUL_DEW, 7),
|
||||
//new WeightedModifierType(modifierTypes.OVAL_CHARM, 6),
|
||||
new WeightedModifierType(modifierTypes.CATCHING_CHARM, (party: Pokemon[]) => !party[0].scene.gameMode.isFreshStartChallenge() && party[0].scene.gameData.getSpeciesCount(d => !!d.caughtAttr) > 100 ? 4 : 0, 4),
|
||||
new WeightedModifierType(modifierTypes.CATCHING_CHARM, (party: Pokemon[]) => party[0].scene.gameMode.isDaily || (!party[0].scene.gameMode.isFreshStartChallenge() && party[0].scene.gameData.getSpeciesCount(d => !!d.caughtAttr) > 100) ? 4 : 0, 4),
|
||||
new WeightedModifierType(modifierTypes.ABILITY_CHARM, skipInClassicAfterWave(189, 6)),
|
||||
new WeightedModifierType(modifierTypes.FOCUS_BAND, 5),
|
||||
new WeightedModifierType(modifierTypes.KINGS_ROCK, 3),
|
||||
|
71
src/test/moves/defog.test.ts
Normal file
71
src/test/moves/defog.test.ts
Normal file
@ -0,0 +1,71 @@
|
||||
import { Stat } from "#enums/stat";
|
||||
import { Abilities } from "#enums/abilities";
|
||||
import { Moves } from "#enums/moves";
|
||||
import { Species } from "#enums/species";
|
||||
import GameManager from "#test/utils/gameManager";
|
||||
import Phaser from "phaser";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
|
||||
|
||||
describe("Moves - Defog", () => {
|
||||
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.MIST, Moves.SAFEGUARD, Moves.SPLASH ])
|
||||
.ability(Abilities.BALL_FETCH)
|
||||
.battleType("single")
|
||||
.disableCrits()
|
||||
.enemySpecies(Species.SHUCKLE)
|
||||
.enemyAbility(Abilities.BALL_FETCH)
|
||||
.enemyMoveset([ Moves.DEFOG, Moves.GROWL ]);
|
||||
});
|
||||
|
||||
it("should not allow Safeguard to be active", async () => {
|
||||
await game.classicMode.startBattle([ Species.REGIELEKI ]);
|
||||
|
||||
const playerPokemon = game.scene.getPlayerField();
|
||||
const enemyPokemon = game.scene.getEnemyField();
|
||||
|
||||
game.move.select(Moves.SAFEGUARD);
|
||||
await game.forceEnemyMove(Moves.DEFOG);
|
||||
await game.phaseInterceptor.to("BerryPhase");
|
||||
|
||||
expect(playerPokemon[0].isSafeguarded(enemyPokemon[0])).toBe(false);
|
||||
|
||||
|
||||
expect(true).toBe(true);
|
||||
});
|
||||
|
||||
|
||||
it("should not allow Mist to be active", async () => {
|
||||
await game.classicMode.startBattle([ Species.REGIELEKI ]);
|
||||
|
||||
const playerPokemon = game.scene.getPlayerField();
|
||||
|
||||
game.move.select(Moves.MIST);
|
||||
await game.forceEnemyMove(Moves.DEFOG);
|
||||
|
||||
await game.toNextTurn();
|
||||
|
||||
game.move.select(Moves.SPLASH);
|
||||
await game.forceEnemyMove(Moves.GROWL);
|
||||
|
||||
await game.phaseInterceptor.to("BerryPhase");
|
||||
|
||||
expect(playerPokemon[0].getStatStage(Stat.ATK)).toBe(-1);
|
||||
|
||||
expect(true).toBe(true);
|
||||
});
|
||||
});
|
Loading…
Reference in New Issue
Block a user