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
"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
"@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();
initMoves();
initAbilities();
this.phaseQueue = [];
this.phaseQueuePrepend = [];
this.phaseQueuePrependSpliceIndex = -1;
@ -553,17 +553,17 @@ export default class BattleScene extends SceneBase {
const species = getPokemonSpecies(parseInt(s));
loadPokemonAssets.push(species.loadAssets(this, false, 0, false));
}
Promise.all(loadPokemonAssets).then(() => {
const starterCandyColors = {};
const rgbaToHexFunc = (r, g, b) => [r, g, b].map(x => x.toString(16).padStart(2, '0')).join('');
for (let s of Object.keys(speciesStarters)) {
const species = getPokemonSpecies(parseInt(s));
starterCandyColors[species.speciesId] = species.generateCandyColors(this).map(c => rgbaToHexFunc(c[0], c[1], c[2]));
}
console.log(JSON.stringify(starterCandyColors));
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 {
const container = this.add.container(x, y);
const icon = this.add.sprite(0, 0, pokemon.getIconAtlasKey(ignoreOverride));
icon.setFrame(pokemon.getIconId(true));
// 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 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
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.setSeed(Overrides.SEED_OVERRIDE || Utils.randomString(24));
console.log("Seed:", this.seed);
@ -789,7 +789,7 @@ export default class BattleScene extends SceneBase {
for (const p of this.getEnemyParty()) {
p.destroy();
}
this.currentBattle = null;
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.setPosition(406, 186);
this.trainer.setVisible(true);
this.updateGameInfo();
if (reloadI18n) {
@ -865,7 +865,7 @@ export default class BattleScene extends SceneBase {
this.resetSeed(newWaveIndex);
const playerField = this.getPlayerField();
if (this.gameMode.hasFixedBattles && fixedBattles.hasOwnProperty(newWaveIndex) && trainerData === undefined) {
battleConfig = fixedBattles[newWaveIndex];
newDouble = battleConfig.double;
@ -986,7 +986,7 @@ export default class BattleScene extends SceneBase {
}
}
}
return this.currentBattle;
}
@ -1157,7 +1157,7 @@ export default class BattleScene extends SceneBase {
if (!pokemon.pokerus || infectedIndexes.indexOf(p) > -1) {
return;
}
this.executeWithSeedOffset(() => {
if (p) {
spread(p, -1);
@ -1622,7 +1622,7 @@ export default class BattleScene extends SceneBase {
this.currentPhase = this.phaseQueue.shift();
this.currentPhase.start();
}
overridePhase(phase: Phase): boolean {
if (this.standbyPhase) {
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);
return this.addModifier(defaultModifierType.newModifier(), ignoreUpdate, playSound, false, instant).then(success => resolve(success));
}
for (const rm of modifiersToRemove) {
this.removeModifier(rm);
}
@ -1750,7 +1750,7 @@ export default class BattleScene extends SceneBase {
} else if (modifier instanceof FusePokemonModifier) {
args.push(this.getPokemonById(modifier.fusePokemonId) as PlayerPokemon);
}
if (modifier.shouldApply(args)) {
const result = modifier.apply(args);
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));
} else {
const args = [ this ];
@ -2109,7 +2109,7 @@ export default class BattleScene extends SceneBase {
return false;
}
updateGameInfo(): void {
const gameInfo = {
playTime: this.sessionPlayTime ? this.sessionPlayTime : 0,

View File

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

View File

@ -68,10 +68,10 @@ export class Ability implements Localizable {
const attr = new AttrType(...args);
attr.addCondition(condition);
this.attrs.push(attr);
return this;
}
hasAttr(attrType: { new(...args: any[]): AbAttr }): boolean {
return !!this.getAttrs(attrType).length;
}
@ -117,7 +117,7 @@ export abstract class AbAttr {
constructor(showAbility: boolean = true) {
this.showAbility = showAbility;
}
apply(pokemon: Pokemon, passive: boolean, cancelled: Utils.BooleanHolder, args: any[]): boolean | Promise<boolean> {
return false;
}
@ -218,7 +218,7 @@ export class PostBattleInitStatChangeAbAttr extends PostBattleInitAbAttr {
pokemon.scene.unshiftPhase(statChangePhase);
}
}
return true;
}
}
@ -257,7 +257,7 @@ export class PreDefendFullHpEndureAbAttr extends PreDefendAbAttr {
(args[0] as Utils.NumberHolder).value >= pokemon.hp){ //Damage >= hp
return pokemon.addTag(BattlerTagType.STURDY, 1);
}
return false;
}
}
@ -265,7 +265,7 @@ export class PreDefendFullHpEndureAbAttr extends PreDefendAbAttr {
export class BlockItemTheftAbAttr extends AbAttr {
apply(pokemon: Pokemon, passive: boolean, cancelled: Utils.BooleanHolder, args: any[]): boolean {
cancelled.value = true;
return true;
}
@ -280,7 +280,7 @@ export class StabBoostAbAttr extends AbAttr {
(args[0] as Utils.NumberHolder).value += 0.5;
return true;
}
return false;
}
}
@ -371,7 +371,7 @@ export class TypeImmunityHealAbAttr extends TypeImmunityAbAttr {
}
return true;
}
return false;
}
}
@ -397,7 +397,7 @@ class TypeImmunityStatChangeAbAttr extends TypeImmunityAbAttr {
pokemon.scene.unshiftPhase(new StatChangePhase(pokemon.scene, pokemon.getBattlerIndex(), true, [ this.stat ], this.levels));
}
}
return ret;
}
}
@ -423,7 +423,7 @@ class TypeImmunityAddBattlerTagAbAttr extends TypeImmunityAbAttr {
pokemon.addTag(this.tagType, this.turnCount, undefined, pokemon.id);
}
}
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 {
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);
if (!recoilDamage) {
return false;
@ -498,7 +498,7 @@ export class FieldPriorityMoveImmunityAbAttr extends PreDefendAbAttr {
const attackPriority = new Utils.IntegerHolder(move.getMove().priority);
applyMoveAttrs(IncrementMovePriorityAttr,attacker,null,move.getMove(),attackPriority);
applyAbAttrs(IncrementMovePriorityAbAttr, attacker, null, move.getMove(), attackPriority);
if(move.getMove().moveTarget===MoveTarget.USER) {
return false;
}
@ -507,7 +507,7 @@ export class FieldPriorityMoveImmunityAbAttr extends PreDefendAbAttr {
cancelled.value = true;
return true;
}
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 {
pokemon.scene.unshiftPhase(new StatChangePhase(pokemon.scene, pokemon.getBattlerIndex(), true, [ this.stat ], this.levels));
return true;
}
@ -799,14 +799,14 @@ export class PostDefendContactDamageAbAttr extends PostDefendAbAttr {
this.damageRatio = damageRatio;
}
applyPostDefend(pokemon: Pokemon, passive: boolean, attacker: Pokemon, move: PokemonMove, hitResult: HitResult, args: any[]): boolean {
if (move.getMove().checkFlag(MoveFlags.MAKES_CONTACT, attacker, pokemon)) {
attacker.damageAndUpdate(Math.ceil(attacker.getMaxHp() * (1 / this.damageRatio)), HitResult.OTHER);
attacker.turnData.damageTaken += Math.ceil(attacker.getMaxHp() * (1 / this.damageRatio));
return true;
}
return false;
}
@ -837,7 +837,7 @@ export class PostDefendAbilitySwapAbAttr extends PostDefendAbAttr {
constructor() {
super();
}
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)) {
const tempAbilityId = attacker.getAbility().id;
@ -845,7 +845,7 @@ export class PostDefendAbilitySwapAbAttr extends PostDefendAbAttr {
pokemon.summonData.ability = tempAbilityId;
return true;
}
return false;
}
@ -861,14 +861,14 @@ export class PostDefendAbilityGiveAbAttr extends PostDefendAbAttr {
super();
this.ability = ability;
}
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)) {
attacker.summonData.ability = this.ability;
return true;
}
return false;
}
@ -887,7 +887,7 @@ export class PostDefendMoveDisableAbAttr extends PostDefendAbAttr {
this.chance = chance;
}
applyPostDefend(pokemon: Pokemon, passive: boolean, attacker: Pokemon, move: PokemonMove, hitResult: HitResult, args: any[]): boolean {
if (!attacker.summonData.disabledMove) {
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 {
apply(pokemon: Pokemon, passive: boolean, cancelled: Utils.BooleanHolder, args: any[]): boolean {
//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;
return true;
}
return false;
}
}
@ -1008,8 +1008,8 @@ export class MoveTypeChangeAttr extends PreAttackAbAttr {
/**
* Class for abilities that boost the damage of moves
* For abilities that boost the base power of moves, see VariableMovePowerAbAttr
* @param damageMultiplier the amount to multiply the damage by
* @param condition the condition for this ability to be applied
* @param damageMultiplier the amount to multiply the damage by
* @param condition the condition for this ability to be applied
*/
export class DamageBoostAbAttr extends PreAttackAbAttr {
private damageMultiplier: number;
@ -1022,7 +1022,7 @@ export class DamageBoostAbAttr extends PreAttackAbAttr {
}
/**
*
*
* @param pokemon the attacker pokemon
* @param passive N/A
* @param defender the target pokemon
@ -1081,7 +1081,7 @@ export class LowHpMoveTypePowerBoostAbAttr extends MoveTypePowerBoostAbAttr {
export class FieldVariableMovePowerAbAttr extends AbAttr {
applyPreAttack(pokemon: Pokemon, passive: boolean, defender: Pokemon, move: PokemonMove, args: any[]): boolean {
//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 effects: BattlerTagType[];
constructor(contactRequired: boolean, chance: (user: Pokemon, target: Pokemon, move: PokemonMove) => integer, ...effects: BattlerTagType[]) {
super();
@ -1287,7 +1287,7 @@ class PostVictoryStatChangeAbAttr extends PostVictoryAbAttr {
? this.stat(pokemon)
: this.stat;
pokemon.scene.unshiftPhase(new StatChangePhase(pokemon.scene, pokemon.getBattlerIndex(), true, [ stat ], this.levels));
return true;
}
}
@ -1334,7 +1334,7 @@ export class PostKnockOutStatChangeAbAttr extends PostKnockOutAbAttr {
? this.stat(pokemon)
: this.stat;
pokemon.scene.unshiftPhase(new StatChangePhase(pokemon.scene, pokemon.getBattlerIndex(), true, [ stat ], this.levels));
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!`));
return true;
}
return false;
}
}
@ -1366,7 +1366,7 @@ export class IgnoreOpponentStatChangesAbAttr extends AbAttr {
return true;
}
}
/**
/**
* Ignores opponent's evasion stat changes when determining if a move hits or not
* @extends AbAttr
* @see {@linkcode apply}
@ -1382,14 +1382,14 @@ export class IgnoreOpponentEvasionAbAttr extends AbAttr {
* @param cancelled N/A
* @param args [0] {@linkcode Utils.IntegerHolder} of BattleStat.EVA
* @returns if evasion level was successfully considered as 0
*/
*/
apply(pokemon: Pokemon, passive: boolean, cancelled: Utils.BooleanHolder, args: any[]) {
(args[0] as Utils.IntegerHolder).value = 0;
return true;
}
}
export class IntimidateImmunityAbAttr extends AbAttr {
export class IntimidateImmunityAbAttr extends AbAttr {
constructor() {
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 levels: integer;
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
private message: string;
@ -1455,7 +1455,7 @@ export class PostSummonUnnamedMessageAbAttr extends PostSummonAbAttr {
this.message = message;
}
applyPostSummon(pokemon: Pokemon, passive: boolean, args: any[]): boolean {
applyPostSummon(pokemon: Pokemon, passive: boolean, args: any[]): boolean {
pokemon.scene.queueMessage(this.message);
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));
return true;
}
return false;
}
}
@ -1563,7 +1563,7 @@ export class PostSummonClearAllyStatsAbAttr extends PostSummonAbAttr {
return true;
}
return false;
}
}
@ -1576,12 +1576,12 @@ export class DownloadAbAttr extends PostSummonAbAttr {
applyPostSummon(pokemon: Pokemon, passive: boolean, args: any[]): boolean {
this.enemyDef = 0;
this.enemySpDef = 0;
for (const opponent of pokemon.getOpponents()) {
this.enemyDef += opponent.stats[BattleStat.DEF];
this.enemySpDef += opponent.stats[BattleStat.SPDEF];
}
if (this.enemyDef < this.enemySpDef) {
this.stats = [BattleStat.ATK];
} else {
@ -1592,7 +1592,7 @@ export class DownloadAbAttr extends PostSummonAbAttr {
pokemon.scene.unshiftPhase(new StatChangePhase(pokemon.scene, pokemon.getBattlerIndex(), false, this.stats, 1));
return true;
}
return false;
}
}
@ -1654,7 +1654,7 @@ export class TraceAbAttr extends PostSummonAbAttr {
if (!targets.length) {
return false;
}
let target: Pokemon;
if (targets.length > 1) {
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.moveset = target.getMoveset().map(m => new PokemonMove(m.moveId, m.ppUsed, m.ppUp));
pokemon.summonData.types = target.getTypes();
pokemon.scene.playSound("PRSFX- Transform");
pokemon.loadAssets(false).then(() => pokemon.playAnim());
@ -1768,7 +1768,7 @@ export class ProtectStatAbAttr extends PreStatChangeAbAttr {
cancelled.value = true;
return true;
}
return false;
}
@ -1885,7 +1885,7 @@ export class ConditionalCritAbAttr extends AbAttr {
/**
* @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.
* [2] {@linkcode Move} used by ability user.
*/
@ -1930,7 +1930,7 @@ export class IncrementMovePriorityAbAttr extends AbAttr {
if (!this.moveIncrementFunc(pokemon, args[0] as Move)) {
return false;
}
(args[1] as Utils.IntegerHolder).value += this.increaseAmount;
return true;
}
@ -2013,7 +2013,7 @@ function getAnticipationCondition(): AbAttrCondition {
+(opponent.ivs[Stat.SPD] & 1) * 8
+(opponent.ivs[Stat.SPATK] & 1) * 16
+(opponent.ivs[Stat.SPDEF] & 1) * 32) * 15/63);
const type = [
Type.FIGHTING, Type.FLYING, Type.POISON, Type.GROUND,
Type.ROCK, Type.BUG, Type.GHOST, Type.STEEL,
@ -2065,10 +2065,10 @@ export class ForewarnAbAttr extends PostSummonAbAttr {
} else {
movePower = move.getMove().power;
}
if (movePower > maxPowerSeen) {
maxPowerSeen = movePower;
maxMove = move.getName();
maxMove = move.getName();
}
}
}
@ -2142,7 +2142,7 @@ export class PostWeatherLapseHealAbAttr extends PostWeatherLapseAbAttr {
constructor(healFactor: integer, ...weatherTypes: WeatherType[]) {
super(...weatherTypes);
this.healFactor = healFactor;
}
@ -2164,7 +2164,7 @@ export class PostWeatherLapseDamageAbAttr extends PostWeatherLapseAbAttr {
constructor(damageFactor: integer, ...weatherTypes: WeatherType[]) {
super(...weatherTypes);
this.damageFactor = damageFactor;
}
@ -2242,13 +2242,13 @@ export class PostTurnResetStatusAbAttr extends PostTurnAbAttr {
this.target = pokemon;
}
if (this.target?.status) {
this.target.scene.queueMessage(getPokemonMessage(this.target, getStatusEffectHealText(this.target.status?.effect)));
this.target.resetStatus(false);
this.target.updateInfo();
return true;
}
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)
* @param {Pokemon} pokemon Pokemon that has this ability
* @param {Pokemon} pokemon Pokemon that has this ability
* @param {boolean} passive N/A
* @param {any[]} args N/A
* @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}`}));
hadEffect = true;
}
}
return hadEffect;
}
}
/**
* Grabs the last failed Pokeball used
* @extends PostTurnAbAttr
/**
* Grabs the last failed Pokeball used
* @extends PostTurnAbAttr
* @see {@linkcode applyPostTurn} */
export class FetchBallAbAttr extends PostTurnAbAttr {
constructor() {
super();
}
/**
* Adds the last used Pokeball back into the player's inventory
* @param pokemon {@linkcode Pokemon} with this ability
* @param passive N/A
* @param args N/A
* @returns true if player has used a pokeball and this pokemon is owned by the player
/**
* Adds the last used Pokeball back into the player's inventory
* @param pokemon {@linkcode Pokemon} with this ability
* @param passive N/A
* @param args N/A
* @returns true if player has used a pokeball and this pokemon is owned by the player
*/
applyPostTurn(pokemon: Pokemon, passive: boolean, args: any[]): boolean {
const lastUsed = pokemon.scene.currentBattle.lastUsedPokeball;
@ -2630,7 +2630,7 @@ export class PostFaintAbAttr extends AbAttr {
export class PostFaintContactDamageAbAttr extends PostFaintAbAttr {
private damageRatio: integer;
constructor(damageRatio: integer) {
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.
*/
export class PostFaintHPDamageAbAttr extends PostFaintAbAttr {
@ -2670,7 +2670,7 @@ export class PostFaintHPDamageAbAttr extends PostFaintAbAttr {
attacker.damageAndUpdate((damage), HitResult.OTHER);
attacker.turnData.damageTaken += damage;
return true;
}
}
getTriggerMessage(pokemon: Pokemon, abilityName: string, ...args: any[]): string {
return getPokemonMessage(pokemon, `'s ${abilityName} hurt\nits attacker!`);
@ -2690,7 +2690,7 @@ export class RedirectMoveAbAttr extends AbAttr {
return false;
}
canRedirect(moveId: Moves): boolean {
const move = allMoves[moveId];
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 },
pokemon: Pokemon, knockedOut: Pokemon, ...args: any[]): Promise<void> {
return applyAbAttrsInternal<PostKnockOutAbAttr>(attrType, pokemon, (attr, passive) => attr.applyPostKnockOut(pokemon, passive, knockedOut, args), args);
}
}
export function applyPostVictoryAbAttrs(attrType: { new(...args: any[]): PostVictoryAbAttr },
pokemon: Pokemon, ...args: any[]): Promise<void> {
@ -3133,7 +3133,7 @@ export function initAbilities() {
new Ability(Abilities.BATTLE_ARMOR, 3)
.attr(BlockCritAbAttr)
.ignorable(),
new Ability(Abilities.STURDY, 3)
new Ability(Abilities.STURDY, 3)
.attr(PreDefendFullHpEndureAbAttr)
.attr(BlockOneHitKOAbAttr)
.ignorable(),
@ -3185,7 +3185,7 @@ export function initAbilities() {
.attr(IntimidateImmunityAbAttr)
.ignorable(),
new Ability(Abilities.SUCTION_CUPS, 3)
.attr(ForceSwitchOutImmunityAbAttr)
.attr(ForceSwitchOutImmunityAbAttr)
.ignorable(),
new Ability(Abilities.INTIMIDATE, 3)
.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, BattleStatMultiplierAbAttr, BattleStat.SPD, 1.5),
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),
new Ability(Abilities.SNIPER, 4)
.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),
new Ability(Abilities.HARVEST, 5)
.attr(
PostTurnLootAbAttr,
"EATEN_BERRIES",
PostTurnLootAbAttr,
"EATEN_BERRIES",
/** 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)
)
@ -4034,7 +4034,7 @@ export function initAbilities() {
.attr(PostDefendApplyArenaTrapTagAbAttr, (target, user, move) => move.category === MoveCategory.PHYSICAL, ArenaTagType.TOXIC_SPIKES)
.bypassFaint(),
new Ability(Abilities.ARMOR_TAIL, 9)
.attr(FieldPriorityMoveImmunityAbAttr)
.attr(FieldPriorityMoveImmunityAbAttr)
.ignorable(),
new Ability(Abilities.EARTH_EATER, 9)
.attr(TypeImmunityHealAbAttr, Type.GROUND)

View File

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

View File

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

View File

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

View File

@ -41,7 +41,7 @@ export function getBattleStatLevelChangeDescription(levels: integer, up: boolean
case 4:
case 5:
case 6:
return "rose drastically";
return "rose drastically";
default:
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.getCurrentPhase() as MovePhase).cancel();
pokemon.getMoveQueue().shift();
return true;
}
}
@ -115,7 +115,7 @@ export class TrappedTag extends BattlerTag {
constructor(tagType: BattlerTagType, lapseType: BattlerTagLapseType, turnCount: integer, sourceMove: Moves, sourceId: integer) {
super(tagType, lapseType, turnCount, sourceMove, sourceId);
}
canAdd(pokemon: Pokemon): boolean {
const isGhost = pokemon.isOfType(Type.GHOST);
const isTrapped = pokemon.getTag(BattlerTagType.TRAPPED);
@ -196,7 +196,7 @@ export class InterruptedTag extends BattlerTag {
lapse(pokemon: Pokemon, lapseType: BattlerTagLapseType): boolean {
super.lapse(pokemon, lapseType);
(pokemon.scene.getCurrentPhase() as MovePhase).cancel();
return true;
return true;
}
}
@ -211,14 +211,14 @@ export class ConfusedTag extends BattlerTag {
onAdd(pokemon: Pokemon): void {
super.onAdd(pokemon);
pokemon.scene.unshiftPhase(new CommonAnimPhase(pokemon.scene, pokemon.getBattlerIndex(), undefined, CommonAnim.CONFUSION));
pokemon.scene.queueMessage(getPokemonMessage(pokemon, " became\nconfused!"));
}
onRemove(pokemon: Pokemon): void {
super.onRemove(pokemon);
pokemon.scene.queueMessage(getPokemonMessage(pokemon, " snapped\nout of confusion!"));
}
@ -245,7 +245,7 @@ export class ConfusedTag extends BattlerTag {
(pokemon.scene.getCurrentPhase() as MovePhase).cancel();
}
}
return ret;
}
@ -265,7 +265,7 @@ export class InfatuatedTag extends BattlerTag {
onAdd(pokemon: Pokemon): void {
super.onAdd(pokemon);
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();
}
}
return ret;
}
@ -328,7 +328,7 @@ export class SeedTag extends BattlerTag {
onAdd(pokemon: Pokemon): void {
super.onAdd(pokemon);
pokemon.scene.queueMessage(getPokemonMessage(pokemon, " was seeded!"));
this.sourceIndex = pokemon.scene.getPokemonById(this.sourceId).getBattlerIndex();
}
@ -354,7 +354,7 @@ export class SeedTag extends BattlerTag {
}
}
}
return ret;
}
@ -370,7 +370,7 @@ export class NightmareTag extends BattlerTag {
onAdd(pokemon: Pokemon): void {
super.onAdd(pokemon);
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));
}
}
return ret;
}
@ -441,12 +441,12 @@ export class EncoreTag extends BattlerTag {
if (pokemon.isMax()) {
return false;
}
const lastMoves = pokemon.getLastXMoves(1);
if (!lastMoves.length) {
return false;
}
const repeatableMove = lastMoves[0];
if (!repeatableMove.move || repeatableMove.virtual) {
@ -463,7 +463,7 @@ export class EncoreTag extends BattlerTag {
case Moves.ENCORE:
return false;
}
if (allMoves[repeatableMove.move].getAttrs(ChargeAttr).length && repeatableMove.result === MoveResult.OTHER) {
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),
getPokemonMessage(pokemon, " absorbed\nnutrients with its roots!"), true));
}
return ret;
}
@ -553,7 +553,7 @@ export class AquaRingTag extends BattlerTag {
onAdd(pokemon: Pokemon): void {
super.onAdd(pokemon);
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(),
Math.floor(pokemon.getMaxHp() / 16), `${this.getMoveName()} restored\n${pokemon.name}\'s HP!`, true));
}
return ret;
}
}
@ -1007,7 +1007,7 @@ export class SlowStartTag extends AbilityBattlerTag {
onAdd(pokemon: Pokemon): void {
super.onAdd(pokemon);
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;
break;
}
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 {
super.onAdd(pokemon);
pokemon.setVisible(false);
}
@ -1237,7 +1237,7 @@ export class SaltCuredTag extends BattlerTag {
onAdd(pokemon: Pokemon): void {
super.onAdd(pokemon);
pokemon.scene.queueMessage(getPokemonMessage(pokemon, " is being salt cured!"));
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()}!`));
}
}
return ret;
}
}
@ -1281,7 +1281,7 @@ export class CursedTag extends BattlerTag {
onAdd(pokemon: Pokemon): void {
super.onAdd(pokemon);
pokemon.scene.queueMessage(getPokemonMessage(pokemon, " has been cursed!"));
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()}!`));
}
}
return ret;
}
}

View File

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

View File

@ -3921,7 +3921,7 @@ export const biomeTrainerPools: BiomeTrainerPools = {
],
[ Species.PIPLUP, Type.WATER, -1, [
[ Biome.SEA, BiomePoolTier.RARE ]
]
]
],
[ Species.PRINPLUP, Type.WATER, -1, [
[ Biome.SEA, BiomePoolTier.RARE ]
@ -7157,7 +7157,7 @@ export const biomeTrainerPools: BiomeTrainerPools = {
[ Biome.JUNGLE, BiomePoolTier.COMMON ]
]
],
[ TrainerType.BAKER, [
[ TrainerType.BAKER, [
[ Biome.SLUM, BiomePoolTier.UNCOMMON ]
]
],
@ -7166,7 +7166,7 @@ export const biomeTrainerPools: BiomeTrainerPools = {
] ],
[ TrainerType.BIKER, [
[ Biome.SLUM, BiomePoolTier.COMMON ]
]
]
],
[ TrainerType.BLACK_BELT, [
[ Biome.DOJO, BiomePoolTier.COMMON ],
@ -7257,7 +7257,7 @@ export const biomeTrainerPools: BiomeTrainerPools = {
[ TrainerType.RICH_KID, [] ],
[ TrainerType.ROUGHNECK, [
[ Biome.SLUM, BiomePoolTier.COMMON ]
]
]
],
[ TrainerType.SCIENTIST, [
[ Biome.DESERT, BiomePoolTier.COMMON ],
@ -7265,7 +7265,7 @@ export const biomeTrainerPools: BiomeTrainerPools = {
]
],
[ TrainerType.SMASHER, [] ],
[ TrainerType.SNOW_WORKER, [
[ TrainerType.SNOW_WORKER, [
[ Biome.ICE_CAVE, BiomePoolTier.COMMON ],
[ Biome.SNOWY_FOREST, BiomePoolTier.COMMON ]
]
@ -7273,7 +7273,7 @@ export const biomeTrainerPools: BiomeTrainerPools = {
[ TrainerType.STRIKER, [] ],
[ TrainerType.SCHOOL_KID, [
[ Biome.GRASS, BiomePoolTier.COMMON ]
]
]
],
[ TrainerType.SWIMMER, [
[ Biome.SEA, BiomePoolTier.COMMON ]
@ -7285,7 +7285,7 @@ export const biomeTrainerPools: BiomeTrainerPools = {
],
[ TrainerType.VETERAN, [
[ Biome.WASTELAND, BiomePoolTier.COMMON ]
]
]
],
[ TrainerType.WAITER, [
[ Biome.METROPOLIS, BiomePoolTier.COMMON ]
@ -7700,7 +7700,7 @@ export const biomeTrainerPools: BiomeTrainerPools = {
const speciesEvolutions: SpeciesFormEvolution[] = pokemonEvolutions.hasOwnProperty(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) {
uncatchableSpecies.push(speciesId);
}

View File

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

View File

@ -946,7 +946,7 @@ export const trainerTypeDialogue = {
],
victory: [
"I wanted to win…but I lost!",
"I lost…'cause I couldn't win!"
"I lost…'cause I couldn't win!"
],
defeat: [
"Hey, wait a sec. Did I just win? I think I just won! Talk about satisfying!",
@ -957,10 +957,10 @@ export const trainerTypeDialogue = {
encounter: [
`I want to be the one to help a certain person. That being the case, I cannot afford to lose.
$ Our battle starts now.`,
],
victory: [
"I am… not enough, I see.",
"I am… not enough, I see.",
],
defeat: [
"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.",
],
victory: [
"That was a great battle!",
"That was a great battle!",
],
defeat: [
"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!`,
],
victory: [
"Guess I should've expected that!",
"Guess I should've expected that!",
],
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?",
@ -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?`,
],
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: [
"Hohoho… Indeed. Frail little blades o' grass'll break through even concrete.",
@ -1011,7 +1011,7 @@ export const trainerTypeDialogue = {
victory: [
"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 same world can look entirely different depending on your view.`
$The same world can look entirely different depending on your view.`
],
defeat: [
"The photo from the moment of my victory will be a really winner, all right!",
@ -1028,7 +1028,7 @@ export const trainerTypeDialogue = {
victory: [
"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!
$I think your focus and will bowled us over totally. `
$I think your focus and will bowled us over totally. `
],
defeat: [
"I sensed your will to win, but I don't lose!",
@ -2073,7 +2073,7 @@ export const trainerTypeDialogue = {
defeat: [
"Things didn't heat up for you.",
]
},
},
[TrainerType.RIVAL]: [
{
encounter: [

View File

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

View File

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

View File

@ -75,7 +75,7 @@ export enum MoveFlags {
PULSE_MOVE = 1 << 7,
PUNCHING_MOVE = 1 << 8,
SLICING_MOVE = 1 << 9,
/**
/**
* Indicates a move should be affected by {@linkcode Abilities.RECKLESS}
* @see {@linkcode Move.recklessMove()}
*/
@ -223,7 +223,7 @@ export default class Move implements Localizable {
return this;
}
partial(): this {
this.nameAppend += " (P)";
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
* @see {@linkcode apply}
*/
@ -486,7 +486,7 @@ export abstract class MoveAttr {
return true;
}
/**
/**
* @virtual
* @returns the {@linkcode MoveCondition} or {@linkcode MoveConditionFunc} for this {@linkcode Move}
*/
@ -506,7 +506,7 @@ export abstract class MoveAttr {
return null;
}
/**
/**
* Used by the Enemy AI to rank an attack based on a given user
* @see {@linkcode EnemyPokemon.getNextMove}
* @virtual
@ -515,7 +515,7 @@ export abstract class MoveAttr {
return 0;
}
/**
/**
* Used by the Enemy AI to rank an attack based on a given target
* @see {@linkcode EnemyPokemon.getNextMove}
* @virtual
@ -567,7 +567,7 @@ export class MoveEffectAttr extends MoveAttr {
/** 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> {
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);
}
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;
return true;
}
}
getCondition(): MoveConditionFunc {
return (user, target, move) => user.hp <= target.hp;
}
// TODO
/*getUserBenefitScore(user: Pokemon, target: Pokemon, move: Move): integer {
return 0;
@ -768,7 +768,7 @@ export class SurviveDamageAttr extends ModifiedDamageAttr {
getCondition(): MoveConditionFunc {
return (user, target, move) => target.hp > 1;
}
getUserBenefitScore(user: Pokemon, target: Pokemon, move: Move): integer {
return target.hp > 1 ? 0 : -20;
}
@ -811,7 +811,7 @@ export class RecoilAttr extends MoveEffectAttr {
if (cancelled.value) {
return false;
}
user.damageAndUpdate(recoilDamage, HitResult.OTHER, false, true, true);
user.scene.queueMessage(getPokemonMessage(user, " is hit\nwith recoil!"));
user.turnData.damageTaken += recoilDamage;
@ -926,7 +926,7 @@ export class HalfSacrificialAttr extends MoveEffectAttr {
if (!cancelled.value){
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
}
}
return true;
}
@ -970,7 +970,7 @@ export class HealAttr extends MoveEffectAttr {
return true;
}
/**
/**
* Creates a new {@linkcode PokemonHealPhase}.
* 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}
* @extends HealAttr
* @see {@linkcode apply}
@ -1232,7 +1232,7 @@ export class IncrementMovePriorityAttr extends MoveAttr {
if (!this.moveIncrementFunc(user, target, move)) {
return false;
}
(args[0] as Utils.IntegerHolder).value += this.increaseAmount;
return true;
}
@ -1413,7 +1413,7 @@ export class PsychoShiftEffectAttr extends MoveEffectAttr {
}
return statusAfflictResult;
}
return false;
}
@ -1542,7 +1542,7 @@ export class EatBerryAttr extends MoveEffectAttr {
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);
if(heldBerries.length <= 0) {
return false;
@ -1562,7 +1562,7 @@ export class EatBerryAttr extends MoveEffectAttr {
target.scene.updateModifiers(target.isPlayer());
}
this.chosenBerry = undefined;
return true;
}
@ -1595,7 +1595,7 @@ export class StealEatBerryAttr extends EatBerryAttr {
if(cancelled.value === true) {
return 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
@ -1633,7 +1633,7 @@ export class HealStatusEffectAttr extends MoveEffectAttr {
pokemon.scene.queueMessage(getPokemonMessage(pokemon, getStatusEffectHealText(pokemon.status.effect)));
pokemon.resetStatus();
pokemon.updateInfo();
return true;
}
@ -1677,13 +1677,13 @@ export class BypassBurnDamageReductionAttr extends MoveAttr {
apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean {
(args[0] as Utils.BooleanHolder).value = true;
return true;
return true;
}
}
export class WeatherChangeAttr extends MoveEffectAttr {
private weatherType: WeatherType;
constructor(weatherType: WeatherType) {
super();
@ -1701,7 +1701,7 @@ export class WeatherChangeAttr extends MoveEffectAttr {
export class ClearWeatherAttr extends MoveEffectAttr {
private weatherType: WeatherType;
constructor(weatherType: WeatherType) {
super();
@ -1719,7 +1719,7 @@ export class ClearWeatherAttr extends MoveEffectAttr {
export class TerrainChangeAttr extends MoveEffectAttr {
private terrainType: TerrainType;
constructor(terrainType: TerrainType) {
super();
@ -1757,7 +1757,7 @@ export class OneHitKOAttr extends MoveAttr {
}
(args[0] as Utils.BooleanHolder).value = true;
return true;
}
@ -2202,7 +2202,7 @@ export class HpSplitAttr extends MoveEffectAttr {
}
const infoUpdates = [];
const hpValue = Math.floor((target.hp + user.hp) / 2);
if (user.hp < hpValue) {
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 {
const ppMax = move.pp;
const ppUsed = user.moveset.find((m) => m.moveId === move.id).ppUsed;
let ppRemains = ppMax - ppUsed;
/** Reduce to 0 to avoid negative numbers if user has 1PP before attack and target has Ability.PRESSURE */
if(ppRemains < 0) {
ppRemains = 0;
}
const power = args[0] as Utils.NumberHolder;
switch (ppRemains) {
@ -2525,7 +2525,7 @@ export class CompareWeightPowerAttr extends VariablePowerAttr {
if (!userWeight || userWeight === 0) {
return false;
}
const relativeWeight = (targetWeight / userWeight) * 100;
switch (true) {
@ -2617,7 +2617,7 @@ export class MagnitudePowerAttr extends VariablePowerAttr {
const magnitudePowers = [ 10, 30, 50, 70, 90, 100, 110, 150 ];
let rand: integer;
user.scene.executeWithSeedOffset(() => rand = Utils.randSeedInt(100), user.scene.currentBattle.turn << 6, user.scene.waveSeed);
let m = 0;
@ -2715,9 +2715,9 @@ export class KnockOffPowerAttr extends VariablePowerAttr {
apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean {
if(target.getHeldItems().length > 0){
(args[0] as Utils.NumberHolder).value *= 1.5;
return true;
return true;
}
return false;
}
}
@ -2821,14 +2821,14 @@ export class ThunderAccuracyAttr extends VariableAccuracyAttr {
* @extends VariableAccuracyAttr
* @see {@linkcode apply}
*/
export class MinimizeAccuracyAttr extends VariableAccuracyAttr {
export class MinimizeAccuracyAttr extends VariableAccuracyAttr {
/**
* @see {@linkcode apply}
* @param user N/A
* @param target {@linkcode Pokemon} target of the move
* @param move N/A
* @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 {
if (target.getTag(BattlerTagType.MINIMIZED)){
@ -3123,7 +3123,7 @@ export class HiddenPowerTypeAttr extends VariableMoveTypeAttr {
+(user.ivs[Stat.SPD] & 1) * 8
+(user.ivs[Stat.SPATK] & 1) * 16
+(user.ivs[Stat.SPDEF] & 1) * 32) * 15/63);
type.value = [
Type.FIGHTING, Type.FLYING, Type.POISON, Type.GROUND,
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
const nonTeraTypes = user.getTypes();
type.value = nonTeraTypes[0];
return true;
return true;
} else if (userTypes.length > 0) {
type.value = userTypes[0];
return true;
@ -3228,11 +3228,11 @@ export class OneHitKOAccuracyAttr extends VariableAccuracyAttr {
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.
* @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 {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
* 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.
@ -3241,7 +3241,7 @@ export class SheerColdAccuracyAttr extends OneHitKOAccuracyAttr {
const accuracy = args[0] as Utils.NumberHolder;
if (user.level < target.level) {
accuracy.value = 0;
} else {
} else {
const baseAccuracy = user.isOfType(Type.ICE) ? 30 : 20;
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) {
return false;
}
user.damageAndUpdate(Math.floor(user.getMaxHp() / 2), HitResult.OTHER, false, true);
user.scene.queueMessage(getPokemonMessage(user, " kept going\nand crashed!"));
user.turnData.damageTaken += Math.floor(user.getMaxHp() / 2);
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
* Bypasses Storm Drain, Follow Me, Ally Switch, and the like.
*/
*/
export class BypassRedirectAttr extends MoveAttr { }
export class DisableMoveAttr extends MoveEffectAttr {
@ -3317,24 +3317,24 @@ export class DisableMoveAttr extends MoveEffectAttr {
if (turnMove.virtual) {
continue;
}
const moveIndex = target.getMoveset().findIndex(m => m.moveId === turnMove.move);
if (moveIndex === -1) {
return false;
}
const disabledMove = target.getMoveset()[moveIndex];
target.summonData.disabledMove = disabledMove.moveId;
target.summonData.disabledTurns = 4;
user.scene.queueMessage(getPokemonMessage(target, `'s ${disabledMove.getName()}\nwas disabled!`));
return true;
}
return false;
}
getCondition(): MoveConditionFunc {
return (user, target, move) => {
if (target.summonData.disabledMove || target.isMax()) {
@ -3348,7 +3348,7 @@ export class DisableMoveAttr extends MoveEffectAttr {
if (turnMove.virtual) {
continue;
}
const move = target.getMoveset().find(m => m.moveId === turnMove.move);
if (!move) {
continue;
@ -3493,7 +3493,7 @@ export class AddBattlerTagAttr extends MoveEffectAttr {
}
export class CurseAttr extends MoveEffectAttr {
apply(user: Pokemon, target: Pokemon, move:Move, args: any[]): boolean {
if (user.getTypes(true).includes(Type.GHOST)) {
if (target.getTag(BattlerTagType.CURSED)) {
@ -3530,7 +3530,7 @@ export class LapseBattlerTagAttr extends MoveEffectAttr {
for (const tagType of this.tagTypes) {
(this.selfTarget ? user : target).lapseTag(tagType);
}
return true;
}
}
@ -3552,7 +3552,7 @@ export class RemoveBattlerTagAttr extends MoveEffectAttr {
for (const tagType of this.tagTypes) {
(this.selfTarget ? user : target).removeTag(tagType);
}
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
*/
export class HitsTagAttr extends MoveAttr {
@ -3811,7 +3811,7 @@ export class RevivalBlessingAttr extends MoveEffectAttr {
}
/**
*
*
* @param user {@linkcode Pokemon} using this move
* @param target {@linkcode Pokemon} target of this move
* @param move {@linkcode Move} being used
@ -3826,7 +3826,7 @@ export class RevivalBlessingAttr extends MoveEffectAttr {
(user as PlayerPokemon).revivalBlessing().then(() => {
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
&& user.hasTrainer()
&& user.scene.getEnemyParty().findIndex(p => p.isFainted() && !p.isBoss()) > -1) {
@ -3866,16 +3866,16 @@ export class RevivalBlessingAttr extends MoveEffectAttr {
export class ForceSwitchOutAttr extends MoveEffectAttr {
private user: boolean;
private batonPass: boolean;
constructor(user?: boolean, batonPass?: boolean) {
super(false, MoveEffectTrigger.POST_APPLY, true);
this.user = !!user;
this.batonPass = !!batonPass;
}
apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): Promise<boolean> {
return new Promise(resolve => {
// Check if the move category is not STATUS or if the switch out condition is not met
if (!this.getSwitchOutCondition()(user, target, move)) {
//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
// This ensures that the switch out only happens when the conditions are met
const switchOutTarget = this.user ? user : target;
if (switchOutTarget instanceof PlayerPokemon) {
if (switchOutTarget instanceof PlayerPokemon) {
if (switchOutTarget.hp) {
applyPreSwitchOutAbAttrs(PreSwitchOutAbAttr, switchOutTarget);
(switchOutTarget as PlayerPokemon).switchOut(this.batonPass, true).then(() => resolve(true));
@ -3902,30 +3902,30 @@ export class ForceSwitchOutAttr extends MoveEffectAttr {
switchOutTarget.setVisible(false);
switchOutTarget.scene.field.remove(switchOutTarget);
user.scene.triggerPokemonFormChange(switchOutTarget, SpeciesFormChangeActiveTrigger, true);
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));
}
} else {
} else {
// Switch out logic for everything else
switchOutTarget.setVisible(false);
if (switchOutTarget.hp) {
switchOutTarget.hideInfo().then(() => switchOutTarget.destroy());
switchOutTarget.scene.field.remove(switchOutTarget);
user.scene.queueMessage(getPokemonMessage(switchOutTarget, " fled!"), null, true, 500);
}
if (!switchOutTarget.getAlly()?.isActive(true)) {
user.scene.clearEnemyHeldItemModifiers();
if (switchOutTarget.hp) {
user.scene.pushPhase(new BattleEndPhase(user.scene));
user.scene.pushPhase(new NewBattlePhase(user.scene));
}
}
}
resolve(true);
});
}
@ -3944,7 +3944,7 @@ export class ForceSwitchOutAttr extends MoveEffectAttr {
return (user, target, move) => {
const switchOutTarget = (this.user ? user : target);
const player = switchOutTarget instanceof PlayerPokemon;
if (!this.user && move.category === MoveCategory.STATUS && (target.hasAbilityWithAttr(ForceSwitchOutImmunityAbAttr) || target.isMax())) {
return false;
}
@ -4115,7 +4115,7 @@ export class FirstMoveTypeAttr extends MoveEffectAttr {
}
const firstMoveType = target.getMoveset()[0].getMove().type;
user.summonData.types = [ firstMoveType ];
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)] ];
break;
}
}
const targets = selectTargets;
}
const targets = selectTargets;
user.getMoveQueue().push({ move: move.moveId, targets: targets, ignorePP: true });
user.scene.unshiftPhase(new MovePhase(user.scene, user, targets, moveset[moveIndex], true));
return true;
@ -4174,7 +4174,7 @@ export class RandomMoveAttr extends OverrideMoveEffectAttr {
return new Promise(resolve => {
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 moveTargets = getMoveTargets(user, moveId);
if (!moveTargets.targets.length) {
resolve(false);
@ -4327,7 +4327,7 @@ export class NaturePowerAttr extends OverrideMoveEffectAttr {
moveId = Moves.TRI_ATTACK;
break;
}
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));
initMoveAnim(user.scene, moveId).then(() => {
@ -4507,18 +4507,18 @@ export class SketchAttr extends MoveEffectAttr {
if (!targetMoveCopiableCondition(user, target, move)) {
return false;
}
const targetMoves = target.getMoveHistory().filter(m => !m.virtual);
if (!targetMoves.length) {
return false;
}
const sketchableMove = targetMoves[0];
if (user.getMoveset().find(m => m.moveId === sketchableMove.move)) {
return false;
}
return true;
};
}
@ -4567,7 +4567,7 @@ export class AbilityCopyAttr extends MoveEffectAttr {
user.summonData.ability = target.getAbility().id;
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) {
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}!`));
@ -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 opponents = user.getOpponents();
let set: Pokemon[] = [];
let multiple = false;
@ -5508,7 +5508,7 @@ export function initMoves() {
.partial(),
new AttackMove(Moves.RAPID_SPIN, Type.NORMAL, MoveCategory.PHYSICAL, 50, 100, 40, 100, 0, 2)
.attr(StatChangeAttr, BattleStat.SPD, 1, true)
.attr(RemoveBattlerTagAttr, [
.attr(RemoveBattlerTagAttr, [
BattlerTagType.BIND,
BattlerTagType.WRAP,
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)
.attr(StatChangeAttr, [ BattleStat.DEF, BattleStat.SPDEF ], -1, true),
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)
.attr(MovePowerMultiplierAttr, (user, target, move) => target.turnData.damageTaken > 0 ? 2 : 1),
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),
new SelfStatusMove(Moves.MAGNET_RISE, Type.ELECTRIC, -1, 10, -1, 0, 4)
.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.MAGNET_RISEN))
.unimplemented(),
@ -6280,7 +6280,7 @@ export function initMoves() {
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
.condition(failOnGravityCondition)
.ignoresVirtual(),
.ignoresVirtual(),
new SelfStatusMove(Moves.SHIFT_GEAR, Type.STEEL, -1, 10, -1, 0, 5)
.attr(StatChangeAttr, BattleStat.ATK, 1, true)
.attr(StatChangeAttr, BattleStat.SPD, 2, true),
@ -6342,7 +6342,7 @@ export function initMoves() {
.attr(HitHealAttr)
.triageMove(),
new AttackMove(Moves.SACRED_SWORD, Type.FIGHTING, MoveCategory.PHYSICAL, 90, 100, 15, -1, 0, 5)
.attr(IgnoreOpponentStatChangesAttr)
.attr(IgnoreOpponentStatChangesAttr)
.slicingMove(),
new AttackMove(Moves.RAZOR_SHELL, Type.WATER, MoveCategory.PHYSICAL, 75, 95, 10, 50, 0, 5)
.attr(StatChangeAttr, BattleStat.DEF, -1)
@ -6963,7 +6963,7 @@ export function initMoves() {
.attr(DiscourageFrequentUseAttr)
.ignoresVirtual(),
new AttackMove(Moves.SNIPE_SHOT, Type.WATER, MoveCategory.SPECIAL, 80, 100, 15, -1, 0, 8)
.attr(HighCritAttr)
.attr(HighCritAttr)
.attr(BypassRedirectAttr),
new AttackMove(Moves.JAW_LOCK, Type.DARK, MoveCategory.PHYSICAL, 80, 100, 10, -1, 0, 8)
.attr(AddBattlerTagAttr, BattlerTagType.TRAPPED, false, false, 1)
@ -7486,7 +7486,7 @@ export function initMoves() {
.attr(StatChangeAttr, BattleStat.SPATK, -1, true, null, true, true)
.target(MoveTarget.ALL_NEAR_ENEMIES),
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(),
new AttackMove(Moves.HYDRO_STEAM, Type.WATER, MoveCategory.SPECIAL, 80, 100, 15, -1, 0, 9)
.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)
.attr(StatusEffectAttr, StatusEffect.TOXIC)
);
}
}

View File

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

View File

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

View File

@ -164,14 +164,14 @@ export function getRandomStatusEffect(statusEffectA: StatusEffect, statusEffectB
* @param statusA The first 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) {
return statusB;
}
if (statusB === undefined || statusB.effect === StatusEffect.NONE || statusB.effect === StatusEffect.FAINT) {
return statusA;
}
return Utils.randIntRange(0, 2) ? statusA : statusB;
}

View File

@ -710,7 +710,7 @@ export const trainerConfigs: TrainerConfigs = {
.setSpeciesPools({
[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.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 ]
}),
[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({
[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.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.ULTRA_RARE]: [ Species.KUBFU ]
}),
@ -748,7 +748,7 @@ export const trainerConfigs: TrainerConfigs = {
.setSpeciesPools({
[TrainerPoolTier.COMMON]: [ Species.RALTS, Species.SPOINK, Species.LOTAD, Species.BUDEW ],
[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 ]
}),
[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.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)
.setSpeciesPools({
.setSpeciesPools({
[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.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.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.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.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 => {
const trainerType = t;
trainerTypeNames[trainerType] = [];
const config = trainerNameConfigs[t] as TrainerNameConfig;
const trainerNames = new Set<string>();
const femaleTrainerNames = new Set<string>();

View File

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

View File

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

View File

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

View File

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

View File

@ -61,7 +61,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
public species: PokemonSpecies;
public formIndex: integer;
public abilityIndex: integer;
public passive: boolean;
public passive: boolean;
public shiny: boolean;
public variant: Variant;
public pokeball: PokeballType;
@ -170,7 +170,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
} else {
this.id = Utils.randSeedInt(4294967296);
this.ivs = ivs || Utils.getIvsFromId(this.id);
if (this.gender === undefined) {
this.generateGender();
}
@ -239,7 +239,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
};
this.setScale(this.getSpriteScale());
const sprite = getSprite(true);
const tintSprite = getSprite();
@ -555,9 +555,9 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
return false;
}
return true;
return true;
}
playAnim(): void {
this.tryPlaySprite(this.getSprite(), this.getTintSprite(), this.getBattleSpriteKey());
}
@ -662,7 +662,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
break;
case Stat.SPD:
// 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))) {
ret *= 2;
}
@ -842,7 +842,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
this.summonData.types.forEach(t => types.push(t));
} else {
const speciesForm = this.getSpeciesForm();
types.push(speciesForm.type1);
const fusionSpeciesForm = this.getFusionSpeciesForm();
@ -933,10 +933,10 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
starterSpeciesId = pokemonPrevolutions[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
* - set by override
* - 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
* 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.
@ -1209,7 +1209,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
return ret;
}
setMove(moveIndex: integer, moveId: Moves): void {
const move = moveId ? new PokemonMove(moveId) : null;
this.moveset[moveIndex] = move;
@ -1279,12 +1279,12 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
&& !species.isTrainerForbidden()
&& species.speciesId !== this.species.speciesId;
};
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.fusionShiny = this.shiny;
this.fusionVariant = this.variant;
if (this.fusionSpecies.malePercent === null) {
this.fusionGender = Gender.GENDERLESS;
} else {
@ -1582,7 +1582,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
const move = battlerMove.getMove();
const damage = new Utils.NumberHolder(0);
const defendingSidePlayField = this.isPlayer() ? this.scene.getPlayerField() : this.scene.getEnemyField();
const variableCategory = new Utils.IntegerHolder(move.category);
applyMoveAttrs(VariableMoveCategoryAttr, source, this, move, variableCategory);
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);
if (!isCritical) {
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 sourceTypes = source.getTypes();
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);
/**
/**
* 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
* 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 => {
if (this.getTag(hta.tagType)) {
@ -1752,7 +1752,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
isCritical = false;
result = HitResult.EFFECTIVE;
}
if (!result) {
if (!typeMultiplier.value) {
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 frameThreshold: number;
sprite.anims.pause();
tintSprite.anims.pause();
@ -2336,7 +2336,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
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)) {
return false;
}
@ -2626,13 +2626,13 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
fusionPixelColors.push(argbFromRgba({ r, g, b, a }));
}
}
let paletteColors: Map<number, number>;
let fusionPaletteColors: Map<number, number>;
const originalRandom = Math.random;
Math.random = () => Phaser.Math.RND.realInRange(0, 1);
this.scene.executeWithSeedOffset(() => {
paletteColors = QuantizerCelebi.quantize(pixelColors, 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 rgbaColors: Map<number, integer[]>;
let hsvColors: Map<number, number[]>;
const mappedColors = new Map<integer, integer[]>();
do {
mappedColors.clear();
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[]>());
hsvColors = Array.from(rgbaColors.keys()).reduce((map: Map<number, number[]>, k: number) => {
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) {
super(scene, 106, 148, species, level, abilityIndex, formIndex, gender, shiny, variant, ivs, nature, dataSource);
if (Overrides.SHINY_OVERRIDE) {
this.shiny = true;
this.initShinySparkle();
@ -2865,7 +2865,7 @@ export class PlayerPokemon extends Pokemon {
}
this.hideInfo();
this.setVisible(false);
this.scene.ui.setMode(Mode.PARTY, PartyUiMode.FAINT_SWITCH, this.getFieldIndex(), (slotIndex: integer, option: PartyOption) => {
if (slotIndex >= this.scene.currentBattle.getBattlerCount() && slotIndex < 6) {
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) {
this.scene.applyModifier(PokemonFriendshipBoosterModifier, true, this, amount);
this.scene.applyModifier(PokemonFriendshipBoosterModifier, true, this, starterAmount);
this.friendship = Math.min(this.friendship + amount.value, 255);
if (this.friendship === 255) {
this.scene.validateAchv(achvs.MAX_FRIENDSHIP);
@ -2949,7 +2949,7 @@ export class PlayerPokemon extends Pokemon {
}, PartyUiHandler.FilterFainted);
});
}
getPossibleEvolution(evolution: SpeciesFormEvolution): Promise<Pokemon> {
return new Promise(resolve => {
const evolutionSpecies = getPokemonSpecies(evolution.speciesId);
@ -3021,11 +3021,11 @@ export class PlayerPokemon extends Pokemon {
private handleSpecialEvolutions(evolution: SpeciesFormEvolution) {
const isFusion = evolution instanceof FusionSpeciesFormEvolution;
const evoSpecies = (!isFusion ? this.species : this.fusionSpecies);
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)) {
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;
@ -3116,7 +3116,7 @@ export class PlayerPokemon extends Pokemon {
this.generateName();
this.calculateStats();
// Set this Pokemon's HP to the average % of both fusion components
this.hp = Math.round(this.stats[Stat.HP] * newHpPercent);
if (!this.isFainted()) {
@ -3168,7 +3168,7 @@ export class PlayerPokemon extends Pokemon {
/** Returns a deep copy of this Pokemon's moveset array */
copyMoveset(): PokemonMove[] {
const newMoveset = [];
this.moveset.forEach(move =>
this.moveset.forEach(move =>
newMoveset.push(new PokemonMove(move.moveId, 0, move.ppUp, move.virtual)));
return newMoveset;
@ -3230,7 +3230,7 @@ export class EnemyPokemon extends Pokemon {
this.battleInfo.updateBossSegments(this);
}
}
setBoss(boss: boolean = true, bossSegments: integer = 0): void {
if (boss) {
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)) {
return [BattlerIndex.ATTACKER];
}
return [];
}
@ -3476,7 +3476,7 @@ export class EnemyPokemon extends Pokemon {
return 0;
}
let clearedBossSegmentIndex = this.isBoss()
let clearedBossSegmentIndex = this.isBoss()
? this.bossSegmentIndex + 1
: 0;

View File

@ -31,7 +31,7 @@ export default class Trainer extends Phaser.GameObjects.Container {
? trainerConfigs[trainerType]
: trainerConfigs[TrainerType.ACE_TRAINER];
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);
if (trainerNamePools.hasOwnProperty(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 });
return ret;
};
const sprite = getSprite(true);
const tintSprite = getSprite();
@ -181,7 +181,7 @@ export default class Trainer extends Phaser.GameObjects.Container {
getPartyLevels(waveIndex: integer): integer[] {
const ret = [];
const partyTemplate = this.getPartyTemplate();
const difficultyWaveIndex = this.scene.gameMode.getWaveForDifficulty(waveIndex);
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++) {
let multiplier = 1;
const strength = partyTemplate.getStrength(i);
switch (strength) {
case PartyMemberStrength.WEAKER:
multiplier = 0.95;
@ -229,7 +229,7 @@ export default class Trainer extends Phaser.GameObjects.Container {
genPartyMember(index: integer): EnemyPokemon {
const battle = this.scene.currentBattle;
const level = battle.enemyLevels[index];
let ret: EnemyPokemon;
this.scene.executeWithSeedOffset(() => {
@ -259,7 +259,7 @@ export default class Trainer extends Phaser.GameObjects.Container {
const species = template.isSameSpecies(index) && index > offset
? getPokemonSpecies(battle.enemyParty[offset].species.getTrainerSpeciesForLevel(level, false, template.getStrength(offset)))
: this.genNewPartyMemberSpecies(level, strength);
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));
@ -324,7 +324,7 @@ export default class Trainer extends Phaser.GameObjects.Container {
if (trainerSlot && !this.isDouble()) {
trainerSlot = TrainerSlot.NONE;
}
const party = this.scene.getEnemyParty();
const nonFaintedPartyMembers = party.slice(this.scene.currentBattle.getBattlerCount()).filter(p => !p.isFainted()).filter(p => !trainerSlot || p.trainerSlot === trainerSlot);
const partyMemberScores = nonFaintedPartyMembers.map(p => {
@ -374,7 +374,7 @@ export default class Trainer extends Phaser.GameObjects.Container {
return maxScorePartyMemberIndexes[0];
}
getPartyMemberModifierChanceMultiplier(index: integer): number {
switch (this.getPartyTemplate().getStrength(index)) {
case PartyMemberStrength.WEAKER:
@ -431,7 +431,7 @@ export default class Trainer extends Phaser.GameObjects.Container {
sprite.play(animConfig);
tintSprite.play(animConfig);
return true;
return true;
}
playAnim(): void {

View File

@ -35,7 +35,7 @@ export class FormChangePhase extends EvolutionPhase {
doEvolution(): void {
const preName = this.pokemon.name;
this.pokemon.getPossibleForm(this.formChange).then(transformedPokemon => {
[ this.pokemonEvoSprite, this.pokemonEvoTintSprite ].map(sprite => {
@ -132,7 +132,7 @@ export class FormChangePhase extends EvolutionPhase {
const delay = playEvolutionFanfare ? 4000 : 1750;
this.scene.playSoundWithoutBgm(playEvolutionFanfare ? "evolution_fanfare" : "minor_fanfare");
transformedPokemon.destroy();
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());
@ -287,7 +287,7 @@ export class QuietFormChangePhase extends BattlePhase {
this.pokemon.bossSegmentIndex = 4;
this.pokemon.initBattleInfo();
this.pokemon.cry();
const movePhase = this.scene.findPhase(p => p instanceof MovePhase && p.pokemon === this.pokemon) as MovePhase;
if (movePhase) {
movePhase.cancel();

View File

@ -46,7 +46,7 @@ export class GameMode implements GameModeConfig {
}
/**
* @returns either:
* @returns either:
* - override from overrides.ts
* - 20 for Daily Runs
* - 5 for all other modes
@ -132,7 +132,7 @@ export class GameMode implements GameModeConfig {
}
return false;
}
isTrainerBoss(waveIndex: integer, biomeType: Biome, offsetGym: boolean): boolean {
switch (this.modeId) {
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
* @param waveIndex
* @param waveIndex
* @param modeId game mode
* @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
*/
isEndlessMinorBoss(waveIndex: integer): boolean {
return waveIndex % 250 === 0 &&
return waveIndex % 250 === 0 &&
(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
*/
isEndlessMajorBoss(waveIndex: integer): boolean {
return waveIndex % 1000 === 0 &&
return waveIndex % 1000 === 0 &&
(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("statuses", "");
this.loadAtlas("categories", "");
this.loadAtlas("egg", "egg");
this.loadAtlas("egg_crack", "egg");
this.loadAtlas("egg_icons", "egg");
@ -350,7 +350,7 @@ export class LoadingScene extends SceneBase {
this.load.on("fileprogress", file => {
assetText.setText(`Loading asset: ${file.key}`);
});
loadingGraphics.push(bg, graphics, progressBar, progressBox, logo, percentText, assetText);
if (!mobile) {

View File

@ -22,7 +22,7 @@ export const starterSelectUiHandler: SimpleTranslationEntries = {
"nature": "Wesen:",
"eggMoves": "Ei-Attacken",
"start": "Start",
"addToParty": "Zum Team hinzufügen",
"addToParty": "Zum Team hinzufügen",
"toggleIVs": "DVs anzeigen/verbergen",
"manageMoves": "Attacken ändern",
"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.
$Für Fehlerberichte nutze bitte den PokéRogue Discord-Server.
$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.",
"menu": `In diesem Menü hast du Zugriff auf die Einstellungen.
$Dort kannst du u. A. die Spielgeschwin-\ndigkeit und das Fensterdesign ändern.
$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!",
"heavyRainLapseMessage": "Der strömende Regen hält an.",
"heavyRainClearMessage": "Der strömende Regen lässt nach.",
"harshSunStartMessage": "Das Sonnenlicht wird sehr viel stärker!",
"harshSunLapseMessage": "Das Sonnenlicht ist sehr stark.",
"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 { voucher } from "./voucher";
export const enConfig = {
export const enConfig = {
ability: ability,
abilityTriggers: abilityTriggers,
battle: battle,

View File

@ -139,10 +139,10 @@ export const modifierType: ModifierTypeTranslationEntries = {
"HYPER_POTION": { name: "Hyper Potion" },
"MAX_POTION": { name: "Max Potion" },
"FULL_RESTORE": { name: "Full Restore" },
"REVIVE": { name: "Revive" },
"MAX_REVIVE": { name: "Max Revive" },
"FULL_HEAL": { name: "Full Heal" },
"SACRED_ASH": { name: "Sacred Ash" },
@ -187,12 +187,12 @@ export const modifierType: ModifierTypeTranslationEntries = {
"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" },
"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" },
"GRIP_CLAW": { name: "Grip Claw" },
"WIDE_LENS": { name: "Wide 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)" },
@ -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

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

View File

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

View File

@ -82,8 +82,8 @@ export const trainerClasses: SimpleTranslationEntries = {
"pokémon_rangers": "Pokémon Ranger",
"ranger": "Ranger",
"restaurant_staff": "Restaurant Staff",
"rich": "Rich",
"rich_female": "Rich",
"rich": "Rich",
"rich_female": "Rich",
"rich_boy": "Rich Boy",
"rich_couple": "Rich Couple",
"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.
$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.`,
"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.
$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!`,

View File

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

View File

@ -139,10 +139,10 @@ export const modifierType: ModifierTypeTranslationEntries = {
"HYPER_POTION": { name: "Hyper Potion" },
"MAX_POTION": { name: "Max Potion" },
"FULL_RESTORE": { name: "Full Restore" },
"REVIVE": { name: "Revive" },
"MAX_REVIVE": { name: "Max Revive" },
"FULL_HEAL": { name: "Full Heal" },
"SACRED_ASH": { name: "Sacred Ash" },
@ -187,12 +187,12 @@ export const modifierType: ModifierTypeTranslationEntries = {
"AMULET_COIN": { name: "Amulet Coin", description: "Increases money rewards by 20%" },
"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" },
"LOCK_CAPSULE": { name: "Lock Capsule", description: "Allows you to lock item rarities when rerolling items" },
"GRIP_CLAW": { name: "Grip Claw" },
"WIDE_LENS": { name: "Wide 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)" },
@ -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

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

View File

@ -8,10 +8,10 @@ export const tutorial: SimpleTranslationEntries = {
$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
$ajustes de tu navegador.`,
"accessMenu": `Para acceder al menú, pulsa M o Escape cuando\ntengas el control.
$El menú contiene los ajustes y otras funciones.`,
"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.
$Hay más opciones, ¡así que pruébalas todas!`,

View File

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

View File

@ -139,10 +139,10 @@ export const modifierType: ModifierTypeTranslationEntries = {
"HYPER_POTION": { name: "Hyper Potion" },
"MAX_POTION": { name: "Potion Max" },
"FULL_RESTORE": { name: "Guérison" },
"REVIVE": { name: "Rappel" },
"MAX_REVIVE": { name: "Rappel Max" },
"FULL_HEAL": { name: "Total Soin" },
"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" },
"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" },
"LOCK_CAPSULE": { name: "Poké Écrin", description: "Permet de verrouiller des objets rares si vous relancez les objets proposés" },
"GRIP_CLAW": { name: "Accro Griffe" },
"WIDE_LENS": { name: "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)" },
@ -290,7 +290,7 @@ export const modifierType: ModifierTypeTranslationEntries = {
"TART_APPLE": "Pomme Acidulée",
"STRAWBERRY_SWEET": "Fraise en Sucre",
"UNREMARKABLE_TEACUP": "Bol Médiocre",
"CHIPPED_POT": "Théière Ébréchée",
"BLACK_AUGURITE": "Obsidienne",
"GALARICA_CUFF": "Bracelet Galanoa",

View File

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

View File

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

View File

@ -139,10 +139,10 @@ export const modifierType: ModifierTypeTranslationEntries = {
"HYPER_POTION": { name: "Iperpozione" },
"MAX_POTION": { name: "Pozione Max" },
"FULL_RESTORE": { name: "Ricarica Totale" },
"REVIVE": { name: "Revitalizzante" },
"MAX_REVIVE": { name: "Revitalizzante Max" },
"FULL_HEAL": { name: "Cura Totale" },
"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%" },
"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" },
"LOCK_CAPSULE": { name: "Capsula Scrigno", description: "Permette di bloccare le rarità degli oggetti quando si fa un reroll degli oggetti" },
"GRIP_CLAW": { name: "Presartigli" },
"WIDE_LENS": { name: "Grandelente" },
"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)" },
@ -290,7 +290,7 @@ export const modifierType: ModifierTypeTranslationEntries = {
"TART_APPLE": "Aspropomo",
"STRAWBERRY_SWEET": "Bonbonfragola",
"UNREMARKABLE_TEACUP": "Tazza dozzinale",
"CHIPPED_POT": "Teiera crepata",
"BLACK_AUGURITE": "Augite nera",
"GALARICA_CUFF": "Fascia Galarnoce",

View File

@ -22,7 +22,7 @@ export const starterSelectUiHandler: SimpleTranslationEntries = {
"nature": "Natura:",
"eggMoves": "Mosse delle uova",
"start": "Inizia",
"addToParty": "Aggiungi al Gruppo",
"addToParty": "Aggiungi al Gruppo",
"toggleIVs": "Vedi/Nascondi IV",
"manageMoves": "Gestisci Mosse",
"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.
$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`,
"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.
$Dalle impostazioni puoi cambiare velocità di gioco, stile di finestra e altre opzioni.
$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!",
"heavyRainLapseMessage": "La pioggia battente continua.",
"heavyRainClearMessage": "La pioggia battente è cessata.",
"harshSunStartMessage": "La luce solare è molto intensa!",
"harshSunLapseMessage": "La luce solare è estremamente calda.",
"harshSunClearMessage": "La luce solare si sta attenuando.",

View File

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

View File

@ -139,10 +139,10 @@ export const modifierType: ModifierTypeTranslationEntries = {
"HYPER_POTION": { name: "Hiper Poção" },
"MAX_POTION": { name: "Poção Máxima" },
"FULL_RESTORE": { name: "Restaurador" },
"REVIVE": { name: "Reanimador" },
"MAX_REVIVE": { name: "Reanimador Máximo" },
"FULL_HEAL": { name: "Cura Total" },
"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%" },
"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" },
"LOCK_CAPSULE": { name: "Cápsula de Travamento", description: "Permite que você trave raridades de itens ao rolar novamente" },
"GRIP_CLAW": { name: "Garra-Aperto" },
"WIDE_LENS": { name: "Lente Ampla" },
"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)" },
@ -290,7 +290,7 @@ export const modifierType: ModifierTypeTranslationEntries = {
"TART_APPLE": "Maçã Azeda",
"STRAWBERRY_SWEET": "Doce de Morango",
"UNREMARKABLE_TEACUP": "Xícara Comum",
"CHIPPED_POT": "Pote Lascado",
"BLACK_AUGURITE": "Mineral Negro",
"GALARICA_CUFF": "Bracelete de Galar",

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -33,7 +33,7 @@ export const weather: SimpleTranslationEntries = {
"heavyRainStartMessage": "開始下起了暴雨!",
"heavyRainLapseMessage": "暴雨勢頭不減。",
"heavyRainClearMessage": "暴雨停了。",
"harshSunStartMessage": "日照變得非常強了!",
"harshSunLapseMessage": "強日照勢頭不減。",
"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.
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}`;
console.error(event.reason);
//alert(errorString);

View File

@ -450,7 +450,7 @@ export class BerryModifierType extends PokemonHeldItemModifierType implements Ge
constructor(berryType: BerryType) {
super("", `${BerryType[berryType].toLowerCase()}_berry`, (type, args) => new Modifiers.BerryModifier(type, (args[0] as Pokemon).id, berryType), "berry");
this.berryType = berryType;
}
@ -653,7 +653,7 @@ export class PokemonExpBoosterModifierType extends PokemonHeldItemModifierType {
constructor(localeKey: string, iconImage: string, boostPercent: integer) {
super(localeKey, iconImage, (_type, args) => new Modifiers.PokemonExpBoosterModifier(this, (args[0] as Pokemon).id, boostPercent));
this.boostPercent = boostPercent;
}
@ -742,7 +742,7 @@ export class EvolutionItemModifierType extends PokemonModifierType implements Ge
this.evolutionItem = evolutionItem;
}
get name(): string {
return i18next.t(`modifierType:EvolutionItem.${EvolutionItem[this.evolutionItem]}`);
}
@ -834,7 +834,7 @@ class AttackTypeBoosterModifierTypeGenerator extends ModifierTypeGenerator {
}
let type: Type;
const randInt = Utils.randSeedInt(totalWeight);
let weight = 0;
@ -846,7 +846,7 @@ class AttackTypeBoosterModifierTypeGenerator extends ModifierTypeGenerator {
}
weight += typeWeight;
}
return new AttackTypeBoosterModifierType(type, 20);
});
}
@ -1041,7 +1041,7 @@ export const modifierTypes = {
HYPER_POTION: () => new PokemonHpRestoreModifierType("modifierType:ModifierType.HYPER_POTION", "hyper_potion", 200, 50),
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),
REVIVE: () => new PokemonReviveModifierType("modifierType:ModifierType.REVIVE", "revive", 50),
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"),
MINI_BLACK_HOLE: () => new TurnHeldItemTransferModifierType("modifierType:ModifierType.MINI_BLACK_HOLE", "mini_black_hole"),
VOUCHER: () => new AddVoucherModifierType(VoucherType.REGULAR, 1),
VOUCHER_PLUS: () => new AddVoucherModifierType(VoucherType.PLUS, 1),
VOUCHER_PREMIUM: () => new AddVoucherModifierType(VoucherType.PREMIUM, 1),
@ -1242,7 +1242,7 @@ const modifierPool: ModifierPool = {
new WeightedModifierType(modifierTypes.BERRY, 2),
new WeightedModifierType(modifierTypes.TM_COMMON, 1),
].map(m => {
m.setTier(ModifierTier.COMMON); return m;
m.setTier(ModifierTier.COMMON); return m;
}),
[ModifierTier.GREAT]: [
new WeightedModifierType(modifierTypes.GREAT_BALL, 6),
@ -1301,7 +1301,7 @@ const modifierPool: ModifierPool = {
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),
].map(m => {
m.setTier(ModifierTier.GREAT); return m;
m.setTier(ModifierTier.GREAT); return m;
}),
[ModifierTier.ULTRA]: [
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.VOUCHER, (party: Pokemon[], rerollCount: integer) => !party[0].scene.gameMode.isDaily ? Math.max(3 - rerollCount, 0) : 0, 3),
].map(m => {
m.setTier(ModifierTier.ULTRA); return m;
m.setTier(ModifierTier.ULTRA); return m;
}),
[ModifierTier.ROGUE]: [
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.DYNAMAX_BAND, (party: Pokemon[]) => Math.min(Math.ceil(party[0].scene.currentBattle.waveIndex / 50), 4) * 8, 32),
].map(m => {
m.setTier(ModifierTier.ROGUE); return m;
m.setTier(ModifierTier.ROGUE); return m;
}),
[ModifierTier.MASTER]: [
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.MINI_BLACK_HOLE, (party: Pokemon[]) => party[0].scene.gameData.unlocks[Unlockables.MINI_BLACK_HOLE] ? 1 : 0, 1),
].map(m => {
m.setTier(ModifierTier.MASTER); return m;
m.setTier(ModifierTier.MASTER); return m;
})
};
@ -1368,27 +1368,27 @@ const wildModifierPool: ModifierPool = {
[ModifierTier.COMMON]: [
new WeightedModifierType(modifierTypes.BERRY, 1)
].map(m => {
m.setTier(ModifierTier.COMMON); return m;
m.setTier(ModifierTier.COMMON); return m;
}),
[ModifierTier.GREAT]: [
new WeightedModifierType(modifierTypes.BASE_STAT_BOOSTER, 1)
].map(m => {
m.setTier(ModifierTier.GREAT); return m;
m.setTier(ModifierTier.GREAT); return m;
}),
[ModifierTier.ULTRA]: [
new WeightedModifierType(modifierTypes.ATTACK_TYPE_BOOSTER, 10),
].map(m => {
m.setTier(ModifierTier.ULTRA); return m;
m.setTier(ModifierTier.ULTRA); return m;
}),
[ModifierTier.ROGUE]: [
new WeightedModifierType(modifierTypes.LUCKY_EGG, 4),
].map(m => {
m.setTier(ModifierTier.ROGUE); return m;
m.setTier(ModifierTier.ROGUE); return m;
}),
[ModifierTier.MASTER]: [
new WeightedModifierType(modifierTypes.GOLDEN_EGG, 1)
].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.BASE_STAT_BOOSTER, 3)
].map(m => {
m.setTier(ModifierTier.COMMON); return m;
m.setTier(ModifierTier.COMMON); return m;
}),
[ModifierTier.GREAT]: [
new WeightedModifierType(modifierTypes.BASE_STAT_BOOSTER, 3),
].map(m => {
m.setTier(ModifierTier.GREAT); return m;
m.setTier(ModifierTier.GREAT); return m;
}),
[ModifierTier.ULTRA]: [
new WeightedModifierType(modifierTypes.ATTACK_TYPE_BOOSTER, 1),
].map(m => {
m.setTier(ModifierTier.ULTRA); return m;
m.setTier(ModifierTier.ULTRA); return m;
}),
[ModifierTier.ROGUE]: [
new WeightedModifierType(modifierTypes.REVIVER_SEED, 2),
@ -1417,14 +1417,14 @@ const trainerModifierPool: ModifierPool = {
new WeightedModifierType(modifierTypes.GRIP_CLAW, 1),
new WeightedModifierType(modifierTypes.WIDE_LENS, 1),
].map(m => {
m.setTier(ModifierTier.ROGUE); return m;
m.setTier(ModifierTier.ROGUE); return m;
}),
[ModifierTier.MASTER]: [
new WeightedModifierType(modifierTypes.KINGS_ROCK, 1),
new WeightedModifierType(modifierTypes.LEFTOVERS, 1),
new WeightedModifierType(modifierTypes.SHELL_BELL, 1),
].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_FUSED_CHANCE, 1)
].map(m => {
m.setTier(ModifierTier.COMMON); return m;
m.setTier(ModifierTier.COMMON); return m;
}),
[ModifierTier.GREAT]: [
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_FUSED_CHANCE, 1)
].map(m => {
m.setTier(ModifierTier.GREAT); return m;
m.setTier(ModifierTier.GREAT); return m;
}),
[ModifierTier.ULTRA]: [
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_FUSED_CHANCE, 5)
].map(m => {
m.setTier(ModifierTier.ULTRA); return m;
m.setTier(ModifierTier.ULTRA); return m;
}),
[ModifierTier.ROGUE]: [ ].map(m => {
m.setTier(ModifierTier.ROGUE); return m;
m.setTier(ModifierTier.ROGUE); return 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.BERRY, 3),
].map(m => {
m.setTier(ModifierTier.COMMON); return m;
m.setTier(ModifierTier.COMMON); return m;
}),
[ModifierTier.GREAT]: [
new WeightedModifierType(modifierTypes.ATTACK_TYPE_BOOSTER, 5),
].map(m => {
m.setTier(ModifierTier.GREAT); return m;
m.setTier(ModifierTier.GREAT); return m;
}),
[ModifierTier.ULTRA]: [
new WeightedModifierType(modifierTypes.REVIVER_SEED, 4),
@ -1488,7 +1488,7 @@ const dailyStarterModifierPool: ModifierPool = {
new WeightedModifierType(modifierTypes.SOUL_DEW, 1),
new WeightedModifierType(modifierTypes.GOLDEN_PUNCH, 1),
].map(m => {
m.setTier(ModifierTier.ULTRA); return m;
m.setTier(ModifierTier.ULTRA); return m;
}),
[ModifierTier.ROGUE]: [
new WeightedModifierType(modifierTypes.GRIP_CLAW, 5),
@ -1497,13 +1497,13 @@ const dailyStarterModifierPool: ModifierPool = {
new WeightedModifierType(modifierTypes.QUICK_CLAW, 3),
new WeightedModifierType(modifierTypes.KINGS_ROCK, 3),
].map(m => {
m.setTier(ModifierTier.ROGUE); return m;
m.setTier(ModifierTier.ROGUE); return m;
}),
[ModifierTier.MASTER]: [
new WeightedModifierType(modifierTypes.LEFTOVERS, 1),
new WeightedModifierType(modifierTypes.SHELL_BELL, 1),
].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) {
const pool = getModifierPoolForType(poolType);
const ignoredIndexes = {};
const modifierTableData = {};
const thresholds = Object.fromEntries(new Map(Object.keys(pool).map(t => {
@ -1801,7 +1801,7 @@ function getNewModifierTypeOption(party: Pokemon[], poolType: ModifierPoolType,
if (index === undefined) {
return null;
}
if (player) {
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) {
super(type, stackCount);
}
clone(): MapModifier {
return new MapModifier(this.type, this.stackCount);
}
@ -382,7 +382,7 @@ export class MegaEvolutionAccessModifier extends PersistentModifier {
constructor(type: ModifierType, stackCount?: integer) {
super(type, stackCount);
}
clone(): MegaEvolutionAccessModifier {
return new MegaEvolutionAccessModifier(this.type, this.stackCount);
}
@ -400,7 +400,7 @@ export class GigantamaxAccessModifier extends PersistentModifier {
constructor(type: ModifierType, stackCount?: integer) {
super(type, stackCount);
}
clone(): GigantamaxAccessModifier {
return new GigantamaxAccessModifier(this.type, this.stackCount);
}
@ -418,7 +418,7 @@ export class TerastallizeAccessModifier extends PersistentModifier {
constructor(type: ModifierType, stackCount?: integer) {
super(type, stackCount);
}
clone(): TerastallizeAccessModifier {
return new TerastallizeAccessModifier(this.type, this.stackCount);
}
@ -596,7 +596,7 @@ export class TerastallizeModifier extends LapsingPokemonHeldItemModifier {
}
return ret;
}
getTransferrable(withinParty: boolean): boolean {
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 1: {number} Move type
* - Index 2: {Utils.NumberHolder} Move power
@ -1062,7 +1062,7 @@ export class PokemonHpRestoreModifier extends ConsumablePokemonModifier {
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());
return true;
}
@ -1466,7 +1466,7 @@ export class PokemonFriendshipBoosterModifier extends PokemonHeldItemModifier {
clone(): PersistentModifier {
return new PokemonFriendshipBoosterModifier(this.type as ModifierTypes.PokemonFriendshipBoosterModifierType, this.pokemonId, this.stackCount);
}
apply(args: any[]): boolean {
const friendship = args[1] as Utils.IntegerHolder;
friendship.value = Math.floor(friendship.value * (1 + 0.5 * this.getStackCount()));
@ -1491,7 +1491,7 @@ export class PokemonNatureWeightModifier extends PokemonHeldItemModifier {
clone(): PersistentModifier {
return new PokemonNatureWeightModifier(this.type, this.pokemonId, this.stackCount);
}
apply(args: any[]): boolean {
const multiplier = args[1] as Utils.IntegerHolder;
if (multiplier.value !== 1) {
@ -1559,7 +1559,7 @@ export class PokemonMultiHitModifier extends PokemonHeldItemModifier {
clone(): PersistentModifier {
return new PokemonMultiHitModifier(this.type as ModifierTypes.PokemonMultiHitModifierType, this.pokemonId, this.stackCount);
}
apply(args: any[]): boolean {
(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));
scene.applyModifiers(MoneyMultiplierModifier, true, moneyAmount);
scene.addMoney(moneyAmount.value);
return true;
@ -1856,7 +1856,7 @@ export abstract class HeldItemTransferModifier extends PokemonHeldItemModifier {
let tierItemModifiers = itemModifiers.filter(m => m.type.getOrInferTier(poolType) === highestItemTier);
const heldItemTransferPromises: Promise<void>[] = [];
for (let i = 0; i < transferredItemCount; i++) {
if (!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())) {
return false;
}
target.addTag(BattlerTagType.ENDURING, 1);
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
* @example Modifier Override [{name: "EXP_SHARE", count: 2}]
* @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}]
* types are listed in interface below
* - TempBattleStat is for TEMP_STAT_BOOSTER / X Items (Dire hit is separate)
@ -92,8 +92,8 @@ interface ModifierOverride {
count?: integer
type?: TempBattleStat|Stat|Nature|Type|BerryType
}
export const STARTING_MODIFIER_OVERRIDE: Array<ModifierOverride> = [];
export const OPP_MODIFIER_OVERRIDE: Array<ModifierOverride> = [];
export const STARTING_MODIFIER_OVERRIDE: Array<ModifierOverride> = [];
export const OPP_MODIFIER_OVERRIDE: Array<ModifierOverride> = [];
export const STARTING_HELD_ITEMS_OVERRIDE: Array<ModifierOverride> = [];
export const OPP_HELD_ITEMS_OVERRIDE: Array<ModifierOverride> = [];
export const STARTING_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) {
this.scene.ui.showText(i18next.t("menu:logInOrCreateAccount"));
}
this.scene.playSound("menu_open");
const loadData = () => {
updateUserInfo().then(() => this.scene.gameData.loadSystem().then(() => this.end()));
};
this.scene.ui.setMode(Mode.LOGIN_FORM, {
buttonActions: [
() => {
@ -138,7 +138,7 @@ export class LoginPhase extends Phase {
if (!this.scene.gameData.gender) {
this.scene.unshiftPhase(new SelectGenderPhase(this.scene));
}
handleTutorial(this.scene, Tutorial.Intro).then(() => super.end());
}
}
@ -319,7 +319,7 @@ export class TitlePhase extends Phase {
party.push(starterPokemon);
loadPokemonAssets.push(starterPokemon.loadAssets());
}
regenerateModifierPoolThresholds(party, ModifierPoolType.DAILY_STARTER);
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()))
@ -341,7 +341,7 @@ export class TitlePhase extends Phase {
this.end();
});
};
// If Online, calls seed fetch from db to generate daily run. If Offline, generates a daily run based on current date.
if (!Utils.isLocal) {
fetchDailyRunSeed().then(seed => {
@ -457,7 +457,7 @@ export class SelectGenderPhase extends Phase {
constructor(scene: BattleScene) {
super(scene);
}
start(): void {
super.start();
@ -771,11 +771,11 @@ export class EncounterPhase extends BattlePhase {
enemyPokemon.updateScale();
}
}
totalBst += enemyPokemon.getSpeciesForm().baseTotal;
loadEnemyAssets.push(enemyPokemon.loadAssets());
console.log(enemyPokemon.name, enemyPokemon.species.speciesId, enemyPokemon.stats);
});
@ -915,7 +915,7 @@ export class EncounterPhase extends BattlePhase {
const trainer = this.scene.currentBattle.trainer;
trainer.untint(100, "Sine.easeOut");
trainer.playAnim();
const doSummon = () => {
this.scene.currentBattle.started = true;
this.scene.playBgm(undefined);
@ -936,7 +936,7 @@ export class EncounterPhase extends BattlePhase {
doTrainerSummon();
}
};
const encounterMessages = this.scene.currentBattle.trainer.getEncounterMessages();
if (!encounterMessages?.length) {
@ -999,7 +999,7 @@ export class EncounterPhase extends BattlePhase {
}
this.scene.pushPhase(new ToggleDoublePositionPhase(this.scene, false));
}
if (this.scene.currentBattle.battleType !== BattleType.TRAINER && (this.scene.currentBattle.waveIndex > 1 || !this.scene.gameMode.isDaily)) {
const minPartySize = this.scene.currentBattle.double ? 2 : 1;
if (availablePartyMembers.length > minPartySize) {
@ -1061,7 +1061,7 @@ export class NextEncounterPhase extends EncounterPhase {
if (this.scene.lastEnemyTrainer) {
this.scene.lastEnemyTrainer.destroy();
}
if (!this.tryOverrideForBattleSpec()) {
this.doEncounterCommon();
}
@ -1278,7 +1278,7 @@ export class SummonPhase extends PartyMemberPokemonPhase {
if (partyMember.isFainted()) {
console.warn("The Pokemon about to be sent out is fainted. Attempting to resolve...");
const party = this.getParty();
// Find the first non-fainted Pokemon index above the current one
const nonFaintedIndex = party.findIndex((p, i) => i > this.partyMemberIndex && !p.isFainted());
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
[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]);
}
@ -1790,9 +1790,9 @@ export class CommandPhase extends FieldPhase {
switch (command) {
case Command.FIGHT:
let useStruggle = false;
if (cursor === -1 ||
playerPokemon.trySelectMove(cursor, args[0] as boolean) ||
(useStruggle = cursor > -1 && !playerPokemon.getMoveset().filter(m => m.isUsable(playerPokemon)).length)) {
if (cursor === -1 ||
playerPokemon.trySelectMove(cursor, args[0] as boolean) ||
(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 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];
@ -1814,8 +1814,8 @@ export class CommandPhase extends FieldPhase {
this.scene.ui.setMode(Mode.MESSAGE);
// Decides between a Disabled, Not Implemented, or No PP translation message
const errorMessage =
playerPokemon.summonData.disabledMove === move.moveId ? "battle:moveDisabled" :
const errorMessage =
playerPokemon.summonData.disabledMove === move.moveId ? "battle:moveDisabled" :
move.getName().endsWith(" (N)") ? "battle:moveNotImplemented" : "battle:moveNoPP";
const moveName = move.getName().replace(" (N)", ""); // Trims off the indicator
@ -1904,12 +1904,12 @@ export class CommandPhase extends FieldPhase {
} else if (trapTag) {
if(trapTag.sourceMove === Moves.INGRAIN && this.scene.getPokemonById(trapTag.sourceId).isOfType(Type.GHOST)) {
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.RUN };
break;
}
if (!isSwitch) {
if (!isSwitch) {
this.scene.ui.setMode(Mode.COMMAND, this.fieldIndex);
this.scene.ui.setMode(Mode.MESSAGE);
}
@ -2009,7 +2009,7 @@ export class EnemyCommandPhase extends FieldPhase {
if (partyMemberScores.length) {
const matchupScores = opponents.map(opp => enemyPokemon.getMatchupScore(opp));
const matchupScore = matchupScores.reduce((total, score) => total += score, 0) / matchupScores.length;
const sortedPartyMemberScores = trainer.getSortedPartyMemberMatchupScores(partyMemberScores);
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] =
{ command: Command.POKEMON, cursor: index, args: [ false ] };
battle.enemySwitchCounter++;
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() === b), null, bMove, bPriority);
if (aPriority.value !== bPriority.value) {
return aPriority.value < bPriority.value ? 1 : -1;
}
@ -2117,7 +2117,7 @@ export class TurnStartPhase extends FieldPhase {
if (battlerBypassSpeed[a].value !== battlerBypassSpeed[b].value) {
return battlerBypassSpeed[a].value ? -1 : 1;
}
const aIndex = order.indexOf(a);
const bIndex = order.indexOf(b);
@ -2231,10 +2231,10 @@ export class TurnEndPhase extends FieldPhase {
super.start();
this.scene.currentBattle.incrementTurn(this.scene);
const handlePokemon = (pokemon: Pokemon) => {
pokemon.lapseTags(BattlerTagLapseType.TURN_END);
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 })));
pokemon.summonData.disabledMove = Moves.NONE;
@ -2260,7 +2260,7 @@ export class TurnEndPhase extends FieldPhase {
};
this.executeForAll(handlePokemon);
this.scene.arena.lapseTags();
if (this.scene.arena.weather && !this.scene.arena.weather.lapse()) {
@ -2444,9 +2444,9 @@ export class MovePhase extends BattlePhase {
const doMove = () => {
this.pokemon.turnData.acted = true; // Record that the move was attempted, even if it fails
this.pokemon.lapseTags(BattlerTagLapseType.PRE_MOVE);
let ppUsed = 1;
// Filter all opponents to include only those this move is targeting
const targetedOpponents = this.pokemon.getOpponents().filter(o => this.targets.includes(o.getBattlerIndex()));
@ -2458,7 +2458,7 @@ export class MovePhase extends BattlePhase {
ppUsed++;
}
}
if (!this.followUp && this.canMove() && !this.cancelled) {
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
if ((moveQueue.length && moveQueue[0].move === Moves.NONE) || !targets.length) {
if ((moveQueue.length && moveQueue[0].move === Moves.NONE) || !targets.length) {
this.showFailedText();
this.cancel();
// 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 });
@ -2525,7 +2525,7 @@ export class MovePhase extends BattlePhase {
this.showFailedText(failedText);
}
}
this.end();
};
@ -2533,7 +2533,7 @@ export class MovePhase extends BattlePhase {
this.pokemon.status.incrementTurn();
let activated = false;
let healed = false;
switch (this.pokemon.status.effect) {
case StatusEffect.PARALYSIS:
if (!this.pokemon.randSeedInt(4)) {
@ -2553,7 +2553,7 @@ export class MovePhase extends BattlePhase {
this.cancelled = activated;
break;
}
if (activated) {
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)));
@ -2587,7 +2587,7 @@ export class MovePhase extends BattlePhase {
if (this.pokemon.getTag(BattlerTagType.RECHARGING || BattlerTagType.INTERRUPTED)) {
return;
}
this.scene.queueMessage(getPokemonMessage(this.pokemon, ` used\n${this.move.getName()}!`), 500);
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 {
public move: PokemonMove;
protected targets: BattlerIndex[];
constructor(scene: BattleScene, battlerIndex: BattlerIndex, targets: BattlerIndex[], move: PokemonMove) {
super(scene, battlerIndex);
@ -2634,7 +2634,7 @@ export class MoveEffectPhase extends PokemonPhase {
if (overridden.value) {
return this.end();
}
user.lapseTags(BattlerTagLapseType.MOVE_EFFECT);
if (user.turnData.hitsLeft === undefined) {
@ -2687,7 +2687,7 @@ export class MoveEffectPhase extends PokemonPhase {
const firstHit = moveHistoryEntry.result !== MoveResult.SUCCESS;
moveHistoryEntry.result = MoveResult.SUCCESS;
const hitResult = !isProtected ? target.apply(user, this.move) : HitResult.NO_EFFECT;
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
const postTarget = applyFilteredMoveAttrs((attr: MoveAttr) => attr instanceof MoveEffectAttr && (attr as MoveEffectAttr).trigger === MoveEffectTrigger.POST_TARGET,
user, null, this.move.getMove());
if (applyAttrs.length) { // If there is a pending asynchronous move effect, do this after
applyAttrs[applyAttrs.length - 1]?.then(() => postTarget);
} else { // Otherwise, push a new asynchronous move effect
@ -2765,7 +2765,7 @@ export class MoveEffectPhase extends PokemonPhase {
this.scene.applyModifiers(HitHealModifier, this.player, user);
}
}
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) {
return true;
}
const hiddenTag = target.getTag(HiddenTag);
if (hiddenTag && !this.move.getMove().getAttrs(HitsTagAttr).filter(hta => (hta as HitsTagAttr).tagType === hiddenTag.tagType).length) {
return false;
@ -2817,7 +2817,7 @@ export class MoveEffectPhase extends PokemonPhase {
if (!isOhko && this.scene.arena.getTag(ArenaTagType.GRAVITY)) {
moveAccuracy.value = Math.floor(moveAccuracy.value * 1.67);
}
const userAccuracyLevel = new Utils.IntegerHolder(user.summonData.battleStats[BattleStat.ACC]);
const targetEvasionLevel = new Utils.IntegerHolder(target.summonData.battleStats[BattleStat.EVA]);
applyAbAttrs(IgnoreOpponentStatChangesAbAttr, target, null, userAccuracyLevel);
@ -2985,7 +2985,7 @@ export class StatChangePhase extends PokemonPhase {
if (!cancelled.value && !this.selfTarget && this.levels < 0) {
applyPreStatChangeAbAttrs(ProtectStatAbAttr, this.getPokemon(), stat, cancelled);
}
return !cancelled.value;
});
@ -3009,15 +3009,15 @@ export class StatChangePhase extends PokemonPhase {
for (const stat of filteredStats) {
pokemon.summonData.battleStats[stat] = Math.max(Math.min(pokemon.summonData.battleStats[stat] + levels.value, 6), -6);
}
if (levels.value > 0 && this.canBeCopied) {
for (const opponent of pokemon.getOpponents()) {
applyAbAttrs(StatChangeCopyAbAttr, opponent, null, this.stats, levels.value);
}
}
applyPostStatChangeAbAttrs(PostStatChangeAbAttr, pokemon, filteredStats, this.levels, this.selfTarget);
pokemon.updateInfo();
handleTutorial(this.scene, Tutorial.Stat_Change).then(() => super.end());
@ -3061,7 +3061,7 @@ export class StatChangePhase extends PokemonPhase {
duration: 1500,
y: `${levels.value >= 1 ? "-" : "+"}=${160 * 6}`
});
this.scene.time.delayedCall(1750, () => {
pokemon.disableMask();
end();
@ -3146,7 +3146,7 @@ export class WeatherEffectPhase extends CommonAnimPhase {
start() {
if (this.weather.isDamaging()) {
const cancelled = new Utils.BooleanHolder(false);
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())) {
this.scene.pushPhase(new BattleEndPhase(this.scene));
if (this.scene.currentBattle.battleType === BattleType.TRAINER) {
@ -3701,7 +3701,7 @@ export class TrainerVictoryPhase extends BattlePhase {
let message: string;
this.scene.executeWithSeedOffset(() => message = Utils.randSeedItem(victoryMessages), this.scene.currentBattle.waveIndex);
const messagePages = message.split(/\$/g).map(m => m.trim());
for (let p = messagePages.length - 1; p >= 0; p--) {
const originalFunc = showMessageOrEnd;
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));
const availablePartyMembers = this.scene.getParty().filter(p => !p.isFainted()).length;
this.scene.pushPhase(new SummonPhase(this.scene, 0));
if (this.scene.currentBattle.double && availablePartyMembers > 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.ui.clearText();
this.scene.ui.fadeIn(1000).then(() => {
this.scene.ui.showText("", null, () => {
this.scene.ui.getMessageHandler().bg.setVisible(true);
this.end();
@ -4375,7 +4375,7 @@ export class PokemonHealPhase extends CommonAnimPhase {
end() {
const pokemon = this.getPokemon();
if (!pokemon.isOnField() || (!this.revive && !pokemon.isActive())) {
super.end();
return;
@ -4538,7 +4538,7 @@ export class AttemptCapturePhase extends PokemonPhase {
} else {
this.scene.playSound("pb_lock");
addPokeballCaptureStars(this.scene, this.pokeball);
const pbTint = this.scene.add.sprite(this.pokeball.x, this.pokeball.y, "pb", "pb");
pbTint.setOrigin(this.pokeball.originX, this.pokeball.originY);
pbTint.setTintFill(0);
@ -4594,7 +4594,7 @@ export class AttemptCapturePhase extends PokemonPhase {
ease: "Sine.easeOut",
scale: 1
});
this.scene.currentBattle.lastUsedPokeball = this.pokeballType;
this.removePb();
this.end();
@ -4625,7 +4625,7 @@ export class AttemptCapturePhase extends PokemonPhase {
this.scene.pokemonInfoContainer.show(pokemon, true);
this.scene.gameData.updateSpeciesDexIvs(pokemon.species.getRootSpeciesId(true), pokemon.ivs);
this.scene.ui.showText(i18next.t("battle:pokemonCaught", { pokemonName: pokemon.name }), null, () => {
const end = () => {
this.scene.pokemonInfoContainer.hide();
@ -4718,7 +4718,7 @@ export class AttemptRunPhase extends PokemonPhase {
if (playerPokemon.randSeedInt(256) < escapeChance.value) {
this.scene.playSound("flee");
this.scene.queueMessage(i18next.t("battle:runAwaySuccess"), null, true, 500);
this.scene.tweens.add({
targets: [ this.scene.arenaEnemy, enemyField ].flat(),
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);
}
getPoolType(): ModifierPoolType {
return ModifierPoolType.PLAYER;
}
@ -4961,11 +4961,11 @@ export class EggLapsePhase extends Phase {
if (eggsToHatch.length) {
this.scene.queueMessage(i18next.t("battle:eggHatching"));
for (const egg of eggsToHatch) {
this.scene.unshiftPhase(new EggHatchPhase(this.scene, egg));
}
}
this.end();
}
@ -4983,7 +4983,7 @@ export class AddEnemyBuffModifierPhase extends Phase {
const tier = !(waveIndex % 1000) ? ModifierTier.ULTRA : !(waveIndex % 250) ? ModifierTier.GREAT : ModifierTier.COMMON;
regenerateModifierPoolThresholds(this.scene.getEnemyParty(), ModifierPoolType.ENEMY_BUFF);
const count = Math.ceil(waveIndex / 250);
for (let i = 0; i < count; i++) {
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[]) {
super(scene);
this.trainerTypes = trainerTypes;
}
@ -5132,7 +5132,7 @@ export class TrainerMessageTestPhase extends BattlePhase {
super.start();
const testMessages: string[] = [];
for (const t of Object.keys(trainerConfigs)) {
const type = parseInt(t);
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.set4fv("tone", tone);
this.bindTexture(this.game.textures.get("tera").source[0].glTexture, 1);
if ((gameObject.scene as BattleScene).fusionPaletteSwaps) {
const spriteColors = ((ignoreOverride && data["spriteColorsBase"]) || data["spriteColors"] || []) 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));
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);
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -24,7 +24,7 @@ export default class AchvsUiHandler extends MessageUiHandler {
setup() {
const ui = this.getUi();
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);
@ -40,7 +40,7 @@ export default class AchvsUiHandler extends MessageUiHandler {
this.achvIconsBg.setOrigin(0, 0);
this.achvIconsContainer = this.scene.add.container(6, headerBg.height + 6);
this.achvIcons = [];
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;
return true;
}
return false;
}
}

View File

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

View File

@ -49,7 +49,7 @@ export default class BattleInfo extends Phaser.GameObjects.Container {
private type2Icon: Phaser.GameObjects.Sprite;
private type3Icon: Phaser.GameObjects.Sprite;
private expBar: Phaser.GameObjects.Image;
public expMaskRect: Phaser.GameObjects.Graphics;
private statsContainer: Phaser.GameObjects.Container;
@ -268,7 +268,7 @@ export default class BattleInfo extends Phaser.GameObjects.Container {
const opponentPokemonDexAttr = pokemon.getDexAttr();
// 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
@ -377,7 +377,7 @@ export default class BattleInfo extends Phaser.GameObjects.Container {
if (boss !== this.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.hpBar.x += 38 * (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.statsBox.setTexture(`${this.getTextureName()}_stats`);
}
this.bossSegments = boss ? pokemon.bossSegments : 0;
this.updateBossSegmentDividers(pokemon);
}
@ -410,12 +410,12 @@ export default class BattleInfo extends Phaser.GameObjects.Container {
}
}
}
setOffset(offset: boolean): void {
if (this.offset === offset) {
return;
}
this.offset = offset;
this.x += 10 * (offset === this.player ? 1 : -1);
@ -435,7 +435,7 @@ export default class BattleInfo extends Phaser.GameObjects.Container {
this.updateNameText(pokemon);
this.genderText.setPositionRelative(this.nameText, this.nameText.displayWidth, 0);
}
const teraType = pokemon.getTeraType();
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.setVisible(!!this.lastStatus);
if (!this.player && this.ownedIcon.visible) {
this.ownedIcon.setAlpha(this.statusIndicator.visible ? 0 : 1);
}
@ -543,7 +543,7 @@ export default class BattleInfo extends Phaser.GameObjects.Container {
? pokemon.summonData.battleStats
: battleStatOrder.map(() => 0);
const battleStatsStr = battleStats.join("");
if (this.lastBattleStats !== battleStatsStr) {
this.updateBattleStats(battleStats);
this.lastBattleStats = battleStatsStr;

View File

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

View File

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

View File

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

View File

@ -42,7 +42,7 @@ export default class ConfirmUiHandler extends AbstractOptionSelectUiHandler {
};
super.show([ config ]);
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);

View File

@ -30,7 +30,7 @@ export class DailyRunScoreboard extends Phaser.GameObjects.Container {
private pageCount: integer;
private page: integer;
private category: ScoreboardCategory;
private _isUpdating: boolean;
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.
*
*
* 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 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.
*
*
* @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.
*/
@ -209,7 +209,7 @@ export class DailyRunScoreboard extends Phaser.GameObjects.Container {
}).finally(() => {
this.isUpdating = false;
});
}).catch(err => {
}).catch(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.setOrigin(0, 0);
this.eggGachaOverlay.setAlpha(0);
this.eggGachaContainer.add(this.eggGachaOverlay);
this.eggGachaSummaryContainer = this.scene.add.container(0, 0);
this.eggGachaSummaryContainer.setVisible(false);
this.eggGachaContainer.add(this.eggGachaSummaryContainer);
const gachaMessageBoxContainer = this.scene.add.container(0, 148);
this.eggGachaContainer.add(gachaMessageBoxContainer);
@ -505,7 +505,7 @@ export default class EggGachaUiHandler extends MessageUiHandler {
if (!text) {
text = this.defaultText;
}
if (text?.indexOf("\n") === -1) {
this.eggGachaMessageBox.setSize(320, 32);
this.eggGachaMessageBox.setY(0);
@ -545,7 +545,7 @@ export default class EggGachaUiHandler extends MessageUiHandler {
return false;
}
} else {
if (this.eggGachaSummaryContainer.visible) {
if (button === Button.ACTION || button === Button.CANCEL) {
this.hideSummary();
@ -646,7 +646,7 @@ export default class EggGachaUiHandler extends MessageUiHandler {
}
}
}
if (success) {
ui.playSelect();
} else if (error) {

View File

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

View File

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

View File

@ -102,7 +102,7 @@ export default class GameStatsUiHandler extends UiHandler {
setup() {
const ui = this.getUi();
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);
@ -156,9 +156,9 @@ export default class GameStatsUiHandler extends UiHandler {
super.show(args);
this.setCursor(0);
this.updateStats();
this.gameStatsContainer.setVisible(true);
this.getUi().moveTo(this.gameStatsContainer, this.getUi().length - 1);

View File

@ -54,7 +54,7 @@ export default class MenuUiHandler extends MessageUiHandler {
setup() {
const ui = this.getUi();
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);
@ -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.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.setOrigin(0, 0);

View File

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

View File

@ -39,7 +39,7 @@ export abstract class ModalUiHandler extends UiHandler {
setup() {
const ui = this.getUi();
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);
@ -106,7 +106,7 @@ export abstract class ModalUiHandler extends UiHandler {
updateContainer(config?: ModalConfig): void {
const [ marginTop, marginRight, marginBottom, marginLeft ] = this.getMargin(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));

View File

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

View File

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

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