Merge branch 'main' into beta

This commit is contained in:
NightKev 2024-09-11 07:29:18 -07:00
commit 9f82d796d3
27 changed files with 72 additions and 59 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 198 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

View File

@ -2769,20 +2769,20 @@ export default class BattleScene extends SceneBase {
const keys: string[] = []; const keys: string[] = [];
const playerParty = this.getParty(); const playerParty = this.getParty();
playerParty.forEach(p => { playerParty.forEach(p => {
keys.push("pkmn__" + p.species.getSpriteId(p.gender === Gender.FEMALE, p.species.formIndex, p.shiny, p.variant)); keys.push(p.getSpriteKey(true));
keys.push("pkmn__" + p.species.getSpriteId(p.gender === Gender.FEMALE, p.species.formIndex, p.shiny, p.variant, true)); keys.push(p.getBattleSpriteKey(true, true));
keys.push("cry/" + p.species.getCryKey(p.species.formIndex)); keys.push("cry/" + p.species.getCryKey(p.formIndex));
if (p.fusionSpecies && p.getSpeciesForm() !== p.getFusionSpeciesForm()) { if (p.fusionSpecies) {
keys.push("cry/"+p.getFusionSpeciesForm().getCryKey(p.fusionSpecies.formIndex)); keys.push("cry/"+p.fusionSpecies.getCryKey(p.fusionFormIndex));
} }
}); });
// enemyParty has to be operated on separately from playerParty because playerPokemon =/= enemyPokemon // enemyParty has to be operated on separately from playerParty because playerPokemon =/= enemyPokemon
const enemyParty = this.getEnemyParty(); const enemyParty = this.getEnemyParty();
enemyParty.forEach(p => { enemyParty.forEach(p => {
keys.push(p.species.getSpriteKey(p.gender === Gender.FEMALE, p.species.formIndex, p.shiny, p.variant)); keys.push(p.getSpriteKey(true));
keys.push("cry/" + p.species.getCryKey(p.species.formIndex)); keys.push("cry/" + p.species.getCryKey(p.formIndex));
if (p.fusionSpecies && p.getSpeciesForm() !== p.getFusionSpeciesForm()) { if (p.fusionSpecies) {
keys.push("cry/"+p.getFusionSpeciesForm().getCryKey(p.fusionSpecies.formIndex)); keys.push("cry/"+p.fusionSpecies.getCryKey(p.fusionFormIndex));
} }
}); });
return keys; return keys;

View File

@ -1569,8 +1569,7 @@ export const trainerTypeDialogue: TrainerTypeDialogue = {
"dialogue:roark.victory.1", "dialogue:roark.victory.1",
"dialogue:roark.victory.2", "dialogue:roark.victory.2",
"dialogue:roark.victory.3", "dialogue:roark.victory.3",
"dialogue:roark.victory.4", "dialogue:roark.victory.4"
"dialogue:roark.victory.5"
], ],
defeat: [ defeat: [
"dialogue:roark.defeat.1", "dialogue:roark.defeat.1",

View File

@ -88,12 +88,14 @@ export class Weather {
return 1; return 1;
} }
isMoveWeatherCancelled(move: Move): boolean { isMoveWeatherCancelled(user: Pokemon, move: Move): boolean {
const moveType = user.getMoveType(move);
switch (this.weatherType) { switch (this.weatherType) {
case WeatherType.HARSH_SUN: case WeatherType.HARSH_SUN:
return move instanceof AttackMove && move.type === Type.WATER; return move instanceof AttackMove && moveType === Type.WATER;
case WeatherType.HEAVY_RAIN: case WeatherType.HEAVY_RAIN:
return move instanceof AttackMove && move.type === Type.FIRE; return move instanceof AttackMove && moveType === Type.FIRE;
} }
return false; return false;

View File

@ -391,8 +391,8 @@ export class Arena {
return true; return true;
} }
isMoveWeatherCancelled(move: Move) { isMoveWeatherCancelled(user: Pokemon, move: Move) {
return this.weather && !this.weather.isEffectSuppressed(this.scene) && this.weather.isMoveWeatherCancelled(move); return this.weather && !this.weather.isEffectSuppressed(this.scene) && this.weather.isMoveWeatherCancelled(user, move);
} }
isMoveTerrainCancelled(user: Pokemon, targets: BattlerIndex[], move: Move) { isMoveTerrainCancelled(user: Pokemon, targets: BattlerIndex[], move: Move) {

View File

@ -2790,7 +2790,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
return this.fusionFaintCry(callback); return this.fusionFaintCry(callback);
} }
const key = `cry/${this.getSpeciesForm().getCryKey(this.formIndex)}`; const key = `cry/${this.species.getCryKey(this.formIndex)}`;
//eslint-disable-next-line @typescript-eslint/no-unused-vars //eslint-disable-next-line @typescript-eslint/no-unused-vars
let i = 0; let i = 0;
let rate = 0.85; let rate = 0.85;
@ -2848,7 +2848,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
} }
private fusionFaintCry(callback: Function): void { private fusionFaintCry(callback: Function): void {
const key = `cry/${this.getSpeciesForm().getCryKey(this.formIndex)}`; const key = `cry/${this.species.getCryKey(this.formIndex)}`;
let i = 0; let i = 0;
let rate = 0.85; let rate = 0.85;
const cry = this.scene.playSound(key, { rate: rate }) as AnySound; const cry = this.scene.playSound(key, { rate: rate }) as AnySound;
@ -2856,7 +2856,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
const tintSprite = this.getTintSprite(); const tintSprite = this.getTintSprite();
let duration = cry.totalDuration * 1000; let duration = cry.totalDuration * 1000;
const fusionCryKey = `cry/${this.getFusionSpeciesForm().getCryKey(this.fusionFormIndex)}`; const fusionCryKey = `cry/${this.fusionSpecies?.getCryKey(this.fusionFormIndex)}`;
let fusionCry = this.scene.playSound(fusionCryKey, { rate: rate }) as AnySound; let fusionCry = this.scene.playSound(fusionCryKey, { rate: rate }) as AnySound;
fusionCry.stop(); fusionCry.stop();
duration = Math.min(duration, fusionCry.totalDuration * 1000); duration = Math.min(duration, fusionCry.totalDuration * 1000);
@ -3543,7 +3543,6 @@ export default interface Pokemon {
export class PlayerPokemon extends Pokemon { export class PlayerPokemon extends Pokemon {
public compatibleTms: Moves[]; public compatibleTms: Moves[];
public usedTms: Moves[];
constructor(scene: BattleScene, species: PokemonSpecies, level: integer, abilityIndex?: integer, formIndex?: integer, gender?: Gender, shiny?: boolean, variant?: Variant, ivs?: integer[], nature?: Nature, dataSource?: Pokemon | PokemonData) { constructor(scene: BattleScene, species: PokemonSpecies, level: integer, abilityIndex?: integer, formIndex?: integer, gender?: Gender, shiny?: boolean, variant?: Variant, ivs?: integer[], nature?: Nature, dataSource?: Pokemon | PokemonData) {
super(scene, 106, 148, species, level, abilityIndex, formIndex, gender, shiny, variant, ivs, nature, dataSource); super(scene, 106, 148, species, level, abilityIndex, formIndex, gender, shiny, variant, ivs, nature, dataSource);
@ -3567,7 +3566,6 @@ export class PlayerPokemon extends Pokemon {
} }
} }
this.generateCompatibleTms(); this.generateCompatibleTms();
this.usedTms = [];
} }
initBattleInfo(): void { initBattleInfo(): void {

View File

@ -250,9 +250,9 @@ export class LoadingScene extends SceneBase {
} }
const availableLangs = ["en", "de", "it", "fr", "ja", "ko", "es", "pt-BR", "zh-CN"]; const availableLangs = ["en", "de", "it", "fr", "ja", "ko", "es", "pt-BR", "zh-CN"];
if (lang && availableLangs.includes(lang)) { if (lang && availableLangs.includes(lang)) {
this.loadImage("september-update-"+lang, "events"); this.loadImage("egg-update_"+lang, "events");
} else { } else {
this.loadImage("september-update-en", "events"); this.loadImage("egg-update_en", "events");
} }
this.loadAtlas("statuses", ""); this.loadAtlas("statuses", "");

View File

@ -1545,6 +1545,7 @@ const modifierPool: ModifierPool = {
new WeightedModifierType(modifierTypes.TEMP_STAT_STAGE_BOOSTER, 4), new WeightedModifierType(modifierTypes.TEMP_STAT_STAGE_BOOSTER, 4),
new WeightedModifierType(modifierTypes.BERRY, 2), new WeightedModifierType(modifierTypes.BERRY, 2),
new WeightedModifierType(modifierTypes.TM_COMMON, 2), new WeightedModifierType(modifierTypes.TM_COMMON, 2),
new WeightedModifierType(modifierTypes.VOUCHER, (party: Pokemon[], rerollCount: integer) => !party[0].scene.gameMode.isDaily ? Math.max(1 - rerollCount, 0) : 0, 1),
].map(m => { ].map(m => {
m.setTier(ModifierTier.COMMON); return m; m.setTier(ModifierTier.COMMON); return m;
}), }),
@ -1615,7 +1616,7 @@ const modifierPool: ModifierPool = {
new WeightedModifierType(modifierTypes.BASE_STAT_BOOSTER, 3), new WeightedModifierType(modifierTypes.BASE_STAT_BOOSTER, 3),
new WeightedModifierType(modifierTypes.TERA_SHARD, 1), new WeightedModifierType(modifierTypes.TERA_SHARD, 1),
new WeightedModifierType(modifierTypes.DNA_SPLICERS, (party: Pokemon[]) => party[0].scene.gameMode.isSplicedOnly && party.filter(p => !p.fusionSpecies).length > 1 ? 4 : 0), new WeightedModifierType(modifierTypes.DNA_SPLICERS, (party: Pokemon[]) => party[0].scene.gameMode.isSplicedOnly && party.filter(p => !p.fusionSpecies).length > 1 ? 4 : 0),
new WeightedModifierType(modifierTypes.VOUCHER, (party: Pokemon[], rerollCount: integer) => !party[0].scene.gameMode.isDaily ? Math.max(1 - rerollCount, 0) : 0, 1), new WeightedModifierType(modifierTypes.VOUCHER, (party: Pokemon[], rerollCount: integer) => !party[0].scene.gameMode.isDaily ? Math.max(3 - rerollCount * 3, 0) : 0, 3),
].map(m => { ].map(m => {
m.setTier(ModifierTier.GREAT); return m; m.setTier(ModifierTier.GREAT); return m;
}), }),
@ -1696,7 +1697,7 @@ const modifierPool: ModifierPool = {
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),
new WeightedModifierType(modifierTypes.DYNAMAX_BAND, (party: Pokemon[]) => Math.min(Math.ceil(party[0].scene.currentBattle.waveIndex / 50), 4) * 9, 36), new WeightedModifierType(modifierTypes.DYNAMAX_BAND, (party: Pokemon[]) => Math.min(Math.ceil(party[0].scene.currentBattle.waveIndex / 50), 4) * 9, 36),
new WeightedModifierType(modifierTypes.VOUCHER_PLUS, (party: Pokemon[], rerollCount: integer) => !party[0].scene.gameMode.isDaily ? Math.max(3 - rerollCount * 1, 0) : 0, 3), new WeightedModifierType(modifierTypes.VOUCHER_PLUS, (party: Pokemon[], rerollCount: integer) => !party[0].scene.gameMode.isDaily ? Math.max(9 - rerollCount * 3, 0) : 0, 9),
].map(m => { ].map(m => {
m.setTier(ModifierTier.ROGUE); return m; m.setTier(ModifierTier.ROGUE); return m;
}), }),
@ -1705,7 +1706,7 @@ const modifierPool: ModifierPool = {
new WeightedModifierType(modifierTypes.SHINY_CHARM, 14), new WeightedModifierType(modifierTypes.SHINY_CHARM, 14),
new WeightedModifierType(modifierTypes.HEALING_CHARM, 18), new WeightedModifierType(modifierTypes.HEALING_CHARM, 18),
new WeightedModifierType(modifierTypes.MULTI_LENS, 18), new WeightedModifierType(modifierTypes.MULTI_LENS, 18),
new WeightedModifierType(modifierTypes.VOUCHER_PREMIUM, (party: Pokemon[], rerollCount: integer) => !party[0].scene.gameMode.isDaily && !party[0].scene.gameMode.isEndless && !party[0].scene.gameMode.isSplicedOnly ? Math.max(5 - rerollCount * 2, 0) : 0, 5), new WeightedModifierType(modifierTypes.VOUCHER_PREMIUM, (party: Pokemon[], rerollCount: integer) => !party[0].scene.gameMode.isDaily && !party[0].scene.gameMode.isEndless && !party[0].scene.gameMode.isSplicedOnly ? Math.max(15 - rerollCount * 5, 0) : 0, 15),
new WeightedModifierType(modifierTypes.DNA_SPLICERS, (party: Pokemon[]) => !party[0].scene.gameMode.isSplicedOnly && party.filter(p => !p.fusionSpecies).length > 1 ? 24 : 0, 24), new WeightedModifierType(modifierTypes.DNA_SPLICERS, (party: Pokemon[]) => !party[0].scene.gameMode.isSplicedOnly && party.filter(p => !p.fusionSpecies).length > 1 ? 24 : 0, 24),
new WeightedModifierType(modifierTypes.MINI_BLACK_HOLE, (party: Pokemon[]) => (!party[0].scene.gameMode.isFreshStartChallenge() && party[0].scene.gameData.unlocks[Unlockables.MINI_BLACK_HOLE]) ? 1 : 0, 1), new WeightedModifierType(modifierTypes.MINI_BLACK_HOLE, (party: Pokemon[]) => (!party[0].scene.gameMode.isFreshStartChallenge() && party[0].scene.gameData.unlocks[Unlockables.MINI_BLACK_HOLE]) ? 1 : 0, 1),
].map(m => { ].map(m => {

View File

@ -367,6 +367,10 @@ export abstract class LapsingPersistentModifier extends PersistentModifier {
return container; return container;
} }
getIconStackText(_scene: BattleScene, _virtual?: boolean): Phaser.GameObjects.BitmapText | null {
return null;
}
getBattleCount(): number { getBattleCount(): number {
return this.battleCount; return this.battleCount;
} }
@ -384,7 +388,8 @@ export abstract class LapsingPersistentModifier extends PersistentModifier {
} }
getMaxStackCount(_scene: BattleScene, _forThreshold?: boolean): number { getMaxStackCount(_scene: BattleScene, _forThreshold?: boolean): number {
return 1; // Must be an abitrary number greater than 1
return 2;
} }
} }
@ -787,7 +792,7 @@ export class TerastallizeModifier extends LapsingPokemonHeldItemModifier {
/** /**
* Modifier used for held items, specifically vitamins like Carbos, Hp Up, etc., that * Modifier used for held items, specifically vitamins like Carbos, Hp Up, etc., that
* increase the value of a given {@linkcode PermanentStat}. * increase the value of a given {@linkcode PermanentStat}.
* @extends LapsingPersistentModifier * @extends PokemonHeldItemModifier
* @see {@linkcode apply} * @see {@linkcode apply}
*/ */
export class BaseStatModifier extends PokemonHeldItemModifier { export class BaseStatModifier extends PokemonHeldItemModifier {

View File

@ -448,6 +448,7 @@ export class EggHatchPhase extends Phase {
*/ */
generatePokemon(): PlayerPokemon { generatePokemon(): PlayerPokemon {
this.eggHatchData = this.eggLapsePhase.generatePokemon(this.egg); this.eggHatchData = this.eggLapsePhase.generatePokemon(this.egg);
this.eggMoveIndex = this.eggHatchData.eggMoveIndex;
return this.eggHatchData.pokemon; return this.eggHatchData.pokemon;
} }
} }

View File

@ -43,8 +43,9 @@ export class EggSummaryPhase extends Phase {
} }
end() { end() {
this.eggHatchHandler.clear(); this.scene.time.delayedCall(250, () => this.scene.setModifiersVisible(true));
this.scene.ui.setModeForceTransition(Mode.MESSAGE).then(() => {}); this.scene.ui.setModeForceTransition(Mode.MESSAGE).then(() => {
super.end(); super.end();
});
} }
} }

