added rule no-trailing-spaces (#1307)

This commit is contained in:
Greenlamp2 2024-05-24 01:45:04 +02:00 committed by GitHub
parent 68e94845ab
commit e2be6ba002
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
113 changed files with 771 additions and 767 deletions

View File

@ -22,7 +22,11 @@
"@typescript-eslint/no-extra-semi": ["error"], // Disallows unnecessary semicolons for TypeScript-specific syntax "@typescript-eslint/no-extra-semi": ["error"], // Disallows unnecessary semicolons for TypeScript-specific syntax
"brace-style": "off", // Note: you must disable the base rule as it can report incorrect errors "brace-style": "off", // Note: you must disable the base rule as it can report incorrect errors
"curly": ["error", "all"], // Enforces the use of curly braces for all control statements "curly": ["error", "all"], // Enforces the use of curly braces for all control statements
"@typescript-eslint/brace-style": ["error", "1tbs"] "@typescript-eslint/brace-style": ["error", "1tbs"],
"no-trailing-spaces": ["error", { // Disallows trailing whitespace at the end of lines
"skipBlankLines": false, // Enforces the rule even on blank lines
"ignoreComments": false // Enforces the rule on lines containing comments
}]
} }
} }
] ]

View File

@ -191,7 +191,7 @@ export default class BattleScene extends SceneBase {
initSpecies(); initSpecies();
initMoves(); initMoves();
initAbilities(); initAbilities();
this.phaseQueue = []; this.phaseQueue = [];
this.phaseQueuePrepend = []; this.phaseQueuePrepend = [];
this.phaseQueuePrependSpliceIndex = -1; this.phaseQueuePrependSpliceIndex = -1;
@ -553,17 +553,17 @@ export default class BattleScene extends SceneBase {
const species = getPokemonSpecies(parseInt(s)); const species = getPokemonSpecies(parseInt(s));
loadPokemonAssets.push(species.loadAssets(this, false, 0, false)); loadPokemonAssets.push(species.loadAssets(this, false, 0, false));
} }
Promise.all(loadPokemonAssets).then(() => { Promise.all(loadPokemonAssets).then(() => {
const starterCandyColors = {}; const starterCandyColors = {};
const rgbaToHexFunc = (r, g, b) => [r, g, b].map(x => x.toString(16).padStart(2, '0')).join(''); const rgbaToHexFunc = (r, g, b) => [r, g, b].map(x => x.toString(16).padStart(2, '0')).join('');
for (let s of Object.keys(speciesStarters)) { for (let s of Object.keys(speciesStarters)) {
const species = getPokemonSpecies(parseInt(s)); const species = getPokemonSpecies(parseInt(s));
starterCandyColors[species.speciesId] = species.generateCandyColors(this).map(c => rgbaToHexFunc(c[0], c[1], c[2])); starterCandyColors[species.speciesId] = species.generateCandyColors(this).map(c => rgbaToHexFunc(c[0], c[1], c[2]));
} }
console.log(JSON.stringify(starterCandyColors)); console.log(JSON.stringify(starterCandyColors));
resolve(); resolve();
@ -669,7 +669,7 @@ export default class BattleScene extends SceneBase {
addPokemonIcon(pokemon: Pokemon, x: number, y: number, originX: number = 0.5, originY: number = 0.5, ignoreOverride: boolean = false): Phaser.GameObjects.Container { addPokemonIcon(pokemon: Pokemon, x: number, y: number, originX: number = 0.5, originY: number = 0.5, ignoreOverride: boolean = false): Phaser.GameObjects.Container {
const container = this.add.container(x, y); const container = this.add.container(x, y);
const icon = this.add.sprite(0, 0, pokemon.getIconAtlasKey(ignoreOverride)); const icon = this.add.sprite(0, 0, pokemon.getIconAtlasKey(ignoreOverride));
icon.setFrame(pokemon.getIconId(true)); icon.setFrame(pokemon.getIconId(true));
// Temporary fix to show pokemon's default icon if variant icon doesn't exist // Temporary fix to show pokemon's default icon if variant icon doesn't exist
@ -695,7 +695,7 @@ export default class BattleScene extends SceneBase {
const originalFrame = icon.frame; const originalFrame = icon.frame;
const iconHeight = (icon.frame.cutHeight <= fusionIcon.frame.cutHeight ? Math.ceil : Math.floor)((icon.frame.cutHeight + fusionIcon.frame.cutHeight) / 4); const iconHeight = (icon.frame.cutHeight <= fusionIcon.frame.cutHeight ? Math.ceil : Math.floor)((icon.frame.cutHeight + fusionIcon.frame.cutHeight) / 4);
// Inefficient, but for some reason didn't work with only the unique properties as part of the name // Inefficient, but for some reason didn't work with only the unique properties as part of the name
const iconFrameId = `${icon.frame.name}f${fusionIcon.frame.name}`; const iconFrameId = `${icon.frame.name}f${fusionIcon.frame.name}`;
@ -760,7 +760,7 @@ export default class BattleScene extends SceneBase {
} }
this.gameMode = gameModes[GameModes.CLASSIC]; this.gameMode = gameModes[GameModes.CLASSIC];
this.setSeed(Overrides.SEED_OVERRIDE || Utils.randomString(24)); this.setSeed(Overrides.SEED_OVERRIDE || Utils.randomString(24));
console.log("Seed:", this.seed); console.log("Seed:", this.seed);
@ -789,7 +789,7 @@ export default class BattleScene extends SceneBase {
for (const p of this.getEnemyParty()) { for (const p of this.getEnemyParty()) {
p.destroy(); p.destroy();
} }
this.currentBattle = null; this.currentBattle = null;
this.waveCountText.setText(startingWave.toString()); this.waveCountText.setText(startingWave.toString());
@ -818,7 +818,7 @@ export default class BattleScene extends SceneBase {
this.trainer.setTexture(`trainer_${this.gameData.gender === PlayerGender.FEMALE ? "f" : "m"}_back`); this.trainer.setTexture(`trainer_${this.gameData.gender === PlayerGender.FEMALE ? "f" : "m"}_back`);
this.trainer.setPosition(406, 186); this.trainer.setPosition(406, 186);
this.trainer.setVisible(true); this.trainer.setVisible(true);
this.updateGameInfo(); this.updateGameInfo();
if (reloadI18n) { if (reloadI18n) {
@ -865,7 +865,7 @@ export default class BattleScene extends SceneBase {
this.resetSeed(newWaveIndex); this.resetSeed(newWaveIndex);
const playerField = this.getPlayerField(); const playerField = this.getPlayerField();
if (this.gameMode.hasFixedBattles && fixedBattles.hasOwnProperty(newWaveIndex) && trainerData === undefined) { if (this.gameMode.hasFixedBattles && fixedBattles.hasOwnProperty(newWaveIndex) && trainerData === undefined) {
battleConfig = fixedBattles[newWaveIndex]; battleConfig = fixedBattles[newWaveIndex];
newDouble = battleConfig.double; newDouble = battleConfig.double;
@ -986,7 +986,7 @@ export default class BattleScene extends SceneBase {
} }
} }
} }
return this.currentBattle; return this.currentBattle;
} }
@ -1157,7 +1157,7 @@ export default class BattleScene extends SceneBase {
if (!pokemon.pokerus || infectedIndexes.indexOf(p) > -1) { if (!pokemon.pokerus || infectedIndexes.indexOf(p) > -1) {
return; return;
} }
this.executeWithSeedOffset(() => { this.executeWithSeedOffset(() => {
if (p) { if (p) {
spread(p, -1); spread(p, -1);
@ -1622,7 +1622,7 @@ export default class BattleScene extends SceneBase {
this.currentPhase = this.phaseQueue.shift(); this.currentPhase = this.phaseQueue.shift();
this.currentPhase.start(); this.currentPhase.start();
} }
overridePhase(phase: Phase): boolean { overridePhase(phase: Phase): boolean {
if (this.standbyPhase) { if (this.standbyPhase) {
return false; return false;
@ -1721,7 +1721,7 @@ export default class BattleScene extends SceneBase {
this.queueMessage(`The stack for this item is full.\n You will receive ${defaultModifierType.name} instead.`, null, true); this.queueMessage(`The stack for this item is full.\n You will receive ${defaultModifierType.name} instead.`, null, true);
return this.addModifier(defaultModifierType.newModifier(), ignoreUpdate, playSound, false, instant).then(success => resolve(success)); return this.addModifier(defaultModifierType.newModifier(), ignoreUpdate, playSound, false, instant).then(success => resolve(success));
} }
for (const rm of modifiersToRemove) { for (const rm of modifiersToRemove) {
this.removeModifier(rm); this.removeModifier(rm);
} }
@ -1750,7 +1750,7 @@ export default class BattleScene extends SceneBase {
} else if (modifier instanceof FusePokemonModifier) { } else if (modifier instanceof FusePokemonModifier) {
args.push(this.getPokemonById(modifier.fusePokemonId) as PlayerPokemon); args.push(this.getPokemonById(modifier.fusePokemonId) as PlayerPokemon);
} }
if (modifier.shouldApply(args)) { if (modifier.shouldApply(args)) {
const result = modifier.apply(args); const result = modifier.apply(args);
if (result instanceof Promise) { if (result instanceof Promise) {
@ -1760,7 +1760,7 @@ export default class BattleScene extends SceneBase {
} }
} }
} }
return Promise.allSettled([this.party.map(p => p.updateInfo(instant)), ...modifierPromises]).then(() => resolve(success)); return Promise.allSettled([this.party.map(p => p.updateInfo(instant)), ...modifierPromises]).then(() => resolve(success));
} else { } else {
const args = [ this ]; const args = [ this ];
@ -2109,7 +2109,7 @@ export default class BattleScene extends SceneBase {
return false; return false;
} }
updateGameInfo(): void { updateGameInfo(): void {
const gameInfo = { const gameInfo = {
playTime: this.sessionPlayTime ? this.sessionPlayTime : 0, playTime: this.sessionPlayTime ? this.sessionPlayTime : 0,

View File

@ -89,7 +89,7 @@ export default class Battle {
this.moneyScattered = 0; this.moneyScattered = 0;
this.lastUsedPokeball = null; this.lastUsedPokeball = null;
} }
private initBattleSpec(): void { private initBattleSpec(): void {
let spec = BattleSpec.DEFAULT; let spec = BattleSpec.DEFAULT;
if (this.gameMode.isWaveFinal(this.waveIndex) && this.gameMode.isClassic) { if (this.gameMode.isWaveFinal(this.waveIndex) && this.gameMode.isClassic) {
@ -116,14 +116,14 @@ export default class Battle {
} }
let levelOffset = 0; let levelOffset = 0;
const deviation = 10 / levelWaveIndex; const deviation = 10 / levelWaveIndex;
levelOffset = Math.abs(this.randSeedGaussForLevel(deviation)); levelOffset = Math.abs(this.randSeedGaussForLevel(deviation));
return Math.max(Math.round(baseLevel + levelOffset), 1); return Math.max(Math.round(baseLevel + levelOffset), 1);
} }
randSeedGaussForLevel(value: number): number { randSeedGaussForLevel(value: number): number {
let rand = 0; let rand = 0;
for (let i = value; i > 0; i--) { for (let i = value; i > 0; i--) {
rand += Phaser.Math.RND.realInRange(0, 1); rand += Phaser.Math.RND.realInRange(0, 1);
@ -162,7 +162,7 @@ export default class Battle {
scene.applyModifiers(MoneyMultiplierModifier, true, moneyAmount); scene.applyModifiers(MoneyMultiplierModifier, true, moneyAmount);
scene.addMoney(moneyAmount.value); scene.addMoney(moneyAmount.value);
scene.queueMessage(`You picked up ₽${moneyAmount.value.toLocaleString("en-US")}!`, null, true); scene.queueMessage(`You picked up ₽${moneyAmount.value.toLocaleString("en-US")}!`, null, true);
scene.currentBattle.moneyScattered = 0; scene.currentBattle.moneyScattered = 0;

View File

@ -68,10 +68,10 @@ export class Ability implements Localizable {
const attr = new AttrType(...args); const attr = new AttrType(...args);
attr.addCondition(condition); attr.addCondition(condition);
this.attrs.push(attr); this.attrs.push(attr);
return this; return this;
} }
hasAttr(attrType: { new(...args: any[]): AbAttr }): boolean { hasAttr(attrType: { new(...args: any[]): AbAttr }): boolean {
return !!this.getAttrs(attrType).length; return !!this.getAttrs(attrType).length;
} }
@ -117,7 +117,7 @@ export abstract class AbAttr {
constructor(showAbility: boolean = true) { constructor(showAbility: boolean = true) {
this.showAbility = showAbility; this.showAbility = showAbility;
} }
apply(pokemon: Pokemon, passive: boolean, cancelled: Utils.BooleanHolder, args: any[]): boolean | Promise<boolean> { apply(pokemon: Pokemon, passive: boolean, cancelled: Utils.BooleanHolder, args: any[]): boolean | Promise<boolean> {
return false; return false;
} }
@ -218,7 +218,7 @@ export class PostBattleInitStatChangeAbAttr extends PostBattleInitAbAttr {
pokemon.scene.unshiftPhase(statChangePhase); pokemon.scene.unshiftPhase(statChangePhase);
} }
} }
return true; return true;
} }
} }
@ -257,7 +257,7 @@ export class PreDefendFullHpEndureAbAttr extends PreDefendAbAttr {
(args[0] as Utils.NumberHolder).value >= pokemon.hp){ //Damage >= hp (args[0] as Utils.NumberHolder).value >= pokemon.hp){ //Damage >= hp
return pokemon.addTag(BattlerTagType.STURDY, 1); return pokemon.addTag(BattlerTagType.STURDY, 1);
} }
return false; return false;
} }
} }
@ -265,7 +265,7 @@ export class PreDefendFullHpEndureAbAttr extends PreDefendAbAttr {
export class BlockItemTheftAbAttr extends AbAttr { export class BlockItemTheftAbAttr extends AbAttr {
apply(pokemon: Pokemon, passive: boolean, cancelled: Utils.BooleanHolder, args: any[]): boolean { apply(pokemon: Pokemon, passive: boolean, cancelled: Utils.BooleanHolder, args: any[]): boolean {
cancelled.value = true; cancelled.value = true;
return true; return true;
} }
@ -280,7 +280,7 @@ export class StabBoostAbAttr extends AbAttr {
(args[0] as Utils.NumberHolder).value += 0.5; (args[0] as Utils.NumberHolder).value += 0.5;
return true; return true;
} }
return false; return false;
} }
} }
@ -371,7 +371,7 @@ export class TypeImmunityHealAbAttr extends TypeImmunityAbAttr {
} }
return true; return true;
} }
return false; return false;
} }
} }
@ -397,7 +397,7 @@ class TypeImmunityStatChangeAbAttr extends TypeImmunityAbAttr {
pokemon.scene.unshiftPhase(new StatChangePhase(pokemon.scene, pokemon.getBattlerIndex(), true, [ this.stat ], this.levels)); pokemon.scene.unshiftPhase(new StatChangePhase(pokemon.scene, pokemon.getBattlerIndex(), true, [ this.stat ], this.levels));
} }
} }
return ret; return ret;
} }
} }
@ -423,7 +423,7 @@ class TypeImmunityAddBattlerTagAbAttr extends TypeImmunityAbAttr {
pokemon.addTag(this.tagType, this.turnCount, undefined, pokemon.id); pokemon.addTag(this.tagType, this.turnCount, undefined, pokemon.id);
} }
} }
return ret; return ret;
} }
} }
@ -458,7 +458,7 @@ export class PostDefendDisguiseAbAttr extends PostDefendAbAttr {
applyPostDefend(pokemon: Pokemon, passive: boolean, attacker: Pokemon, move: PokemonMove, hitResult: HitResult, args: any[]): boolean { applyPostDefend(pokemon: Pokemon, passive: boolean, attacker: Pokemon, move: PokemonMove, hitResult: HitResult, args: any[]): boolean {
if (pokemon.formIndex === 0 && pokemon.battleData.hitCount !== 0 && (move.getMove().category === MoveCategory.SPECIAL || move.getMove().category === MoveCategory.PHYSICAL)) { if (pokemon.formIndex === 0 && pokemon.battleData.hitCount !== 0 && (move.getMove().category === MoveCategory.SPECIAL || move.getMove().category === MoveCategory.PHYSICAL)) {
const recoilDamage = Math.ceil((pokemon.getMaxHp() / 8) - attacker.turnData.damageDealt); const recoilDamage = Math.ceil((pokemon.getMaxHp() / 8) - attacker.turnData.damageDealt);
if (!recoilDamage) { if (!recoilDamage) {
return false; return false;
@ -498,7 +498,7 @@ export class FieldPriorityMoveImmunityAbAttr extends PreDefendAbAttr {
const attackPriority = new Utils.IntegerHolder(move.getMove().priority); const attackPriority = new Utils.IntegerHolder(move.getMove().priority);
applyMoveAttrs(IncrementMovePriorityAttr,attacker,null,move.getMove(),attackPriority); applyMoveAttrs(IncrementMovePriorityAttr,attacker,null,move.getMove(),attackPriority);
applyAbAttrs(IncrementMovePriorityAbAttr, attacker, null, move.getMove(), attackPriority); applyAbAttrs(IncrementMovePriorityAbAttr, attacker, null, move.getMove(), attackPriority);
if(move.getMove().moveTarget===MoveTarget.USER) { if(move.getMove().moveTarget===MoveTarget.USER) {
return false; return false;
} }
@ -507,7 +507,7 @@ export class FieldPriorityMoveImmunityAbAttr extends PreDefendAbAttr {
cancelled.value = true; cancelled.value = true;
return true; return true;
} }
return false; return false;
} }
} }
@ -782,7 +782,7 @@ export class PostDefendCritStatChangeAbAttr extends PostDefendAbAttr {
applyPostDefend(pokemon: Pokemon, passive: boolean, attacker: Pokemon, move: PokemonMove, hitResult: HitResult, args: any[]): boolean { applyPostDefend(pokemon: Pokemon, passive: boolean, attacker: Pokemon, move: PokemonMove, hitResult: HitResult, args: any[]): boolean {
pokemon.scene.unshiftPhase(new StatChangePhase(pokemon.scene, pokemon.getBattlerIndex(), true, [ this.stat ], this.levels)); pokemon.scene.unshiftPhase(new StatChangePhase(pokemon.scene, pokemon.getBattlerIndex(), true, [ this.stat ], this.levels));
return true; return true;
} }
@ -799,14 +799,14 @@ export class PostDefendContactDamageAbAttr extends PostDefendAbAttr {
this.damageRatio = damageRatio; this.damageRatio = damageRatio;
} }
applyPostDefend(pokemon: Pokemon, passive: boolean, attacker: Pokemon, move: PokemonMove, hitResult: HitResult, args: any[]): boolean { applyPostDefend(pokemon: Pokemon, passive: boolean, attacker: Pokemon, move: PokemonMove, hitResult: HitResult, args: any[]): boolean {
if (move.getMove().checkFlag(MoveFlags.MAKES_CONTACT, attacker, pokemon)) { if (move.getMove().checkFlag(MoveFlags.MAKES_CONTACT, attacker, pokemon)) {
attacker.damageAndUpdate(Math.ceil(attacker.getMaxHp() * (1 / this.damageRatio)), HitResult.OTHER); attacker.damageAndUpdate(Math.ceil(attacker.getMaxHp() * (1 / this.damageRatio)), HitResult.OTHER);
attacker.turnData.damageTaken += Math.ceil(attacker.getMaxHp() * (1 / this.damageRatio)); attacker.turnData.damageTaken += Math.ceil(attacker.getMaxHp() * (1 / this.damageRatio));
return true; return true;
} }
return false; return false;
} }
@ -837,7 +837,7 @@ export class PostDefendAbilitySwapAbAttr extends PostDefendAbAttr {
constructor() { constructor() {
super(); super();
} }
applyPostDefend(pokemon: Pokemon, passive: boolean, attacker: Pokemon, move: PokemonMove, hitResult: HitResult, args: any[]): boolean { applyPostDefend(pokemon: Pokemon, passive: boolean, attacker: Pokemon, move: PokemonMove, hitResult: HitResult, args: any[]): boolean {
if (move.getMove().checkFlag(MoveFlags.MAKES_CONTACT, attacker, pokemon) && !attacker.getAbility().hasAttr(UnswappableAbilityAbAttr)) { if (move.getMove().checkFlag(MoveFlags.MAKES_CONTACT, attacker, pokemon) && !attacker.getAbility().hasAttr(UnswappableAbilityAbAttr)) {
const tempAbilityId = attacker.getAbility().id; const tempAbilityId = attacker.getAbility().id;
@ -845,7 +845,7 @@ export class PostDefendAbilitySwapAbAttr extends PostDefendAbAttr {
pokemon.summonData.ability = tempAbilityId; pokemon.summonData.ability = tempAbilityId;
return true; return true;
} }
return false; return false;
} }
@ -861,14 +861,14 @@ export class PostDefendAbilityGiveAbAttr extends PostDefendAbAttr {
super(); super();
this.ability = ability; this.ability = ability;
} }
applyPostDefend(pokemon: Pokemon, passive: boolean, attacker: Pokemon, move: PokemonMove, hitResult: HitResult, args: any[]): boolean { applyPostDefend(pokemon: Pokemon, passive: boolean, attacker: Pokemon, move: PokemonMove, hitResult: HitResult, args: any[]): boolean {
if (move.getMove().checkFlag(MoveFlags.MAKES_CONTACT, attacker, pokemon) && !attacker.getAbility().hasAttr(UnsuppressableAbilityAbAttr) && !attacker.getAbility().hasAttr(PostDefendAbilityGiveAbAttr)) { if (move.getMove().checkFlag(MoveFlags.MAKES_CONTACT, attacker, pokemon) && !attacker.getAbility().hasAttr(UnsuppressableAbilityAbAttr) && !attacker.getAbility().hasAttr(PostDefendAbilityGiveAbAttr)) {
attacker.summonData.ability = this.ability; attacker.summonData.ability = this.ability;
return true; return true;
} }
return false; return false;
} }
@ -887,7 +887,7 @@ export class PostDefendMoveDisableAbAttr extends PostDefendAbAttr {
this.chance = chance; this.chance = chance;
} }
applyPostDefend(pokemon: Pokemon, passive: boolean, attacker: Pokemon, move: PokemonMove, hitResult: HitResult, args: any[]): boolean { applyPostDefend(pokemon: Pokemon, passive: boolean, attacker: Pokemon, move: PokemonMove, hitResult: HitResult, args: any[]): boolean {
if (!attacker.summonData.disabledMove) { if (!attacker.summonData.disabledMove) {
if (move.getMove().checkFlag(MoveFlags.MAKES_CONTACT, attacker, pokemon) && (this.chance === -1 || pokemon.randSeedInt(100) < this.chance) && !attacker.isMax()) { if (move.getMove().checkFlag(MoveFlags.MAKES_CONTACT, attacker, pokemon) && (this.chance === -1 || pokemon.randSeedInt(100) < this.chance) && !attacker.isMax()) {
@ -946,7 +946,7 @@ export class VariableMovePowerAbAttr extends PreAttackAbAttr {
export class VariableMoveTypeAbAttr extends AbAttr { export class VariableMoveTypeAbAttr extends AbAttr {
apply(pokemon: Pokemon, passive: boolean, cancelled: Utils.BooleanHolder, args: any[]): boolean { apply(pokemon: Pokemon, passive: boolean, cancelled: Utils.BooleanHolder, args: any[]): boolean {
//const power = args[0] as Utils.IntegerHolder; //const power = args[0] as Utils.IntegerHolder;
return false; return false;
} }
} }
@ -969,7 +969,7 @@ export class MoveTypeChangePowerMultiplierAbAttr extends VariableMoveTypeAbAttr
(args[1] as Utils.NumberHolder).value *= this.powerMultiplier; (args[1] as Utils.NumberHolder).value *= this.powerMultiplier;
return true; return true;
} }
return false; return false;
} }
} }
@ -1008,8 +1008,8 @@ export class MoveTypeChangeAttr extends PreAttackAbAttr {
/** /**
* Class for abilities that boost the damage of moves * Class for abilities that boost the damage of moves
* For abilities that boost the base power of moves, see VariableMovePowerAbAttr * For abilities that boost the base power of moves, see VariableMovePowerAbAttr
* @param damageMultiplier the amount to multiply the damage by * @param damageMultiplier the amount to multiply the damage by
* @param condition the condition for this ability to be applied * @param condition the condition for this ability to be applied
*/ */
export class DamageBoostAbAttr extends PreAttackAbAttr { export class DamageBoostAbAttr extends PreAttackAbAttr {
private damageMultiplier: number; private damageMultiplier: number;
@ -1022,7 +1022,7 @@ export class DamageBoostAbAttr extends PreAttackAbAttr {
} }
/** /**
* *
* @param pokemon the attacker pokemon * @param pokemon the attacker pokemon
* @param passive N/A * @param passive N/A
* @param defender the target pokemon * @param defender the target pokemon
@ -1081,7 +1081,7 @@ export class LowHpMoveTypePowerBoostAbAttr extends MoveTypePowerBoostAbAttr {
export class FieldVariableMovePowerAbAttr extends AbAttr { export class FieldVariableMovePowerAbAttr extends AbAttr {
applyPreAttack(pokemon: Pokemon, passive: boolean, defender: Pokemon, move: PokemonMove, args: any[]): boolean { applyPreAttack(pokemon: Pokemon, passive: boolean, defender: Pokemon, move: PokemonMove, args: any[]): boolean {
//const power = args[0] as Utils.NumberHolder; //const power = args[0] as Utils.NumberHolder;
return false; return false;
} }
} }
@ -1210,7 +1210,7 @@ export class PostAttackApplyBattlerTagAbAttr extends PostAttackAbAttr {
private chance: (user: Pokemon, target: Pokemon, move: PokemonMove) => integer; private chance: (user: Pokemon, target: Pokemon, move: PokemonMove) => integer;
private effects: BattlerTagType[]; private effects: BattlerTagType[];
constructor(contactRequired: boolean, chance: (user: Pokemon, target: Pokemon, move: PokemonMove) => integer, ...effects: BattlerTagType[]) { constructor(contactRequired: boolean, chance: (user: Pokemon, target: Pokemon, move: PokemonMove) => integer, ...effects: BattlerTagType[]) {
super(); super();
@ -1287,7 +1287,7 @@ class PostVictoryStatChangeAbAttr extends PostVictoryAbAttr {
? this.stat(pokemon) ? this.stat(pokemon)
: this.stat; : this.stat;
pokemon.scene.unshiftPhase(new StatChangePhase(pokemon.scene, pokemon.getBattlerIndex(), true, [ stat ], this.levels)); pokemon.scene.unshiftPhase(new StatChangePhase(pokemon.scene, pokemon.getBattlerIndex(), true, [ stat ], this.levels));
return true; return true;
} }
} }
@ -1334,7 +1334,7 @@ export class PostKnockOutStatChangeAbAttr extends PostKnockOutAbAttr {
? this.stat(pokemon) ? this.stat(pokemon)
: this.stat; : this.stat;
pokemon.scene.unshiftPhase(new StatChangePhase(pokemon.scene, pokemon.getBattlerIndex(), true, [ stat ], this.levels)); pokemon.scene.unshiftPhase(new StatChangePhase(pokemon.scene, pokemon.getBattlerIndex(), true, [ stat ], this.levels));
return true; return true;
} }
} }
@ -1350,7 +1350,7 @@ export class CopyFaintedAllyAbilityAbAttr extends PostKnockOutAbAttr {
pokemon.scene.queueMessage(getPokemonMessage(knockedOut, `'s ${allAbilities[knockedOut.getAbility().id].name} was taken over!`)); pokemon.scene.queueMessage(getPokemonMessage(knockedOut, `'s ${allAbilities[knockedOut.getAbility().id].name} was taken over!`));
return true; return true;
} }
return false; return false;
} }
} }
@ -1366,7 +1366,7 @@ export class IgnoreOpponentStatChangesAbAttr extends AbAttr {
return true; return true;
} }
} }
/** /**
* Ignores opponent's evasion stat changes when determining if a move hits or not * Ignores opponent's evasion stat changes when determining if a move hits or not
* @extends AbAttr * @extends AbAttr
* @see {@linkcode apply} * @see {@linkcode apply}
@ -1382,14 +1382,14 @@ export class IgnoreOpponentEvasionAbAttr extends AbAttr {
* @param cancelled N/A * @param cancelled N/A
* @param args [0] {@linkcode Utils.IntegerHolder} of BattleStat.EVA * @param args [0] {@linkcode Utils.IntegerHolder} of BattleStat.EVA
* @returns if evasion level was successfully considered as 0 * @returns if evasion level was successfully considered as 0
*/ */
apply(pokemon: Pokemon, passive: boolean, cancelled: Utils.BooleanHolder, args: any[]) { apply(pokemon: Pokemon, passive: boolean, cancelled: Utils.BooleanHolder, args: any[]) {
(args[0] as Utils.IntegerHolder).value = 0; (args[0] as Utils.IntegerHolder).value = 0;
return true; return true;
} }
} }
export class IntimidateImmunityAbAttr extends AbAttr { export class IntimidateImmunityAbAttr extends AbAttr {
constructor() { constructor() {
super(false); super(false);
} }
@ -1404,7 +1404,7 @@ export class IntimidateImmunityAbAttr extends AbAttr {
} }
} }
export class PostIntimidateStatChangeAbAttr extends AbAttr { export class PostIntimidateStatChangeAbAttr extends AbAttr {
private stats: BattleStat[]; private stats: BattleStat[];
private levels: integer; private levels: integer;
private overwrites: boolean; private overwrites: boolean;
@ -1445,7 +1445,7 @@ export class PostSummonMessageAbAttr extends PostSummonAbAttr {
} }
} }
export class PostSummonUnnamedMessageAbAttr extends PostSummonAbAttr { export class PostSummonUnnamedMessageAbAttr extends PostSummonAbAttr {
//Attr doesn't force pokemon name on the message //Attr doesn't force pokemon name on the message
private message: string; private message: string;
@ -1455,7 +1455,7 @@ export class PostSummonUnnamedMessageAbAttr extends PostSummonAbAttr {
this.message = message; this.message = message;
} }
applyPostSummon(pokemon: Pokemon, passive: boolean, args: any[]): boolean { applyPostSummon(pokemon: Pokemon, passive: boolean, args: any[]): boolean {
pokemon.scene.queueMessage(this.message); pokemon.scene.queueMessage(this.message);
return true; return true;
@ -1534,7 +1534,7 @@ export class PostSummonAllyHealAbAttr extends PostSummonAbAttr {
Math.max(Math.floor(pokemon.getMaxHp() / this.healRatio), 1), getPokemonMessage(target, ` drank down all the\nmatcha that ${pokemon.name} made!`), true, !this.showAnim)); Math.max(Math.floor(pokemon.getMaxHp() / this.healRatio), 1), getPokemonMessage(target, ` drank down all the\nmatcha that ${pokemon.name} made!`), true, !this.showAnim));
return true; return true;
} }
return false; return false;
} }
} }
@ -1563,7 +1563,7 @@ export class PostSummonClearAllyStatsAbAttr extends PostSummonAbAttr {
return true; return true;
} }
return false; return false;
} }
} }
@ -1576,12 +1576,12 @@ export class DownloadAbAttr extends PostSummonAbAttr {
applyPostSummon(pokemon: Pokemon, passive: boolean, args: any[]): boolean { applyPostSummon(pokemon: Pokemon, passive: boolean, args: any[]): boolean {
this.enemyDef = 0; this.enemyDef = 0;
this.enemySpDef = 0; this.enemySpDef = 0;
for (const opponent of pokemon.getOpponents()) { for (const opponent of pokemon.getOpponents()) {
this.enemyDef += opponent.stats[BattleStat.DEF]; this.enemyDef += opponent.stats[BattleStat.DEF];
this.enemySpDef += opponent.stats[BattleStat.SPDEF]; this.enemySpDef += opponent.stats[BattleStat.SPDEF];
} }
if (this.enemyDef < this.enemySpDef) { if (this.enemyDef < this.enemySpDef) {
this.stats = [BattleStat.ATK]; this.stats = [BattleStat.ATK];
} else { } else {
@ -1592,7 +1592,7 @@ export class DownloadAbAttr extends PostSummonAbAttr {
pokemon.scene.unshiftPhase(new StatChangePhase(pokemon.scene, pokemon.getBattlerIndex(), false, this.stats, 1)); pokemon.scene.unshiftPhase(new StatChangePhase(pokemon.scene, pokemon.getBattlerIndex(), false, this.stats, 1));
return true; return true;
} }
return false; return false;
} }
} }
@ -1654,7 +1654,7 @@ export class TraceAbAttr extends PostSummonAbAttr {
if (!targets.length) { if (!targets.length) {
return false; return false;
} }
let target: Pokemon; let target: Pokemon;
if (targets.length > 1) { if (targets.length > 1) {
pokemon.scene.executeWithSeedOffset(() => target = Utils.randSeedItem(targets), pokemon.scene.currentBattle.waveIndex); pokemon.scene.executeWithSeedOffset(() => target = Utils.randSeedItem(targets), pokemon.scene.currentBattle.waveIndex);
@ -1702,7 +1702,7 @@ export class PostSummonTransformAbAttr extends PostSummonAbAttr {
pokemon.summonData.battleStats = target.summonData.battleStats.slice(0); pokemon.summonData.battleStats = target.summonData.battleStats.slice(0);
pokemon.summonData.moveset = target.getMoveset().map(m => new PokemonMove(m.moveId, m.ppUsed, m.ppUp)); pokemon.summonData.moveset = target.getMoveset().map(m => new PokemonMove(m.moveId, m.ppUsed, m.ppUp));
pokemon.summonData.types = target.getTypes(); pokemon.summonData.types = target.getTypes();
pokemon.scene.playSound("PRSFX- Transform"); pokemon.scene.playSound("PRSFX- Transform");
pokemon.loadAssets(false).then(() => pokemon.playAnim()); pokemon.loadAssets(false).then(() => pokemon.playAnim());
@ -1768,7 +1768,7 @@ export class ProtectStatAbAttr extends PreStatChangeAbAttr {
cancelled.value = true; cancelled.value = true;
return true; return true;
} }
return false; return false;
} }
@ -1885,7 +1885,7 @@ export class ConditionalCritAbAttr extends AbAttr {
/** /**
* @param pokemon {@linkcode Pokemon} user. * @param pokemon {@linkcode Pokemon} user.
* @param args [0] {@linkcode Utils.BooleanHolder} If true critical hit is guaranteed. * @param args [0] {@linkcode Utils.BooleanHolder} If true critical hit is guaranteed.
* [1] {@linkcode Pokemon} Target. * [1] {@linkcode Pokemon} Target.
* [2] {@linkcode Move} used by ability user. * [2] {@linkcode Move} used by ability user.
*/ */
@ -1930,7 +1930,7 @@ export class IncrementMovePriorityAbAttr extends AbAttr {
if (!this.moveIncrementFunc(pokemon, args[0] as Move)) { if (!this.moveIncrementFunc(pokemon, args[0] as Move)) {
return false; return false;
} }
(args[1] as Utils.IntegerHolder).value += this.increaseAmount; (args[1] as Utils.IntegerHolder).value += this.increaseAmount;
return true; return true;
} }
@ -2013,7 +2013,7 @@ function getAnticipationCondition(): AbAttrCondition {
+(opponent.ivs[Stat.SPD] & 1) * 8 +(opponent.ivs[Stat.SPD] & 1) * 8
+(opponent.ivs[Stat.SPATK] & 1) * 16 +(opponent.ivs[Stat.SPATK] & 1) * 16
+(opponent.ivs[Stat.SPDEF] & 1) * 32) * 15/63); +(opponent.ivs[Stat.SPDEF] & 1) * 32) * 15/63);
const type = [ const type = [
Type.FIGHTING, Type.FLYING, Type.POISON, Type.GROUND, Type.FIGHTING, Type.FLYING, Type.POISON, Type.GROUND,
Type.ROCK, Type.BUG, Type.GHOST, Type.STEEL, Type.ROCK, Type.BUG, Type.GHOST, Type.STEEL,
@ -2065,10 +2065,10 @@ export class ForewarnAbAttr extends PostSummonAbAttr {
} else { } else {
movePower = move.getMove().power; movePower = move.getMove().power;
} }
if (movePower > maxPowerSeen) { if (movePower > maxPowerSeen) {
maxPowerSeen = movePower; maxPowerSeen = movePower;
maxMove = move.getName(); maxMove = move.getName();
} }
} }
} }
@ -2142,7 +2142,7 @@ export class PostWeatherLapseHealAbAttr extends PostWeatherLapseAbAttr {
constructor(healFactor: integer, ...weatherTypes: WeatherType[]) { constructor(healFactor: integer, ...weatherTypes: WeatherType[]) {
super(...weatherTypes); super(...weatherTypes);
this.healFactor = healFactor; this.healFactor = healFactor;
} }
@ -2164,7 +2164,7 @@ export class PostWeatherLapseDamageAbAttr extends PostWeatherLapseAbAttr {
constructor(damageFactor: integer, ...weatherTypes: WeatherType[]) { constructor(damageFactor: integer, ...weatherTypes: WeatherType[]) {
super(...weatherTypes); super(...weatherTypes);
this.damageFactor = damageFactor; this.damageFactor = damageFactor;
} }
@ -2242,13 +2242,13 @@ export class PostTurnResetStatusAbAttr extends PostTurnAbAttr {
this.target = pokemon; this.target = pokemon;
} }
if (this.target?.status) { if (this.target?.status) {
this.target.scene.queueMessage(getPokemonMessage(this.target, getStatusEffectHealText(this.target.status?.effect))); this.target.scene.queueMessage(getPokemonMessage(this.target, getStatusEffectHealText(this.target.status?.effect)));
this.target.resetStatus(false); this.target.resetStatus(false);
this.target.updateInfo(); this.target.updateInfo();
return true; return true;
} }
return false; return false;
} }
} }
@ -2403,7 +2403,7 @@ export class PostTurnHurtIfSleepingAbAttr extends PostTurnAbAttr {
/** /**
* Deals damage to all sleeping opponents equal to 1/8 of their max hp (min 1) * Deals damage to all sleeping opponents equal to 1/8 of their max hp (min 1)
* @param {Pokemon} pokemon Pokemon that has this ability * @param {Pokemon} pokemon Pokemon that has this ability
* @param {boolean} passive N/A * @param {boolean} passive N/A
* @param {any[]} args N/A * @param {any[]} args N/A
* @returns {boolean} true if any opponents are sleeping * @returns {boolean} true if any opponents are sleeping
@ -2416,27 +2416,27 @@ export class PostTurnHurtIfSleepingAbAttr extends PostTurnAbAttr {
pokemon.scene.queueMessage(i18next.t("abilityTriggers:badDreams", {pokemonName: `${getPokemonPrefix(opp)}${opp.name}`})); pokemon.scene.queueMessage(i18next.t("abilityTriggers:badDreams", {pokemonName: `${getPokemonPrefix(opp)}${opp.name}`}));
hadEffect = true; hadEffect = true;
} }
} }
return hadEffect; return hadEffect;
} }
} }
/** /**
* Grabs the last failed Pokeball used * Grabs the last failed Pokeball used
* @extends PostTurnAbAttr * @extends PostTurnAbAttr
* @see {@linkcode applyPostTurn} */ * @see {@linkcode applyPostTurn} */
export class FetchBallAbAttr extends PostTurnAbAttr { export class FetchBallAbAttr extends PostTurnAbAttr {
constructor() { constructor() {
super(); super();
} }
/** /**
* Adds the last used Pokeball back into the player's inventory * Adds the last used Pokeball back into the player's inventory
* @param pokemon {@linkcode Pokemon} with this ability * @param pokemon {@linkcode Pokemon} with this ability
* @param passive N/A * @param passive N/A
* @param args N/A * @param args N/A
* @returns true if player has used a pokeball and this pokemon is owned by the player * @returns true if player has used a pokeball and this pokemon is owned by the player
*/ */
applyPostTurn(pokemon: Pokemon, passive: boolean, args: any[]): boolean { applyPostTurn(pokemon: Pokemon, passive: boolean, args: any[]): boolean {
const lastUsed = pokemon.scene.currentBattle.lastUsedPokeball; const lastUsed = pokemon.scene.currentBattle.lastUsedPokeball;
@ -2630,7 +2630,7 @@ export class PostFaintAbAttr extends AbAttr {
export class PostFaintContactDamageAbAttr extends PostFaintAbAttr { export class PostFaintContactDamageAbAttr extends PostFaintAbAttr {
private damageRatio: integer; private damageRatio: integer;
constructor(damageRatio: integer) { constructor(damageRatio: integer) {
super(); super();
@ -2657,7 +2657,7 @@ export class PostFaintContactDamageAbAttr extends PostFaintAbAttr {
} }
} }
/** /**
* Attribute used for abilities (Innards Out) that damage the opponent based on how much HP the last attack used to knock out the owner of the ability. * Attribute used for abilities (Innards Out) that damage the opponent based on how much HP the last attack used to knock out the owner of the ability.
*/ */
export class PostFaintHPDamageAbAttr extends PostFaintAbAttr { export class PostFaintHPDamageAbAttr extends PostFaintAbAttr {
@ -2670,7 +2670,7 @@ export class PostFaintHPDamageAbAttr extends PostFaintAbAttr {
attacker.damageAndUpdate((damage), HitResult.OTHER); attacker.damageAndUpdate((damage), HitResult.OTHER);
attacker.turnData.damageTaken += damage; attacker.turnData.damageTaken += damage;
return true; return true;
} }
getTriggerMessage(pokemon: Pokemon, abilityName: string, ...args: any[]): string { getTriggerMessage(pokemon: Pokemon, abilityName: string, ...args: any[]): string {
return getPokemonMessage(pokemon, `'s ${abilityName} hurt\nits attacker!`); return getPokemonMessage(pokemon, `'s ${abilityName} hurt\nits attacker!`);
@ -2690,7 +2690,7 @@ export class RedirectMoveAbAttr extends AbAttr {
return false; return false;
} }
canRedirect(moveId: Moves): boolean { canRedirect(moveId: Moves): boolean {
const move = allMoves[moveId]; const move = allMoves[moveId];
return !![ MoveTarget.NEAR_OTHER, MoveTarget.OTHER ].find(t => move.moveTarget === t); return !![ MoveTarget.NEAR_OTHER, MoveTarget.OTHER ].find(t => move.moveTarget === t);
@ -3031,7 +3031,7 @@ export function applyPostAttackAbAttrs(attrType: { new(...args: any[]): PostAtta
export function applyPostKnockOutAbAttrs(attrType: { new(...args: any[]): PostKnockOutAbAttr }, export function applyPostKnockOutAbAttrs(attrType: { new(...args: any[]): PostKnockOutAbAttr },
pokemon: Pokemon, knockedOut: Pokemon, ...args: any[]): Promise<void> { pokemon: Pokemon, knockedOut: Pokemon, ...args: any[]): Promise<void> {
return applyAbAttrsInternal<PostKnockOutAbAttr>(attrType, pokemon, (attr, passive) => attr.applyPostKnockOut(pokemon, passive, knockedOut, args), args); return applyAbAttrsInternal<PostKnockOutAbAttr>(attrType, pokemon, (attr, passive) => attr.applyPostKnockOut(pokemon, passive, knockedOut, args), args);
} }
export function applyPostVictoryAbAttrs(attrType: { new(...args: any[]): PostVictoryAbAttr }, export function applyPostVictoryAbAttrs(attrType: { new(...args: any[]): PostVictoryAbAttr },
pokemon: Pokemon, ...args: any[]): Promise<void> { pokemon: Pokemon, ...args: any[]): Promise<void> {
@ -3133,7 +3133,7 @@ export function initAbilities() {
new Ability(Abilities.BATTLE_ARMOR, 3) new Ability(Abilities.BATTLE_ARMOR, 3)
.attr(BlockCritAbAttr) .attr(BlockCritAbAttr)
.ignorable(), .ignorable(),
new Ability(Abilities.STURDY, 3) new Ability(Abilities.STURDY, 3)
.attr(PreDefendFullHpEndureAbAttr) .attr(PreDefendFullHpEndureAbAttr)
.attr(BlockOneHitKOAbAttr) .attr(BlockOneHitKOAbAttr)
.ignorable(), .ignorable(),
@ -3185,7 +3185,7 @@ export function initAbilities() {
.attr(IntimidateImmunityAbAttr) .attr(IntimidateImmunityAbAttr)
.ignorable(), .ignorable(),
new Ability(Abilities.SUCTION_CUPS, 3) new Ability(Abilities.SUCTION_CUPS, 3)
.attr(ForceSwitchOutImmunityAbAttr) .attr(ForceSwitchOutImmunityAbAttr)
.ignorable(), .ignorable(),
new Ability(Abilities.INTIMIDATE, 3) new Ability(Abilities.INTIMIDATE, 3)
.attr(PostSummonStatChangeAbAttr, BattleStat.ATK, -1, false, true), .attr(PostSummonStatChangeAbAttr, BattleStat.ATK, -1, false, true),
@ -3395,7 +3395,7 @@ export function initAbilities() {
.conditionalAttr(pokemon => pokemon.status ? pokemon.status.effect === StatusEffect.PARALYSIS : false, BattleStatMultiplierAbAttr, BattleStat.SPD, 2) .conditionalAttr(pokemon => pokemon.status ? pokemon.status.effect === StatusEffect.PARALYSIS : false, BattleStatMultiplierAbAttr, BattleStat.SPD, 2)
.conditionalAttr(pokemon => !!pokemon.status, BattleStatMultiplierAbAttr, BattleStat.SPD, 1.5), .conditionalAttr(pokemon => !!pokemon.status, BattleStatMultiplierAbAttr, BattleStat.SPD, 1.5),
new Ability(Abilities.NORMALIZE, 4) new Ability(Abilities.NORMALIZE, 4)
.attr(MoveTypeChangeAttr, Type.NORMAL, 1.2, (user, target, move) => move.id !== Moves.HIDDEN_POWER && move.id !== Moves.WEATHER_BALL && .attr(MoveTypeChangeAttr, Type.NORMAL, 1.2, (user, target, move) => move.id !== Moves.HIDDEN_POWER && move.id !== Moves.WEATHER_BALL &&
move.id !== Moves.NATURAL_GIFT && move.id !== Moves.JUDGMENT && move.id !== Moves.TECHNO_BLAST), move.id !== Moves.NATURAL_GIFT && move.id !== Moves.JUDGMENT && move.id !== Moves.TECHNO_BLAST),
new Ability(Abilities.SNIPER, 4) new Ability(Abilities.SNIPER, 4)
.attr(MultCritAbAttr, 1.5), .attr(MultCritAbAttr, 1.5),
@ -3519,8 +3519,8 @@ export function initAbilities() {
.attr(MovePowerBoostAbAttr, (user, target, move) => move.category === MoveCategory.SPECIAL && user.status?.effect === StatusEffect.BURN, 1.5), .attr(MovePowerBoostAbAttr, (user, target, move) => move.category === MoveCategory.SPECIAL && user.status?.effect === StatusEffect.BURN, 1.5),
new Ability(Abilities.HARVEST, 5) new Ability(Abilities.HARVEST, 5)
.attr( .attr(
PostTurnLootAbAttr, PostTurnLootAbAttr,
"EATEN_BERRIES", "EATEN_BERRIES",
/** Rate is doubled when under sun {@link https://dex.pokemonshowdown.com/abilities/harvest} */ /** Rate is doubled when under sun {@link https://dex.pokemonshowdown.com/abilities/harvest} */
(pokemon) => 0.5 * (getWeatherCondition(WeatherType.SUNNY, WeatherType.HARSH_SUN)(pokemon) ? 2 : 1) (pokemon) => 0.5 * (getWeatherCondition(WeatherType.SUNNY, WeatherType.HARSH_SUN)(pokemon) ? 2 : 1)
) )
@ -4034,7 +4034,7 @@ export function initAbilities() {
.attr(PostDefendApplyArenaTrapTagAbAttr, (target, user, move) => move.category === MoveCategory.PHYSICAL, ArenaTagType.TOXIC_SPIKES) .attr(PostDefendApplyArenaTrapTagAbAttr, (target, user, move) => move.category === MoveCategory.PHYSICAL, ArenaTagType.TOXIC_SPIKES)
.bypassFaint(), .bypassFaint(),
new Ability(Abilities.ARMOR_TAIL, 9) new Ability(Abilities.ARMOR_TAIL, 9)
.attr(FieldPriorityMoveImmunityAbAttr) .attr(FieldPriorityMoveImmunityAbAttr)
.ignorable(), .ignorable(),
new Ability(Abilities.EARTH_EATER, 9) new Ability(Abilities.EARTH_EATER, 9)
.attr(TypeImmunityHealAbAttr, Type.GROUND) .attr(TypeImmunityHealAbAttr, Type.GROUND)

View File

@ -103,7 +103,7 @@ export async function printPokemon() {
const offset = 0; const offset = 0;
const pokemonResponse = await api.pokemon.listPokemons(offset, 2000); const pokemonResponse = await api.pokemon.listPokemons(offset, 2000);
pokemonArr = pokemonResponse.results; pokemonArr = pokemonResponse.results;
const types = Utils.getEnumKeys(Type).map(t => t.toLowerCase()); const types = Utils.getEnumKeys(Type).map(t => t.toLowerCase());
@ -121,7 +121,7 @@ export async function printPokemon() {
if (!dexIdMatch) { if (!dexIdMatch) {
continue; continue;
} }
const matchingSpecies = pokemonSpeciesList[parseInt(dexIdMatch[1]) - 1]; const matchingSpecies = pokemonSpeciesList[parseInt(dexIdMatch[1]) - 1];
if (!matchingSpecies) { if (!matchingSpecies) {
@ -448,7 +448,7 @@ export async function printAbilities() {
const replaceText = true; const replaceText = true;
let abilityContent: string = await fs.readFile("./src/data/ability.ts"); let abilityContent: string = await fs.readFile("./src/data/ability.ts");
const api = new MainClient(); const api = new MainClient();
let enumStr = "export enum Abilities {\n NONE,"; let enumStr = "export enum Abilities {\n NONE,";
@ -516,7 +516,7 @@ export async function printMoves() {
const replaceText = true; const replaceText = true;
let moveContent: string = await fs.readFile("./src/data/move.ts"); let moveContent: string = await fs.readFile("./src/data/move.ts");
const api = new MainClient(); const api = new MainClient();
let enumStr = "export enum Moves {\n NONE,"; let enumStr = "export enum Moves {\n NONE,";
@ -528,7 +528,7 @@ export async function printMoves() {
const offset = 0; const offset = 0;
const movesResponse = await api.move.listMoves(offset, 2000); const movesResponse = await api.move.listMoves(offset, 2000);
moves = movesResponse.results; moves = movesResponse.results;
console.log(moves); console.log(moves);
for (const m of moves) { for (const m of moves) {
@ -594,7 +594,7 @@ export async function printTmSpecies() {
const api = new MainClient(); const api = new MainClient();
const moveIds = Object.keys(tmSpecies).map(k => parseInt(k) as Moves); const moveIds = Object.keys(tmSpecies).map(k => parseInt(k) as Moves);
for (const moveId of moveIds) { for (const moveId of moveIds) {
const move = await api.move.getMoveById(moveId); const move = await api.move.getMoveById(moveId);
@ -643,9 +643,9 @@ export async function printTmSpecies() {
console.log("NO MATCH", species.name); console.log("NO MATCH", species.name);
continue; continue;
} }
const speciesKey = Species[matchingSpecies.speciesId]; const speciesKey = Species[matchingSpecies.speciesId];
const matchingIndex = moveTmSpecies[moveId].findIndex(s => Array.isArray(s) ? s[0] === speciesKey : s === speciesKey); const matchingIndex = moveTmSpecies[moveId].findIndex(s => Array.isArray(s) ? s[0] === speciesKey : s === speciesKey);
if (matchingIndex === -1) { if (matchingIndex === -1) {

View File

@ -72,7 +72,7 @@ export class MistTag extends ArenaTag {
(args[0] as Utils.BooleanHolder).value = true; (args[0] as Utils.BooleanHolder).value = true;
arena.scene.queueMessage("The mist prevented\nthe lowering of stats!"); arena.scene.queueMessage("The mist prevented\nthe lowering of stats!");
return true; return true;
} }
} }
@ -161,7 +161,7 @@ class WishTag extends ArenaTag {
this.triggerMessage = getPokemonMessage(user, "'s wish\ncame true!"); this.triggerMessage = getPokemonMessage(user, "'s wish\ncame true!");
this.healHp = Math.max(Math.floor(user.getMaxHp() / 2), 1); this.healHp = Math.max(Math.floor(user.getMaxHp() / 2), 1);
} }
onRemove(arena: Arena): void { onRemove(arena: Arena): void {
const target = arena.scene.getField()[this.battlerIndex]; const target = arena.scene.getField()[this.battlerIndex];
if (target?.isActive(true)) { if (target?.isActive(true)) {
@ -299,7 +299,7 @@ class ToxicSpikesTag extends ArenaTrapTag {
onAdd(arena: Arena): void { onAdd(arena: Arena): void {
super.onAdd(arena); super.onAdd(arena);
const source = arena.scene.getPokemonById(this.sourceId); const source = arena.scene.getPokemonById(this.sourceId);
arena.scene.queueMessage(`${this.getMoveName()} were scattered\nall around ${source.getOpponentDescriptor()}'s feet!`); arena.scene.queueMessage(`${this.getMoveName()} were scattered\nall around ${source.getOpponentDescriptor()}'s feet!`);
} }
@ -322,7 +322,7 @@ class ToxicSpikesTag extends ArenaTrapTag {
const toxic = this.layers > 1; const toxic = this.layers > 1;
if (pokemon.trySetStatus(!toxic ? StatusEffect.POISON : StatusEffect.TOXIC, true, null, 0, `the ${this.getMoveName()}`)) { if (pokemon.trySetStatus(!toxic ? StatusEffect.POISON : StatusEffect.TOXIC, true, null, 0, `the ${this.getMoveName()}`)) {
return true; return true;
} }
} }
} }
@ -410,7 +410,7 @@ class StealthRockTag extends ArenaTrapTag {
if (cancelled.value) { if (cancelled.value) {
return false; return false;
} }
const damageHpRatio = this.getDamageHpRatio(pokemon); const damageHpRatio = this.getDamageHpRatio(pokemon);
if (damageHpRatio) { if (damageHpRatio) {

View File

@ -296,7 +296,7 @@ class ImportedAnimFrame extends AnimFrame {
abstract class AnimTimedEvent { abstract class AnimTimedEvent {
public frameIndex: integer; public frameIndex: integer;
public resourceName: string; public resourceName: string;
constructor(frameIndex: integer, resourceName: string) { constructor(frameIndex: integer, resourceName: string) {
this.frameIndex = frameIndex; this.frameIndex = frameIndex;
this.resourceName = resourceName; this.resourceName = resourceName;
@ -310,7 +310,7 @@ abstract class AnimTimedEvent {
class AnimTimedSoundEvent extends AnimTimedEvent { class AnimTimedSoundEvent extends AnimTimedEvent {
public volume: number = 100; public volume: number = 100;
public pitch: number = 100; public pitch: number = 100;
constructor(frameIndex: integer, resourceName: string, source?: any) { constructor(frameIndex: integer, resourceName: string, source?: any) {
super(frameIndex, resourceName); super(frameIndex, resourceName);
@ -813,7 +813,7 @@ export abstract class BattleAnim {
this.srcLine = [ userFocusX, userFocusY, targetFocusX, targetFocusY ]; this.srcLine = [ userFocusX, userFocusY, targetFocusX, targetFocusY ];
this.dstLine = [ userInitialX, userInitialY, targetInitialX, targetInitialY ]; this.dstLine = [ userInitialX, userInitialY, targetInitialX, targetInitialY ];
let r = anim.frames.length; let r = anim.frames.length;
let f = 0; let f = 0;
@ -855,7 +855,7 @@ export abstract class BattleAnim {
const pokemonSprite = sprites[spriteIndex]; const pokemonSprite = sprites[spriteIndex];
const graphicFrameData = frameData.get(frame.target).get(spriteIndex); const graphicFrameData = frameData.get(frame.target).get(spriteIndex);
pokemonSprite.setPosition(graphicFrameData.x, graphicFrameData.y - ((spriteSource.height / 2) * (spriteSource.parentContainer.scale - 1))); pokemonSprite.setPosition(graphicFrameData.x, graphicFrameData.y - ((spriteSource.height / 2) * (spriteSource.parentContainer.scale - 1)));
pokemonSprite.setAngle(graphicFrameData.angle); pokemonSprite.setAngle(graphicFrameData.angle);
pokemonSprite.setScale(graphicFrameData.scaleX * spriteSource.parentContainer.scale, graphicFrameData.scaleY * spriteSource.parentContainer.scale); pokemonSprite.setScale(graphicFrameData.scaleX * spriteSource.parentContainer.scale, graphicFrameData.scaleY * spriteSource.parentContainer.scale);
@ -873,7 +873,7 @@ export abstract class BattleAnim {
scene.field.add(newSprite); scene.field.add(newSprite);
spritePriorities.push(1); spritePriorities.push(1);
} }
const graphicIndex = g++; const graphicIndex = g++;
const moveSprite = sprites[graphicIndex]; const moveSprite = sprites[graphicIndex];
if (spritePriorities[graphicIndex] !== frame.priority) { if (spritePriorities[graphicIndex] !== frame.priority) {
@ -924,7 +924,7 @@ export abstract class BattleAnim {
} }
moveSprite.setFrame(frame.graphicFrame); moveSprite.setFrame(frame.graphicFrame);
//console.log(AnimFocus[frame.focus]); //console.log(AnimFocus[frame.focus]);
const graphicFrameData = frameData.get(frame.target).get(graphicIndex); const graphicFrameData = frameData.get(frame.target).get(graphicIndex);
moveSprite.setPosition(graphicFrameData.x, graphicFrameData.y); moveSprite.setPosition(graphicFrameData.x, graphicFrameData.y);
moveSprite.setAngle(graphicFrameData.angle); moveSprite.setAngle(graphicFrameData.angle);
@ -999,7 +999,7 @@ export class CommonBattleAnim extends BattleAnim {
export class MoveAnim extends BattleAnim { export class MoveAnim extends BattleAnim {
public move: Moves; public move: Moves;
constructor(move: Moves, user: Pokemon, target: BattlerIndex) { constructor(move: Moves, user: Pokemon, target: BattlerIndex) {
super(user, user.scene.getField()[target]); super(user, user.scene.getField()[target]);
@ -1027,7 +1027,7 @@ export class MoveAnim extends BattleAnim {
export class MoveChargeAnim extends MoveAnim { export class MoveChargeAnim extends MoveAnim {
private chargeAnim: ChargeAnim; private chargeAnim: ChargeAnim;
constructor(chargeAnim: ChargeAnim, move: Moves, user: Pokemon) { constructor(chargeAnim: ChargeAnim, move: Moves, user: Pokemon) {
super(move, user, 0); super(move, user, 0);
@ -1060,13 +1060,13 @@ export async function populateAnims() {
} }
const seNames = [];//(await fs.readdir('./public/audio/se/battle_anims/')).map(se => se.toString()); const seNames = [];//(await fs.readdir('./public/audio/se/battle_anims/')).map(se => se.toString());
const animsData = [];//battleAnimRawData.split('!ruby/array:PBAnimation').slice(1); const animsData = [];//battleAnimRawData.split('!ruby/array:PBAnimation').slice(1);
for (let a = 0; a < animsData.length; a++) { for (let a = 0; a < animsData.length; a++) {
const fields = animsData[a].split("@").slice(1); const fields = animsData[a].split("@").slice(1);
const nameField = fields.find(f => f.startsWith("name: ")); const nameField = fields.find(f => f.startsWith("name: "));
let isOppMove: boolean; let isOppMove: boolean;
let commonAnimId: CommonAnim; let commonAnimId: CommonAnim;
let chargeAnimId: ChargeAnim; let chargeAnimId: ChargeAnim;

View File

@ -41,7 +41,7 @@ export function getBattleStatLevelChangeDescription(levels: integer, up: boolean
case 4: case 4:
case 5: case 5:
case 6: case 6:
return "rose drastically"; return "rose drastically";
default: default:
return "won't go any higher"; return "won't go any higher";
} }

View File

@ -106,7 +106,7 @@ export class RechargingTag extends BattlerTag {
pokemon.scene.queueMessage(getPokemonMessage(pokemon, " must\nrecharge!")); pokemon.scene.queueMessage(getPokemonMessage(pokemon, " must\nrecharge!"));
(pokemon.scene.getCurrentPhase() as MovePhase).cancel(); (pokemon.scene.getCurrentPhase() as MovePhase).cancel();
pokemon.getMoveQueue().shift(); pokemon.getMoveQueue().shift();
return true; return true;
} }
} }
@ -115,7 +115,7 @@ export class TrappedTag extends BattlerTag {
constructor(tagType: BattlerTagType, lapseType: BattlerTagLapseType, turnCount: integer, sourceMove: Moves, sourceId: integer) { constructor(tagType: BattlerTagType, lapseType: BattlerTagLapseType, turnCount: integer, sourceMove: Moves, sourceId: integer) {
super(tagType, lapseType, turnCount, sourceMove, sourceId); super(tagType, lapseType, turnCount, sourceMove, sourceId);
} }
canAdd(pokemon: Pokemon): boolean { canAdd(pokemon: Pokemon): boolean {
const isGhost = pokemon.isOfType(Type.GHOST); const isGhost = pokemon.isOfType(Type.GHOST);
const isTrapped = pokemon.getTag(BattlerTagType.TRAPPED); const isTrapped = pokemon.getTag(BattlerTagType.TRAPPED);
@ -196,7 +196,7 @@ export class InterruptedTag extends BattlerTag {
lapse(pokemon: Pokemon, lapseType: BattlerTagLapseType): boolean { lapse(pokemon: Pokemon, lapseType: BattlerTagLapseType): boolean {
super.lapse(pokemon, lapseType); super.lapse(pokemon, lapseType);
(pokemon.scene.getCurrentPhase() as MovePhase).cancel(); (pokemon.scene.getCurrentPhase() as MovePhase).cancel();
return true; return true;
} }
} }
@ -211,14 +211,14 @@ export class ConfusedTag extends BattlerTag {
onAdd(pokemon: Pokemon): void { onAdd(pokemon: Pokemon): void {
super.onAdd(pokemon); super.onAdd(pokemon);
pokemon.scene.unshiftPhase(new CommonAnimPhase(pokemon.scene, pokemon.getBattlerIndex(), undefined, CommonAnim.CONFUSION)); pokemon.scene.unshiftPhase(new CommonAnimPhase(pokemon.scene, pokemon.getBattlerIndex(), undefined, CommonAnim.CONFUSION));
pokemon.scene.queueMessage(getPokemonMessage(pokemon, " became\nconfused!")); pokemon.scene.queueMessage(getPokemonMessage(pokemon, " became\nconfused!"));
} }
onRemove(pokemon: Pokemon): void { onRemove(pokemon: Pokemon): void {
super.onRemove(pokemon); super.onRemove(pokemon);
pokemon.scene.queueMessage(getPokemonMessage(pokemon, " snapped\nout of confusion!")); pokemon.scene.queueMessage(getPokemonMessage(pokemon, " snapped\nout of confusion!"));
} }
@ -245,7 +245,7 @@ export class ConfusedTag extends BattlerTag {
(pokemon.scene.getCurrentPhase() as MovePhase).cancel(); (pokemon.scene.getCurrentPhase() as MovePhase).cancel();
} }
} }
return ret; return ret;
} }
@ -265,7 +265,7 @@ export class InfatuatedTag extends BattlerTag {
onAdd(pokemon: Pokemon): void { onAdd(pokemon: Pokemon): void {
super.onAdd(pokemon); super.onAdd(pokemon);
pokemon.scene.queueMessage(getPokemonMessage(pokemon, ` fell in love\nwith ${pokemon.scene.getPokemonById(this.sourceId).name}!`)); pokemon.scene.queueMessage(getPokemonMessage(pokemon, ` fell in love\nwith ${pokemon.scene.getPokemonById(this.sourceId).name}!`));
} }
@ -287,7 +287,7 @@ export class InfatuatedTag extends BattlerTag {
(pokemon.scene.getCurrentPhase() as MovePhase).cancel(); (pokemon.scene.getCurrentPhase() as MovePhase).cancel();
} }
} }
return ret; return ret;
} }
@ -328,7 +328,7 @@ export class SeedTag extends BattlerTag {
onAdd(pokemon: Pokemon): void { onAdd(pokemon: Pokemon): void {
super.onAdd(pokemon); super.onAdd(pokemon);
pokemon.scene.queueMessage(getPokemonMessage(pokemon, " was seeded!")); pokemon.scene.queueMessage(getPokemonMessage(pokemon, " was seeded!"));
this.sourceIndex = pokemon.scene.getPokemonById(this.sourceId).getBattlerIndex(); this.sourceIndex = pokemon.scene.getPokemonById(this.sourceId).getBattlerIndex();
} }
@ -354,7 +354,7 @@ export class SeedTag extends BattlerTag {
} }
} }
} }
return ret; return ret;
} }
@ -370,7 +370,7 @@ export class NightmareTag extends BattlerTag {
onAdd(pokemon: Pokemon): void { onAdd(pokemon: Pokemon): void {
super.onAdd(pokemon); super.onAdd(pokemon);
pokemon.scene.queueMessage(getPokemonMessage(pokemon, " began\nhaving a Nightmare!")); pokemon.scene.queueMessage(getPokemonMessage(pokemon, " began\nhaving a Nightmare!"));
} }
@ -394,7 +394,7 @@ export class NightmareTag extends BattlerTag {
pokemon.damageAndUpdate(Math.ceil(pokemon.getMaxHp() / 4)); pokemon.damageAndUpdate(Math.ceil(pokemon.getMaxHp() / 4));
} }
} }
return ret; return ret;
} }
@ -441,12 +441,12 @@ export class EncoreTag extends BattlerTag {
if (pokemon.isMax()) { if (pokemon.isMax()) {
return false; return false;
} }
const lastMoves = pokemon.getLastXMoves(1); const lastMoves = pokemon.getLastXMoves(1);
if (!lastMoves.length) { if (!lastMoves.length) {
return false; return false;
} }
const repeatableMove = lastMoves[0]; const repeatableMove = lastMoves[0];
if (!repeatableMove.move || repeatableMove.virtual) { if (!repeatableMove.move || repeatableMove.virtual) {
@ -463,7 +463,7 @@ export class EncoreTag extends BattlerTag {
case Moves.ENCORE: case Moves.ENCORE:
return false; return false;
} }
if (allMoves[repeatableMove.move].getAttrs(ChargeAttr).length && repeatableMove.result === MoveResult.OTHER) { if (allMoves[repeatableMove.move].getAttrs(ChargeAttr).length && repeatableMove.result === MoveResult.OTHER) {
return false; return false;
} }
@ -533,7 +533,7 @@ export class IngrainTag extends TrappedTag {
pokemon.scene.unshiftPhase(new PokemonHealPhase(pokemon.scene, pokemon.getBattlerIndex(), Math.floor(pokemon.getMaxHp() / 16), pokemon.scene.unshiftPhase(new PokemonHealPhase(pokemon.scene, pokemon.getBattlerIndex(), Math.floor(pokemon.getMaxHp() / 16),
getPokemonMessage(pokemon, " absorbed\nnutrients with its roots!"), true)); getPokemonMessage(pokemon, " absorbed\nnutrients with its roots!"), true));
} }
return ret; return ret;
} }
@ -553,7 +553,7 @@ export class AquaRingTag extends BattlerTag {
onAdd(pokemon: Pokemon): void { onAdd(pokemon: Pokemon): void {
super.onAdd(pokemon); super.onAdd(pokemon);
pokemon.scene.queueMessage(getPokemonMessage(pokemon, " surrounded\nitself with a veil of water!")); pokemon.scene.queueMessage(getPokemonMessage(pokemon, " surrounded\nitself with a veil of water!"));
} }
@ -564,7 +564,7 @@ export class AquaRingTag extends BattlerTag {
pokemon.scene.unshiftPhase(new PokemonHealPhase(pokemon.scene, pokemon.getBattlerIndex(), pokemon.scene.unshiftPhase(new PokemonHealPhase(pokemon.scene, pokemon.getBattlerIndex(),
Math.floor(pokemon.getMaxHp() / 16), `${this.getMoveName()} restored\n${pokemon.name}\'s HP!`, true)); Math.floor(pokemon.getMaxHp() / 16), `${this.getMoveName()} restored\n${pokemon.name}\'s HP!`, true));
} }
return ret; return ret;
} }
} }
@ -1007,7 +1007,7 @@ export class SlowStartTag extends AbilityBattlerTag {
onAdd(pokemon: Pokemon): void { onAdd(pokemon: Pokemon): void {
super.onAdd(pokemon); super.onAdd(pokemon);
pokemon.scene.queueMessage(getPokemonMessage(pokemon, " can't\nget it going!"), null, false, null, true); pokemon.scene.queueMessage(getPokemonMessage(pokemon, " can't\nget it going!"), null, false, null, true);
} }
@ -1067,7 +1067,7 @@ export class HighestStatBoostTag extends AbilityBattlerTag {
this.multiplier = 1.3; this.multiplier = 1.3;
break; break;
} }
pokemon.scene.queueMessage(getPokemonMessage(pokemon, `'s ${getStatName(highestStat)}\nwas heightened!`), null, false, null, true); pokemon.scene.queueMessage(getPokemonMessage(pokemon, `'s ${getStatName(highestStat)}\nwas heightened!`), null, false, null, true);
} }
@ -1121,7 +1121,7 @@ export class HideSpriteTag extends BattlerTag {
onAdd(pokemon: Pokemon): void { onAdd(pokemon: Pokemon): void {
super.onAdd(pokemon); super.onAdd(pokemon);
pokemon.setVisible(false); pokemon.setVisible(false);
} }
@ -1237,7 +1237,7 @@ export class SaltCuredTag extends BattlerTag {
onAdd(pokemon: Pokemon): void { onAdd(pokemon: Pokemon): void {
super.onAdd(pokemon); super.onAdd(pokemon);
pokemon.scene.queueMessage(getPokemonMessage(pokemon, " is being salt cured!")); pokemon.scene.queueMessage(getPokemonMessage(pokemon, " is being salt cured!"));
this.sourceIndex = pokemon.scene.getPokemonById(this.sourceId).getBattlerIndex(); this.sourceIndex = pokemon.scene.getPokemonById(this.sourceId).getBattlerIndex();
} }
@ -1258,7 +1258,7 @@ export class SaltCuredTag extends BattlerTag {
pokemon.scene.queueMessage(getPokemonMessage(pokemon, ` is hurt by ${this.getMoveName()}!`)); pokemon.scene.queueMessage(getPokemonMessage(pokemon, ` is hurt by ${this.getMoveName()}!`));
} }
} }
return ret; return ret;
} }
} }
@ -1281,7 +1281,7 @@ export class CursedTag extends BattlerTag {
onAdd(pokemon: Pokemon): void { onAdd(pokemon: Pokemon): void {
super.onAdd(pokemon); super.onAdd(pokemon);
pokemon.scene.queueMessage(getPokemonMessage(pokemon, " has been cursed!")); pokemon.scene.queueMessage(getPokemonMessage(pokemon, " has been cursed!"));
this.sourceIndex = pokemon.scene.getPokemonById(this.sourceId).getBattlerIndex(); this.sourceIndex = pokemon.scene.getPokemonById(this.sourceId).getBattlerIndex();
} }
@ -1300,7 +1300,7 @@ export class CursedTag extends BattlerTag {
pokemon.scene.queueMessage(getPokemonMessage(pokemon, ` is hurt by the ${this.getMoveName()}!`)); pokemon.scene.queueMessage(getPokemonMessage(pokemon, ` is hurt by the ${this.getMoveName()}!`));
} }
} }
return ret; return ret;
} }
} }

View File

@ -96,7 +96,7 @@ export function getBerryEffectFunc(berryType: BerryType): BerryEffectFunc {
pokemon.scene.queueMessage(getPokemonMessage(pokemon, getStatusEffectHealText(pokemon.status.effect))); pokemon.scene.queueMessage(getPokemonMessage(pokemon, getStatusEffectHealText(pokemon.status.effect)));
pokemon.resetStatus(); pokemon.resetStatus();
pokemon.updateInfo(); pokemon.updateInfo();
} }
if (pokemon.getTag(BattlerTagType.CONFUSED)) { if (pokemon.getTag(BattlerTagType.CONFUSED)) {
pokemon.lapseTag(BattlerTagType.CONFUSED); pokemon.lapseTag(BattlerTagType.CONFUSED);
} }

View File

@ -3921,7 +3921,7 @@ export const biomeTrainerPools: BiomeTrainerPools = {
], ],
[ Species.PIPLUP, Type.WATER, -1, [ [ Species.PIPLUP, Type.WATER, -1, [
[ Biome.SEA, BiomePoolTier.RARE ] [ Biome.SEA, BiomePoolTier.RARE ]
] ]
], ],
[ Species.PRINPLUP, Type.WATER, -1, [ [ Species.PRINPLUP, Type.WATER, -1, [
[ Biome.SEA, BiomePoolTier.RARE ] [ Biome.SEA, BiomePoolTier.RARE ]
@ -7157,7 +7157,7 @@ export const biomeTrainerPools: BiomeTrainerPools = {
[ Biome.JUNGLE, BiomePoolTier.COMMON ] [ Biome.JUNGLE, BiomePoolTier.COMMON ]
] ]
], ],
[ TrainerType.BAKER, [ [ TrainerType.BAKER, [
[ Biome.SLUM, BiomePoolTier.UNCOMMON ] [ Biome.SLUM, BiomePoolTier.UNCOMMON ]
] ]
], ],
@ -7166,7 +7166,7 @@ export const biomeTrainerPools: BiomeTrainerPools = {
] ], ] ],
[ TrainerType.BIKER, [ [ TrainerType.BIKER, [
[ Biome.SLUM, BiomePoolTier.COMMON ] [ Biome.SLUM, BiomePoolTier.COMMON ]
] ]
], ],
[ TrainerType.BLACK_BELT, [ [ TrainerType.BLACK_BELT, [
[ Biome.DOJO, BiomePoolTier.COMMON ], [ Biome.DOJO, BiomePoolTier.COMMON ],
@ -7257,7 +7257,7 @@ export const biomeTrainerPools: BiomeTrainerPools = {
[ TrainerType.RICH_KID, [] ], [ TrainerType.RICH_KID, [] ],
[ TrainerType.ROUGHNECK, [ [ TrainerType.ROUGHNECK, [
[ Biome.SLUM, BiomePoolTier.COMMON ] [ Biome.SLUM, BiomePoolTier.COMMON ]
] ]
], ],
[ TrainerType.SCIENTIST, [ [ TrainerType.SCIENTIST, [
[ Biome.DESERT, BiomePoolTier.COMMON ], [ Biome.DESERT, BiomePoolTier.COMMON ],
@ -7265,7 +7265,7 @@ export const biomeTrainerPools: BiomeTrainerPools = {
] ]
], ],
[ TrainerType.SMASHER, [] ], [ TrainerType.SMASHER, [] ],
[ TrainerType.SNOW_WORKER, [ [ TrainerType.SNOW_WORKER, [
[ Biome.ICE_CAVE, BiomePoolTier.COMMON ], [ Biome.ICE_CAVE, BiomePoolTier.COMMON ],
[ Biome.SNOWY_FOREST, BiomePoolTier.COMMON ] [ Biome.SNOWY_FOREST, BiomePoolTier.COMMON ]
] ]
@ -7273,7 +7273,7 @@ export const biomeTrainerPools: BiomeTrainerPools = {
[ TrainerType.STRIKER, [] ], [ TrainerType.STRIKER, [] ],
[ TrainerType.SCHOOL_KID, [ [ TrainerType.SCHOOL_KID, [
[ Biome.GRASS, BiomePoolTier.COMMON ] [ Biome.GRASS, BiomePoolTier.COMMON ]
] ]
], ],
[ TrainerType.SWIMMER, [ [ TrainerType.SWIMMER, [
[ Biome.SEA, BiomePoolTier.COMMON ] [ Biome.SEA, BiomePoolTier.COMMON ]
@ -7285,7 +7285,7 @@ export const biomeTrainerPools: BiomeTrainerPools = {
], ],
[ TrainerType.VETERAN, [ [ TrainerType.VETERAN, [
[ Biome.WASTELAND, BiomePoolTier.COMMON ] [ Biome.WASTELAND, BiomePoolTier.COMMON ]
] ]
], ],
[ TrainerType.WAITER, [ [ TrainerType.WAITER, [
[ Biome.METROPOLIS, BiomePoolTier.COMMON ] [ Biome.METROPOLIS, BiomePoolTier.COMMON ]
@ -7700,7 +7700,7 @@ export const biomeTrainerPools: BiomeTrainerPools = {
const speciesEvolutions: SpeciesFormEvolution[] = pokemonEvolutions.hasOwnProperty(speciesId) const speciesEvolutions: SpeciesFormEvolution[] = pokemonEvolutions.hasOwnProperty(speciesId)
? pokemonEvolutions[speciesId] ? pokemonEvolutions[speciesId]
: []; : [];
if (!biomeEntries.filter(b => b[0] !== Biome.END).length && !speciesEvolutions.filter(es => !!((pokemonBiomes.find(p => p[0] === es.speciesId))[3] as any[]).filter(b => b[0] !== Biome.END).length).length) { if (!biomeEntries.filter(b => b[0] !== Biome.END).length && !speciesEvolutions.filter(es => !!((pokemonBiomes.find(p => p[0] === es.speciesId))[3] as any[]).filter(b => b[0] !== Biome.END).length).length) {
uncatchableSpecies.push(speciesId); uncatchableSpecies.push(speciesId);
} }

View File

@ -54,7 +54,7 @@ export function getDailyRunStarters(scene: BattleScene, seed: string): Starter[]
starters.push(getDailyRunStarter(scene, starterSpecies, startingLevel)); starters.push(getDailyRunStarter(scene, starterSpecies, startingLevel));
} }
}, 0, seed); }, 0, seed);
return starters; return starters;
} }

View File

@ -946,7 +946,7 @@ export const trainerTypeDialogue = {
], ],
victory: [ victory: [
"I wanted to win…but I lost!", "I wanted to win…but I lost!",
"I lost…'cause I couldn't win!" "I lost…'cause I couldn't win!"
], ],
defeat: [ defeat: [
"Hey, wait a sec. Did I just win? I think I just won! Talk about satisfying!", "Hey, wait a sec. Did I just win? I think I just won! Talk about satisfying!",
@ -957,10 +957,10 @@ export const trainerTypeDialogue = {
encounter: [ encounter: [
`I want to be the one to help a certain person. That being the case, I cannot afford to lose. `I want to be the one to help a certain person. That being the case, I cannot afford to lose.
$ Our battle starts now.`, $ Our battle starts now.`,
], ],
victory: [ victory: [
"I am… not enough, I see.", "I am… not enough, I see.",
], ],
defeat: [ defeat: [
"Victory belongs to me. Well fought.", "Victory belongs to me. Well fought.",
@ -971,7 +971,7 @@ export const trainerTypeDialogue = {
"I'll be facing you with my usual party as a member of the Elite Four.", "I'll be facing you with my usual party as a member of the Elite Four.",
], ],
victory: [ victory: [
"That was a great battle!", "That was a great battle!",
], ],
defeat: [ defeat: [
"Let's give your Pokémon a nice round of applause for their efforts!", "Let's give your Pokémon a nice round of applause for their efforts!",
@ -983,7 +983,7 @@ export const trainerTypeDialogue = {
$I don't get why everyone doesn't just sit all the time. Standing up's tiring work!`, $I don't get why everyone doesn't just sit all the time. Standing up's tiring work!`,
], ],
victory: [ victory: [
"Guess I should've expected that!", "Guess I should've expected that!",
], ],
defeat: [ defeat: [
"Heh heh! Don't mind me, just scooping up a W over here. I get it if you're upset, but don't go full Kieran on me, OK?", "Heh heh! Don't mind me, just scooping up a W over here. I get it if you're upset, but don't go full Kieran on me, OK?",
@ -995,7 +995,7 @@ export const trainerTypeDialogue = {
$Their strength is a sign o' my strength as a gardener and a Gym Leader! Yeh sure yer up to facing all that?`, $Their strength is a sign o' my strength as a gardener and a Gym Leader! Yeh sure yer up to facing all that?`,
], ],
victory: [ victory: [
"Yeh believe in yer Pokémon… And they believe in yeh, too… It was a fine battle, sprout.", "Yeh believe in yer Pokémon… And they believe in yeh, too… It was a fine battle, sprout.",
], ],
defeat: [ defeat: [
"Hohoho… Indeed. Frail little blades o' grass'll break through even concrete.", "Hohoho… Indeed. Frail little blades o' grass'll break through even concrete.",
@ -1011,7 +1011,7 @@ export const trainerTypeDialogue = {
victory: [ victory: [
"You and your Pokémon have shown me a whole new depth of field! Fantastic! Just fantastic!", "You and your Pokémon have shown me a whole new depth of field! Fantastic! Just fantastic!",
`The world you see through a lens, and the world you see with a Pokémon by your side… `The world you see through a lens, and the world you see with a Pokémon by your side…
$The same world can look entirely different depending on your view.` $The same world can look entirely different depending on your view.`
], ],
defeat: [ defeat: [
"The photo from the moment of my victory will be a really winner, all right!", "The photo from the moment of my victory will be a really winner, all right!",
@ -1028,7 +1028,7 @@ export const trainerTypeDialogue = {
victory: [ victory: [
"I must say, I'm warmed up to you! I might even admire you a little.", "I must say, I'm warmed up to you! I might even admire you a little.",
`Wow! You're great! You've earned my respect! `Wow! You're great! You've earned my respect!
$I think your focus and will bowled us over totally. ` $I think your focus and will bowled us over totally. `
], ],
defeat: [ defeat: [
"I sensed your will to win, but I don't lose!", "I sensed your will to win, but I don't lose!",
@ -2073,7 +2073,7 @@ export const trainerTypeDialogue = {
defeat: [ defeat: [
"Things didn't heat up for you.", "Things didn't heat up for you.",
] ]
}, },
[TrainerType.RIVAL]: [ [TrainerType.RIVAL]: [
{ {
encounter: [ encounter: [

View File

@ -581,7 +581,7 @@ function parseEggMoves(content: string): void {
const speciesNames = Utils.getEnumKeys(Species); const speciesNames = Utils.getEnumKeys(Species);
const speciesValues = Utils.getEnumValues(Species); const speciesValues = Utils.getEnumValues(Species);
const lines = content.split(/\n/g); const lines = content.split(/\n/g);
lines.forEach((line, l) => { lines.forEach((line, l) => {
const cols = line.split(",").slice(0, 5); const cols = line.split(",").slice(0, 5);
const moveNames = allMoves.map(m => m.name.replace(/ \([A-Z]\)$/, "").toLowerCase()); const moveNames = allMoves.map(m => m.name.replace(/ \([A-Z]\)$/, "").toLowerCase());

View File

@ -1,7 +1,7 @@
export enum TrainerType { export enum TrainerType {
UNKNOWN, UNKNOWN,
ACE_TRAINER, ACE_TRAINER,
ARTIST, ARTIST,
BACKERS, BACKERS,

View File

@ -75,7 +75,7 @@ export enum MoveFlags {
PULSE_MOVE = 1 << 7, PULSE_MOVE = 1 << 7,
PUNCHING_MOVE = 1 << 8, PUNCHING_MOVE = 1 << 8,
SLICING_MOVE = 1 << 9, SLICING_MOVE = 1 << 9,
/** /**
* Indicates a move should be affected by {@linkcode Abilities.RECKLESS} * Indicates a move should be affected by {@linkcode Abilities.RECKLESS}
* @see {@linkcode Move.recklessMove()} * @see {@linkcode Move.recklessMove()}
*/ */
@ -223,7 +223,7 @@ export default class Move implements Localizable {
return this; return this;
} }
partial(): this { partial(): this {
this.nameAppend += " (P)"; this.nameAppend += " (P)";
return this; return this;
@ -459,8 +459,8 @@ export class SelfStatusMove extends Move {
} }
} }
/** /**
* Base class defining all {@linkcode Move} Attributes * Base class defining all {@linkcode Move} Attributes
* @abstract * @abstract
* @see {@linkcode apply} * @see {@linkcode apply}
*/ */
@ -486,7 +486,7 @@ export abstract class MoveAttr {
return true; return true;
} }
/** /**
* @virtual * @virtual
* @returns the {@linkcode MoveCondition} or {@linkcode MoveConditionFunc} for this {@linkcode Move} * @returns the {@linkcode MoveCondition} or {@linkcode MoveConditionFunc} for this {@linkcode Move}
*/ */
@ -506,7 +506,7 @@ export abstract class MoveAttr {
return null; return null;
} }
/** /**
* Used by the Enemy AI to rank an attack based on a given user * Used by the Enemy AI to rank an attack based on a given user
* @see {@linkcode EnemyPokemon.getNextMove} * @see {@linkcode EnemyPokemon.getNextMove}
* @virtual * @virtual
@ -515,7 +515,7 @@ export abstract class MoveAttr {
return 0; return 0;
} }
/** /**
* Used by the Enemy AI to rank an attack based on a given target * Used by the Enemy AI to rank an attack based on a given target
* @see {@linkcode EnemyPokemon.getNextMove} * @see {@linkcode EnemyPokemon.getNextMove}
* @virtual * @virtual
@ -567,7 +567,7 @@ export class MoveEffectAttr extends MoveAttr {
/** Applies move effects so long as they are able based on {@linkcode canApply} */ /** Applies move effects so long as they are able based on {@linkcode canApply} */
apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean | Promise<boolean> { apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean | Promise<boolean> {
return this.canApply(user, target, move, args); return this.canApply(user, target, move, args);
} }
} }
@ -686,16 +686,16 @@ export class MatchHpAttr extends FixedDamageAttr {
super(0); super(0);
} }
apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean { apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean {
(args[0] as Utils.IntegerHolder).value = target.hp - user.hp; (args[0] as Utils.IntegerHolder).value = target.hp - user.hp;
return true; return true;
} }
getCondition(): MoveConditionFunc { getCondition(): MoveConditionFunc {
return (user, target, move) => user.hp <= target.hp; return (user, target, move) => user.hp <= target.hp;
} }
// TODO // TODO
/*getUserBenefitScore(user: Pokemon, target: Pokemon, move: Move): integer { /*getUserBenefitScore(user: Pokemon, target: Pokemon, move: Move): integer {
return 0; return 0;
@ -768,7 +768,7 @@ export class SurviveDamageAttr extends ModifiedDamageAttr {
getCondition(): MoveConditionFunc { getCondition(): MoveConditionFunc {
return (user, target, move) => target.hp > 1; return (user, target, move) => target.hp > 1;
} }
getUserBenefitScore(user: Pokemon, target: Pokemon, move: Move): integer { getUserBenefitScore(user: Pokemon, target: Pokemon, move: Move): integer {
return target.hp > 1 ? 0 : -20; return target.hp > 1 ? 0 : -20;
} }
@ -811,7 +811,7 @@ export class RecoilAttr extends MoveEffectAttr {
if (cancelled.value) { if (cancelled.value) {
return false; return false;
} }
user.damageAndUpdate(recoilDamage, HitResult.OTHER, false, true, true); user.damageAndUpdate(recoilDamage, HitResult.OTHER, false, true, true);
user.scene.queueMessage(getPokemonMessage(user, " is hit\nwith recoil!")); user.scene.queueMessage(getPokemonMessage(user, " is hit\nwith recoil!"));
user.turnData.damageTaken += recoilDamage; user.turnData.damageTaken += recoilDamage;
@ -926,7 +926,7 @@ export class HalfSacrificialAttr extends MoveEffectAttr {
if (!cancelled.value){ if (!cancelled.value){
user.damageAndUpdate(Math.ceil(user.getMaxHp()/2), HitResult.OTHER, false, true, true); user.damageAndUpdate(Math.ceil(user.getMaxHp()/2), HitResult.OTHER, false, true, true);
user.scene.queueMessage(getPokemonMessage(user, " cut its own HP to power up its move!")); // Queue recoil message user.scene.queueMessage(getPokemonMessage(user, " cut its own HP to power up its move!")); // Queue recoil message
} }
return true; return true;
} }
@ -970,7 +970,7 @@ export class HealAttr extends MoveEffectAttr {
return true; return true;
} }
/** /**
* Creates a new {@linkcode PokemonHealPhase}. * Creates a new {@linkcode PokemonHealPhase}.
* This heals the target and shows the appropriate message. * This heals the target and shows the appropriate message.
*/ */
@ -1124,7 +1124,7 @@ export class SandHealAttr extends WeatherHealAttr {
} }
/** /**
* Heals the target or the user by either {@linkcode normalHealRatio} or {@linkcode boostedHealRatio} * Heals the target or the user by either {@linkcode normalHealRatio} or {@linkcode boostedHealRatio}
* depending on the evaluation of {@linkcode condition} * depending on the evaluation of {@linkcode condition}
* @extends HealAttr * @extends HealAttr
* @see {@linkcode apply} * @see {@linkcode apply}
@ -1232,7 +1232,7 @@ export class IncrementMovePriorityAttr extends MoveAttr {
if (!this.moveIncrementFunc(user, target, move)) { if (!this.moveIncrementFunc(user, target, move)) {
return false; return false;
} }
(args[0] as Utils.IntegerHolder).value += this.increaseAmount; (args[0] as Utils.IntegerHolder).value += this.increaseAmount;
return true; return true;
} }
@ -1413,7 +1413,7 @@ export class PsychoShiftEffectAttr extends MoveEffectAttr {
} }
return statusAfflictResult; return statusAfflictResult;
} }
return false; return false;
} }
@ -1542,7 +1542,7 @@ export class EatBerryAttr extends MoveEffectAttr {
return false; return false;
} }
if(this.chosenBerry === undefined) { // if no berry has been provided, pick a random berry from their inventory if(this.chosenBerry === undefined) { // if no berry has been provided, pick a random berry from their inventory
const heldBerries = this.getTargetHeldBerries(target); const heldBerries = this.getTargetHeldBerries(target);
if(heldBerries.length <= 0) { if(heldBerries.length <= 0) {
return false; return false;
@ -1562,7 +1562,7 @@ export class EatBerryAttr extends MoveEffectAttr {
target.scene.updateModifiers(target.isPlayer()); target.scene.updateModifiers(target.isPlayer());
} }
this.chosenBerry = undefined; this.chosenBerry = undefined;
return true; return true;
} }
@ -1595,7 +1595,7 @@ export class StealEatBerryAttr extends EatBerryAttr {
if(cancelled.value === true) { if(cancelled.value === true) {
return false; return false;
} }
const heldBerries = this.getTargetHeldBerries(target).filter(i => i.getTransferrable(false)); const heldBerries = this.getTargetHeldBerries(target).filter(i => i.getTransferrable(false));
if (heldBerries.length) { // if the target has berries, pick a random berry and steal it if (heldBerries.length) { // if the target has berries, pick a random berry and steal it
@ -1633,7 +1633,7 @@ export class HealStatusEffectAttr extends MoveEffectAttr {
pokemon.scene.queueMessage(getPokemonMessage(pokemon, getStatusEffectHealText(pokemon.status.effect))); pokemon.scene.queueMessage(getPokemonMessage(pokemon, getStatusEffectHealText(pokemon.status.effect)));
pokemon.resetStatus(); pokemon.resetStatus();
pokemon.updateInfo(); pokemon.updateInfo();
return true; return true;
} }
@ -1677,13 +1677,13 @@ export class BypassBurnDamageReductionAttr extends MoveAttr {
apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean { apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean {
(args[0] as Utils.BooleanHolder).value = true; (args[0] as Utils.BooleanHolder).value = true;
return true; return true;
} }
} }
export class WeatherChangeAttr extends MoveEffectAttr { export class WeatherChangeAttr extends MoveEffectAttr {
private weatherType: WeatherType; private weatherType: WeatherType;
constructor(weatherType: WeatherType) { constructor(weatherType: WeatherType) {
super(); super();
@ -1701,7 +1701,7 @@ export class WeatherChangeAttr extends MoveEffectAttr {
export class ClearWeatherAttr extends MoveEffectAttr { export class ClearWeatherAttr extends MoveEffectAttr {
private weatherType: WeatherType; private weatherType: WeatherType;
constructor(weatherType: WeatherType) { constructor(weatherType: WeatherType) {
super(); super();
@ -1719,7 +1719,7 @@ export class ClearWeatherAttr extends MoveEffectAttr {
export class TerrainChangeAttr extends MoveEffectAttr { export class TerrainChangeAttr extends MoveEffectAttr {
private terrainType: TerrainType; private terrainType: TerrainType;
constructor(terrainType: TerrainType) { constructor(terrainType: TerrainType) {
super(); super();
@ -1757,7 +1757,7 @@ export class OneHitKOAttr extends MoveAttr {
} }
(args[0] as Utils.BooleanHolder).value = true; (args[0] as Utils.BooleanHolder).value = true;
return true; return true;
} }
@ -2202,7 +2202,7 @@ export class HpSplitAttr extends MoveEffectAttr {
} }
const infoUpdates = []; const infoUpdates = [];
const hpValue = Math.floor((target.hp + user.hp) / 2); const hpValue = Math.floor((target.hp + user.hp) / 2);
if (user.hp < hpValue) { if (user.hp < hpValue) {
const healing = user.heal(hpValue - user.hp); const healing = user.heal(hpValue - user.hp);
@ -2254,13 +2254,13 @@ export class LessPPMorePowerAttr extends VariablePowerAttr {
apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean { apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean {
const ppMax = move.pp; const ppMax = move.pp;
const ppUsed = user.moveset.find((m) => m.moveId === move.id).ppUsed; const ppUsed = user.moveset.find((m) => m.moveId === move.id).ppUsed;
let ppRemains = ppMax - ppUsed; let ppRemains = ppMax - ppUsed;
/** Reduce to 0 to avoid negative numbers if user has 1PP before attack and target has Ability.PRESSURE */ /** Reduce to 0 to avoid negative numbers if user has 1PP before attack and target has Ability.PRESSURE */
if(ppRemains < 0) { if(ppRemains < 0) {
ppRemains = 0; ppRemains = 0;
} }
const power = args[0] as Utils.NumberHolder; const power = args[0] as Utils.NumberHolder;
switch (ppRemains) { switch (ppRemains) {
@ -2525,7 +2525,7 @@ export class CompareWeightPowerAttr extends VariablePowerAttr {
if (!userWeight || userWeight === 0) { if (!userWeight || userWeight === 0) {
return false; return false;
} }
const relativeWeight = (targetWeight / userWeight) * 100; const relativeWeight = (targetWeight / userWeight) * 100;
switch (true) { switch (true) {
@ -2617,7 +2617,7 @@ export class MagnitudePowerAttr extends VariablePowerAttr {
const magnitudePowers = [ 10, 30, 50, 70, 90, 100, 110, 150 ]; const magnitudePowers = [ 10, 30, 50, 70, 90, 100, 110, 150 ];
let rand: integer; let rand: integer;
user.scene.executeWithSeedOffset(() => rand = Utils.randSeedInt(100), user.scene.currentBattle.turn << 6, user.scene.waveSeed); user.scene.executeWithSeedOffset(() => rand = Utils.randSeedInt(100), user.scene.currentBattle.turn << 6, user.scene.waveSeed);
let m = 0; let m = 0;
@ -2715,9 +2715,9 @@ export class KnockOffPowerAttr extends VariablePowerAttr {
apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean { apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean {
if(target.getHeldItems().length > 0){ if(target.getHeldItems().length > 0){
(args[0] as Utils.NumberHolder).value *= 1.5; (args[0] as Utils.NumberHolder).value *= 1.5;
return true; return true;
} }
return false; return false;
} }
} }
@ -2821,14 +2821,14 @@ export class ThunderAccuracyAttr extends VariableAccuracyAttr {
* @extends VariableAccuracyAttr * @extends VariableAccuracyAttr
* @see {@linkcode apply} * @see {@linkcode apply}
*/ */
export class MinimizeAccuracyAttr extends VariableAccuracyAttr { export class MinimizeAccuracyAttr extends VariableAccuracyAttr {
/** /**
* @see {@linkcode apply} * @see {@linkcode apply}
* @param user N/A * @param user N/A
* @param target {@linkcode Pokemon} target of the move * @param target {@linkcode Pokemon} target of the move
* @param move N/A * @param move N/A
* @param args [0] Accuracy of the move to be modified * @param args [0] Accuracy of the move to be modified
* @returns true if the function succeeds * @returns true if the function succeeds
*/ */
apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean { apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean {
if (target.getTag(BattlerTagType.MINIMIZED)){ if (target.getTag(BattlerTagType.MINIMIZED)){
@ -3123,7 +3123,7 @@ export class HiddenPowerTypeAttr extends VariableMoveTypeAttr {
+(user.ivs[Stat.SPD] & 1) * 8 +(user.ivs[Stat.SPD] & 1) * 8
+(user.ivs[Stat.SPATK] & 1) * 16 +(user.ivs[Stat.SPATK] & 1) * 16
+(user.ivs[Stat.SPDEF] & 1) * 32) * 15/63); +(user.ivs[Stat.SPDEF] & 1) * 32) * 15/63);
type.value = [ type.value = [
Type.FIGHTING, Type.FLYING, Type.POISON, Type.GROUND, Type.FIGHTING, Type.FLYING, Type.POISON, Type.GROUND,
Type.ROCK, Type.BUG, Type.GHOST, Type.STEEL, Type.ROCK, Type.BUG, Type.GHOST, Type.STEEL,
@ -3143,7 +3143,7 @@ export class MatchUserTypeAttr extends VariableMoveTypeAttr {
if(userTypes.includes(Type.STELLAR)) { // will not change to stellar type if(userTypes.includes(Type.STELLAR)) { // will not change to stellar type
const nonTeraTypes = user.getTypes(); const nonTeraTypes = user.getTypes();
type.value = nonTeraTypes[0]; type.value = nonTeraTypes[0];
return true; return true;
} else if (userTypes.length > 0) { } else if (userTypes.length > 0) {
type.value = userTypes[0]; type.value = userTypes[0];
return true; return true;
@ -3228,11 +3228,11 @@ export class OneHitKOAccuracyAttr extends VariableAccuracyAttr {
export class SheerColdAccuracyAttr extends OneHitKOAccuracyAttr { export class SheerColdAccuracyAttr extends OneHitKOAccuracyAttr {
/** /**
* Changes the normal One Hit KO Accuracy Attr to implement the Gen VII changes, * Changes the normal One Hit KO Accuracy Attr to implement the Gen VII changes,
* where if the user is Ice-Type, it has more accuracy. * where if the user is Ice-Type, it has more accuracy.
* @param {Pokemon} user Pokemon that is using the move; checks the Pokemon's level. * @param {Pokemon} user Pokemon that is using the move; checks the Pokemon's level.
* @param {Pokemon} target Pokemon that is receiving the move; checks the Pokemon's level. * @param {Pokemon} target Pokemon that is receiving the move; checks the Pokemon's level.
* @param {Move} move N/A * @param {Move} move N/A
* @param {any[]} args Uses the accuracy argument, allowing to change it from either 0 if it doesn't pass * @param {any[]} args Uses the accuracy argument, allowing to change it from either 0 if it doesn't pass
* the first if/else, or 30/20 depending on the type of the user Pokemon. * the first if/else, or 30/20 depending on the type of the user Pokemon.
* @returns Returns true if move is successful, false if misses. * @returns Returns true if move is successful, false if misses.
@ -3241,7 +3241,7 @@ export class SheerColdAccuracyAttr extends OneHitKOAccuracyAttr {
const accuracy = args[0] as Utils.NumberHolder; const accuracy = args[0] as Utils.NumberHolder;
if (user.level < target.level) { if (user.level < target.level) {
accuracy.value = 0; accuracy.value = 0;
} else { } else {
const baseAccuracy = user.isOfType(Type.ICE) ? 30 : 20; const baseAccuracy = user.isOfType(Type.ICE) ? 30 : 20;
accuracy.value = Math.min(Math.max(baseAccuracy + 100 * (1 - target.level / user.level), 0), 100); accuracy.value = Math.min(Math.max(baseAccuracy + 100 * (1 - target.level / user.level), 0), 100);
} }
@ -3285,11 +3285,11 @@ const crashDamageFunc = (user: Pokemon, move: Move) => {
if (cancelled.value) { if (cancelled.value) {
return false; return false;
} }
user.damageAndUpdate(Math.floor(user.getMaxHp() / 2), HitResult.OTHER, false, true); user.damageAndUpdate(Math.floor(user.getMaxHp() / 2), HitResult.OTHER, false, true);
user.scene.queueMessage(getPokemonMessage(user, " kept going\nand crashed!")); user.scene.queueMessage(getPokemonMessage(user, " kept going\nand crashed!"));
user.turnData.damageTaken += Math.floor(user.getMaxHp() / 2); user.turnData.damageTaken += Math.floor(user.getMaxHp() / 2);
return true; return true;
}; };
@ -3297,7 +3297,7 @@ export class TypelessAttr extends MoveAttr { }
/** /**
* Attribute used for moves which ignore redirection effects, and always target their original target, i.e. Snipe Shot * Attribute used for moves which ignore redirection effects, and always target their original target, i.e. Snipe Shot
* Bypasses Storm Drain, Follow Me, Ally Switch, and the like. * Bypasses Storm Drain, Follow Me, Ally Switch, and the like.
*/ */
export class BypassRedirectAttr extends MoveAttr { } export class BypassRedirectAttr extends MoveAttr { }
export class DisableMoveAttr extends MoveEffectAttr { export class DisableMoveAttr extends MoveEffectAttr {
@ -3317,24 +3317,24 @@ export class DisableMoveAttr extends MoveEffectAttr {
if (turnMove.virtual) { if (turnMove.virtual) {
continue; continue;
} }
const moveIndex = target.getMoveset().findIndex(m => m.moveId === turnMove.move); const moveIndex = target.getMoveset().findIndex(m => m.moveId === turnMove.move);
if (moveIndex === -1) { if (moveIndex === -1) {
return false; return false;
} }
const disabledMove = target.getMoveset()[moveIndex]; const disabledMove = target.getMoveset()[moveIndex];
target.summonData.disabledMove = disabledMove.moveId; target.summonData.disabledMove = disabledMove.moveId;
target.summonData.disabledTurns = 4; target.summonData.disabledTurns = 4;
user.scene.queueMessage(getPokemonMessage(target, `'s ${disabledMove.getName()}\nwas disabled!`)); user.scene.queueMessage(getPokemonMessage(target, `'s ${disabledMove.getName()}\nwas disabled!`));
return true; return true;
} }
return false; return false;
} }
getCondition(): MoveConditionFunc { getCondition(): MoveConditionFunc {
return (user, target, move) => { return (user, target, move) => {
if (target.summonData.disabledMove || target.isMax()) { if (target.summonData.disabledMove || target.isMax()) {
@ -3348,7 +3348,7 @@ export class DisableMoveAttr extends MoveEffectAttr {
if (turnMove.virtual) { if (turnMove.virtual) {
continue; continue;
} }
const move = target.getMoveset().find(m => m.moveId === turnMove.move); const move = target.getMoveset().find(m => m.moveId === turnMove.move);
if (!move) { if (!move) {
continue; continue;
@ -3493,7 +3493,7 @@ export class AddBattlerTagAttr extends MoveEffectAttr {
} }
export class CurseAttr extends MoveEffectAttr { export class CurseAttr extends MoveEffectAttr {
apply(user: Pokemon, target: Pokemon, move:Move, args: any[]): boolean { apply(user: Pokemon, target: Pokemon, move:Move, args: any[]): boolean {
if (user.getTypes(true).includes(Type.GHOST)) { if (user.getTypes(true).includes(Type.GHOST)) {
if (target.getTag(BattlerTagType.CURSED)) { if (target.getTag(BattlerTagType.CURSED)) {
@ -3530,7 +3530,7 @@ export class LapseBattlerTagAttr extends MoveEffectAttr {
for (const tagType of this.tagTypes) { for (const tagType of this.tagTypes) {
(this.selfTarget ? user : target).lapseTag(tagType); (this.selfTarget ? user : target).lapseTag(tagType);
} }
return true; return true;
} }
} }
@ -3552,7 +3552,7 @@ export class RemoveBattlerTagAttr extends MoveEffectAttr {
for (const tagType of this.tagTypes) { for (const tagType of this.tagTypes) {
(this.selfTarget ? user : target).removeTag(tagType); (this.selfTarget ? user : target).removeTag(tagType);
} }
return true; return true;
} }
} }
@ -3661,8 +3661,8 @@ export class FaintCountdownAttr extends AddBattlerTagAttr {
} }
} }
/** /**
* Attribute used when a move hits a {@linkcode BattlerTagType} for double damage * Attribute used when a move hits a {@linkcode BattlerTagType} for double damage
* @extends MoveAttr * @extends MoveAttr
*/ */
export class HitsTagAttr extends MoveAttr { export class HitsTagAttr extends MoveAttr {
@ -3811,7 +3811,7 @@ export class RevivalBlessingAttr extends MoveEffectAttr {
} }
/** /**
* *
* @param user {@linkcode Pokemon} using this move * @param user {@linkcode Pokemon} using this move
* @param target {@linkcode Pokemon} target of this move * @param target {@linkcode Pokemon} target of this move
* @param move {@linkcode Move} being used * @param move {@linkcode Move} being used
@ -3826,7 +3826,7 @@ export class RevivalBlessingAttr extends MoveEffectAttr {
(user as PlayerPokemon).revivalBlessing().then(() => { (user as PlayerPokemon).revivalBlessing().then(() => {
resolve(true); resolve(true);
}); });
// If user is enemy, checks that it is a trainer, and it has fainted non-boss pokemon in party // If user is enemy, checks that it is a trainer, and it has fainted non-boss pokemon in party
} else if(user instanceof EnemyPokemon } else if(user instanceof EnemyPokemon
&& user.hasTrainer() && user.hasTrainer()
&& user.scene.getEnemyParty().findIndex(p => p.isFainted() && !p.isBoss()) > -1) { && user.scene.getEnemyParty().findIndex(p => p.isFainted() && !p.isBoss()) > -1) {
@ -3866,16 +3866,16 @@ export class RevivalBlessingAttr extends MoveEffectAttr {
export class ForceSwitchOutAttr extends MoveEffectAttr { export class ForceSwitchOutAttr extends MoveEffectAttr {
private user: boolean; private user: boolean;
private batonPass: boolean; private batonPass: boolean;
constructor(user?: boolean, batonPass?: boolean) { constructor(user?: boolean, batonPass?: boolean) {
super(false, MoveEffectTrigger.POST_APPLY, true); super(false, MoveEffectTrigger.POST_APPLY, true);
this.user = !!user; this.user = !!user;
this.batonPass = !!batonPass; this.batonPass = !!batonPass;
} }
apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): Promise<boolean> { apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): Promise<boolean> {
return new Promise(resolve => { return new Promise(resolve => {
// Check if the move category is not STATUS or if the switch out condition is not met // Check if the move category is not STATUS or if the switch out condition is not met
if (!this.getSwitchOutCondition()(user, target, move)) { if (!this.getSwitchOutCondition()(user, target, move)) {
//Apply effects before switch out i.e. poison point, flame body, etc //Apply effects before switch out i.e. poison point, flame body, etc
@ -3886,7 +3886,7 @@ export class ForceSwitchOutAttr extends MoveEffectAttr {
// Move the switch out logic inside the conditional block // Move the switch out logic inside the conditional block
// This ensures that the switch out only happens when the conditions are met // This ensures that the switch out only happens when the conditions are met
const switchOutTarget = this.user ? user : target; const switchOutTarget = this.user ? user : target;
if (switchOutTarget instanceof PlayerPokemon) { if (switchOutTarget instanceof PlayerPokemon) {
if (switchOutTarget.hp) { if (switchOutTarget.hp) {
applyPreSwitchOutAbAttrs(PreSwitchOutAbAttr, switchOutTarget); applyPreSwitchOutAbAttrs(PreSwitchOutAbAttr, switchOutTarget);
(switchOutTarget as PlayerPokemon).switchOut(this.batonPass, true).then(() => resolve(true)); (switchOutTarget as PlayerPokemon).switchOut(this.batonPass, true).then(() => resolve(true));
@ -3902,30 +3902,30 @@ export class ForceSwitchOutAttr extends MoveEffectAttr {
switchOutTarget.setVisible(false); switchOutTarget.setVisible(false);
switchOutTarget.scene.field.remove(switchOutTarget); switchOutTarget.scene.field.remove(switchOutTarget);
user.scene.triggerPokemonFormChange(switchOutTarget, SpeciesFormChangeActiveTrigger, true); user.scene.triggerPokemonFormChange(switchOutTarget, SpeciesFormChangeActiveTrigger, true);
if (switchOutTarget.hp) { if (switchOutTarget.hp) {
user.scene.unshiftPhase(new SwitchSummonPhase(user.scene, switchOutTarget.getFieldIndex(), user.scene.currentBattle.trainer.getNextSummonIndex((switchOutTarget as EnemyPokemon).trainerSlot), false, this.batonPass, false)); user.scene.unshiftPhase(new SwitchSummonPhase(user.scene, switchOutTarget.getFieldIndex(), user.scene.currentBattle.trainer.getNextSummonIndex((switchOutTarget as EnemyPokemon).trainerSlot), false, this.batonPass, false));
} }
} else { } else {
// Switch out logic for everything else // Switch out logic for everything else
switchOutTarget.setVisible(false); switchOutTarget.setVisible(false);
if (switchOutTarget.hp) { if (switchOutTarget.hp) {
switchOutTarget.hideInfo().then(() => switchOutTarget.destroy()); switchOutTarget.hideInfo().then(() => switchOutTarget.destroy());
switchOutTarget.scene.field.remove(switchOutTarget); switchOutTarget.scene.field.remove(switchOutTarget);
user.scene.queueMessage(getPokemonMessage(switchOutTarget, " fled!"), null, true, 500); user.scene.queueMessage(getPokemonMessage(switchOutTarget, " fled!"), null, true, 500);
} }
if (!switchOutTarget.getAlly()?.isActive(true)) { if (!switchOutTarget.getAlly()?.isActive(true)) {
user.scene.clearEnemyHeldItemModifiers(); user.scene.clearEnemyHeldItemModifiers();
if (switchOutTarget.hp) { if (switchOutTarget.hp) {
user.scene.pushPhase(new BattleEndPhase(user.scene)); user.scene.pushPhase(new BattleEndPhase(user.scene));
user.scene.pushPhase(new NewBattlePhase(user.scene)); user.scene.pushPhase(new NewBattlePhase(user.scene));
} }
} }
} }
resolve(true); resolve(true);
}); });
} }
@ -3944,7 +3944,7 @@ export class ForceSwitchOutAttr extends MoveEffectAttr {
return (user, target, move) => { return (user, target, move) => {
const switchOutTarget = (this.user ? user : target); const switchOutTarget = (this.user ? user : target);
const player = switchOutTarget instanceof PlayerPokemon; const player = switchOutTarget instanceof PlayerPokemon;
if (!this.user && move.category === MoveCategory.STATUS && (target.hasAbilityWithAttr(ForceSwitchOutImmunityAbAttr) || target.isMax())) { if (!this.user && move.category === MoveCategory.STATUS && (target.hasAbilityWithAttr(ForceSwitchOutImmunityAbAttr) || target.isMax())) {
return false; return false;
} }
@ -4115,7 +4115,7 @@ export class FirstMoveTypeAttr extends MoveEffectAttr {
} }
const firstMoveType = target.getMoveset()[0].getMove().type; const firstMoveType = target.getMoveset()[0].getMove().type;
user.summonData.types = [ firstMoveType ]; user.summonData.types = [ firstMoveType ];
user.scene.queueMessage(getPokemonMessage(user, ` transformed\ninto to the ${Utils.toReadableString(Type[firstMoveType])} type!`)); user.scene.queueMessage(getPokemonMessage(user, ` transformed\ninto to the ${Utils.toReadableString(Type[firstMoveType])} type!`));
@ -4158,8 +4158,8 @@ export class RandomMovesetMoveAttr extends OverrideMoveEffectAttr {
selectTargets = [ moveTargets.targets[user.randSeedInt(moveTargets.targets.length)] ]; selectTargets = [ moveTargets.targets[user.randSeedInt(moveTargets.targets.length)] ];
break; break;
} }
} }
const targets = selectTargets; const targets = selectTargets;
user.getMoveQueue().push({ move: move.moveId, targets: targets, ignorePP: true }); user.getMoveQueue().push({ move: move.moveId, targets: targets, ignorePP: true });
user.scene.unshiftPhase(new MovePhase(user.scene, user, targets, moveset[moveIndex], true)); user.scene.unshiftPhase(new MovePhase(user.scene, user, targets, moveset[moveIndex], true));
return true; return true;
@ -4174,7 +4174,7 @@ export class RandomMoveAttr extends OverrideMoveEffectAttr {
return new Promise(resolve => { return new Promise(resolve => {
const moveIds = Utils.getEnumValues(Moves).filter(m => !allMoves[m].hasFlag(MoveFlags.IGNORE_VIRTUAL) && !allMoves[m].name.endsWith(" (N)")); const moveIds = Utils.getEnumValues(Moves).filter(m => !allMoves[m].hasFlag(MoveFlags.IGNORE_VIRTUAL) && !allMoves[m].name.endsWith(" (N)"));
const moveId = moveIds[user.randSeedInt(moveIds.length)]; const moveId = moveIds[user.randSeedInt(moveIds.length)];
const moveTargets = getMoveTargets(user, moveId); const moveTargets = getMoveTargets(user, moveId);
if (!moveTargets.targets.length) { if (!moveTargets.targets.length) {
resolve(false); resolve(false);
@ -4327,7 +4327,7 @@ export class NaturePowerAttr extends OverrideMoveEffectAttr {
moveId = Moves.TRI_ATTACK; moveId = Moves.TRI_ATTACK;
break; break;
} }
user.getMoveQueue().push({ move: moveId, targets: [target.getBattlerIndex()], ignorePP: true }); user.getMoveQueue().push({ move: moveId, targets: [target.getBattlerIndex()], ignorePP: true });
user.scene.unshiftPhase(new MovePhase(user.scene, user, [target.getBattlerIndex()], new PokemonMove(moveId, 0, 0, true), true)); user.scene.unshiftPhase(new MovePhase(user.scene, user, [target.getBattlerIndex()], new PokemonMove(moveId, 0, 0, true), true));
initMoveAnim(user.scene, moveId).then(() => { initMoveAnim(user.scene, moveId).then(() => {
@ -4507,18 +4507,18 @@ export class SketchAttr extends MoveEffectAttr {
if (!targetMoveCopiableCondition(user, target, move)) { if (!targetMoveCopiableCondition(user, target, move)) {
return false; return false;
} }
const targetMoves = target.getMoveHistory().filter(m => !m.virtual); const targetMoves = target.getMoveHistory().filter(m => !m.virtual);
if (!targetMoves.length) { if (!targetMoves.length) {
return false; return false;
} }
const sketchableMove = targetMoves[0]; const sketchableMove = targetMoves[0];
if (user.getMoveset().find(m => m.moveId === sketchableMove.move)) { if (user.getMoveset().find(m => m.moveId === sketchableMove.move)) {
return false; return false;
} }
return true; return true;
}; };
} }
@ -4567,7 +4567,7 @@ export class AbilityCopyAttr extends MoveEffectAttr {
user.summonData.ability = target.getAbility().id; user.summonData.ability = target.getAbility().id;
user.scene.queueMessage(getPokemonMessage(user, " copied the ") + getPokemonMessage(target, `'s\n${allAbilities[target.getAbility().id].name}!`)); user.scene.queueMessage(getPokemonMessage(user, " copied the ") + getPokemonMessage(target, `'s\n${allAbilities[target.getAbility().id].name}!`));
if (this.copyToPartner && user.scene.currentBattle?.double && user.getAlly().hp) { if (this.copyToPartner && user.scene.currentBattle?.double && user.getAlly().hp) {
user.getAlly().summonData.ability = target.getAbility().id; user.getAlly().summonData.ability = target.getAbility().id;
user.getAlly().scene.queueMessage(getPokemonMessage(user.getAlly(), " copied the ") + getPokemonMessage(target, `'s\n${allAbilities[target.getAbility().id].name}!`)); user.getAlly().scene.queueMessage(getPokemonMessage(user.getAlly(), " copied the ") + getPokemonMessage(target, `'s\n${allAbilities[target.getAbility().id].name}!`));
@ -4825,7 +4825,7 @@ export function getMoveTargets(user: Pokemon, move: Moves): MoveTargetSet {
const moveTarget = allMoves[move].getAttrs(VariableTargetAttr).length ? variableTarget.value : move ? allMoves[move].moveTarget : move === undefined ? MoveTarget.NEAR_ENEMY : []; const moveTarget = allMoves[move].getAttrs(VariableTargetAttr).length ? variableTarget.value : move ? allMoves[move].moveTarget : move === undefined ? MoveTarget.NEAR_ENEMY : [];
const opponents = user.getOpponents(); const opponents = user.getOpponents();
let set: Pokemon[] = []; let set: Pokemon[] = [];
let multiple = false; let multiple = false;
@ -5508,7 +5508,7 @@ export function initMoves() {
.partial(), .partial(),
new AttackMove(Moves.RAPID_SPIN, Type.NORMAL, MoveCategory.PHYSICAL, 50, 100, 40, 100, 0, 2) new AttackMove(Moves.RAPID_SPIN, Type.NORMAL, MoveCategory.PHYSICAL, 50, 100, 40, 100, 0, 2)
.attr(StatChangeAttr, BattleStat.SPD, 1, true) .attr(StatChangeAttr, BattleStat.SPD, 1, true)
.attr(RemoveBattlerTagAttr, [ .attr(RemoveBattlerTagAttr, [
BattlerTagType.BIND, BattlerTagType.BIND,
BattlerTagType.WRAP, BattlerTagType.WRAP,
BattlerTagType.FIRE_SPIN, BattlerTagType.FIRE_SPIN,
@ -5903,7 +5903,7 @@ export function initMoves() {
new AttackMove(Moves.CLOSE_COMBAT, Type.FIGHTING, MoveCategory.PHYSICAL, 120, 100, 5, 100, 0, 4) new AttackMove(Moves.CLOSE_COMBAT, Type.FIGHTING, MoveCategory.PHYSICAL, 120, 100, 5, 100, 0, 4)
.attr(StatChangeAttr, [ BattleStat.DEF, BattleStat.SPDEF ], -1, true), .attr(StatChangeAttr, [ BattleStat.DEF, BattleStat.SPDEF ], -1, true),
new AttackMove(Moves.PAYBACK, Type.DARK, MoveCategory.PHYSICAL, 50, 100, 10, -1, 0, 4) new AttackMove(Moves.PAYBACK, Type.DARK, MoveCategory.PHYSICAL, 50, 100, 10, -1, 0, 4)
.attr(MovePowerMultiplierAttr, (user, target, move) => target.getLastXMoves(1).find(m => m.turn === target.scene.currentBattle.turn) || user.scene.currentBattle.turnCommands[target.getBattlerIndex()].command === Command.BALL ? 2 : 1), .attr(MovePowerMultiplierAttr, (user, target, move) => target.getLastXMoves(1).find(m => m.turn === target.scene.currentBattle.turn) || user.scene.currentBattle.turnCommands[target.getBattlerIndex()].command === Command.BALL ? 2 : 1),
new AttackMove(Moves.ASSURANCE, Type.DARK, MoveCategory.PHYSICAL, 60, 100, 10, -1, 0, 4) new AttackMove(Moves.ASSURANCE, Type.DARK, MoveCategory.PHYSICAL, 60, 100, 10, -1, 0, 4)
.attr(MovePowerMultiplierAttr, (user, target, move) => target.turnData.damageTaken > 0 ? 2 : 1), .attr(MovePowerMultiplierAttr, (user, target, move) => target.turnData.damageTaken > 0 ? 2 : 1),
new StatusMove(Moves.EMBARGO, Type.DARK, 100, 15, -1, 0, 4) new StatusMove(Moves.EMBARGO, Type.DARK, 100, 15, -1, 0, 4)
@ -5965,7 +5965,7 @@ export function initMoves() {
.attr(AddBattlerTagAttr, BattlerTagType.AQUA_RING, true, true), .attr(AddBattlerTagAttr, BattlerTagType.AQUA_RING, true, true),
new SelfStatusMove(Moves.MAGNET_RISE, Type.ELECTRIC, -1, 10, -1, 0, 4) new SelfStatusMove(Moves.MAGNET_RISE, Type.ELECTRIC, -1, 10, -1, 0, 4)
.attr(AddBattlerTagAttr, BattlerTagType.MAGNET_RISEN, true, true) .attr(AddBattlerTagAttr, BattlerTagType.MAGNET_RISEN, true, true)
.condition((user, target, move) => !user.scene.arena.getTag(ArenaTagType.GRAVITY) && .condition((user, target, move) => !user.scene.arena.getTag(ArenaTagType.GRAVITY) &&
!user.getTag(BattlerTagType.IGNORE_FLYING) && !user.getTag(BattlerTagType.INGRAIN) && !user.getTag(BattlerTagType.IGNORE_FLYING) && !user.getTag(BattlerTagType.INGRAIN) &&
!user.getTag(BattlerTagType.MAGNET_RISEN)) !user.getTag(BattlerTagType.MAGNET_RISEN))
.unimplemented(), .unimplemented(),
@ -6280,7 +6280,7 @@ export function initMoves() {
new AttackMove(Moves.SKY_DROP, Type.FLYING, MoveCategory.PHYSICAL, 60, 100, 10, -1, 0, 5) new AttackMove(Moves.SKY_DROP, Type.FLYING, MoveCategory.PHYSICAL, 60, 100, 10, -1, 0, 5)
.attr(ChargeAttr, ChargeAnim.SKY_DROP_CHARGING, "took {TARGET}\ninto the sky!", BattlerTagType.FLYING) // TODO: Add 2nd turn message .attr(ChargeAttr, ChargeAnim.SKY_DROP_CHARGING, "took {TARGET}\ninto the sky!", BattlerTagType.FLYING) // TODO: Add 2nd turn message
.condition(failOnGravityCondition) .condition(failOnGravityCondition)
.ignoresVirtual(), .ignoresVirtual(),
new SelfStatusMove(Moves.SHIFT_GEAR, Type.STEEL, -1, 10, -1, 0, 5) new SelfStatusMove(Moves.SHIFT_GEAR, Type.STEEL, -1, 10, -1, 0, 5)
.attr(StatChangeAttr, BattleStat.ATK, 1, true) .attr(StatChangeAttr, BattleStat.ATK, 1, true)
.attr(StatChangeAttr, BattleStat.SPD, 2, true), .attr(StatChangeAttr, BattleStat.SPD, 2, true),
@ -6342,7 +6342,7 @@ export function initMoves() {
.attr(HitHealAttr) .attr(HitHealAttr)
.triageMove(), .triageMove(),
new AttackMove(Moves.SACRED_SWORD, Type.FIGHTING, MoveCategory.PHYSICAL, 90, 100, 15, -1, 0, 5) new AttackMove(Moves.SACRED_SWORD, Type.FIGHTING, MoveCategory.PHYSICAL, 90, 100, 15, -1, 0, 5)
.attr(IgnoreOpponentStatChangesAttr) .attr(IgnoreOpponentStatChangesAttr)
.slicingMove(), .slicingMove(),
new AttackMove(Moves.RAZOR_SHELL, Type.WATER, MoveCategory.PHYSICAL, 75, 95, 10, 50, 0, 5) new AttackMove(Moves.RAZOR_SHELL, Type.WATER, MoveCategory.PHYSICAL, 75, 95, 10, 50, 0, 5)
.attr(StatChangeAttr, BattleStat.DEF, -1) .attr(StatChangeAttr, BattleStat.DEF, -1)
@ -6963,7 +6963,7 @@ export function initMoves() {
.attr(DiscourageFrequentUseAttr) .attr(DiscourageFrequentUseAttr)
.ignoresVirtual(), .ignoresVirtual(),
new AttackMove(Moves.SNIPE_SHOT, Type.WATER, MoveCategory.SPECIAL, 80, 100, 15, -1, 0, 8) new AttackMove(Moves.SNIPE_SHOT, Type.WATER, MoveCategory.SPECIAL, 80, 100, 15, -1, 0, 8)
.attr(HighCritAttr) .attr(HighCritAttr)
.attr(BypassRedirectAttr), .attr(BypassRedirectAttr),
new AttackMove(Moves.JAW_LOCK, Type.DARK, MoveCategory.PHYSICAL, 80, 100, 10, -1, 0, 8) new AttackMove(Moves.JAW_LOCK, Type.DARK, MoveCategory.PHYSICAL, 80, 100, 10, -1, 0, 8)
.attr(AddBattlerTagAttr, BattlerTagType.TRAPPED, false, false, 1) .attr(AddBattlerTagAttr, BattlerTagType.TRAPPED, false, false, 1)
@ -7486,7 +7486,7 @@ export function initMoves() {
.attr(StatChangeAttr, BattleStat.SPATK, -1, true, null, true, true) .attr(StatChangeAttr, BattleStat.SPATK, -1, true, null, true, true)
.target(MoveTarget.ALL_NEAR_ENEMIES), .target(MoveTarget.ALL_NEAR_ENEMIES),
new AttackMove(Moves.PSYBLADE, Type.PSYCHIC, MoveCategory.PHYSICAL, 80, 100, 15, -1, 0, 9) new AttackMove(Moves.PSYBLADE, Type.PSYCHIC, MoveCategory.PHYSICAL, 80, 100, 15, -1, 0, 9)
.attr(MovePowerMultiplierAttr, (user, target, move) => user.scene.arena.getTerrainType() === TerrainType.ELECTRIC && user.isGrounded() ? 1.5 : 1) .attr(MovePowerMultiplierAttr, (user, target, move) => user.scene.arena.getTerrainType() === TerrainType.ELECTRIC && user.isGrounded() ? 1.5 : 1)
.slicingMove(), .slicingMove(),
new AttackMove(Moves.HYDRO_STEAM, Type.WATER, MoveCategory.SPECIAL, 80, 100, 15, -1, 0, 9) new AttackMove(Moves.HYDRO_STEAM, Type.WATER, MoveCategory.SPECIAL, 80, 100, 15, -1, 0, 9)
.attr(IgnoreWeatherTypeDebuffAttr, WeatherType.SUNNY) .attr(IgnoreWeatherTypeDebuffAttr, WeatherType.SUNNY)
@ -7631,4 +7631,4 @@ export function initMoves() {
new AttackMove(Moves.MALIGNANT_CHAIN, Type.POISON, MoveCategory.SPECIAL, 100, 100, 5, 50, 0, 9) new AttackMove(Moves.MALIGNANT_CHAIN, Type.POISON, MoveCategory.SPECIAL, 100, 100, 5, 50, 0, 9)
.attr(StatusEffectAttr, StatusEffect.TOXIC) .attr(StatusEffectAttr, StatusEffect.TOXIC)
); );
} }

View File

@ -4381,7 +4381,7 @@ export const pokemonSpeciesLevelMoves: PokemonSpeciesLevelMoves = {
[ 1, Moves.FALSE_SWIPE ], [ 1, Moves.FALSE_SWIPE ],
[ 1, Moves.FURY_CUTTER ], [ 1, Moves.FURY_CUTTER ],
[ 1, Moves.X_SCISSOR ], [ 1, Moves.X_SCISSOR ],
[ 1, Moves.ENERGY_BALL ], [ 1, Moves.ENERGY_BALL ],
[ 9, Moves.MEGA_DRAIN ], [ 9, Moves.MEGA_DRAIN ],
[ 12, Moves.DETECT ], [ 12, Moves.DETECT ],
[ 15, Moves.QUICK_GUARD ], [ 15, Moves.QUICK_GUARD ],
@ -4403,7 +4403,7 @@ export const pokemonSpeciesLevelMoves: PokemonSpeciesLevelMoves = {
[ 1, Moves.FALSE_SWIPE ], [ 1, Moves.FALSE_SWIPE ],
[ 1, Moves.FURY_CUTTER ], [ 1, Moves.FURY_CUTTER ],
[ 1, Moves.X_SCISSOR ], [ 1, Moves.X_SCISSOR ],
[ 1, Moves.ENERGY_BALL ], [ 1, Moves.ENERGY_BALL ],
[ 1, Moves.SHED_TAIL ], [ 1, Moves.SHED_TAIL ],
[ 1, Moves.DUAL_CHOP ], [ 1, Moves.DUAL_CHOP ],
[ 5, Moves.MEGA_DRAIN ], [ 5, Moves.MEGA_DRAIN ],
@ -4439,9 +4439,9 @@ export const pokemonSpeciesLevelMoves: PokemonSpeciesLevelMoves = {
[ 1, Moves.SCRATCH ], [ 1, Moves.SCRATCH ],
[ 1, Moves.GROWL ], [ 1, Moves.GROWL ],
[ 1, Moves.EMBER ], [ 1, Moves.EMBER ],
[ 1, Moves.QUICK_ATTACK ], [ 1, Moves.QUICK_ATTACK ],
[ 1, Moves.FLAMETHROWER ], [ 1, Moves.FLAMETHROWER ],
[ 1, Moves.FEATHER_DANCE ], [ 1, Moves.FEATHER_DANCE ],
[ 9, Moves.FLAME_CHARGE ], [ 9, Moves.FLAME_CHARGE ],
[ 12, Moves.DETECT ], [ 12, Moves.DETECT ],
[ 15, Moves.SAND_ATTACK ], [ 15, Moves.SAND_ATTACK ],
@ -4518,7 +4518,7 @@ export const pokemonSpeciesLevelMoves: PokemonSpeciesLevelMoves = {
[ 1, Moves.WATER_GUN ], [ 1, Moves.WATER_GUN ],
[ 1, Moves.SURF ], [ 1, Moves.SURF ],
[ 1, Moves.EARTHQUAKE ], [ 1, Moves.EARTHQUAKE ],
[ 1, Moves.ROCK_SMASH ], [ 1, Moves.ROCK_SMASH ],
[ 1, Moves.HAMMER_ARM ], [ 1, Moves.HAMMER_ARM ],
[ 9, Moves.ROCK_THROW ], [ 9, Moves.ROCK_THROW ],
[ 12, Moves.PROTECT ], [ 12, Moves.PROTECT ],
@ -4947,7 +4947,7 @@ export const pokemonSpeciesLevelMoves: PokemonSpeciesLevelMoves = {
[ 1, Moves.GROWTH ], [ 1, Moves.GROWTH ],
[ 1, Moves.TOXIC ], [ 1, Moves.TOXIC ],
[ 1, Moves.ABSORB ], [ 1, Moves.ABSORB ],
[ 1, Moves.TACKLE ], [ 1, Moves.TACKLE ],
[ 1, Moves.STUN_SPORE ], [ 1, Moves.STUN_SPORE ],
[ 1, Moves.LEECH_SEED ], [ 1, Moves.LEECH_SEED ],
[ 12, Moves.MEGA_DRAIN ], [ 12, Moves.MEGA_DRAIN ],
@ -5500,7 +5500,7 @@ export const pokemonSpeciesLevelMoves: PokemonSpeciesLevelMoves = {
[ 1, Moves.YAWN ], [ 1, Moves.YAWN ],
[ 1, Moves.POISON_GAS ], [ 1, Moves.POISON_GAS ],
[ 1, Moves.WRING_OUT ], [ 1, Moves.WRING_OUT ],
[ 1, Moves.SLUDGE ], [ 1, Moves.SLUDGE ],
[ 12, Moves.AMNESIA ], [ 12, Moves.AMNESIA ],
[ 17, Moves.ACID_SPRAY ], [ 17, Moves.ACID_SPRAY ],
[ 20, Moves.ENCORE ], [ 20, Moves.ENCORE ],
@ -5963,7 +5963,7 @@ export const pokemonSpeciesLevelMoves: PokemonSpeciesLevelMoves = {
[ 1, Moves.WATER_GUN ], [ 1, Moves.WATER_GUN ],
[ 1, Moves.HARDEN ], [ 1, Moves.HARDEN ],
[ 1, Moves.LEER ], [ 1, Moves.LEER ],
[ 1, Moves.TAUNT ], [ 1, Moves.TAUNT ],
[ 12, Moves.BUBBLE_BEAM ], [ 12, Moves.BUBBLE_BEAM ],
[ 16, Moves.KNOCK_OFF ], [ 16, Moves.KNOCK_OFF ],
[ 20, Moves.DOUBLE_HIT ], [ 20, Moves.DOUBLE_HIT ],
@ -6071,7 +6071,7 @@ export const pokemonSpeciesLevelMoves: PokemonSpeciesLevelMoves = {
[Species.ARMALDO]: [ [Species.ARMALDO]: [
[ 1, Moves.FURY_CUTTER ], [ 1, Moves.FURY_CUTTER ],
[ 1, Moves.HARDEN ], [ 1, Moves.HARDEN ],
[ 1, Moves.WATER_GUN ], [ 1, Moves.WATER_GUN ],
[ 1, Moves.SMACK_DOWN ], [ 1, Moves.SMACK_DOWN ],
[ 12, Moves.METAL_CLAW ], [ 12, Moves.METAL_CLAW ],
[ 16, Moves.ANCIENT_POWER ], [ 16, Moves.ANCIENT_POWER ],
@ -6091,7 +6091,7 @@ export const pokemonSpeciesLevelMoves: PokemonSpeciesLevelMoves = {
[Species.MILOTIC]: [ [Species.MILOTIC]: [
[ 0, Moves.WATER_PULSE ], [ 0, Moves.WATER_PULSE ],
[ 1, Moves.FLAIL ], [ 1, Moves.FLAIL ],
[ 1, Moves.SPLASH ], [ 1, Moves.SPLASH ],
[ 1, Moves.TACKLE ], [ 1, Moves.TACKLE ],
[ 1, Moves.WRAP ], [ 1, Moves.WRAP ],
[ 1, Moves.WATER_GUN ], [ 1, Moves.WATER_GUN ],
@ -6113,7 +6113,7 @@ export const pokemonSpeciesLevelMoves: PokemonSpeciesLevelMoves = {
[Species.CASTFORM]: [ [Species.CASTFORM]: [
[ 1, Moves.TACKLE ], [ 1, Moves.TACKLE ],
[ 10, Moves.WATER_GUN ], [ 10, Moves.WATER_GUN ],
[ 10, Moves.EMBER ], [ 10, Moves.EMBER ],
[ 10, Moves.POWDER_SNOW ], [ 10, Moves.POWDER_SNOW ],
[ 15, Moves.HEADBUTT ], [ 15, Moves.HEADBUTT ],
[ 20, Moves.RAIN_DANCE ], [ 20, Moves.RAIN_DANCE ],
@ -6122,7 +6122,7 @@ export const pokemonSpeciesLevelMoves: PokemonSpeciesLevelMoves = {
[ 25, Moves.WEATHER_BALL ], [ 25, Moves.WEATHER_BALL ],
[ 35, Moves.HYDRO_PUMP ], [ 35, Moves.HYDRO_PUMP ],
[ 35, Moves.FIRE_BLAST ], [ 35, Moves.FIRE_BLAST ],
[ 35, Moves.BLIZZARD ], [ 35, Moves.BLIZZARD ],
[ 45, Moves.HURRICANE ], [ 45, Moves.HURRICANE ],
], ],
[Species.KECLEON]: [ [Species.KECLEON]: [
@ -6130,7 +6130,7 @@ export const pokemonSpeciesLevelMoves: PokemonSpeciesLevelMoves = {
[ 1, Moves.TAIL_WHIP ], [ 1, Moves.TAIL_WHIP ],
[ 1, Moves.ASTONISH ], [ 1, Moves.ASTONISH ],
[ 1, Moves.LICK ], [ 1, Moves.LICK ],
[ 1, Moves.SCRATCH ], [ 1, Moves.SCRATCH ],
[ 4, Moves.BIND ], [ 4, Moves.BIND ],
[ 7, Moves.SHADOW_SNEAK ], [ 7, Moves.SHADOW_SNEAK ],
[ 10, Moves.FEINT ], [ 10, Moves.FEINT ],
@ -6250,7 +6250,7 @@ export const pokemonSpeciesLevelMoves: PokemonSpeciesLevelMoves = {
], ],
[Species.ABSOL]: [ [Species.ABSOL]: [
[ 1, Moves.QUICK_ATTACK ], [ 1, Moves.QUICK_ATTACK ],
[ 1, Moves.LEER ], [ 1, Moves.LEER ],
[ 5, Moves.DOUBLE_TEAM ], [ 5, Moves.DOUBLE_TEAM ],
[ 10, Moves.KNOCK_OFF ], [ 10, Moves.KNOCK_OFF ],
[ 15, Moves.DETECT ], [ 15, Moves.DETECT ],
@ -6266,16 +6266,16 @@ export const pokemonSpeciesLevelMoves: PokemonSpeciesLevelMoves = {
[Species.WYNAUT]: [ [Species.WYNAUT]: [
[ 1, Moves.COUNTER ], [ 1, Moves.COUNTER ],
[ 1, Moves.MIRROR_COAT ], [ 1, Moves.MIRROR_COAT ],
[ 1, Moves.SAFEGUARD ], [ 1, Moves.SAFEGUARD ],
[ 1, Moves.DESTINY_BOND ], [ 1, Moves.DESTINY_BOND ],
[ 1, Moves.SPLASH ], [ 1, Moves.SPLASH ],
[ 1, Moves.CHARM ], [ 1, Moves.CHARM ],
[ 1, Moves.ENCORE ], [ 1, Moves.ENCORE ],
[ 1, Moves.AMNESIA ], [ 1, Moves.AMNESIA ],
], ],
[Species.SNORUNT]: [ [Species.SNORUNT]: [
[ 1, Moves.POWDER_SNOW ], [ 1, Moves.POWDER_SNOW ],
[ 1, Moves.ASTONISH ], [ 1, Moves.ASTONISH ],
[ 1, Moves.HEADBUTT ], [ 1, Moves.HEADBUTT ],
[ 5, Moves.LEER ], [ 5, Moves.LEER ],
[ 10, Moves.DOUBLE_TEAM ], [ 10, Moves.DOUBLE_TEAM ],
@ -6298,7 +6298,7 @@ export const pokemonSpeciesLevelMoves: PokemonSpeciesLevelMoves = {
[ 1, Moves.ASTONISH ], [ 1, Moves.ASTONISH ],
[ 1, Moves.LEER ], [ 1, Moves.LEER ],
[ 1, Moves.DOUBLE_TEAM ], [ 1, Moves.DOUBLE_TEAM ],
[ 1, Moves.ICE_BALL ], [ 1, Moves.ICE_BALL ],
[ 15, Moves.ICE_SHARD ], [ 15, Moves.ICE_SHARD ],
[ 20, Moves.PROTECT ], [ 20, Moves.PROTECT ],
[ 25, Moves.ICY_WIND ], [ 25, Moves.ICY_WIND ],
@ -6312,7 +6312,7 @@ export const pokemonSpeciesLevelMoves: PokemonSpeciesLevelMoves = {
], ],
[Species.SPHEAL]: [ [Species.SPHEAL]: [
[ 1, Moves.ROLLOUT ], [ 1, Moves.ROLLOUT ],
[ 1, Moves.DEFENSE_CURL ], [ 1, Moves.DEFENSE_CURL ],
[ 4, Moves.GROWL ], [ 4, Moves.GROWL ],
[ 8, Moves.WATER_GUN ], [ 8, Moves.WATER_GUN ],
[ 12, Moves.POWDER_SNOW ], [ 12, Moves.POWDER_SNOW ],
@ -6332,7 +6332,7 @@ export const pokemonSpeciesLevelMoves: PokemonSpeciesLevelMoves = {
[ 1, Moves.ROLLOUT ], [ 1, Moves.ROLLOUT ],
[ 1, Moves.DEFENSE_CURL ], [ 1, Moves.DEFENSE_CURL ],
[ 1, Moves.GROWL ], [ 1, Moves.GROWL ],
[ 1, Moves.WATER_GUN ], [ 1, Moves.WATER_GUN ],
[ 12, Moves.POWDER_SNOW ], [ 12, Moves.POWDER_SNOW ],
[ 16, Moves.REST ], [ 16, Moves.REST ],
[ 20, Moves.SNORE ], [ 20, Moves.SNORE ],
@ -6352,7 +6352,7 @@ export const pokemonSpeciesLevelMoves: PokemonSpeciesLevelMoves = {
[ 1, Moves.ROLLOUT ], [ 1, Moves.ROLLOUT ],
[ 1, Moves.DEFENSE_CURL ], [ 1, Moves.DEFENSE_CURL ],
[ 1, Moves.GROWL ], [ 1, Moves.GROWL ],
[ 1, Moves.WATER_GUN ], [ 1, Moves.WATER_GUN ],
[ 12, Moves.POWDER_SNOW ], [ 12, Moves.POWDER_SNOW ],
[ 16, Moves.REST ], [ 16, Moves.REST ],
[ 20, Moves.SNORE ], [ 20, Moves.SNORE ],
@ -6376,8 +6376,8 @@ export const pokemonSpeciesLevelMoves: PokemonSpeciesLevelMoves = {
[ 1, Moves.WATER_GUN ], [ 1, Moves.WATER_GUN ],
[ 1, Moves.IRON_DEFENSE ], [ 1, Moves.IRON_DEFENSE ],
[ 1, Moves.SHELL_SMASH ], [ 1, Moves.SHELL_SMASH ],
[ 1, Moves.WHIRLPOOL ], [ 1, Moves.WHIRLPOOL ],
[ 1, Moves.BITE ], [ 1, Moves.BITE ],
[ 5, Moves.SCREECH ], [ 5, Moves.SCREECH ],
[ 9, Moves.SCARY_FACE ], [ 9, Moves.SCARY_FACE ],
[ 11, Moves.RAIN_DANCE ], [ 11, Moves.RAIN_DANCE ],
@ -6397,7 +6397,7 @@ export const pokemonSpeciesLevelMoves: PokemonSpeciesLevelMoves = {
[ 1, Moves.IRON_DEFENSE ], [ 1, Moves.IRON_DEFENSE ],
[ 1, Moves.SHELL_SMASH ], [ 1, Moves.SHELL_SMASH ],
[ 1, Moves.WHIRLPOOL ], [ 1, Moves.WHIRLPOOL ],
[ 1, Moves.CONFUSION ], [ 1, Moves.CONFUSION ],
[ 5, Moves.RAIN_DANCE ], [ 5, Moves.RAIN_DANCE ],
[ 9, Moves.AGILITY ], [ 9, Moves.AGILITY ],
[ 11, Moves.DRAINING_KISS ], [ 11, Moves.DRAINING_KISS ],
@ -6447,7 +6447,7 @@ export const pokemonSpeciesLevelMoves: PokemonSpeciesLevelMoves = {
], ],
[Species.BAGON]: [ [Species.BAGON]: [
[ 1, Moves.EMBER ], [ 1, Moves.EMBER ],
[ 1, Moves.LEER ], [ 1, Moves.LEER ],
[ 5, Moves.BITE ], [ 5, Moves.BITE ],
[ 10, Moves.DRAGON_BREATH ], [ 10, Moves.DRAGON_BREATH ],
[ 15, Moves.HEADBUTT ], [ 15, Moves.HEADBUTT ],
@ -6465,7 +6465,7 @@ export const pokemonSpeciesLevelMoves: PokemonSpeciesLevelMoves = {
[ 1, Moves.EMBER ], [ 1, Moves.EMBER ],
[ 1, Moves.LEER ], [ 1, Moves.LEER ],
[ 1, Moves.BITE ], [ 1, Moves.BITE ],
[ 1, Moves.DRAGON_BREATH ], [ 1, Moves.DRAGON_BREATH ],
[ 15, Moves.HEADBUTT ], [ 15, Moves.HEADBUTT ],
[ 20, Moves.SCARY_FACE ], [ 20, Moves.SCARY_FACE ],
[ 25, Moves.CRUNCH ], [ 25, Moves.CRUNCH ],
@ -6536,7 +6536,7 @@ export const pokemonSpeciesLevelMoves: PokemonSpeciesLevelMoves = {
], ],
[Species.REGIROCK]: [ [Species.REGIROCK]: [
[ 1, Moves.CHARGE_BEAM ], [ 1, Moves.CHARGE_BEAM ],
[ 1, Moves.ROCK_THROW ], [ 1, Moves.ROCK_THROW ],
[ 6, Moves.BULLDOZE ], [ 6, Moves.BULLDOZE ],
[ 12, Moves.ANCIENT_POWER ], [ 12, Moves.ANCIENT_POWER ],
[ 18, Moves.STOMP ], [ 18, Moves.STOMP ],
@ -6553,7 +6553,7 @@ export const pokemonSpeciesLevelMoves: PokemonSpeciesLevelMoves = {
], ],
[Species.REGICE]: [ [Species.REGICE]: [
[ 1, Moves.CHARGE_BEAM ], [ 1, Moves.CHARGE_BEAM ],
[ 1, Moves.ICY_WIND ], [ 1, Moves.ICY_WIND ],
[ 6, Moves.BULLDOZE ], [ 6, Moves.BULLDOZE ],
[ 12, Moves.ANCIENT_POWER ], [ 12, Moves.ANCIENT_POWER ],
[ 18, Moves.STOMP ], [ 18, Moves.STOMP ],
@ -6570,10 +6570,10 @@ export const pokemonSpeciesLevelMoves: PokemonSpeciesLevelMoves = {
], ],
[Species.REGISTEEL]: [ [Species.REGISTEEL]: [
[ 1, Moves.CHARGE_BEAM ], [ 1, Moves.CHARGE_BEAM ],
[ 1, Moves.METAL_CLAW ], [ 1, Moves.METAL_CLAW ],
[ 6, Moves.BULLDOZE ], [ 6, Moves.BULLDOZE ],
[ 12, Moves.ANCIENT_POWER ], [ 12, Moves.ANCIENT_POWER ],
[ 18, Moves.STOMP ], [ 18, Moves.STOMP ],
[ 24, Moves.IRON_HEAD ], [ 24, Moves.IRON_HEAD ],
[ 24, Moves.FLASH_CANNON ], [ 24, Moves.FLASH_CANNON ],
[ 30, Moves.CURSE ], [ 30, Moves.CURSE ],
@ -6589,7 +6589,7 @@ export const pokemonSpeciesLevelMoves: PokemonSpeciesLevelMoves = {
], ],
[Species.LATIAS]: [ [Species.LATIAS]: [
[ 1, Moves.STORED_POWER ], [ 1, Moves.STORED_POWER ],
[ 1, Moves.CHARM ], [ 1, Moves.CHARM ],
[ 1, Moves.PSYWAVE ], [ 1, Moves.PSYWAVE ],
[ 5, Moves.HELPING_HAND ], [ 5, Moves.HELPING_HAND ],
[ 10, Moves.RECOVER ], [ 10, Moves.RECOVER ],
@ -6631,7 +6631,7 @@ export const pokemonSpeciesLevelMoves: PokemonSpeciesLevelMoves = {
[ 1, Moves.WATER_PULSE ], [ 1, Moves.WATER_PULSE ],
[ 1, Moves.ANCIENT_POWER ], [ 1, Moves.ANCIENT_POWER ],
[ 1, Moves.BODY_SLAM ], [ 1, Moves.BODY_SLAM ],
[ 1, Moves.SCARY_FACE ], [ 1, Moves.SCARY_FACE ],
[ 9, Moves.AQUA_TAIL ], [ 9, Moves.AQUA_TAIL ],
[ 18, Moves.CALM_MIND ], [ 18, Moves.CALM_MIND ],
[ 27, Moves.MUDDY_WATER ], [ 27, Moves.MUDDY_WATER ],
@ -6647,7 +6647,7 @@ export const pokemonSpeciesLevelMoves: PokemonSpeciesLevelMoves = {
[ 1, Moves.MUD_SHOT ], [ 1, Moves.MUD_SHOT ],
[ 1, Moves.ANCIENT_POWER ], [ 1, Moves.ANCIENT_POWER ],
[ 1, Moves.LAVA_PLUME ], [ 1, Moves.LAVA_PLUME ],
[ 1, Moves.SCARY_FACE ], [ 1, Moves.SCARY_FACE ],
[ 9, Moves.EARTH_POWER ], [ 9, Moves.EARTH_POWER ],
[ 18, Moves.BULK_UP ], [ 18, Moves.BULK_UP ],
[ 27, Moves.EARTHQUAKE ], [ 27, Moves.EARTHQUAKE ],
@ -6663,7 +6663,7 @@ export const pokemonSpeciesLevelMoves: PokemonSpeciesLevelMoves = {
[ 1, Moves.TWISTER ], [ 1, Moves.TWISTER ],
[ 1, Moves.ANCIENT_POWER ], [ 1, Moves.ANCIENT_POWER ],
[ 1, Moves.AIR_SLASH ], [ 1, Moves.AIR_SLASH ],
[ 1, Moves.SCARY_FACE ], [ 1, Moves.SCARY_FACE ],
[ 9, Moves.CRUNCH ], [ 9, Moves.CRUNCH ],
[ 18, Moves.DRAGON_DANCE ], [ 18, Moves.DRAGON_DANCE ],
[ 27, Moves.EXTREME_SPEED ], [ 27, Moves.EXTREME_SPEED ],
@ -6695,7 +6695,7 @@ export const pokemonSpeciesLevelMoves: PokemonSpeciesLevelMoves = {
[Species.DEOXYS]: [ [Species.DEOXYS]: [
[ 1, Moves.CONFUSION ], //Custom [ 1, Moves.CONFUSION ], //Custom
[ 1, Moves.LEER ], [ 1, Moves.LEER ],
[ 1, Moves.WRAP ], [ 1, Moves.WRAP ],
[ 7, Moves.NIGHT_SHADE ], [ 7, Moves.NIGHT_SHADE ],
[ 13, Moves.TELEPORT ], [ 13, Moves.TELEPORT ],
[ 19, Moves.KNOCK_OFF ], [ 19, Moves.KNOCK_OFF ],

View File

@ -69,7 +69,7 @@ export function getFusedSpeciesName(speciesAName: string, speciesBName: string):
const splitNameA = speciesAName.split(/ /g); const splitNameA = speciesAName.split(/ /g);
const splitNameB = speciesBName.split(/ /g); const splitNameB = speciesBName.split(/ /g);
const fragAMatch = fragAPattern.exec(speciesAName); const fragAMatch = fragAPattern.exec(speciesAName);
const fragBMatch = fragBPattern.exec(speciesBName); const fragBMatch = fragBPattern.exec(speciesBName);
@ -243,7 +243,7 @@ export abstract class PokemonSpeciesForm {
const showGenderDiffs = this.genderDiffs && female && ![ SpeciesFormKey.MEGA, SpeciesFormKey.GIGANTAMAX ].find(k => formSpriteKey === k); const showGenderDiffs = this.genderDiffs && female && ![ SpeciesFormKey.MEGA, SpeciesFormKey.GIGANTAMAX ].find(k => formSpriteKey === k);
const baseSpriteKey = `${showGenderDiffs ? "female__" : ""}${this.speciesId}${formSpriteKey ? `-${formSpriteKey}` : ""}`; const baseSpriteKey = `${showGenderDiffs ? "female__" : ""}${this.speciesId}${formSpriteKey ? `-${formSpriteKey}` : ""}`;
let config = variantData; let config = variantData;
`${back ? "back__" : ""}${baseSpriteKey}`.split("__").map(p => config ? config = config[p] : null); `${back ? "back__" : ""}${baseSpriteKey}`.split("__").map(p => config ? config = config[p] : null);
const variantSet = config as VariantSet; const variantSet = config as VariantSet;
@ -274,7 +274,7 @@ export abstract class PokemonSpeciesForm {
if (shiny && !isVariant) { if (shiny && !isVariant) {
ret += "s"; ret += "s";
} }
switch (this.speciesId) { switch (this.speciesId) {
case Species.HIPPOPOTAS: case Species.HIPPOPOTAS:
case Species.HIPPOWDON: case Species.HIPPOWDON:
@ -479,7 +479,7 @@ export abstract class PokemonSpeciesForm {
for (let i = 0; i < pixelData.length; i += 4) { for (let i = 0; i < pixelData.length; i += 4) {
if (pixelData[i + 3]) { if (pixelData[i + 3]) {
const pixel = pixelData.slice(i, i + 4); const pixel = pixelData.slice(i, i + 4);
const [ r, g, b, a ] = pixel; const [ r, g, b, a ] = pixel;
if (!spriteColors.find(c => c[0] === r && c[1] === g && c[2] === b)) { if (!spriteColors.find(c => c[0] === r && c[1] === g && c[2] === b)) {
spriteColors.push([ r, g, b, a ]); spriteColors.push([ r, g, b, a ]);
} }
@ -494,12 +494,12 @@ export abstract class PokemonSpeciesForm {
} }
pixelColors.push(argbFromRgba({ r: pixelData[i], g: pixelData[i + 1], b: pixelData[i + 2], a: pixelData[i + 3] })); pixelColors.push(argbFromRgba({ r: pixelData[i], g: pixelData[i + 1], b: pixelData[i + 2], a: pixelData[i + 3] }));
} }
let paletteColors: Map<number, number>; let paletteColors: Map<number, number>;
const originalRandom = Math.random; const originalRandom = Math.random;
Math.random = () => Phaser.Math.RND.realInRange(0, 1); Math.random = () => Phaser.Math.RND.realInRange(0, 1);
scene.executeWithSeedOffset(() => { scene.executeWithSeedOffset(() => {
paletteColors = QuantizerCelebi.quantize(pixelColors, 2); paletteColors = QuantizerCelebi.quantize(pixelColors, 2);
}, 0, "This result should not vary"); }, 0, "This result should not vary");
@ -541,7 +541,7 @@ export default class PokemonSpecies extends PokemonSpeciesForm implements Locali
this.genderDiffs = genderDiffs; this.genderDiffs = genderDiffs;
this.canChangeForm = !!canChangeForm; this.canChangeForm = !!canChangeForm;
this.forms = forms; this.forms = forms;
this.localize(); this.localize();
forms.forEach((form, f) => { forms.forEach((form, f) => {
@ -632,10 +632,10 @@ export default class PokemonSpecies extends PokemonSpeciesForm implements Locali
} }
let evolutionChance: number; let evolutionChance: number;
const evolutionSpecies = getPokemonSpecies(ev.speciesId); const evolutionSpecies = getPokemonSpecies(ev.speciesId);
const isRegionalEvolution = !this.isRegional() && evolutionSpecies.isRegional(); const isRegionalEvolution = !this.isRegional() && evolutionSpecies.isRegional();
if (!forTrainer && isRegionalEvolution) { if (!forTrainer && isRegionalEvolution) {
evolutionChance = 0; evolutionChance = 0;
} else { } else {
@ -645,7 +645,7 @@ export default class PokemonSpecies extends PokemonSpeciesForm implements Locali
} else { } else {
const maxLevelDiff = this.getStrengthLevelDiff(strength); const maxLevelDiff = this.getStrengthLevelDiff(strength);
const minChance: number = 0.875 - 0.125 * strength; const minChance: number = 0.875 - 0.125 * strength;
evolutionChance = Math.min(minChance + easeInFunc(Math.min(level - ev.level, maxLevelDiff) / maxLevelDiff) * (1 - minChance), 1); evolutionChance = Math.min(minChance + easeInFunc(Math.min(level - ev.level, maxLevelDiff) / maxLevelDiff) * (1 - minChance), 1);
} }
} else { } else {
@ -671,7 +671,7 @@ export default class PokemonSpecies extends PokemonSpeciesForm implements Locali
totalWeight += evolutionChance; totalWeight += evolutionChance;
evolutionPool.set(totalWeight, ev.speciesId); evolutionPool.set(totalWeight, ev.speciesId);
if ((1 - evolutionChance) < noEvolutionChance) { if ((1 - evolutionChance) < noEvolutionChance) {
noEvolutionChance = 1 - evolutionChance; noEvolutionChance = 1 - evolutionChance;
} }
@ -681,7 +681,7 @@ export default class PokemonSpecies extends PokemonSpeciesForm implements Locali
if (noEvolutionChance === 1 || Phaser.Math.RND.realInRange(0, 1) < noEvolutionChance) { if (noEvolutionChance === 1 || Phaser.Math.RND.realInRange(0, 1) < noEvolutionChance) {
return this.speciesId; return this.speciesId;
} }
const randValue = evolutionPool.size === 1 ? 0 : Utils.randSeedInt(totalWeight); const randValue = evolutionPool.size === 1 ? 0 : Utils.randSeedInt(totalWeight);
for (const weight of evolutionPool.keys()) { for (const weight of evolutionPool.keys()) {

View File

@ -164,14 +164,14 @@ export function getRandomStatusEffect(statusEffectA: StatusEffect, statusEffectB
* @param statusA The first Status * @param statusA The first Status
* @param statusB The second Status * @param statusB The second Status
*/ */
export function getRandomStatus(statusA: Status, statusB: Status): Status { export function getRandomStatus(statusA: Status, statusB: Status): Status {
if (statusA === undefined || statusA.effect === StatusEffect.NONE || statusA.effect === StatusEffect.FAINT) { if (statusA === undefined || statusA.effect === StatusEffect.NONE || statusA.effect === StatusEffect.FAINT) {
return statusB; return statusB;
} }
if (statusB === undefined || statusB.effect === StatusEffect.NONE || statusB.effect === StatusEffect.FAINT) { if (statusB === undefined || statusB.effect === StatusEffect.NONE || statusB.effect === StatusEffect.FAINT) {
return statusA; return statusA;
} }
return Utils.randIntRange(0, 2) ? statusA : statusB; return Utils.randIntRange(0, 2) ? statusA : statusB;
} }

View File

@ -710,7 +710,7 @@ export const trainerConfigs: TrainerConfigs = {
.setSpeciesPools({ .setSpeciesPools({
[TrainerPoolTier.COMMON]: [ Species.RHYHORN, Species.AIPOM, Species.MAKUHITA, Species.MAWILE, Species.NUMEL, Species.LILLIPUP, Species.SANDILE, Species.WOOLOO ], [TrainerPoolTier.COMMON]: [ Species.RHYHORN, Species.AIPOM, Species.MAKUHITA, Species.MAWILE, Species.NUMEL, Species.LILLIPUP, Species.SANDILE, Species.WOOLOO ],
[TrainerPoolTier.UNCOMMON]: [ Species.GIRAFARIG, Species.ZANGOOSE, Species.SEVIPER, Species.CUBCHOO, Species.PANCHAM, Species.SKIDDO, Species.MUDBRAY ], [TrainerPoolTier.UNCOMMON]: [ Species.GIRAFARIG, Species.ZANGOOSE, Species.SEVIPER, Species.CUBCHOO, Species.PANCHAM, Species.SKIDDO, Species.MUDBRAY ],
[TrainerPoolTier.RARE]: [ Species.TAUROS, Species.STANTLER, Species.DARUMAKA, Species.BOUFFALANT, Species.DEERLING, Species.IMPIDIMP ], [TrainerPoolTier.RARE]: [ Species.TAUROS, Species.STANTLER, Species.DARUMAKA, Species.BOUFFALANT, Species.DEERLING, Species.IMPIDIMP ],
[TrainerPoolTier.SUPER_RARE]: [ Species.GALAR_DARUMAKA, Species.TEDDIURSA ] [TrainerPoolTier.SUPER_RARE]: [ Species.GALAR_DARUMAKA, Species.TEDDIURSA ]
}), }),
[TrainerType.BAKER]: new TrainerConfig(++t).setEncounterBgm(TrainerType.CLERK).setMoneyMultiplier(1.35).setSpeciesFilter(s => s.isOfType(Type.GRASS) || s.isOfType(Type.FIRE)), [TrainerType.BAKER]: new TrainerConfig(++t).setEncounterBgm(TrainerType.CLERK).setMoneyMultiplier(1.35).setSpeciesFilter(s => s.isOfType(Type.GRASS) || s.isOfType(Type.FIRE)),
@ -721,7 +721,7 @@ export const trainerConfigs: TrainerConfigs = {
.setSpeciesPools({ .setSpeciesPools({
[TrainerPoolTier.COMMON]: [ Species.NIDORAN_F, Species.NIDORAN_M, Species.MACHOP, Species.MAKUHITA, Species.MEDITITE, Species.CROAGUNK, Species.TIMBURR ], [TrainerPoolTier.COMMON]: [ Species.NIDORAN_F, Species.NIDORAN_M, Species.MACHOP, Species.MAKUHITA, Species.MEDITITE, Species.CROAGUNK, Species.TIMBURR ],
[TrainerPoolTier.UNCOMMON]: [ Species.MANKEY, Species.POLIWRATH, Species.TYROGUE, Species.BRELOOM, Species.SCRAGGY, Species.MIENFOO, Species.PANCHAM, Species.STUFFUL, Species.CRABRAWLER ], [TrainerPoolTier.UNCOMMON]: [ Species.MANKEY, Species.POLIWRATH, Species.TYROGUE, Species.BRELOOM, Species.SCRAGGY, Species.MIENFOO, Species.PANCHAM, Species.STUFFUL, Species.CRABRAWLER ],
[TrainerPoolTier.RARE]: [ Species.HERACROSS, Species.RIOLU, Species.THROH, Species.SAWK, Species.PASSIMIAN, Species.CLOBBOPUS ], [TrainerPoolTier.RARE]: [ Species.HERACROSS, Species.RIOLU, Species.THROH, Species.SAWK, Species.PASSIMIAN, Species.CLOBBOPUS ],
[TrainerPoolTier.SUPER_RARE]: [ Species.HITMONTOP, Species.INFERNAPE, Species.GALLADE, Species.HAWLUCHA, Species.HAKAMO_O ], [TrainerPoolTier.SUPER_RARE]: [ Species.HITMONTOP, Species.INFERNAPE, Species.GALLADE, Species.HAWLUCHA, Species.HAKAMO_O ],
[TrainerPoolTier.ULTRA_RARE]: [ Species.KUBFU ] [TrainerPoolTier.ULTRA_RARE]: [ Species.KUBFU ]
}), }),
@ -748,7 +748,7 @@ export const trainerConfigs: TrainerConfigs = {
.setSpeciesPools({ .setSpeciesPools({
[TrainerPoolTier.COMMON]: [ Species.RALTS, Species.SPOINK, Species.LOTAD, Species.BUDEW ], [TrainerPoolTier.COMMON]: [ Species.RALTS, Species.SPOINK, Species.LOTAD, Species.BUDEW ],
[TrainerPoolTier.UNCOMMON]: [ Species.SPINDA, Species.SWABLU, Species.MARACTUS,], [TrainerPoolTier.UNCOMMON]: [ Species.SPINDA, Species.SWABLU, Species.MARACTUS,],
[TrainerPoolTier.RARE]: [ Species.BELLOSSOM, Species.HITMONTOP, Species.MIME_JR, Species.ORICORIO ], [TrainerPoolTier.RARE]: [ Species.BELLOSSOM, Species.HITMONTOP, Species.MIME_JR, Species.ORICORIO ],
[TrainerPoolTier.SUPER_RARE]: [ Species.POPPLIO ] [TrainerPoolTier.SUPER_RARE]: [ Species.POPPLIO ]
}), }),
[TrainerType.DEPOT_AGENT]: new TrainerConfig(++t).setMoneyMultiplier(1.45).setEncounterBgm(TrainerType.CLERK), [TrainerType.DEPOT_AGENT]: new TrainerConfig(++t).setMoneyMultiplier(1.45).setEncounterBgm(TrainerType.CLERK),
@ -785,7 +785,7 @@ export const trainerConfigs: TrainerConfigs = {
[TrainerType.NURSERY_AIDE]: new TrainerConfig(++t).setMoneyMultiplier(1.3).setEncounterBgm("lass"), [TrainerType.NURSERY_AIDE]: new TrainerConfig(++t).setMoneyMultiplier(1.3).setEncounterBgm("lass"),
[TrainerType.OFFICER]: new TrainerConfig(++t).setMoneyMultiplier(1.55).setEncounterBgm(TrainerType.CLERK) [TrainerType.OFFICER]: new TrainerConfig(++t).setMoneyMultiplier(1.55).setEncounterBgm(TrainerType.CLERK)
.setPartyTemplates(trainerPartyTemplates.ONE_AVG, trainerPartyTemplates.ONE_STRONG, trainerPartyTemplates.TWO_AVG, trainerPartyTemplates.TWO_WEAK_SAME_ONE_AVG) .setPartyTemplates(trainerPartyTemplates.ONE_AVG, trainerPartyTemplates.ONE_STRONG, trainerPartyTemplates.TWO_AVG, trainerPartyTemplates.TWO_WEAK_SAME_ONE_AVG)
.setSpeciesPools({ .setSpeciesPools({
[TrainerPoolTier.COMMON]: [ Species.VULPIX, Species.GROWLITHE, Species.SNUBBULL, Species.POOCHYENA, Species.ELECTRIKE, Species.LILLIPUP, Species.YAMPER, Species.FIDOUGH ], [TrainerPoolTier.COMMON]: [ Species.VULPIX, Species.GROWLITHE, Species.SNUBBULL, Species.POOCHYENA, Species.ELECTRIKE, Species.LILLIPUP, Species.YAMPER, Species.FIDOUGH ],
[TrainerPoolTier.UNCOMMON]: [ Species.HOUNDOUR, Species.ROCKRUFF, Species.MASCHIFF ], [TrainerPoolTier.UNCOMMON]: [ Species.HOUNDOUR, Species.ROCKRUFF, Species.MASCHIFF ],
[TrainerPoolTier.RARE]: [ Species.JOLTEON, Species.RIOLU ], [TrainerPoolTier.RARE]: [ Species.JOLTEON, Species.RIOLU ],
@ -932,7 +932,7 @@ export const trainerConfigs: TrainerConfigs = {
[TrainerType.RYME]: new TrainerConfig(++t).initForGymLeader([ Species.GREAVARD, Species.SHUPPET, Species.MIMIKYU ], Type.GHOST), [TrainerType.RYME]: new TrainerConfig(++t).initForGymLeader([ Species.GREAVARD, Species.SHUPPET, Species.MIMIKYU ], Type.GHOST),
[TrainerType.TULIP]: new TrainerConfig(++t).initForGymLeader([ Species.GIRAFARIG, Species.FLITTLE, Species.RALTS ], Type.PSYCHIC), [TrainerType.TULIP]: new TrainerConfig(++t).initForGymLeader([ Species.GIRAFARIG, Species.FLITTLE, Species.RALTS ], Type.PSYCHIC),
[TrainerType.GRUSHA]: new TrainerConfig(++t).initForGymLeader([ Species.CETODDLE, Species.ALOLA_VULPIX, Species.CUBCHOO ], Type.ICE), [TrainerType.GRUSHA]: new TrainerConfig(++t).initForGymLeader([ Species.CETODDLE, Species.ALOLA_VULPIX, Species.CUBCHOO ], Type.ICE),
[TrainerType.LORELEI]: new TrainerConfig((t = TrainerType.LORELEI)).initForEliteFour([ Species.SLOWBRO, Species.LAPRAS, Species.DEWGONG, Species.ALOLA_SANDSLASH ], Type.ICE), [TrainerType.LORELEI]: new TrainerConfig((t = TrainerType.LORELEI)).initForEliteFour([ Species.SLOWBRO, Species.LAPRAS, Species.DEWGONG, Species.ALOLA_SANDSLASH ], Type.ICE),
[TrainerType.BRUNO]: new TrainerConfig(++t).initForEliteFour([ Species.ONIX, Species.HITMONCHAN, Species.HITMONLEE, Species.ALOLA_GOLEM ], Type.FIGHTING), [TrainerType.BRUNO]: new TrainerConfig(++t).initForEliteFour([ Species.ONIX, Species.HITMONCHAN, Species.HITMONLEE, Species.ALOLA_GOLEM ], Type.FIGHTING),
[TrainerType.AGATHA]: new TrainerConfig(++t).initForEliteFour([ Species.GENGAR, Species.ARBOK, Species.CROBAT, Species.ALOLA_MAROWAK ], Type.GHOST), [TrainerType.AGATHA]: new TrainerConfig(++t).initForEliteFour([ Species.GENGAR, Species.ARBOK, Species.CROBAT, Species.ALOLA_MAROWAK ], Type.GHOST),

View File

@ -174,7 +174,7 @@ function fetchAndPopulateTrainerNames(url: string, parser: DOMParser, trainerNam
populateTrainerNamePromises.push(new Promise<void>(resolve => { populateTrainerNamePromises.push(new Promise<void>(resolve => {
const trainerType = t; const trainerType = t;
trainerTypeNames[trainerType] = []; trainerTypeNames[trainerType] = [];
const config = trainerNameConfigs[t] as TrainerNameConfig; const config = trainerNameConfigs[t] as TrainerNameConfig;
const trainerNames = new Set<string>(); const trainerNames = new Set<string>();
const femaleTrainerNames = new Set<string>(); const femaleTrainerNames = new Set<string>();

View File

@ -498,47 +498,47 @@ export function getTypeDamageMultiplier(attackType: integer, defType: integer):
} }
case Type.STELLAR: case Type.STELLAR:
return 1; return 1;
} }
} }
export function getTypeRgb(type: Type): [ integer, integer, integer ] { export function getTypeRgb(type: Type): [ integer, integer, integer ] {
switch (type) { switch (type) {
case Type.NORMAL: case Type.NORMAL:
return [ 168, 168, 120 ]; return [ 168, 168, 120 ];
case Type.FIGHTING: case Type.FIGHTING:
return [ 192, 48, 40 ]; return [ 192, 48, 40 ];
case Type.FLYING: case Type.FLYING:
return [ 168, 144, 240 ]; return [ 168, 144, 240 ];
case Type.POISON: case Type.POISON:
return [ 160, 64, 160 ]; return [ 160, 64, 160 ];
case Type.GROUND: case Type.GROUND:
return [ 224, 192, 104 ]; return [ 224, 192, 104 ];
case Type.ROCK: case Type.ROCK:
return [ 184, 160, 56 ]; return [ 184, 160, 56 ];
case Type.BUG: case Type.BUG:
return [ 168, 184, 32 ]; return [ 168, 184, 32 ];
case Type.GHOST: case Type.GHOST:
return [ 112, 88, 152 ]; return [ 112, 88, 152 ];
case Type.STEEL: case Type.STEEL:
return [ 184, 184, 208 ]; return [ 184, 184, 208 ];
case Type.FIRE: case Type.FIRE:
return [ 240, 128, 48 ]; return [ 240, 128, 48 ];
case Type.WATER: case Type.WATER:
return [ 104, 144, 240 ]; return [ 104, 144, 240 ];
case Type.GRASS: case Type.GRASS:
return [ 120, 200, 80 ]; return [ 120, 200, 80 ];
case Type.ELECTRIC: case Type.ELECTRIC:
return [ 248, 208, 48 ]; return [ 248, 208, 48 ];
case Type.PSYCHIC: case Type.PSYCHIC:
return [ 248, 88, 136 ]; return [ 248, 88, 136 ];
case Type.ICE: case Type.ICE:
return [ 152, 216, 216 ]; return [ 152, 216, 216 ];
case Type.DRAGON: case Type.DRAGON:
return [ 112, 56, 248 ]; return [ 112, 56, 248 ];
case Type.DARK: case Type.DARK:
return [ 112, 88, 72 ]; return [ 112, 88, 72 ];
case Type.FAIRY: case Type.FAIRY:
return [ 232, 136, 200 ]; return [ 232, 136, 200 ];
case Type.STELLAR: case Type.STELLAR:
return [ 255, 255, 255 ]; return [ 255, 255, 255 ];
default: default:

View File

@ -291,7 +291,7 @@ export class EggHatchPhase extends Phase {
this.infoContainer.show(this.pokemon, false, this.skipped ? 2 : 1); this.infoContainer.show(this.pokemon, false, this.skipped ? 2 : 1);
this.scene.playSoundWithoutBgm("evolution_fanfare"); this.scene.playSoundWithoutBgm("evolution_fanfare");
this.scene.ui.showText(`${this.pokemon.name} hatched from the egg!`, null, () => { this.scene.ui.showText(`${this.pokemon.name} hatched from the egg!`, null, () => {
this.scene.gameData.updateSpeciesDexIvs(this.pokemon.species.speciesId, this.pokemon.ivs); this.scene.gameData.updateSpeciesDexIvs(this.pokemon.species.speciesId, this.pokemon.ivs);
this.scene.gameData.setPokemonCaught(this.pokemon, true, true).then(() => { this.scene.gameData.setPokemonCaught(this.pokemon, true, true).then(() => {
@ -374,7 +374,7 @@ export class EggHatchPhase extends Phase {
if (this.egg.isManaphyEgg()) { if (this.egg.isManaphyEgg()) {
const rand = Utils.randSeedInt(8); const rand = Utils.randSeedInt(8);
speciesOverride = rand ? Species.PHIONE : Species.MANAPHY; speciesOverride = rand ? Species.PHIONE : Species.MANAPHY;
} else if (this.egg.tier === EggTier.MASTER } else if (this.egg.tier === EggTier.MASTER
&& this.egg.gachaType === GachaType.LEGENDARY) { && this.egg.gachaType === GachaType.LEGENDARY) {
@ -451,14 +451,14 @@ export class EggHatchPhase extends Phase {
for (let s = 0; s < ret.ivs.length; s++) { for (let s = 0; s < ret.ivs.length; s++) {
ret.ivs[s] = Math.max(ret.ivs[s], secondaryIvs[s]); ret.ivs[s] = Math.max(ret.ivs[s], secondaryIvs[s]);
} }
const baseChance = this.egg.gachaType === GachaType.MOVE ? 3 : 6; const baseChance = this.egg.gachaType === GachaType.MOVE ? 3 : 6;
this.eggMoveIndex = Utils.randSeedInt(baseChance * Math.pow(2, 3 - this.egg.tier)) this.eggMoveIndex = Utils.randSeedInt(baseChance * Math.pow(2, 3 - this.egg.tier))
? Utils.randSeedInt(3) ? Utils.randSeedInt(3)
: 3; : 3;
}, this.egg.id, EGG_SEED.toString()); }, this.egg.id, EGG_SEED.toString());
return ret; return ret;
} }
} }

View File

@ -14,7 +14,7 @@ import i18next from "i18next";
export class EvolutionPhase extends Phase { export class EvolutionPhase extends Phase {
protected pokemon: PlayerPokemon; protected pokemon: PlayerPokemon;
protected lastLevel: integer; protected lastLevel: integer;
private evolution: SpeciesFormEvolution; private evolution: SpeciesFormEvolution;
protected evolutionContainer: Phaser.GameObjects.Container; protected evolutionContainer: Phaser.GameObjects.Container;
@ -117,7 +117,7 @@ export class EvolutionPhase extends Phase {
doEvolution(): void { doEvolution(): void {
const evolutionHandler = this.scene.ui.getHandler() as EvolutionSceneHandler; const evolutionHandler = this.scene.ui.getHandler() as EvolutionSceneHandler;
const preName = this.pokemon.name; const preName = this.pokemon.name;
this.scene.ui.showText(i18next.t("menu:evolving", { pokemonName: preName }), null, () => { this.scene.ui.showText(i18next.t("menu:evolving", { pokemonName: preName }), null, () => {
this.pokemon.cry(); this.pokemon.cry();
@ -211,7 +211,7 @@ export class EvolutionPhase extends Phase {
}, null, true); }, null, true);
return; return;
} }
this.scene.playSound("sparkle"); this.scene.playSound("sparkle");
this.pokemonEvoSprite.setVisible(true); this.pokemonEvoSprite.setVisible(true);
this.doCircleInward(); this.doCircleInward();
@ -222,7 +222,7 @@ export class EvolutionPhase extends Phase {
const levelMoves = this.pokemon.getLevelMoves(this.lastLevel + 1, true); const levelMoves = this.pokemon.getLevelMoves(this.lastLevel + 1, true);
for (const lm of levelMoves) { for (const lm of levelMoves) {
this.scene.unshiftPhase(new LearnMovePhase(this.scene, this.scene.getParty().indexOf(this.pokemon), lm[1])); this.scene.unshiftPhase(new LearnMovePhase(this.scene, this.scene.getParty().indexOf(this.pokemon), lm[1]));
} }
this.scene.unshiftPhase(new EndEvolutionPhase(this.scene)); this.scene.unshiftPhase(new EndEvolutionPhase(this.scene));
this.scene.playSound("shine"); this.scene.playSound("shine");
@ -252,7 +252,7 @@ export class EvolutionPhase extends Phase {
this.pokemon.cry(); this.pokemon.cry();
this.scene.time.delayedCall(1250, () => { this.scene.time.delayedCall(1250, () => {
this.scene.playSoundWithoutBgm("evolution_fanfare"); this.scene.playSoundWithoutBgm("evolution_fanfare");
evolvedPokemon.destroy(); evolvedPokemon.destroy();
this.scene.ui.showText(i18next.t("menu:evolutionDone", { pokemonName: preName, evolvedPokemonName: this.pokemon.name }), null, () => this.end(), null, true, Utils.fixedInt(4000)); this.scene.ui.showText(i18next.t("menu:evolutionDone", { pokemonName: preName, evolvedPokemonName: this.pokemon.name }), null, () => this.end(), null, true, Utils.fixedInt(4000));
this.scene.time.delayedCall(Utils.fixedInt(4250), () => this.scene.playBgm()); this.scene.time.delayedCall(Utils.fixedInt(4250), () => this.scene.playBgm());
@ -280,7 +280,7 @@ export class EvolutionPhase extends Phase {
doSpiralUpward() { doSpiralUpward() {
let f = 0; let f = 0;
this.scene.tweens.addCounter({ this.scene.tweens.addCounter({
repeat: 64, repeat: 64,
duration: Utils.getFrameMs(1), duration: Utils.getFrameMs(1),
@ -299,7 +299,7 @@ export class EvolutionPhase extends Phase {
doArcDownward() { doArcDownward() {
let f = 0; let f = 0;
this.scene.tweens.addCounter({ this.scene.tweens.addCounter({
repeat: 96, repeat: 96,
duration: Utils.getFrameMs(1), duration: Utils.getFrameMs(1),
@ -350,7 +350,7 @@ export class EvolutionPhase extends Phase {
doCircleInward() { doCircleInward() {
let f = 0; let f = 0;
this.scene.tweens.addCounter({ this.scene.tweens.addCounter({
repeat: 48, repeat: 48,
duration: Utils.getFrameMs(1), duration: Utils.getFrameMs(1),
@ -371,7 +371,7 @@ export class EvolutionPhase extends Phase {
doSpray() { doSpray() {
let f = 0; let f = 0;
this.scene.tweens.addCounter({ this.scene.tweens.addCounter({
repeat: 48, repeat: 48,
duration: Utils.getFrameMs(1), duration: Utils.getFrameMs(1),

View File

@ -108,11 +108,11 @@ function doMbOpenParticles(scene: BattleScene, x: number, y: number) {
} }
function doFanOutParticle(scene: BattleScene, trigIndex: integer, x: integer, y: integer, xSpeed: integer, ySpeed: integer, angle: integer, frameIndex: integer): Phaser.GameObjects.Image { function doFanOutParticle(scene: BattleScene, trigIndex: integer, x: integer, y: integer, xSpeed: integer, ySpeed: integer, angle: integer, frameIndex: integer): Phaser.GameObjects.Image {
let f = 0; let f = 0;
const particle = scene.add.image(x, y, "pb_particles", `${frameIndex}.png`); const particle = scene.add.image(x, y, "pb_particles", `${frameIndex}.png`);
scene.field.add(particle); scene.field.add(particle);
const updateParticle = () => { const updateParticle = () => {
if (!particle.scene) { if (!particle.scene) {
return particleTimer.remove(); return particleTimer.remove();

View File

@ -106,7 +106,7 @@ export class Arena {
} }
} }
} }
ret = getPokemonSpecies(species); ret = getPokemonSpecies(species);
if (ret.subLegendary || ret.legendary || ret.mythical) { if (ret.subLegendary || ret.legendary || ret.mythical) {
@ -292,7 +292,7 @@ export class Arena {
if (Overrides.WEATHER_OVERRIDE) { if (Overrides.WEATHER_OVERRIDE) {
return this.trySetWeatherOverride(Overrides.WEATHER_OVERRIDE); return this.trySetWeatherOverride(Overrides.WEATHER_OVERRIDE);
} }
if (this.weather?.weatherType === (weather || undefined)) { if (this.weather?.weatherType === (weather || undefined)) {
return false; return false;
} }
@ -300,7 +300,7 @@ export class Arena {
const oldWeatherType = this.weather?.weatherType || WeatherType.NONE; const oldWeatherType = this.weather?.weatherType || WeatherType.NONE;
this.weather = weather ? new Weather(weather, hasPokemonSource ? 5 : 0) : null; this.weather = weather ? new Weather(weather, hasPokemonSource ? 5 : 0) : null;
if (this.weather) { if (this.weather) {
this.scene.tryReplacePhase(phase => phase instanceof WeatherEffectPhase && phase.weather.weatherType === oldWeatherType, new WeatherEffectPhase(this.scene, this.weather)); this.scene.tryReplacePhase(phase => phase instanceof WeatherEffectPhase && phase.weather.weatherType === oldWeatherType, new WeatherEffectPhase(this.scene, this.weather));
this.scene.unshiftPhase(new CommonAnimPhase(this.scene, undefined, undefined, CommonAnim.SUNNY + (weather - 1))); this.scene.unshiftPhase(new CommonAnimPhase(this.scene, undefined, undefined, CommonAnim.SUNNY + (weather - 1)));
@ -314,7 +314,7 @@ export class Arena {
pokemon.findAndRemoveTags(t => "weatherTypes" in t && !(t.weatherTypes as WeatherType[]).find(t => t === weather)); pokemon.findAndRemoveTags(t => "weatherTypes" in t && !(t.weatherTypes as WeatherType[]).find(t => t === weather));
applyPostWeatherChangeAbAttrs(PostWeatherChangeAbAttr, pokemon, weather); applyPostWeatherChangeAbAttrs(PostWeatherChangeAbAttr, pokemon, weather);
}); });
return true; return true;
} }
@ -326,7 +326,7 @@ export class Arena {
const oldTerrainType = this.terrain?.terrainType || TerrainType.NONE; const oldTerrainType = this.terrain?.terrainType || TerrainType.NONE;
this.terrain = terrain ? new Terrain(terrain, hasPokemonSource ? 5 : 0) : null; this.terrain = terrain ? new Terrain(terrain, hasPokemonSource ? 5 : 0) : null;
if (this.terrain) { if (this.terrain) {
if (!ignoreAnim) { if (!ignoreAnim) {
this.scene.unshiftPhase(new CommonAnimPhase(this.scene, undefined, undefined, CommonAnim.MISTY_TERRAIN + (terrain - 1))); this.scene.unshiftPhase(new CommonAnimPhase(this.scene, undefined, undefined, CommonAnim.MISTY_TERRAIN + (terrain - 1)));
@ -340,7 +340,7 @@ export class Arena {
pokemon.findAndRemoveTags(t => "terrainTypes" in t && !(t.terrainTypes as TerrainType[]).find(t => t === terrain)); pokemon.findAndRemoveTags(t => "terrainTypes" in t && !(t.terrainTypes as TerrainType[]).find(t => t === terrain));
applyPostTerrainChangeAbAttrs(PostTerrainChangeAbAttr, pokemon, terrain); applyPostTerrainChangeAbAttrs(PostTerrainChangeAbAttr, pokemon, terrain);
}); });
return true; return true;
} }
@ -506,7 +506,7 @@ export class Arena {
} }
tags.forEach(t => t.apply(this, args)); tags.forEach(t => t.apply(this, args));
} }
applyTags(tagType: ArenaTagType | { new(...args: any[]): ArenaTag }, ...args: any[]): void { applyTags(tagType: ArenaTagType | { new(...args: any[]): ArenaTag }, ...args: any[]): void {
this.applyTagsForSide(tagType, ArenaTagSide.BOTH, ...args); this.applyTagsForSide(tagType, ArenaTagSide.BOTH, ...args);
} }
@ -568,8 +568,8 @@ export class Arena {
} }
return !!tag; return !!tag;
} }
removeAllTags(): void { removeAllTags(): void {
while (this.tags.length) { while (this.tags.length) {
this.tags[0].onRemove(this); this.tags[0].onRemove(this);
@ -720,7 +720,7 @@ export class ArenaBase extends Phaser.GameObjects.Container {
const hasProps = getBiomeHasProps(biome); const hasProps = getBiomeHasProps(biome);
const biomeKey = getBiomeKey(biome); const biomeKey = getBiomeKey(biome);
const baseKey = `${biomeKey}_${this.player ? "a" : "b"}`; const baseKey = `${biomeKey}_${this.player ? "a" : "b"}`;
if (biome !== this.biome) { if (biome !== this.biome) {
this.base.setTexture(baseKey); this.base.setTexture(baseKey);

View File

@ -61,7 +61,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
public species: PokemonSpecies; public species: PokemonSpecies;
public formIndex: integer; public formIndex: integer;
public abilityIndex: integer; public abilityIndex: integer;
public passive: boolean; public passive: boolean;
public shiny: boolean; public shiny: boolean;
public variant: Variant; public variant: Variant;
public pokeball: PokeballType; public pokeball: PokeballType;
@ -170,7 +170,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
} else { } else {
this.id = Utils.randSeedInt(4294967296); this.id = Utils.randSeedInt(4294967296);
this.ivs = ivs || Utils.getIvsFromId(this.id); this.ivs = ivs || Utils.getIvsFromId(this.id);
if (this.gender === undefined) { if (this.gender === undefined) {
this.generateGender(); this.generateGender();
} }
@ -239,7 +239,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
}; };
this.setScale(this.getSpriteScale()); this.setScale(this.getSpriteScale());
const sprite = getSprite(true); const sprite = getSprite(true);
const tintSprite = getSprite(); const tintSprite = getSprite();
@ -555,9 +555,9 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
return false; return false;
} }
return true; return true;
} }
playAnim(): void { playAnim(): void {
this.tryPlaySprite(this.getSprite(), this.getTintSprite(), this.getBattleSpriteKey()); this.tryPlaySprite(this.getSprite(), this.getTintSprite(), this.getBattleSpriteKey());
} }
@ -662,7 +662,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
break; break;
case Stat.SPD: case Stat.SPD:
// Check both the player and enemy to see if Tailwind should be multiplying the speed of the Pokemon // Check both the player and enemy to see if Tailwind should be multiplying the speed of the Pokemon
if ((this.isPlayer() && this.scene.arena.getTagOnSide(ArenaTagType.TAILWIND, ArenaTagSide.PLAYER)) if ((this.isPlayer() && this.scene.arena.getTagOnSide(ArenaTagType.TAILWIND, ArenaTagSide.PLAYER))
|| (!this.isPlayer() && this.scene.arena.getTagOnSide(ArenaTagType.TAILWIND, ArenaTagSide.ENEMY))) { || (!this.isPlayer() && this.scene.arena.getTagOnSide(ArenaTagType.TAILWIND, ArenaTagSide.ENEMY))) {
ret *= 2; ret *= 2;
} }
@ -842,7 +842,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
this.summonData.types.forEach(t => types.push(t)); this.summonData.types.forEach(t => types.push(t));
} else { } else {
const speciesForm = this.getSpeciesForm(); const speciesForm = this.getSpeciesForm();
types.push(speciesForm.type1); types.push(speciesForm.type1);
const fusionSpeciesForm = this.getFusionSpeciesForm(); const fusionSpeciesForm = this.getFusionSpeciesForm();
@ -933,10 +933,10 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
starterSpeciesId = pokemonPrevolutions[starterSpeciesId]; starterSpeciesId = pokemonPrevolutions[starterSpeciesId];
} }
return allAbilities[starterPassiveAbilities[starterSpeciesId]]; return allAbilities[starterPassiveAbilities[starterSpeciesId]];
} }
/** /**
* Checks if a pokemon has a passive either from: * Checks if a pokemon has a passive either from:
* - bought with starter candy * - bought with starter candy
* - set by override * - set by override
* - is a boss pokemon * - is a boss pokemon
@ -1009,7 +1009,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
} }
/** /**
* Checks whether a pokemon has an ability with the specified attribute and it's in effect. * Checks whether a pokemon has an ability with the specified attribute and it's in effect.
* Accounts for all the various effects which can affect whether an ability will be present or * Accounts for all the various effects which can affect whether an ability will be present or
* in effect, and both passive and non-passive. This is one of the two primary ways to check * in effect, and both passive and non-passive. This is one of the two primary ways to check
* whether a pokemon has a particular ability. * whether a pokemon has a particular ability.
@ -1209,7 +1209,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
return ret; return ret;
} }
setMove(moveIndex: integer, moveId: Moves): void { setMove(moveIndex: integer, moveId: Moves): void {
const move = moveId ? new PokemonMove(moveId) : null; const move = moveId ? new PokemonMove(moveId) : null;
this.moveset[moveIndex] = move; this.moveset[moveIndex] = move;
@ -1279,12 +1279,12 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
&& !species.isTrainerForbidden() && !species.isTrainerForbidden()
&& species.speciesId !== this.species.speciesId; && species.speciesId !== this.species.speciesId;
}; };
this.fusionSpecies = this.scene.randomSpecies(this.scene.currentBattle?.waveIndex || 0, this.level, false, filter, true); this.fusionSpecies = this.scene.randomSpecies(this.scene.currentBattle?.waveIndex || 0, this.level, false, filter, true);
this.fusionAbilityIndex = (this.fusionSpecies.abilityHidden && hasHiddenAbility ? this.fusionSpecies.ability2 ? 2 : 1 : this.fusionSpecies.ability2 ? randAbilityIndex : 0); this.fusionAbilityIndex = (this.fusionSpecies.abilityHidden && hasHiddenAbility ? this.fusionSpecies.ability2 ? 2 : 1 : this.fusionSpecies.ability2 ? randAbilityIndex : 0);
this.fusionShiny = this.shiny; this.fusionShiny = this.shiny;
this.fusionVariant = this.variant; this.fusionVariant = this.variant;
if (this.fusionSpecies.malePercent === null) { if (this.fusionSpecies.malePercent === null) {
this.fusionGender = Gender.GENDERLESS; this.fusionGender = Gender.GENDERLESS;
} else { } else {
@ -1582,7 +1582,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
const move = battlerMove.getMove(); const move = battlerMove.getMove();
const damage = new Utils.NumberHolder(0); const damage = new Utils.NumberHolder(0);
const defendingSidePlayField = this.isPlayer() ? this.scene.getPlayerField() : this.scene.getEnemyField(); const defendingSidePlayField = this.isPlayer() ? this.scene.getPlayerField() : this.scene.getEnemyField();
const variableCategory = new Utils.IntegerHolder(move.category); const variableCategory = new Utils.IntegerHolder(move.category);
applyMoveAttrs(VariableMoveCategoryAttr, source, this, move, variableCategory); applyMoveAttrs(VariableMoveCategoryAttr, source, this, move, variableCategory);
const moveCategory = variableCategory.value as MoveCategory; const moveCategory = variableCategory.value as MoveCategory;
@ -1694,7 +1694,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
const screenMultiplier = new Utils.NumberHolder(1); const screenMultiplier = new Utils.NumberHolder(1);
if (!isCritical) { if (!isCritical) {
this.scene.arena.applyTagsForSide(WeakenMoveScreenTag, this.isPlayer() ? ArenaTagSide.PLAYER : ArenaTagSide.ENEMY, move.category, this.scene.currentBattle.double, screenMultiplier); this.scene.arena.applyTagsForSide(WeakenMoveScreenTag, this.isPlayer() ? ArenaTagSide.PLAYER : ArenaTagSide.ENEMY, move.category, this.scene.currentBattle.double, screenMultiplier);
} }
const isTypeImmune = (typeMultiplier.value * arenaAttackTypeMultiplier.value) === 0; const isTypeImmune = (typeMultiplier.value * arenaAttackTypeMultiplier.value) === 0;
const sourceTypes = source.getTypes(); const sourceTypes = source.getTypes();
const matchesSourceType = sourceTypes[0] === type || (sourceTypes.length > 1 && sourceTypes[1] === type); const matchesSourceType = sourceTypes[0] === type || (sourceTypes.length > 1 && sourceTypes[1] === type);
@ -1728,11 +1728,11 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
applyPreAttackAbAttrs(DamageBoostAbAttr, source, this, battlerMove, damage); applyPreAttackAbAttrs(DamageBoostAbAttr, source, this, battlerMove, damage);
/** /**
* For each {@link HitsTagAttr} the move has, doubles the damage of the move if: * For each {@link HitsTagAttr} the move has, doubles the damage of the move if:
* The target has a {@link BattlerTagType} that this move interacts with * The target has a {@link BattlerTagType} that this move interacts with
* AND * AND
* The move doubles damage when used against that tag * The move doubles damage when used against that tag
* */ * */
move.getAttrs(HitsTagAttr).map(hta => hta as HitsTagAttr).filter(hta => hta.doubleDamage).forEach(hta => { move.getAttrs(HitsTagAttr).map(hta => hta as HitsTagAttr).filter(hta => hta.doubleDamage).forEach(hta => {
if (this.getTag(hta.tagType)) { if (this.getTag(hta.tagType)) {
@ -1752,7 +1752,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
isCritical = false; isCritical = false;
result = HitResult.EFFECTIVE; result = HitResult.EFFECTIVE;
} }
if (!result) { if (!result) {
if (!typeMultiplier.value) { if (!typeMultiplier.value) {
result = move.id === Moves.SHEER_COLD ? HitResult.IMMUNE : HitResult.NO_EFFECT; result = move.id === Moves.SHEER_COLD ? HitResult.IMMUNE : HitResult.NO_EFFECT;
@ -2123,7 +2123,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
let frameProgress = 0; let frameProgress = 0;
let frameThreshold: number; let frameThreshold: number;
sprite.anims.pause(); sprite.anims.pause();
tintSprite.anims.pause(); tintSprite.anims.pause();
@ -2336,7 +2336,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
return true; return true;
} }
trySetStatus(effect: StatusEffect, asPhase: boolean = false, sourcePokemon: Pokemon = null, cureTurn: integer = 0, sourceText: string = null): boolean { trySetStatus(effect: StatusEffect, asPhase: boolean = false, sourcePokemon: Pokemon = null, cureTurn: integer = 0, sourceText: string = null): boolean {
if (!this.canSetStatus(effect, asPhase, false, sourcePokemon)) { if (!this.canSetStatus(effect, asPhase, false, sourcePokemon)) {
return false; return false;
} }
@ -2626,13 +2626,13 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
fusionPixelColors.push(argbFromRgba({ r, g, b, a })); fusionPixelColors.push(argbFromRgba({ r, g, b, a }));
} }
} }
let paletteColors: Map<number, number>; let paletteColors: Map<number, number>;
let fusionPaletteColors: Map<number, number>; let fusionPaletteColors: Map<number, number>;
const originalRandom = Math.random; const originalRandom = Math.random;
Math.random = () => Phaser.Math.RND.realInRange(0, 1); Math.random = () => Phaser.Math.RND.realInRange(0, 1);
this.scene.executeWithSeedOffset(() => { this.scene.executeWithSeedOffset(() => {
paletteColors = QuantizerCelebi.quantize(pixelColors, 4); paletteColors = QuantizerCelebi.quantize(pixelColors, 4);
fusionPaletteColors = QuantizerCelebi.quantize(fusionPixelColors, 4); fusionPaletteColors = QuantizerCelebi.quantize(fusionPixelColors, 4);
@ -2645,14 +2645,14 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
let keys = Array.from(paletteColors.keys()).sort((a: integer, b: integer) => paletteColors.get(a) < paletteColors.get(b) ? 1 : -1); let keys = Array.from(paletteColors.keys()).sort((a: integer, b: integer) => paletteColors.get(a) < paletteColors.get(b) ? 1 : -1);
let rgbaColors: Map<number, integer[]>; let rgbaColors: Map<number, integer[]>;
let hsvColors: Map<number, number[]>; let hsvColors: Map<number, number[]>;
const mappedColors = new Map<integer, integer[]>(); const mappedColors = new Map<integer, integer[]>();
do { do {
mappedColors.clear(); mappedColors.clear();
rgbaColors = keys.reduce((map: Map<number, integer[]>, k: number) => { rgbaColors = keys.reduce((map: Map<number, integer[]>, k: number) => {
map.set(k, Object.values(rgbaFromArgb(k))); return map; map.set(k, Object.values(rgbaFromArgb(k))); return map;
}, new Map<number, integer[]>()); }, new Map<number, integer[]>());
hsvColors = Array.from(rgbaColors.keys()).reduce((map: Map<number, number[]>, k: number) => { hsvColors = Array.from(rgbaColors.keys()).reduce((map: Map<number, number[]>, k: number) => {
const rgb = rgbaColors.get(k).slice(0, 3); const rgb = rgbaColors.get(k).slice(0, 3);
@ -2780,7 +2780,7 @@ export class PlayerPokemon extends Pokemon {
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);
if (Overrides.SHINY_OVERRIDE) { if (Overrides.SHINY_OVERRIDE) {
this.shiny = true; this.shiny = true;
this.initShinySparkle(); this.initShinySparkle();
@ -2865,7 +2865,7 @@ export class PlayerPokemon extends Pokemon {
} }
this.hideInfo(); this.hideInfo();
this.setVisible(false); this.setVisible(false);
this.scene.ui.setMode(Mode.PARTY, PartyUiMode.FAINT_SWITCH, this.getFieldIndex(), (slotIndex: integer, option: PartyOption) => { this.scene.ui.setMode(Mode.PARTY, PartyUiMode.FAINT_SWITCH, this.getFieldIndex(), (slotIndex: integer, option: PartyOption) => {
if (slotIndex >= this.scene.currentBattle.getBattlerCount() && slotIndex < 6) { if (slotIndex >= this.scene.currentBattle.getBattlerCount() && slotIndex < 6) {
this.scene.unshiftPhase(new SwitchSummonPhase(this.scene, this.getFieldIndex(), slotIndex, false, batonPass)); this.scene.unshiftPhase(new SwitchSummonPhase(this.scene, this.getFieldIndex(), slotIndex, false, batonPass));
@ -2892,7 +2892,7 @@ export class PlayerPokemon extends Pokemon {
if (amount.value > 0) { if (amount.value > 0) {
this.scene.applyModifier(PokemonFriendshipBoosterModifier, true, this, amount); this.scene.applyModifier(PokemonFriendshipBoosterModifier, true, this, amount);
this.scene.applyModifier(PokemonFriendshipBoosterModifier, true, this, starterAmount); this.scene.applyModifier(PokemonFriendshipBoosterModifier, true, this, starterAmount);
this.friendship = Math.min(this.friendship + amount.value, 255); this.friendship = Math.min(this.friendship + amount.value, 255);
if (this.friendship === 255) { if (this.friendship === 255) {
this.scene.validateAchv(achvs.MAX_FRIENDSHIP); this.scene.validateAchv(achvs.MAX_FRIENDSHIP);
@ -2949,7 +2949,7 @@ export class PlayerPokemon extends Pokemon {
}, PartyUiHandler.FilterFainted); }, PartyUiHandler.FilterFainted);
}); });
} }
getPossibleEvolution(evolution: SpeciesFormEvolution): Promise<Pokemon> { getPossibleEvolution(evolution: SpeciesFormEvolution): Promise<Pokemon> {
return new Promise(resolve => { return new Promise(resolve => {
const evolutionSpecies = getPokemonSpecies(evolution.speciesId); const evolutionSpecies = getPokemonSpecies(evolution.speciesId);
@ -3021,11 +3021,11 @@ export class PlayerPokemon extends Pokemon {
private handleSpecialEvolutions(evolution: SpeciesFormEvolution) { private handleSpecialEvolutions(evolution: SpeciesFormEvolution) {
const isFusion = evolution instanceof FusionSpeciesFormEvolution; const isFusion = evolution instanceof FusionSpeciesFormEvolution;
const evoSpecies = (!isFusion ? this.species : this.fusionSpecies); const evoSpecies = (!isFusion ? this.species : this.fusionSpecies);
if (evoSpecies.speciesId === Species.NINCADA && evolution.speciesId === Species.NINJASK) { if (evoSpecies.speciesId === Species.NINCADA && evolution.speciesId === Species.NINJASK) {
const newEvolution = pokemonEvolutions[evoSpecies.speciesId][1]; const newEvolution = pokemonEvolutions[evoSpecies.speciesId][1];
if (newEvolution.condition.predicate(this)) { if (newEvolution.condition.predicate(this)) {
const newPokemon = this.scene.addPlayerPokemon(this.species, this.level, this.abilityIndex, this.formIndex, undefined, this.shiny, this.variant, this.ivs, this.nature); const newPokemon = this.scene.addPlayerPokemon(this.species, this.level, this.abilityIndex, this.formIndex, undefined, this.shiny, this.variant, this.ivs, this.nature);
newPokemon.natureOverride = this.natureOverride; newPokemon.natureOverride = this.natureOverride;
@ -3116,7 +3116,7 @@ export class PlayerPokemon extends Pokemon {
this.generateName(); this.generateName();
this.calculateStats(); this.calculateStats();
// Set this Pokemon's HP to the average % of both fusion components // Set this Pokemon's HP to the average % of both fusion components
this.hp = Math.round(this.stats[Stat.HP] * newHpPercent); this.hp = Math.round(this.stats[Stat.HP] * newHpPercent);
if (!this.isFainted()) { if (!this.isFainted()) {
@ -3168,7 +3168,7 @@ export class PlayerPokemon extends Pokemon {
/** Returns a deep copy of this Pokemon's moveset array */ /** Returns a deep copy of this Pokemon's moveset array */
copyMoveset(): PokemonMove[] { copyMoveset(): PokemonMove[] {
const newMoveset = []; const newMoveset = [];
this.moveset.forEach(move => this.moveset.forEach(move =>
newMoveset.push(new PokemonMove(move.moveId, 0, move.ppUp, move.virtual))); newMoveset.push(new PokemonMove(move.moveId, 0, move.ppUp, move.virtual)));
return newMoveset; return newMoveset;
@ -3230,7 +3230,7 @@ export class EnemyPokemon extends Pokemon {
this.battleInfo.updateBossSegments(this); this.battleInfo.updateBossSegments(this);
} }
} }
setBoss(boss: boolean = true, bossSegments: integer = 0): void { setBoss(boss: boolean = true, bossSegments: integer = 0): void {
if (boss) { if (boss) {
this.bossSegments = bossSegments || this.scene.getEncounterBossSegments(this.scene.currentBattle.waveIndex, this.level, this.species, true); this.bossSegments = bossSegments || this.scene.getEncounterBossSegments(this.scene.currentBattle.waveIndex, this.level, this.species, true);
@ -3404,7 +3404,7 @@ export class EnemyPokemon extends Pokemon {
if (!!move.findAttr(attr => attr instanceof CounterDamageAttr)) { if (!!move.findAttr(attr => attr instanceof CounterDamageAttr)) {
return [BattlerIndex.ATTACKER]; return [BattlerIndex.ATTACKER];
} }
return []; return [];
} }
@ -3476,7 +3476,7 @@ export class EnemyPokemon extends Pokemon {
return 0; return 0;
} }
let clearedBossSegmentIndex = this.isBoss() let clearedBossSegmentIndex = this.isBoss()
? this.bossSegmentIndex + 1 ? this.bossSegmentIndex + 1
: 0; : 0;

View File

@ -31,7 +31,7 @@ export default class Trainer extends Phaser.GameObjects.Container {
? trainerConfigs[trainerType] ? trainerConfigs[trainerType]
: trainerConfigs[TrainerType.ACE_TRAINER]; : trainerConfigs[TrainerType.ACE_TRAINER];
this.variant = variant; this.variant = variant;
this.partyTemplateIndex = Math.min(partyTemplateIndex !== undefined ? partyTemplateIndex : Utils.randSeedWeightedItem(this.config.partyTemplates.map((_, i) => i)), this.partyTemplateIndex = Math.min(partyTemplateIndex !== undefined ? partyTemplateIndex : Utils.randSeedWeightedItem(this.config.partyTemplates.map((_, i) => i)),
this.config.partyTemplates.length - 1); this.config.partyTemplates.length - 1);
if (trainerNamePools.hasOwnProperty(trainerType)) { if (trainerNamePools.hasOwnProperty(trainerType)) {
const namePool = trainerNamePools[trainerType]; const namePool = trainerNamePools[trainerType];
@ -70,7 +70,7 @@ export default class Trainer extends Phaser.GameObjects.Container {
ret.setPipeline(this.scene.spritePipeline, { tone: [ 0.0, 0.0, 0.0, 0.0 ], hasShadow: !!hasShadow }); ret.setPipeline(this.scene.spritePipeline, { tone: [ 0.0, 0.0, 0.0, 0.0 ], hasShadow: !!hasShadow });
return ret; return ret;
}; };
const sprite = getSprite(true); const sprite = getSprite(true);
const tintSprite = getSprite(); const tintSprite = getSprite();
@ -181,7 +181,7 @@ export default class Trainer extends Phaser.GameObjects.Container {
getPartyLevels(waveIndex: integer): integer[] { getPartyLevels(waveIndex: integer): integer[] {
const ret = []; const ret = [];
const partyTemplate = this.getPartyTemplate(); const partyTemplate = this.getPartyTemplate();
const difficultyWaveIndex = this.scene.gameMode.getWaveForDifficulty(waveIndex); const difficultyWaveIndex = this.scene.gameMode.getWaveForDifficulty(waveIndex);
const baseLevel = 1 + difficultyWaveIndex / 2 + Math.pow(difficultyWaveIndex / 25, 2); const baseLevel = 1 + difficultyWaveIndex / 2 + Math.pow(difficultyWaveIndex / 25, 2);
@ -191,9 +191,9 @@ export default class Trainer extends Phaser.GameObjects.Container {
for (let i = 0; i < partyTemplate.size; i++) { for (let i = 0; i < partyTemplate.size; i++) {
let multiplier = 1; let multiplier = 1;
const strength = partyTemplate.getStrength(i); const strength = partyTemplate.getStrength(i);
switch (strength) { switch (strength) {
case PartyMemberStrength.WEAKER: case PartyMemberStrength.WEAKER:
multiplier = 0.95; multiplier = 0.95;
@ -229,7 +229,7 @@ export default class Trainer extends Phaser.GameObjects.Container {
genPartyMember(index: integer): EnemyPokemon { genPartyMember(index: integer): EnemyPokemon {
const battle = this.scene.currentBattle; const battle = this.scene.currentBattle;
const level = battle.enemyLevels[index]; const level = battle.enemyLevels[index];
let ret: EnemyPokemon; let ret: EnemyPokemon;
this.scene.executeWithSeedOffset(() => { this.scene.executeWithSeedOffset(() => {
@ -259,7 +259,7 @@ export default class Trainer extends Phaser.GameObjects.Container {
const species = template.isSameSpecies(index) && index > offset const species = template.isSameSpecies(index) && index > offset
? getPokemonSpecies(battle.enemyParty[offset].species.getTrainerSpeciesForLevel(level, false, template.getStrength(offset))) ? getPokemonSpecies(battle.enemyParty[offset].species.getTrainerSpeciesForLevel(level, false, template.getStrength(offset)))
: this.genNewPartyMemberSpecies(level, strength); : this.genNewPartyMemberSpecies(level, strength);
ret = this.scene.addEnemyPokemon(species, level, !this.isDouble() || !(index % 2) ? TrainerSlot.TRAINER : TrainerSlot.TRAINER_PARTNER); ret = this.scene.addEnemyPokemon(species, level, !this.isDouble() || !(index % 2) ? TrainerSlot.TRAINER : TrainerSlot.TRAINER_PARTNER);
}, this.config.hasStaticParty ? this.config.getDerivedType() + ((index + 1) << 8) : this.scene.currentBattle.waveIndex + (this.config.getDerivedType() << 10) + (((!this.config.useSameSeedForAllMembers ? index : 0) + 1) << 8)); }, this.config.hasStaticParty ? this.config.getDerivedType() + ((index + 1) << 8) : this.scene.currentBattle.waveIndex + (this.config.getDerivedType() << 10) + (((!this.config.useSameSeedForAllMembers ? index : 0) + 1) << 8));
@ -324,7 +324,7 @@ export default class Trainer extends Phaser.GameObjects.Container {
if (trainerSlot && !this.isDouble()) { if (trainerSlot && !this.isDouble()) {
trainerSlot = TrainerSlot.NONE; trainerSlot = TrainerSlot.NONE;
} }
const party = this.scene.getEnemyParty(); const party = this.scene.getEnemyParty();
const nonFaintedPartyMembers = party.slice(this.scene.currentBattle.getBattlerCount()).filter(p => !p.isFainted()).filter(p => !trainerSlot || p.trainerSlot === trainerSlot); const nonFaintedPartyMembers = party.slice(this.scene.currentBattle.getBattlerCount()).filter(p => !p.isFainted()).filter(p => !trainerSlot || p.trainerSlot === trainerSlot);
const partyMemberScores = nonFaintedPartyMembers.map(p => { const partyMemberScores = nonFaintedPartyMembers.map(p => {
@ -374,7 +374,7 @@ export default class Trainer extends Phaser.GameObjects.Container {
return maxScorePartyMemberIndexes[0]; return maxScorePartyMemberIndexes[0];
} }
getPartyMemberModifierChanceMultiplier(index: integer): number { getPartyMemberModifierChanceMultiplier(index: integer): number {
switch (this.getPartyTemplate().getStrength(index)) { switch (this.getPartyTemplate().getStrength(index)) {
case PartyMemberStrength.WEAKER: case PartyMemberStrength.WEAKER:
@ -431,7 +431,7 @@ export default class Trainer extends Phaser.GameObjects.Container {
sprite.play(animConfig); sprite.play(animConfig);
tintSprite.play(animConfig); tintSprite.play(animConfig);
return true; return true;
} }
playAnim(): void { playAnim(): void {

View File

@ -35,7 +35,7 @@ export class FormChangePhase extends EvolutionPhase {
doEvolution(): void { doEvolution(): void {
const preName = this.pokemon.name; const preName = this.pokemon.name;
this.pokemon.getPossibleForm(this.formChange).then(transformedPokemon => { this.pokemon.getPossibleForm(this.formChange).then(transformedPokemon => {
[ this.pokemonEvoSprite, this.pokemonEvoTintSprite ].map(sprite => { [ this.pokemonEvoSprite, this.pokemonEvoTintSprite ].map(sprite => {
@ -132,7 +132,7 @@ export class FormChangePhase extends EvolutionPhase {
const delay = playEvolutionFanfare ? 4000 : 1750; const delay = playEvolutionFanfare ? 4000 : 1750;
this.scene.playSoundWithoutBgm(playEvolutionFanfare ? "evolution_fanfare" : "minor_fanfare"); this.scene.playSoundWithoutBgm(playEvolutionFanfare ? "evolution_fanfare" : "minor_fanfare");
transformedPokemon.destroy(); transformedPokemon.destroy();
this.scene.ui.showText(getSpeciesFormChangeMessage(this.pokemon, this.formChange, preName), null, () => this.end(), null, true, Utils.fixedInt(delay)); this.scene.ui.showText(getSpeciesFormChangeMessage(this.pokemon, this.formChange, preName), null, () => this.end(), null, true, Utils.fixedInt(delay));
this.scene.time.delayedCall(Utils.fixedInt(delay + 250), () => this.scene.playBgm()); this.scene.time.delayedCall(Utils.fixedInt(delay + 250), () => this.scene.playBgm());
@ -287,7 +287,7 @@ export class QuietFormChangePhase extends BattlePhase {
this.pokemon.bossSegmentIndex = 4; this.pokemon.bossSegmentIndex = 4;
this.pokemon.initBattleInfo(); this.pokemon.initBattleInfo();
this.pokemon.cry(); this.pokemon.cry();
const movePhase = this.scene.findPhase(p => p instanceof MovePhase && p.pokemon === this.pokemon) as MovePhase; const movePhase = this.scene.findPhase(p => p instanceof MovePhase && p.pokemon === this.pokemon) as MovePhase;
if (movePhase) { if (movePhase) {
movePhase.cancel(); movePhase.cancel();

View File

@ -46,7 +46,7 @@ export class GameMode implements GameModeConfig {
} }
/** /**
* @returns either: * @returns either:
* - override from overrides.ts * - override from overrides.ts
* - 20 for Daily Runs * - 20 for Daily Runs
* - 5 for all other modes * - 5 for all other modes
@ -132,7 +132,7 @@ export class GameMode implements GameModeConfig {
} }
return false; return false;
} }
isTrainerBoss(waveIndex: integer, biomeType: Biome, offsetGym: boolean): boolean { isTrainerBoss(waveIndex: integer, biomeType: Biome, offsetGym: boolean): boolean {
switch (this.modeId) { switch (this.modeId) {
case GameModes.DAILY: case GameModes.DAILY:
@ -154,7 +154,7 @@ export class GameMode implements GameModeConfig {
/** /**
* Checks if wave provided is the final for current or specified game mode * Checks if wave provided is the final for current or specified game mode
* @param waveIndex * @param waveIndex
* @param modeId game mode * @param modeId game mode
* @returns if the current wave is final for classic or daily OR a minor boss in endless * @returns if the current wave is final for classic or daily OR a minor boss in endless
*/ */
@ -194,7 +194,7 @@ export class GameMode implements GameModeConfig {
* @returns true if waveIndex is a multiple of 250 in Endless * @returns true if waveIndex is a multiple of 250 in Endless
*/ */
isEndlessMinorBoss(waveIndex: integer): boolean { isEndlessMinorBoss(waveIndex: integer): boolean {
return waveIndex % 250 === 0 && return waveIndex % 250 === 0 &&
(this.modeId === GameModes.ENDLESS || this.modeId === GameModes.SPLICED_ENDLESS); (this.modeId === GameModes.ENDLESS || this.modeId === GameModes.SPLICED_ENDLESS);
} }
@ -204,7 +204,7 @@ export class GameMode implements GameModeConfig {
* @returns true if waveIndex is a multiple of 1000 in Endless * @returns true if waveIndex is a multiple of 1000 in Endless
*/ */
isEndlessMajorBoss(waveIndex: integer): boolean { isEndlessMajorBoss(waveIndex: integer): boolean {
return waveIndex % 1000 === 0 && return waveIndex % 1000 === 0 &&
(this.modeId === GameModes.ENDLESS || this.modeId === GameModes.SPLICED_ENDLESS); (this.modeId === GameModes.ENDLESS || this.modeId === GameModes.SPLICED_ENDLESS);
} }

View File

@ -198,7 +198,7 @@ export class LoadingScene extends SceneBase {
this.loadAtlas("types", ""); this.loadAtlas("types", "");
this.loadAtlas("statuses", ""); this.loadAtlas("statuses", "");
this.loadAtlas("categories", ""); this.loadAtlas("categories", "");
this.loadAtlas("egg", "egg"); this.loadAtlas("egg", "egg");
this.loadAtlas("egg_crack", "egg"); this.loadAtlas("egg_crack", "egg");
this.loadAtlas("egg_icons", "egg"); this.loadAtlas("egg_icons", "egg");
@ -350,7 +350,7 @@ export class LoadingScene extends SceneBase {
this.load.on("fileprogress", file => { this.load.on("fileprogress", file => {
assetText.setText(`Loading asset: ${file.key}`); assetText.setText(`Loading asset: ${file.key}`);
}); });
loadingGraphics.push(bg, graphics, progressBar, progressBox, logo, percentText, assetText); loadingGraphics.push(bg, graphics, progressBar, progressBox, logo, percentText, assetText);
if (!mobile) { if (!mobile) {

View File

@ -22,7 +22,7 @@ export const starterSelectUiHandler: SimpleTranslationEntries = {
"nature": "Wesen:", "nature": "Wesen:",
"eggMoves": "Ei-Attacken", "eggMoves": "Ei-Attacken",
"start": "Start", "start": "Start",
"addToParty": "Zum Team hinzufügen", "addToParty": "Zum Team hinzufügen",
"toggleIVs": "DVs anzeigen/verbergen", "toggleIVs": "DVs anzeigen/verbergen",
"manageMoves": "Attacken ändern", "manageMoves": "Attacken ändern",
"useCandies": "Bonbons verwenden", "useCandies": "Bonbons verwenden",

View File

@ -7,9 +7,9 @@ export const tutorial: SimpleTranslationEntries = {
$Das Spiel befindet sich noch in der Entwicklung, ist aber voll spielbar. $Das Spiel befindet sich noch in der Entwicklung, ist aber voll spielbar.
$Für Fehlerberichte nutze bitte den PokéRogue Discord-Server. $Für Fehlerberichte nutze bitte den PokéRogue Discord-Server.
$Sollte das Spiel langsam laufen, überprüfe, ob in deinem Browser "Hardwarebeschleunigung" aktiviert ist.`, $Sollte das Spiel langsam laufen, überprüfe, ob in deinem Browser "Hardwarebeschleunigung" aktiviert ist.`,
"accessMenu": "Nutze M oder Esc, um das Menü zu öffnen. Dort hast du Zugriff auf die Einstellungen und andere Funktionen.", "accessMenu": "Nutze M oder Esc, um das Menü zu öffnen. Dort hast du Zugriff auf die Einstellungen und andere Funktionen.",
"menu": `In diesem Menü hast du Zugriff auf die Einstellungen. "menu": `In diesem Menü hast du Zugriff auf die Einstellungen.
$Dort kannst du u. A. die Spielgeschwin-\ndigkeit und das Fensterdesign ändern. $Dort kannst du u. A. die Spielgeschwin-\ndigkeit und das Fensterdesign ändern.
$Das Menü verbirgt noch andere Funktionen - probier' sie gerne aus!`, $Das Menü verbirgt noch andere Funktionen - probier' sie gerne aus!`,

View File

@ -33,7 +33,7 @@ export const weather: SimpleTranslationEntries = {
"heavyRainStartMessage": "Es fängt an, in Strömen zu regnen!", "heavyRainStartMessage": "Es fängt an, in Strömen zu regnen!",
"heavyRainLapseMessage": "Der strömende Regen hält an.", "heavyRainLapseMessage": "Der strömende Regen hält an.",
"heavyRainClearMessage": "Der strömende Regen lässt nach.", "heavyRainClearMessage": "Der strömende Regen lässt nach.",
"harshSunStartMessage": "Das Sonnenlicht wird sehr viel stärker!", "harshSunStartMessage": "Das Sonnenlicht wird sehr viel stärker!",
"harshSunLapseMessage": "Das Sonnenlicht ist sehr stark.", "harshSunLapseMessage": "Das Sonnenlicht ist sehr stark.",
"harshSunClearMessage": "Das Sonnenlicht verliert an Intensität.", "harshSunClearMessage": "Das Sonnenlicht verliert an Intensität.",

View File

@ -22,7 +22,7 @@ import { battleMessageUiHandler } from "./battle-message-ui-handler";
import { berry } from "./berry"; import { berry } from "./berry";
import { voucher } from "./voucher"; import { voucher } from "./voucher";
export const enConfig = { export const enConfig = {
ability: ability, ability: ability,
abilityTriggers: abilityTriggers, abilityTriggers: abilityTriggers,
battle: battle, battle: battle,

View File

@ -139,10 +139,10 @@ export const modifierType: ModifierTypeTranslationEntries = {
"HYPER_POTION": { name: "Hyper Potion" }, "HYPER_POTION": { name: "Hyper Potion" },
"MAX_POTION": { name: "Max Potion" }, "MAX_POTION": { name: "Max Potion" },
"FULL_RESTORE": { name: "Full Restore" }, "FULL_RESTORE": { name: "Full Restore" },
"REVIVE": { name: "Revive" }, "REVIVE": { name: "Revive" },
"MAX_REVIVE": { name: "Max Revive" }, "MAX_REVIVE": { name: "Max Revive" },
"FULL_HEAL": { name: "Full Heal" }, "FULL_HEAL": { name: "Full Heal" },
"SACRED_ASH": { name: "Sacred Ash" }, "SACRED_ASH": { name: "Sacred Ash" },
@ -187,12 +187,12 @@ export const modifierType: ModifierTypeTranslationEntries = {
"AMULET_COIN": { name: "Amulet Coin", description: "Increases money rewards by 20%" }, "AMULET_COIN": { name: "Amulet Coin", description: "Increases money rewards by 20%" },
"GOLDEN_PUNCH": { name: "Golden Punch", description: "Grants 50% of direct damage inflicted as money" }, "GOLDEN_PUNCH": { name: "Golden Punch", description: "Grants 50% of direct damage inflicted as money" },
"COIN_CASE": { name: "Coin Case", description: "After every 10th battle, receive 10% of your money in interest" }, "COIN_CASE": { name: "Coin Case", description: "After every 10th battle, receive 10% of your money in interest" },
"LOCK_CAPSULE": { name: "Lock Capsule", description: "Allows you to lock item rarities when rerolling items" }, "LOCK_CAPSULE": { name: "Lock Capsule", description: "Allows you to lock item rarities when rerolling items" },
"GRIP_CLAW": { name: "Grip Claw" }, "GRIP_CLAW": { name: "Grip Claw" },
"WIDE_LENS": { name: "Wide Lens" }, "WIDE_LENS": { name: "Wide Lens" },
"MULTI_LENS": { name: "Multi Lens" }, "MULTI_LENS": { name: "Multi Lens" },
"HEALING_CHARM": { name: "Healing Charm", description: "Increases the effectiveness of HP restoring moves and items by 10% (excludes Revives)" }, "HEALING_CHARM": { name: "Healing Charm", description: "Increases the effectiveness of HP restoring moves and items by 10% (excludes Revives)" },
@ -290,7 +290,7 @@ export const modifierType: ModifierTypeTranslationEntries = {
"TART_APPLE": "Tart Apple", "TART_APPLE": "Tart Apple",
"STRAWBERRY_SWEET": "Strawberry Sweet", "STRAWBERRY_SWEET": "Strawberry Sweet",
"UNREMARKABLE_TEACUP": "Unremarkable Teacup", "UNREMARKABLE_TEACUP": "Unremarkable Teacup",
"CHIPPED_POT": "Chipped Pot", "CHIPPED_POT": "Chipped Pot",
"BLACK_AUGURITE": "Black Augurite", "BLACK_AUGURITE": "Black Augurite",
"GALARICA_CUFF": "Galarica Cuff", "GALARICA_CUFF": "Galarica Cuff",

View File

@ -15,7 +15,7 @@ export const pokemonInfo: PokemonInfoTranslationEntries = {
"SPD": "Speed", "SPD": "Speed",
"SPDshortened": "Spd" "SPDshortened": "Spd"
}, },
Type: { Type: {
"UNKNOWN": "Unknown", "UNKNOWN": "Unknown",
"NORMAL": "Normal", "NORMAL": "Normal",

View File

@ -22,7 +22,7 @@ export const starterSelectUiHandler: SimpleTranslationEntries = {
"nature": "Nature:", "nature": "Nature:",
"eggMoves": "Egg Moves", "eggMoves": "Egg Moves",
"start": "Start", "start": "Start",
"addToParty": "Add to Party", "addToParty": "Add to Party",
"toggleIVs": "Toggle IVs", "toggleIVs": "Toggle IVs",
"manageMoves": "Manage Moves", "manageMoves": "Manage Moves",
"useCandies": "Use Candies", "useCandies": "Use Candies",

View File

@ -82,8 +82,8 @@ export const trainerClasses: SimpleTranslationEntries = {
"pokémon_rangers": "Pokémon Ranger", "pokémon_rangers": "Pokémon Ranger",
"ranger": "Ranger", "ranger": "Ranger",
"restaurant_staff": "Restaurant Staff", "restaurant_staff": "Restaurant Staff",
"rich": "Rich", "rich": "Rich",
"rich_female": "Rich", "rich_female": "Rich",
"rich_boy": "Rich Boy", "rich_boy": "Rich Boy",
"rich_couple": "Rich Couple", "rich_couple": "Rich Couple",
"rich_kid": "Rich Kid", "rich_kid": "Rich Kid",

View File

@ -5,9 +5,9 @@ export const tutorial: SimpleTranslationEntries = {
$This game is not monetized and we claim no ownership of Pokémon nor of the copyrighted assets used. $This game is not monetized and we claim no ownership of Pokémon nor of the copyrighted assets used.
$The game is a work in progress, but fully playable.\nFor bug reports, please use the Discord community. $The game is a work in progress, but fully playable.\nFor bug reports, please use the Discord community.
$If the game runs slowly, please ensure 'Hardware Acceleration' is turned on in your browser settings.`, $If the game runs slowly, please ensure 'Hardware Acceleration' is turned on in your browser settings.`,
"accessMenu": "To access the menu, press M or Escape while awaiting input.\nThe menu contains settings and various features.", "accessMenu": "To access the menu, press M or Escape while awaiting input.\nThe menu contains settings and various features.",
"menu": `From this menu you can access the settings. "menu": `From this menu you can access the settings.
$From the settings you can change game speed, window style, and other options. $From the settings you can change game speed, window style, and other options.
$There are also various other features here, so be sure to check them all!`, $There are also various other features here, so be sure to check them all!`,

View File

@ -33,7 +33,7 @@ export const weather: SimpleTranslationEntries = {
"heavyRainStartMessage": "A heavy downpour started!", "heavyRainStartMessage": "A heavy downpour started!",
"heavyRainLapseMessage": "The heavy downpour continues.", "heavyRainLapseMessage": "The heavy downpour continues.",
"heavyRainClearMessage": "The heavy rain stopped.", "heavyRainClearMessage": "The heavy rain stopped.",
"harshSunStartMessage": "The sunlight got hot!", "harshSunStartMessage": "The sunlight got hot!",
"harshSunLapseMessage": "The sun is scorching hot.", "harshSunLapseMessage": "The sun is scorching hot.",
"harshSunClearMessage": "The harsh sunlight faded.", "harshSunClearMessage": "The harsh sunlight faded.",

View File

@ -139,10 +139,10 @@ export const modifierType: ModifierTypeTranslationEntries = {
"HYPER_POTION": { name: "Hyper Potion" }, "HYPER_POTION": { name: "Hyper Potion" },
"MAX_POTION": { name: "Max Potion" }, "MAX_POTION": { name: "Max Potion" },
"FULL_RESTORE": { name: "Full Restore" }, "FULL_RESTORE": { name: "Full Restore" },
"REVIVE": { name: "Revive" }, "REVIVE": { name: "Revive" },
"MAX_REVIVE": { name: "Max Revive" }, "MAX_REVIVE": { name: "Max Revive" },
"FULL_HEAL": { name: "Full Heal" }, "FULL_HEAL": { name: "Full Heal" },
"SACRED_ASH": { name: "Sacred Ash" }, "SACRED_ASH": { name: "Sacred Ash" },
@ -187,12 +187,12 @@ export const modifierType: ModifierTypeTranslationEntries = {
"AMULET_COIN": { name: "Amulet Coin", description: "Increases money rewards by 20%" }, "AMULET_COIN": { name: "Amulet Coin", description: "Increases money rewards by 20%" },
"GOLDEN_PUNCH": { name: "Golden Punch", description: "Grants 50% of damage inflicted as money" }, "GOLDEN_PUNCH": { name: "Golden Punch", description: "Grants 50% of damage inflicted as money" },
"COIN_CASE": { name: "Coin Case", description: "After every 10th battle, receive 10% of your money in interest" }, "COIN_CASE": { name: "Coin Case", description: "After every 10th battle, receive 10% of your money in interest" },
"LOCK_CAPSULE": { name: "Lock Capsule", description: "Allows you to lock item rarities when rerolling items" }, "LOCK_CAPSULE": { name: "Lock Capsule", description: "Allows you to lock item rarities when rerolling items" },
"GRIP_CLAW": { name: "Grip Claw" }, "GRIP_CLAW": { name: "Grip Claw" },
"WIDE_LENS": { name: "Wide Lens" }, "WIDE_LENS": { name: "Wide Lens" },
"MULTI_LENS": { name: "Multi Lens" }, "MULTI_LENS": { name: "Multi Lens" },
"HEALING_CHARM": { name: "Healing Charm", description: "Increases the effectiveness of HP restoring moves and items by 10% (excludes Revives)" }, "HEALING_CHARM": { name: "Healing Charm", description: "Increases the effectiveness of HP restoring moves and items by 10% (excludes Revives)" },
@ -290,7 +290,7 @@ export const modifierType: ModifierTypeTranslationEntries = {
"TART_APPLE": "Tart Apple", "TART_APPLE": "Tart Apple",
"STRAWBERRY_SWEET": "Strawberry Sweet", "STRAWBERRY_SWEET": "Strawberry Sweet",
"UNREMARKABLE_TEACUP": "Unremarkable Teacup", "UNREMARKABLE_TEACUP": "Unremarkable Teacup",
"CHIPPED_POT": "Chipped Pot", "CHIPPED_POT": "Chipped Pot",
"BLACK_AUGURITE": "Black Augurite", "BLACK_AUGURITE": "Black Augurite",
"GALARICA_CUFF": "Galarica Cuff", "GALARICA_CUFF": "Galarica Cuff",

View File

@ -37,5 +37,5 @@ export const pokemonInfo: PokemonInfoTranslationEntries = {
"DARK": "Siniestro", "DARK": "Siniestro",
"FAIRY": "Hada", "FAIRY": "Hada",
"STELLAR": "Astral", "STELLAR": "Astral",
}, },
} as const; } as const;

View File

@ -8,10 +8,10 @@ export const tutorial: SimpleTranslationEntries = {
$comunidad de Discord. $comunidad de Discord.
$Si el juego va lento, por favor, asegúrate de que tengas activada la opción 'Aceleración de gráficos' en los $Si el juego va lento, por favor, asegúrate de que tengas activada la opción 'Aceleración de gráficos' en los
$ajustes de tu navegador.`, $ajustes de tu navegador.`,
"accessMenu": `Para acceder al menú, pulsa M o Escape cuando\ntengas el control. "accessMenu": `Para acceder al menú, pulsa M o Escape cuando\ntengas el control.
$El menú contiene los ajustes y otras funciones.`, $El menú contiene los ajustes y otras funciones.`,
"menu": `Desde este menú podrás acceder a los ajustes. "menu": `Desde este menú podrás acceder a los ajustes.
$Podrás cambiar la velocidad del juego, el estilo de la ventana y demás. $Podrás cambiar la velocidad del juego, el estilo de la ventana y demás.
$Hay más opciones, ¡así que pruébalas todas!`, $Hay más opciones, ¡así que pruébalas todas!`,

View File

@ -33,7 +33,7 @@ export const weather: SimpleTranslationEntries = {
"heavyRainStartMessage": "A heavy downpour started!", "heavyRainStartMessage": "A heavy downpour started!",
"heavyRainLapseMessage": "The heavy downpour continues.", "heavyRainLapseMessage": "The heavy downpour continues.",
"heavyRainClearMessage": "The heavy rain stopped.", "heavyRainClearMessage": "The heavy rain stopped.",
"harshSunStartMessage": "The sunlight got hot!", "harshSunStartMessage": "The sunlight got hot!",
"harshSunLapseMessage": "The sun is scorching hot.", "harshSunLapseMessage": "The sun is scorching hot.",
"harshSunClearMessage": "The harsh sunlight faded.", "harshSunClearMessage": "The harsh sunlight faded.",

View File

@ -139,10 +139,10 @@ export const modifierType: ModifierTypeTranslationEntries = {
"HYPER_POTION": { name: "Hyper Potion" }, "HYPER_POTION": { name: "Hyper Potion" },
"MAX_POTION": { name: "Potion Max" }, "MAX_POTION": { name: "Potion Max" },
"FULL_RESTORE": { name: "Guérison" }, "FULL_RESTORE": { name: "Guérison" },
"REVIVE": { name: "Rappel" }, "REVIVE": { name: "Rappel" },
"MAX_REVIVE": { name: "Rappel Max" }, "MAX_REVIVE": { name: "Rappel Max" },
"FULL_HEAL": { name: "Total Soin" }, "FULL_HEAL": { name: "Total Soin" },
"SACRED_ASH": { name: "Cendres Sacrées" }, "SACRED_ASH": { name: "Cendres Sacrées" },
@ -187,12 +187,12 @@ export const modifierType: ModifierTypeTranslationEntries = {
"AMULET_COIN": { name: "Pièce Rune", description: "Augmente de 20% les gains dargent" }, "AMULET_COIN": { name: "Pièce Rune", description: "Augmente de 20% les gains dargent" },
"GOLDEN_PUNCH": { name: "Poing Doré", description: "50% des dégâts infligés sont convertis en argent" }, "GOLDEN_PUNCH": { name: "Poing Doré", description: "50% des dégâts infligés sont convertis en argent" },
"COIN_CASE": { name: "Boite Jetons", description: "Tous les 10 combats, recevez 10% de votre argent en intérêts" }, "COIN_CASE": { name: "Boite Jetons", description: "Tous les 10 combats, recevez 10% de votre argent en intérêts" },
"LOCK_CAPSULE": { name: "Poké Écrin", description: "Permet de verrouiller des objets rares si vous relancez les objets proposés" }, "LOCK_CAPSULE": { name: "Poké Écrin", description: "Permet de verrouiller des objets rares si vous relancez les objets proposés" },
"GRIP_CLAW": { name: "Accro Griffe" }, "GRIP_CLAW": { name: "Accro Griffe" },
"WIDE_LENS": { name: "Loupe" }, "WIDE_LENS": { name: "Loupe" },
"MULTI_LENS": { name: "Multi Loupe" }, "MULTI_LENS": { name: "Multi Loupe" },
"HEALING_CHARM": { name: "Charme Soin", description: "Augmente de 10% lefficacité des capacités et objets de soin de PV (hors Rappels)" }, "HEALING_CHARM": { name: "Charme Soin", description: "Augmente de 10% lefficacité des capacités et objets de soin de PV (hors Rappels)" },
@ -290,7 +290,7 @@ export const modifierType: ModifierTypeTranslationEntries = {
"TART_APPLE": "Pomme Acidulée", "TART_APPLE": "Pomme Acidulée",
"STRAWBERRY_SWEET": "Fraise en Sucre", "STRAWBERRY_SWEET": "Fraise en Sucre",
"UNREMARKABLE_TEACUP": "Bol Médiocre", "UNREMARKABLE_TEACUP": "Bol Médiocre",
"CHIPPED_POT": "Théière Ébréchée", "CHIPPED_POT": "Théière Ébréchée",
"BLACK_AUGURITE": "Obsidienne", "BLACK_AUGURITE": "Obsidienne",
"GALARICA_CUFF": "Bracelet Galanoa", "GALARICA_CUFF": "Bracelet Galanoa",

View File

@ -61,7 +61,7 @@ export const trainerClasses: SimpleTranslationEntries = {
"maid": "Gouvernante", "maid": "Gouvernante",
"madame": "Mondaine", "madame": "Mondaine",
"medical_team": "Médecins", "medical_team": "Médecins",
"musician": "Musicien", "musician": "Musicien",
"hex_maniac": "Mystimaniac", "hex_maniac": "Mystimaniac",
"nurse": "Infirmière", "nurse": "Infirmière",
"nursery_aide": "Institutrice", "nursery_aide": "Institutrice",

View File

@ -33,7 +33,7 @@ export const weather: SimpleTranslationEntries = {
"heavyRainStartMessage": "Une pluie battante sabat soudainement !", "heavyRainStartMessage": "Une pluie battante sabat soudainement !",
"heavyRainLapseMessage": "La pluie battante continue.", "heavyRainLapseMessage": "La pluie battante continue.",
"heavyRainClearMessage": "La pluie battante sest arrêtée…", "heavyRainClearMessage": "La pluie battante sest arrêtée…",
"harshSunStartMessage": "Les rayons du soleil sintensifient !", "harshSunStartMessage": "Les rayons du soleil sintensifient !",
"harshSunLapseMessage": "Les rayons du soleil sont brulants !", "harshSunLapseMessage": "Les rayons du soleil sont brulants !",
"harshSunClearMessage": "Les rayons du soleil saffaiblissent !", "harshSunClearMessage": "Les rayons du soleil saffaiblissent !",

View File

@ -139,10 +139,10 @@ export const modifierType: ModifierTypeTranslationEntries = {
"HYPER_POTION": { name: "Iperpozione" }, "HYPER_POTION": { name: "Iperpozione" },
"MAX_POTION": { name: "Pozione Max" }, "MAX_POTION": { name: "Pozione Max" },
"FULL_RESTORE": { name: "Ricarica Totale" }, "FULL_RESTORE": { name: "Ricarica Totale" },
"REVIVE": { name: "Revitalizzante" }, "REVIVE": { name: "Revitalizzante" },
"MAX_REVIVE": { name: "Revitalizzante Max" }, "MAX_REVIVE": { name: "Revitalizzante Max" },
"FULL_HEAL": { name: "Cura Totale" }, "FULL_HEAL": { name: "Cura Totale" },
"SACRED_ASH": { name: "Cenere Magica" }, "SACRED_ASH": { name: "Cenere Magica" },
@ -187,12 +187,12 @@ export const modifierType: ModifierTypeTranslationEntries = {
"AMULET_COIN": { name: "Monetamuleto", description: "Aumenta le ricompense in denaro del 20%" }, "AMULET_COIN": { name: "Monetamuleto", description: "Aumenta le ricompense in denaro del 20%" },
"GOLDEN_PUNCH": { name: "Pugno Dorato", description: "Garantisce il 50% dei danni inflitti come denaro" }, "GOLDEN_PUNCH": { name: "Pugno Dorato", description: "Garantisce il 50% dei danni inflitti come denaro" },
"COIN_CASE": { name: " Salvadanaio", description: "Dopo ogni 10° battaglia, riceverete il 10% del vostro denaro in interessi" }, "COIN_CASE": { name: " Salvadanaio", description: "Dopo ogni 10° battaglia, riceverete il 10% del vostro denaro in interessi" },
"LOCK_CAPSULE": { name: "Capsula Scrigno", description: "Permette di bloccare le rarità degli oggetti quando si fa un reroll degli oggetti" }, "LOCK_CAPSULE": { name: "Capsula Scrigno", description: "Permette di bloccare le rarità degli oggetti quando si fa un reroll degli oggetti" },
"GRIP_CLAW": { name: "Presartigli" }, "GRIP_CLAW": { name: "Presartigli" },
"WIDE_LENS": { name: "Grandelente" }, "WIDE_LENS": { name: "Grandelente" },
"MULTI_LENS": { name: "Multilente" }, "MULTI_LENS": { name: "Multilente" },
"HEALING_CHARM": { name: "Curamuleto", description: "Aumenta del 10% l'efficacia delle mosse e degli oggetti che ripristinano i PS (escluse le rianimazioni)" }, "HEALING_CHARM": { name: "Curamuleto", description: "Aumenta del 10% l'efficacia delle mosse e degli oggetti che ripristinano i PS (escluse le rianimazioni)" },
@ -290,7 +290,7 @@ export const modifierType: ModifierTypeTranslationEntries = {
"TART_APPLE": "Aspropomo", "TART_APPLE": "Aspropomo",
"STRAWBERRY_SWEET": "Bonbonfragola", "STRAWBERRY_SWEET": "Bonbonfragola",
"UNREMARKABLE_TEACUP": "Tazza dozzinale", "UNREMARKABLE_TEACUP": "Tazza dozzinale",
"CHIPPED_POT": "Teiera crepata", "CHIPPED_POT": "Teiera crepata",
"BLACK_AUGURITE": "Augite nera", "BLACK_AUGURITE": "Augite nera",
"GALARICA_CUFF": "Fascia Galarnoce", "GALARICA_CUFF": "Fascia Galarnoce",

View File

@ -22,7 +22,7 @@ export const starterSelectUiHandler: SimpleTranslationEntries = {
"nature": "Natura:", "nature": "Natura:",
"eggMoves": "Mosse delle uova", "eggMoves": "Mosse delle uova",
"start": "Inizia", "start": "Inizia",
"addToParty": "Aggiungi al Gruppo", "addToParty": "Aggiungi al Gruppo",
"toggleIVs": "Vedi/Nascondi IV", "toggleIVs": "Vedi/Nascondi IV",
"manageMoves": "Gestisci Mosse", "manageMoves": "Gestisci Mosse",
"useCandies": "Usa Caramelle", "useCandies": "Usa Caramelle",

View File

@ -5,9 +5,9 @@ export const tutorial: SimpleTranslationEntries = {
$Questo gioco non è monetizzato e non siamo proprietari di Pokemon e Assets presenti nel gioco. $Questo gioco non è monetizzato e non siamo proprietari di Pokemon e Assets presenti nel gioco.
$Il gioco è work-in-progress ma giocabile al 100%.\nPer reportare eventuali bugs è possibile discuterne sul nostro Discord. $Il gioco è work-in-progress ma giocabile al 100%.\nPer reportare eventuali bugs è possibile discuterne sul nostro Discord.
$Se il game risulta 'lento', assicurati di aver abilitato l'Accelerazione Hardware nelle impostazioni del tuo Browser`, $Se il game risulta 'lento', assicurati di aver abilitato l'Accelerazione Hardware nelle impostazioni del tuo Browser`,
"accessMenu": "Per accedere al menù, press M o Esc.\nDal menù puoi cambiare impostazioni, controllare la wiki e accedere a varie features.", "accessMenu": "Per accedere al menù, press M o Esc.\nDal menù puoi cambiare impostazioni, controllare la wiki e accedere a varie features.",
"menu": `Da questo menù puoi accedere alle impostazioni. "menu": `Da questo menù puoi accedere alle impostazioni.
$Dalle impostazioni puoi cambiare velocità di gioco, stile di finestra e altre opzioni. $Dalle impostazioni puoi cambiare velocità di gioco, stile di finestra e altre opzioni.
$Ci sono varie funzionalità, controlla bene e non perderti nulla!`, $Ci sono varie funzionalità, controlla bene e non perderti nulla!`,

View File

@ -33,7 +33,7 @@ export const weather: SimpleTranslationEntries = {
"heavyRainStartMessage": "Ha iniziato a piovere forte!", "heavyRainStartMessage": "Ha iniziato a piovere forte!",
"heavyRainLapseMessage": "La pioggia battente continua.", "heavyRainLapseMessage": "La pioggia battente continua.",
"heavyRainClearMessage": "La pioggia battente è cessata.", "heavyRainClearMessage": "La pioggia battente è cessata.",
"harshSunStartMessage": "La luce solare è molto intensa!", "harshSunStartMessage": "La luce solare è molto intensa!",
"harshSunLapseMessage": "La luce solare è estremamente calda.", "harshSunLapseMessage": "La luce solare è estremamente calda.",
"harshSunClearMessage": "La luce solare si sta attenuando.", "harshSunClearMessage": "La luce solare si sta attenuando.",

View File

@ -22,7 +22,7 @@ import { berry } from "./berry";
import { voucher } from "./voucher"; import { voucher } from "./voucher";
export const ptBrConfig = { export const ptBrConfig = {
ability: ability, ability: ability,
abilityTriggers: abilityTriggers, abilityTriggers: abilityTriggers,
battle: battle, battle: battle,

View File

@ -139,10 +139,10 @@ export const modifierType: ModifierTypeTranslationEntries = {
"HYPER_POTION": { name: "Hiper Poção" }, "HYPER_POTION": { name: "Hiper Poção" },
"MAX_POTION": { name: "Poção Máxima" }, "MAX_POTION": { name: "Poção Máxima" },
"FULL_RESTORE": { name: "Restaurador" }, "FULL_RESTORE": { name: "Restaurador" },
"REVIVE": { name: "Reanimador" }, "REVIVE": { name: "Reanimador" },
"MAX_REVIVE": { name: "Reanimador Máximo" }, "MAX_REVIVE": { name: "Reanimador Máximo" },
"FULL_HEAL": { name: "Cura Total" }, "FULL_HEAL": { name: "Cura Total" },
"SACRED_ASH": { name: "Cinza Sagrada" }, "SACRED_ASH": { name: "Cinza Sagrada" },
@ -187,12 +187,12 @@ export const modifierType: ModifierTypeTranslationEntries = {
"AMULET_COIN": { name: "Moeda Amuleto", description: "Aumenta a recompensa de dinheiro em 50%" }, "AMULET_COIN": { name: "Moeda Amuleto", description: "Aumenta a recompensa de dinheiro em 50%" },
"GOLDEN_PUNCH": { name: "Soco Dourado", description: "Concede 50% do dano causado em dinheiro" }, "GOLDEN_PUNCH": { name: "Soco Dourado", description: "Concede 50% do dano causado em dinheiro" },
"COIN_CASE": { name: "Moedeira", description: "Após cada 10ª batalha, recebe 10% de seu dinheiro em juros" }, "COIN_CASE": { name: "Moedeira", description: "Após cada 10ª batalha, recebe 10% de seu dinheiro em juros" },
"LOCK_CAPSULE": { name: "Cápsula de Travamento", description: "Permite que você trave raridades de itens ao rolar novamente" }, "LOCK_CAPSULE": { name: "Cápsula de Travamento", description: "Permite que você trave raridades de itens ao rolar novamente" },
"GRIP_CLAW": { name: "Garra-Aperto" }, "GRIP_CLAW": { name: "Garra-Aperto" },
"WIDE_LENS": { name: "Lente Ampla" }, "WIDE_LENS": { name: "Lente Ampla" },
"MULTI_LENS": { name: "Multi Lentes" }, "MULTI_LENS": { name: "Multi Lentes" },
"HEALING_CHARM": { name: "Amuleto de Cura", description: "Aumenta a eficácia dos movimentos e itens que restauram PS em 10% (exceto Reanimador)" }, "HEALING_CHARM": { name: "Amuleto de Cura", description: "Aumenta a eficácia dos movimentos e itens que restauram PS em 10% (exceto Reanimador)" },
@ -290,7 +290,7 @@ export const modifierType: ModifierTypeTranslationEntries = {
"TART_APPLE": "Maçã Azeda", "TART_APPLE": "Maçã Azeda",
"STRAWBERRY_SWEET": "Doce de Morango", "STRAWBERRY_SWEET": "Doce de Morango",
"UNREMARKABLE_TEACUP": "Xícara Comum", "UNREMARKABLE_TEACUP": "Xícara Comum",
"CHIPPED_POT": "Pote Lascado", "CHIPPED_POT": "Pote Lascado",
"BLACK_AUGURITE": "Mineral Negro", "BLACK_AUGURITE": "Mineral Negro",
"GALARICA_CUFF": "Bracelete de Galar", "GALARICA_CUFF": "Bracelete de Galar",

View File

@ -61,7 +61,7 @@ export const trainerClasses: SimpleTranslationEntries = {
"maid": "Doméstica", "maid": "Doméstica",
"madame": "Madame", "madame": "Madame",
"medical_team": "Equipe Médica", "medical_team": "Equipe Médica",
"musician": "Músico", "musician": "Músico",
"hex_maniac": "Ocultista", "hex_maniac": "Ocultista",
"nurse": "Enfermeira", "nurse": "Enfermeira",
"nursery_aide": "Professora do Berçário", "nursery_aide": "Professora do Berçário",

View File

@ -33,7 +33,7 @@ export const weather: SimpleTranslationEntries = {
"heavyRainStartMessage": "Um temporal começou!", "heavyRainStartMessage": "Um temporal começou!",
"heavyRainLapseMessage": "O temporal continua forte.", "heavyRainLapseMessage": "O temporal continua forte.",
"heavyRainClearMessage": "O temporal parou.", "heavyRainClearMessage": "O temporal parou.",
"harshSunStartMessage": "A luz do sol está escaldante!", "harshSunStartMessage": "A luz do sol está escaldante!",
"harshSunLapseMessage": "A luz do sol é intensa.", "harshSunLapseMessage": "A luz do sol é intensa.",
"harshSunClearMessage": "A luz do sol enfraqueceu.", "harshSunClearMessage": "A luz do sol enfraqueceu.",

View File

@ -22,7 +22,7 @@ export const battle: SimpleTranslationEntries = {
"hitResultSuperEffective": "效果拔群!", "hitResultSuperEffective": "效果拔群!",
"hitResultNotVeryEffective": "收效甚微…", "hitResultNotVeryEffective": "收效甚微…",
"hitResultNoEffect": "对 {{pokemonName}} 没有效果!!", "hitResultNoEffect": "对 {{pokemonName}} 没有效果!!",
"hitResultOneHitKO": "一击必杀!", "hitResultOneHitKO": "一击必杀!",
"attackFailed": "但是失败了!", "attackFailed": "但是失败了!",
"attackHitsCount": "击中 {{count}} 次!", "attackHitsCount": "击中 {{count}} 次!",
"expGain": "{{pokemonName}} 获得了 {{exp}} 经验值!", "expGain": "{{pokemonName}} 获得了 {{exp}} 经验值!",

View File

@ -139,10 +139,10 @@ export const modifierType: ModifierTypeTranslationEntries = {
"HYPER_POTION": { name: "厉害伤药" }, "HYPER_POTION": { name: "厉害伤药" },
"MAX_POTION": { name: "全满药" }, "MAX_POTION": { name: "全满药" },
"FULL_RESTORE": { name: "全复药" }, "FULL_RESTORE": { name: "全复药" },
"REVIVE": { name: "活力碎片" }, "REVIVE": { name: "活力碎片" },
"MAX_REVIVE": { name: "活力块" }, "MAX_REVIVE": { name: "活力块" },
"FULL_HEAL": { name: "万灵药" }, "FULL_HEAL": { name: "万灵药" },
"SACRED_ASH": { name: "圣灰" }, "SACRED_ASH": { name: "圣灰" },
@ -187,12 +187,12 @@ export const modifierType: ModifierTypeTranslationEntries = {
"AMULET_COIN": { name: "护符金币", description: "金钱奖励增加20%" }, "AMULET_COIN": { name: "护符金币", description: "金钱奖励增加20%" },
"GOLDEN_PUNCH": { name: "黄金拳头", description: "将50%造成的伤害转换为金钱" }, "GOLDEN_PUNCH": { name: "黄金拳头", description: "将50%造成的伤害转换为金钱" },
"COIN_CASE": { name: "代币盒", description: "每十场战斗, 获得自己金钱10%的利息" }, "COIN_CASE": { name: "代币盒", description: "每十场战斗, 获得自己金钱10%的利息" },
"LOCK_CAPSULE": { name: "上锁的容器", description: "允许在刷新物品时锁定物品稀有度" }, "LOCK_CAPSULE": { name: "上锁的容器", description: "允许在刷新物品时锁定物品稀有度" },
"GRIP_CLAW": { name: "紧缠钩爪" }, "GRIP_CLAW": { name: "紧缠钩爪" },
"WIDE_LENS": { name: "广角镜" }, "WIDE_LENS": { name: "广角镜" },
"MULTI_LENS": { name: "多重镜" }, "MULTI_LENS": { name: "多重镜" },
"HEALING_CHARM": { name: "治愈护符", description: "HP回复量增加10% (含复活)" }, "HEALING_CHARM": { name: "治愈护符", description: "HP回复量增加10% (含复活)" },
@ -290,7 +290,7 @@ export const modifierType: ModifierTypeTranslationEntries = {
"TART_APPLE": "酸酸苹果", "TART_APPLE": "酸酸苹果",
"STRAWBERRY_SWEET": "草莓糖饰", "STRAWBERRY_SWEET": "草莓糖饰",
"UNREMARKABLE_TEACUP": "凡作茶碗", "UNREMARKABLE_TEACUP": "凡作茶碗",
"CHIPPED_POT": "缺损的茶壶", "CHIPPED_POT": "缺损的茶壶",
"BLACK_AUGURITE": "黑奇石", "BLACK_AUGURITE": "黑奇石",
"GALARICA_CUFF": "伽勒豆蔻手环", "GALARICA_CUFF": "伽勒豆蔻手环",

View File

@ -22,7 +22,7 @@ export const starterSelectUiHandler: SimpleTranslationEntries = {
"nature": "性格:", "nature": "性格:",
"eggMoves": "蛋招式", "eggMoves": "蛋招式",
"start": "开始", "start": "开始",
"addToParty": "加入队伍", "addToParty": "加入队伍",
"toggleIVs": "切换个体值", "toggleIVs": "切换个体值",
"manageMoves": "管理招式", "manageMoves": "管理招式",
"useCandies": "使用糖果", "useCandies": "使用糖果",

View File

@ -6,9 +6,9 @@ export const tutorial: SimpleTranslationEntries = {
$权资产的所有权 $权资产的所有权
$游戏仍在开发中\n告错误使 Discord $游戏仍在开发中\n告错误使 Discord
$如果游戏运行缓慢\n打开了`, $如果游戏运行缓慢\n打开了`,
"accessMenu": "在等待输入时,按 M 或 Escape 键可访\n问菜单。菜单包含设置和各种功能。", "accessMenu": "在等待输入时,按 M 或 Escape 键可访\n问菜单。菜单包含设置和各种功能。",
"menu": `在此菜单中,您可以访问设置。 "menu": `在此菜单中,您可以访问设置。
$在设置中\n和其他选项 $在设置中\n和其他选项
$这里还有各种其他功能`, $这里还有各种其他功能`,

View File

@ -22,7 +22,7 @@ import { battleMessageUiHandler } from "./battle-message-ui-handler";
import { berry } from "./berry"; import { berry } from "./berry";
import { voucher } from "./voucher"; import { voucher } from "./voucher";
export const zhTWConfig = { export const zhTWConfig = {
ability: ability, ability: ability,
abilityTriggers: abilityTriggers, abilityTriggers: abilityTriggers,
battle: battle, battle: battle,

View File

@ -1511,8 +1511,8 @@ export const move: MoveTranslationEntries = {
name: "暗襲要害", name: "暗襲要害",
effect: "抓住瞬間的空隙切斬對手。\n容易擊中要害", effect: "抓住瞬間的空隙切斬對手。\n容易擊中要害",
}, },
aquaTail: { aquaTail: {
name: "水流尾", effect: "如驚濤駭浪般揮動大尾巴攻\n擊對手" name: "水流尾", effect: "如驚濤駭浪般揮動大尾巴攻\n擊對手"
}, },
seedBomb: { seedBomb: {
name: "種子炸彈", name: "種子炸彈",
@ -1538,8 +1538,8 @@ export const move: MoveTranslationEntries = {
name: "龍之俯衝", name: "龍之俯衝",
effect: "釋放出駭人的殺氣,一邊威\n懾一邊撞擊對手。有時會使\n對手畏縮", effect: "釋放出駭人的殺氣,一邊威\n懾一邊撞擊對手。有時會使\n對手畏縮",
}, },
powerGem: { powerGem: {
name: "力量寶石", effect: "發射如寶石般閃耀的光芒攻\n擊對手" name: "力量寶石", effect: "發射如寶石般閃耀的光芒攻\n擊對手"
}, },
drainPunch: { drainPunch: {
name: "吸取拳", name: "吸取拳",
@ -1853,8 +1853,8 @@ export const move: MoveTranslationEntries = {
name: "電球", name: "電球",
effect: "用電氣團撞向對手。自己比\n對手速度越快威力越大", effect: "用電氣團撞向對手。自己比\n對手速度越快威力越大",
}, },
soak: { soak: {
name: "浸水", effect: "將大量的水潑向對手,從而\n使其變成水屬性" name: "浸水", effect: "將大量的水潑向對手,從而\n使其變成水屬性"
}, },
flameCharge: { flameCharge: {
name: "蓄能焰襲", name: "蓄能焰襲",
@ -1948,8 +1948,8 @@ export const move: MoveTranslationEntries = {
name: "燒淨", name: "燒淨",
effect: "用火焰攻擊對手。對手攜帶\n樹果等時會燒掉使其不\n能使用", effect: "用火焰攻擊對手。對手攜帶\n樹果等時會燒掉使其不\n能使用",
}, },
quash: { quash: {
name: "延後", effect: "壓制對手,從而將其行動順\n序放到最後" name: "延後", effect: "壓制對手,從而將其行動順\n序放到最後"
}, },
acrobatics: { acrobatics: {
name: "雜技", name: "雜技",
@ -2007,8 +2007,8 @@ export const move: MoveTranslationEntries = {
name: "龍尾", name: "龍尾",
effect: "彈飛對手,強制拉後備寶可\n夢上場。如果對手爲野生寶\n可夢戰鬥將直接結束", effect: "彈飛對手,強制拉後備寶可\n夢上場。如果對手爲野生寶\n可夢戰鬥將直接結束",
}, },
workUp: { workUp: {
name: "自我激勵", effect: "激勵自己,從而提高攻擊和\n特攻" name: "自我激勵", effect: "激勵自己,從而提高攻擊和\n特攻"
}, },
electroweb: { electroweb: {
name: "電網", name: "電網",
@ -2238,8 +2238,8 @@ export const move: MoveTranslationEntries = {
name: "嬉鬧", name: "嬉鬧",
effect: "與對手嬉鬧並攻擊。有時會\n降低對手的攻擊", effect: "與對手嬉鬧並攻擊。有時會\n降低對手的攻擊",
}, },
fairyWind: { fairyWind: {
name: "妖精之風", effect: "颳起妖精之風,吹向對手進\n行攻擊" name: "妖精之風", effect: "颳起妖精之風,吹向對手進\n行攻擊"
}, },
moonblast: { moonblast: {
name: "月亮之力", name: "月亮之力",

View File

@ -17,25 +17,25 @@ export const pokemonInfo: PokemonInfoTranslationEntries = {
}, },
Type: { Type: {
"UNKNOWN": "未知", "UNKNOWN": "未知",
"NORMAL": "一般", "NORMAL": "一般",
"FIGHTING": "格鬥", "FIGHTING": "格鬥",
"FLYING": "飛行", "FLYING": "飛行",
"POISON": "毒", "POISON": "毒",
"GROUND": "地面", "GROUND": "地面",
"ROCK": "岩石", "ROCK": "岩石",
"BUG": "蟲", "BUG": "蟲",
"GHOST": "幽靈", "GHOST": "幽靈",
"STEEL": "鋼", "STEEL": "鋼",
"FIRE": "火", "FIRE": "火",
"WATER": "水", "WATER": "水",
"GRASS": "草", "GRASS": "草",
"ELECTRIC": "電", "ELECTRIC": "電",
"PSYCHIC": "超能力", "PSYCHIC": "超能力",
"ICE": "冰", "ICE": "冰",
"DRAGON": "龍", "DRAGON": "龍",
"DARK": "惡", "DARK": "惡",
"FAIRY": "妖精", "FAIRY": "妖精",
"STELLAR": "星晶" "STELLAR": "星晶"
}, },
} as const; } as const;

View File

@ -22,7 +22,7 @@ export const starterSelectUiHandler: SimpleTranslationEntries = {
"nature": "性格:", "nature": "性格:",
"eggMoves": "孵化招式", "eggMoves": "孵化招式",
"start": "開始", "start": "開始",
"addToParty": "加入隊伍", "addToParty": "加入隊伍",
"toggleIVs": "查看個體值", "toggleIVs": "查看個體值",
"manageMoves": "管理技能", "manageMoves": "管理技能",
"useCandies": "使用糖果", "useCandies": "使用糖果",

View File

@ -5,26 +5,26 @@ export const tutorial: SimpleTranslationEntries = {
$本遊戲未進行商業化\nPokémon或Pokémon使用的版 $本遊戲未進行商業化\nPokémon或Pokémon使用的版
$權資產的所有權 $權資產的所有權
$遊戲仍在開發中\n告錯誤使 Discord $遊戲仍在開發中\n告錯誤使 Discord
$如果遊戲運行緩慢\n打開了`, $如果遊戲運行緩慢\n打開了`,
"accessMenu": "在等待輸入時,按 M 或 Escape 鍵可訪\n問菜單。菜單包含設置和各種功能。", "accessMenu": "在等待輸入時,按 M 或 Escape 鍵可訪\n問菜單。菜單包含設置和各種功能。",
"menu": `在此菜單中,您可以訪問設置。 "menu": `在此菜單中,您可以訪問設置。
$在設置中\n和其他選項 $在設置中\n和其他選項
$這裏還有各種其他功能`, $這裏還有各種其他功能`,
"starterSelect": `在此頁面中,您可以選擇您的初始寶可夢。\n這些是您最初的隊伍成員。 "starterSelect": `在此頁面中,您可以選擇您的初始寶可夢。\n這些是您最初的隊伍成員。
$每個初始寶可夢都有一個費用值\n最多可以擁有6名成員10 $每個初始寶可夢都有一個費用值\n最多可以擁有6名成員10
$您還可以根據您捕獲或孵化的變種選擇性別\n $您還可以根據您捕獲或孵化的變種選擇性別\n
$一個物種個體值是您捕獲或孵化的所有寶可\n夢中最好的`, $一個物種個體值是您捕獲或孵化的所有寶可\n夢中最好的`,
"pokerus": `每天隨機3個可選的初始寶可夢會有紫色邊\n框。 "pokerus": `每天隨機3個可選的初始寶可夢會有紫色邊\n框。
$如果您看到您擁有的初始寶可夢帶有紫色邊\n框 $如果您看到您擁有的初始寶可夢帶有紫色邊\n框
$查看其概況`, $查看其概況`,
"statChange": `只要您的寶可夢沒有被召回,屬性變化就會\n在戰鬥中持續存在。 "statChange": `只要您的寶可夢沒有被召回,屬性變化就會\n在戰鬥中持續存在。
$在訓練家戰鬥之前和進入新的寶可夢羣落之\n前 $在訓練家戰鬥之前和進入新的寶可夢羣落之\n前
$您還可以通過按住C或Shift鍵來查看\n場上寶可夢的能力變化`, $您還可以通過按住C或Shift鍵來查看\n場上寶可夢的能力變化`,
"selectItem": `每次戰鬥後,您都可以選擇 3 個隨機物品。\n您只能選擇其中一個。 "selectItem": `每次戰鬥後,您都可以選擇 3 個隨機物品。\n您只能選擇其中一個。
$這些物品包括消耗品\n久被動道具 $這些物品包括消耗品\n久被動道具
@ -33,8 +33,8 @@ export const tutorial: SimpleTranslationEntries = {
$您還可以使用轉移選項在寶可夢之間轉移攜\n帶物品 $您還可以使用轉移選項在寶可夢之間轉移攜\n帶物品
$一旦您獲得了攜帶物品\n在右下角 $一旦您獲得了攜帶物品\n在右下角
$您可以用金錢購買消耗品\n的深入 $您可以用金錢購買消耗品\n的深入
$請務必在選擇隨機物品之前購買這些消耗品\n因爲一旦您選擇`, $請務必在選擇隨機物品之前購買這些消耗品\n因爲一旦您選擇`,
"eggGacha": `在此頁面中,您可以使用您的兌換券兌換寶\n可夢蛋。 "eggGacha": `在此頁面中,您可以使用您的兌換券兌換寶\n可夢蛋。
$蛋需要孵化\n化週期 $蛋需要孵化\n化週期
$孵化的寶可夢不會被添加到您的隊伍中\n們將被添加到您的初始寶可夢中 $孵化的寶可夢不會被添加到您的隊伍中\n們將被添加到您的初始寶可夢中

View File

@ -33,7 +33,7 @@ export const weather: SimpleTranslationEntries = {
"heavyRainStartMessage": "開始下起了暴雨!", "heavyRainStartMessage": "開始下起了暴雨!",
"heavyRainLapseMessage": "暴雨勢頭不減。", "heavyRainLapseMessage": "暴雨勢頭不減。",
"heavyRainClearMessage": "暴雨停了。", "heavyRainClearMessage": "暴雨停了。",
"harshSunStartMessage": "日照變得非常強了!", "harshSunStartMessage": "日照變得非常強了!",
"harshSunLapseMessage": "強日照勢頭不減。", "harshSunLapseMessage": "強日照勢頭不減。",
"harshSunClearMessage": "日照復原了。", "harshSunClearMessage": "日照復原了。",

View File

@ -20,7 +20,7 @@ window.onerror = function (message, source, lineno, colno, error) {
}; };
// Catch global promise rejections and display them in an alert so users can report the issue. // Catch global promise rejections and display them in an alert so users can report the issue.
window.addEventListener("unhandledrejection", (event) => { window.addEventListener("unhandledrejection", (event) => {
// const errorString = `Received unhandled promise rejection. Open browser console and click OK to see details.\nReason: ${event.reason}`; // const errorString = `Received unhandled promise rejection. Open browser console and click OK to see details.\nReason: ${event.reason}`;
console.error(event.reason); console.error(event.reason);
//alert(errorString); //alert(errorString);

View File

@ -450,7 +450,7 @@ export class BerryModifierType extends PokemonHeldItemModifierType implements Ge
constructor(berryType: BerryType) { constructor(berryType: BerryType) {
super("", `${BerryType[berryType].toLowerCase()}_berry`, (type, args) => new Modifiers.BerryModifier(type, (args[0] as Pokemon).id, berryType), "berry"); super("", `${BerryType[berryType].toLowerCase()}_berry`, (type, args) => new Modifiers.BerryModifier(type, (args[0] as Pokemon).id, berryType), "berry");
this.berryType = berryType; this.berryType = berryType;
} }
@ -653,7 +653,7 @@ export class PokemonExpBoosterModifierType extends PokemonHeldItemModifierType {
constructor(localeKey: string, iconImage: string, boostPercent: integer) { constructor(localeKey: string, iconImage: string, boostPercent: integer) {
super(localeKey, iconImage, (_type, args) => new Modifiers.PokemonExpBoosterModifier(this, (args[0] as Pokemon).id, boostPercent)); super(localeKey, iconImage, (_type, args) => new Modifiers.PokemonExpBoosterModifier(this, (args[0] as Pokemon).id, boostPercent));
this.boostPercent = boostPercent; this.boostPercent = boostPercent;
} }
@ -742,7 +742,7 @@ export class EvolutionItemModifierType extends PokemonModifierType implements Ge
this.evolutionItem = evolutionItem; this.evolutionItem = evolutionItem;
} }
get name(): string { get name(): string {
return i18next.t(`modifierType:EvolutionItem.${EvolutionItem[this.evolutionItem]}`); return i18next.t(`modifierType:EvolutionItem.${EvolutionItem[this.evolutionItem]}`);
} }
@ -834,7 +834,7 @@ class AttackTypeBoosterModifierTypeGenerator extends ModifierTypeGenerator {
} }
let type: Type; let type: Type;
const randInt = Utils.randSeedInt(totalWeight); const randInt = Utils.randSeedInt(totalWeight);
let weight = 0; let weight = 0;
@ -846,7 +846,7 @@ class AttackTypeBoosterModifierTypeGenerator extends ModifierTypeGenerator {
} }
weight += typeWeight; weight += typeWeight;
} }
return new AttackTypeBoosterModifierType(type, 20); return new AttackTypeBoosterModifierType(type, 20);
}); });
} }
@ -1041,7 +1041,7 @@ export const modifierTypes = {
HYPER_POTION: () => new PokemonHpRestoreModifierType("modifierType:ModifierType.HYPER_POTION", "hyper_potion", 200, 50), HYPER_POTION: () => new PokemonHpRestoreModifierType("modifierType:ModifierType.HYPER_POTION", "hyper_potion", 200, 50),
MAX_POTION: () => new PokemonHpRestoreModifierType("modifierType:ModifierType.MAX_POTION", "max_potion", 0, 100), MAX_POTION: () => new PokemonHpRestoreModifierType("modifierType:ModifierType.MAX_POTION", "max_potion", 0, 100),
FULL_RESTORE: () => new PokemonHpRestoreModifierType("modifierType:ModifierType.FULL_RESTORE", "full_restore", 0, 100, true), FULL_RESTORE: () => new PokemonHpRestoreModifierType("modifierType:ModifierType.FULL_RESTORE", "full_restore", 0, 100, true),
REVIVE: () => new PokemonReviveModifierType("modifierType:ModifierType.REVIVE", "revive", 50), REVIVE: () => new PokemonReviveModifierType("modifierType:ModifierType.REVIVE", "revive", 50),
MAX_REVIVE: () => new PokemonReviveModifierType("modifierType:ModifierType.MAX_REVIVE", "max_revive", 100), MAX_REVIVE: () => new PokemonReviveModifierType("modifierType:ModifierType.MAX_REVIVE", "max_revive", 100),
@ -1192,7 +1192,7 @@ export const modifierTypes = {
DNA_SPLICERS: () => new FusePokemonModifierType("modifierType:ModifierType.DNA_SPLICERS", "dna_splicers"), DNA_SPLICERS: () => new FusePokemonModifierType("modifierType:ModifierType.DNA_SPLICERS", "dna_splicers"),
MINI_BLACK_HOLE: () => new TurnHeldItemTransferModifierType("modifierType:ModifierType.MINI_BLACK_HOLE", "mini_black_hole"), MINI_BLACK_HOLE: () => new TurnHeldItemTransferModifierType("modifierType:ModifierType.MINI_BLACK_HOLE", "mini_black_hole"),
VOUCHER: () => new AddVoucherModifierType(VoucherType.REGULAR, 1), VOUCHER: () => new AddVoucherModifierType(VoucherType.REGULAR, 1),
VOUCHER_PLUS: () => new AddVoucherModifierType(VoucherType.PLUS, 1), VOUCHER_PLUS: () => new AddVoucherModifierType(VoucherType.PLUS, 1),
VOUCHER_PREMIUM: () => new AddVoucherModifierType(VoucherType.PREMIUM, 1), VOUCHER_PREMIUM: () => new AddVoucherModifierType(VoucherType.PREMIUM, 1),
@ -1242,7 +1242,7 @@ const modifierPool: ModifierPool = {
new WeightedModifierType(modifierTypes.BERRY, 2), new WeightedModifierType(modifierTypes.BERRY, 2),
new WeightedModifierType(modifierTypes.TM_COMMON, 1), new WeightedModifierType(modifierTypes.TM_COMMON, 1),
].map(m => { ].map(m => {
m.setTier(ModifierTier.COMMON); return m; m.setTier(ModifierTier.COMMON); return m;
}), }),
[ModifierTier.GREAT]: [ [ModifierTier.GREAT]: [
new WeightedModifierType(modifierTypes.GREAT_BALL, 6), new WeightedModifierType(modifierTypes.GREAT_BALL, 6),
@ -1301,7 +1301,7 @@ const modifierPool: ModifierPool = {
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),
].map(m => { ].map(m => {
m.setTier(ModifierTier.GREAT); return m; m.setTier(ModifierTier.GREAT); return m;
}), }),
[ModifierTier.ULTRA]: [ [ModifierTier.ULTRA]: [
new WeightedModifierType(modifierTypes.ULTRA_BALL, 24), new WeightedModifierType(modifierTypes.ULTRA_BALL, 24),
@ -1325,7 +1325,7 @@ const modifierPool: ModifierPool = {
new WeightedModifierType(modifierTypes.TERA_ORB, (party: Pokemon[]) => Math.min(Math.max(Math.floor(party[0].scene.currentBattle.waveIndex / 50) * 2, 1), 4), 4), new WeightedModifierType(modifierTypes.TERA_ORB, (party: Pokemon[]) => Math.min(Math.max(Math.floor(party[0].scene.currentBattle.waveIndex / 50) * 2, 1), 4), 4),
new WeightedModifierType(modifierTypes.VOUCHER, (party: Pokemon[], rerollCount: integer) => !party[0].scene.gameMode.isDaily ? Math.max(3 - rerollCount, 0) : 0, 3), new WeightedModifierType(modifierTypes.VOUCHER, (party: Pokemon[], rerollCount: integer) => !party[0].scene.gameMode.isDaily ? Math.max(3 - rerollCount, 0) : 0, 3),
].map(m => { ].map(m => {
m.setTier(ModifierTier.ULTRA); return m; m.setTier(ModifierTier.ULTRA); return m;
}), }),
[ModifierTier.ROGUE]: [ [ModifierTier.ROGUE]: [
new WeightedModifierType(modifierTypes.ROGUE_BALL, 24), new WeightedModifierType(modifierTypes.ROGUE_BALL, 24),
@ -1349,7 +1349,7 @@ const modifierPool: ModifierPool = {
new WeightedModifierType(modifierTypes.MEGA_BRACELET, (party: Pokemon[]) => Math.min(Math.ceil(party[0].scene.currentBattle.waveIndex / 50), 4) * 8, 32), new WeightedModifierType(modifierTypes.MEGA_BRACELET, (party: Pokemon[]) => Math.min(Math.ceil(party[0].scene.currentBattle.waveIndex / 50), 4) * 8, 32),
new WeightedModifierType(modifierTypes.DYNAMAX_BAND, (party: Pokemon[]) => Math.min(Math.ceil(party[0].scene.currentBattle.waveIndex / 50), 4) * 8, 32), new WeightedModifierType(modifierTypes.DYNAMAX_BAND, (party: Pokemon[]) => Math.min(Math.ceil(party[0].scene.currentBattle.waveIndex / 50), 4) * 8, 32),
].map(m => { ].map(m => {
m.setTier(ModifierTier.ROGUE); return m; m.setTier(ModifierTier.ROGUE); return m;
}), }),
[ModifierTier.MASTER]: [ [ModifierTier.MASTER]: [
new WeightedModifierType(modifierTypes.MASTER_BALL, 24), new WeightedModifierType(modifierTypes.MASTER_BALL, 24),
@ -1360,7 +1360,7 @@ const modifierPool: ModifierPool = {
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.gameData.unlocks[Unlockables.MINI_BLACK_HOLE] ? 1 : 0, 1), new WeightedModifierType(modifierTypes.MINI_BLACK_HOLE, (party: Pokemon[]) => party[0].scene.gameData.unlocks[Unlockables.MINI_BLACK_HOLE] ? 1 : 0, 1),
].map(m => { ].map(m => {
m.setTier(ModifierTier.MASTER); return m; m.setTier(ModifierTier.MASTER); return m;
}) })
}; };
@ -1368,27 +1368,27 @@ const wildModifierPool: ModifierPool = {
[ModifierTier.COMMON]: [ [ModifierTier.COMMON]: [
new WeightedModifierType(modifierTypes.BERRY, 1) new WeightedModifierType(modifierTypes.BERRY, 1)
].map(m => { ].map(m => {
m.setTier(ModifierTier.COMMON); return m; m.setTier(ModifierTier.COMMON); return m;
}), }),
[ModifierTier.GREAT]: [ [ModifierTier.GREAT]: [
new WeightedModifierType(modifierTypes.BASE_STAT_BOOSTER, 1) new WeightedModifierType(modifierTypes.BASE_STAT_BOOSTER, 1)
].map(m => { ].map(m => {
m.setTier(ModifierTier.GREAT); return m; m.setTier(ModifierTier.GREAT); return m;
}), }),
[ModifierTier.ULTRA]: [ [ModifierTier.ULTRA]: [
new WeightedModifierType(modifierTypes.ATTACK_TYPE_BOOSTER, 10), new WeightedModifierType(modifierTypes.ATTACK_TYPE_BOOSTER, 10),
].map(m => { ].map(m => {
m.setTier(ModifierTier.ULTRA); return m; m.setTier(ModifierTier.ULTRA); return m;
}), }),
[ModifierTier.ROGUE]: [ [ModifierTier.ROGUE]: [
new WeightedModifierType(modifierTypes.LUCKY_EGG, 4), new WeightedModifierType(modifierTypes.LUCKY_EGG, 4),
].map(m => { ].map(m => {
m.setTier(ModifierTier.ROGUE); return m; m.setTier(ModifierTier.ROGUE); return m;
}), }),
[ModifierTier.MASTER]: [ [ModifierTier.MASTER]: [
new WeightedModifierType(modifierTypes.GOLDEN_EGG, 1) new WeightedModifierType(modifierTypes.GOLDEN_EGG, 1)
].map(m => { ].map(m => {
m.setTier(ModifierTier.MASTER); return m; m.setTier(ModifierTier.MASTER); return m;
}) })
}; };
@ -1397,17 +1397,17 @@ const trainerModifierPool: ModifierPool = {
new WeightedModifierType(modifierTypes.BERRY, 8), new WeightedModifierType(modifierTypes.BERRY, 8),
new WeightedModifierType(modifierTypes.BASE_STAT_BOOSTER, 3) new WeightedModifierType(modifierTypes.BASE_STAT_BOOSTER, 3)
].map(m => { ].map(m => {
m.setTier(ModifierTier.COMMON); return m; m.setTier(ModifierTier.COMMON); return m;
}), }),
[ModifierTier.GREAT]: [ [ModifierTier.GREAT]: [
new WeightedModifierType(modifierTypes.BASE_STAT_BOOSTER, 3), new WeightedModifierType(modifierTypes.BASE_STAT_BOOSTER, 3),
].map(m => { ].map(m => {
m.setTier(ModifierTier.GREAT); return m; m.setTier(ModifierTier.GREAT); return m;
}), }),
[ModifierTier.ULTRA]: [ [ModifierTier.ULTRA]: [
new WeightedModifierType(modifierTypes.ATTACK_TYPE_BOOSTER, 1), new WeightedModifierType(modifierTypes.ATTACK_TYPE_BOOSTER, 1),
].map(m => { ].map(m => {
m.setTier(ModifierTier.ULTRA); return m; m.setTier(ModifierTier.ULTRA); return m;
}), }),
[ModifierTier.ROGUE]: [ [ModifierTier.ROGUE]: [
new WeightedModifierType(modifierTypes.REVIVER_SEED, 2), new WeightedModifierType(modifierTypes.REVIVER_SEED, 2),
@ -1417,14 +1417,14 @@ const trainerModifierPool: ModifierPool = {
new WeightedModifierType(modifierTypes.GRIP_CLAW, 1), new WeightedModifierType(modifierTypes.GRIP_CLAW, 1),
new WeightedModifierType(modifierTypes.WIDE_LENS, 1), new WeightedModifierType(modifierTypes.WIDE_LENS, 1),
].map(m => { ].map(m => {
m.setTier(ModifierTier.ROGUE); return m; m.setTier(ModifierTier.ROGUE); return m;
}), }),
[ModifierTier.MASTER]: [ [ModifierTier.MASTER]: [
new WeightedModifierType(modifierTypes.KINGS_ROCK, 1), new WeightedModifierType(modifierTypes.KINGS_ROCK, 1),
new WeightedModifierType(modifierTypes.LEFTOVERS, 1), new WeightedModifierType(modifierTypes.LEFTOVERS, 1),
new WeightedModifierType(modifierTypes.SHELL_BELL, 1), new WeightedModifierType(modifierTypes.SHELL_BELL, 1),
].map(m => { ].map(m => {
m.setTier(ModifierTier.MASTER); return m; m.setTier(ModifierTier.MASTER); return m;
}) })
}; };
@ -1441,7 +1441,7 @@ const enemyBuffModifierPool: ModifierPool = {
new WeightedModifierType(modifierTypes.ENEMY_ENDURE_CHANCE, 5), new WeightedModifierType(modifierTypes.ENEMY_ENDURE_CHANCE, 5),
new WeightedModifierType(modifierTypes.ENEMY_FUSED_CHANCE, 1) new WeightedModifierType(modifierTypes.ENEMY_FUSED_CHANCE, 1)
].map(m => { ].map(m => {
m.setTier(ModifierTier.COMMON); return m; m.setTier(ModifierTier.COMMON); return m;
}), }),
[ModifierTier.GREAT]: [ [ModifierTier.GREAT]: [
new WeightedModifierType(modifierTypes.ENEMY_DAMAGE_BOOSTER, 5), new WeightedModifierType(modifierTypes.ENEMY_DAMAGE_BOOSTER, 5),
@ -1450,7 +1450,7 @@ const enemyBuffModifierPool: ModifierPool = {
new WeightedModifierType(modifierTypes.ENEMY_ENDURE_CHANCE, 5), new WeightedModifierType(modifierTypes.ENEMY_ENDURE_CHANCE, 5),
new WeightedModifierType(modifierTypes.ENEMY_FUSED_CHANCE, 1) new WeightedModifierType(modifierTypes.ENEMY_FUSED_CHANCE, 1)
].map(m => { ].map(m => {
m.setTier(ModifierTier.GREAT); return m; m.setTier(ModifierTier.GREAT); return m;
}), }),
[ModifierTier.ULTRA]: [ [ModifierTier.ULTRA]: [
new WeightedModifierType(modifierTypes.ENEMY_DAMAGE_BOOSTER, 10), new WeightedModifierType(modifierTypes.ENEMY_DAMAGE_BOOSTER, 10),
@ -1460,13 +1460,13 @@ const enemyBuffModifierPool: ModifierPool = {
new WeightedModifierType(modifierTypes.ENEMY_ENDURE_CHANCE, 10), new WeightedModifierType(modifierTypes.ENEMY_ENDURE_CHANCE, 10),
new WeightedModifierType(modifierTypes.ENEMY_FUSED_CHANCE, 5) new WeightedModifierType(modifierTypes.ENEMY_FUSED_CHANCE, 5)
].map(m => { ].map(m => {
m.setTier(ModifierTier.ULTRA); return m; m.setTier(ModifierTier.ULTRA); return m;
}), }),
[ModifierTier.ROGUE]: [ ].map(m => { [ModifierTier.ROGUE]: [ ].map(m => {
m.setTier(ModifierTier.ROGUE); return m; m.setTier(ModifierTier.ROGUE); return m;
}), }),
[ModifierTier.MASTER]: [ ].map(m => { [ModifierTier.MASTER]: [ ].map(m => {
m.setTier(ModifierTier.MASTER); return m; m.setTier(ModifierTier.MASTER); return m;
}) })
}; };
@ -1475,12 +1475,12 @@ const dailyStarterModifierPool: ModifierPool = {
new WeightedModifierType(modifierTypes.BASE_STAT_BOOSTER, 1), new WeightedModifierType(modifierTypes.BASE_STAT_BOOSTER, 1),
new WeightedModifierType(modifierTypes.BERRY, 3), new WeightedModifierType(modifierTypes.BERRY, 3),
].map(m => { ].map(m => {
m.setTier(ModifierTier.COMMON); return m; m.setTier(ModifierTier.COMMON); return m;
}), }),
[ModifierTier.GREAT]: [ [ModifierTier.GREAT]: [
new WeightedModifierType(modifierTypes.ATTACK_TYPE_BOOSTER, 5), new WeightedModifierType(modifierTypes.ATTACK_TYPE_BOOSTER, 5),
].map(m => { ].map(m => {
m.setTier(ModifierTier.GREAT); return m; m.setTier(ModifierTier.GREAT); return m;
}), }),
[ModifierTier.ULTRA]: [ [ModifierTier.ULTRA]: [
new WeightedModifierType(modifierTypes.REVIVER_SEED, 4), new WeightedModifierType(modifierTypes.REVIVER_SEED, 4),
@ -1488,7 +1488,7 @@ const dailyStarterModifierPool: ModifierPool = {
new WeightedModifierType(modifierTypes.SOUL_DEW, 1), new WeightedModifierType(modifierTypes.SOUL_DEW, 1),
new WeightedModifierType(modifierTypes.GOLDEN_PUNCH, 1), new WeightedModifierType(modifierTypes.GOLDEN_PUNCH, 1),
].map(m => { ].map(m => {
m.setTier(ModifierTier.ULTRA); return m; m.setTier(ModifierTier.ULTRA); return m;
}), }),
[ModifierTier.ROGUE]: [ [ModifierTier.ROGUE]: [
new WeightedModifierType(modifierTypes.GRIP_CLAW, 5), new WeightedModifierType(modifierTypes.GRIP_CLAW, 5),
@ -1497,13 +1497,13 @@ const dailyStarterModifierPool: ModifierPool = {
new WeightedModifierType(modifierTypes.QUICK_CLAW, 3), new WeightedModifierType(modifierTypes.QUICK_CLAW, 3),
new WeightedModifierType(modifierTypes.KINGS_ROCK, 3), new WeightedModifierType(modifierTypes.KINGS_ROCK, 3),
].map(m => { ].map(m => {
m.setTier(ModifierTier.ROGUE); return m; m.setTier(ModifierTier.ROGUE); return m;
}), }),
[ModifierTier.MASTER]: [ [ModifierTier.MASTER]: [
new WeightedModifierType(modifierTypes.LEFTOVERS, 1), new WeightedModifierType(modifierTypes.LEFTOVERS, 1),
new WeightedModifierType(modifierTypes.SHELL_BELL, 1), new WeightedModifierType(modifierTypes.SHELL_BELL, 1),
].map(m => { ].map(m => {
m.setTier(ModifierTier.MASTER); return m; m.setTier(ModifierTier.MASTER); return m;
}) })
}; };
@ -1553,7 +1553,7 @@ const tierWeights = [ 769 / 1024, 192 / 1024, 48 / 1024, 12 / 1024, 1 / 1024 ];
export function regenerateModifierPoolThresholds(party: Pokemon[], poolType: ModifierPoolType, rerollCount: integer = 0) { export function regenerateModifierPoolThresholds(party: Pokemon[], poolType: ModifierPoolType, rerollCount: integer = 0) {
const pool = getModifierPoolForType(poolType); const pool = getModifierPoolForType(poolType);
const ignoredIndexes = {}; const ignoredIndexes = {};
const modifierTableData = {}; const modifierTableData = {};
const thresholds = Object.fromEntries(new Map(Object.keys(pool).map(t => { const thresholds = Object.fromEntries(new Map(Object.keys(pool).map(t => {
@ -1801,7 +1801,7 @@ function getNewModifierTypeOption(party: Pokemon[], poolType: ModifierPoolType,
if (index === undefined) { if (index === undefined) {
return null; return null;
} }
if (player) { if (player) {
console.log(index, ignoredPoolIndexes[tier].filter(i => i <= index).length, ignoredPoolIndexes[tier]); console.log(index, ignoredPoolIndexes[tier].filter(i => i <= index).length, ignoredPoolIndexes[tier]);
} }

View File

@ -364,7 +364,7 @@ export class MapModifier extends PersistentModifier {
constructor(type: ModifierType, stackCount?: integer) { constructor(type: ModifierType, stackCount?: integer) {
super(type, stackCount); super(type, stackCount);
} }
clone(): MapModifier { clone(): MapModifier {
return new MapModifier(this.type, this.stackCount); return new MapModifier(this.type, this.stackCount);
} }
@ -382,7 +382,7 @@ export class MegaEvolutionAccessModifier extends PersistentModifier {
constructor(type: ModifierType, stackCount?: integer) { constructor(type: ModifierType, stackCount?: integer) {
super(type, stackCount); super(type, stackCount);
} }
clone(): MegaEvolutionAccessModifier { clone(): MegaEvolutionAccessModifier {
return new MegaEvolutionAccessModifier(this.type, this.stackCount); return new MegaEvolutionAccessModifier(this.type, this.stackCount);
} }
@ -400,7 +400,7 @@ export class GigantamaxAccessModifier extends PersistentModifier {
constructor(type: ModifierType, stackCount?: integer) { constructor(type: ModifierType, stackCount?: integer) {
super(type, stackCount); super(type, stackCount);
} }
clone(): GigantamaxAccessModifier { clone(): GigantamaxAccessModifier {
return new GigantamaxAccessModifier(this.type, this.stackCount); return new GigantamaxAccessModifier(this.type, this.stackCount);
} }
@ -418,7 +418,7 @@ export class TerastallizeAccessModifier extends PersistentModifier {
constructor(type: ModifierType, stackCount?: integer) { constructor(type: ModifierType, stackCount?: integer) {
super(type, stackCount); super(type, stackCount);
} }
clone(): TerastallizeAccessModifier { clone(): TerastallizeAccessModifier {
return new TerastallizeAccessModifier(this.type, this.stackCount); return new TerastallizeAccessModifier(this.type, this.stackCount);
} }
@ -596,7 +596,7 @@ export class TerastallizeModifier extends LapsingPokemonHeldItemModifier {
} }
return ret; return ret;
} }
getTransferrable(withinParty: boolean): boolean { getTransferrable(withinParty: boolean): boolean {
return false; return false;
} }
@ -692,7 +692,7 @@ export class AttackTypeBoosterModifier extends PokemonHeldItemModifier {
} }
/** /**
* @param {Array<any>} args Array * @param {Array<any>} args Array
* - Index 0: {Pokemon} Pokemon * - Index 0: {Pokemon} Pokemon
* - Index 1: {number} Move type * - Index 1: {number} Move type
* - Index 2: {Utils.NumberHolder} Move power * - Index 2: {Utils.NumberHolder} Move power
@ -1062,7 +1062,7 @@ export class PokemonHpRestoreModifier extends ConsumablePokemonModifier {
pokemon.resetStatus(); pokemon.resetStatus();
} }
pokemon.hp = Math.min(pokemon.hp + Math.max(Math.ceil(Math.max(Math.floor((this.restorePercent * 0.01) * pokemon.getMaxHp()), restorePoints)), 1), pokemon.getMaxHp()); pokemon.hp = Math.min(pokemon.hp + Math.max(Math.ceil(Math.max(Math.floor((this.restorePercent * 0.01) * pokemon.getMaxHp()), restorePoints)), 1), pokemon.getMaxHp());
return true; return true;
} }
@ -1466,7 +1466,7 @@ export class PokemonFriendshipBoosterModifier extends PokemonHeldItemModifier {
clone(): PersistentModifier { clone(): PersistentModifier {
return new PokemonFriendshipBoosterModifier(this.type as ModifierTypes.PokemonFriendshipBoosterModifierType, this.pokemonId, this.stackCount); return new PokemonFriendshipBoosterModifier(this.type as ModifierTypes.PokemonFriendshipBoosterModifierType, this.pokemonId, this.stackCount);
} }
apply(args: any[]): boolean { apply(args: any[]): boolean {
const friendship = args[1] as Utils.IntegerHolder; const friendship = args[1] as Utils.IntegerHolder;
friendship.value = Math.floor(friendship.value * (1 + 0.5 * this.getStackCount())); friendship.value = Math.floor(friendship.value * (1 + 0.5 * this.getStackCount()));
@ -1491,7 +1491,7 @@ export class PokemonNatureWeightModifier extends PokemonHeldItemModifier {
clone(): PersistentModifier { clone(): PersistentModifier {
return new PokemonNatureWeightModifier(this.type, this.pokemonId, this.stackCount); return new PokemonNatureWeightModifier(this.type, this.pokemonId, this.stackCount);
} }
apply(args: any[]): boolean { apply(args: any[]): boolean {
const multiplier = args[1] as Utils.IntegerHolder; const multiplier = args[1] as Utils.IntegerHolder;
if (multiplier.value !== 1) { if (multiplier.value !== 1) {
@ -1559,7 +1559,7 @@ export class PokemonMultiHitModifier extends PokemonHeldItemModifier {
clone(): PersistentModifier { clone(): PersistentModifier {
return new PokemonMultiHitModifier(this.type as ModifierTypes.PokemonMultiHitModifierType, this.pokemonId, this.stackCount); return new PokemonMultiHitModifier(this.type as ModifierTypes.PokemonMultiHitModifierType, this.pokemonId, this.stackCount);
} }
apply(args: any[]): boolean { apply(args: any[]): boolean {
(args[1] as Utils.IntegerHolder).value *= (this.getStackCount() + 1); (args[1] as Utils.IntegerHolder).value *= (this.getStackCount() + 1);
@ -1648,7 +1648,7 @@ export class MoneyRewardModifier extends ConsumableModifier {
const moneyAmount = new Utils.IntegerHolder(scene.getWaveMoneyAmount(this.moneyMultiplier)); const moneyAmount = new Utils.IntegerHolder(scene.getWaveMoneyAmount(this.moneyMultiplier));
scene.applyModifiers(MoneyMultiplierModifier, true, moneyAmount); scene.applyModifiers(MoneyMultiplierModifier, true, moneyAmount);
scene.addMoney(moneyAmount.value); scene.addMoney(moneyAmount.value);
return true; return true;
@ -1856,7 +1856,7 @@ export abstract class HeldItemTransferModifier extends PokemonHeldItemModifier {
let tierItemModifiers = itemModifiers.filter(m => m.type.getOrInferTier(poolType) === highestItemTier); let tierItemModifiers = itemModifiers.filter(m => m.type.getOrInferTier(poolType) === highestItemTier);
const heldItemTransferPromises: Promise<void>[] = []; const heldItemTransferPromises: Promise<void>[] = [];
for (let i = 0; i < transferredItemCount; i++) { for (let i = 0; i < transferredItemCount; i++) {
if (!tierItemModifiers.length) { if (!tierItemModifiers.length) {
while (highestItemTier-- && !tierItemModifiers.length) { while (highestItemTier-- && !tierItemModifiers.length) {
@ -2210,7 +2210,7 @@ export class EnemyEndureChanceModifier extends EnemyPersistentModifier {
if (target.battleData.endured || Phaser.Math.RND.realInRange(0, 1) >= (this.chance * this.getStackCount())) { if (target.battleData.endured || Phaser.Math.RND.realInRange(0, 1) >= (this.chance * this.getStackCount())) {
return false; return false;
} }
target.addTag(BattlerTagType.ENDURING, 1); target.addTag(BattlerTagType.ENDURING, 1);
target.battleData.endured = true; target.battleData.endured = true;

View File

@ -77,8 +77,8 @@ export const OPP_VARIANT_OVERRIDE: Variant = 0;
* if count is not provided, it will default to 1 * if count is not provided, it will default to 1
* @example Modifier Override [{name: "EXP_SHARE", count: 2}] * @example Modifier Override [{name: "EXP_SHARE", count: 2}]
* @example Held Item Override [{name: "LUCKY_EGG"}] * @example Held Item Override [{name: "LUCKY_EGG"}]
* *
* Some items are generated based on a sub-type (i.e. berries), to override those: * Some items are generated based on a sub-type (i.e. berries), to override those:
* @example [{name: "BERRY", count: 5, type: BerryType.SITRUS}] * @example [{name: "BERRY", count: 5, type: BerryType.SITRUS}]
* types are listed in interface below * types are listed in interface below
* - TempBattleStat is for TEMP_STAT_BOOSTER / X Items (Dire hit is separate) * - TempBattleStat is for TEMP_STAT_BOOSTER / X Items (Dire hit is separate)
@ -92,8 +92,8 @@ interface ModifierOverride {
count?: integer count?: integer
type?: TempBattleStat|Stat|Nature|Type|BerryType type?: TempBattleStat|Stat|Nature|Type|BerryType
} }
export const STARTING_MODIFIER_OVERRIDE: Array<ModifierOverride> = []; export const STARTING_MODIFIER_OVERRIDE: Array<ModifierOverride> = [];
export const OPP_MODIFIER_OVERRIDE: Array<ModifierOverride> = []; export const OPP_MODIFIER_OVERRIDE: Array<ModifierOverride> = [];
export const STARTING_HELD_ITEMS_OVERRIDE: Array<ModifierOverride> = []; export const STARTING_HELD_ITEMS_OVERRIDE: Array<ModifierOverride> = [];
export const OPP_HELD_ITEMS_OVERRIDE: Array<ModifierOverride> = []; export const OPP_HELD_ITEMS_OVERRIDE: Array<ModifierOverride> = [];

View File

@ -86,13 +86,13 @@ export class LoginPhase extends Phase {
if (this.showText) { if (this.showText) {
this.scene.ui.showText(i18next.t("menu:logInOrCreateAccount")); this.scene.ui.showText(i18next.t("menu:logInOrCreateAccount"));
} }
this.scene.playSound("menu_open"); this.scene.playSound("menu_open");
const loadData = () => { const loadData = () => {
updateUserInfo().then(() => this.scene.gameData.loadSystem().then(() => this.end())); updateUserInfo().then(() => this.scene.gameData.loadSystem().then(() => this.end()));
}; };
this.scene.ui.setMode(Mode.LOGIN_FORM, { this.scene.ui.setMode(Mode.LOGIN_FORM, {
buttonActions: [ buttonActions: [
() => { () => {
@ -138,7 +138,7 @@ export class LoginPhase extends Phase {
if (!this.scene.gameData.gender) { if (!this.scene.gameData.gender) {
this.scene.unshiftPhase(new SelectGenderPhase(this.scene)); this.scene.unshiftPhase(new SelectGenderPhase(this.scene));
} }
handleTutorial(this.scene, Tutorial.Intro).then(() => super.end()); handleTutorial(this.scene, Tutorial.Intro).then(() => super.end());
} }
} }
@ -319,7 +319,7 @@ export class TitlePhase extends Phase {
party.push(starterPokemon); party.push(starterPokemon);
loadPokemonAssets.push(starterPokemon.loadAssets()); loadPokemonAssets.push(starterPokemon.loadAssets());
} }
regenerateModifierPoolThresholds(party, ModifierPoolType.DAILY_STARTER); regenerateModifierPoolThresholds(party, ModifierPoolType.DAILY_STARTER);
const modifiers: Modifier[] = Array(3).fill(null).map(() => modifierTypes.EXP_SHARE().withIdFromFunc(modifierTypes.EXP_SHARE).newModifier()) const modifiers: Modifier[] = Array(3).fill(null).map(() => modifierTypes.EXP_SHARE().withIdFromFunc(modifierTypes.EXP_SHARE).newModifier())
.concat(Array(3).fill(null).map(() => modifierTypes.GOLDEN_EXP_CHARM().withIdFromFunc(modifierTypes.GOLDEN_EXP_CHARM).newModifier())) .concat(Array(3).fill(null).map(() => modifierTypes.GOLDEN_EXP_CHARM().withIdFromFunc(modifierTypes.GOLDEN_EXP_CHARM).newModifier()))
@ -341,7 +341,7 @@ export class TitlePhase extends Phase {
this.end(); this.end();
}); });
}; };
// If Online, calls seed fetch from db to generate daily run. If Offline, generates a daily run based on current date. // If Online, calls seed fetch from db to generate daily run. If Offline, generates a daily run based on current date.
if (!Utils.isLocal) { if (!Utils.isLocal) {
fetchDailyRunSeed().then(seed => { fetchDailyRunSeed().then(seed => {
@ -457,7 +457,7 @@ export class SelectGenderPhase extends Phase {
constructor(scene: BattleScene) { constructor(scene: BattleScene) {
super(scene); super(scene);
} }
start(): void { start(): void {
super.start(); super.start();
@ -771,11 +771,11 @@ export class EncounterPhase extends BattlePhase {
enemyPokemon.updateScale(); enemyPokemon.updateScale();
} }
} }
totalBst += enemyPokemon.getSpeciesForm().baseTotal; totalBst += enemyPokemon.getSpeciesForm().baseTotal;
loadEnemyAssets.push(enemyPokemon.loadAssets()); loadEnemyAssets.push(enemyPokemon.loadAssets());
console.log(enemyPokemon.name, enemyPokemon.species.speciesId, enemyPokemon.stats); console.log(enemyPokemon.name, enemyPokemon.species.speciesId, enemyPokemon.stats);
}); });
@ -915,7 +915,7 @@ export class EncounterPhase extends BattlePhase {
const trainer = this.scene.currentBattle.trainer; const trainer = this.scene.currentBattle.trainer;
trainer.untint(100, "Sine.easeOut"); trainer.untint(100, "Sine.easeOut");
trainer.playAnim(); trainer.playAnim();
const doSummon = () => { const doSummon = () => {
this.scene.currentBattle.started = true; this.scene.currentBattle.started = true;
this.scene.playBgm(undefined); this.scene.playBgm(undefined);
@ -936,7 +936,7 @@ export class EncounterPhase extends BattlePhase {
doTrainerSummon(); doTrainerSummon();
} }
}; };
const encounterMessages = this.scene.currentBattle.trainer.getEncounterMessages(); const encounterMessages = this.scene.currentBattle.trainer.getEncounterMessages();
if (!encounterMessages?.length) { if (!encounterMessages?.length) {
@ -999,7 +999,7 @@ export class EncounterPhase extends BattlePhase {
} }
this.scene.pushPhase(new ToggleDoublePositionPhase(this.scene, false)); this.scene.pushPhase(new ToggleDoublePositionPhase(this.scene, false));
} }
if (this.scene.currentBattle.battleType !== BattleType.TRAINER && (this.scene.currentBattle.waveIndex > 1 || !this.scene.gameMode.isDaily)) { if (this.scene.currentBattle.battleType !== BattleType.TRAINER && (this.scene.currentBattle.waveIndex > 1 || !this.scene.gameMode.isDaily)) {
const minPartySize = this.scene.currentBattle.double ? 2 : 1; const minPartySize = this.scene.currentBattle.double ? 2 : 1;
if (availablePartyMembers.length > minPartySize) { if (availablePartyMembers.length > minPartySize) {
@ -1061,7 +1061,7 @@ export class NextEncounterPhase extends EncounterPhase {
if (this.scene.lastEnemyTrainer) { if (this.scene.lastEnemyTrainer) {
this.scene.lastEnemyTrainer.destroy(); this.scene.lastEnemyTrainer.destroy();
} }
if (!this.tryOverrideForBattleSpec()) { if (!this.tryOverrideForBattleSpec()) {
this.doEncounterCommon(); this.doEncounterCommon();
} }
@ -1278,7 +1278,7 @@ export class SummonPhase extends PartyMemberPokemonPhase {
if (partyMember.isFainted()) { if (partyMember.isFainted()) {
console.warn("The Pokemon about to be sent out is fainted. Attempting to resolve..."); console.warn("The Pokemon about to be sent out is fainted. Attempting to resolve...");
const party = this.getParty(); const party = this.getParty();
// Find the first non-fainted Pokemon index above the current one // Find the first non-fainted Pokemon index above the current one
const nonFaintedIndex = party.findIndex((p, i) => i > this.partyMemberIndex && !p.isFainted()); const nonFaintedIndex = party.findIndex((p, i) => i > this.partyMemberIndex && !p.isFainted());
if (nonFaintedIndex === -1) { if (nonFaintedIndex === -1) {
@ -1287,7 +1287,7 @@ export class SummonPhase extends PartyMemberPokemonPhase {
} }
// Swaps the fainted Pokemon and the first non-fainted Pokemon in the party // Swaps the fainted Pokemon and the first non-fainted Pokemon in the party
[party[this.partyMemberIndex], party[nonFaintedIndex]] = [party[nonFaintedIndex], party[this.partyMemberIndex]]; [party[this.partyMemberIndex], party[nonFaintedIndex]] = [party[nonFaintedIndex], party[this.partyMemberIndex]];
console.warn("Swapped %s %O with %s %O", partyMember?.name, partyMember, party[0]?.name, party[0]); console.warn("Swapped %s %O with %s %O", partyMember?.name, partyMember, party[0]?.name, party[0]);
} }
@ -1790,9 +1790,9 @@ export class CommandPhase extends FieldPhase {
switch (command) { switch (command) {
case Command.FIGHT: case Command.FIGHT:
let useStruggle = false; let useStruggle = false;
if (cursor === -1 || if (cursor === -1 ||
playerPokemon.trySelectMove(cursor, args[0] as boolean) || playerPokemon.trySelectMove(cursor, args[0] as boolean) ||
(useStruggle = cursor > -1 && !playerPokemon.getMoveset().filter(m => m.isUsable(playerPokemon)).length)) { (useStruggle = cursor > -1 && !playerPokemon.getMoveset().filter(m => m.isUsable(playerPokemon)).length)) {
const moveId = !useStruggle ? cursor > -1 ? playerPokemon.getMoveset()[cursor].moveId : Moves.NONE : Moves.STRUGGLE; const moveId = !useStruggle ? cursor > -1 ? playerPokemon.getMoveset()[cursor].moveId : Moves.NONE : Moves.STRUGGLE;
const turnCommand: TurnCommand = { command: Command.FIGHT, cursor: cursor, move: { move: moveId, targets: [], ignorePP: args[0] }, args: args }; const turnCommand: TurnCommand = { command: Command.FIGHT, cursor: cursor, move: { move: moveId, targets: [], ignorePP: args[0] }, args: args };
const moveTargets: MoveTargetSet = args.length < 3 ? getMoveTargets(playerPokemon, moveId) : args[2]; const moveTargets: MoveTargetSet = args.length < 3 ? getMoveTargets(playerPokemon, moveId) : args[2];
@ -1814,8 +1814,8 @@ export class CommandPhase extends FieldPhase {
this.scene.ui.setMode(Mode.MESSAGE); this.scene.ui.setMode(Mode.MESSAGE);
// Decides between a Disabled, Not Implemented, or No PP translation message // Decides between a Disabled, Not Implemented, or No PP translation message
const errorMessage = const errorMessage =
playerPokemon.summonData.disabledMove === move.moveId ? "battle:moveDisabled" : playerPokemon.summonData.disabledMove === move.moveId ? "battle:moveDisabled" :
move.getName().endsWith(" (N)") ? "battle:moveNotImplemented" : "battle:moveNoPP"; move.getName().endsWith(" (N)") ? "battle:moveNotImplemented" : "battle:moveNoPP";
const moveName = move.getName().replace(" (N)", ""); // Trims off the indicator const moveName = move.getName().replace(" (N)", ""); // Trims off the indicator
@ -1904,12 +1904,12 @@ export class CommandPhase extends FieldPhase {
} else if (trapTag) { } else if (trapTag) {
if(trapTag.sourceMove === Moves.INGRAIN && this.scene.getPokemonById(trapTag.sourceId).isOfType(Type.GHOST)) { if(trapTag.sourceMove === Moves.INGRAIN && this.scene.getPokemonById(trapTag.sourceId).isOfType(Type.GHOST)) {
success = true; success = true;
this.scene.currentBattle.turnCommands[this.fieldIndex] = isSwitch this.scene.currentBattle.turnCommands[this.fieldIndex] = isSwitch
? { command: Command.POKEMON, cursor: cursor, args: args } ? { command: Command.POKEMON, cursor: cursor, args: args }
: { command: Command.RUN }; : { command: Command.RUN };
break; break;
} }
if (!isSwitch) { if (!isSwitch) {
this.scene.ui.setMode(Mode.COMMAND, this.fieldIndex); this.scene.ui.setMode(Mode.COMMAND, this.fieldIndex);
this.scene.ui.setMode(Mode.MESSAGE); this.scene.ui.setMode(Mode.MESSAGE);
} }
@ -2009,7 +2009,7 @@ export class EnemyCommandPhase extends FieldPhase {
if (partyMemberScores.length) { if (partyMemberScores.length) {
const matchupScores = opponents.map(opp => enemyPokemon.getMatchupScore(opp)); const matchupScores = opponents.map(opp => enemyPokemon.getMatchupScore(opp));
const matchupScore = matchupScores.reduce((total, score) => total += score, 0) / matchupScores.length; const matchupScore = matchupScores.reduce((total, score) => total += score, 0) / matchupScores.length;
const sortedPartyMemberScores = trainer.getSortedPartyMemberMatchupScores(partyMemberScores); const sortedPartyMemberScores = trainer.getSortedPartyMemberMatchupScores(partyMemberScores);
const switchMultiplier = 1 - (battle.enemySwitchCounter ? Math.pow(0.1, (1 / battle.enemySwitchCounter)) : 0); const switchMultiplier = 1 - (battle.enemySwitchCounter ? Math.pow(0.1, (1 / battle.enemySwitchCounter)) : 0);
@ -2019,7 +2019,7 @@ export class EnemyCommandPhase extends FieldPhase {
battle.turnCommands[this.fieldIndex + BattlerIndex.ENEMY] = battle.turnCommands[this.fieldIndex + BattlerIndex.ENEMY] =
{ command: Command.POKEMON, cursor: index, args: [ false ] }; { command: Command.POKEMON, cursor: index, args: [ false ] };
battle.enemySwitchCounter++; battle.enemySwitchCounter++;
return this.end(); return this.end();
@ -2108,7 +2108,7 @@ export class TurnStartPhase extends FieldPhase {
applyAbAttrs(IncrementMovePriorityAbAttr, this.scene.getField().find(p => p?.isActive() && p.getBattlerIndex() === a), null, aMove, aPriority); applyAbAttrs(IncrementMovePriorityAbAttr, this.scene.getField().find(p => p?.isActive() && p.getBattlerIndex() === a), null, aMove, aPriority);
applyAbAttrs(IncrementMovePriorityAbAttr, this.scene.getField().find(p => p?.isActive() && p.getBattlerIndex() === b), null, bMove, bPriority); applyAbAttrs(IncrementMovePriorityAbAttr, this.scene.getField().find(p => p?.isActive() && p.getBattlerIndex() === b), null, bMove, bPriority);
if (aPriority.value !== bPriority.value) { if (aPriority.value !== bPriority.value) {
return aPriority.value < bPriority.value ? 1 : -1; return aPriority.value < bPriority.value ? 1 : -1;
} }
@ -2117,7 +2117,7 @@ export class TurnStartPhase extends FieldPhase {
if (battlerBypassSpeed[a].value !== battlerBypassSpeed[b].value) { if (battlerBypassSpeed[a].value !== battlerBypassSpeed[b].value) {
return battlerBypassSpeed[a].value ? -1 : 1; return battlerBypassSpeed[a].value ? -1 : 1;
} }
const aIndex = order.indexOf(a); const aIndex = order.indexOf(a);
const bIndex = order.indexOf(b); const bIndex = order.indexOf(b);
@ -2231,10 +2231,10 @@ export class TurnEndPhase extends FieldPhase {
super.start(); super.start();
this.scene.currentBattle.incrementTurn(this.scene); this.scene.currentBattle.incrementTurn(this.scene);
const handlePokemon = (pokemon: Pokemon) => { const handlePokemon = (pokemon: Pokemon) => {
pokemon.lapseTags(BattlerTagLapseType.TURN_END); pokemon.lapseTags(BattlerTagLapseType.TURN_END);
if (pokemon.summonData.disabledMove && !--pokemon.summonData.disabledTurns) { if (pokemon.summonData.disabledMove && !--pokemon.summonData.disabledTurns) {
this.scene.pushPhase(new MessagePhase(this.scene, i18next.t("battle:notDisabled", { pokemonName: `${getPokemonPrefix(pokemon)}${pokemon.name}`, moveName: allMoves[pokemon.summonData.disabledMove].name }))); this.scene.pushPhase(new MessagePhase(this.scene, i18next.t("battle:notDisabled", { pokemonName: `${getPokemonPrefix(pokemon)}${pokemon.name}`, moveName: allMoves[pokemon.summonData.disabledMove].name })));
pokemon.summonData.disabledMove = Moves.NONE; pokemon.summonData.disabledMove = Moves.NONE;
@ -2260,7 +2260,7 @@ export class TurnEndPhase extends FieldPhase {
}; };
this.executeForAll(handlePokemon); this.executeForAll(handlePokemon);
this.scene.arena.lapseTags(); this.scene.arena.lapseTags();
if (this.scene.arena.weather && !this.scene.arena.weather.lapse()) { if (this.scene.arena.weather && !this.scene.arena.weather.lapse()) {
@ -2444,9 +2444,9 @@ export class MovePhase extends BattlePhase {
const doMove = () => { const doMove = () => {
this.pokemon.turnData.acted = true; // Record that the move was attempted, even if it fails this.pokemon.turnData.acted = true; // Record that the move was attempted, even if it fails
this.pokemon.lapseTags(BattlerTagLapseType.PRE_MOVE); this.pokemon.lapseTags(BattlerTagLapseType.PRE_MOVE);
let ppUsed = 1; let ppUsed = 1;
// Filter all opponents to include only those this move is targeting // Filter all opponents to include only those this move is targeting
const targetedOpponents = this.pokemon.getOpponents().filter(o => this.targets.includes(o.getBattlerIndex())); const targetedOpponents = this.pokemon.getOpponents().filter(o => this.targets.includes(o.getBattlerIndex()));
@ -2458,7 +2458,7 @@ export class MovePhase extends BattlePhase {
ppUsed++; ppUsed++;
} }
} }
if (!this.followUp && this.canMove() && !this.cancelled) { if (!this.followUp && this.canMove() && !this.cancelled) {
this.pokemon.lapseTags(BattlerTagLapseType.MOVE); this.pokemon.lapseTags(BattlerTagLapseType.MOVE);
} }
@ -2484,10 +2484,10 @@ export class MovePhase extends BattlePhase {
} }
// This should only happen when there are no valid targets left on the field // This should only happen when there are no valid targets left on the field
if ((moveQueue.length && moveQueue[0].move === Moves.NONE) || !targets.length) { if ((moveQueue.length && moveQueue[0].move === Moves.NONE) || !targets.length) {
this.showFailedText(); this.showFailedText();
this.cancel(); this.cancel();
// Record a failed move so Abilities like Truant don't trigger next turn and soft-lock // Record a failed move so Abilities like Truant don't trigger next turn and soft-lock
this.pokemon.pushMoveHistory({ move: Moves.NONE, result: MoveResult.FAIL }); this.pokemon.pushMoveHistory({ move: Moves.NONE, result: MoveResult.FAIL });
@ -2525,7 +2525,7 @@ export class MovePhase extends BattlePhase {
this.showFailedText(failedText); this.showFailedText(failedText);
} }
} }
this.end(); this.end();
}; };
@ -2533,7 +2533,7 @@ export class MovePhase extends BattlePhase {
this.pokemon.status.incrementTurn(); this.pokemon.status.incrementTurn();
let activated = false; let activated = false;
let healed = false; let healed = false;
switch (this.pokemon.status.effect) { switch (this.pokemon.status.effect) {
case StatusEffect.PARALYSIS: case StatusEffect.PARALYSIS:
if (!this.pokemon.randSeedInt(4)) { if (!this.pokemon.randSeedInt(4)) {
@ -2553,7 +2553,7 @@ export class MovePhase extends BattlePhase {
this.cancelled = activated; this.cancelled = activated;
break; break;
} }
if (activated) { if (activated) {
this.scene.queueMessage(getPokemonMessage(this.pokemon, getStatusEffectActivationText(this.pokemon.status.effect))); this.scene.queueMessage(getPokemonMessage(this.pokemon, getStatusEffectActivationText(this.pokemon.status.effect)));
this.scene.unshiftPhase(new CommonAnimPhase(this.scene, this.pokemon.getBattlerIndex(), undefined, CommonAnim.POISON + (this.pokemon.status.effect - 1))); this.scene.unshiftPhase(new CommonAnimPhase(this.scene, this.pokemon.getBattlerIndex(), undefined, CommonAnim.POISON + (this.pokemon.status.effect - 1)));
@ -2587,7 +2587,7 @@ export class MovePhase extends BattlePhase {
if (this.pokemon.getTag(BattlerTagType.RECHARGING || BattlerTagType.INTERRUPTED)) { if (this.pokemon.getTag(BattlerTagType.RECHARGING || BattlerTagType.INTERRUPTED)) {
return; return;
} }
this.scene.queueMessage(getPokemonMessage(this.pokemon, ` used\n${this.move.getName()}!`), 500); this.scene.queueMessage(getPokemonMessage(this.pokemon, ` used\n${this.move.getName()}!`), 500);
applyMoveAttrs(PreMoveMessageAttr, this.pokemon, this.pokemon.getOpponents().find(() => true), this.move.getMove()); applyMoveAttrs(PreMoveMessageAttr, this.pokemon, this.pokemon.getOpponents().find(() => true), this.move.getMove());
} }
@ -2608,7 +2608,7 @@ export class MovePhase extends BattlePhase {
export class MoveEffectPhase extends PokemonPhase { export class MoveEffectPhase extends PokemonPhase {
public move: PokemonMove; public move: PokemonMove;
protected targets: BattlerIndex[]; protected targets: BattlerIndex[];
constructor(scene: BattleScene, battlerIndex: BattlerIndex, targets: BattlerIndex[], move: PokemonMove) { constructor(scene: BattleScene, battlerIndex: BattlerIndex, targets: BattlerIndex[], move: PokemonMove) {
super(scene, battlerIndex); super(scene, battlerIndex);
@ -2634,7 +2634,7 @@ export class MoveEffectPhase extends PokemonPhase {
if (overridden.value) { if (overridden.value) {
return this.end(); return this.end();
} }
user.lapseTags(BattlerTagLapseType.MOVE_EFFECT); user.lapseTags(BattlerTagLapseType.MOVE_EFFECT);
if (user.turnData.hitsLeft === undefined) { if (user.turnData.hitsLeft === undefined) {
@ -2687,7 +2687,7 @@ export class MoveEffectPhase extends PokemonPhase {
const firstHit = moveHistoryEntry.result !== MoveResult.SUCCESS; const firstHit = moveHistoryEntry.result !== MoveResult.SUCCESS;
moveHistoryEntry.result = MoveResult.SUCCESS; moveHistoryEntry.result = MoveResult.SUCCESS;
const hitResult = !isProtected ? target.apply(user, this.move) : HitResult.NO_EFFECT; const hitResult = !isProtected ? target.apply(user, this.move) : HitResult.NO_EFFECT;
this.scene.triggerPokemonFormChange(user, SpeciesFormChangePostMoveTrigger); this.scene.triggerPokemonFormChange(user, SpeciesFormChangePostMoveTrigger);
@ -2740,7 +2740,7 @@ export class MoveEffectPhase extends PokemonPhase {
// Trigger effect which should only apply one time after all targeted effects have already applied // Trigger effect which should only apply one time after all targeted effects have already applied
const postTarget = applyFilteredMoveAttrs((attr: MoveAttr) => attr instanceof MoveEffectAttr && (attr as MoveEffectAttr).trigger === MoveEffectTrigger.POST_TARGET, const postTarget = applyFilteredMoveAttrs((attr: MoveAttr) => attr instanceof MoveEffectAttr && (attr as MoveEffectAttr).trigger === MoveEffectTrigger.POST_TARGET,
user, null, this.move.getMove()); user, null, this.move.getMove());
if (applyAttrs.length) { // If there is a pending asynchronous move effect, do this after if (applyAttrs.length) { // If there is a pending asynchronous move effect, do this after
applyAttrs[applyAttrs.length - 1]?.then(() => postTarget); applyAttrs[applyAttrs.length - 1]?.then(() => postTarget);
} else { // Otherwise, push a new asynchronous move effect } else { // Otherwise, push a new asynchronous move effect
@ -2765,7 +2765,7 @@ export class MoveEffectPhase extends PokemonPhase {
this.scene.applyModifiers(HitHealModifier, this.player, user); this.scene.applyModifiers(HitHealModifier, this.player, user);
} }
} }
super.end(); super.end();
} }
@ -2790,7 +2790,7 @@ export class MoveEffectPhase extends PokemonPhase {
if (user.getTag(BattlerTagType.IGNORE_ACCURACY) && (user.getLastXMoves().slice(1).find(() => true)?.targets || []).indexOf(target.getBattlerIndex()) !== -1) { if (user.getTag(BattlerTagType.IGNORE_ACCURACY) && (user.getLastXMoves().slice(1).find(() => true)?.targets || []).indexOf(target.getBattlerIndex()) !== -1) {
return true; return true;
} }
const hiddenTag = target.getTag(HiddenTag); const hiddenTag = target.getTag(HiddenTag);
if (hiddenTag && !this.move.getMove().getAttrs(HitsTagAttr).filter(hta => (hta as HitsTagAttr).tagType === hiddenTag.tagType).length) { if (hiddenTag && !this.move.getMove().getAttrs(HitsTagAttr).filter(hta => (hta as HitsTagAttr).tagType === hiddenTag.tagType).length) {
return false; return false;
@ -2817,7 +2817,7 @@ export class MoveEffectPhase extends PokemonPhase {
if (!isOhko && this.scene.arena.getTag(ArenaTagType.GRAVITY)) { if (!isOhko && this.scene.arena.getTag(ArenaTagType.GRAVITY)) {
moveAccuracy.value = Math.floor(moveAccuracy.value * 1.67); moveAccuracy.value = Math.floor(moveAccuracy.value * 1.67);
} }
const userAccuracyLevel = new Utils.IntegerHolder(user.summonData.battleStats[BattleStat.ACC]); const userAccuracyLevel = new Utils.IntegerHolder(user.summonData.battleStats[BattleStat.ACC]);
const targetEvasionLevel = new Utils.IntegerHolder(target.summonData.battleStats[BattleStat.EVA]); const targetEvasionLevel = new Utils.IntegerHolder(target.summonData.battleStats[BattleStat.EVA]);
applyAbAttrs(IgnoreOpponentStatChangesAbAttr, target, null, userAccuracyLevel); applyAbAttrs(IgnoreOpponentStatChangesAbAttr, target, null, userAccuracyLevel);
@ -2985,7 +2985,7 @@ export class StatChangePhase extends PokemonPhase {
if (!cancelled.value && !this.selfTarget && this.levels < 0) { if (!cancelled.value && !this.selfTarget && this.levels < 0) {
applyPreStatChangeAbAttrs(ProtectStatAbAttr, this.getPokemon(), stat, cancelled); applyPreStatChangeAbAttrs(ProtectStatAbAttr, this.getPokemon(), stat, cancelled);
} }
return !cancelled.value; return !cancelled.value;
}); });
@ -3009,15 +3009,15 @@ export class StatChangePhase extends PokemonPhase {
for (const stat of filteredStats) { for (const stat of filteredStats) {
pokemon.summonData.battleStats[stat] = Math.max(Math.min(pokemon.summonData.battleStats[stat] + levels.value, 6), -6); pokemon.summonData.battleStats[stat] = Math.max(Math.min(pokemon.summonData.battleStats[stat] + levels.value, 6), -6);
} }
if (levels.value > 0 && this.canBeCopied) { if (levels.value > 0 && this.canBeCopied) {
for (const opponent of pokemon.getOpponents()) { for (const opponent of pokemon.getOpponents()) {
applyAbAttrs(StatChangeCopyAbAttr, opponent, null, this.stats, levels.value); applyAbAttrs(StatChangeCopyAbAttr, opponent, null, this.stats, levels.value);
} }
} }
applyPostStatChangeAbAttrs(PostStatChangeAbAttr, pokemon, filteredStats, this.levels, this.selfTarget); applyPostStatChangeAbAttrs(PostStatChangeAbAttr, pokemon, filteredStats, this.levels, this.selfTarget);
pokemon.updateInfo(); pokemon.updateInfo();
handleTutorial(this.scene, Tutorial.Stat_Change).then(() => super.end()); handleTutorial(this.scene, Tutorial.Stat_Change).then(() => super.end());
@ -3061,7 +3061,7 @@ export class StatChangePhase extends PokemonPhase {
duration: 1500, duration: 1500,
y: `${levels.value >= 1 ? "-" : "+"}=${160 * 6}` y: `${levels.value >= 1 ? "-" : "+"}=${160 * 6}`
}); });
this.scene.time.delayedCall(1750, () => { this.scene.time.delayedCall(1750, () => {
pokemon.disableMask(); pokemon.disableMask();
end(); end();
@ -3146,7 +3146,7 @@ export class WeatherEffectPhase extends CommonAnimPhase {
start() { start() {
if (this.weather.isDamaging()) { if (this.weather.isDamaging()) {
const cancelled = new Utils.BooleanHolder(false); const cancelled = new Utils.BooleanHolder(false);
this.executeForAll((pokemon: Pokemon) => applyPreWeatherEffectAbAttrs(SuppressWeatherEffectAbAttr, pokemon, this.weather, cancelled)); this.executeForAll((pokemon: Pokemon) => applyPreWeatherEffectAbAttrs(SuppressWeatherEffectAbAttr, pokemon, this.weather, cancelled));
@ -3627,7 +3627,7 @@ export class VictoryPhase extends PokemonPhase {
} }
} }
} }
if (!this.scene.getEnemyParty().find(p => this.scene.currentBattle.battleType ? !p?.isFainted(true) : p.isOnField())) { if (!this.scene.getEnemyParty().find(p => this.scene.currentBattle.battleType ? !p?.isFainted(true) : p.isOnField())) {
this.scene.pushPhase(new BattleEndPhase(this.scene)); this.scene.pushPhase(new BattleEndPhase(this.scene));
if (this.scene.currentBattle.battleType === BattleType.TRAINER) { if (this.scene.currentBattle.battleType === BattleType.TRAINER) {
@ -3701,7 +3701,7 @@ export class TrainerVictoryPhase extends BattlePhase {
let message: string; let message: string;
this.scene.executeWithSeedOffset(() => message = Utils.randSeedItem(victoryMessages), this.scene.currentBattle.waveIndex); this.scene.executeWithSeedOffset(() => message = Utils.randSeedItem(victoryMessages), this.scene.currentBattle.waveIndex);
const messagePages = message.split(/\$/g).map(m => m.trim()); const messagePages = message.split(/\$/g).map(m => m.trim());
for (let p = messagePages.length - 1; p >= 0; p--) { for (let p = messagePages.length - 1; p >= 0; p--) {
const originalFunc = showMessageOrEnd; const originalFunc = showMessageOrEnd;
showMessageOrEnd = () => this.scene.ui.showDialogue(messagePages[p], this.scene.currentBattle.trainer.getName(), null, originalFunc); showMessageOrEnd = () => this.scene.ui.showDialogue(messagePages[p], this.scene.currentBattle.trainer.getName(), null, originalFunc);
@ -3847,7 +3847,7 @@ export class GameOverPhase extends BattlePhase {
this.scene.pushPhase(new EncounterPhase(this.scene, true)); this.scene.pushPhase(new EncounterPhase(this.scene, true));
const availablePartyMembers = this.scene.getParty().filter(p => !p.isFainted()).length; const availablePartyMembers = this.scene.getParty().filter(p => !p.isFainted()).length;
this.scene.pushPhase(new SummonPhase(this.scene, 0)); this.scene.pushPhase(new SummonPhase(this.scene, 0));
if (this.scene.currentBattle.double && availablePartyMembers > 1) { if (this.scene.currentBattle.double && availablePartyMembers > 1) {
this.scene.pushPhase(new SummonPhase(this.scene, 1)); this.scene.pushPhase(new SummonPhase(this.scene, 1));
@ -4001,9 +4001,9 @@ export class EndCardPhase extends Phase {
this.scene.field.add(this.text); this.scene.field.add(this.text);
this.scene.ui.clearText(); this.scene.ui.clearText();
this.scene.ui.fadeIn(1000).then(() => { this.scene.ui.fadeIn(1000).then(() => {
this.scene.ui.showText("", null, () => { this.scene.ui.showText("", null, () => {
this.scene.ui.getMessageHandler().bg.setVisible(true); this.scene.ui.getMessageHandler().bg.setVisible(true);
this.end(); this.end();
@ -4375,7 +4375,7 @@ export class PokemonHealPhase extends CommonAnimPhase {
end() { end() {
const pokemon = this.getPokemon(); const pokemon = this.getPokemon();
if (!pokemon.isOnField() || (!this.revive && !pokemon.isActive())) { if (!pokemon.isOnField() || (!this.revive && !pokemon.isActive())) {
super.end(); super.end();
return; return;
@ -4538,7 +4538,7 @@ export class AttemptCapturePhase extends PokemonPhase {
} else { } else {
this.scene.playSound("pb_lock"); this.scene.playSound("pb_lock");
addPokeballCaptureStars(this.scene, this.pokeball); addPokeballCaptureStars(this.scene, this.pokeball);
const pbTint = this.scene.add.sprite(this.pokeball.x, this.pokeball.y, "pb", "pb"); const pbTint = this.scene.add.sprite(this.pokeball.x, this.pokeball.y, "pb", "pb");
pbTint.setOrigin(this.pokeball.originX, this.pokeball.originY); pbTint.setOrigin(this.pokeball.originX, this.pokeball.originY);
pbTint.setTintFill(0); pbTint.setTintFill(0);
@ -4594,7 +4594,7 @@ export class AttemptCapturePhase extends PokemonPhase {
ease: "Sine.easeOut", ease: "Sine.easeOut",
scale: 1 scale: 1
}); });
this.scene.currentBattle.lastUsedPokeball = this.pokeballType; this.scene.currentBattle.lastUsedPokeball = this.pokeballType;
this.removePb(); this.removePb();
this.end(); this.end();
@ -4625,7 +4625,7 @@ export class AttemptCapturePhase extends PokemonPhase {
this.scene.pokemonInfoContainer.show(pokemon, true); this.scene.pokemonInfoContainer.show(pokemon, true);
this.scene.gameData.updateSpeciesDexIvs(pokemon.species.getRootSpeciesId(true), pokemon.ivs); this.scene.gameData.updateSpeciesDexIvs(pokemon.species.getRootSpeciesId(true), pokemon.ivs);
this.scene.ui.showText(i18next.t("battle:pokemonCaught", { pokemonName: pokemon.name }), null, () => { this.scene.ui.showText(i18next.t("battle:pokemonCaught", { pokemonName: pokemon.name }), null, () => {
const end = () => { const end = () => {
this.scene.pokemonInfoContainer.hide(); this.scene.pokemonInfoContainer.hide();
@ -4718,7 +4718,7 @@ export class AttemptRunPhase extends PokemonPhase {
if (playerPokemon.randSeedInt(256) < escapeChance.value) { if (playerPokemon.randSeedInt(256) < escapeChance.value) {
this.scene.playSound("flee"); this.scene.playSound("flee");
this.scene.queueMessage(i18next.t("battle:runAwaySuccess"), null, true, 500); this.scene.queueMessage(i18next.t("battle:runAwaySuccess"), null, true, 500);
this.scene.tweens.add({ this.scene.tweens.add({
targets: [ this.scene.arenaEnemy, enemyField ].flat(), targets: [ this.scene.arenaEnemy, enemyField ].flat(),
alpha: 0, alpha: 0,
@ -4933,7 +4933,7 @@ export class SelectModifierPhase extends BattlePhase {
} }
return Math.min(Math.ceil(this.scene.currentBattle.waveIndex / 10) * baseValue * Math.pow(2, this.rerollCount), Number.MAX_SAFE_INTEGER); return Math.min(Math.ceil(this.scene.currentBattle.waveIndex / 10) * baseValue * Math.pow(2, this.rerollCount), Number.MAX_SAFE_INTEGER);
} }
getPoolType(): ModifierPoolType { getPoolType(): ModifierPoolType {
return ModifierPoolType.PLAYER; return ModifierPoolType.PLAYER;
} }
@ -4961,11 +4961,11 @@ export class EggLapsePhase extends Phase {
if (eggsToHatch.length) { if (eggsToHatch.length) {
this.scene.queueMessage(i18next.t("battle:eggHatching")); this.scene.queueMessage(i18next.t("battle:eggHatching"));
for (const egg of eggsToHatch) { for (const egg of eggsToHatch) {
this.scene.unshiftPhase(new EggHatchPhase(this.scene, egg)); this.scene.unshiftPhase(new EggHatchPhase(this.scene, egg));
} }
} }
this.end(); this.end();
} }
@ -4983,7 +4983,7 @@ export class AddEnemyBuffModifierPhase extends Phase {
const tier = !(waveIndex % 1000) ? ModifierTier.ULTRA : !(waveIndex % 250) ? ModifierTier.GREAT : ModifierTier.COMMON; const tier = !(waveIndex % 1000) ? ModifierTier.ULTRA : !(waveIndex % 250) ? ModifierTier.GREAT : ModifierTier.COMMON;
regenerateModifierPoolThresholds(this.scene.getEnemyParty(), ModifierPoolType.ENEMY_BUFF); regenerateModifierPoolThresholds(this.scene.getEnemyParty(), ModifierPoolType.ENEMY_BUFF);
const count = Math.ceil(waveIndex / 250); const count = Math.ceil(waveIndex / 250);
for (let i = 0; i < count; i++) { for (let i = 0; i < count; i++) {
this.scene.addEnemyModifier(getEnemyBuffModifierForWave(tier, this.scene.findModifiers(m => m instanceof EnemyPersistentModifier, false), this.scene), true, true); this.scene.addEnemyModifier(getEnemyBuffModifierForWave(tier, this.scene.findModifiers(m => m instanceof EnemyPersistentModifier, false), this.scene), true, true);
@ -5124,7 +5124,7 @@ export class TrainerMessageTestPhase extends BattlePhase {
constructor(scene: BattleScene, ...trainerTypes: TrainerType[]) { constructor(scene: BattleScene, ...trainerTypes: TrainerType[]) {
super(scene); super(scene);
this.trainerTypes = trainerTypes; this.trainerTypes = trainerTypes;
} }
@ -5132,7 +5132,7 @@ export class TrainerMessageTestPhase extends BattlePhase {
super.start(); super.start();
const testMessages: string[] = []; const testMessages: string[] = [];
for (const t of Object.keys(trainerConfigs)) { for (const t of Object.keys(trainerConfigs)) {
const type = parseInt(t); const type = parseInt(t);
if (this.trainerTypes.length && !this.trainerTypes.find(tt => tt === type as TrainerType)) { if (this.trainerTypes.length && !this.trainerTypes.find(tt => tt === type as TrainerType)) {

View File

@ -378,7 +378,7 @@ export default class SpritePipeline extends FieldSpritePipeline {
this.set1f("yOffset", sprite.height - sprite.frame.height * (isEntityObj ? sprite.parentContainer.scale : sprite.scale)); this.set1f("yOffset", sprite.height - sprite.frame.height * (isEntityObj ? sprite.parentContainer.scale : sprite.scale));
this.set4fv("tone", tone); this.set4fv("tone", tone);
this.bindTexture(this.game.textures.get("tera").source[0].glTexture, 1); this.bindTexture(this.game.textures.get("tera").source[0].glTexture, 1);
if ((gameObject.scene as BattleScene).fusionPaletteSwaps) { if ((gameObject.scene as BattleScene).fusionPaletteSwaps) {
const spriteColors = ((ignoreOverride && data["spriteColorsBase"]) || data["spriteColors"] || []) as number[][]; const spriteColors = ((ignoreOverride && data["spriteColorsBase"]) || data["spriteColors"] || []) as number[][];
const fusionSpriteColors = ((ignoreOverride && data["fusionSpriteColorsBase"]) || data["fusionSpriteColors"] || []) as number[][]; const fusionSpriteColors = ((ignoreOverride && data["fusionSpriteColorsBase"]) || data["fusionSpriteColors"] || []) as number[][];
@ -460,7 +460,7 @@ export default class SpritePipeline extends FieldSpritePipeline {
const pixelHeight = (v1 - v0) / (sprite.frame.height * (isEntityObj ? sprite.parentContainer.scale : sprite.scale)); const pixelHeight = (v1 - v0) / (sprite.frame.height * (isEntityObj ? sprite.parentContainer.scale : sprite.scale));
v1 += (yDelta + bottomPadding / field.scale) * pixelHeight; v1 += (yDelta + bottomPadding / field.scale) * pixelHeight;
} }
return super.batchQuad(gameObject, x0, y0, x1, y1, x2, y2, x3, y3, u0, v0, u1, v1, tintTL, tintTR, tintBL, tintBR, tintEffect, texture, unit); return super.batchQuad(gameObject, x0, y0, x1, y1, x2, y2, x3, y3, u0, v0, u1, v1, tintTL, tintTR, tintBL, tintBR, tintEffect, texture, unit);
} }

View File

@ -17,7 +17,7 @@ export default class CacheBustedLoaderPlugin extends Phaser.Loader.LoaderPlugin
if (!Array.isArray(file)) { if (!Array.isArray(file)) {
file = [ file ]; file = [ file ];
} }
file.forEach(item => { file.forEach(item => {
if (manifest) { if (manifest) {
const timestamp = manifest[`/${item.url.replace(/\/\//g, "/")}` ]; const timestamp = manifest[`/${item.url.replace(/\/\//g, "/")}` ];

View File

@ -124,7 +124,7 @@ export function initI18n(): void {
}, },
zh_CN: { zh_CN: {
...zhCnConfig ...zhCnConfig
}, },
zh_TW: { zh_TW: {
...zhTWConfig ...zhTWConfig
} }

View File

@ -180,7 +180,7 @@ export interface StarterMoveData {
} }
export interface StarterDataEntry { export interface StarterDataEntry {
moveset: StarterMoveset | StarterFormMoveData; moveset: StarterMoveset | StarterFormMoveData;
eggMoves: integer; eggMoves: integer;
candyCount: integer; candyCount: integer;
friendship: integer; friendship: integer;
@ -223,7 +223,7 @@ export class GameData {
public secretId: integer; public secretId: integer;
public gender: PlayerGender; public gender: PlayerGender;
public dexData: DexData; public dexData: DexData;
private defaultDexData: DexData; private defaultDexData: DexData;
@ -372,7 +372,7 @@ export class GameData {
localStorage.setItem(`data_${loggedInUser.username}`, encrypt(systemDataStr, bypassLogin)); localStorage.setItem(`data_${loggedInUser.username}`, encrypt(systemDataStr, bypassLogin));
/*const versions = [ this.scene.game.config.gameVersion, data.gameVersion || '0.0.0' ]; /*const versions = [ this.scene.game.config.gameVersion, data.gameVersion || '0.0.0' ];
if (versions[0] !== versions[1]) { if (versions[0] !== versions[1]) {
const [ versionNumbers, oldVersionNumbers ] = versions.map(ver => ver.split('.').map(v => parseInt(v))); const [ versionNumbers, oldVersionNumbers ] = versions.map(ver => ver.split('.').map(v => parseInt(v)));
}*/ }*/
@ -439,7 +439,7 @@ export class GameData {
if (achvs.hasOwnProperty(a)) { if (achvs.hasOwnProperty(a)) {
this.achvUnlocks[a] = systemData.achvUnlocks[a]; this.achvUnlocks[a] = systemData.achvUnlocks[a];
} }
} }
} }
if (systemData.voucherUnlocks) { if (systemData.voucherUnlocks) {
@ -1029,7 +1029,7 @@ export class GameData {
if (saveFile) { if (saveFile) {
saveFile.remove(); saveFile.remove();
} }
saveFile = document.createElement("input"); saveFile = document.createElement("input");
saveFile.id = "saveFile"; saveFile.id = "saveFile";
saveFile.type = "file"; saveFile.type = "file";
@ -1219,7 +1219,7 @@ export class GameData {
: AbilityAttr.ABILITY_HIDDEN; : AbilityAttr.ABILITY_HIDDEN;
} }
dexEntry.natureAttr |= Math.pow(2, pokemon.nature + 1); dexEntry.natureAttr |= Math.pow(2, pokemon.nature + 1);
const hasPrevolution = pokemonPrevolutions.hasOwnProperty(species.speciesId); const hasPrevolution = pokemonPrevolutions.hasOwnProperty(species.speciesId);
const newCatch = !caughtAttr; const newCatch = !caughtAttr;
const hasNewAttr = (caughtAttr & dexAttr) !== dexAttr; const hasNewAttr = (caughtAttr & dexAttr) !== dexAttr;
@ -1257,7 +1257,7 @@ export class GameData {
this.addStarterCandy(species, (1 * (pokemon.isShiny() ? 5 * Math.pow(2, pokemon.variant || 0) : 1)) * (fromEgg || pokemon.isBoss() ? 2 : 1)); this.addStarterCandy(species, (1 * (pokemon.isShiny() ? 5 * Math.pow(2, pokemon.variant || 0) : 1)) * (fromEgg || pokemon.isBoss() ? 2 : 1));
} }
} }
const checkPrevolution = () => { const checkPrevolution = () => {
if (hasPrevolution) { if (hasPrevolution) {
const prevolutionSpecies = pokemonPrevolutions[species.speciesId]; const prevolutionSpecies = pokemonPrevolutions[species.speciesId];
@ -1282,7 +1282,7 @@ export class GameData {
if (!this.starterData[speciesIdToIncrement].classicWinCount) { if (!this.starterData[speciesIdToIncrement].classicWinCount) {
this.starterData[speciesIdToIncrement].classicWinCount = 0; this.starterData[speciesIdToIncrement].classicWinCount = 0;
} }
if (!this.starterData[speciesIdToIncrement].classicWinCount) { if (!this.starterData[speciesIdToIncrement].classicWinCount) {
this.scene.gameData.gameStats.ribbonsOwned++; this.scene.gameData.gameStats.ribbonsOwned++;
} }
@ -1474,7 +1474,7 @@ export class GameData {
getFormAttr(formIndex: integer): bigint { getFormAttr(formIndex: integer): bigint {
return BigInt(Math.pow(2, 7 + formIndex)); return BigInt(Math.pow(2, 7 + formIndex));
} }
consolidateDexData(dexData: DexData): void { consolidateDexData(dexData: DexData): void {
for (const k of Object.keys(dexData)) { for (const k of Object.keys(dexData)) {
const entry = dexData[k] as DexEntry; const entry = dexData[k] as DexEntry;
@ -1555,7 +1555,7 @@ export class GameData {
} }
} }
} }
fixStarterData(systemData: SystemSaveData): void { fixStarterData(systemData: SystemSaveData): void {
for (const starterId of defaultStarterSpecies) { for (const starterId of defaultStarterSpecies) {
systemData.starterData[starterId].abilityAttr |= AbilityAttr.ABILITY_1; systemData.starterData[starterId].abilityAttr |= AbilityAttr.ABILITY_1;

View File

@ -85,7 +85,7 @@ export function initGameSpeed() {
} }
return originalAddCounter.apply(this, [ config ]); return originalAddCounter.apply(this, [ config ]);
}; };
const originalFadeOut = SoundFade.fadeOut; const originalFadeOut = SoundFade.fadeOut;
SoundFade.fadeOut = (( SoundFade.fadeOut = ((
scene: Phaser.Scene, scene: Phaser.Scene,

View File

@ -125,7 +125,7 @@ export default class PokemonData {
this.summonData.ability = source.summonData.ability; this.summonData.ability = source.summonData.ability;
this.summonData.moveset = source.summonData.moveset?.map(m => PokemonMove.loadMove(m)); this.summonData.moveset = source.summonData.moveset?.map(m => PokemonMove.loadMove(m));
this.summonData.types = source.summonData.types; this.summonData.types = source.summonData.types;
if (source.summonData.tags) { if (source.summonData.tags) {
this.summonData.tags = source.summonData.tags?.map(t => loadBattlerTag(t)); this.summonData.tags = source.summonData.tags?.map(t => loadBattlerTag(t));
} else { } else {

View File

@ -32,7 +32,7 @@ export function isMobile() {
*/ */
function simulateKeyboardEvent(eventType, button, buttonMap) { function simulateKeyboardEvent(eventType, button, buttonMap) {
const key = buttonMap[button]; const key = buttonMap[button];
switch (eventType) { switch (eventType) {
case "keydown": case "keydown":
key.onDown({}); key.onDown({});

View File

@ -63,7 +63,7 @@ export default class AbilityBar extends Phaser.GameObjects.Container {
this.resetAutoHideTimer(); this.resetAutoHideTimer();
} }
}); });
this.setVisible(true); this.setVisible(true);
this.shown = true; this.shown = true;
} }

View File

@ -54,7 +54,7 @@ export default abstract class AbstractOptionSelectUiHandler extends UiHandler {
setup() { setup() {
const ui = this.getUi(); const ui = this.getUi();
this.optionSelectContainer = this.scene.add.container((this.scene.game.canvas.width / 6) - 1, -48); this.optionSelectContainer = this.scene.add.container((this.scene.game.canvas.width / 6) - 1, -48);
this.optionSelectContainer.setVisible(false); this.optionSelectContainer.setVisible(false);
ui.add(this.optionSelectContainer); ui.add(this.optionSelectContainer);
@ -159,7 +159,7 @@ export default abstract class AbstractOptionSelectUiHandler extends UiHandler {
ui.playError(); ui.playError();
return false; return false;
} }
success = true; success = true;
if (button === Button.CANCEL) { if (button === Button.CANCEL) {
if (this.config?.maxOptions && this.config.options.length > this.config.maxOptions) { if (this.config?.maxOptions && this.config.options.length > this.config.maxOptions) {

View File

@ -76,7 +76,7 @@ export default class AchvBar extends Phaser.GameObjects.Container {
}); });
this.scene.time.delayedCall(10000, () => this.hide()); this.scene.time.delayedCall(10000, () => this.hide());
this.setVisible(true); this.setVisible(true);
this.shown = true; this.shown = true;
} }

View File

@ -24,7 +24,7 @@ export default class AchvsUiHandler extends MessageUiHandler {
setup() { setup() {
const ui = this.getUi(); const ui = this.getUi();
this.achvsContainer = this.scene.add.container(1, -(this.scene.game.canvas.height / 6) + 1); this.achvsContainer = this.scene.add.container(1, -(this.scene.game.canvas.height / 6) + 1);
this.achvsContainer.setInteractive(new Phaser.Geom.Rectangle(0, 0, this.scene.game.canvas.width / 6, this.scene.game.canvas.height / 6), Phaser.Geom.Rectangle.Contains); this.achvsContainer.setInteractive(new Phaser.Geom.Rectangle(0, 0, this.scene.game.canvas.width / 6, this.scene.game.canvas.height / 6), Phaser.Geom.Rectangle.Contains);
@ -40,7 +40,7 @@ export default class AchvsUiHandler extends MessageUiHandler {
this.achvIconsBg.setOrigin(0, 0); this.achvIconsBg.setOrigin(0, 0);
this.achvIconsContainer = this.scene.add.container(6, headerBg.height + 6); this.achvIconsContainer = this.scene.add.container(6, headerBg.height + 6);
this.achvIcons = []; this.achvIcons = [];
for (let a = 0; a < Object.keys(achvs).length; a++) { for (let a = 0; a < Object.keys(achvs).length; a++) {

View File

@ -21,7 +21,7 @@ export default abstract class AwaitableUiHandler extends UiHandler {
this.awaitingActionInput = false; this.awaitingActionInput = false;
return true; return true;
} }
return false; return false;
} }
} }

View File

@ -21,7 +21,7 @@ export default class BallUiHandler extends UiHandler {
setup() { setup() {
const ui = this.getUi(); const ui = this.getUi();
this.pokeballSelectContainer = this.scene.add.container((this.scene.game.canvas.width / 6) - 115, -49); this.pokeballSelectContainer = this.scene.add.container((this.scene.game.canvas.width / 6) - 115, -49);
this.pokeballSelectContainer.setVisible(false); this.pokeballSelectContainer.setVisible(false);
ui.add(this.pokeballSelectContainer); ui.add(this.pokeballSelectContainer);

View File

@ -49,7 +49,7 @@ export default class BattleInfo extends Phaser.GameObjects.Container {
private type2Icon: Phaser.GameObjects.Sprite; private type2Icon: Phaser.GameObjects.Sprite;
private type3Icon: Phaser.GameObjects.Sprite; private type3Icon: Phaser.GameObjects.Sprite;
private expBar: Phaser.GameObjects.Image; private expBar: Phaser.GameObjects.Image;
public expMaskRect: Phaser.GameObjects.Graphics; public expMaskRect: Phaser.GameObjects.Graphics;
private statsContainer: Phaser.GameObjects.Container; private statsContainer: Phaser.GameObjects.Container;
@ -268,7 +268,7 @@ export default class BattleInfo extends Phaser.GameObjects.Container {
const opponentPokemonDexAttr = pokemon.getDexAttr(); const opponentPokemonDexAttr = pokemon.getDexAttr();
// Check if Player owns all genders and forms of the Pokemon // Check if Player owns all genders and forms of the Pokemon
const missingDexAttrs = ((dexEntry.caughtAttr & opponentPokemonDexAttr) < opponentPokemonDexAttr); const missingDexAttrs = ((dexEntry.caughtAttr & opponentPokemonDexAttr) < opponentPokemonDexAttr);
/** /**
* If the opposing Pokemon only has 1 normal ability and is using the hidden ability it should have the same behavior * If the opposing Pokemon only has 1 normal ability and is using the hidden ability it should have the same behavior
@ -377,7 +377,7 @@ export default class BattleInfo extends Phaser.GameObjects.Container {
if (boss !== this.boss) { if (boss !== this.boss) {
this.boss = boss; this.boss = boss;
[ this.nameText, this.genderText, this.teraIcon, this.splicedIcon, this.shinyIcon, this.ownedIcon, this.statusIndicator, this.levelContainer, this.statValuesContainer ].map(e => e.x += 48 * (boss ? -1 : 1)); [ this.nameText, this.genderText, this.teraIcon, this.splicedIcon, this.shinyIcon, this.ownedIcon, this.statusIndicator, this.levelContainer, this.statValuesContainer ].map(e => e.x += 48 * (boss ? -1 : 1));
this.hpBar.x += 38 * (boss ? -1 : 1); this.hpBar.x += 38 * (boss ? -1 : 1);
this.hpBar.y += 2 * (this.boss ? -1 : 1); this.hpBar.y += 2 * (this.boss ? -1 : 1);
@ -385,7 +385,7 @@ export default class BattleInfo extends Phaser.GameObjects.Container {
this.box.setTexture(this.getTextureName()); this.box.setTexture(this.getTextureName());
this.statsBox.setTexture(`${this.getTextureName()}_stats`); this.statsBox.setTexture(`${this.getTextureName()}_stats`);
} }
this.bossSegments = boss ? pokemon.bossSegments : 0; this.bossSegments = boss ? pokemon.bossSegments : 0;
this.updateBossSegmentDividers(pokemon); this.updateBossSegmentDividers(pokemon);
} }
@ -410,12 +410,12 @@ export default class BattleInfo extends Phaser.GameObjects.Container {
} }
} }
} }
setOffset(offset: boolean): void { setOffset(offset: boolean): void {
if (this.offset === offset) { if (this.offset === offset) {
return; return;
} }
this.offset = offset; this.offset = offset;
this.x += 10 * (offset === this.player ? 1 : -1); this.x += 10 * (offset === this.player ? 1 : -1);
@ -435,7 +435,7 @@ export default class BattleInfo extends Phaser.GameObjects.Container {
this.updateNameText(pokemon); this.updateNameText(pokemon);
this.genderText.setPositionRelative(this.nameText, this.nameText.displayWidth, 0); this.genderText.setPositionRelative(this.nameText, this.nameText.displayWidth, 0);
} }
const teraType = pokemon.getTeraType(); const teraType = pokemon.getTeraType();
const teraTypeUpdated = this.lastTeraType !== teraType; const teraTypeUpdated = this.lastTeraType !== teraType;
@ -461,7 +461,7 @@ export default class BattleInfo extends Phaser.GameObjects.Container {
this.statusIndicator.setFrame(StatusEffect[this.lastStatus].toLowerCase()); this.statusIndicator.setFrame(StatusEffect[this.lastStatus].toLowerCase());
} }
this.statusIndicator.setVisible(!!this.lastStatus); this.statusIndicator.setVisible(!!this.lastStatus);
if (!this.player && this.ownedIcon.visible) { if (!this.player && this.ownedIcon.visible) {
this.ownedIcon.setAlpha(this.statusIndicator.visible ? 0 : 1); this.ownedIcon.setAlpha(this.statusIndicator.visible ? 0 : 1);
} }
@ -543,7 +543,7 @@ export default class BattleInfo extends Phaser.GameObjects.Container {
? pokemon.summonData.battleStats ? pokemon.summonData.battleStats
: battleStatOrder.map(() => 0); : battleStatOrder.map(() => 0);
const battleStatsStr = battleStats.join(""); const battleStatsStr = battleStats.join("");
if (this.lastBattleStats !== battleStatsStr) { if (this.lastBattleStats !== battleStatsStr) {
this.updateBattleStats(battleStats); this.updateBattleStats(battleStats);
this.lastBattleStats = battleStatsStr; this.lastBattleStats = battleStatsStr;

View File

@ -84,7 +84,7 @@ export default class CandyBar extends Phaser.GameObjects.Container {
resolve(); resolve();
} }
}); });
this.setVisible(true); this.setVisible(true);
this.shown = true; this.shown = true;
}); });

View File

@ -56,7 +56,7 @@ export default class CharSprite extends Phaser.GameObjects.Container {
resolve(); resolve();
} }
}); });
this.setVisible(this.scene.textures.get(key).key !== Utils.MissingTextureKey); this.setVisible(this.scene.textures.get(key).key !== Utils.MissingTextureKey);
this.shown = true; this.shown = true;

View File

@ -27,11 +27,11 @@ export default class CommandUiHandler extends UiHandler {
setup() { setup() {
const ui = this.getUi(); const ui = this.getUi();
const commands = [ const commands = [
i18next.t("commandUiHandler:fight"), i18next.t("commandUiHandler:fight"),
i18next.t("commandUiHandler:ball"), i18next.t("commandUiHandler:ball"),
i18next.t("commandUiHandler:pokemon"), i18next.t("commandUiHandler:pokemon"),
i18next.t("commandUiHandler:run") i18next.t("commandUiHandler:run")
]; ];
this.commandsContainer = this.scene.add.container(216, -38.7); this.commandsContainer = this.scene.add.container(216, -38.7);
@ -77,7 +77,7 @@ export default class CommandUiHandler extends UiHandler {
const cursor = this.getCursor(); const cursor = this.getCursor();
if (button === Button.CANCEL || button === Button.ACTION) { if (button === Button.CANCEL || button === Button.ACTION) {
if (button === Button.ACTION) { if (button === Button.ACTION) {
switch (cursor) { switch (cursor) {
// Fight // Fight

View File

@ -42,7 +42,7 @@ export default class ConfirmUiHandler extends AbstractOptionSelectUiHandler {
}; };
super.show([ config ]); super.show([ config ]);
this.switchCheck = args.length >= 3 && args[2] !== null && args[2] as boolean; this.switchCheck = args.length >= 3 && args[2] !== null && args[2] as boolean;
const xOffset = (args.length >= 4 && args[3] !== null ? args[3] as number : 0); const xOffset = (args.length >= 4 && args[3] !== null ? args[3] as number : 0);

View File

@ -30,7 +30,7 @@ export class DailyRunScoreboard extends Phaser.GameObjects.Container {
private pageCount: integer; private pageCount: integer;
private page: integer; private page: integer;
private category: ScoreboardCategory; private category: ScoreboardCategory;
private _isUpdating: boolean; private _isUpdating: boolean;
constructor(scene: BattleScene, x: number, y: number) { constructor(scene: BattleScene, x: number, y: number) {
@ -165,13 +165,13 @@ export class DailyRunScoreboard extends Phaser.GameObjects.Container {
/** /**
* Updates the scoreboard rankings based on the selected category and page. * Updates the scoreboard rankings based on the selected category and page.
* *
* If the update process is already ongoing, the method exits early. Otherwise, it begins the update process by clearing * If the update process is already ongoing, the method exits early. Otherwise, it begins the update process by clearing
* the current rankings and showing a loading label. If the category changes, the page is reset to 1. * the current rankings and showing a loading label. If the category changes, the page is reset to 1.
* *
* The method fetches the total page count if necessary, followed by fetching the rankings for the specified category * The method fetches the total page count if necessary, followed by fetching the rankings for the specified category
* and page. It updates the UI with the fetched rankings or shows an appropriate message if no rankings are found. * and page. It updates the UI with the fetched rankings or shows an appropriate message if no rankings are found.
* *
* @param {ScoreboardCategory} [category=this.category] - The category to fetch rankings for. Defaults to the current category. * @param {ScoreboardCategory} [category=this.category] - The category to fetch rankings for. Defaults to the current category.
* @param {number} [page=this.page] - The page number to fetch. Defaults to the current page. * @param {number} [page=this.page] - The page number to fetch. Defaults to the current page.
*/ */
@ -209,7 +209,7 @@ export class DailyRunScoreboard extends Phaser.GameObjects.Container {
}).finally(() => { }).finally(() => {
this.isUpdating = false; this.isUpdating = false;
}); });
}).catch(err => { }).catch(err => {
console.error("Failed to load daily rankings:\n", err); console.error("Failed to load daily rankings:\n", err);
}); });
} }

View File

@ -213,13 +213,13 @@ export default class EggGachaUiHandler extends MessageUiHandler {
this.eggGachaOverlay = this.scene.add.rectangle(0, 0, bg.displayWidth, bg.displayHeight, 0x000000); this.eggGachaOverlay = this.scene.add.rectangle(0, 0, bg.displayWidth, bg.displayHeight, 0x000000);
this.eggGachaOverlay.setOrigin(0, 0); this.eggGachaOverlay.setOrigin(0, 0);
this.eggGachaOverlay.setAlpha(0); this.eggGachaOverlay.setAlpha(0);
this.eggGachaContainer.add(this.eggGachaOverlay); this.eggGachaContainer.add(this.eggGachaOverlay);
this.eggGachaSummaryContainer = this.scene.add.container(0, 0); this.eggGachaSummaryContainer = this.scene.add.container(0, 0);
this.eggGachaSummaryContainer.setVisible(false); this.eggGachaSummaryContainer.setVisible(false);
this.eggGachaContainer.add(this.eggGachaSummaryContainer); this.eggGachaContainer.add(this.eggGachaSummaryContainer);
const gachaMessageBoxContainer = this.scene.add.container(0, 148); const gachaMessageBoxContainer = this.scene.add.container(0, 148);
this.eggGachaContainer.add(gachaMessageBoxContainer); this.eggGachaContainer.add(gachaMessageBoxContainer);
@ -505,7 +505,7 @@ export default class EggGachaUiHandler extends MessageUiHandler {
if (!text) { if (!text) {
text = this.defaultText; text = this.defaultText;
} }
if (text?.indexOf("\n") === -1) { if (text?.indexOf("\n") === -1) {
this.eggGachaMessageBox.setSize(320, 32); this.eggGachaMessageBox.setSize(320, 32);
this.eggGachaMessageBox.setY(0); this.eggGachaMessageBox.setY(0);
@ -545,7 +545,7 @@ export default class EggGachaUiHandler extends MessageUiHandler {
return false; return false;
} }
} else { } else {
if (this.eggGachaSummaryContainer.visible) { if (this.eggGachaSummaryContainer.visible) {
if (button === Button.ACTION || button === Button.CANCEL) { if (button === Button.ACTION || button === Button.CANCEL) {
this.hideSummary(); this.hideSummary();
@ -646,7 +646,7 @@ export default class EggGachaUiHandler extends MessageUiHandler {
} }
} }
} }
if (success) { if (success) {
ui.playSelect(); ui.playSelect();
} else if (error) { } else if (error) {

View File

@ -158,7 +158,7 @@ export default class EggListUiHandler extends MessageUiHandler {
break; break;
} }
} }
if (success) { if (success) {
ui.playSelect(); ui.playSelect();
} else if (error) { } else if (error) {

View File

@ -55,7 +55,7 @@ export default class EvolutionSceneHandler extends MessageUiHandler {
show(_args: any[]): boolean { show(_args: any[]): boolean {
super.show(_args); super.show(_args);
this.scene.ui.bringToTop(this.evolutionContainer); this.scene.ui.bringToTop(this.evolutionContainer);
this.scene.ui.bringToTop(this.messageBg); this.scene.ui.bringToTop(this.messageBg);
this.scene.ui.bringToTop(this.messageContainer); this.scene.ui.bringToTop(this.messageContainer);
@ -97,4 +97,4 @@ export default class EvolutionSceneHandler extends MessageUiHandler {
this.messageContainer.setVisible(false); this.messageContainer.setVisible(false);
this.messageBg.setVisible(false); this.messageBg.setVisible(false);
} }
} }

View File

@ -102,7 +102,7 @@ export default class GameStatsUiHandler extends UiHandler {
setup() { setup() {
const ui = this.getUi(); const ui = this.getUi();
this.gameStatsContainer = this.scene.add.container(1, -(this.scene.game.canvas.height / 6) + 1); this.gameStatsContainer = this.scene.add.container(1, -(this.scene.game.canvas.height / 6) + 1);
this.gameStatsContainer.setInteractive(new Phaser.Geom.Rectangle(0, 0, this.scene.game.canvas.width / 6, this.scene.game.canvas.height / 6), Phaser.Geom.Rectangle.Contains); this.gameStatsContainer.setInteractive(new Phaser.Geom.Rectangle(0, 0, this.scene.game.canvas.width / 6, this.scene.game.canvas.height / 6), Phaser.Geom.Rectangle.Contains);
@ -156,9 +156,9 @@ export default class GameStatsUiHandler extends UiHandler {
super.show(args); super.show(args);
this.setCursor(0); this.setCursor(0);
this.updateStats(); this.updateStats();
this.gameStatsContainer.setVisible(true); this.gameStatsContainer.setVisible(true);
this.getUi().moveTo(this.gameStatsContainer, this.getUi().length - 1); this.getUi().moveTo(this.gameStatsContainer, this.getUi().length - 1);

View File

@ -54,7 +54,7 @@ export default class MenuUiHandler extends MessageUiHandler {
setup() { setup() {
const ui = this.getUi(); const ui = this.getUi();
this.menuContainer = this.scene.add.container(1, -(this.scene.game.canvas.height / 6) + 1); this.menuContainer = this.scene.add.container(1, -(this.scene.game.canvas.height / 6) + 1);
this.menuContainer.setInteractive(new Phaser.Geom.Rectangle(0, 0, this.scene.game.canvas.width / 6, this.scene.game.canvas.height / 6), Phaser.Geom.Rectangle.Contains); this.menuContainer.setInteractive(new Phaser.Geom.Rectangle(0, 0, this.scene.game.canvas.width / 6, this.scene.game.canvas.height / 6), Phaser.Geom.Rectangle.Contains);
@ -65,7 +65,7 @@ export default class MenuUiHandler extends MessageUiHandler {
this.optionSelectText = addTextObject(this.scene, 0, 0, this.menuOptions.map(o => `${i18next.t(`menuUiHandler:${MenuOptions[o]}`)}`).join("\n"), TextStyle.WINDOW, { maxLines: this.menuOptions.length }); this.optionSelectText = addTextObject(this.scene, 0, 0, this.menuOptions.map(o => `${i18next.t(`menuUiHandler:${MenuOptions[o]}`)}`).join("\n"), TextStyle.WINDOW, { maxLines: this.menuOptions.length });
this.optionSelectText.setLineSpacing(12); this.optionSelectText.setLineSpacing(12);
this.menuBg = addWindow(this.scene, (this.scene.game.canvas.width / 6) - (this.optionSelectText.displayWidth + 25), 0, this.optionSelectText.displayWidth + 23, (this.scene.game.canvas.height / 6) - 2); this.menuBg = addWindow(this.scene, (this.scene.game.canvas.width / 6) - (this.optionSelectText.displayWidth + 25), 0, this.optionSelectText.displayWidth + 23, (this.scene.game.canvas.height / 6) - 2);
this.menuBg.setOrigin(0, 0); this.menuBg.setOrigin(0, 0);

View File

@ -56,7 +56,7 @@ export default abstract class MessageUiHandler extends AwaitableUiHandler {
let newText = ""; let newText = "";
for (let w = 0; w < textWords.length; w++) { for (let w = 0; w < textWords.length; w++) {
const nextWordText = newText ? `${newText} ${textWords[w]}` : textWords[w]; const nextWordText = newText ? `${newText} ${textWords[w]}` : textWords[w];
if (textWords[w].includes("\n")) { if (textWords[w].includes("\n")) {
newText = nextWordText; newText = nextWordText;
lastLineCount++; lastLineCount++;

View File

@ -39,7 +39,7 @@ export abstract class ModalUiHandler extends UiHandler {
setup() { setup() {
const ui = this.getUi(); const ui = this.getUi();
this.modalContainer = this.scene.add.container(0, 0); this.modalContainer = this.scene.add.container(0, 0);
this.modalContainer.setInteractive(new Phaser.Geom.Rectangle(0, 0, this.scene.game.canvas.width / 6, this.scene.game.canvas.height / 6), Phaser.Geom.Rectangle.Contains); this.modalContainer.setInteractive(new Phaser.Geom.Rectangle(0, 0, this.scene.game.canvas.width / 6, this.scene.game.canvas.height / 6), Phaser.Geom.Rectangle.Contains);
@ -106,7 +106,7 @@ export abstract class ModalUiHandler extends UiHandler {
updateContainer(config?: ModalConfig): void { updateContainer(config?: ModalConfig): void {
const [ marginTop, marginRight, marginBottom, marginLeft ] = this.getMargin(config); const [ marginTop, marginRight, marginBottom, marginLeft ] = this.getMargin(config);
const [ width, height ] = [ this.getWidth(config), this.getHeight(config) ]; const [ width, height ] = [ this.getWidth(config), this.getHeight(config) ];
this.modalContainer.setPosition((((this.scene.game.canvas.width / 6) - (width + (marginRight - marginLeft))) / 2), (((-this.scene.game.canvas.height / 6) - (height + (marginBottom - marginTop))) / 2)); this.modalContainer.setPosition((((this.scene.game.canvas.width / 6) - (width + (marginRight - marginLeft))) / 2), (((-this.scene.game.canvas.height / 6) - (height + (marginBottom - marginTop))) / 2));

View File

@ -36,7 +36,7 @@ export default class ModifierSelectUiHandler extends AwaitableUiHandler {
setup() { setup() {
const ui = this.getUi(); const ui = this.getUi();
this.modifierContainer = this.scene.add.container(0, 0); this.modifierContainer = this.scene.add.container(0, 0);
ui.add(this.modifierContainer); ui.add(this.modifierContainer);
@ -112,7 +112,7 @@ export default class ModifierSelectUiHandler extends AwaitableUiHandler {
? getPlayerShopModifierTypeOptionsForWave(this.scene.currentBattle.waveIndex, this.scene.getWaveMoneyAmount(1)) ? getPlayerShopModifierTypeOptionsForWave(this.scene.currentBattle.waveIndex, this.scene.getWaveMoneyAmount(1))
: []; : [];
const optionsYOffset = shopTypeOptions.length >= SHOP_OPTIONS_ROW_LIMIT ? -8 : -24; const optionsYOffset = shopTypeOptions.length >= SHOP_OPTIONS_ROW_LIMIT ? -8 : -24;
for (let m = 0; m < typeOptions.length; m++) { for (let m = 0; m < typeOptions.length; m++) {
const sliceWidth = (this.scene.game.canvas.width / 6) / (typeOptions.length + 2); const sliceWidth = (this.scene.game.canvas.width / 6) / (typeOptions.length + 2);
const option = new ModifierOption(this.scene, sliceWidth * (m + 1) + (sliceWidth * 0.5), -this.scene.game.canvas.height / 12 + optionsYOffset, typeOptions[m]); const option = new ModifierOption(this.scene, sliceWidth * (m + 1) + (sliceWidth * 0.5), -this.scene.game.canvas.height / 12 + optionsYOffset, typeOptions[m]);
@ -144,7 +144,7 @@ export default class ModifierSelectUiHandler extends AwaitableUiHandler {
this.scene.updateAndShowLuckText(750); this.scene.updateAndShowLuckText(750);
let i = 0; let i = 0;
this.scene.tweens.addCounter({ this.scene.tweens.addCounter({
ease: "Sine.easeIn", ease: "Sine.easeIn",
duration: 1250, duration: 1250,
@ -382,7 +382,7 @@ export default class ModifierSelectUiHandler extends AwaitableUiHandler {
const options = this.options.concat(this.shopOptionsRows.flat()); const options = this.options.concat(this.shopOptionsRows.flat());
this.options.splice(0, this.options.length); this.options.splice(0, this.options.length);
this.shopOptionsRows.splice(0, this.shopOptionsRows.length); this.shopOptionsRows.splice(0, this.shopOptionsRows.length);
this.scene.tweens.add({ this.scene.tweens.add({
targets: options, targets: options,
scale: 0.01, scale: 0.01,
@ -390,7 +390,7 @@ export default class ModifierSelectUiHandler extends AwaitableUiHandler {
ease: "Cubic.easeIn", ease: "Cubic.easeIn",
onComplete: () => options.forEach(o => o.destroy()) onComplete: () => options.forEach(o => o.destroy())
}); });
[ this.rerollButtonContainer, this.transferButtonContainer, this.lockRarityButtonContainer ].forEach(container => { [ this.rerollButtonContainer, this.transferButtonContainer, this.lockRarityButtonContainer ].forEach(container => {
if (container.visible) { if (container.visible) {
this.scene.tweens.add({ this.scene.tweens.add({
@ -479,7 +479,7 @@ class ModifierOption extends Phaser.GameObjects.Container {
if (this.modifierTypeOption.cost) { if (this.modifierTypeOption.cost) {
this.itemCostText = addTextObject(this.scene, 0, 45, "", TextStyle.MONEY, { align: "center" }); this.itemCostText = addTextObject(this.scene, 0, 45, "", TextStyle.MONEY, { align: "center" });
this.itemCostText.setOrigin(0.5, 0); this.itemCostText.setOrigin(0.5, 0);
this.itemCostText.setAlpha(0); this.itemCostText.setAlpha(0);
this.add(this.itemCostText); this.add(this.itemCostText);
@ -559,7 +559,7 @@ class ModifierOption extends Phaser.GameObjects.Container {
if (!this.modifierTypeOption.cost) { if (!this.modifierTypeOption.cost) {
this.pb.setTexture("pb", `${this.getPbAtlasKey(0)}_open`); this.pb.setTexture("pb", `${this.getPbAtlasKey(0)}_open`);
(this.scene as BattleScene).playSound("pb_rel"); (this.scene as BattleScene).playSound("pb_rel");
this.scene.tweens.add({ this.scene.tweens.add({
targets: this.pb, targets: this.pb,
duration: 500, duration: 500,

View File

@ -37,7 +37,7 @@ export default class PartyExpBar extends Phaser.GameObjects.Container {
this.pokemonIcon = (this.scene as BattleScene).addPokemonIcon(pokemon, -8, 15, 0, 0.5); this.pokemonIcon = (this.scene as BattleScene).addPokemonIcon(pokemon, -8, 15, 0, 0.5);
this.pokemonIcon.setScale(0.5); this.pokemonIcon.setScale(0.5);
this.add(this.pokemonIcon); this.add(this.pokemonIcon);
// if we want to only display the level in the small frame // if we want to only display the level in the small frame
@ -70,7 +70,7 @@ export default class PartyExpBar extends Phaser.GameObjects.Container {
resolve(); resolve();
} }
}); });
this.setVisible(true); this.setVisible(true);
this.shown = true; this.shown = true;
}); });

View File

@ -87,7 +87,7 @@ export default class PartyUiHandler extends MessageUiHandler {
private transferMode: boolean; private transferMode: boolean;
private transferOptionCursor: integer; private transferOptionCursor: integer;
private transferCursor: integer; private transferCursor: integer;
private lastCursor: integer = 0; private lastCursor: integer = 0;
private selectCallback: PartySelectCallback | PartyModifierTransferSelectCallback; private selectCallback: PartySelectCallback | PartyModifierTransferSelectCallback;
private selectFilter: PokemonSelectFilter | PokemonModifierTransferSelectFilter; private selectFilter: PokemonSelectFilter | PokemonModifierTransferSelectFilter;
@ -158,7 +158,7 @@ export default class PartyUiHandler extends MessageUiHandler {
this.partyMessageBox = partyMessageBox; this.partyMessageBox = partyMessageBox;
const partyMessageText = addTextObject(this.scene, 8, 10, defaultMessage, TextStyle.WINDOW, { maxLines: 2 }); const partyMessageText = addTextObject(this.scene, 8, 10, defaultMessage, TextStyle.WINDOW, { maxLines: 2 });
partyMessageText.setOrigin(0, 0); partyMessageText.setOrigin(0, 0);
partyMessageBoxContainer.add(partyMessageText); partyMessageBoxContainer.add(partyMessageText);
@ -403,7 +403,7 @@ export default class PartyUiHandler extends MessageUiHandler {
ui.playSelect(); ui.playSelect();
} }
} }
return true; return true;
} }
@ -463,10 +463,10 @@ export default class PartyUiHandler extends MessageUiHandler {
} }
} }
} }
setCursor(cursor: integer): boolean { setCursor(cursor: integer): boolean {
let changed: boolean; let changed: boolean;
if (this.optionsMode) { if (this.optionsMode) {
changed = this.optionsCursor !== cursor; changed = this.optionsCursor !== cursor;
let isScroll = false; let isScroll = false;
@ -544,7 +544,7 @@ export default class PartyUiHandler extends MessageUiHandler {
if (this.cursor === 6) { if (this.cursor === 6) {
return; return;
} }
this.optionsMode = true; this.optionsMode = true;
let optionsMessage = "Do what with this Pokémon?"; let optionsMessage = "Do what with this Pokémon?";
@ -880,7 +880,7 @@ class PartySlot extends Phaser.GameObjects.Container {
this.slotIndex = slotIndex; this.slotIndex = slotIndex;
this.pokemon = pokemon; this.pokemon = pokemon;
this.iconAnimHandler = iconAnimHandler; this.iconAnimHandler = iconAnimHandler;
this.setup(partyUiMode, tmMoveId); this.setup(partyUiMode, tmMoveId);
} }
@ -989,7 +989,7 @@ class PartySlot extends Phaser.GameObjects.Container {
fusionShinyStar.setOrigin(0, 0); fusionShinyStar.setOrigin(0, 0);
fusionShinyStar.setPosition(shinyStar.x, shinyStar.y); fusionShinyStar.setPosition(shinyStar.x, shinyStar.y);
fusionShinyStar.setTint(getVariantTint(this.pokemon.fusionVariant)); fusionShinyStar.setTint(getVariantTint(this.pokemon.fusionVariant));
slotInfoContainer.add(fusionShinyStar); slotInfoContainer.add(fusionShinyStar);
} }
} }

Some files were not shown because too many files have changed in this diff Show More