Merge branch 'fixscaleshottest' of github.com:Fontbane/pokerogue into fixscaleshottest

This commit is contained in:
AJ Fontaine 2024-10-04 11:38:42 -04:00
commit af228e43df
411 changed files with 4335 additions and 4306 deletions

View File

@ -41,6 +41,11 @@ export default [
"keyword-spacing": ["error", { "before": true, "after": true }], // Enforces spacing before and after keywords
"comma-spacing": ["error", { "before": false, "after": true }], // Enforces spacing after comma
"import-x/extensions": ["error", "never", { "json": "always" }], // Enforces no extension for imports unless json
"array-bracket-spacing": ["error", "always", { "objectsInArrays": false, "arraysInArrays": false }], // Enforces consistent spacing inside array brackets
"object-curly-spacing": ["error", "always", { "arraysInObjects": false, "objectsInObjects": false }], // Enforces consistent spacing inside braces of object literals, destructuring assignments, and import/export specifiers
"computed-property-spacing": ["error", "never" ], // Enforces consistent spacing inside computed property brackets
"space-infix-ops": ["error", { "int32Hint": false }], // Enforces spacing around infix operators
"no-multiple-empty-lines": ["error", { "max": 2, "maxEOF": 1, "maxBOF": 0 }], // Disallows multiple empty lines
}
}
]

View File

@ -889,6 +889,9 @@ export default class BattleScene extends SceneBase {
}
const pokemon = new EnemyPokemon(this, species, level, trainerSlot, boss, dataSource);
if (Overrides.OPP_FUSION_OVERRIDE) {
pokemon.generateFusionSpecies();
}
overrideModifiers(this, false);
overrideHeldItems(this, pokemon, false);

View File

@ -1033,4 +1033,3 @@ export class WeightRequirement extends EncounterPokemonRequirement {
}
}

View File

@ -484,6 +484,8 @@ export abstract class PokemonSpeciesForm {
frameRate: 12,
repeat: -1
});
} else {
scene.anims.get(spriteKey).frameRate = 12;
}
let spritePath = this.getSpriteAtlasPath(female, formIndex, shiny, variant).replace("variant/", "").replace(/_[1-3]$/, "");
const useExpSprite = scene.experimentalSprites && scene.hasExpSprite(spriteKey);

View File

