mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-18 13:29:25 +02:00
Merge 05584be564
into 0da37a0f0c
This commit is contained in:
commit
0afc4e5fe0
@ -81,7 +81,7 @@ For example, here is how you could test a scenario where the player Pokemon has
|
|||||||
```typescript
|
```typescript
|
||||||
const overrides = {
|
const overrides = {
|
||||||
ABILITY_OVERRIDE: AbilityId.DROUGHT,
|
ABILITY_OVERRIDE: AbilityId.DROUGHT,
|
||||||
OPP_MOVESET_OVERRIDE: MoveId.WATER_GUN,
|
ENEMY_MOVESET_OVERRIDE: MoveId.WATER_GUN,
|
||||||
} satisfies Partial<InstanceType<typeof DefaultOverrides>>;
|
} satisfies Partial<InstanceType<typeof DefaultOverrides>>;
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -943,17 +943,17 @@ export class BattleScene extends SceneBase {
|
|||||||
dataSource?: PokemonData,
|
dataSource?: PokemonData,
|
||||||
postProcess?: (enemyPokemon: EnemyPokemon) => void,
|
postProcess?: (enemyPokemon: EnemyPokemon) => void,
|
||||||
): EnemyPokemon {
|
): EnemyPokemon {
|
||||||
if (Overrides.OPP_LEVEL_OVERRIDE > 0) {
|
if (Overrides.ENEMY_LEVEL_OVERRIDE > 0) {
|
||||||
level = Overrides.OPP_LEVEL_OVERRIDE;
|
level = Overrides.ENEMY_LEVEL_OVERRIDE;
|
||||||
}
|
}
|
||||||
if (Overrides.OPP_SPECIES_OVERRIDE) {
|
if (Overrides.ENEMY_SPECIES_OVERRIDE) {
|
||||||
species = getPokemonSpecies(Overrides.OPP_SPECIES_OVERRIDE);
|
species = getPokemonSpecies(Overrides.ENEMY_SPECIES_OVERRIDE);
|
||||||
// The fact that a Pokemon is a boss or not can change based on its Species and level
|
// The fact that a Pokemon is a boss or not can change based on its Species and level
|
||||||
boss = this.getEncounterBossSegments(this.currentBattle.waveIndex, level, species) > 1;
|
boss = this.getEncounterBossSegments(this.currentBattle.waveIndex, level, species) > 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
const pokemon = new EnemyPokemon(species, level, trainerSlot, boss, shinyLock, dataSource);
|
const pokemon = new EnemyPokemon(species, level, trainerSlot, boss, shinyLock, dataSource);
|
||||||
if (Overrides.OPP_FUSION_OVERRIDE) {
|
if (Overrides.ENEMY_FUSION_OVERRIDE) {
|
||||||
pokemon.generateFusionSpecies();
|
pokemon.generateFusionSpecies();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1764,10 +1764,10 @@ export class BattleScene extends SceneBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getEncounterBossSegments(waveIndex: number, level: number, species?: PokemonSpecies, forceBoss = false): number {
|
getEncounterBossSegments(waveIndex: number, level: number, species?: PokemonSpecies, forceBoss = false): number {
|
||||||
if (Overrides.OPP_HEALTH_SEGMENTS_OVERRIDE > 1) {
|
if (Overrides.ENEMY_HEALTH_SEGMENTS_OVERRIDE > 1) {
|
||||||
return Overrides.OPP_HEALTH_SEGMENTS_OVERRIDE;
|
return Overrides.ENEMY_HEALTH_SEGMENTS_OVERRIDE;
|
||||||
}
|
}
|
||||||
if (Overrides.OPP_HEALTH_SEGMENTS_OVERRIDE === 1) {
|
if (Overrides.ENEMY_HEALTH_SEGMENTS_OVERRIDE === 1) {
|
||||||
// The rest of the code expects to be returned 0 and not 1 if the enemy is not a boss
|
// The rest of the code expects to be returned 0 and not 1 if the enemy is not a boss
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -1825,7 +1825,7 @@ export abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
// Overrides moveset based on arrays specified in overrides.ts
|
// Overrides moveset based on arrays specified in overrides.ts
|
||||||
let overrideArray: MoveId | Array<MoveId> = this.isPlayer()
|
let overrideArray: MoveId | Array<MoveId> = this.isPlayer()
|
||||||
? Overrides.MOVESET_OVERRIDE
|
? Overrides.MOVESET_OVERRIDE
|
||||||
: Overrides.OPP_MOVESET_OVERRIDE;
|
: Overrides.ENEMY_MOVESET_OVERRIDE;
|
||||||
overrideArray = coerceArray(overrideArray);
|
overrideArray = coerceArray(overrideArray);
|
||||||
if (overrideArray.length > 0) {
|
if (overrideArray.length > 0) {
|
||||||
if (!this.isPlayer()) {
|
if (!this.isPlayer()) {
|
||||||
@ -2030,8 +2030,8 @@ export abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
if (Overrides.ABILITY_OVERRIDE && this.isPlayer()) {
|
if (Overrides.ABILITY_OVERRIDE && this.isPlayer()) {
|
||||||
return allAbilities[Overrides.ABILITY_OVERRIDE];
|
return allAbilities[Overrides.ABILITY_OVERRIDE];
|
||||||
}
|
}
|
||||||
if (Overrides.OPP_ABILITY_OVERRIDE && this.isEnemy()) {
|
if (Overrides.ENEMY_ABILITY_OVERRIDE && this.isEnemy()) {
|
||||||
return allAbilities[Overrides.OPP_ABILITY_OVERRIDE];
|
return allAbilities[Overrides.ENEMY_ABILITY_OVERRIDE];
|
||||||
}
|
}
|
||||||
if (this.isFusion()) {
|
if (this.isFusion()) {
|
||||||
if (!isNullOrUndefined(this.fusionCustomPokemonData?.ability) && this.fusionCustomPokemonData.ability !== -1) {
|
if (!isNullOrUndefined(this.fusionCustomPokemonData?.ability) && this.fusionCustomPokemonData.ability !== -1) {
|
||||||
@ -2060,8 +2060,8 @@ export abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
if (Overrides.PASSIVE_ABILITY_OVERRIDE && this.isPlayer()) {
|
if (Overrides.PASSIVE_ABILITY_OVERRIDE && this.isPlayer()) {
|
||||||
return allAbilities[Overrides.PASSIVE_ABILITY_OVERRIDE];
|
return allAbilities[Overrides.PASSIVE_ABILITY_OVERRIDE];
|
||||||
}
|
}
|
||||||
if (Overrides.OPP_PASSIVE_ABILITY_OVERRIDE && this.isEnemy()) {
|
if (Overrides.ENEMY_PASSIVE_ABILITY_OVERRIDE && this.isEnemy()) {
|
||||||
return allAbilities[Overrides.OPP_PASSIVE_ABILITY_OVERRIDE];
|
return allAbilities[Overrides.ENEMY_PASSIVE_ABILITY_OVERRIDE];
|
||||||
}
|
}
|
||||||
if (!isNullOrUndefined(this.customPokemonData.passive) && this.customPokemonData.passive !== -1) {
|
if (!isNullOrUndefined(this.customPokemonData.passive) && this.customPokemonData.passive !== -1) {
|
||||||
return allAbilities[this.customPokemonData.passive];
|
return allAbilities[this.customPokemonData.passive];
|
||||||
@ -2128,14 +2128,14 @@ export abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
// returns override if valid for current case
|
// returns override if valid for current case
|
||||||
if (
|
if (
|
||||||
(Overrides.HAS_PASSIVE_ABILITY_OVERRIDE === false && this.isPlayer()) ||
|
(Overrides.HAS_PASSIVE_ABILITY_OVERRIDE === false && this.isPlayer()) ||
|
||||||
(Overrides.OPP_HAS_PASSIVE_ABILITY_OVERRIDE === false && this.isEnemy())
|
(Overrides.ENEMY_HAS_PASSIVE_ABILITY_OVERRIDE === false && this.isEnemy())
|
||||||
) {
|
) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (
|
if (
|
||||||
((Overrides.PASSIVE_ABILITY_OVERRIDE !== AbilityId.NONE || Overrides.HAS_PASSIVE_ABILITY_OVERRIDE) &&
|
((Overrides.PASSIVE_ABILITY_OVERRIDE !== AbilityId.NONE || Overrides.HAS_PASSIVE_ABILITY_OVERRIDE) &&
|
||||||
this.isPlayer()) ||
|
this.isPlayer()) ||
|
||||||
((Overrides.OPP_PASSIVE_ABILITY_OVERRIDE !== AbilityId.NONE || Overrides.OPP_HAS_PASSIVE_ABILITY_OVERRIDE) &&
|
((Overrides.ENEMY_PASSIVE_ABILITY_OVERRIDE !== AbilityId.NONE || Overrides.ENEMY_HAS_PASSIVE_ABILITY_OVERRIDE) &&
|
||||||
this.isEnemy())
|
this.isEnemy())
|
||||||
) {
|
) {
|
||||||
return true;
|
return true;
|
||||||
@ -3001,8 +3001,8 @@ export abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
|
|
||||||
if (forStarter && this.isPlayer() && Overrides.STARTER_FUSION_SPECIES_OVERRIDE) {
|
if (forStarter && this.isPlayer() && Overrides.STARTER_FUSION_SPECIES_OVERRIDE) {
|
||||||
fusionOverride = getPokemonSpecies(Overrides.STARTER_FUSION_SPECIES_OVERRIDE);
|
fusionOverride = getPokemonSpecies(Overrides.STARTER_FUSION_SPECIES_OVERRIDE);
|
||||||
} else if (this.isEnemy() && Overrides.OPP_FUSION_SPECIES_OVERRIDE) {
|
} else if (this.isEnemy() && Overrides.ENEMY_FUSION_SPECIES_OVERRIDE) {
|
||||||
fusionOverride = getPokemonSpecies(Overrides.OPP_FUSION_SPECIES_OVERRIDE);
|
fusionOverride = getPokemonSpecies(Overrides.ENEMY_FUSION_SPECIES_OVERRIDE);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.fusionSpecies =
|
this.fusionSpecies =
|
||||||
@ -6241,22 +6241,22 @@ export class EnemyPokemon extends Pokemon {
|
|||||||
this.setBoss(boss, dataSource?.bossSegments);
|
this.setBoss(boss, dataSource?.bossSegments);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Overrides.OPP_STATUS_OVERRIDE) {
|
if (Overrides.ENEMY_STATUS_OVERRIDE) {
|
||||||
this.status = new Status(Overrides.OPP_STATUS_OVERRIDE, 0, 4);
|
this.status = new Status(Overrides.ENEMY_STATUS_OVERRIDE, 0, 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Overrides.OPP_GENDER_OVERRIDE !== null) {
|
if (Overrides.ENEMY_GENDER_OVERRIDE !== null) {
|
||||||
this.gender = Overrides.OPP_GENDER_OVERRIDE;
|
this.gender = Overrides.ENEMY_GENDER_OVERRIDE;
|
||||||
}
|
}
|
||||||
|
|
||||||
const speciesId = this.species.speciesId;
|
const speciesId = this.species.speciesId;
|
||||||
|
|
||||||
if (
|
if (
|
||||||
speciesId in Overrides.OPP_FORM_OVERRIDES &&
|
speciesId in Overrides.ENEMY_FORM_OVERRIDES &&
|
||||||
!isNullOrUndefined(Overrides.OPP_FORM_OVERRIDES[speciesId]) &&
|
!isNullOrUndefined(Overrides.ENEMY_FORM_OVERRIDES[speciesId]) &&
|
||||||
this.species.forms[Overrides.OPP_FORM_OVERRIDES[speciesId]]
|
this.species.forms[Overrides.ENEMY_FORM_OVERRIDES[speciesId]]
|
||||||
) {
|
) {
|
||||||
this.formIndex = Overrides.OPP_FORM_OVERRIDES[speciesId];
|
this.formIndex = Overrides.ENEMY_FORM_OVERRIDES[speciesId];
|
||||||
} else if (globalScene.gameMode.isDaily && globalScene.gameMode.isWaveFinal(globalScene.currentBattle.waveIndex)) {
|
} else if (globalScene.gameMode.isDaily && globalScene.gameMode.isWaveFinal(globalScene.currentBattle.waveIndex)) {
|
||||||
const eventBoss = getDailyEventSeedBoss(globalScene.seed);
|
const eventBoss = getDailyEventSeedBoss(globalScene.seed);
|
||||||
if (!isNullOrUndefined(eventBoss)) {
|
if (!isNullOrUndefined(eventBoss)) {
|
||||||
@ -6266,21 +6266,21 @@ export class EnemyPokemon extends Pokemon {
|
|||||||
|
|
||||||
if (!dataSource) {
|
if (!dataSource) {
|
||||||
this.generateAndPopulateMoveset();
|
this.generateAndPopulateMoveset();
|
||||||
if (shinyLock || Overrides.OPP_SHINY_OVERRIDE === false) {
|
if (shinyLock || Overrides.ENEMY_SHINY_OVERRIDE === false) {
|
||||||
this.shiny = false;
|
this.shiny = false;
|
||||||
} else {
|
} else {
|
||||||
this.trySetShiny();
|
this.trySetShiny();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this.shiny && Overrides.OPP_SHINY_OVERRIDE) {
|
if (!this.shiny && Overrides.ENEMY_SHINY_OVERRIDE) {
|
||||||
this.shiny = true;
|
this.shiny = true;
|
||||||
this.initShinySparkle();
|
this.initShinySparkle();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.shiny) {
|
if (this.shiny) {
|
||||||
this.variant = this.generateShinyVariant();
|
this.variant = this.generateShinyVariant();
|
||||||
if (Overrides.OPP_VARIANT_OVERRIDE !== null) {
|
if (Overrides.ENEMY_VARIANT_OVERRIDE !== null) {
|
||||||
this.variant = Overrides.OPP_VARIANT_OVERRIDE;
|
this.variant = Overrides.ENEMY_VARIANT_OVERRIDE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3755,7 +3755,7 @@ export class EnemyFusionChanceModifier extends EnemyPersistentModifier {
|
|||||||
export function overrideModifiers(isPlayer = true): void {
|
export function overrideModifiers(isPlayer = true): void {
|
||||||
const modifiersOverride: ModifierOverride[] = isPlayer
|
const modifiersOverride: ModifierOverride[] = isPlayer
|
||||||
? Overrides.STARTING_MODIFIER_OVERRIDE
|
? Overrides.STARTING_MODIFIER_OVERRIDE
|
||||||
: Overrides.OPP_MODIFIER_OVERRIDE;
|
: Overrides.ENEMY_MODIFIER_OVERRIDE;
|
||||||
if (!modifiersOverride || modifiersOverride.length === 0 || !globalScene) {
|
if (!modifiersOverride || modifiersOverride.length === 0 || !globalScene) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -3797,7 +3797,7 @@ export function overrideModifiers(isPlayer = true): void {
|
|||||||
export function overrideHeldItems(pokemon: Pokemon, isPlayer = true): void {
|
export function overrideHeldItems(pokemon: Pokemon, isPlayer = true): void {
|
||||||
const heldItemsOverride: ModifierOverride[] = isPlayer
|
const heldItemsOverride: ModifierOverride[] = isPlayer
|
||||||
? Overrides.STARTING_HELD_ITEMS_OVERRIDE
|
? Overrides.STARTING_HELD_ITEMS_OVERRIDE
|
||||||
: Overrides.OPP_HELD_ITEMS_OVERRIDE;
|
: Overrides.ENEMY_HELD_ITEMS_OVERRIDE;
|
||||||
if (!heldItemsOverride || heldItemsOverride.length === 0 || !globalScene) {
|
if (!heldItemsOverride || heldItemsOverride.length === 0 || !globalScene) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -179,25 +179,24 @@ class DefaultOverrides {
|
|||||||
// --------------------------
|
// --------------------------
|
||||||
// OPPONENT / ENEMY OVERRIDES
|
// OPPONENT / ENEMY OVERRIDES
|
||||||
// --------------------------
|
// --------------------------
|
||||||
// TODO: rename `OPP_` to `ENEMY_`
|
readonly ENEMY_SPECIES_OVERRIDE: SpeciesId | number = 0;
|
||||||
readonly OPP_SPECIES_OVERRIDE: SpeciesId | number = 0;
|
|
||||||
/**
|
/**
|
||||||
* This will make all opponents fused Pokemon
|
* This will make all opponents fused Pokemon
|
||||||
*/
|
*/
|
||||||
readonly OPP_FUSION_OVERRIDE: boolean = false;
|
readonly ENEMY_FUSION_OVERRIDE: boolean = false;
|
||||||
/**
|
/**
|
||||||
* This will override the species of the fusion only when the opponent is already a fusion
|
* This will override the species of the fusion only when the opponent is already a fusion
|
||||||
*/
|
*/
|
||||||
readonly OPP_FUSION_SPECIES_OVERRIDE: SpeciesId | number = 0;
|
readonly ENEMY_FUSION_SPECIES_OVERRIDE: SpeciesId | number = 0;
|
||||||
readonly OPP_LEVEL_OVERRIDE: number = 0;
|
readonly ENEMY_LEVEL_OVERRIDE: number = 0;
|
||||||
readonly OPP_ABILITY_OVERRIDE: AbilityId = AbilityId.NONE;
|
readonly ENEMY_ABILITY_OVERRIDE: AbilityId = AbilityId.NONE;
|
||||||
readonly OPP_PASSIVE_ABILITY_OVERRIDE: AbilityId = AbilityId.NONE;
|
readonly ENEMY_PASSIVE_ABILITY_OVERRIDE: AbilityId = AbilityId.NONE;
|
||||||
readonly OPP_HAS_PASSIVE_ABILITY_OVERRIDE: boolean | null = null;
|
readonly ENEMY_HAS_PASSIVE_ABILITY_OVERRIDE: boolean | null = null;
|
||||||
readonly OPP_STATUS_OVERRIDE: StatusEffect = StatusEffect.NONE;
|
readonly ENEMY_STATUS_OVERRIDE: StatusEffect = StatusEffect.NONE;
|
||||||
readonly OPP_GENDER_OVERRIDE: Gender | null = null;
|
readonly ENEMY_GENDER_OVERRIDE: Gender | null = null;
|
||||||
readonly OPP_MOVESET_OVERRIDE: MoveId | Array<MoveId> = [];
|
readonly ENEMY_MOVESET_OVERRIDE: MoveId | Array<MoveId> = [];
|
||||||
readonly OPP_SHINY_OVERRIDE: boolean | null = null;
|
readonly ENEMY_SHINY_OVERRIDE: boolean | null = null;
|
||||||
readonly OPP_VARIANT_OVERRIDE: Variant | null = null;
|
readonly ENEMY_VARIANT_OVERRIDE: Variant | null = null;
|
||||||
/**
|
/**
|
||||||
* Overrides the IVs of enemy pokemon. Values must never be outside the range `0` to `31`!
|
* Overrides the IVs of enemy pokemon. Values must never be outside the range `0` to `31`!
|
||||||
* - If set to a number between `0` and `31`, set all IVs of all enemy pokemon to that number.
|
* - If set to a number between `0` and `31`, set all IVs of all enemy pokemon to that number.
|
||||||
@ -207,7 +206,7 @@ class DefaultOverrides {
|
|||||||
readonly ENEMY_IVS_OVERRIDE: number | number[] | null = null;
|
readonly ENEMY_IVS_OVERRIDE: number | number[] | null = null;
|
||||||
/** Override the nature of all enemy pokemon to the specified nature. Disabled if `null`. */
|
/** Override the nature of all enemy pokemon to the specified nature. Disabled if `null`. */
|
||||||
readonly ENEMY_NATURE_OVERRIDE: Nature | null = null;
|
readonly ENEMY_NATURE_OVERRIDE: Nature | null = null;
|
||||||
readonly OPP_FORM_OVERRIDES: Partial<Record<SpeciesId, number>> = {};
|
readonly ENEMY_FORM_OVERRIDES: Partial<Record<SpeciesId, number>> = {};
|
||||||
/**
|
/**
|
||||||
* Override to give the enemy Pokemon a given amount of health segments
|
* Override to give the enemy Pokemon a given amount of health segments
|
||||||
*
|
*
|
||||||
@ -215,7 +214,7 @@ class DefaultOverrides {
|
|||||||
* 1: the Pokemon will have a single health segment and therefore will not be a boss
|
* 1: the Pokemon will have a single health segment and therefore will not be a boss
|
||||||
* 2+: the Pokemon will be a boss with the given number of health segments
|
* 2+: the Pokemon will be a boss with the given number of health segments
|
||||||
*/
|
*/
|
||||||
readonly OPP_HEALTH_SEGMENTS_OVERRIDE: number = 0;
|
readonly ENEMY_HEALTH_SEGMENTS_OVERRIDE: number = 0;
|
||||||
|
|
||||||
// -------------
|
// -------------
|
||||||
// EGG OVERRIDES
|
// EGG OVERRIDES
|
||||||
@ -277,12 +276,12 @@ class DefaultOverrides {
|
|||||||
*
|
*
|
||||||
* Note that any previous modifiers are cleared.
|
* Note that any previous modifiers are cleared.
|
||||||
*/
|
*/
|
||||||
readonly OPP_MODIFIER_OVERRIDE: ModifierOverride[] = [];
|
readonly ENEMY_MODIFIER_OVERRIDE: ModifierOverride[] = [];
|
||||||
|
|
||||||
/** Override array of {@linkcode ModifierOverride}s used to provide held items to first party member when starting a new game. */
|
/** Override array of {@linkcode ModifierOverride}s used to provide held items to first party member when starting a new game. */
|
||||||
readonly STARTING_HELD_ITEMS_OVERRIDE: ModifierOverride[] = [];
|
readonly STARTING_HELD_ITEMS_OVERRIDE: ModifierOverride[] = [];
|
||||||
/** Override array of {@linkcode ModifierOverride}s used to provide held items to enemies on spawn. */
|
/** Override array of {@linkcode ModifierOverride}s used to provide held items to enemies on spawn. */
|
||||||
readonly OPP_HELD_ITEMS_OVERRIDE: ModifierOverride[] = [];
|
readonly ENEMY_HELD_ITEMS_OVERRIDE: ModifierOverride[] = [];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Override array of {@linkcode ModifierOverride}s used to replace the generated item rolls after a wave.
|
* Override array of {@linkcode ModifierOverride}s used to replace the generated item rolls after a wave.
|
||||||
|
@ -229,7 +229,7 @@ export class EncounterPhase extends BattlePhase {
|
|||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
const overridedBossSegments = Overrides.OPP_HEALTH_SEGMENTS_OVERRIDE > 1;
|
const overridedBossSegments = Overrides.ENEMY_HEALTH_SEGMENTS_OVERRIDE > 1;
|
||||||
// for double battles, reduce the health segments for boss Pokemon unless there is an override
|
// for double battles, reduce the health segments for boss Pokemon unless there is an override
|
||||||
if (!overridedBossSegments && battle.enemyParty.filter(p => p.isBoss()).length > 1) {
|
if (!overridedBossSegments && battle.enemyParty.filter(p => p.isBoss()).length > 1) {
|
||||||
for (const enemyPokemon of battle.enemyParty) {
|
for (const enemyPokemon of battle.enemyParty) {
|
||||||
|
2
test/@types/vitest.d.ts
vendored
2
test/@types/vitest.d.ts
vendored
@ -130,7 +130,7 @@ declare module "vitest" {
|
|||||||
* @param ppUsed - The numerical amount of PP that should have been consumed,
|
* @param ppUsed - The numerical amount of PP that should have been consumed,
|
||||||
* or `all` to indicate the move should be _out_ of PP
|
* or `all` to indicate the move should be _out_ of PP
|
||||||
* @remarks
|
* @remarks
|
||||||
* If the Pokemon's moveset has been set via {@linkcode Overrides.MOVESET_OVERRIDE}/{@linkcode Overrides.OPP_MOVESET_OVERRIDE},
|
* If the Pokemon's moveset has been set via {@linkcode Overrides.MOVESET_OVERRIDE}/{@linkcode Overrides.ENEMY_MOVESET_OVERRIDE},
|
||||||
* does not contain {@linkcode expectedMove}
|
* does not contain {@linkcode expectedMove}
|
||||||
* or contains the desired move more than once, this will fail the test.
|
* or contains the desired move more than once, this will fail the test.
|
||||||
*/
|
*/
|
||||||
|
@ -224,7 +224,7 @@ export class GameManager {
|
|||||||
// This will consider all battle entry dialog as seens and skip them
|
// This will consider all battle entry dialog as seens and skip them
|
||||||
vi.spyOn(this.scene.ui, "shouldSkipDialogue").mockReturnValue(true);
|
vi.spyOn(this.scene.ui, "shouldSkipDialogue").mockReturnValue(true);
|
||||||
|
|
||||||
if (overrides.OPP_HELD_ITEMS_OVERRIDE.length === 0) {
|
if (overrides.ENEMY_HELD_ITEMS_OVERRIDE.length === 0) {
|
||||||
this.removeEnemyHeldItems();
|
this.removeEnemyHeldItems();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -50,7 +50,7 @@ export class ChallengeModeHelper extends GameManagerHelper {
|
|||||||
});
|
});
|
||||||
|
|
||||||
await this.game.phaseInterceptor.run(EncounterPhase);
|
await this.game.phaseInterceptor.run(EncounterPhase);
|
||||||
if (overrides.OPP_HELD_ITEMS_OVERRIDE.length === 0 && this.game.override.removeEnemyStartingItems) {
|
if (overrides.ENEMY_HELD_ITEMS_OVERRIDE.length === 0 && this.game.override.removeEnemyStartingItems) {
|
||||||
this.game.removeEnemyHeldItems();
|
this.game.removeEnemyHeldItems();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -53,7 +53,7 @@ export class ClassicModeHelper extends GameManagerHelper {
|
|||||||
});
|
});
|
||||||
|
|
||||||
await this.game.phaseInterceptor.to(EncounterPhase);
|
await this.game.phaseInterceptor.to(EncounterPhase);
|
||||||
if (overrides.OPP_HELD_ITEMS_OVERRIDE.length === 0 && this.game.override.removeEnemyStartingItems) {
|
if (overrides.ENEMY_HELD_ITEMS_OVERRIDE.length === 0 && this.game.override.removeEnemyStartingItems) {
|
||||||
this.game.removeEnemyHeldItems();
|
this.game.removeEnemyHeldItems();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -37,7 +37,7 @@ export class DailyModeHelper extends GameManagerHelper {
|
|||||||
|
|
||||||
await this.game.phaseInterceptor.to(EncounterPhase);
|
await this.game.phaseInterceptor.to(EncounterPhase);
|
||||||
|
|
||||||
if (overrides.OPP_HELD_ITEMS_OVERRIDE.length === 0 && this.game.override.removeEnemyStartingItems) {
|
if (overrides.ENEMY_HELD_ITEMS_OVERRIDE.length === 0 && this.game.override.removeEnemyStartingItems) {
|
||||||
this.game.removeEnemyHeldItems();
|
this.game.removeEnemyHeldItems();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -228,8 +228,8 @@ export class MoveHelper extends GameManagerHelper {
|
|||||||
console.warn("Player moveset override disabled due to use of `game.move.changeMoveset`!");
|
console.warn("Player moveset override disabled due to use of `game.move.changeMoveset`!");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (coerceArray(Overrides.OPP_MOVESET_OVERRIDE).length > 0) {
|
if (coerceArray(Overrides.ENEMY_MOVESET_OVERRIDE).length > 0) {
|
||||||
vi.spyOn(Overrides, "OPP_MOVESET_OVERRIDE", "get").mockReturnValue([]);
|
vi.spyOn(Overrides, "ENEMY_MOVESET_OVERRIDE", "get").mockReturnValue([]);
|
||||||
console.warn("Enemy moveset override disabled due to use of `game.move.changeMoveset`!");
|
console.warn("Enemy moveset override disabled due to use of `game.move.changeMoveset`!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -302,8 +302,8 @@ export class MoveHelper extends GameManagerHelper {
|
|||||||
(this.game.scene.phaseManager.getCurrentPhase() as EnemyCommandPhase).getFieldIndex()
|
(this.game.scene.phaseManager.getCurrentPhase() as EnemyCommandPhase).getFieldIndex()
|
||||||
];
|
];
|
||||||
|
|
||||||
if ([Overrides.OPP_MOVESET_OVERRIDE].flat().length > 0) {
|
if ([Overrides.ENEMY_MOVESET_OVERRIDE].flat().length > 0) {
|
||||||
vi.spyOn(Overrides, "OPP_MOVESET_OVERRIDE", "get").mockReturnValue([]);
|
vi.spyOn(Overrides, "ENEMY_MOVESET_OVERRIDE", "get").mockReturnValue([]);
|
||||||
console.warn(
|
console.warn(
|
||||||
"Warning: `forceEnemyMove` overwrites the Pokemon's moveset and disables the enemy moveset override!",
|
"Warning: `forceEnemyMove` overwrites the Pokemon's moveset and disables the enemy moveset override!",
|
||||||
);
|
);
|
||||||
|
@ -406,7 +406,7 @@ export class OverridesHelper extends GameManagerHelper {
|
|||||||
* @returns `this`
|
* @returns `this`
|
||||||
*/
|
*/
|
||||||
public enemySpecies(species: SpeciesId | number): this {
|
public enemySpecies(species: SpeciesId | number): this {
|
||||||
vi.spyOn(Overrides, "OPP_SPECIES_OVERRIDE", "get").mockReturnValue(species);
|
vi.spyOn(Overrides, "ENEMY_SPECIES_OVERRIDE", "get").mockReturnValue(species);
|
||||||
this.log(`Enemy Pokemon species set to ${SpeciesId[species]} (=${species})!`);
|
this.log(`Enemy Pokemon species set to ${SpeciesId[species]} (=${species})!`);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
@ -416,7 +416,7 @@ export class OverridesHelper extends GameManagerHelper {
|
|||||||
* @returns `this`
|
* @returns `this`
|
||||||
*/
|
*/
|
||||||
public enableEnemyFusion(): this {
|
public enableEnemyFusion(): this {
|
||||||
vi.spyOn(Overrides, "OPP_FUSION_OVERRIDE", "get").mockReturnValue(true);
|
vi.spyOn(Overrides, "ENEMY_FUSION_OVERRIDE", "get").mockReturnValue(true);
|
||||||
this.log("Enemy Pokemon is a random fusion!");
|
this.log("Enemy Pokemon is a random fusion!");
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
@ -427,7 +427,7 @@ export class OverridesHelper extends GameManagerHelper {
|
|||||||
* @returns `this`
|
* @returns `this`
|
||||||
*/
|
*/
|
||||||
public enemyFusionSpecies(species: SpeciesId | number): this {
|
public enemyFusionSpecies(species: SpeciesId | number): this {
|
||||||
vi.spyOn(Overrides, "OPP_FUSION_SPECIES_OVERRIDE", "get").mockReturnValue(species);
|
vi.spyOn(Overrides, "ENEMY_FUSION_SPECIES_OVERRIDE", "get").mockReturnValue(species);
|
||||||
this.log(`Enemy Pokemon fusion species set to ${SpeciesId[species]} (=${species})!`);
|
this.log(`Enemy Pokemon fusion species set to ${SpeciesId[species]} (=${species})!`);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
@ -438,7 +438,7 @@ export class OverridesHelper extends GameManagerHelper {
|
|||||||
* @returns `this`
|
* @returns `this`
|
||||||
*/
|
*/
|
||||||
public enemyAbility(ability: AbilityId): this {
|
public enemyAbility(ability: AbilityId): this {
|
||||||
vi.spyOn(Overrides, "OPP_ABILITY_OVERRIDE", "get").mockReturnValue(ability);
|
vi.spyOn(Overrides, "ENEMY_ABILITY_OVERRIDE", "get").mockReturnValue(ability);
|
||||||
this.log(`Enemy Pokemon ability set to ${AbilityId[ability]} (=${ability})!`);
|
this.log(`Enemy Pokemon ability set to ${AbilityId[ability]} (=${ability})!`);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
@ -449,7 +449,7 @@ export class OverridesHelper extends GameManagerHelper {
|
|||||||
* @returns `this`
|
* @returns `this`
|
||||||
*/
|
*/
|
||||||
public enemyPassiveAbility(passiveAbility: AbilityId): this {
|
public enemyPassiveAbility(passiveAbility: AbilityId): this {
|
||||||
vi.spyOn(Overrides, "OPP_PASSIVE_ABILITY_OVERRIDE", "get").mockReturnValue(passiveAbility);
|
vi.spyOn(Overrides, "ENEMY_PASSIVE_ABILITY_OVERRIDE", "get").mockReturnValue(passiveAbility);
|
||||||
this.log(`Enemy Pokemon PASSIVE ability set to ${AbilityId[passiveAbility]} (=${passiveAbility})!`);
|
this.log(`Enemy Pokemon PASSIVE ability set to ${AbilityId[passiveAbility]} (=${passiveAbility})!`);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
@ -460,7 +460,7 @@ export class OverridesHelper extends GameManagerHelper {
|
|||||||
* @returns `this`
|
* @returns `this`
|
||||||
*/
|
*/
|
||||||
public enemyHasPassiveAbility(hasPassiveAbility: boolean | null): this {
|
public enemyHasPassiveAbility(hasPassiveAbility: boolean | null): this {
|
||||||
vi.spyOn(Overrides, "OPP_HAS_PASSIVE_ABILITY_OVERRIDE", "get").mockReturnValue(hasPassiveAbility);
|
vi.spyOn(Overrides, "ENEMY_HAS_PASSIVE_ABILITY_OVERRIDE", "get").mockReturnValue(hasPassiveAbility);
|
||||||
if (hasPassiveAbility === null) {
|
if (hasPassiveAbility === null) {
|
||||||
this.log("Enemy Pokemon PASSIVE ability no longer force enabled or disabled!");
|
this.log("Enemy Pokemon PASSIVE ability no longer force enabled or disabled!");
|
||||||
} else {
|
} else {
|
||||||
@ -475,7 +475,7 @@ export class OverridesHelper extends GameManagerHelper {
|
|||||||
* @returns `this`
|
* @returns `this`
|
||||||
*/
|
*/
|
||||||
public enemyMoveset(moveset: MoveId | MoveId[]): this {
|
public enemyMoveset(moveset: MoveId | MoveId[]): this {
|
||||||
vi.spyOn(Overrides, "OPP_MOVESET_OVERRIDE", "get").mockReturnValue(moveset);
|
vi.spyOn(Overrides, "ENEMY_MOVESET_OVERRIDE", "get").mockReturnValue(moveset);
|
||||||
moveset = coerceArray(moveset);
|
moveset = coerceArray(moveset);
|
||||||
const movesetStr = moveset.map(moveId => MoveId[moveId]).join(", ");
|
const movesetStr = moveset.map(moveId => MoveId[moveId]).join(", ");
|
||||||
this.log(`Enemy Pokemon moveset set to ${movesetStr} (=[${moveset.join(", ")}])!`);
|
this.log(`Enemy Pokemon moveset set to ${movesetStr} (=[${moveset.join(", ")}])!`);
|
||||||
@ -488,7 +488,7 @@ export class OverridesHelper extends GameManagerHelper {
|
|||||||
* @returns `this`
|
* @returns `this`
|
||||||
*/
|
*/
|
||||||
public enemyLevel(level: number): this {
|
public enemyLevel(level: number): this {
|
||||||
vi.spyOn(Overrides, "OPP_LEVEL_OVERRIDE", "get").mockReturnValue(level);
|
vi.spyOn(Overrides, "ENEMY_LEVEL_OVERRIDE", "get").mockReturnValue(level);
|
||||||
this.log(`Enemy Pokemon level set to ${level}!`);
|
this.log(`Enemy Pokemon level set to ${level}!`);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
@ -499,7 +499,7 @@ export class OverridesHelper extends GameManagerHelper {
|
|||||||
* @returns `this`
|
* @returns `this`
|
||||||
*/
|
*/
|
||||||
public enemyStatusEffect(statusEffect: StatusEffect): this {
|
public enemyStatusEffect(statusEffect: StatusEffect): this {
|
||||||
vi.spyOn(Overrides, "OPP_STATUS_OVERRIDE", "get").mockReturnValue(statusEffect);
|
vi.spyOn(Overrides, "ENEMY_STATUS_OVERRIDE", "get").mockReturnValue(statusEffect);
|
||||||
this.log(`Enemy Pokemon status-effect set to ${StatusEffect[statusEffect]} (=${statusEffect})!`);
|
this.log(`Enemy Pokemon status-effect set to ${StatusEffect[statusEffect]} (=${statusEffect})!`);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
@ -510,7 +510,7 @@ export class OverridesHelper extends GameManagerHelper {
|
|||||||
* @returns `this`
|
* @returns `this`
|
||||||
*/
|
*/
|
||||||
public enemyHeldItems(items: ModifierOverride[]): this {
|
public enemyHeldItems(items: ModifierOverride[]): this {
|
||||||
vi.spyOn(Overrides, "OPP_HELD_ITEMS_OVERRIDE", "get").mockReturnValue(items);
|
vi.spyOn(Overrides, "ENEMY_HELD_ITEMS_OVERRIDE", "get").mockReturnValue(items);
|
||||||
this.log("Enemy Pokemon held items set to:", items);
|
this.log("Enemy Pokemon held items set to:", items);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
@ -571,7 +571,7 @@ export class OverridesHelper extends GameManagerHelper {
|
|||||||
* @param variant - (Optional) The enemy's shiny {@linkcode Variant}.
|
* @param variant - (Optional) The enemy's shiny {@linkcode Variant}.
|
||||||
*/
|
*/
|
||||||
enemyShiny(shininess: boolean | null, variant?: Variant): this {
|
enemyShiny(shininess: boolean | null, variant?: Variant): this {
|
||||||
vi.spyOn(Overrides, "OPP_SHINY_OVERRIDE", "get").mockReturnValue(shininess);
|
vi.spyOn(Overrides, "ENEMY_SHINY_OVERRIDE", "get").mockReturnValue(shininess);
|
||||||
if (shininess === null) {
|
if (shininess === null) {
|
||||||
this.log("Disabled enemy Pokemon shiny override!");
|
this.log("Disabled enemy Pokemon shiny override!");
|
||||||
} else {
|
} else {
|
||||||
@ -579,7 +579,7 @@ export class OverridesHelper extends GameManagerHelper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (variant !== undefined) {
|
if (variant !== undefined) {
|
||||||
vi.spyOn(Overrides, "OPP_VARIANT_OVERRIDE", "get").mockReturnValue(variant);
|
vi.spyOn(Overrides, "ENEMY_VARIANT_OVERRIDE", "get").mockReturnValue(variant);
|
||||||
this.log(`Set enemy shiny variant to be ${variant}!`);
|
this.log(`Set enemy shiny variant to be ${variant}!`);
|
||||||
}
|
}
|
||||||
return this;
|
return this;
|
||||||
@ -594,7 +594,7 @@ export class OverridesHelper extends GameManagerHelper {
|
|||||||
* @returns `this`
|
* @returns `this`
|
||||||
*/
|
*/
|
||||||
public enemyHealthSegments(healthSegments: number): this {
|
public enemyHealthSegments(healthSegments: number): this {
|
||||||
vi.spyOn(Overrides, "OPP_HEALTH_SEGMENTS_OVERRIDE", "get").mockReturnValue(healthSegments);
|
vi.spyOn(Overrides, "ENEMY_HEALTH_SEGMENTS_OVERRIDE", "get").mockReturnValue(healthSegments);
|
||||||
this.log("Enemy Pokemon health segments set to:", healthSegments);
|
this.log("Enemy Pokemon health segments set to:", healthSegments);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
@ -33,7 +33,7 @@ export function toHaveUsedPP(
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
const override = received.isPlayer() ? Overrides.MOVESET_OVERRIDE : Overrides.OPP_MOVESET_OVERRIDE;
|
const override = received.isPlayer() ? Overrides.MOVESET_OVERRIDE : Overrides.ENEMY_MOVESET_OVERRIDE;
|
||||||
if (coerceArray(override).length > 0) {
|
if (coerceArray(override).length > 0) {
|
||||||
return {
|
return {
|
||||||
pass: false,
|
pass: false,
|
||||||
|
Loading…
Reference in New Issue
Block a user