Merge branch 'pagefaultgames:main' into main

pull/728/head
Zedarflight 2024-05-10 18:41:09 -07:00 committed by GitHub
commit 8abd7e2a1b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 102 additions and 80 deletions

View File

@ -1978,7 +1978,7 @@
},
{
"frameIndex": 0,
"resourceName": "PRAS- Sketch and Lick",
"resourceName": "PRAS- Sketch + Lick",
"bgX": 0,
"bgY": 0,
"opacity": 0,

View File

@ -759,6 +759,8 @@ export default class BattleScene extends SceneBase {
this.newArena(Overrides.STARTING_BIOME_OVERRIDE || Biome.TOWN);
this.field.setVisible(true);
this.arenaBgTransition.setPosition(0, 0);
this.arenaPlayer.setPosition(300, 0);
this.arenaPlayerTransition.setPosition(0, 0);

View File

@ -1,6 +1,6 @@
import { Moves } from "./enums/moves";
import { ChargeAnim, MoveChargeAnim, initMoveAnim, loadMoveAnimAssets } from "./battle-anims";
import { BattleEndPhase, MovePhase, NewBattlePhase, PartyEffectPhase, PartyStatusCurePhase, PokemonHealPhase, StatChangePhase, SwitchSummonPhase } from "../phases";
import { BattleEndPhase, MovePhase, NewBattlePhase, PartyStatusCurePhase, PokemonHealPhase, StatChangePhase, SwitchSummonPhase } from "../phases";
import { BattleStat, getBattleStatName } from "./battle-stat";
import { EncoreTag } from "./battler-tags";
import { BattlerTagType } from "./enums/battler-tag-type";

View File

@ -3181,9 +3181,9 @@ export function getStarterValueFriendshipCap(value: integer): integer {
}
export const starterPassiveAbilities = {
[Species.BULBASAUR]: Abilities.SOLAR_POWER,
[Species.CHARMANDER]: Abilities.INTIMIDATE,
[Species.SQUIRTLE]: Abilities.DAUNTLESS_SHIELD,
[Species.BULBASAUR]: Abilities.GRASSY_SURGE,
[Species.CHARMANDER]: Abilities.SHEER_FORCE,
[Species.SQUIRTLE]: Abilities.STURDY,
[Species.CATERPIE]: Abilities.MAGICIAN,
[Species.WEEDLE]: Abilities.TECHNICIAN,
[Species.PIDGEY]: Abilities.GALE_WINGS,
@ -3238,7 +3238,7 @@ export const starterPassiveAbilities = {
[Species.MAGIKARP]: Abilities.MULTISCALE,
[Species.LAPRAS]: Abilities.LIQUID_VOICE,
[Species.DITTO]: Abilities.GOOEY,
[Species.EEVEE]: Abilities.PROTEAN,
[Species.EEVEE]: Abilities.SIMPLE,
[Species.PORYGON]: Abilities.QUARK_DRIVE,
[Species.OMANYTE]: Abilities.ANGER_SHELL,
[Species.KABUTO]: Abilities.SHARPNESS,
@ -3246,18 +3246,18 @@ export const starterPassiveAbilities = {
[Species.ARTICUNO]: Abilities.SNOW_WARNING,
[Species.ZAPDOS]: Abilities.DRIZZLE,
[Species.MOLTRES]: Abilities.DROUGHT,
[Species.DRATINI]: Abilities.DELTA_STREAM,
[Species.DRATINI]: Abilities.AERILATE,
[Species.MEWTWO]: Abilities.NEUROFORCE,
[Species.MEW]: Abilities.PROTEAN,
[Species.CHIKORITA]: Abilities.THICK_FAT,
[Species.CYNDAQUIL]: Abilities.TURBOBLAZE,
[Species.CYNDAQUIL]: Abilities.DROUGHT,
[Species.TOTODILE]: Abilities.TOUGH_CLAWS,
[Species.SENTRET]: Abilities.FLUFFY,
[Species.HOOTHOOT]: Abilities.CURSED_BODY,
[Species.LEDYBA]: Abilities.PRANKSTER,
[Species.SPINARAK]: Abilities.PRANKSTER,
[Species.CHINCHOU]: Abilities.REGENERATOR,
[Species.PICHU]: Abilities.TRANSISTOR,
[Species.PICHU]: Abilities.ELECTRIC_SURGE,
[Species.CLEFFA]: Abilities.MAGIC_BOUNCE,
[Species.IGGLYBUFF]: Abilities.SERENE_GRACE,
[Species.TOGEPI]: Abilities.OPPORTUNIST,
@ -3299,7 +3299,7 @@ export const starterPassiveAbilities = {
[Species.RAIKOU]: Abilities.TRANSISTOR,
[Species.ENTEI]: Abilities.MOXIE,
[Species.SUICUNE]: Abilities.UNAWARE,
[Species.LARVITAR]: Abilities.SAND_FORCE,
[Species.LARVITAR]: Abilities.SAND_RUSH,
[Species.LUGIA]: Abilities.DELTA_STREAM,
[Species.HO_OH]: Abilities.MAGIC_GUARD,
[Species.CELEBI]: Abilities.GRASSY_SURGE,
@ -3364,8 +3364,8 @@ export const starterPassiveAbilities = {
[Species.CLAMPERL]: Abilities.SIMPLE,
[Species.RELICANTH]: Abilities.SOLID_ROCK,
[Species.LUVDISC]: Abilities.PICKUP,
[Species.BAGON]: Abilities.GALE_WINGS,
[Species.BELDUM]: Abilities.IRON_FIST,
[Species.BAGON]: Abilities.ADAPTABILITY,
[Species.BELDUM]: Abilities.LEVITATE,
[Species.REGIROCK]: Abilities.SAND_STREAM,
[Species.REGICE]: Abilities.SNOW_WARNING,
[Species.REGISTEEL]: Abilities.FILTER,
@ -3376,9 +3376,9 @@ export const starterPassiveAbilities = {
[Species.RAYQUAZA]: Abilities.UNNERVE,
[Species.JIRACHI]: Abilities.COMATOSE,
[Species.DEOXYS]: Abilities.PROTEAN,
[Species.TURTWIG]: Abilities.HARVEST,
[Species.CHIMCHAR]: Abilities.DEFIANT,
[Species.PIPLUP]: Abilities.SLUSH_RUSH,
[Species.TURTWIG]: Abilities.THICK_FAT,
[Species.CHIMCHAR]: Abilities.MOXIE,
[Species.PIPLUP]: Abilities.LIGHTNING_ROD,
[Species.STARLY]: Abilities.ROCK_HEAD,
[Species.BIDOOF]: Abilities.NEUROFORCE,
[Species.KRICKETOT]: Abilities.SOUNDPROOF,
@ -3431,7 +3431,7 @@ export const starterPassiveAbilities = {
[Species.VICTINI]: Abilities.SUPER_LUCK,
[Species.SNIVY]: Abilities.MULTISCALE,
[Species.TEPIG]: Abilities.ROCK_HEAD,
[Species.OSHAWOTT]: Abilities.QUICK_DRAW,
[Species.OSHAWOTT]: Abilities.INTREPID_SWORD,
[Species.PATRAT]: Abilities.STAKEOUT,
[Species.LILLIPUP]: Abilities.BALL_FETCH,
[Species.PURRLOIN]: Abilities.DEFIANT,
@ -3496,7 +3496,7 @@ export const starterPassiveAbilities = {
[Species.VULLABY]: Abilities.THICK_FAT,
[Species.HEATMOR]: Abilities.CONTRARY,
[Species.DURANT]: Abilities.TOUGH_CLAWS,
[Species.DEINO]: Abilities.BERSERK,
[Species.DEINO]: Abilities.PARENTAL_BOND,
[Species.LARVESTA]: Abilities.DROUGHT,
[Species.COBALION]: Abilities.INTREPID_SWORD,
[Species.TERRAKION]: Abilities.ROCKY_PAYLOAD,
@ -3510,8 +3510,8 @@ export const starterPassiveAbilities = {
[Species.KELDEO]: Abilities.GRIM_NEIGH,
[Species.MELOETTA]: Abilities.MINDS_EYE,
[Species.GENESECT]: Abilities.REGENERATOR,
[Species.CHESPIN]: Abilities.IRON_BARBS,
[Species.FENNEKIN]: Abilities.MAGIC_BOUNCE,
[Species.CHESPIN]: Abilities.DAUNTLESS_SHIELD,
[Species.FENNEKIN]: Abilities.PSYCHIC_SURGE,
[Species.FROAKIE]: Abilities.ADAPTABILITY,
[Species.BUNNELBY]: Abilities.GUTS,
[Species.FLETCHLING]: Abilities.RECKLESS,
@ -3548,7 +3548,7 @@ export const starterPassiveAbilities = {
[Species.HOOPA]: Abilities.OPPORTUNIST,
[Species.VOLCANION]: Abilities.FILTER,
[Species.ROWLET]: Abilities.SNIPER,
[Species.LITTEN]: Abilities.FLAME_BODY,
[Species.LITTEN]: Abilities.FUR_COAT,
[Species.POPPLIO]: Abilities.PUNK_ROCK,
[Species.PIKIPEK]: Abilities.ANGER_POINT,
[Species.YUNGOOS]: Abilities.HUGE_POWER,
@ -3581,7 +3581,7 @@ export const starterPassiveAbilities = {
[Species.BRUXISH]: Abilities.MULTISCALE,
[Species.DRAMPA]: Abilities.FLASH_FIRE,
[Species.DHELMISE]: Abilities.INFILTRATOR,
[Species.JANGMO_O]: Abilities.DANCER,
[Species.JANGMO_O]: Abilities.PUNK_ROCK,
[Species.TAPU_KOKO]: Abilities.TRANSISTOR,
[Species.TAPU_LELE]: Abilities.SHEER_FORCE,
[Species.TAPU_BULU]: Abilities.GRASS_PELT,
@ -3603,7 +3603,7 @@ export const starterPassiveAbilities = {
[Species.ZERAORA]: Abilities.TOUGH_CLAWS,
[Species.MELTAN]: Abilities.STEELY_SPIRIT,
[Species.GROOKEY]: Abilities.GRASS_PELT,
[Species.SCORBUNNY]: Abilities.RECKLESS,
[Species.SCORBUNNY]: Abilities.VICTORY_STAR,
[Species.SOBBLE]: Abilities.SUPER_LUCK,
[Species.SKWOVET]: Abilities.HONEY_GATHER,
[Species.ROOKIDEE]: Abilities.IRON_BARBS,
@ -3637,7 +3637,7 @@ export const starterPassiveAbilities = {
[Species.ARCTOZOLT]: Abilities.SAND_RUSH,
[Species.DRACOVISH]: Abilities.HUSTLE,
[Species.ARCTOVISH]: Abilities.STRONG_JAW,
[Species.DURALUDON]: Abilities.MEGA_LAUNCHER,
[Species.DURALUDON]: Abilities.DOWNLOAD,
[Species.DREEPY]: Abilities.PARENTAL_BOND,
[Species.ZACIAN]: Abilities.UNNERVE,
[Species.ZAMAZENTA]: Abilities.STAMINA,
@ -3651,8 +3651,8 @@ export const starterPassiveAbilities = {
[Species.CALYREX]: Abilities.HARVEST,
[Species.ENAMORUS]: Abilities.FAIRY_AURA,
[Species.SPRIGATITO]: Abilities.MAGICIAN,
[Species.FUECOCO]: Abilities.EARTH_EATER,
[Species.QUAXLY]: Abilities.DANCER,
[Species.FUECOCO]: Abilities.PUNK_ROCK,
[Species.QUAXLY]: Abilities.DEFIANT,
[Species.LECHONK]: Abilities.SIMPLE,
[Species.TAROUNTULA]: Abilities.PICKUP,
[Species.NYMBLE]: Abilities.TECHNICIAN,
@ -3699,7 +3699,7 @@ export const starterPassiveAbilities = {
[Species.IRON_JUGULIS]: Abilities.AERILATE,
[Species.IRON_MOTH]: Abilities.LEVITATE,
[Species.IRON_THORNS]: Abilities.SAND_STREAM,
[Species.FRIGIBAX]: Abilities.THICK_FAT,
[Species.FRIGIBAX]: Abilities.SNOW_WARNING,
[Species.GIMMIGHOUL]: Abilities.SUPER_LUCK,
[Species.WO_CHIEN]: Abilities.GRASSY_SURGE,
[Species.CHIEN_PAO]: Abilities.INTREPID_SWORD,

View File

@ -2,7 +2,7 @@ import BattleScene, { AnySound, 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";
import { allMoves, applyMoveAttrs, BypassSleepAttr, ChargeAttr, applyFilteredMoveAttrs, HitsTagAttr, MissEffectAttr, MoveAttr, MoveEffectAttr, MoveFlags, MultiHitAttr, OverrideMoveEffectAttr, VariableAccuracyAttr, MoveTarget, OneHitKOAttr, getMoveTargets, MoveTargetSet, MoveEffectTrigger, CopyMoveAttr, AttackMove, SelfStatusMove, DelayedAttackAttr, RechargeAttr, PreMoveMessageAttr, HealStatusEffectAttr, IgnoreOpponentStatChangesAttr, NoEffectAttr, BypassRedirectAttr ,FixedDamageAttr, PostVictoryStatChangeAttr, OneHitKOAccuracyAttr, ForceSwitchOutAttr, VariableTargetAttr } from "./data/move";
import { allMoves, applyMoveAttrs, BypassSleepAttr, ChargeAttr, applyFilteredMoveAttrs, HitsTagAttr, MissEffectAttr, MoveAttr, MoveEffectAttr, MoveFlags, MultiHitAttr, OverrideMoveEffectAttr, VariableAccuracyAttr, MoveTarget, OneHitKOAttr, getMoveTargets, MoveTargetSet, MoveEffectTrigger, CopyMoveAttr, AttackMove, SelfStatusMove, DelayedAttackAttr, RechargeAttr, PreMoveMessageAttr, HealStatusEffectAttr, IgnoreOpponentStatChangesAttr, NoEffectAttr, BypassRedirectAttr, FixedDamageAttr, PostVictoryStatChangeAttr, OneHitKOAccuracyAttr, ForceSwitchOutAttr, VariableTargetAttr } from "./data/move";
import { Mode } from './ui/ui';
import { Command } from "./ui/command-ui-handler";
import { Stat } from "./data/pokemon-stat";
@ -3484,8 +3484,6 @@ export class GameOverModifierRewardPhase extends ModifierRewardPhase {
return new Promise<void>(resolve => {
const newModifier = this.modifierType.newModifier();
this.scene.addModifier(newModifier).then(() => {
this.scene.gameData.saveSystem().then(success => {
if (success) {
this.scene.playSound('level_up_fanfare');
this.scene.ui.setMode(Mode.MESSAGE);
this.scene.arenaBg.setVisible(false);
@ -3495,9 +3493,6 @@ export class GameOverModifierRewardPhase extends ModifierRewardPhase {
resolve();
}, null, true, 1500);
});
} else
this.scene.reset(true);
});
});
})
}
@ -3516,8 +3511,6 @@ export class RibbonModifierRewardPhase extends ModifierRewardPhase {
return new Promise<void>(resolve => {
const newModifier = this.modifierType.newModifier();
this.scene.addModifier(newModifier).then(() => {
this.scene.gameData.saveSystem().then(success => {
if (success) {
this.scene.playSound('level_up_fanfare');
this.scene.ui.setMode(Mode.MESSAGE);
this.scene.arenaBg.setVisible(false);
@ -3526,9 +3519,6 @@ export class RibbonModifierRewardPhase extends ModifierRewardPhase {
resolve();
}, null, true, 1500);
});
} else
this.scene.reset(true);
});
});
})
}
@ -3548,7 +3538,7 @@ export class GameOverPhase extends BattlePhase {
super.start();
if (this.victory || !this.scene.enableRetries)
this.handleClearSession();
this.handleGameOver();
else {
this.scene.ui.showText(`Would you like to retry from the start of the battle?`, null, () => {
this.scene.ui.setMode(Mode.CONFIRM, () => {
@ -3573,18 +3563,16 @@ export class GameOverPhase extends BattlePhase {
this.end();
});
});
}, () => this.handleClearSession(), false, 0, 0, 1000);
}, () => this.handleGameOver(), false, 0, 0, 1000);
});
}
}
handleClearSession(): void {
this.scene.gameData.tryClearSession(this.scene, this.scene.sessionSlotId).then((success: boolean | [boolean, boolean]) => {
if (!success[0])
return this.scene.reset(true);
handleGameOver(): void {
const doGameOver = (newClear: boolean) => {
this.scene.time.delayedCall(1000, () => {
let firstClear = false;
if (this.victory && success[1]) {
if (this.victory && newClear) {
if (this.scene.gameMode.isClassic) {
firstClear = this.scene.validateAchv(achvs.CLASSIC_VICTORY);
this.scene.gameData.gameStats.sessionsWon++;
@ -3595,29 +3583,37 @@ export class GameOverPhase extends BattlePhase {
this.awardRibbon(pokemon, true);
}
}
} else if (this.scene.gameMode.isDaily && success[1])
} else if (this.scene.gameMode.isDaily && newClear)
this.scene.gameData.gameStats.dailyRunSessionsWon++;
}
this.scene.gameData.saveSystem();
const fadeDuration = this.victory ? 10000 : 5000;
this.scene.fadeOutBgm(fadeDuration, true);
const activeBattlers = this.scene.getField().filter(p => p?.isActive(true));
activeBattlers.map(p => p.hideInfo());
this.scene.ui.fadeOut(fadeDuration).then(() => {
[ this.scene.field, ...activeBattlers ].map(a => a.setVisible(false));
this.scene.setFieldScale(1, true);
this.scene.clearPhaseQueue();
this.scene.ui.clearText();
if (newClear)
this.handleUnlocks();
if (this.victory && success[1]) {
if (this.victory && newClear) {
for (let species of this.firstRibbons)
this.scene.unshiftPhase(new RibbonModifierRewardPhase(this.scene, modifierTypes.VOUCHER_PLUS, species));
if (!firstClear)
this.scene.unshiftPhase(new GameOverModifierRewardPhase(this.scene, modifierTypes.VOUCHER_PREMIUM));
}
this.scene.reset();
this.scene.unshiftPhase(new TitlePhase(this.scene));
this.scene.pushPhase(new PostGameOverPhase(this.scene));
this.end();
});
});
});
};
if (this.victory) {
Utils.apiFetch(`savedata/newclear?slot=${this.scene.sessionSlotId}`, true)
.then(response => response.json())
.then(newClear => doGameOver(newClear));
} else
doGameOver(false);
}
handleUnlocks(): void {
@ -3653,8 +3649,6 @@ export class UnlockPhase extends Phase {
start(): void {
this.scene.time.delayedCall(2000, () => {
this.scene.gameData.unlocks[this.unlockable] = true;
this.scene.gameData.saveSystem().then(success => {
if (success) {
this.scene.playSound('level_up_fanfare');
this.scene.ui.setMode(Mode.MESSAGE);
this.scene.arenaBg.setVisible(false);
@ -3664,8 +3658,27 @@ export class UnlockPhase extends Phase {
this.end();
}, null, true, 1500);
});
} else
this.scene.reset(true);
});
}
}
export class PostGameOverPhase extends Phase {
constructor(scene: BattleScene) {
super(scene);
}
start() {
super.start();
this.scene.gameData.saveSystem().then(success => {
if (!success)
return this.scene.reset(true);
this.scene.gameData.tryClearSession(this.scene, this.scene.sessionSlotId).then((success: boolean | [boolean, boolean]) => {
if (!success[0])
return this.scene.reset(true);
this.scene.reset();
this.scene.unshiftPhase(new TitlePhase(this.scene));
this.end();
});
});
}

View File

@ -190,11 +190,14 @@ const systemShortKeys = {
natureAttr: '$na',
seenCount: '$s' ,
caughtCount: '$c',
hatchedCount: '$hc',
ivs: '$i',
moveset: '$m',
eggMoves: '$em',
candyCount: '$x',
passive: '$p',
friendship: '$f',
abilityAttr: '$a',
passiveAttr: '$pa',
valueReduction: '$vr',
classicWinCount: '$wc'
};
@ -454,6 +457,10 @@ export class GameData {
}
private convertSystemDataStr(dataStr: string, shorten: boolean = false): string {
if (!shorten) {
// Account for past key oversight
dataStr = dataStr.replace(/\$pAttr/g, '$pa');
}
const fromKeys = shorten ? Object.keys(systemShortKeys) : Object.values(systemShortKeys);
const toKeys = shorten ? Object.values(systemShortKeys) : Object.keys(systemShortKeys);
for (let k in fromKeys)