mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-27 18:52:19 +02:00
Compare commits
10 Commits
f76dd2c712
...
166e1fa0d5
Author | SHA1 | Date | |
---|---|---|---|
|
166e1fa0d5 | ||
|
0eea2031fb | ||
|
e0992e42b3 | ||
|
4feb45f532 | ||
|
2610a64980 | ||
|
729054fb33 | ||
|
63fba0dcae | ||
|
baf686f621 | ||
|
4bdaf93c72 | ||
|
a98ec39d00 |
@ -782,6 +782,14 @@ export default class BattleScene extends SceneBase {
|
|||||||
return this.getPlayerField().find(p => p.isActive());
|
return this.getPlayerField().find(p => p.isActive());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Finds the first {@linkcode Pokemon.isActive() | active PlayerPokemon} that isn't also currently switching out
|
||||||
|
* @returns Either the first {@linkcode PlayerPokemon} satisfying, or undefined if no player pokemon on the field satisfy
|
||||||
|
*/
|
||||||
|
getNonSwitchedPlayerPokemon(): PlayerPokemon | undefined {
|
||||||
|
return this.getPlayerField().find(p => p.isActive() && p.switchOutStatus === false);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns an array of PlayerPokemon of length 1 or 2 depending on if double battles or not
|
* Returns an array of PlayerPokemon of length 1 or 2 depending on if double battles or not
|
||||||
* @returns array of {@linkcode PlayerPokemon}
|
* @returns array of {@linkcode PlayerPokemon}
|
||||||
@ -799,6 +807,14 @@ export default class BattleScene extends SceneBase {
|
|||||||
return this.getEnemyField().find(p => p.isActive());
|
return this.getEnemyField().find(p => p.isActive());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Finds the first {@linkcode Pokemon.isActive() | active EnemyPokemon} pokemon from the enemy that isn't also currently switching out
|
||||||
|
* @returns Either the first {@linkcode EnemyPokemon} satisfying, or undefined if no player pokemon on the field satisfy
|
||||||
|
*/
|
||||||
|
getNonSwitchedEnemyPokemon(): EnemyPokemon | undefined {
|
||||||
|
return this.getEnemyField().find(p => p.isActive() && p.switchOutStatus === false);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns an array of EnemyPokemon of length 1 or 2 depending on if double battles or not
|
* Returns an array of EnemyPokemon of length 1 or 2 depending on if double battles or not
|
||||||
* @returns array of {@linkcode EnemyPokemon}
|
* @returns array of {@linkcode EnemyPokemon}
|
||||||
|
@ -16,6 +16,14 @@ import { TrainerType } from "#enums/trainer-type";
|
|||||||
import i18next from "#app/plugins/i18n";
|
import i18next from "#app/plugins/i18n";
|
||||||
import MysteryEncounter from "#app/data/mystery-encounters/mystery-encounter";
|
import MysteryEncounter from "#app/data/mystery-encounters/mystery-encounter";
|
||||||
import { MysteryEncounterMode } from "#enums/mystery-encounter-mode";
|
import { MysteryEncounterMode } from "#enums/mystery-encounter-mode";
|
||||||
|
import { CustomModifierSettings } from "#app/modifier/modifier-type";
|
||||||
|
import { ModifierTier } from "#app/modifier/modifier-tier";
|
||||||
|
|
||||||
|
export enum ClassicFixedBossWaves {
|
||||||
|
// TODO: other fixed wave battles should be added here
|
||||||
|
EVIL_BOSS_1 = 115,
|
||||||
|
EVIL_BOSS_2 = 165,
|
||||||
|
}
|
||||||
|
|
||||||
export enum BattleType {
|
export enum BattleType {
|
||||||
WILD,
|
WILD,
|
||||||
@ -419,6 +427,7 @@ export class FixedBattleConfig {
|
|||||||
public getTrainer: GetTrainerFunc;
|
public getTrainer: GetTrainerFunc;
|
||||||
public getEnemyParty: GetEnemyPartyFunc;
|
public getEnemyParty: GetEnemyPartyFunc;
|
||||||
public seedOffsetWaveIndex: number;
|
public seedOffsetWaveIndex: number;
|
||||||
|
public customModifierRewardSettings?: CustomModifierSettings;
|
||||||
|
|
||||||
setBattleType(battleType: BattleType): FixedBattleConfig {
|
setBattleType(battleType: BattleType): FixedBattleConfig {
|
||||||
this.battleType = battleType;
|
this.battleType = battleType;
|
||||||
@ -444,6 +453,11 @@ export class FixedBattleConfig {
|
|||||||
this.seedOffsetWaveIndex = seedOffsetWaveIndex;
|
this.seedOffsetWaveIndex = seedOffsetWaveIndex;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setCustomModifierRewards(customModifierRewardSettings: CustomModifierSettings) {
|
||||||
|
this.customModifierRewardSettings = customModifierRewardSettings;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -503,11 +517,13 @@ export const classicFixedBattles: FixedBattleConfigs = {
|
|||||||
[8]: new FixedBattleConfig().setBattleType(BattleType.TRAINER)
|
[8]: new FixedBattleConfig().setBattleType(BattleType.TRAINER)
|
||||||
.setGetTrainerFunc(scene => new Trainer(scene, TrainerType.RIVAL, scene.gameData.gender === PlayerGender.MALE ? TrainerVariant.FEMALE : TrainerVariant.DEFAULT)),
|
.setGetTrainerFunc(scene => new Trainer(scene, TrainerType.RIVAL, scene.gameData.gender === PlayerGender.MALE ? TrainerVariant.FEMALE : TrainerVariant.DEFAULT)),
|
||||||
[25]: new FixedBattleConfig().setBattleType(BattleType.TRAINER)
|
[25]: new FixedBattleConfig().setBattleType(BattleType.TRAINER)
|
||||||
.setGetTrainerFunc(scene => new Trainer(scene, TrainerType.RIVAL_2, scene.gameData.gender === PlayerGender.MALE ? TrainerVariant.FEMALE : TrainerVariant.DEFAULT)),
|
.setGetTrainerFunc(scene => new Trainer(scene, TrainerType.RIVAL_2, scene.gameData.gender === PlayerGender.MALE ? TrainerVariant.FEMALE : TrainerVariant.DEFAULT))
|
||||||
|
.setCustomModifierRewards({ guaranteedModifierTiers: [ModifierTier.ULTRA, ModifierTier.GREAT, ModifierTier.GREAT], allowLuckUpgrades: false }),
|
||||||
[35]: new FixedBattleConfig().setBattleType(BattleType.TRAINER)
|
[35]: new FixedBattleConfig().setBattleType(BattleType.TRAINER)
|
||||||
.setGetTrainerFunc(getRandomTrainerFunc([ TrainerType.ROCKET_GRUNT, TrainerType.MAGMA_GRUNT, TrainerType.AQUA_GRUNT, TrainerType.GALACTIC_GRUNT, TrainerType.PLASMA_GRUNT, TrainerType.FLARE_GRUNT, TrainerType.AETHER_GRUNT, TrainerType.SKULL_GRUNT, TrainerType.MACRO_GRUNT ], true)),
|
.setGetTrainerFunc(getRandomTrainerFunc([ TrainerType.ROCKET_GRUNT, TrainerType.MAGMA_GRUNT, TrainerType.AQUA_GRUNT, TrainerType.GALACTIC_GRUNT, TrainerType.PLASMA_GRUNT, TrainerType.FLARE_GRUNT, TrainerType.AETHER_GRUNT, TrainerType.SKULL_GRUNT, TrainerType.MACRO_GRUNT ], true)),
|
||||||
[55]: new FixedBattleConfig().setBattleType(BattleType.TRAINER)
|
[55]: new FixedBattleConfig().setBattleType(BattleType.TRAINER)
|
||||||
.setGetTrainerFunc(scene => new Trainer(scene, TrainerType.RIVAL_3, scene.gameData.gender === PlayerGender.MALE ? TrainerVariant.FEMALE : TrainerVariant.DEFAULT)),
|
.setGetTrainerFunc(scene => new Trainer(scene, TrainerType.RIVAL_3, scene.gameData.gender === PlayerGender.MALE ? TrainerVariant.FEMALE : TrainerVariant.DEFAULT))
|
||||||
|
.setCustomModifierRewards({ guaranteedModifierTiers: [ModifierTier.ULTRA, ModifierTier.ULTRA, ModifierTier.GREAT, ModifierTier.GREAT], allowLuckUpgrades: false }),
|
||||||
[62]: new FixedBattleConfig().setBattleType(BattleType.TRAINER).setSeedOffsetWave(35)
|
[62]: new FixedBattleConfig().setBattleType(BattleType.TRAINER).setSeedOffsetWave(35)
|
||||||
.setGetTrainerFunc(getRandomTrainerFunc([ TrainerType.ROCKET_GRUNT, TrainerType.MAGMA_GRUNT, TrainerType.AQUA_GRUNT, TrainerType.GALACTIC_GRUNT, TrainerType.PLASMA_GRUNT, TrainerType.FLARE_GRUNT, TrainerType.AETHER_GRUNT, TrainerType.SKULL_GRUNT, TrainerType.MACRO_GRUNT ], true)),
|
.setGetTrainerFunc(getRandomTrainerFunc([ TrainerType.ROCKET_GRUNT, TrainerType.MAGMA_GRUNT, TrainerType.AQUA_GRUNT, TrainerType.GALACTIC_GRUNT, TrainerType.PLASMA_GRUNT, TrainerType.FLARE_GRUNT, TrainerType.AETHER_GRUNT, TrainerType.SKULL_GRUNT, TrainerType.MACRO_GRUNT ], true)),
|
||||||
[64]: new FixedBattleConfig().setBattleType(BattleType.TRAINER).setSeedOffsetWave(35)
|
[64]: new FixedBattleConfig().setBattleType(BattleType.TRAINER).setSeedOffsetWave(35)
|
||||||
@ -515,17 +531,21 @@ export const classicFixedBattles: FixedBattleConfigs = {
|
|||||||
[66]: new FixedBattleConfig().setBattleType(BattleType.TRAINER).setSeedOffsetWave(35)
|
[66]: new FixedBattleConfig().setBattleType(BattleType.TRAINER).setSeedOffsetWave(35)
|
||||||
.setGetTrainerFunc(getRandomTrainerFunc([[ TrainerType.ARCHER, TrainerType.ARIANA, TrainerType.PROTON, TrainerType.PETREL ], [ TrainerType.TABITHA, TrainerType.COURTNEY ], [ TrainerType.MATT, TrainerType.SHELLY ], [ TrainerType.JUPITER, TrainerType.MARS, TrainerType.SATURN ], [ TrainerType.ZINZOLIN, TrainerType.ROOD ], [ TrainerType.XEROSIC, TrainerType.BRYONY ], TrainerType.FABA, TrainerType.PLUMERIA, TrainerType.OLEANA ], true)),
|
.setGetTrainerFunc(getRandomTrainerFunc([[ TrainerType.ARCHER, TrainerType.ARIANA, TrainerType.PROTON, TrainerType.PETREL ], [ TrainerType.TABITHA, TrainerType.COURTNEY ], [ TrainerType.MATT, TrainerType.SHELLY ], [ TrainerType.JUPITER, TrainerType.MARS, TrainerType.SATURN ], [ TrainerType.ZINZOLIN, TrainerType.ROOD ], [ TrainerType.XEROSIC, TrainerType.BRYONY ], TrainerType.FABA, TrainerType.PLUMERIA, TrainerType.OLEANA ], true)),
|
||||||
[95]: new FixedBattleConfig().setBattleType(BattleType.TRAINER)
|
[95]: new FixedBattleConfig().setBattleType(BattleType.TRAINER)
|
||||||
.setGetTrainerFunc(scene => new Trainer(scene, TrainerType.RIVAL_4, scene.gameData.gender === PlayerGender.MALE ? TrainerVariant.FEMALE : TrainerVariant.DEFAULT)),
|
.setGetTrainerFunc(scene => new Trainer(scene, TrainerType.RIVAL_4, scene.gameData.gender === PlayerGender.MALE ? TrainerVariant.FEMALE : TrainerVariant.DEFAULT))
|
||||||
|
.setCustomModifierRewards({ guaranteedModifierTiers: [ModifierTier.ULTRA, ModifierTier.ULTRA, ModifierTier.ULTRA, ModifierTier.ULTRA], allowLuckUpgrades: false }),
|
||||||
[112]: new FixedBattleConfig().setBattleType(BattleType.TRAINER).setSeedOffsetWave(35)
|
[112]: new FixedBattleConfig().setBattleType(BattleType.TRAINER).setSeedOffsetWave(35)
|
||||||
.setGetTrainerFunc(getRandomTrainerFunc([ TrainerType.ROCKET_GRUNT, TrainerType.MAGMA_GRUNT, TrainerType.AQUA_GRUNT, TrainerType.GALACTIC_GRUNT, TrainerType.PLASMA_GRUNT, TrainerType.FLARE_GRUNT, TrainerType.AETHER_GRUNT, TrainerType.SKULL_GRUNT, TrainerType.MACRO_GRUNT ], true)),
|
.setGetTrainerFunc(getRandomTrainerFunc([ TrainerType.ROCKET_GRUNT, TrainerType.MAGMA_GRUNT, TrainerType.AQUA_GRUNT, TrainerType.GALACTIC_GRUNT, TrainerType.PLASMA_GRUNT, TrainerType.FLARE_GRUNT, TrainerType.AETHER_GRUNT, TrainerType.SKULL_GRUNT, TrainerType.MACRO_GRUNT ], true)),
|
||||||
[114]: new FixedBattleConfig().setBattleType(BattleType.TRAINER).setSeedOffsetWave(35)
|
[114]: new FixedBattleConfig().setBattleType(BattleType.TRAINER).setSeedOffsetWave(35)
|
||||||
.setGetTrainerFunc(getRandomTrainerFunc([[ TrainerType.ARCHER, TrainerType.ARIANA, TrainerType.PROTON, TrainerType.PETREL ], [ TrainerType.TABITHA, TrainerType.COURTNEY ], [ TrainerType.MATT, TrainerType.SHELLY ], [ TrainerType.JUPITER, TrainerType.MARS, TrainerType.SATURN ], [ TrainerType.ZINZOLIN, TrainerType.ROOD ], [ TrainerType.XEROSIC, TrainerType.BRYONY ], TrainerType.FABA, TrainerType.PLUMERIA, TrainerType.OLEANA ], true, 1)),
|
.setGetTrainerFunc(getRandomTrainerFunc([[ TrainerType.ARCHER, TrainerType.ARIANA, TrainerType.PROTON, TrainerType.PETREL ], [ TrainerType.TABITHA, TrainerType.COURTNEY ], [ TrainerType.MATT, TrainerType.SHELLY ], [ TrainerType.JUPITER, TrainerType.MARS, TrainerType.SATURN ], [ TrainerType.ZINZOLIN, TrainerType.ROOD ], [ TrainerType.XEROSIC, TrainerType.BRYONY ], TrainerType.FABA, TrainerType.PLUMERIA, TrainerType.OLEANA ], true, 1)),
|
||||||
[115]: new FixedBattleConfig().setBattleType(BattleType.TRAINER).setSeedOffsetWave(35)
|
[ClassicFixedBossWaves.EVIL_BOSS_1]: new FixedBattleConfig().setBattleType(BattleType.TRAINER).setSeedOffsetWave(35)
|
||||||
.setGetTrainerFunc(getRandomTrainerFunc([ TrainerType.ROCKET_BOSS_GIOVANNI_1, TrainerType.MAXIE, TrainerType.ARCHIE, TrainerType.CYRUS, TrainerType.GHETSIS, TrainerType.LYSANDRE, TrainerType.LUSAMINE, TrainerType.GUZMA, TrainerType.ROSE ])),
|
.setGetTrainerFunc(getRandomTrainerFunc([ TrainerType.ROCKET_BOSS_GIOVANNI_1, TrainerType.MAXIE, TrainerType.ARCHIE, TrainerType.CYRUS, TrainerType.GHETSIS, TrainerType.LYSANDRE, TrainerType.LUSAMINE, TrainerType.GUZMA, TrainerType.ROSE ]))
|
||||||
|
.setCustomModifierRewards({ guaranteedModifierTiers: [ModifierTier.ROGUE, ModifierTier.ROGUE, ModifierTier.ULTRA, ModifierTier.ULTRA, ModifierTier.ULTRA], allowLuckUpgrades: false }),
|
||||||
[145]: new FixedBattleConfig().setBattleType(BattleType.TRAINER)
|
[145]: new FixedBattleConfig().setBattleType(BattleType.TRAINER)
|
||||||
.setGetTrainerFunc(scene => new Trainer(scene, TrainerType.RIVAL_5, scene.gameData.gender === PlayerGender.MALE ? TrainerVariant.FEMALE : TrainerVariant.DEFAULT)),
|
.setGetTrainerFunc(scene => new Trainer(scene, TrainerType.RIVAL_5, scene.gameData.gender === PlayerGender.MALE ? TrainerVariant.FEMALE : TrainerVariant.DEFAULT))
|
||||||
[165]: new FixedBattleConfig().setBattleType(BattleType.TRAINER).setSeedOffsetWave(35)
|
.setCustomModifierRewards({ guaranteedModifierTiers: [ModifierTier.ROGUE, ModifierTier.ROGUE, ModifierTier.ROGUE, ModifierTier.ULTRA, ModifierTier.ULTRA], allowLuckUpgrades: false }),
|
||||||
.setGetTrainerFunc(getRandomTrainerFunc([ TrainerType.ROCKET_BOSS_GIOVANNI_2, TrainerType.MAXIE_2, TrainerType.ARCHIE_2, TrainerType.CYRUS_2, TrainerType.GHETSIS_2, TrainerType.LYSANDRE_2, TrainerType.LUSAMINE_2, TrainerType.GUZMA_2, TrainerType.ROSE_2 ])),
|
[ClassicFixedBossWaves.EVIL_BOSS_2]: new FixedBattleConfig().setBattleType(BattleType.TRAINER).setSeedOffsetWave(35)
|
||||||
|
.setGetTrainerFunc(getRandomTrainerFunc([ TrainerType.ROCKET_BOSS_GIOVANNI_2, TrainerType.MAXIE_2, TrainerType.ARCHIE_2, TrainerType.CYRUS_2, TrainerType.GHETSIS_2, TrainerType.LYSANDRE_2, TrainerType.LUSAMINE_2, TrainerType.GUZMA_2, TrainerType.ROSE_2 ]))
|
||||||
|
.setCustomModifierRewards({ guaranteedModifierTiers: [ModifierTier.ROGUE, ModifierTier.ROGUE, ModifierTier.ULTRA, ModifierTier.ULTRA, ModifierTier.ULTRA, ModifierTier.ULTRA], allowLuckUpgrades: false }),
|
||||||
[182]: new FixedBattleConfig().setBattleType(BattleType.TRAINER)
|
[182]: new FixedBattleConfig().setBattleType(BattleType.TRAINER)
|
||||||
.setGetTrainerFunc(getRandomTrainerFunc([ TrainerType.LORELEI, TrainerType.WILL, TrainerType.SIDNEY, TrainerType.AARON, TrainerType.SHAUNTAL, TrainerType.MALVA, [ TrainerType.HALA, TrainerType.MOLAYNE ], TrainerType.MARNIE_ELITE, TrainerType.RIKA, TrainerType.CRISPIN ])),
|
.setGetTrainerFunc(getRandomTrainerFunc([ TrainerType.LORELEI, TrainerType.WILL, TrainerType.SIDNEY, TrainerType.AARON, TrainerType.SHAUNTAL, TrainerType.MALVA, [ TrainerType.HALA, TrainerType.MOLAYNE ], TrainerType.MARNIE_ELITE, TrainerType.RIKA, TrainerType.CRISPIN ])),
|
||||||
[184]: new FixedBattleConfig().setBattleType(BattleType.TRAINER).setSeedOffsetWave(182)
|
[184]: new FixedBattleConfig().setBattleType(BattleType.TRAINER).setSeedOffsetWave(182)
|
||||||
@ -538,4 +558,5 @@ export const classicFixedBattles: FixedBattleConfigs = {
|
|||||||
.setGetTrainerFunc(getRandomTrainerFunc([ TrainerType.BLUE, [ TrainerType.RED, TrainerType.LANCE_CHAMPION ], [ TrainerType.STEVEN, TrainerType.WALLACE ], TrainerType.CYNTHIA, [ TrainerType.ALDER, TrainerType.IRIS ], TrainerType.DIANTHA, TrainerType.HAU, TrainerType.LEON, [ TrainerType.GEETA, TrainerType.NEMONA ], TrainerType.KIERAN ])),
|
.setGetTrainerFunc(getRandomTrainerFunc([ TrainerType.BLUE, [ TrainerType.RED, TrainerType.LANCE_CHAMPION ], [ TrainerType.STEVEN, TrainerType.WALLACE ], TrainerType.CYNTHIA, [ TrainerType.ALDER, TrainerType.IRIS ], TrainerType.DIANTHA, TrainerType.HAU, TrainerType.LEON, [ TrainerType.GEETA, TrainerType.NEMONA ], TrainerType.KIERAN ])),
|
||||||
[195]: new FixedBattleConfig().setBattleType(BattleType.TRAINER)
|
[195]: new FixedBattleConfig().setBattleType(BattleType.TRAINER)
|
||||||
.setGetTrainerFunc(scene => new Trainer(scene, TrainerType.RIVAL_6, scene.gameData.gender === PlayerGender.MALE ? TrainerVariant.FEMALE : TrainerVariant.DEFAULT))
|
.setGetTrainerFunc(scene => new Trainer(scene, TrainerType.RIVAL_6, scene.gameData.gender === PlayerGender.MALE ? TrainerVariant.FEMALE : TrainerVariant.DEFAULT))
|
||||||
|
.setCustomModifierRewards({ guaranteedModifierTiers: [ModifierTier.ROGUE, ModifierTier.ROGUE, ModifierTier.ULTRA, ModifierTier.ULTRA, ModifierTier.GREAT, ModifierTier.GREAT], allowLuckUpgrades: false })
|
||||||
};
|
};
|
||||||
|
@ -428,7 +428,7 @@ class AnimTimedAddBgEvent extends AnimTimedBgEvent {
|
|||||||
moveAnim.bgSprite.setScale(1.25);
|
moveAnim.bgSprite.setScale(1.25);
|
||||||
moveAnim.bgSprite.setAlpha(this.opacity / 255);
|
moveAnim.bgSprite.setAlpha(this.opacity / 255);
|
||||||
scene.field.add(moveAnim.bgSprite);
|
scene.field.add(moveAnim.bgSprite);
|
||||||
const fieldPokemon = scene.getEnemyPokemon() || scene.getPlayerPokemon();
|
const fieldPokemon = scene.getNonSwitchedEnemyPokemon() || scene.getNonSwitchedPlayerPokemon();
|
||||||
if (!isNullOrUndefined(priority)) {
|
if (!isNullOrUndefined(priority)) {
|
||||||
scene.field.moveTo(moveAnim.bgSprite as Phaser.GameObjects.GameObject, priority!);
|
scene.field.moveTo(moveAnim.bgSprite as Phaser.GameObjects.GameObject, priority!);
|
||||||
} else if (fieldPokemon?.isOnField()) {
|
} else if (fieldPokemon?.isOnField()) {
|
||||||
@ -989,7 +989,7 @@ export abstract class BattleAnim {
|
|||||||
const setSpritePriority = (priority: integer) => {
|
const setSpritePriority = (priority: integer) => {
|
||||||
switch (priority) {
|
switch (priority) {
|
||||||
case 0:
|
case 0:
|
||||||
scene.field.moveBelow(moveSprite as Phaser.GameObjects.GameObject, scene.getEnemyPokemon() || scene.getPlayerPokemon()!); // TODO: is this bang correct?
|
scene.field.moveBelow(moveSprite as Phaser.GameObjects.GameObject, scene.getNonSwitchedEnemyPokemon() || scene.getNonSwitchedPlayerPokemon()!); // This bang assumes that if (the EnemyPokemon is undefined, then the PlayerPokemon function must return an object), correct assumption?
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
scene.field.moveTo(moveSprite, scene.field.getAll().length - 1);
|
scene.field.moveTo(moveSprite, scene.field.getAll().length - 1);
|
||||||
|
@ -5221,7 +5221,6 @@ export class ForceSwitchOutAttr extends MoveEffectAttr {
|
|||||||
switchOutTarget.leaveField(false);
|
switchOutTarget.leaveField(false);
|
||||||
|
|
||||||
if (switchOutTarget.hp) {
|
if (switchOutTarget.hp) {
|
||||||
switchOutTarget.setWildFlee(true);
|
|
||||||
user.scene.queueMessage(i18next.t("moveTriggers:fled", {pokemonName: getPokemonNameWithAffix(switchOutTarget)}), null, true, 500);
|
user.scene.queueMessage(i18next.t("moveTriggers:fled", {pokemonName: getPokemonNameWithAffix(switchOutTarget)}), null, true, 500);
|
||||||
|
|
||||||
// in double battles redirect potential moves off fled pokemon
|
// in double battles redirect potential moves off fled pokemon
|
||||||
|
@ -99,7 +99,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
public luck: integer;
|
public luck: integer;
|
||||||
public pauseEvolutions: boolean;
|
public pauseEvolutions: boolean;
|
||||||
public pokerus: boolean;
|
public pokerus: boolean;
|
||||||
public wildFlee: boolean;
|
public switchOutStatus: boolean;
|
||||||
public evoCounter: integer;
|
public evoCounter: integer;
|
||||||
|
|
||||||
public fusionSpecies: PokemonSpecies | null;
|
public fusionSpecies: PokemonSpecies | null;
|
||||||
@ -145,7 +145,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
this.species = species;
|
this.species = species;
|
||||||
this.pokeball = dataSource?.pokeball || PokeballType.POKEBALL;
|
this.pokeball = dataSource?.pokeball || PokeballType.POKEBALL;
|
||||||
this.level = level;
|
this.level = level;
|
||||||
this.wildFlee = false;
|
this.switchOutStatus = false;
|
||||||
|
|
||||||
// Determine the ability index
|
// Determine the ability index
|
||||||
if (abilityIndex !== undefined) {
|
if (abilityIndex !== undefined) {
|
||||||
@ -343,7 +343,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
isAllowed(): boolean {
|
isAllowed(): boolean {
|
||||||
const challengeAllowed = new Utils.BooleanHolder(true);
|
const challengeAllowed = new Utils.BooleanHolder(true);
|
||||||
applyChallenges(this.scene.gameMode, ChallengeType.POKEMON_IN_BATTLE, this, challengeAllowed);
|
applyChallenges(this.scene.gameMode, ChallengeType.POKEMON_IN_BATTLE, this, challengeAllowed);
|
||||||
return !this.wildFlee && challengeAllowed.value;
|
return !this.isFainted() && challengeAllowed.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
isActive(onField?: boolean): boolean {
|
isActive(onField?: boolean): boolean {
|
||||||
@ -2152,11 +2152,11 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* sets if the pokemon has fled (implies it's a wild pokemon)
|
* sets if the pokemon is switching out (if it's a enemy wild implies it's going to flee)
|
||||||
* @param status - boolean
|
* @param status - boolean
|
||||||
*/
|
*/
|
||||||
setWildFlee(status: boolean): void {
|
setSwitchOutStatus(status: boolean): void {
|
||||||
this.wildFlee = status;
|
this.switchOutStatus = status;
|
||||||
}
|
}
|
||||||
|
|
||||||
updateInfo(instant?: boolean): Promise<void> {
|
updateInfo(instant?: boolean): Promise<void> {
|
||||||
@ -3384,6 +3384,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
this.updateFusionPalette();
|
this.updateFusionPalette();
|
||||||
}
|
}
|
||||||
this.summonData = new PokemonSummonData();
|
this.summonData = new PokemonSummonData();
|
||||||
|
this.setSwitchOutStatus(false);
|
||||||
if (!this.battleData) {
|
if (!this.battleData) {
|
||||||
this.resetBattleData();
|
this.resetBattleData();
|
||||||
}
|
}
|
||||||
@ -3789,6 +3790,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
this.hideInfo();
|
this.hideInfo();
|
||||||
}
|
}
|
||||||
this.scene.field.remove(this);
|
this.scene.field.remove(this);
|
||||||
|
this.setSwitchOutStatus(true);
|
||||||
this.scene.triggerPokemonFormChange(this, SpeciesFormChangeActiveTrigger, true);
|
this.scene.triggerPokemonFormChange(this, SpeciesFormChangeActiveTrigger, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3812,6 +3814,25 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
const rootForm = getPokemonSpecies(this.species.getRootSpeciesId());
|
const rootForm = getPokemonSpecies(this.species.getRootSpeciesId());
|
||||||
return rootForm.getAbility(abilityIndex) === rootForm.getAbility(currentAbilityIndex);
|
return rootForm.getAbility(abilityIndex) === rootForm.getAbility(currentAbilityIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Helper function to check if the player already owns the starter data of the Pokemon's
|
||||||
|
* current ability
|
||||||
|
* @param ownedAbilityAttrs the owned abilityAttr of this Pokemon's root form
|
||||||
|
* @returns true if the player already has it, false otherwise
|
||||||
|
*/
|
||||||
|
checkIfPlayerHasAbilityOfStarter(ownedAbilityAttrs: number): boolean {
|
||||||
|
if ((ownedAbilityAttrs & 1) > 0 && this.hasSameAbilityInRootForm(0)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if ((ownedAbilityAttrs & 2) > 0 && this.hasSameAbilityInRootForm(1)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if ((ownedAbilityAttrs & 4) > 0 && this.hasSameAbilityInRootForm(2)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default interface Pokemon {
|
export default interface Pokemon {
|
||||||
|
@ -268,7 +268,6 @@ export class GameMode implements GameModeConfig {
|
|||||||
isFixedBattle(waveIndex: integer): boolean {
|
isFixedBattle(waveIndex: integer): boolean {
|
||||||
const dummyConfig = new FixedBattleConfig();
|
const dummyConfig = new FixedBattleConfig();
|
||||||
return this.battleConfig.hasOwnProperty(waveIndex) || applyChallenges(this, ChallengeType.FIXED_BATTLES, waveIndex, dummyConfig);
|
return this.battleConfig.hasOwnProperty(waveIndex) || applyChallenges(this, ChallengeType.FIXED_BATTLES, waveIndex, dummyConfig);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
{
|
{
|
||||||
"encounter": "It appears the time has finally come once again.\nYou know why you have come here, do you not?\n$You were drawn here, because you have been here before.\nCountless times.\n$Though, perhaps it can be counted.\nTo be precise, this is in fact your {{cycleCount}} cycle.\n$Each cycle your mind reverts to its former state.\nEven so, somehow, remnants of your former selves remain.\n$Until now you have yet to succeed, but I sense a different presence in you this time.\n\n$You are the only one here, though it is as if there is… another.\n$Will you finally prove a formidable challenge to me?\nThe challenge I have longed after for millennia?\n$We begin.",
|
"encounter": "又しても 時が満ちた 様 である。\nこちらへ 至る 理由は 存知するな。\n$汝は この場所へ 引かれた……\nこの何度となく 至った場所。\n$けれども 数えられぬとも 限らぬ……\n正確に宣ふ(のたまう)と 現在の 循環は {{cycleCount}}回目 である。\n$各循環に 心… 意識… 両方も 元の有様に 戻る。\nなれども 故吾の 残影は 汝の 中に 存する。\n$未だに 成功せぬ ままでも\n異なる 存在を 感ずる。\n$御座在る者は 一人。\nなれども 感ずるは… もう 他人。\n$到頭 汝から いかめしい 挑戦は 我が目にかかるか?\n千歳 万歳 相まってた挑戦……\n$始もう。",
|
||||||
"encounter_female": "It appears the time has finally come once again.\nYou know why you have come here, do you not?\n$You were drawn here, because you have been here before.\nCountless times.\n$Though, perhaps it can be counted.\nTo be precise, this is in fact your {{cycleCount}} cycle.\n$Each cycle your mind reverts to its former state.\nEven so, somehow, remnants of your former selves remain.\n$Until now you have yet to succeed, but I sense a different presence in you this time.\n\n$You are the only one here, though it is as if there is… another.\n$Will you finally prove a formidable challenge to me?\nThe challenge I have longed after for millennia?\n$We begin.",
|
"encounter_female": "又しても 時が満ちた 様 である。\nこちらへ 至る 理由は 存知するな。\n$汝は この場所へ 引かれた……\nこの何度となく 至った場所。\n$けれども 数えられぬとも 限らぬ……\n正確に宣ふ(のたまう)と 現在の 循環は {{cycleCount}}回目 である。\n$各循環に 心… 意識… 両方も 元の有様に 戻る。\nなれども 故吾の 残影は 汝の 中に 存する。\n$未だに 成功せぬ ままでも\n異なる 存在を 感ずる。\n$御座在る者は 一人。\nなれども 感ずるは… もう 他人。\n$到頭 汝から いかめしい 挑戦は 我が目にかかるか?\n千歳 万歳 相まってた挑戦……\n$始もう。",
|
||||||
"firstStageWin": "I see. The presence I felt was indeed real.\nIt appears I no longer need to hold back.\n$Do not disappoint me.",
|
"firstStageWin": "成る程。 感じた 存在は 正身(むざね) であった。\n自分を括る 必要 有らぬ 様である。\n$失望させぬが良い。",
|
||||||
"secondStageWin": "…Magnificent.",
|
"secondStageWin": "……お見事でございます。",
|
||||||
"key_ordinal_one": "st",
|
"key_ordinal_one": "",
|
||||||
"key_ordinal_two": "nd",
|
"key_ordinal_two": "",
|
||||||
"key_ordinal_few": "rd",
|
"key_ordinal_few": "",
|
||||||
"key_ordinal_other": "th"
|
"key_ordinal_other": ""
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"ending": "@c{shock}You're back?@d{32} Does that mean…@d{96} you won?!\n@c{smile_ehalf}I should have known you had it in you.\n$@c{smile_eclosed}Of course… I always had that feeling.\n@c{smile}It's over now, right? You ended the loop.\n$@c{smile_ehalf}You fulfilled your dream too, didn't you?\nYou didn't lose even once.\n$I'll be the only one to remember what you did.\n@c{angry_mopen}I'll try not to forget!\n$@c{smile_wave_wink}Just kidding!@d{64} @c{smile}I'd never forget.@d{32}\nYour legend will live on in our hearts.\n$@c{smile_wave}Anyway,@d{64} it's getting late…@d{96} I think?\nIt's hard to tell in this place.\n$Let's go home. @c{smile_wave_wink}Maybe tomorrow, we can have another battle, for old time's sake?",
|
"ending": "@c{shock}帰ってきた?@d{32} それなら…@d{96} 勝った っていうこと だろう?!\n@c{smile_ehalf}絶対 やれると思う べきだったな。\n$@c{smile_eclosed}もちろん、ずっと そんな気 がしたんだな。\n@c{smile}ついに 終わった だろう? ループを 断ち切った。\n$@c{smile_ehalf}キミの夢も 叶ったよな?\n一回も 負けなかった。\n$キミの しつくした事を 覚えるのは おれだけだ。\n@c{angry_mopen}忘れない ように するが…\n$@c{smile_wave_wink}なんつって!@d{64} @c{smile}一生 忘れない。@d{32}\nキミの伝説は いつまでも みんなの 心の中に 残っているから。\n$@c{smile_wave}とにかく、@d{64} そろそろ 遅くなる……@d{96} かな?\nこの場所で よく 分からない。\n$さあ、帰ろう。\n@c{smile_wave_wink}明日、昔のよしみで バトルでも しないか?",
|
||||||
"ending_female": "@c{smile}Oh? You won?@d{96} @c{smile_eclosed}I guess I should've known.\nBut, you're back now.\n$@c{smile}It's over.@d{64} You ended the loop.\n$@c{serious_smile_fists}You fulfilled your dream too, didn't you?\nYou didn't lose even once.\n$@c{neutral}I'm the only one who'll remember what you did.@d{96}\nI guess that's okay, isn't it?\n$@c{serious_smile_fists}Your legend will always live on in our hearts.\n$@c{smile_eclosed}Anyway, I've had about enough of this place, haven't you? Let's head home.\n$@c{serious_smile_fists}Maybe when we get back, we can have another battle?\nIf you're up to it.",
|
"ending_female": "@c{smile}えぇ? 勝ちゃった?@d{96} @c{smile_eclosed}勝てるのが 分かる べきだったね。\nやっぱり 帰ってきた…\n$@c{smile}ついに終わった。@d{64} ループを 断ち切った。\n$@c{serious_smile_fists} アナタの夢も 叶ったよね?\n一回も 負けなかった!\n$@c{neutral}アタシだけが アナタが できた事 を覚えていく、ね。@d{96}\nでもね、たぶん 大丈夫なの かなぁ?\n$@c{serious_smile_fists}アナタの伝説は みんなの 心の中に\nずっと 残っているからね……\n$@c{smile_eclosed}じゃあ、こんなトコは もう飽きた だろう?\n帰ろうよ。\n$@c{serious_smile_fists}ふるさとに 着いたら、 また バトルしよう?\nやる気 あればね!",
|
||||||
"ending_endless": "Congratulations on reaching the current end!\nMore content is coming soon.",
|
"ending_endless": "現在のエンドまで やって来て おめでとう!\n更に多くの コンテンツは 近日公開予定です。",
|
||||||
"ending_name": "Devs"
|
"ending_name": "開発者"
|
||||||
}
|
}
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -6,7 +6,7 @@
|
|||||||
"newGame": "はじめから",
|
"newGame": "はじめから",
|
||||||
"settings": "設定",
|
"settings": "設定",
|
||||||
"selectGameMode": "ゲームモードを 選んでください。",
|
"selectGameMode": "ゲームモードを 選んでください。",
|
||||||
"logInOrCreateAccount": "始めるには、ログイン、または 登録して ください。\nメールアドレスは 必要が ありません!",
|
"logInOrCreateAccount": "始めるには、ログイン、または 登録して ください。\nメールアドレスは 必要 ありません!",
|
||||||
"username": "ユーザー名",
|
"username": "ユーザー名",
|
||||||
"password": "パスワード",
|
"password": "パスワード",
|
||||||
"login": "ログイン",
|
"login": "ログイン",
|
||||||
@ -14,7 +14,7 @@
|
|||||||
"register": "登録",
|
"register": "登録",
|
||||||
"emptyUsername": "ユーザー名を 空にする ことは できません",
|
"emptyUsername": "ユーザー名を 空にする ことは できません",
|
||||||
"invalidLoginUsername": "入力されたユーザー名は無効です",
|
"invalidLoginUsername": "入力されたユーザー名は無効です",
|
||||||
"invalidRegisterUsername": "ユーザー名には 英文字、 数字、 アンダースコアのみを 含くむ必要が あります",
|
"invalidRegisterUsername": "ユーザー名には 英文字、 数字、 アンダースコアのみを 含くむことが 必要です",
|
||||||
"invalidLoginPassword": "入力したパスワードは無効です",
|
"invalidLoginPassword": "入力したパスワードは無効です",
|
||||||
"invalidRegisterPassword": "パスワードは 6文字以上 でなければなりません",
|
"invalidRegisterPassword": "パスワードは 6文字以上 でなければなりません",
|
||||||
"usernameAlreadyUsed": "入力したユーザー名は すでに 使用されています",
|
"usernameAlreadyUsed": "入力したユーザー名は すでに 使用されています",
|
||||||
|
@ -1761,7 +1761,7 @@ const modifierPool: ModifierPool = {
|
|||||||
new WeightedModifierType(modifierTypes.ABILITY_CHARM, skipInClassicAfterWave(189, 6)),
|
new WeightedModifierType(modifierTypes.ABILITY_CHARM, skipInClassicAfterWave(189, 6)),
|
||||||
new WeightedModifierType(modifierTypes.FOCUS_BAND, 5),
|
new WeightedModifierType(modifierTypes.FOCUS_BAND, 5),
|
||||||
new WeightedModifierType(modifierTypes.KINGS_ROCK, 3),
|
new WeightedModifierType(modifierTypes.KINGS_ROCK, 3),
|
||||||
new WeightedModifierType(modifierTypes.LOCK_CAPSULE, skipInLastClassicWaveOrDefault(3)),
|
new WeightedModifierType(modifierTypes.LOCK_CAPSULE, (party: Pokemon[]) => party[0].scene.gameMode.isClassic ? 0 : 3),
|
||||||
new WeightedModifierType(modifierTypes.SUPER_EXP_CHARM, skipInLastClassicWaveOrDefault(8)),
|
new WeightedModifierType(modifierTypes.SUPER_EXP_CHARM, skipInLastClassicWaveOrDefault(8)),
|
||||||
new WeightedModifierType(modifierTypes.RARE_FORM_CHANGE_ITEM, (party: Pokemon[]) => Math.min(Math.ceil(party[0].scene.currentBattle.waveIndex / 50), 4) * 6, 24),
|
new WeightedModifierType(modifierTypes.RARE_FORM_CHANGE_ITEM, (party: Pokemon[]) => Math.min(Math.ceil(party[0].scene.currentBattle.waveIndex / 50), 4) * 6, 24),
|
||||||
new WeightedModifierType(modifierTypes.MEGA_BRACELET, (party: Pokemon[]) => Math.min(Math.ceil(party[0].scene.currentBattle.waveIndex / 50), 4) * 9, 36),
|
new WeightedModifierType(modifierTypes.MEGA_BRACELET, (party: Pokemon[]) => Math.min(Math.ceil(party[0].scene.currentBattle.waveIndex / 50), 4) * 9, 36),
|
||||||
|
@ -40,7 +40,7 @@ export class EggLapsePhase extends Phase {
|
|||||||
this.showSummary();
|
this.showSummary();
|
||||||
}, () => {
|
}, () => {
|
||||||
this.hatchEggsRegular(eggsToHatch);
|
this.hatchEggsRegular(eggsToHatch);
|
||||||
this.showSummary();
|
this.end();
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}, 100, true);
|
}, 100, true);
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import BattleScene from "#app/battle-scene";
|
import BattleScene from "#app/battle-scene";
|
||||||
import { BattlerIndex, BattleType } from "#app/battle";
|
import { BattlerIndex, BattleType, ClassicFixedBossWaves } from "#app/battle";
|
||||||
import { modifierTypes } from "#app/modifier/modifier-type";
|
import { CustomModifierSettings, modifierTypes } from "#app/modifier/modifier-type";
|
||||||
import { BattleEndPhase } from "./battle-end-phase";
|
import { BattleEndPhase } from "./battle-end-phase";
|
||||||
import { NewBattlePhase } from "./new-battle-phase";
|
import { NewBattlePhase } from "./new-battle-phase";
|
||||||
import { PokemonPhase } from "./pokemon-phase";
|
import { PokemonPhase } from "./pokemon-phase";
|
||||||
@ -42,8 +42,12 @@ export class VictoryPhase extends PokemonPhase {
|
|||||||
}
|
}
|
||||||
if (this.scene.gameMode.isEndless || !this.scene.gameMode.isWaveFinal(this.scene.currentBattle.waveIndex)) {
|
if (this.scene.gameMode.isEndless || !this.scene.gameMode.isWaveFinal(this.scene.currentBattle.waveIndex)) {
|
||||||
this.scene.pushPhase(new EggLapsePhase(this.scene));
|
this.scene.pushPhase(new EggLapsePhase(this.scene));
|
||||||
|
if (this.scene.gameMode.isClassic && this.scene.currentBattle.waveIndex === ClassicFixedBossWaves.EVIL_BOSS_2) {
|
||||||
|
// Should get Lock Capsule on 165 before shop phase so it can be used in the rewards shop
|
||||||
|
this.scene.pushPhase(new ModifierRewardPhase(this.scene, modifierTypes.LOCK_CAPSULE));
|
||||||
|
}
|
||||||
if (this.scene.currentBattle.waveIndex % 10) {
|
if (this.scene.currentBattle.waveIndex % 10) {
|
||||||
this.scene.pushPhase(new SelectModifierPhase(this.scene));
|
this.scene.pushPhase(new SelectModifierPhase(this.scene, undefined, undefined, this.getFixedBattleCustomModifiers()));
|
||||||
} else if (this.scene.gameMode.isDaily) {
|
} else if (this.scene.gameMode.isDaily) {
|
||||||
this.scene.pushPhase(new ModifierRewardPhase(this.scene, modifierTypes.EXP_CHARM));
|
this.scene.pushPhase(new ModifierRewardPhase(this.scene, modifierTypes.EXP_CHARM));
|
||||||
if (this.scene.currentBattle.waveIndex > 10 && !this.scene.gameMode.isWaveFinal(this.scene.currentBattle.waveIndex)) {
|
if (this.scene.currentBattle.waveIndex > 10 && !this.scene.gameMode.isWaveFinal(this.scene.currentBattle.waveIndex)) {
|
||||||
@ -76,4 +80,18 @@ export class VictoryPhase extends PokemonPhase {
|
|||||||
|
|
||||||
this.end();
|
this.end();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If this wave is a fixed battle with special custom modifier rewards,
|
||||||
|
* will pass those settings to the upcoming {@linkcode SelectModifierPhase}`.
|
||||||
|
*/
|
||||||
|
getFixedBattleCustomModifiers(): CustomModifierSettings | undefined {
|
||||||
|
const gameMode = this.scene.gameMode;
|
||||||
|
const waveIndex = this.scene.currentBattle.waveIndex;
|
||||||
|
if (gameMode.isFixedBattle(waveIndex)) {
|
||||||
|
return gameMode.getFixedBattle(waveIndex).customModifierRewardSettings;
|
||||||
|
}
|
||||||
|
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -50,7 +50,7 @@ describe("Moves - Dragon Tail", () => {
|
|||||||
await game.phaseInterceptor.to(BerryPhase);
|
await game.phaseInterceptor.to(BerryPhase);
|
||||||
|
|
||||||
const isVisible = enemyPokemon.visible;
|
const isVisible = enemyPokemon.visible;
|
||||||
const hasFled = enemyPokemon.wildFlee;
|
const hasFled = enemyPokemon.switchOutStatus;
|
||||||
expect(!isVisible && hasFled).toBe(true);
|
expect(!isVisible && hasFled).toBe(true);
|
||||||
|
|
||||||
// simply want to test that the game makes it this far without crashing
|
// simply want to test that the game makes it this far without crashing
|
||||||
@ -72,7 +72,7 @@ describe("Moves - Dragon Tail", () => {
|
|||||||
await game.phaseInterceptor.to(BerryPhase);
|
await game.phaseInterceptor.to(BerryPhase);
|
||||||
|
|
||||||
const isVisible = enemyPokemon.visible;
|
const isVisible = enemyPokemon.visible;
|
||||||
const hasFled = enemyPokemon.wildFlee;
|
const hasFled = enemyPokemon.switchOutStatus;
|
||||||
expect(!isVisible && hasFled).toBe(true);
|
expect(!isVisible && hasFled).toBe(true);
|
||||||
expect(leadPokemon.hp).toBeLessThan(leadPokemon.getMaxHp());
|
expect(leadPokemon.hp).toBeLessThan(leadPokemon.getMaxHp());
|
||||||
}, TIMEOUT
|
}, TIMEOUT
|
||||||
@ -97,9 +97,9 @@ describe("Moves - Dragon Tail", () => {
|
|||||||
await game.phaseInterceptor.to(TurnEndPhase);
|
await game.phaseInterceptor.to(TurnEndPhase);
|
||||||
|
|
||||||
const isVisibleLead = enemyLeadPokemon.visible;
|
const isVisibleLead = enemyLeadPokemon.visible;
|
||||||
const hasFledLead = enemyLeadPokemon.wildFlee;
|
const hasFledLead = enemyLeadPokemon.switchOutStatus;
|
||||||
const isVisibleSec = enemySecPokemon.visible;
|
const isVisibleSec = enemySecPokemon.visible;
|
||||||
const hasFledSec = enemySecPokemon.wildFlee;
|
const hasFledSec = enemySecPokemon.switchOutStatus;
|
||||||
expect(!isVisibleLead && hasFledLead && isVisibleSec && !hasFledSec).toBe(true);
|
expect(!isVisibleLead && hasFledLead && isVisibleSec && !hasFledSec).toBe(true);
|
||||||
expect(leadPokemon.hp).toBeLessThan(leadPokemon.getMaxHp());
|
expect(leadPokemon.hp).toBeLessThan(leadPokemon.getMaxHp());
|
||||||
|
|
||||||
@ -133,9 +133,9 @@ describe("Moves - Dragon Tail", () => {
|
|||||||
await game.phaseInterceptor.to(BerryPhase);
|
await game.phaseInterceptor.to(BerryPhase);
|
||||||
|
|
||||||
const isVisibleLead = enemyLeadPokemon.visible;
|
const isVisibleLead = enemyLeadPokemon.visible;
|
||||||
const hasFledLead = enemyLeadPokemon.wildFlee;
|
const hasFledLead = enemyLeadPokemon.switchOutStatus;
|
||||||
const isVisibleSec = enemySecPokemon.visible;
|
const isVisibleSec = enemySecPokemon.visible;
|
||||||
const hasFledSec = enemySecPokemon.wildFlee;
|
const hasFledSec = enemySecPokemon.switchOutStatus;
|
||||||
expect(!isVisibleLead && hasFledLead && !isVisibleSec && hasFledSec).toBe(true);
|
expect(!isVisibleLead && hasFledLead && !isVisibleSec && hasFledSec).toBe(true);
|
||||||
expect(leadPokemon.hp).toBeLessThan(leadPokemon.getMaxHp());
|
expect(leadPokemon.hp).toBeLessThan(leadPokemon.getMaxHp());
|
||||||
expect(secPokemon.hp).toBeLessThan(secPokemon.getMaxHp());
|
expect(secPokemon.hp).toBeLessThan(secPokemon.getMaxHp());
|
||||||
|
@ -381,17 +381,8 @@ export default class BattleInfo extends Phaser.GameObjects.Container {
|
|||||||
|
|
||||||
const ownedAbilityAttrs = pokemon.scene.gameData.starterData[pokemon.species.getRootSpeciesId()].abilityAttr;
|
const ownedAbilityAttrs = pokemon.scene.gameData.starterData[pokemon.species.getRootSpeciesId()].abilityAttr;
|
||||||
|
|
||||||
let playerOwnsThisAbility = false;
|
|
||||||
// Check if the player owns ability for the root form
|
// Check if the player owns ability for the root form
|
||||||
if ((ownedAbilityAttrs & 1) > 0 && pokemon.hasSameAbilityInRootForm(0)) {
|
const playerOwnsThisAbility = pokemon.checkIfPlayerHasAbilityOfStarter(ownedAbilityAttrs);
|
||||||
playerOwnsThisAbility = true;
|
|
||||||
}
|
|
||||||
if ((ownedAbilityAttrs & 2) > 0 && pokemon.hasSameAbilityInRootForm(1)) {
|
|
||||||
playerOwnsThisAbility = true;
|
|
||||||
}
|
|
||||||
if ((ownedAbilityAttrs & 4) > 0 && pokemon.hasSameAbilityInRootForm(2)) {
|
|
||||||
playerOwnsThisAbility = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (missingDexAttrs || !playerOwnsThisAbility) {
|
if (missingDexAttrs || !playerOwnsThisAbility) {
|
||||||
this.ownedIcon.setTint(0x808080);
|
this.ownedIcon.setTint(0x808080);
|
||||||
|
@ -267,18 +267,13 @@ export default class PokemonInfoContainer extends Phaser.GameObjects.Container {
|
|||||||
this.pokemonAbilityText.setColor(getTextColor(abilityTextStyle, false, this.scene.uiTheme));
|
this.pokemonAbilityText.setColor(getTextColor(abilityTextStyle, false, this.scene.uiTheme));
|
||||||
this.pokemonAbilityText.setShadowColor(getTextColor(abilityTextStyle, true, this.scene.uiTheme));
|
this.pokemonAbilityText.setShadowColor(getTextColor(abilityTextStyle, true, this.scene.uiTheme));
|
||||||
|
|
||||||
/**
|
|
||||||
* If the opposing Pokemon only has 1 normal ability and is using the hidden ability it should have the same behavior
|
|
||||||
* if it had 2 normal abilities. This code checks if that is the case and uses the correct opponent Pokemon abilityIndex (2)
|
|
||||||
* for calculations so it aligns with where the hidden ability is stored in the starter data's abilityAttr (4)
|
|
||||||
*/
|
|
||||||
const opponentPokemonOneNormalAbility = (pokemon.species.getAbilityCount() === 2);
|
|
||||||
const opponentPokemonAbilityIndex = (opponentPokemonOneNormalAbility && pokemon.abilityIndex === 1) ? 2 : pokemon.abilityIndex;
|
|
||||||
const opponentPokemonAbilityAttr = 1 << opponentPokemonAbilityIndex;
|
|
||||||
|
|
||||||
const rootFormHasHiddenAbility = starterEntry.abilityAttr & opponentPokemonAbilityAttr;
|
const ownedAbilityAttrs = pokemon.scene.gameData.starterData[pokemon.species.getRootSpeciesId()].abilityAttr;
|
||||||
|
|
||||||
if (!rootFormHasHiddenAbility) {
|
// Check if the player owns ability for the root form
|
||||||
|
const playerOwnsThisAbility = pokemon.checkIfPlayerHasAbilityOfStarter(ownedAbilityAttrs);
|
||||||
|
|
||||||
|
if (!playerOwnsThisAbility) {
|
||||||
this.pokemonAbilityLabelText.setColor(getTextColor(TextStyle.SUMMARY_BLUE, false, this.scene.uiTheme));
|
this.pokemonAbilityLabelText.setColor(getTextColor(TextStyle.SUMMARY_BLUE, false, this.scene.uiTheme));
|
||||||
this.pokemonAbilityLabelText.setShadowColor(getTextColor(TextStyle.SUMMARY_BLUE, true, this.scene.uiTheme));
|
this.pokemonAbilityLabelText.setShadowColor(getTextColor(TextStyle.SUMMARY_BLUE, true, this.scene.uiTheme));
|
||||||
} else {
|
} else {
|
||||||
|
@ -13,7 +13,7 @@ import { RunEntry } from "../system/game-data";
|
|||||||
import { PlayerGender } from "#enums/player-gender";
|
import { PlayerGender } from "#enums/player-gender";
|
||||||
import { TrainerVariant } from "../field/trainer";
|
import { TrainerVariant } from "../field/trainer";
|
||||||
|
|
||||||
export type RunSelectCallback = (cursor: integer) => void;
|
export type RunSelectCallback = (cursor: number) => void;
|
||||||
|
|
||||||
export const RUN_HISTORY_LIMIT: number = 25;
|
export const RUN_HISTORY_LIMIT: number = 25;
|
||||||
|
|
||||||
@ -25,15 +25,15 @@ export const RUN_HISTORY_LIMIT: number = 25;
|
|||||||
*/
|
*/
|
||||||
export default class RunHistoryUiHandler extends MessageUiHandler {
|
export default class RunHistoryUiHandler extends MessageUiHandler {
|
||||||
|
|
||||||
|
private readonly maxRows = 3;
|
||||||
|
|
||||||
private runSelectContainer: Phaser.GameObjects.Container;
|
private runSelectContainer: Phaser.GameObjects.Container;
|
||||||
private runsContainer: Phaser.GameObjects.Container;
|
private runsContainer: Phaser.GameObjects.Container;
|
||||||
private runSelectMessageBox: Phaser.GameObjects.NineSlice;
|
|
||||||
private runSelectMessageBoxContainer: Phaser.GameObjects.Container;
|
|
||||||
private runs: RunEntryContainer[];
|
private runs: RunEntryContainer[];
|
||||||
|
|
||||||
private runSelectCallback: RunSelectCallback | null;
|
private runSelectCallback: RunSelectCallback | null;
|
||||||
|
|
||||||
private scrollCursor: integer = 0;
|
private scrollCursor: number = 0;
|
||||||
|
|
||||||
private cursorObj: Phaser.GameObjects.NineSlice | null;
|
private cursorObj: Phaser.GameObjects.NineSlice | null;
|
||||||
|
|
||||||
@ -74,8 +74,7 @@ export default class RunHistoryUiHandler extends MessageUiHandler {
|
|||||||
|
|
||||||
this.getUi().bringToTop(this.runSelectContainer);
|
this.getUi().bringToTop(this.runSelectContainer);
|
||||||
this.runSelectContainer.setVisible(true);
|
this.runSelectContainer.setVisible(true);
|
||||||
this.populateRuns(this.scene);
|
this.populateRuns(this.scene).then(() => {
|
||||||
|
|
||||||
this.setScrollCursor(0);
|
this.setScrollCursor(0);
|
||||||
this.setCursor(0);
|
this.setCursor(0);
|
||||||
|
|
||||||
@ -83,6 +82,7 @@ export default class RunHistoryUiHandler extends MessageUiHandler {
|
|||||||
if (this.runs.length === 0) {
|
if (this.runs.length === 0) {
|
||||||
this.clearCursor();
|
this.clearCursor();
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -122,13 +122,21 @@ export default class RunHistoryUiHandler extends MessageUiHandler {
|
|||||||
success = this.setCursor(this.cursor - 1);
|
success = this.setCursor(this.cursor - 1);
|
||||||
} else if (this.scrollCursor) {
|
} else if (this.scrollCursor) {
|
||||||
success = this.setScrollCursor(this.scrollCursor - 1);
|
success = this.setScrollCursor(this.scrollCursor - 1);
|
||||||
|
} else if (this.runs.length > 1) {
|
||||||
|
// wrap around to the bottom
|
||||||
|
success = this.setCursor(Math.min(this.runs.length - 1, this.maxRows - 1));
|
||||||
|
success = this.setScrollCursor(Math.max(0, this.runs.length - this.maxRows)) || success;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case Button.DOWN:
|
case Button.DOWN:
|
||||||
if (this.cursor < 2) {
|
if (this.cursor < Math.min(this.maxRows - 1, this.runs.length - this.scrollCursor - 1)) {
|
||||||
success = this.setCursor(this.cursor + 1);
|
success = this.setCursor(this.cursor + 1);
|
||||||
} else if (this.scrollCursor < this.runs.length - 3) {
|
} else if (this.scrollCursor < this.runs.length - this.maxRows) {
|
||||||
success = this.setScrollCursor(this.scrollCursor + 1);
|
success = this.setScrollCursor(this.scrollCursor + 1);
|
||||||
|
} else if (this.runs.length > 1) {
|
||||||
|
// wrap around to the top
|
||||||
|
success = this.setCursor(0);
|
||||||
|
success = this.setScrollCursor(0) || success;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -218,6 +226,7 @@ export default class RunHistoryUiHandler extends MessageUiHandler {
|
|||||||
override clear() {
|
override clear() {
|
||||||
super.clear();
|
super.clear();
|
||||||
this.runSelectContainer.setVisible(false);
|
this.runSelectContainer.setVisible(false);
|
||||||
|
this.setScrollCursor(0);
|
||||||
this.clearCursor();
|
this.clearCursor();
|
||||||
this.runSelectCallback = null;
|
this.runSelectCallback = null;
|
||||||
this.clearRuns();
|
this.clearRuns();
|
||||||
@ -360,7 +369,7 @@ class RunEntryContainer extends Phaser.GameObjects.Container {
|
|||||||
// The code here does not account for icon weirdness.
|
// The code here does not account for icon weirdness.
|
||||||
const pokemonIconsContainer = this.scene.add.container(140, 17);
|
const pokemonIconsContainer = this.scene.add.container(140, 17);
|
||||||
|
|
||||||
data.party.forEach((p: PokemonData, i: integer) => {
|
data.party.forEach((p: PokemonData, i: number) => {
|
||||||
const iconContainer = this.scene.add.container(26 * i, 0);
|
const iconContainer = this.scene.add.container(26 * i, 0);
|
||||||
iconContainer.setScale(0.75);
|
iconContainer.setScale(0.75);
|
||||||
const pokemon = p.toPokemon(this.scene);
|
const pokemon = p.toPokemon(this.scene);
|
||||||
|
@ -49,15 +49,11 @@ export default class RunInfoUiHandler extends UiHandler {
|
|||||||
private runResultContainer: Phaser.GameObjects.Container;
|
private runResultContainer: Phaser.GameObjects.Container;
|
||||||
private runInfoContainer: Phaser.GameObjects.Container;
|
private runInfoContainer: Phaser.GameObjects.Container;
|
||||||
private partyContainer: Phaser.GameObjects.Container;
|
private partyContainer: Phaser.GameObjects.Container;
|
||||||
private partyHeldItemsContainer: Phaser.GameObjects.Container;
|
|
||||||
private statsBgWidth: integer;
|
private statsBgWidth: integer;
|
||||||
private partyContainerHeight: integer;
|
|
||||||
private partyContainerWidth: integer;
|
|
||||||
|
|
||||||
private hallofFameContainer: Phaser.GameObjects.Container;
|
private hallofFameContainer: Phaser.GameObjects.Container;
|
||||||
private endCardContainer: Phaser.GameObjects.Container;
|
private endCardContainer: Phaser.GameObjects.Container;
|
||||||
|
|
||||||
private partyInfo: Phaser.GameObjects.Container[];
|
|
||||||
private partyVisibility: Boolean;
|
private partyVisibility: Boolean;
|
||||||
private modifiersModule: any;
|
private modifiersModule: any;
|
||||||
|
|
||||||
@ -863,7 +859,7 @@ export default class RunInfoUiHandler extends UiHandler {
|
|||||||
private buttonCycleOption(button: Button) {
|
private buttonCycleOption(button: Button) {
|
||||||
switch (button) {
|
switch (button) {
|
||||||
case Button.CYCLE_FORM:
|
case Button.CYCLE_FORM:
|
||||||
if (this.isVictory) {
|
if (this.isVictory && this.pageMode !== RunInfoUiMode.HALL_OF_FAME) {
|
||||||
if (!this.endCardContainer || !this.endCardContainer.visible) {
|
if (!this.endCardContainer || !this.endCardContainer.visible) {
|
||||||
this.createVictorySplash();
|
this.createVictorySplash();
|
||||||
this.endCardContainer.setVisible(true);
|
this.endCardContainer.setVisible(true);
|
||||||
@ -877,7 +873,7 @@ export default class RunInfoUiHandler extends UiHandler {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case Button.CYCLE_SHINY:
|
case Button.CYCLE_SHINY:
|
||||||
if (this.isVictory) {
|
if (this.isVictory && this.pageMode !== RunInfoUiMode.ENDING_ART) {
|
||||||
if (!this.hallofFameContainer.visible) {
|
if (!this.hallofFameContainer.visible) {
|
||||||
this.hallofFameContainer.setVisible(true);
|
this.hallofFameContainer.setVisible(true);
|
||||||
this.pageMode = RunInfoUiMode.HALL_OF_FAME;
|
this.pageMode = RunInfoUiMode.HALL_OF_FAME;
|
||||||
@ -888,7 +884,7 @@ export default class RunInfoUiHandler extends UiHandler {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case Button.CYCLE_ABILITY:
|
case Button.CYCLE_ABILITY:
|
||||||
if (this.runInfo.modifiers.length !== 0) {
|
if (this.runInfo.modifiers.length !== 0 && this.pageMode === RunInfoUiMode.MAIN) {
|
||||||
if (this.partyVisibility) {
|
if (this.partyVisibility) {
|
||||||
this.showParty(false);
|
this.showParty(false);
|
||||||
} else {
|
} else {
|
||||||
|
@ -76,7 +76,7 @@ export default class TitleUiHandler extends OptionSelectUiHandler {
|
|||||||
.then(stats => {
|
.then(stats => {
|
||||||
this.playerCountLabel.setText(`${stats.playerCount} ${i18next.t("menu:playersOnline")}`);
|
this.playerCountLabel.setText(`${stats.playerCount} ${i18next.t("menu:playersOnline")}`);
|
||||||
if (this.splashMessage === "splashMessages:battlesWon") {
|
if (this.splashMessage === "splashMessages:battlesWon") {
|
||||||
this.splashMessageText.setText(i18next.t(this.splashMessage, { count: stats.battlesWon }));
|
this.splashMessageText.setText(i18next.t(this.splashMessage, { count: stats.battleCount }));
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch(err => {
|
.catch(err => {
|
||||||
|
@ -139,7 +139,8 @@ const noTransitionModes = [
|
|||||||
Mode.TEST_DIALOGUE,
|
Mode.TEST_DIALOGUE,
|
||||||
Mode.AUTO_COMPLETE,
|
Mode.AUTO_COMPLETE,
|
||||||
Mode.ADMIN,
|
Mode.ADMIN,
|
||||||
Mode.MYSTERY_ENCOUNTER
|
Mode.MYSTERY_ENCOUNTER,
|
||||||
|
Mode.RUN_INFO
|
||||||
];
|
];
|
||||||
|
|
||||||
export default class UI extends Phaser.GameObjects.Container {
|
export default class UI extends Phaser.GameObjects.Container {
|
||||||
|
Loading…
Reference in New Issue
Block a user