mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-05 16:02:20 +02:00
Merge branch 'pagefaultgames:main' into Gen-4-de-local
This commit is contained in:
commit
a9ad510dd9
1
.gitignore
vendored
1
.gitignore
vendored
@ -33,5 +33,6 @@ public/images/pokemon/icons/input/output/*
|
||||
public/images/character/*/
|
||||
src/data/battle-anim-raw-data*.ts
|
||||
src/data/battle-anim-data.ts
|
||||
src/overrides.ts
|
||||
|
||||
coverage
|
4
package-lock.json
generated
4
package-lock.json
generated
@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "pokemon-rogue-battle",
|
||||
"version": "1.0.1",
|
||||
"version": "1.0.3",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "pokemon-rogue-battle",
|
||||
"version": "1.0.1",
|
||||
"version": "1.0.3",
|
||||
"dependencies": {
|
||||
"@material/material-color-utilities": "^0.2.7",
|
||||
"crypto-js": "^4.2.0",
|
||||
|
@ -60,25 +60,10 @@ import { SceneBase } from './scene-base';
|
||||
import CandyBar from './ui/candy-bar';
|
||||
import { Variant, variantData } from './data/variant';
|
||||
import { Localizable } from './plugins/i18n';
|
||||
import { STARTING_WAVE_OVERRIDE, OPP_SPECIES_OVERRIDE, SEED_OVERRIDE, STARTING_BIOME_OVERRIDE } from './overrides';
|
||||
|
||||
export const bypassLogin = import.meta.env.VITE_BYPASS_LOGIN === "1";
|
||||
|
||||
export const SEED_OVERRIDE = '';
|
||||
export const STARTER_SPECIES_OVERRIDE = 0;
|
||||
export const STARTER_FORM_OVERRIDE = 0;
|
||||
export const STARTING_LEVEL_OVERRIDE = 0;
|
||||
export const STARTING_WAVE_OVERRIDE = 0;
|
||||
export const STARTING_BIOME_OVERRIDE = Biome.TOWN;
|
||||
export const STARTING_MONEY_OVERRIDE = 0;
|
||||
|
||||
export const ABILITY_OVERRIDE = Abilities.NONE;
|
||||
export const MOVE_OVERRIDE = Moves.NONE;
|
||||
export const OPP_SPECIES_OVERRIDE = 0;
|
||||
export const OPP_ABILITY_OVERRIDE = Abilities.NONE;
|
||||
export const OPP_MOVE_OVERRIDE = Moves.NONE;
|
||||
export const OPP_SHINY_OVERRIDE = false;
|
||||
export const OPP_VARIANT_OVERRIDE = 0;
|
||||
|
||||
const DEBUG_RNG = false;
|
||||
|
||||
export const startingWave = STARTING_WAVE_OVERRIDE || 1;
|
||||
|
@ -976,16 +976,19 @@ export class FieldMoveTypePowerBoostAbAttr extends FieldMovePowerBoostAbAttr {
|
||||
export class BattleStatMultiplierAbAttr extends AbAttr {
|
||||
private battleStat: BattleStat;
|
||||
private multiplier: number;
|
||||
private condition: PokemonAttackCondition;
|
||||
|
||||
constructor(battleStat: BattleStat, multiplier: number) {
|
||||
constructor(battleStat: BattleStat, multiplier: number, condition?: PokemonAttackCondition) {
|
||||
super(false);
|
||||
|
||||
this.battleStat = battleStat;
|
||||
this.multiplier = multiplier;
|
||||
this.condition = condition;
|
||||
}
|
||||
|
||||
applyBattleStat(pokemon: Pokemon, passive: boolean, battleStat: BattleStat, statValue: Utils.NumberHolder, args: any[]): boolean | Promise<boolean> {
|
||||
if (battleStat === this.battleStat) {
|
||||
const move = (args[0] as Move);
|
||||
if (battleStat === this.battleStat && (!this.condition || this.condition(pokemon, null, move))) {
|
||||
statValue.value *= this.multiplier;
|
||||
return true;
|
||||
}
|
||||
@ -1402,6 +1405,7 @@ export class TraceAbAttr extends PostSummonAbAttr {
|
||||
const targets = pokemon.getOpponents();
|
||||
if (!targets.length)
|
||||
return false;
|
||||
|
||||
let target: Pokemon;
|
||||
if (targets.length > 1)
|
||||
pokemon.scene.executeWithSeedOffset(() => target = Utils.randSeedItem(targets), pokemon.scene.currentBattle.waveIndex);
|
||||
@ -1427,6 +1431,9 @@ export class PostSummonTransformAbAttr extends PostSummonAbAttr {
|
||||
|
||||
applyPostSummon(pokemon: Pokemon, passive: boolean, args: any[]): boolean {
|
||||
const targets = pokemon.getOpponents();
|
||||
if (!targets.length)
|
||||
return false;
|
||||
|
||||
let target: Pokemon;
|
||||
if (targets.length > 1)
|
||||
pokemon.scene.executeWithSeedOffset(() => target = Utils.randSeedItem(targets), pokemon.scene.currentBattle.waveIndex);
|
||||
@ -2642,8 +2649,8 @@ export function initAbilities() {
|
||||
new Ability(Abilities.TRUANT, 3)
|
||||
.attr(PostSummonAddBattlerTagAbAttr, BattlerTagType.TRUANT, 1, false),
|
||||
new Ability(Abilities.HUSTLE, 3)
|
||||
.attr(BattleStatMultiplierAbAttr, BattleStat.ATK, 1.5)
|
||||
.attr(BattleStatMultiplierAbAttr, BattleStat.ACC, 0.8),
|
||||
.attr(BattleStatMultiplierAbAttr, BattleStat.ATK, 1.5, (user, target, move) => move.category == MoveCategory.PHYSICAL)
|
||||
.attr(BattleStatMultiplierAbAttr, BattleStat.ACC, 0.8, (user, target, move) => move.category == MoveCategory.PHYSICAL),
|
||||
new Ability(Abilities.CUTE_CHARM, 3)
|
||||
.attr(PostDefendContactApplyTagChanceAbAttr, 30, BattlerTagType.INFATUATED),
|
||||
new Ability(Abilities.PLUS, 3)
|
||||
|
@ -1,10 +1,10 @@
|
||||
import { Arena } from "../field/arena";
|
||||
import { Type } from "./type";
|
||||
import * as Utils from "../utils";
|
||||
import { MoveCategory, StatChangeAttr, allMoves } from "./move";
|
||||
import { MoveCategory, allMoves } from "./move";
|
||||
import { getPokemonMessage } from "../messages";
|
||||
import Pokemon, { HitResult, PokemonMove } from "../field/pokemon";
|
||||
import { MoveEffectPhase, StatChangePhase } from "../phases";
|
||||
import { MoveEffectPhase, PokemonHealPhase, StatChangePhase} from "../phases";
|
||||
import { StatusEffect } from "./status-effect";
|
||||
import { BattlerIndex } from "../battle";
|
||||
import { Moves } from "./enums/moves";
|
||||
@ -146,6 +146,31 @@ class AuroraVeilTag extends WeakenMoveScreenTag {
|
||||
}
|
||||
}
|
||||
|
||||
class WishTag extends ArenaTag {
|
||||
private battlerIndex: BattlerIndex;
|
||||
private triggerMessage: string;
|
||||
private healHp: number;
|
||||
|
||||
constructor(turnCount: integer, sourceId: integer, side: ArenaTagSide) {
|
||||
super(ArenaTagType.WISH, turnCount, Moves.WISH, sourceId, side);
|
||||
}
|
||||
|
||||
onAdd(arena: Arena): void {
|
||||
const user = arena.scene.getPokemonById(this.sourceId);
|
||||
this.battlerIndex = user.getBattlerIndex();
|
||||
this.triggerMessage = getPokemonMessage(user, '\'s wish\ncame true!');
|
||||
this.healHp = Math.max(Math.floor(user.getMaxHp() / 2), 1);
|
||||
}
|
||||
|
||||
onRemove(arena: Arena): void {
|
||||
const target = arena.scene.getField()[this.battlerIndex];
|
||||
if (target?.isActive(true)) {
|
||||
arena.scene.queueMessage(this.triggerMessage);
|
||||
arena.scene.unshiftPhase(new PokemonHealPhase(target.scene, target.getBattlerIndex(), this.healHp, null, true, false));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export class WeakenMoveTypeTag extends ArenaTag {
|
||||
private weakenedType: Type;
|
||||
|
||||
@ -472,6 +497,8 @@ export function getArenaTag(tagType: ArenaTagType, turnCount: integer, sourceMov
|
||||
case ArenaTagType.FUTURE_SIGHT:
|
||||
case ArenaTagType.DOOM_DESIRE:
|
||||
return new DelayedAttackTag(tagType, sourceMove, sourceId, targetIndex);
|
||||
case ArenaTagType.WISH:
|
||||
return new WishTag(turnCount, sourceId, side);
|
||||
case ArenaTagType.STEALTH_ROCK:
|
||||
return new StealthRockTag(sourceId, side);
|
||||
case ArenaTagType.STICKY_WEB:
|
||||
|
@ -8,6 +8,7 @@ export enum ArenaTagType {
|
||||
MIST = "MIST",
|
||||
FUTURE_SIGHT = "FUTURE_SIGHT",
|
||||
DOOM_DESIRE = "DOOM_DESIRE",
|
||||
WISH = "WISH",
|
||||
STEALTH_ROCK = "STEALTH_ROCK",
|
||||
STICKY_WEB = "STICKY_WEB",
|
||||
TRICK_ROOM = "TRICK_ROOM",
|
||||
|
@ -3099,11 +3099,23 @@ export class RandomMovesetMoveAttr extends OverrideMoveEffectAttr {
|
||||
const moveTargets = getMoveTargets(user, move.moveId);
|
||||
if (!moveTargets.targets.length)
|
||||
return false;
|
||||
const targets = moveTargets.multiple || moveTargets.targets.length === 1
|
||||
? moveTargets.targets
|
||||
: moveTargets.targets.indexOf(target.getBattlerIndex()) > -1
|
||||
? [ target.getBattlerIndex() ]
|
||||
: [ moveTargets.targets[user.randSeedInt(moveTargets.targets.length)] ];
|
||||
let selectTargets: BattlerIndex[];
|
||||
switch (true) {
|
||||
case (moveTargets.multiple || moveTargets.targets.length === 1): {
|
||||
selectTargets = moveTargets.targets;
|
||||
break;
|
||||
}
|
||||
case (moveTargets.targets.indexOf(target.getBattlerIndex()) > -1): {
|
||||
selectTargets = [ target.getBattlerIndex() ];
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
moveTargets.targets.splice(moveTargets.targets.indexOf(user.getAlly().getBattlerIndex()));
|
||||
selectTargets = [ moveTargets.targets[user.randSeedInt(moveTargets.targets.length)] ];
|
||||
break;
|
||||
}
|
||||
}
|
||||
const targets = selectTargets;
|
||||
user.getMoveQueue().push({ move: move.moveId, targets: targets, ignorePP: true });
|
||||
user.scene.unshiftPhase(new MovePhase(user.scene, user, targets, moveset[moveIndex], true));
|
||||
return true;
|
||||
@ -4481,7 +4493,7 @@ export function initMoves() {
|
||||
.attr(AbilityCopyAttr),
|
||||
new SelfStatusMove(Moves.WISH, Type.NORMAL, -1, 10, -1, 0, 3)
|
||||
.triageMove()
|
||||
.unimplemented(),
|
||||
.attr(AddArenaTagAttr, ArenaTagType.WISH, 2, true),
|
||||
new SelfStatusMove(Moves.ASSIST, Type.NORMAL, -1, 20, -1, 0, 3)
|
||||
.attr(RandomMovesetMoveAttr, true)
|
||||
.ignoresVirtual(),
|
||||
|
@ -18,8 +18,7 @@ import { TimeOfDay } from "../data/enums/time-of-day";
|
||||
import { Terrain, TerrainType } from "../data/terrain";
|
||||
import { PostTerrainChangeAbAttr, PostWeatherChangeAbAttr, applyPostTerrainChangeAbAttrs, applyPostWeatherChangeAbAttrs } from "../data/ability";
|
||||
import Pokemon from "./pokemon";
|
||||
|
||||
const WEATHER_OVERRIDE = WeatherType.NONE;
|
||||
import { WEATHER_OVERRIDE } from '../overrides';
|
||||
|
||||
export class Arena {
|
||||
public scene: BattleScene;
|
||||
|
@ -1,5 +1,5 @@
|
||||
import Phaser from 'phaser';
|
||||
import BattleScene, { ABILITY_OVERRIDE, AnySound, MOVE_OVERRIDE, OPP_ABILITY_OVERRIDE, OPP_MOVE_OVERRIDE, OPP_SHINY_OVERRIDE, OPP_VARIANT_OVERRIDE } from '../battle-scene';
|
||||
import BattleScene, { AnySound } from '../battle-scene';
|
||||
import { Variant, VariantSet, variantColorCache } from '#app/data/variant';
|
||||
import { variantData } from '#app/data/variant';
|
||||
import BattleInfo, { PlayerBattleInfo, EnemyBattleInfo } from '../ui/battle-info';
|
||||
@ -43,6 +43,7 @@ import { Nature, getNatureStatMultiplier } from '../data/nature';
|
||||
import { SpeciesFormChange, SpeciesFormChangeActiveTrigger, SpeciesFormChangeMoveLearnedTrigger, SpeciesFormChangePostMoveTrigger, SpeciesFormChangeStatusEffectTrigger } from '../data/pokemon-forms';
|
||||
import { TerrainType } from '../data/terrain';
|
||||
import { TrainerSlot } from '../data/trainer-config';
|
||||
import { ABILITY_OVERRIDE, MOVE_OVERRIDE, OPP_ABILITY_OVERRIDE, OPP_MOVE_OVERRIDE, OPP_SHINY_OVERRIDE, OPP_VARIANT_OVERRIDE } from '../overrides';
|
||||
|
||||
export enum FieldPosition {
|
||||
CENTER,
|
||||
@ -657,7 +658,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
|
||||
getHpRatio(precise: boolean = false): number {
|
||||
return precise
|
||||
? this.hp / this.getMaxHp()
|
||||
: ((this.hp / this.getMaxHp()) * 100) / 100;
|
||||
: Math.round((this.hp / this.getMaxHp()) * 100) / 100;
|
||||
}
|
||||
|
||||
generateGender(): void {
|
||||
|
@ -1,10 +1,11 @@
|
||||
import { fixedBattles } from "./battle";
|
||||
import BattleScene, { STARTING_BIOME_OVERRIDE, STARTING_LEVEL_OVERRIDE, STARTING_MONEY_OVERRIDE } from "./battle-scene";
|
||||
import BattleScene from "./battle-scene";
|
||||
import { Biome } from "./data/enums/biome";
|
||||
import { Species } from "./data/enums/species";
|
||||
import PokemonSpecies, { allSpecies } from "./data/pokemon-species";
|
||||
import { Arena } from "./field/arena";
|
||||
import * as Utils from "./utils";
|
||||
import { STARTING_BIOME_OVERRIDE, STARTING_LEVEL_OVERRIDE, STARTING_MONEY_OVERRIDE } from './overrides';
|
||||
|
||||
export enum GameModes {
|
||||
CLASSIC,
|
||||
|
@ -59,4 +59,9 @@ export const menu: SimpleTranslationEntries = {
|
||||
"escapeVerbSwitch": "auswechseln",
|
||||
"escapeVerbFlee": "flucht",
|
||||
"notDisabled": "{{moveName}} ist\nnicht mehr deaktiviert!",
|
||||
"rankings": "Rankings",
|
||||
"dailyRankings": "Daily Rankings",
|
||||
"noRankings": "No Rankings",
|
||||
"loading": "Loading…",
|
||||
"playersOnline": "Players Online"
|
||||
} as const;
|
@ -78,4 +78,9 @@ export const menu: SimpleTranslationEntries = {
|
||||
"skipItemQuestion": "Are you sure you want to skip taking an item?",
|
||||
"eggHatching": "Oh?",
|
||||
"ivScannerUseQuestion": "Use IV Scanner on {{pokemonName}}?",
|
||||
"rankings": "Rankings",
|
||||
"dailyRankings": "Daily Rankings",
|
||||
"noRankings": "No Rankings",
|
||||
"loading": "Loading…",
|
||||
"playersOnline": "Players Online"
|
||||
} as const;
|
@ -61,5 +61,10 @@ export const menu: SimpleTranslationEntries = {
|
||||
"notDisabled": "¡El movimiento {{moveName}}\nya no está anulado!",
|
||||
"skipItemQuestion": "¿Estás seguro de que no quieres coger un objeto?",
|
||||
"eggHatching": "¿Y esto?",
|
||||
"ivScannerUseQuestion": "¿Quieres usar el Escáner de IVs en {{pokemonName}}?"
|
||||
"ivScannerUseQuestion": "¿Quieres usar el Escáner de IVs en {{pokemonName}}?",
|
||||
"rankings": "Rankings",
|
||||
"dailyRankings": "Daily Rankings",
|
||||
"noRankings": "No Rankings",
|
||||
"loading": "Loading…",
|
||||
"playersOnline": "Players Online"
|
||||
} as const;
|
@ -73,4 +73,9 @@ export const menu: SimpleTranslationEntries = {
|
||||
"skipItemQuestion": "Êtes-vous sûr·e de ne pas vouloir prendre d’objet ?",
|
||||
"eggHatching": "Oh ?",
|
||||
"ivScannerUseQuestion": "Utiliser le Scanner d’IV sur {{pokemonName}} ?",
|
||||
"rankings": "Rankings",
|
||||
"dailyRankings": "Daily Rankings",
|
||||
"noRankings": "No Rankings",
|
||||
"loading": "Loading…",
|
||||
"playersOnline": "Players Online"
|
||||
} as const;
|
||||
|
@ -6,5 +6,10 @@ export const menu: SimpleTranslationEntries = {
|
||||
"newGame": "Nuova Partita",
|
||||
"loadGame": "Carica Partita",
|
||||
"dailyRun": "Corsa Giornaliera (Beta)",
|
||||
"selectGameMode": "Seleziona una modalità di gioco."
|
||||
"selectGameMode": "Seleziona una modalità di gioco.",
|
||||
"rankings": "Rankings",
|
||||
"dailyRankings": "Daily Rankings",
|
||||
"noRankings": "No Rankings",
|
||||
"loading": "Loading…",
|
||||
"playersOnline": "Players Online"
|
||||
} as const;
|
23
src/overrides.ts
Normal file
23
src/overrides.ts
Normal file
@ -0,0 +1,23 @@
|
||||
import { Species } from './data/enums/species';
|
||||
import { Abilities } from "./data/enums/abilities";
|
||||
import { Biome } from "./data/enums/biome";
|
||||
import { Moves } from "./data/enums/moves";
|
||||
import { WeatherType } from "./data/weather";
|
||||
|
||||
export const SEED_OVERRIDE = '';
|
||||
export const STARTER_SPECIES_OVERRIDE = 0;
|
||||
export const STARTER_FORM_OVERRIDE = 0;
|
||||
export const STARTING_LEVEL_OVERRIDE = 0;
|
||||
export const STARTING_WAVE_OVERRIDE = 0;
|
||||
export const STARTING_BIOME_OVERRIDE = Biome.TOWN;
|
||||
export const STARTING_MONEY_OVERRIDE = 0;
|
||||
export const WEATHER_OVERRIDE = WeatherType.NONE;
|
||||
|
||||
export const ABILITY_OVERRIDE = Abilities.NONE;
|
||||
export const MOVE_OVERRIDE = Moves.NONE;
|
||||
export const OPP_SPECIES_OVERRIDE = 0;
|
||||
export const OPP_ABILITY_OVERRIDE = Abilities.NONE;
|
||||
export const OPP_MOVE_OVERRIDE = Moves.NONE;
|
||||
|
||||
export const OPP_SHINY_OVERRIDE = false;
|
||||
export const OPP_VARIANT_OVERRIDE = 0;
|
@ -1,4 +1,4 @@
|
||||
import BattleScene, { STARTER_FORM_OVERRIDE, STARTER_SPECIES_OVERRIDE, bypassLogin, startingWave } from "./battle-scene";
|
||||
import BattleScene, { bypassLogin, startingWave } from "./battle-scene";
|
||||
import { default as Pokemon, PlayerPokemon, EnemyPokemon, PokemonMove, MoveResult, DamageResult, FieldPosition, HitResult, TurnMove } from "./field/pokemon";
|
||||
import * as Utils from './utils';
|
||||
import { Moves } from "./data/enums/moves";
|
||||
@ -57,6 +57,7 @@ import { fetchDailyRunSeed, getDailyRunStarters } from "./data/daily-run";
|
||||
import { GameModes, gameModes } from "./game-mode";
|
||||
import { getPokemonSpecies, speciesStarters } from "./data/pokemon-species";
|
||||
import i18next from './plugins/i18n';
|
||||
import { STARTER_FORM_OVERRIDE, STARTER_SPECIES_OVERRIDE } from './overrides';
|
||||
|
||||
export class LoginPhase extends Phase {
|
||||
private showText: boolean;
|
||||
@ -2547,7 +2548,7 @@ export class MoveEffectPhase extends PokemonPhase {
|
||||
: 3 / (3 + Math.min(targetEvasionLevel.value - userAccuracyLevel.value, 6));
|
||||
}
|
||||
|
||||
applyBattleStatMultiplierAbAttrs(BattleStatMultiplierAbAttr, user, BattleStat.ACC, accuracyMultiplier);
|
||||
applyBattleStatMultiplierAbAttrs(BattleStatMultiplierAbAttr, user, BattleStat.ACC, accuracyMultiplier, this.move.getMove());
|
||||
|
||||
const evasionMultiplier = new Utils.NumberHolder(1);
|
||||
applyBattleStatMultiplierAbAttrs(BattleStatMultiplierAbAttr, this.getTarget(), BattleStat.EVA, evasionMultiplier);
|
||||
|
@ -2,6 +2,7 @@ import BattleScene from "../battle-scene";
|
||||
import { TextStyle, addTextObject } from "./text";
|
||||
import { WindowVariant, addWindow } from "./ui-theme";
|
||||
import * as Utils from "../utils";
|
||||
import i18next from "i18next";
|
||||
|
||||
interface RankingEntry {
|
||||
rank: integer,
|
||||
@ -39,7 +40,7 @@ export class DailyRunScoreboard extends Phaser.GameObjects.Container {
|
||||
const titleWindow = addWindow(this.scene, 0, 0, 114, 18, false, false, null, null, WindowVariant.THIN);
|
||||
this.add(titleWindow);
|
||||
|
||||
this.titleLabel = addTextObject(this.scene, titleWindow.displayWidth / 2, titleWindow.displayHeight / 2, 'Daily Rankings', TextStyle.WINDOW, { fontSize: '64px' });
|
||||
this.titleLabel = addTextObject(this.scene, titleWindow.displayWidth / 2, titleWindow.displayHeight / 2, i18next.t('menu:dailyRankings'), TextStyle.WINDOW, { fontSize: '64px' });
|
||||
this.titleLabel.setOrigin(0.5, 0.5);
|
||||
this.add(this.titleLabel);
|
||||
|
||||
@ -141,7 +142,7 @@ export class DailyRunScoreboard extends Phaser.GameObjects.Container {
|
||||
update(category: ScoreboardCategory = this.category, page: integer = this.page) {
|
||||
this.rankingsContainer.removeAll(true);
|
||||
|
||||
this.loadingLabel.setText('Loading…');
|
||||
this.loadingLabel.setText(i18next.t('menu:loading'));
|
||||
this.loadingLabel.setVisible(true);
|
||||
|
||||
if (category !== this.category)
|
||||
@ -155,7 +156,7 @@ export class DailyRunScoreboard extends Phaser.GameObjects.Container {
|
||||
.then(jsonResponse => {
|
||||
this.page = page;
|
||||
this.category = category;
|
||||
this.titleLabel.setText(`${Utils.toReadableString(ScoreboardCategory[category])} Rankings`);
|
||||
this.titleLabel.setText(`${Utils.toReadableString(ScoreboardCategory[category])} ${i18next.t("menu:rankings")}`);
|
||||
this.prevPageButton.setAlpha(page > 1 ? 1 : 0.5);
|
||||
this.nextPageButton.setAlpha(page < this.pageCount ? 1 : 0.5);
|
||||
this.pageNumberLabel.setText(page.toString());
|
||||
@ -163,7 +164,7 @@ export class DailyRunScoreboard extends Phaser.GameObjects.Container {
|
||||
this.loadingLabel.setVisible(false);
|
||||
this.updateRankings(jsonResponse);
|
||||
} else
|
||||
this.loadingLabel.setText('No Rankings');
|
||||
this.loadingLabel.setText(i18next.t('menu:noRankings'));
|
||||
});
|
||||
});
|
||||
}
|
||||
|
@ -383,6 +383,7 @@ export default class PartyUiHandler extends MessageUiHandler {
|
||||
}
|
||||
|
||||
const slotCount = this.partySlots.length;
|
||||
const battlerCount = this.scene.currentBattle.getBattlerCount();
|
||||
|
||||
switch (button) {
|
||||
case Button.UP:
|
||||
@ -392,16 +393,22 @@ export default class PartyUiHandler extends MessageUiHandler {
|
||||
success = this.setCursor(this.cursor < 6 ? this.cursor < slotCount - 1 ? this.cursor + 1 : 6 : 0);
|
||||
break;
|
||||
case Button.LEFT:
|
||||
if (this.cursor >= this.scene.currentBattle.getBattlerCount() && this.cursor < 6)
|
||||
if (this.cursor >= battlerCount && this.cursor <= 6)
|
||||
success = this.setCursor(0);
|
||||
break;
|
||||
case Button.RIGHT:
|
||||
const battlerCount = this.scene.currentBattle.getBattlerCount();
|
||||
if (slotCount > battlerCount && this.cursor < battlerCount)
|
||||
if (slotCount === battlerCount){
|
||||
success = this.setCursor(6);
|
||||
break;
|
||||
} else if (battlerCount >= 2 && slotCount > battlerCount && this.getCursor() === 0 && this.lastCursor === 1){
|
||||
success = this.setCursor(2);
|
||||
break;
|
||||
} else if (slotCount > battlerCount && this.cursor < battlerCount){
|
||||
success = this.setCursor(this.lastCursor < 6 ? this.lastCursor || battlerCount : battlerCount);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (success)
|
||||
ui.playSelect();
|
||||
|
@ -364,9 +364,16 @@ export default class SummaryUiHandler extends UiHandler {
|
||||
case Button.LEFT:
|
||||
this.moveSelect = false;
|
||||
this.setCursor(Page.STATS);
|
||||
if (this.summaryUiMode === SummaryUiMode.LEARN_MOVE){
|
||||
this.hideMoveEffect();
|
||||
this.destroyBlinkCursor();
|
||||
success = true;
|
||||
break;
|
||||
} else {
|
||||
this.hideMoveSelect();
|
||||
success = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@ -426,11 +433,9 @@ export default class SummaryUiHandler extends UiHandler {
|
||||
}
|
||||
|
||||
setCursor(cursor: integer, overrideChanged: boolean = false): boolean {
|
||||
let changed: boolean;
|
||||
let changed: boolean = overrideChanged || this.moveCursor !== cursor;
|
||||
|
||||
if (this.moveSelect) {
|
||||
changed = overrideChanged || this.moveCursor !== cursor;
|
||||
if (changed) {
|
||||
this.moveCursor = cursor;
|
||||
|
||||
const selectedMove = this.getSelectedMove();
|
||||
@ -462,7 +467,6 @@ export default class SummaryUiHandler extends UiHandler {
|
||||
y: `-=${14.83 * (moveDescriptionLineCount - 3)}`
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
if (!this.moveCursorObj) {
|
||||
this.moveCursorObj = this.scene.add.sprite(-2, 0, 'summary_moves_cursor', 'highlight');
|
||||
@ -527,6 +531,11 @@ export default class SummaryUiHandler extends UiHandler {
|
||||
this.setCursor(0, true);
|
||||
this.showMoveEffect();
|
||||
}
|
||||
else if (this.cursor===Page.MOVES) {
|
||||
this.moveCursorObj = null;
|
||||
this.showMoveSelect();
|
||||
this.showMoveEffect();
|
||||
}
|
||||
}
|
||||
else
|
||||
this.summaryPageTransitionContainer.x -= 214;
|
||||
@ -871,6 +880,12 @@ export default class SummaryUiHandler extends UiHandler {
|
||||
this.moveSelect = false;
|
||||
this.extraMoveRowContainer.setVisible(false);
|
||||
this.moveDescriptionText.setText('');
|
||||
|
||||
this.destroyBlinkCursor();
|
||||
this.hideMoveEffect();
|
||||
}
|
||||
|
||||
destroyBlinkCursor(){
|
||||
if (this.moveCursorBlinkTimer) {
|
||||
this.moveCursorBlinkTimer.destroy();
|
||||
this.moveCursorBlinkTimer = null;
|
||||
@ -883,8 +898,6 @@ export default class SummaryUiHandler extends UiHandler {
|
||||
this.selectedMoveCursorObj.destroy();
|
||||
this.selectedMoveCursorObj = null;
|
||||
}
|
||||
|
||||
this.hideMoveEffect();
|
||||
}
|
||||
|
||||
showMoveEffect(instant?: boolean) {
|
||||
|
@ -5,6 +5,7 @@ import { Mode } from "./ui";
|
||||
import * as Utils from "../utils";
|
||||
import { TextStyle, addTextObject } from "./text";
|
||||
import { battleCountSplashMessage, splashMessages } from "../data/splash-messages";
|
||||
import i18next from "i18next";
|
||||
|
||||
export default class TitleUiHandler extends OptionSelectUiHandler {
|
||||
private titleContainer: Phaser.GameObjects.Container;
|
||||
@ -37,7 +38,7 @@ export default class TitleUiHandler extends OptionSelectUiHandler {
|
||||
|
||||
this.titleContainer.add(this.dailyRunScoreboard);
|
||||
|
||||
this.playerCountLabel = addTextObject(this.scene, (this.scene.game.canvas.width / 6) - 2, (this.scene.game.canvas.height / 6) - 90, '? Players Online', TextStyle.MESSAGE, { fontSize: '54px' });
|
||||
this.playerCountLabel = addTextObject(this.scene, (this.scene.game.canvas.width / 6) - 2, (this.scene.game.canvas.height / 6) - 90, `? ${i18next.t("menu:playersOnline")}`, TextStyle.MESSAGE, { fontSize: '54px' });
|
||||
this.playerCountLabel.setOrigin(1, 0);
|
||||
this.titleContainer.add(this.playerCountLabel);
|
||||
|
||||
@ -61,7 +62,7 @@ export default class TitleUiHandler extends OptionSelectUiHandler {
|
||||
Utils.apiFetch(`game/titlestats`)
|
||||
.then(request => request.json())
|
||||
.then(stats => {
|
||||
this.playerCountLabel.setText(`${stats.playerCount} Players Online`);
|
||||
this.playerCountLabel.setText(`${stats.playerCount} ${i18next.t("menu:playersOnline")}`);
|
||||
if (this.splashMessage === battleCountSplashMessage)
|
||||
this.splashMessageText.setText(battleCountSplashMessage.replace('{COUNT}', stats.battleCount.toLocaleString('en-US')));
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user