@ -1,4 +1,3 @@
export enum ArenaTagType {
NONE = "NONE",
MUD_SPORT = "MUD_SPORT",

View File

@ -1,4 +1,3 @@
export enum BattlerTagType {
NONE = "NONE",
RECHARGING = "RECHARGING",

View File

@ -1,4 +1,3 @@
export enum BerryType {
SITRUS,
LUM,

View File

@ -1,4 +1,3 @@
export enum Biome {
TOWN,
PLAINS,

View File

@ -1,4 +1,3 @@
export enum TimeOfDay {
ALL = -1,
DAWN,

View File

@ -1531,7 +1531,6 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
}
/**
* Calculates the effectiveness of a move against the Pokémon.
* This includes modifiers from move and ability attributes.
@ -1965,7 +1964,15 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
&& species.speciesId !== this.species.speciesId;
};
this.fusionSpecies = this.scene.randomSpecies(this.scene.currentBattle?.waveIndex || 0, this.level, false, filter, true);
let fusionOverride: PokemonSpecies | undefined = undefined;
if (forStarter && this instanceof PlayerPokemon && Overrides.STARTER_FUSION_SPECIES_OVERRIDE) {
fusionOverride = getPokemonSpecies(Overrides.STARTER_FUSION_SPECIES_OVERRIDE);
} else if (this instanceof EnemyPokemon && Overrides.OPP_FUSION_SPECIES_OVERRIDE) {
fusionOverride = getPokemonSpecies(Overrides.OPP_FUSION_SPECIES_OVERRIDE);
}
this.fusionSpecies = fusionOverride ?? this.scene.randomSpecies(this.scene.currentBattle?.waveIndex || 0, this.level, false, filter, true);
this.fusionAbilityIndex = (this.fusionSpecies.abilityHidden && hasHiddenAbility ? 2 : this.fusionSpecies.ability2 !== this.fusionSpecies.ability1 ? randAbilityIndex : 0);
this.fusionShiny = this.shiny;
this.fusionVariant = this.variant;

View File

@ -100,6 +100,14 @@ class DefaultOverrides {
* @example SPECIES_OVERRIDE = Species.Bulbasaur;
*/
readonly STARTER_SPECIES_OVERRIDE: Species | number = 0;
/**
* This will force your starter to be a random fusion
*/
readonly STARTER_FUSION_OVERRIDE: boolean = false;
/**
* This will override the species of the fusion
*/
readonly STARTER_FUSION_SPECIES_OVERRIDE: Species | integer = 0;
readonly ABILITY_OVERRIDE: Abilities = Abilities.NONE;
readonly PASSIVE_ABILITY_OVERRIDE: Abilities = Abilities.NONE;
readonly STATUS_OVERRIDE: StatusEffect = StatusEffect.NONE;
@ -112,6 +120,14 @@ class DefaultOverrides {
// OPPONENT / ENEMY OVERRIDES
// --------------------------
readonly OPP_SPECIES_OVERRIDE: Species | number = 0;
/**
* This will make all opponents fused Pokemon
*/
readonly OPP_FUSION_OVERRIDE: boolean = false;
/**
* This will override the species of the fusion only when the opponent is already a fusion
*/
readonly OPP_FUSION_SPECIES_OVERRIDE: Species | integer = 0;
readonly OPP_LEVEL_OVERRIDE: number = 0;
readonly OPP_ABILITY_OVERRIDE: Abilities = Abilities.NONE;
readonly OPP_PASSIVE_ABILITY_OVERRIDE: Abilities = Abilities.NONE;

View File

@ -407,7 +407,7 @@ export class MoveEffectPhase extends PokemonPhase {
const semiInvulnerableTag = target.getTag(SemiInvulnerableTag);
if (semiInvulnerableTag
&& !this.move.getMove().getAttrs(HitsTagAttr).some(hta => hta.tagType === semiInvulnerableTag.tagType)
&& !(this.move.getMove().getAttrs(ToxicAccuracyAttr) && user.isOfType(Type.POISON))
&& !(this.move.getMove().hasAttr(ToxicAccuracyAttr) && user.isOfType(Type.POISON))
) {
return false;
}

View File

@ -5,7 +5,6 @@ import Pokemon from "#app/field/pokemon";
import { BattlePhase } from "#app/phases/battle-phase";
export class PokemonAnimPhase extends BattlePhase {
/** The type of animation to play in this phase */
private key: PokemonAnimType;

View File

@ -80,7 +80,7 @@ export class SelectStarterPhase extends Phase {
starterPokemon.nickname = starter.nickname;
}
if (this.scene.gameMode.isSplicedOnly) {
if (this.scene.gameMode.isSplicedOnly || Overrides.STARTER_FUSION_OVERRIDE) {
starterPokemon.generateFusionSpecies(true);
}
starterPokemon.setVisible(false);

View File

@ -8,7 +8,6 @@ import GameManager from "#test/utils/gameManager";
import { afterEach, beforeAll, beforeEach, describe, expect, test } from "vitest";
describe("Abilities - BATTLE BOND", () => {
let phaserGame: Phaser.Game;
let game: GameManager;

View File

@ -9,7 +9,6 @@ import Phaser from "phaser";
import { afterEach, beforeAll, beforeEach, describe, expect, test } from "vitest";
describe("Abilities - COSTAR", () => {
let phaserGame: Phaser.Game;
let game: GameManager;

View File

@ -8,7 +8,6 @@ import Phaser from "phaser";
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
describe("Abilities - Dancer", () => {
let phaserGame: Phaser.Game;
let game: GameManager;

View File

@ -8,7 +8,6 @@ import GameManager from "#test/utils/gameManager";
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
describe("Abilities - Disguise", () => {
let phaserGame: Phaser.Game;
let game: GameManager;

View File

@ -10,7 +10,6 @@ import Phaser from "phaser";
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
describe("Abilities - Galvanize", () => {
let phaserGame: Phaser.Game;
let game: GameManager;

View File

@ -13,7 +13,6 @@ import Phaser from "phaser";
import { afterEach, beforeAll, beforeEach, describe, expect, test, vi } from "vitest";
describe("Abilities - Libero", () => {
let phaserGame: Phaser.Game;
let game: GameManager;

View File

@ -11,7 +11,6 @@ import Phaser from "phaser";
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
describe("Abilities - Parental Bond", () => {
let phaserGame: Phaser.Game;
let game: GameManager;

View File

@ -8,7 +8,6 @@ import GameManager from "#test/utils/gameManager";
import { afterEach, beforeAll, beforeEach, describe, expect, test } from "vitest";
describe("Abilities - POWER CONSTRUCT", () => {
let phaserGame: Phaser.Game;
let game: GameManager;

View File

@ -13,7 +13,6 @@ import Phaser from "phaser";
import { afterEach, beforeAll, beforeEach, describe, expect, test, vi } from "vitest";
describe("Abilities - Protean", () => {
let phaserGame: Phaser.Game;
let game: GameManager;

View File

@ -12,7 +12,6 @@ import Phaser from "phaser";
import { afterEach, beforeAll, beforeEach, describe, expect, test, vi } from "vitest";
describe("Abilities - Sand Veil", () => {
let phaserGame: Phaser.Game;
let game: GameManager;

View File

@ -8,7 +8,6 @@ import GameManager from "#test/utils/gameManager";
import { afterEach, beforeAll, beforeEach, describe, expect, test } from "vitest";
describe("Abilities - SCHOOLING", () => {
let phaserGame: Phaser.Game;
let game: GameManager;

View File

@ -8,7 +8,6 @@ import GameManager from "#test/utils/gameManager";
import { afterEach, beforeAll, beforeEach, describe, expect, test } from "vitest";
describe("Abilities - SHIELDS DOWN", () => {
let phaserGame: Phaser.Game;
let game: GameManager;

View File

@ -9,7 +9,6 @@ import Phaser from "phaser";
import { afterEach, beforeAll, beforeEach, describe, expect, test } from "vitest";
describe("Abilities - Sturdy", () => {
let phaserGame: Phaser.Game;
let game: GameManager;

View File

@ -9,7 +9,6 @@ import { BattlerTagType } from "#app/enums/battler-tag-type";
import { BerryPhase } from "#app/phases/berry-phase";
describe("Abilities - Unseen Fist", () => {
let phaserGame: Phaser.Game;
let game: GameManager;

View File

@ -21,7 +21,6 @@ import { Status, StatusEffect } from "#app/data/status-effect";
import { SwitchType } from "#enums/switch-type";
describe("Abilities - ZEN MODE", () => {
let phaserGame: Phaser.Game;
let game: GameManager;

View File

@ -8,7 +8,6 @@ import GameManager from "#test/utils/gameManager";
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
describe("Abilities - ZERO TO HERO", () => {
let phaserGame: Phaser.Game;
let game: GameManager;

View File

@ -11,7 +11,6 @@ import Phaser from "phaser";
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
describe("Inverse Battle", () => {
let phaserGame: Phaser.Game;
let game: GameManager;

View File

@ -9,7 +9,6 @@ import Phaser from "phaser";
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
describe("Moves - After You", () => {
let phaserGame: Phaser.Game;
let game: GameManager;

View File

@ -9,7 +9,6 @@ import Phaser from "phaser";
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
describe("Moves - Alluring Voice", () => {
let phaserGame: Phaser.Game;
let game: GameManager;

View File

@ -12,7 +12,6 @@ import Phaser from "phaser";
import { afterEach, beforeAll, beforeEach, describe, expect, test, vi } from "vitest";
describe("Moves - Astonish", () => {
let phaserGame: Phaser.Game;
let game: GameManager;

View File

@ -8,7 +8,6 @@ import { BattlerIndex } from "#app/battle";
import { StatusEffect } from "#app/enums/status-effect";
describe("Moves - Baneful Bunker", () => {
let phaserGame: Phaser.Game;
let game: GameManager;

View File

@ -11,7 +11,6 @@ import Phaser from "phaser";
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
describe("Moves - Beak Blast", () => {
let phaserGame: Phaser.Game;
let game: GameManager;

View File

@ -9,7 +9,6 @@ import Phaser from "phaser";
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
describe("Moves - Burning Jealousy", () => {
let phaserGame: Phaser.Game;
let game: GameManager;

View File

@ -11,7 +11,6 @@ import Phaser from "phaser";
import { afterEach, beforeAll, beforeEach, describe, expect, test, vi } from "vitest";
describe("Moves - Ceaseless Edge", () => {
let phaserGame: Phaser.Game;
let game: GameManager;

View File

@ -10,7 +10,6 @@ import { BerryPhase } from "#app/phases/berry-phase";
import { CommandPhase } from "#app/phases/command-phase";
describe("Moves - Crafty Shield", () => {
let phaserGame: Phaser.Game;
let game: GameManager;

View File

@ -11,7 +11,6 @@ import Phaser from "phaser";
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
describe("Moves - Focus Punch", () => {
let phaserGame: Phaser.Game;
let game: GameManager;

View File

@ -9,7 +9,6 @@ import Phaser from "phaser";
import { afterEach, beforeAll, beforeEach, describe, expect, test } from "vitest";
describe("Moves - Follow Me", () => {
let phaserGame: Phaser.Game;
let game: GameManager;

View File

@ -7,7 +7,6 @@ import GameManager from "#test/utils/gameManager";
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
describe("Moves - Gastro Acid", () => {
let phaserGame: Phaser.Game;
let game: GameManager;

View File

@ -7,7 +7,6 @@ import Phaser from "phaser";
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
describe("Moves - Glaive Rush", () => {
let phaserGame: Phaser.Game;
let game: GameManager;

View File

@ -12,7 +12,6 @@ import Phaser from "phaser";
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
describe("Moves - Jaw Lock", () => {
let phaserGame: Phaser.Game;
let game: GameManager;

View File

@ -8,7 +8,6 @@ import Phaser from "phaser";
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
describe("Moves - Lash Out", () => {
let phaserGame: Phaser.Game;
let game: GameManager;

View File

@ -8,7 +8,6 @@ import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
import GameManager from "../utils/gameManager";
describe("Moves - Lucky Chant", () => {
let phaserGame: Phaser.Game;
let game: GameManager;

View File

@ -9,7 +9,6 @@ import { MoveEndPhase } from "#app/phases/move-end-phase";
import { StatStageChangePhase } from "#app/phases/stat-stage-change-phase";
describe("Moves - Make It Rain", () => {
let phaserGame: Phaser.Game;
let game: GameManager;

View File

@ -10,7 +10,6 @@ import { CommandPhase } from "#app/phases/command-phase";
import { TurnEndPhase } from "#app/phases/turn-end-phase";
describe("Moves - Mat Block", () => {
let phaserGame: Phaser.Game;
let game: GameManager;

View File

@ -8,7 +8,6 @@ import Phaser from "phaser";
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
describe("Multi-target damage reduction", () => {
let phaserGame: Phaser.Game;
let game: GameManager;

View File

@ -11,7 +11,6 @@ import { MessagePhase } from "#app/phases/message-phase";
import { TurnInitPhase } from "#app/phases/turn-init-phase";
describe("Moves - Parting Shot", () => {
let phaserGame: Phaser.Game;
let game: GameManager;

View File

@ -11,7 +11,6 @@ import { BattlerIndex } from "#app/battle";
import { MoveResult } from "#app/field/pokemon";
describe("Moves - Protect", () => {
let phaserGame: Phaser.Game;
let game: GameManager;

View File

@ -9,7 +9,6 @@ import Phaser from "phaser";
import { afterEach, beforeAll, beforeEach, describe, expect, test } from "vitest";
describe("Moves - Purify", () => {
let phaserGame: Phaser.Game;
let game: GameManager;

View File

@ -9,7 +9,6 @@ import { BattlerIndex } from "#app/battle";
import { MoveResult } from "#app/field/pokemon";
describe("Moves - Quick Guard", () => {
let phaserGame: Phaser.Game;
let game: GameManager;

View File

@ -7,7 +7,6 @@ import Phaser from "phaser";
import { afterEach, beforeAll, beforeEach, describe, expect, test } from "vitest";
describe("Moves - Rage Powder", () => {
let phaserGame: Phaser.Game;
let game: GameManager;

View File

@ -10,7 +10,6 @@ import Phaser from "phaser";
import { afterEach, beforeAll, beforeEach, describe, expect, test } from "vitest";
describe("Moves - Roost", () => {
let phaserGame: Phaser.Game;
let game: GameManager;

View File

@ -9,7 +9,6 @@ import Phaser from "phaser";
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
describe("Moves - Safeguard", () => {
let phaserGame: Phaser.Game;
let game: GameManager;

View File

@ -11,7 +11,6 @@ import Phaser from "phaser";
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
describe("Moves - Shell Trap", () => {
let phaserGame: Phaser.Game;
let game: GameManager;

View File

@ -7,7 +7,6 @@ import Phaser from "phaser";
import { afterEach, beforeAll, beforeEach, describe, expect, test } from "vitest";
describe("Moves - Spotlight", () => {
let phaserGame: Phaser.Game;
let game: GameManager;

View File

@ -9,7 +9,6 @@ import Phaser from "phaser";
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
describe("Moves - Thousand Arrows", () => {
let phaserGame: Phaser.Game;
let game: GameManager;

View File

@ -8,7 +8,6 @@ import Phaser from "phaser";
import { afterEach, beforeAll, beforeEach, describe, expect, it } from "vitest";
describe("Moves - Thunder Wave", () => {
let phaserGame: Phaser.Game;
let game: GameManager;

View File

@ -73,4 +73,17 @@ describe("Moves - Toxic", () => {
expect(game.scene.getEnemyPokemon()!.status).toBeUndefined();
});
it("moves other than Toxic should not hit semi-invulnerable targets even if user is Poison-type", async () => {
game.override.moveset(Moves.SWIFT);
game.override.enemyMoveset(Moves.FLY);
await game.classicMode.startBattle([ Species.TOXAPEX ]);
game.move.select(Moves.SWIFT);
await game.setTurnOrder([ BattlerIndex.ENEMY, BattlerIndex.PLAYER ]);
await game.phaseInterceptor.to("BerryPhase", false);
const enemyPokemon = game.scene.getEnemyPokemon()!;
expect(enemyPokemon.hp).toBe(enemyPokemon.getMaxHp());
});
});

View File

@ -9,7 +9,6 @@ import { BerryPhase } from "#app/phases/berry-phase";
import { CommandPhase } from "#app/phases/command-phase";
describe("Moves - Wide Guard", () => {
let phaserGame: Phaser.Game;
let game: GameManager;

View File

@ -85,6 +85,27 @@ export class OverridesHelper extends GameManagerHelper {
return this;
}
/**
* Override the player (pokemon) to be a random fusion
* @returns this
*/
enableStarterFusion(): this {
vi.spyOn(Overrides, "STARTER_FUSION_OVERRIDE", "get").mockReturnValue(true);
this.log("Player Pokemon is a random fusion!");
return this;
}
/**
* Override the player (pokemon) fusion species
* @param species the fusion species to set
* @returns this
*/
starterFusionSpecies(species: Species | number): this {
vi.spyOn(Overrides, "STARTER_FUSION_SPECIES_OVERRIDE", "get").mockReturnValue(species);
this.log(`Player Pokemon fusion species set to ${Species[species]} (=${species})!`);
return this;
}
/**
* Override the player (pokemons) forms
* @param forms the (pokemon) forms to set
@ -232,6 +253,27 @@ export class OverridesHelper extends GameManagerHelper {
return this;
}
/**
* Override the enemy (pokemon) to be a random fusion
* @returns this
*/
enableEnemyFusion(): this {
vi.spyOn(Overrides, "OPP_FUSION_OVERRIDE", "get").mockReturnValue(true);
this.log("Enemy Pokemon is a random fusion!");
return this;
}
/**
* Override the enemy (pokemon) fusion species
* @param species the fusion species to set
* @returns this
*/
enemyFusionSpecies(species: Species | number): this {
vi.spyOn(Overrides, "OPP_FUSION_SPECIES_OVERRIDE", "get").mockReturnValue(species);
this.log(`Enemy Pokemon fusion species set to ${Species[species]} (=${species})!`);
return this;
}
/**
* Override the enemy (pokemon) {@linkcode Abilities | ability}
* @param ability the (pokemon) {@linkcode Abilities | ability} to set

View File

@ -212,5 +212,4 @@ export default class MockSprite implements MockGameObject {
}
}

View File

@ -196,7 +196,6 @@ export class ArenaFlyout extends Phaser.GameObjects.Container {
}
/** Clears out the current string stored in all arena effect texts */
private clearText() {
this.flyoutTextPlayer.text = "";

View File

@ -6,7 +6,6 @@ export const TOUCH_CONTROL_POSITIONS_LANDSCAPE = "touchControlPositionsLandscape
export const TOUCH_CONTROL_POSITIONS_PORTRAIT = "touchControlPositionsPortrait";
type ControlPosition = { id: string, x: number, y: number };
type ConfigurationEventListeners = {

View File

@ -77,7 +77,6 @@ export default class SettingsKeyboardUiHandler extends AbstractControlSettingsUi
this.settingsContainer.add(deleteText);
// Map the 'noKeyboard' layout options for easy access.
this.layout["noKeyboard"].optionsContainer = optionsContainer;
this.layout["noKeyboard"].label = label;

View File

@ -2951,7 +2951,6 @@ export default class StarterSelectUiHandler extends MessageUiHandler {
}
setSpeciesDetails(species: PokemonSpecies, shiny?: boolean, formIndex?: integer, female?: boolean, variant?: Variant, abilityIndex?: integer, natureIndex?: integer, forSeen: boolean = false): void {
const oldProps = species ? this.scene.gameData.getSpeciesDexAttrProps(species, this.dexAttrCursor) : null;
const oldAbilityIndex = this.abilityCursor > -1 ? this.abilityCursor : this.scene.gameData.getStarterSpeciesDefaultAbilityIndex(species);