Merge pull request #4167 from DayKev/beta

Synchronize beta with main
This commit is contained in:
Frederico Santos 2024-09-11 15:38:23 +01:00 committed by GitHub
commit abb133e253
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
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 playerParty = this.getParty();
playerParty.forEach(p => {
keys.push("pkmn__" + p.species.getSpriteId(p.gender === Gender.FEMALE, p.species.formIndex, p.shiny, p.variant));
keys.push("pkmn__" + p.species.getSpriteId(p.gender === Gender.FEMALE, p.species.formIndex, p.shiny, p.variant, true));
keys.push("cry/" + p.species.getCryKey(p.species.formIndex));
if (p.fusionSpecies && p.getSpeciesForm() !== p.getFusionSpeciesForm()) {
keys.push("cry/"+p.getFusionSpeciesForm().getCryKey(p.fusionSpecies.formIndex));
keys.push(p.getSpriteKey(true));
keys.push(p.getBattleSpriteKey(true, true));
keys.push("cry/" + p.species.getCryKey(p.formIndex));
if (p.fusionSpecies) {
keys.push("cry/"+p.fusionSpecies.getCryKey(p.fusionFormIndex));
}
});
// enemyParty has to be operated on separately from playerParty because playerPokemon =/= enemyPokemon
const enemyParty = this.getEnemyParty();
enemyParty.forEach(p => {
keys.push(p.species.getSpriteKey(p.gender === Gender.FEMALE, p.species.formIndex, p.shiny, p.variant));
keys.push("cry/" + p.species.getCryKey(p.species.formIndex));
if (p.fusionSpecies && p.getSpeciesForm() !== p.getFusionSpeciesForm()) {
keys.push("cry/"+p.getFusionSpeciesForm().getCryKey(p.fusionSpecies.formIndex));
keys.push(p.getSpriteKey(true));
keys.push("cry/" + p.species.getCryKey(p.formIndex));
if (p.fusionSpecies) {
keys.push("cry/"+p.fusionSpecies.getCryKey(p.fusionFormIndex));
}
});
return keys;

View File

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

View File

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

View File

@ -391,8 +391,8 @@ export class Arena {
return true;
}
isMoveWeatherCancelled(move: Move) {
return this.weather && !this.weather.isEffectSuppressed(this.scene) && this.weather.isMoveWeatherCancelled(move);
isMoveWeatherCancelled(user: Pokemon, move: Move) {
return this.weather && !this.weather.isEffectSuppressed(this.scene) && this.weather.isMoveWeatherCancelled(user, 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);
}
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
let i = 0;
let rate = 0.85;
@ -2848,7 +2848,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
}
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 rate = 0.85;
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();
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;
fusionCry.stop();
duration = Math.min(duration, fusionCry.totalDuration * 1000);
@ -3543,7 +3543,6 @@ export default interface Pokemon {
export class PlayerPokemon extends Pokemon {
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) {
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.usedTms = [];
}
initBattleInfo(): void {

View File

@ -7,15 +7,15 @@ import { WindowVariant, getWindowVariantSuffix } from "./ui/ui-theme";
import { isMobile } from "./touch-controls";
import * as Utils from "./utils";
import { initI18n } from "./plugins/i18n";
import {initPokemonPrevolutions} from "#app/data/pokemon-evolutions";
import {initBiomes} from "#app/data/biomes";
import {initEggMoves} from "#app/data/egg-moves";
import {initPokemonForms} from "#app/data/pokemon-forms";
import {initSpecies} from "#app/data/pokemon-species";
import {initMoves} from "#app/data/move";
import {initAbilities} from "#app/data/ability";
import {initAchievements} from "#app/system/achv";
import {initTrainerTypeDialogue} from "#app/data/dialogue";
import { initPokemonPrevolutions } from "#app/data/pokemon-evolutions";
import { initBiomes } from "#app/data/biomes";
import { initEggMoves } from "#app/data/egg-moves";
import { initPokemonForms } from "#app/data/pokemon-forms";
import { initSpecies } from "#app/data/pokemon-species";
import { initMoves } from "#app/data/move";
import { initAbilities } from "#app/data/ability";
import { initAchievements } from "#app/system/achv";
import { initTrainerTypeDialogue } from "#app/data/dialogue";
import { initChallenges } from "./data/challenge";
import i18next from "i18next";
import { initStatsKeys } from "./ui/game-stats-ui-handler";
@ -250,9 +250,9 @@ export class LoadingScene extends SceneBase {
}
const availableLangs = ["en", "de", "it", "fr", "ja", "ko", "es", "pt-BR", "zh-CN"];
if (lang && availableLangs.includes(lang)) {
this.loadImage("september-update-"+lang, "events");
this.loadImage("egg-update_"+lang, "events");
} else {
this.loadImage("september-update-en", "events");
this.loadImage("egg-update_en", "events");
}
this.loadAtlas("statuses", "");

View File

@ -1545,6 +1545,7 @@ const modifierPool: ModifierPool = {
new WeightedModifierType(modifierTypes.TEMP_STAT_STAGE_BOOSTER, 4),
new WeightedModifierType(modifierTypes.BERRY, 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 => {
m.setTier(ModifierTier.COMMON); return m;
}),
@ -1615,7 +1616,7 @@ const modifierPool: ModifierPool = {
new WeightedModifierType(modifierTypes.BASE_STAT_BOOSTER, 3),
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.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 => {
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.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.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 => {
m.setTier(ModifierTier.ROGUE); return m;
}),
@ -1705,7 +1706,7 @@ const modifierPool: ModifierPool = {
new WeightedModifierType(modifierTypes.SHINY_CHARM, 14),
new WeightedModifierType(modifierTypes.HEALING_CHARM, 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.MINI_BLACK_HOLE, (party: Pokemon[]) => (!party[0].scene.gameMode.isFreshStartChallenge() && party[0].scene.gameData.unlocks[Unlockables.MINI_BLACK_HOLE]) ? 1 : 0, 1),
].map(m => {

View File

@ -367,6 +367,10 @@ export abstract class LapsingPersistentModifier extends PersistentModifier {
return container;
}
getIconStackText(_scene: BattleScene, _virtual?: boolean): Phaser.GameObjects.BitmapText | null {
return null;
}
getBattleCount(): number {
return this.battleCount;
}
@ -384,7 +388,8 @@ export abstract class LapsingPersistentModifier extends PersistentModifier {
}
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
* increase the value of a given {@linkcode PermanentStat}.
* @extends LapsingPersistentModifier
* @extends PokemonHeldItemModifier
* @see {@linkcode apply}
*/
export class BaseStatModifier extends PokemonHeldItemModifier {

View File

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

View File

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

View File

@ -137,6 +137,9 @@ export class LearnMovePhase extends PlayerPartyMemberPokemonPhase {
*/
async learnMove(index: number, move: Move, pokemon: Pokemon, textMessage?: string) {
if (this.fromTM) {
if (!pokemon.usedTMs) {
pokemon.usedTMs = [];
}
pokemon.usedTMs.push(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());
const cancelled = new Utils.BooleanHolder(false);
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;
} else if (success && this.scene.arena.isMoveTerrainCancelled(this.pokemon, this.targets, this.move.getMove())) {
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?
if (vouchers.hasOwnProperty(TrainerType[trainerType])) {
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

@ -7,7 +7,7 @@ import * as Utils from "../utils";
import { PlayerGender } from "#enums/player-gender";
import { Challenge, FreshStartChallenge, SingleGenerationChallenge, SingleTypeChallenge, InverseBattleChallenge } from "#app/data/challenge";
import { ConditionFn } from "#app/@types/common";
import { Stat, getShortenedStatKey } from "#app/enums/stat";
import { Stat, getShortenedStatKey } from "#app/enums/stat";
import { Challenges } from "#app/enums/challenges";
export enum AchvTier {
@ -197,7 +197,7 @@ export function getAchievementDescription(localizationKey: string): string {
case "100_RIBBONS":
return i18next.t("achv:RibbonAchv.description", {context: genderStr, "ribbonAmount": achvs._100_RIBBONS.ribbonAmount.toLocaleString("en-US")});
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":
return i18next.t("achv:MAX_FRIENDSHIP.description", { context: genderStr });
case "MEGA_EVOLVE":

View File

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

View File

@ -25,14 +25,14 @@ interface TimedEvent extends EventBanner {
const timedEvents: TimedEvent[] = [
{
name: "September Update",
name: "Egg Skip Update",
eventType: EventType.GENERIC,
startDate: new Date(Date.UTC(2024, 7, 28, 0)),
endDate: new Date(Date.UTC(2024, 8, 15, 0)),
bannerKey: "september-update",
startDate: new Date(Date.UTC(2024, 8, 8, 0)),
endDate: new Date(Date.UTC(2024, 8, 12, 0)),
bannerKey: "egg-update",
xPosition: 19,
yPosition: 115,
scale: 0.30,
yPosition: 120,
scale: 0.21,
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;
if (lang && this.event.availableLangs && this.event.availableLangs.length > 0) {
if (this.event.availableLangs.includes(lang)) {
key += "-"+lang;
key += "_"+lang;
} else {
key += "-en";
key += "_en";
}
}
console.log(this.event.bannerKey);

View File

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