View File

@ -137,6 +137,9 @@ export class LearnMovePhase extends PlayerPartyMemberPokemonPhase {
*/ */
async learnMove(index: number, move: Move, pokemon: Pokemon, textMessage?: string) { async learnMove(index: number, move: Move, pokemon: Pokemon, textMessage?: string) {
if (this.fromTM) { if (this.fromTM) {
if (!pokemon.usedTMs) {
pokemon.usedTMs = [];
}
pokemon.usedTMs.push(this.moveId); pokemon.usedTMs.push(this.moveId);
} }
pokemon.setMove(index, this.moveId); pokemon.setMove(index, this.moveId);

View File

@ -204,7 +204,7 @@ export class MovePhase extends BattlePhase {
let success = this.move.getMove().applyConditions(this.pokemon, targets[0], this.move.getMove()); let success = this.move.getMove().applyConditions(this.pokemon, targets[0], this.move.getMove());
const cancelled = new Utils.BooleanHolder(false); const cancelled = new Utils.BooleanHolder(false);
let failedText = this.move.getMove().getFailedText(this.pokemon, targets[0], this.move.getMove(), cancelled); let failedText = this.move.getMove().getFailedText(this.pokemon, targets[0], this.move.getMove(), cancelled);
if (success && this.scene.arena.isMoveWeatherCancelled(this.move.getMove())) { if (success && this.scene.arena.isMoveWeatherCancelled(this.pokemon, this.move.getMove())) {
success = false; success = false;
} else if (success && this.scene.arena.isMoveTerrainCancelled(this.pokemon, this.targets, this.move.getMove())) { } else if (success && this.scene.arena.isMoveTerrainCancelled(this.pokemon, this.targets, this.move.getMove())) {
success = false; success = false;

View File

@ -30,7 +30,7 @@ export class TrainerVictoryPhase extends BattlePhase {
const trainerType = this.scene.currentBattle.trainer?.config.trainerType!; // TODO: is this bang correct? const trainerType = this.scene.currentBattle.trainer?.config.trainerType!; // TODO: is this bang correct?
if (vouchers.hasOwnProperty(TrainerType[trainerType])) { if (vouchers.hasOwnProperty(TrainerType[trainerType])) {
if (!this.scene.validateVoucher(vouchers[TrainerType[trainerType]]) && this.scene.currentBattle.trainer?.config.isBoss) { if (!this.scene.validateVoucher(vouchers[TrainerType[trainerType]]) && this.scene.currentBattle.trainer?.config.isBoss) {
this.scene.unshiftPhase(new ModifierRewardPhase(this.scene, [modifierTypes.VOUCHER, modifierTypes.VOUCHER, modifierTypes.VOUCHER_PLUS, modifierTypes.VOUCHER_PREMIUM][vouchers[TrainerType[trainerType]].voucherType])); this.scene.unshiftPhase(new ModifierRewardPhase(this.scene, [modifierTypes.VOUCHER_PLUS, modifierTypes.VOUCHER_PLUS, modifierTypes.VOUCHER_PLUS, modifierTypes.VOUCHER_PREMIUM][vouchers[TrainerType[trainerType]].voucherType]));
} }
} }

View File

@ -197,7 +197,7 @@ export function getAchievementDescription(localizationKey: string): string {
case "100_RIBBONS": case "100_RIBBONS":
return i18next.t("achv:RibbonAchv.description", {context: genderStr, "ribbonAmount": achvs._100_RIBBONS.ribbonAmount.toLocaleString("en-US")}); return i18next.t("achv:RibbonAchv.description", {context: genderStr, "ribbonAmount": achvs._100_RIBBONS.ribbonAmount.toLocaleString("en-US")});
case "TRANSFER_MAX_STAT_STAGE": case "TRANSFER_MAX_STAT_STAGE":
return i18next.t("achv:TRANSFER_MAX_BATTLE_STAT.description", { context: genderStr }); return i18next.t("achv:TRANSFER_MAX_STAT_STAGE.description", { context: genderStr });
case "MAX_FRIENDSHIP": case "MAX_FRIENDSHIP":
return i18next.t("achv:MAX_FRIENDSHIP.description", { context: genderStr }); return i18next.t("achv:MAX_FRIENDSHIP.description", { context: genderStr });
case "MEGA_EVOLVE": case "MEGA_EVOLVE":

View File

@ -31,7 +31,7 @@ export function applySessionDataPatches(data: SessionSaveData) {
// From [ stat, battlesLeft ] to [ stat, maxBattles, battleCount ] // From [ stat, battlesLeft ] to [ stat, maxBattles, battleCount ]
m.args = [ newStat, 5, m.args[1] ]; m.args = [ newStat, 5, m.args[1] ];
} else if (m.className === "DoubleBattleChanceBoosterModifier") { } else if (m.className === "DoubleBattleChanceBoosterModifier" && m.args.length === 1) {
let maxBattles: number; let maxBattles: number;
switch (m.typeId) { switch (m.typeId) {
case "MAX_LURE": case "MAX_LURE":
@ -53,6 +53,8 @@ export function applySessionDataPatches(data: SessionSaveData) {
data.enemyModifiers.forEach((m) => { data.enemyModifiers.forEach((m) => {
if (m.className === "PokemonBaseStatModifier") { if (m.className === "PokemonBaseStatModifier") {
m.className = "BaseStatModifier"; m.className = "BaseStatModifier";
} else if (m.className === "PokemonResetNegativeStatStageModifier") {
m.className = "ResetNegativeStatStageModifier";
} }
}); });
} }
@ -74,7 +76,7 @@ export function applySystemDataPatches(data: SystemSaveData) {
if (data.starterData) { if (data.starterData) {
// Migrate ability starter data if empty for caught species // Migrate ability starter data if empty for caught species
Object.keys(data.starterData).forEach(sd => { Object.keys(data.starterData).forEach(sd => {
if (data.dexData[sd].caughtAttr && !data.starterData[sd].abilityAttr) { if (data.dexData[sd]?.caughtAttr && (data.starterData[sd] && !data.starterData[sd].abilityAttr)) {
data.starterData[sd].abilityAttr = 1; data.starterData[sd].abilityAttr = 1;
} }
}); });
@ -102,9 +104,11 @@ export function applySystemDataPatches(data: SystemSaveData) {
// --- PATCHES --- // --- PATCHES ---
// Fix Starter Data // Fix Starter Data
if (data.gameVersion) {
for (const starterId of defaultStarterSpecies) { for (const starterId of defaultStarterSpecies) {
if (data.starterData[starterId]?.abilityAttr) {
data.starterData[starterId].abilityAttr |= AbilityAttr.ABILITY_1; data.starterData[starterId].abilityAttr |= AbilityAttr.ABILITY_1;
}
if (data.dexData[starterId]?.caughtAttr) {
data.dexData[starterId].caughtAttr |= DexAttr.FEMALE; data.dexData[starterId].caughtAttr |= DexAttr.FEMALE;
} }
} }

View File

@ -25,14 +25,14 @@ interface TimedEvent extends EventBanner {
const timedEvents: TimedEvent[] = [ const timedEvents: TimedEvent[] = [
{ {
name: "September Update", name: "Egg Skip Update",
eventType: EventType.GENERIC, eventType: EventType.GENERIC,
startDate: new Date(Date.UTC(2024, 7, 28, 0)), startDate: new Date(Date.UTC(2024, 8, 8, 0)),
endDate: new Date(Date.UTC(2024, 8, 15, 0)), endDate: new Date(Date.UTC(2024, 8, 12, 0)),
bannerKey: "september-update", bannerKey: "egg-update",
xPosition: 19, xPosition: 19,
yPosition: 115, yPosition: 120,
scale: 0.30, scale: 0.21,
availableLangs: ["en", "de", "it", "fr", "ja", "ko", "es", "pt-BR", "zh-CN"] availableLangs: ["en", "de", "it", "fr", "ja", "ko", "es", "pt-BR", "zh-CN"]
} }
]; ];
@ -94,9 +94,9 @@ export class TimedEventDisplay extends Phaser.GameObjects.Container {
let key = this.event.bannerKey; let key = this.event.bannerKey;
if (lang && this.event.availableLangs && this.event.availableLangs.length > 0) { if (lang && this.event.availableLangs && this.event.availableLangs.length > 0) {
if (this.event.availableLangs.includes(lang)) { if (this.event.availableLangs.includes(lang)) {
key += "-"+lang; key += "_"+lang;
} else { } else {
key += "-en"; key += "_en";
} }
} }
console.log(this.event.bannerKey); console.log(this.event.bannerKey);

View File

@ -102,6 +102,7 @@ export default class EggSummaryUiHandler extends MessageUiHandler {
this.pokemonBackgroundContainer.removeAll(true); this.pokemonBackgroundContainer.removeAll(true);
this.eggHatchBg.setVisible(false); this.eggHatchBg.setVisible(false);
this.getUi().hideTooltip(); this.getUi().hideTooltip();
// Note: Questions on garbage collection go to @frutescens // Note: Questions on garbage collection go to @frutescens
const activeKeys = this.scene.getActiveKeys(); const activeKeys = this.scene.getActiveKeys();
// Removing unnecessary sprites from animation manager // Removing unnecessary sprites from animation manager
@ -122,7 +123,6 @@ export default class EggSummaryUiHandler extends MessageUiHandler {
this.eggHatchData.length = 0; this.eggHatchData.length = 0;
// Removes Pokemon icons in EggSummaryUiHandler // Removes Pokemon icons in EggSummaryUiHandler
this.iconAnimHandler.removeAll(); this.iconAnimHandler.removeAll();
console.log("Egg Summary Handler cleared");
} }
/** /**
@ -264,7 +264,6 @@ export default class EggSummaryUiHandler extends MessageUiHandler {
if (phase instanceof EggSummaryPhase) { if (phase instanceof EggSummaryPhase) {
phase.end(); phase.end();
} }
ui.revertMode();
success = true; success = true;
} else { } else {
const count = this.eggHatchData.length; const count = this.eggHatchData.length;

View File

@ -60,7 +60,7 @@ export abstract class FormModalUiHandler extends ModalUiHandler {
const inputBg = addWindow(this.scene, 0, 0, 80, 16, false, false, 0, 0, WindowVariant.XTHIN); const inputBg = addWindow(this.scene, 0, 0, 80, 16, false, false, 0, 0, WindowVariant.XTHIN);
const isPassword = field.includes(i18next.t("menu:password")) || field.includes(i18next.t("menu:confirmPassword")); const isPassword = field.includes(i18next.t("menu:password")) || field.includes(i18next.t("menu:confirmPassword"));
const input = addTextInputObject(this.scene, 4, -2, 440, 116, TextStyle.TOOLTIP_CONTENT, { type: isPassword ? "password" : "text", maxLength: isPassword ? 64 : 18 }); const input = addTextInputObject(this.scene, 4, -2, 440, 116, TextStyle.TOOLTIP_CONTENT, { type: isPassword ? "password" : "text", maxLength: isPassword ? 64 : 20 });
input.setOrigin(0, 0); input.setOrigin(0, 0);
inputContainer.add(inputBg); inputContainer.add(inputBg);