mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-09-23 23:13:42 +02:00
Run biome
This commit is contained in:
parent
6818d22a67
commit
75914269d7
@ -115,10 +115,10 @@ import { AbilityBar } from "#ui/containers/ability-bar";
|
|||||||
import { ArenaFlyout } from "#ui/containers/arena-flyout";
|
import { ArenaFlyout } from "#ui/containers/arena-flyout";
|
||||||
import { CandyBar } from "#ui/containers/candy-bar";
|
import { CandyBar } from "#ui/containers/candy-bar";
|
||||||
import { CharSprite } from "#ui/containers/char-sprite";
|
import { CharSprite } from "#ui/containers/char-sprite";
|
||||||
import { ItemBar } from "#ui/item-bar-ui";
|
|
||||||
import { PartyExpBar } from "#ui/containers/party-exp-bar";
|
import { PartyExpBar } from "#ui/containers/party-exp-bar";
|
||||||
import { PokeballTray } from "#ui/containers/pokeball-tray";
|
import { PokeballTray } from "#ui/containers/pokeball-tray";
|
||||||
import { PokemonInfoContainer } from "#ui/containers/pokemon-info-container";
|
import { PokemonInfoContainer } from "#ui/containers/pokemon-info-container";
|
||||||
|
import { ItemBar } from "#ui/item-bar-ui";
|
||||||
import { addTextObject, getTextColor } from "#ui/text";
|
import { addTextObject, getTextColor } from "#ui/text";
|
||||||
import { UI } from "#ui/ui";
|
import { UI } from "#ui/ui";
|
||||||
import { addUiThemeOverrides } from "#ui/ui-theme";
|
import { addUiThemeOverrides } from "#ui/ui-theme";
|
||||||
@ -2907,7 +2907,7 @@ export class BattleScene extends SceneBase {
|
|||||||
|
|
||||||
for (const t in tokens) {
|
for (const t in tokens) {
|
||||||
(allTrainerItems[t] as EnemyAttackStatusEffectChanceTrainerItem).apply(this.enemyTrainerItems, {
|
(allTrainerItems[t] as EnemyAttackStatusEffectChanceTrainerItem).apply(this.enemyTrainerItems, {
|
||||||
pokemon: pokemon,
|
pokemon,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4640,8 +4640,8 @@ export class PostTurnRestoreBerryAbAttr extends PostTurnAbAttr {
|
|||||||
.getHeldItems()
|
.getHeldItems()
|
||||||
.filter(
|
.filter(
|
||||||
bm =>
|
bm =>
|
||||||
isItemInCategory(bm, HeldItemCategoryId.BERRY) &&
|
isItemInCategory(bm, HeldItemCategoryId.BERRY)
|
||||||
pokemon.heldItemManager.getStack(bm) < allHeldItems[bm].maxStackCount,
|
&& pokemon.heldItemManager.getStack(bm) < allHeldItems[bm].maxStackCount,
|
||||||
)
|
)
|
||||||
.map(bm => (allHeldItems[bm] as BerryHeldItem).berryType),
|
.map(bm => (allHeldItems[bm] as BerryHeldItem).berryType),
|
||||||
);
|
);
|
||||||
@ -6261,16 +6261,14 @@ class ForceSwitchOutHelper {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!allyPokemon?.isActive(true)) {
|
if (!allyPokemon?.isActive(true) && switchOutTarget.hp) {
|
||||||
if (switchOutTarget.hp) {
|
globalScene.phaseManager.pushNew("BattleEndPhase", false);
|
||||||
globalScene.phaseManager.pushNew("BattleEndPhase", false);
|
|
||||||
|
|
||||||
if (globalScene.gameMode.hasRandomBiomes || globalScene.isNewBiome()) {
|
if (globalScene.gameMode.hasRandomBiomes || globalScene.isNewBiome()) {
|
||||||
globalScene.phaseManager.pushNew("SelectBiomePhase");
|
globalScene.phaseManager.pushNew("SelectBiomePhase");
|
||||||
}
|
|
||||||
|
|
||||||
globalScene.phaseManager.pushNew("NewBattlePhase");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
globalScene.phaseManager.pushNew("NewBattlePhase");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
@ -40,11 +40,11 @@ const namespace = "mysteryEncounters/absoluteAvarice";
|
|||||||
|
|
||||||
function berrySprite(spriteKey: string, x: number, y: number): MysteryEncounterSpriteConfig {
|
function berrySprite(spriteKey: string, x: number, y: number): MysteryEncounterSpriteConfig {
|
||||||
return {
|
return {
|
||||||
spriteKey: spriteKey,
|
spriteKey,
|
||||||
fileRoot: "items",
|
fileRoot: "items",
|
||||||
isItem: true,
|
isItem: true,
|
||||||
x: x,
|
x,
|
||||||
y: y,
|
y,
|
||||||
hidden: true,
|
hidden: true,
|
||||||
disableAnimation: true,
|
disableAnimation: true,
|
||||||
};
|
};
|
||||||
|
@ -158,7 +158,7 @@ export const DarkDealEncounter: MysteryEncounter = MysteryEncounterBuilder.withE
|
|||||||
// Store removed pokemon types
|
// Store removed pokemon types
|
||||||
encounter.misc = {
|
encounter.misc = {
|
||||||
removedTypes: removedPokemon.getTypes(),
|
removedTypes: removedPokemon.getTypes(),
|
||||||
itemConfig: itemConfig,
|
itemConfig,
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
.withOptionPhase(async () => {
|
.withOptionPhase(async () => {
|
||||||
|
@ -288,8 +288,8 @@ export const GlobalTradeSystemEncounter: MysteryEncounter = MysteryEncounterBuil
|
|||||||
if (tradePokemon.species.abilityHidden && tradePokemon.abilityIndex < hiddenIndex) {
|
if (tradePokemon.species.abilityHidden && tradePokemon.abilityIndex < hiddenIndex) {
|
||||||
const hiddenAbilityChance = new NumberHolder(64);
|
const hiddenAbilityChance = new NumberHolder(64);
|
||||||
globalScene.applyPlayerItems(TrainerItemEffect.HIDDEN_ABILITY_CHANCE_BOOSTER, {
|
globalScene.applyPlayerItems(TrainerItemEffect.HIDDEN_ABILITY_CHANCE_BOOSTER, {
|
||||||
numberHolder: hiddenAbilityChance,
|
numberHolder: hiddenAbilityChance,
|
||||||
});
|
});
|
||||||
|
|
||||||
const hasHiddenAbility = !randSeedInt(hiddenAbilityChance.value);
|
const hasHiddenAbility = !randSeedInt(hiddenAbilityChance.value);
|
||||||
|
|
||||||
|
@ -100,7 +100,7 @@ export const ShadyVitaminDealerEncounter: MysteryEncounter = MysteryEncounterBui
|
|||||||
encounter.setDialogueToken("boost2", allHeldItems[items[1]].name);
|
encounter.setDialogueToken("boost2", allHeldItems[items[1]].name);
|
||||||
encounter.misc = {
|
encounter.misc = {
|
||||||
chosenPokemon: pokemon,
|
chosenPokemon: pokemon,
|
||||||
items: items,
|
items,
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -180,7 +180,7 @@ export const ShadyVitaminDealerEncounter: MysteryEncounter = MysteryEncounterBui
|
|||||||
encounter.setDialogueToken("boost2", allHeldItems[items[1]].name);
|
encounter.setDialogueToken("boost2", allHeldItems[items[1]].name);
|
||||||
encounter.misc = {
|
encounter.misc = {
|
||||||
chosenPokemon: pokemon,
|
chosenPokemon: pokemon,
|
||||||
items: items,
|
items,
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -907,8 +907,8 @@ export class HeldItemRequirement extends EncounterSceneRequirement {
|
|||||||
override getDialogueToken(pokemon?: PlayerPokemon): [string, string] {
|
override getDialogueToken(pokemon?: PlayerPokemon): [string, string] {
|
||||||
const requiredItems = pokemon?.getHeldItems().filter(item => {
|
const requiredItems = pokemon?.getHeldItems().filter(item => {
|
||||||
return (
|
return (
|
||||||
this.requiredHeldItems.some(heldItem => item === heldItem) &&
|
this.requiredHeldItems.some(heldItem => item === heldItem)
|
||||||
(!this.requireTransferable || allHeldItems[item].isTransferable)
|
&& (!this.requireTransferable || allHeldItems[item].isTransferable)
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
if (requiredItems && requiredItems.length > 0) {
|
if (requiredItems && requiredItems.length > 0) {
|
||||||
|
@ -6,124 +6,123 @@ import type { ObjectValues } from "#types/type-helpers";
|
|||||||
*/
|
*/
|
||||||
export const FormChangeItemId = {
|
export const FormChangeItemId = {
|
||||||
// Mega Stones
|
// Mega Stones
|
||||||
ABOMASITE: 0x0B01,
|
ABOMASITE: 0x0b01,
|
||||||
ABSOLITE: 0x0B02,
|
ABSOLITE: 0x0b02,
|
||||||
AERODACTYLITE: 0x0B03,
|
AERODACTYLITE: 0x0b03,
|
||||||
AGGRONITE: 0x0B04,
|
AGGRONITE: 0x0b04,
|
||||||
ALAKAZITE: 0x0B05,
|
ALAKAZITE: 0x0b05,
|
||||||
ALTARIANITE: 0x0B06,
|
ALTARIANITE: 0x0b06,
|
||||||
AMPHAROSITE: 0x0B07,
|
AMPHAROSITE: 0x0b07,
|
||||||
AUDINITE: 0x0B08,
|
AUDINITE: 0x0b08,
|
||||||
BANETTITE: 0x0B09,
|
BANETTITE: 0x0b09,
|
||||||
BEEDRILLITE: 0x0B0A,
|
BEEDRILLITE: 0x0b0a,
|
||||||
BLASTOISINITE: 0x0B0B,
|
BLASTOISINITE: 0x0b0b,
|
||||||
BLAZIKENITE: 0x0B0C,
|
BLAZIKENITE: 0x0b0c,
|
||||||
CAMERUPTITE: 0x0B0D,
|
CAMERUPTITE: 0x0b0d,
|
||||||
CHARIZARDITE_X: 0x0B0E,
|
CHARIZARDITE_X: 0x0b0e,
|
||||||
CHARIZARDITE_Y: 0x0B0F,
|
CHARIZARDITE_Y: 0x0b0f,
|
||||||
DIANCITE: 0x0B10,
|
DIANCITE: 0x0b10,
|
||||||
GALLADITE: 0x0B11,
|
GALLADITE: 0x0b11,
|
||||||
GARCHOMPITE: 0x0B12,
|
GARCHOMPITE: 0x0b12,
|
||||||
GARDEVOIRITE: 0x0B13,
|
GARDEVOIRITE: 0x0b13,
|
||||||
GENGARITE: 0x0B14,
|
GENGARITE: 0x0b14,
|
||||||
GLALITITE: 0x0B15,
|
GLALITITE: 0x0b15,
|
||||||
GYARADOSITE: 0x0B16,
|
GYARADOSITE: 0x0b16,
|
||||||
HERACRONITE: 0x0B17,
|
HERACRONITE: 0x0b17,
|
||||||
HOUNDOOMINITE: 0x0B18,
|
HOUNDOOMINITE: 0x0b18,
|
||||||
KANGASKHANITE: 0x0B19,
|
KANGASKHANITE: 0x0b19,
|
||||||
LATIASITE: 0x0B1A,
|
LATIASITE: 0x0b1a,
|
||||||
LATIOSITE: 0x0B1B,
|
LATIOSITE: 0x0b1b,
|
||||||
LOPUNNITE: 0x0B1C,
|
LOPUNNITE: 0x0b1c,
|
||||||
LUCARIONITE: 0x0B1D,
|
LUCARIONITE: 0x0b1d,
|
||||||
MANECTITE: 0x0B1E,
|
MANECTITE: 0x0b1e,
|
||||||
MAWILITE: 0x0B1F,
|
MAWILITE: 0x0b1f,
|
||||||
MEDICHAMITE: 0x0B20,
|
MEDICHAMITE: 0x0b20,
|
||||||
METAGROSSITE: 0x0B21,
|
METAGROSSITE: 0x0b21,
|
||||||
MEWTWONITE_X: 0x0B22,
|
MEWTWONITE_X: 0x0b22,
|
||||||
MEWTWONITE_Y: 0x0B23,
|
MEWTWONITE_Y: 0x0b23,
|
||||||
PIDGEOTITE: 0x0B24,
|
PIDGEOTITE: 0x0b24,
|
||||||
PINSIRITE: 0x0B25,
|
PINSIRITE: 0x0b25,
|
||||||
RAYQUAZITE: 0x0B26,
|
RAYQUAZITE: 0x0b26,
|
||||||
SABLENITE: 0x0B27,
|
SABLENITE: 0x0b27,
|
||||||
SALAMENCITE: 0x0B28,
|
SALAMENCITE: 0x0b28,
|
||||||
SCEPTILITE: 0x0B29,
|
SCEPTILITE: 0x0b29,
|
||||||
SCIZORITE: 0x0B2A,
|
SCIZORITE: 0x0b2a,
|
||||||
SHARPEDONITE: 0x0B2B,
|
SHARPEDONITE: 0x0b2b,
|
||||||
SLOWBRONITE: 0x0B2C,
|
SLOWBRONITE: 0x0b2c,
|
||||||
STEELIXITE: 0x0B2D,
|
STEELIXITE: 0x0b2d,
|
||||||
SWAMPERTITE: 0x0B2E,
|
SWAMPERTITE: 0x0b2e,
|
||||||
TYRANITARITE: 0x0B2F,
|
TYRANITARITE: 0x0b2f,
|
||||||
VENUSAURITE: 0x0B30,
|
VENUSAURITE: 0x0b30,
|
||||||
|
|
||||||
// Other rare form change items
|
// Other rare form change items
|
||||||
BLUE_ORB: 0x0B51,
|
BLUE_ORB: 0x0b51,
|
||||||
RED_ORB: 0x0B52,
|
RED_ORB: 0x0b52,
|
||||||
ADAMANT_CRYSTAL: 0x0B53,
|
ADAMANT_CRYSTAL: 0x0b53,
|
||||||
LUSTROUS_GLOBE: 0x0B54,
|
LUSTROUS_GLOBE: 0x0b54,
|
||||||
GRISEOUS_CORE: 0x0B55,
|
GRISEOUS_CORE: 0x0b55,
|
||||||
REVEAL_GLASS: 0x0B56,
|
REVEAL_GLASS: 0x0b56,
|
||||||
MAX_MUSHROOMS: 0x0B57,
|
MAX_MUSHROOMS: 0x0b57,
|
||||||
DARK_STONE: 0x0B58,
|
DARK_STONE: 0x0b58,
|
||||||
LIGHT_STONE: 0x0B59,
|
LIGHT_STONE: 0x0b59,
|
||||||
PRISON_BOTTLE: 0x0B5A,
|
PRISON_BOTTLE: 0x0b5a,
|
||||||
RUSTED_SWORD: 0x0B5B,
|
RUSTED_SWORD: 0x0b5b,
|
||||||
RUSTED_SHIELD: 0x0B5C,
|
RUSTED_SHIELD: 0x0b5c,
|
||||||
ICY_REINS_OF_UNITY: 0x0B5D,
|
ICY_REINS_OF_UNITY: 0x0b5d,
|
||||||
SHADOW_REINS_OF_UNITY: 0x0B5E,
|
SHADOW_REINS_OF_UNITY: 0x0b5e,
|
||||||
ULTRANECROZIUM_Z: 0x0B5F,
|
ULTRANECROZIUM_Z: 0x0b5f,
|
||||||
|
|
||||||
// less rare form change items
|
// less rare form change items
|
||||||
SHARP_METEORITE: 0x0C01,
|
SHARP_METEORITE: 0x0c01,
|
||||||
HARD_METEORITE: 0x0C02,
|
HARD_METEORITE: 0x0c02,
|
||||||
SMOOTH_METEORITE: 0x0C03,
|
SMOOTH_METEORITE: 0x0c03,
|
||||||
GRACIDEA: 0x0C04,
|
GRACIDEA: 0x0c04,
|
||||||
SHOCK_DRIVE: 0x0C05,
|
SHOCK_DRIVE: 0x0c05,
|
||||||
BURN_DRIVE: 0x0C06,
|
BURN_DRIVE: 0x0c06,
|
||||||
CHILL_DRIVE: 0x0C07,
|
CHILL_DRIVE: 0x0c07,
|
||||||
DOUSE_DRIVE: 0x0C08,
|
DOUSE_DRIVE: 0x0c08,
|
||||||
N_SOLARIZER: 0x0C09,
|
N_SOLARIZER: 0x0c09,
|
||||||
N_LUNARIZER: 0x0C0A,
|
N_LUNARIZER: 0x0c0a,
|
||||||
WELLSPRING_MASK: 0x0C0B,
|
WELLSPRING_MASK: 0x0c0b,
|
||||||
HEARTHFLAME_MASK: 0x0C0C,
|
HEARTHFLAME_MASK: 0x0c0c,
|
||||||
CORNERSTONE_MASK: 0x0C0D,
|
CORNERSTONE_MASK: 0x0c0d,
|
||||||
FIST_PLATE: 0x0C0E,
|
FIST_PLATE: 0x0c0e,
|
||||||
SKY_PLATE: 0x0C0F,
|
SKY_PLATE: 0x0c0f,
|
||||||
TOXIC_PLATE: 0x0C10,
|
TOXIC_PLATE: 0x0c10,
|
||||||
EARTH_PLATE: 0x0C11,
|
EARTH_PLATE: 0x0c11,
|
||||||
STONE_PLATE: 0x0C12,
|
STONE_PLATE: 0x0c12,
|
||||||
INSECT_PLATE: 0x0C13,
|
INSECT_PLATE: 0x0c13,
|
||||||
SPOOKY_PLATE: 0x0C14,
|
SPOOKY_PLATE: 0x0c14,
|
||||||
IRON_PLATE: 0x0C15,
|
IRON_PLATE: 0x0c15,
|
||||||
FLAME_PLATE: 0x0C16,
|
FLAME_PLATE: 0x0c16,
|
||||||
SPLASH_PLATE: 0x0C17,
|
SPLASH_PLATE: 0x0c17,
|
||||||
MEADOW_PLATE: 0x0C18,
|
MEADOW_PLATE: 0x0c18,
|
||||||
ZAP_PLATE: 0x0C19,
|
ZAP_PLATE: 0x0c19,
|
||||||
MIND_PLATE: 0x0C1A,
|
MIND_PLATE: 0x0c1a,
|
||||||
ICICLE_PLATE: 0x0C1B,
|
ICICLE_PLATE: 0x0c1b,
|
||||||
DRACO_PLATE: 0x0C1C,
|
DRACO_PLATE: 0x0c1c,
|
||||||
DREAD_PLATE: 0x0C1D,
|
DREAD_PLATE: 0x0c1d,
|
||||||
PIXIE_PLATE: 0x0C1E,
|
PIXIE_PLATE: 0x0c1e,
|
||||||
BLANK_PLATE: 0x0C1F, // TODO: Find a potential use for this
|
BLANK_PLATE: 0x0c1f, // TODO: Find a potential use for this
|
||||||
LEGEND_PLATE: 0x0C20, // TODO: Find a potential use for this
|
LEGEND_PLATE: 0x0c20, // TODO: Find a potential use for this
|
||||||
FIGHTING_MEMORY: 0x0C21,
|
FIGHTING_MEMORY: 0x0c21,
|
||||||
FLYING_MEMORY: 0x0C22,
|
FLYING_MEMORY: 0x0c22,
|
||||||
POISON_MEMORY: 0x0C23,
|
POISON_MEMORY: 0x0c23,
|
||||||
GROUND_MEMORY: 0x0C24,
|
GROUND_MEMORY: 0x0c24,
|
||||||
ROCK_MEMORY: 0x0C25,
|
ROCK_MEMORY: 0x0c25,
|
||||||
BUG_MEMORY: 0x0C26,
|
BUG_MEMORY: 0x0c26,
|
||||||
GHOST_MEMORY: 0x0C27,
|
GHOST_MEMORY: 0x0c27,
|
||||||
STEEL_MEMORY: 0x0C28,
|
STEEL_MEMORY: 0x0c28,
|
||||||
FIRE_MEMORY: 0x0C29,
|
FIRE_MEMORY: 0x0c29,
|
||||||
WATER_MEMORY: 0x0C2A,
|
WATER_MEMORY: 0x0c2a,
|
||||||
GRASS_MEMORY: 0x0C2B,
|
GRASS_MEMORY: 0x0c2b,
|
||||||
ELECTRIC_MEMORY: 0x0C2C,
|
ELECTRIC_MEMORY: 0x0c2c,
|
||||||
PSYCHIC_MEMORY: 0x0C2D,
|
PSYCHIC_MEMORY: 0x0c2d,
|
||||||
ICE_MEMORY: 0x0C2E,
|
ICE_MEMORY: 0x0c2e,
|
||||||
DRAGON_MEMORY: 0x0C2F,
|
DRAGON_MEMORY: 0x0c2f,
|
||||||
DARK_MEMORY: 0x0C30,
|
DARK_MEMORY: 0x0c30,
|
||||||
FAIRY_MEMORY: 0x0C31,
|
FAIRY_MEMORY: 0x0c31,
|
||||||
NORMAL_MEMORY: 0x0C32,
|
NORMAL_MEMORY: 0x0c32,
|
||||||
} as const;
|
} as const;
|
||||||
|
|
||||||
export type FormChangeItemId = ObjectValues<typeof FormChangeItemId>
|
export type FormChangeItemId = ObjectValues<typeof FormChangeItemId>;
|
||||||
|
|
||||||
|
@ -15,8 +15,8 @@ export const HeldItemId = {
|
|||||||
APICOT_BERRY: 0x0107,
|
APICOT_BERRY: 0x0107,
|
||||||
SALAC_BERRY: 0x0108,
|
SALAC_BERRY: 0x0108,
|
||||||
LANSAT_BERRY: 0x0109,
|
LANSAT_BERRY: 0x0109,
|
||||||
STARF_BERRY: 0x010A,
|
STARF_BERRY: 0x010a,
|
||||||
LEPPA_BERRY: 0x010B,
|
LEPPA_BERRY: 0x010b,
|
||||||
|
|
||||||
// Other items that are consumed
|
// Other items that are consumed
|
||||||
REVIVER_SEED: 0x0201,
|
REVIVER_SEED: 0x0201,
|
||||||
@ -32,12 +32,12 @@ export const HeldItemId = {
|
|||||||
SILVER_POWDER: 0x0307,
|
SILVER_POWDER: 0x0307,
|
||||||
SPELL_TAG: 0x0308,
|
SPELL_TAG: 0x0308,
|
||||||
METAL_COAT: 0x0309,
|
METAL_COAT: 0x0309,
|
||||||
CHARCOAL: 0x030A,
|
CHARCOAL: 0x030a,
|
||||||
MYSTIC_WATER: 0x030B,
|
MYSTIC_WATER: 0x030b,
|
||||||
MIRACLE_SEED: 0x030C,
|
MIRACLE_SEED: 0x030c,
|
||||||
MAGNET: 0x030D,
|
MAGNET: 0x030d,
|
||||||
TWISTED_SPOON: 0x030E,
|
TWISTED_SPOON: 0x030e,
|
||||||
NEVER_MELT_ICE: 0x030F,
|
NEVER_MELT_ICE: 0x030f,
|
||||||
DRAGON_FANG: 0x0310,
|
DRAGON_FANG: 0x0310,
|
||||||
BLACK_GLASSES: 0x0311,
|
BLACK_GLASSES: 0x0311,
|
||||||
FAIRY_FEATHER: 0x0312,
|
FAIRY_FEATHER: 0x0312,
|
||||||
@ -69,12 +69,12 @@ export const HeldItemId = {
|
|||||||
WIDE_LENS: 0x0707,
|
WIDE_LENS: 0x0707,
|
||||||
MULTI_LENS: 0x0708,
|
MULTI_LENS: 0x0708,
|
||||||
GOLDEN_PUNCH: 0x0709,
|
GOLDEN_PUNCH: 0x0709,
|
||||||
GRIP_CLAW: 0x070A,
|
GRIP_CLAW: 0x070a,
|
||||||
TOXIC_ORB: 0x070B,
|
TOXIC_ORB: 0x070b,
|
||||||
FLAME_ORB: 0x070C,
|
FLAME_ORB: 0x070c,
|
||||||
SOUL_DEW: 0x070D,
|
SOUL_DEW: 0x070d,
|
||||||
BATON: 0x070E,
|
BATON: 0x070e,
|
||||||
MINI_BLACK_HOLE: 0x070F,
|
MINI_BLACK_HOLE: 0x070f,
|
||||||
EVIOLITE: 0x0710,
|
EVIOLITE: 0x0710,
|
||||||
|
|
||||||
// Vitamins
|
// Vitamins
|
||||||
@ -92,30 +92,32 @@ export const HeldItemId = {
|
|||||||
MACHO_BRACE: 0x0904,
|
MACHO_BRACE: 0x0904,
|
||||||
|
|
||||||
// Evo trackers
|
// Evo trackers
|
||||||
GIMMIGHOUL_EVO_TRACKER: 0x0A01,
|
GIMMIGHOUL_EVO_TRACKER: 0x0a01,
|
||||||
|
|
||||||
// All form change items
|
// All form change items
|
||||||
...FormChangeItemId
|
...FormChangeItemId,
|
||||||
} as const;
|
} as const;
|
||||||
|
|
||||||
export type HeldItemId = ObjectValues<typeof HeldItemId>;
|
export type HeldItemId = ObjectValues<typeof HeldItemId>;
|
||||||
|
|
||||||
type HeldItemNameMap = {
|
type HeldItemNameMap = {
|
||||||
[k in HeldItemName as (typeof HeldItemId)[k]]: k
|
[k in HeldItemName as (typeof HeldItemId)[k]]: k;
|
||||||
}
|
};
|
||||||
|
|
||||||
type HeldItemName = keyof typeof HeldItemId;
|
type HeldItemName = keyof typeof HeldItemId;
|
||||||
|
|
||||||
/** `const object` mapping all held item IDs to their respective names. */
|
/** `const object` mapping all held item IDs to their respective names. */
|
||||||
// TODO: This stores names as UPPER_SNAKE_CASE, but the locales are in PascalCase...
|
// TODO: This stores names as UPPER_SNAKE_CASE, but the locales are in PascalCase...
|
||||||
export const HeldItemNames = Object.freeze(Object.entries(HeldItemId).reduce(
|
export const HeldItemNames = Object.freeze(
|
||||||
// Use a type-safe reducer to force number keys and values
|
Object.entries(HeldItemId).reduce(
|
||||||
(acc, [key, value]) => {
|
// Use a type-safe reducer to force number keys and values
|
||||||
acc[value] = key;
|
(acc, [key, value]) => {
|
||||||
return acc;
|
acc[value] = key;
|
||||||
},
|
return acc;
|
||||||
{}
|
},
|
||||||
)) as HeldItemNameMap;
|
{},
|
||||||
|
),
|
||||||
|
) as HeldItemNameMap;
|
||||||
|
|
||||||
export const HeldItemCategoryId = {
|
export const HeldItemCategoryId = {
|
||||||
NONE: 0x0000,
|
NONE: 0x0000,
|
||||||
@ -128,14 +130,14 @@ export const HeldItemCategoryId = {
|
|||||||
UNIQUE: 0x0700,
|
UNIQUE: 0x0700,
|
||||||
VITAMIN: 0x0800,
|
VITAMIN: 0x0800,
|
||||||
BASE_STAT_BOOST: 0x0900,
|
BASE_STAT_BOOST: 0x0900,
|
||||||
EVO_TRACKER: 0x0A00,
|
EVO_TRACKER: 0x0a00,
|
||||||
RARE_FORM_CHANGE: 0x0B00,
|
RARE_FORM_CHANGE: 0x0b00,
|
||||||
FORM_CHANGE: 0x0C00,
|
FORM_CHANGE: 0x0c00,
|
||||||
} as const;
|
} as const;
|
||||||
|
|
||||||
export type HeldItemCategoryId = ObjectValues<typeof HeldItemCategoryId>;
|
export type HeldItemCategoryId = ObjectValues<typeof HeldItemCategoryId>;
|
||||||
|
|
||||||
const ITEM_CATEGORY_MASK = 0xFF00
|
const ITEM_CATEGORY_MASK = 0xff00;
|
||||||
|
|
||||||
export function getHeldItemCategory(itemId: HeldItemId): HeldItemCategoryId {
|
export function getHeldItemCategory(itemId: HeldItemId): HeldItemCategoryId {
|
||||||
return (itemId & ITEM_CATEGORY_MASK) as HeldItemCategoryId;
|
return (itemId & ITEM_CATEGORY_MASK) as HeldItemCategoryId;
|
||||||
@ -149,9 +151,6 @@ export function isItemInCategory(itemId: HeldItemId, category: HeldItemCategoryI
|
|||||||
return getHeldItemCategory(itemId) === category;
|
return getHeldItemCategory(itemId) === category;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function isItemInRequested(
|
export function isItemInRequested(itemId: HeldItemId, requestedItems: (HeldItemCategoryId | HeldItemId)[]): boolean {
|
||||||
itemId: HeldItemId,
|
|
||||||
requestedItems: (HeldItemCategoryId | HeldItemId)[]
|
|
||||||
): boolean {
|
|
||||||
return requestedItems.some(entry => itemId === entry || (itemId & ITEM_CATEGORY_MASK) === entry);
|
return requestedItems.some(entry => itemId === entry || (itemId & ITEM_CATEGORY_MASK) === entry);
|
||||||
}
|
}
|
||||||
|
@ -43,29 +43,29 @@ export const RewardId = {
|
|||||||
PP_UP: 0x2901,
|
PP_UP: 0x2901,
|
||||||
PP_MAX: 0x2902,
|
PP_MAX: 0x2902,
|
||||||
|
|
||||||
TM_COMMON: 0x2A01,
|
TM_COMMON: 0x2a01,
|
||||||
TM_GREAT: 0x2A02,
|
TM_GREAT: 0x2a02,
|
||||||
TM_ULTRA: 0x2A03,
|
TM_ULTRA: 0x2a03,
|
||||||
|
|
||||||
MINT: 0x2B01,
|
MINT: 0x2b01,
|
||||||
TERA_SHARD: 0x2B02,
|
TERA_SHARD: 0x2b02,
|
||||||
MEMORY_MUSHROOM: 0x2B03,
|
MEMORY_MUSHROOM: 0x2b03,
|
||||||
DNA_SPLICERS: 0x2B04,
|
DNA_SPLICERS: 0x2b04,
|
||||||
|
|
||||||
SPECIES_STAT_BOOSTER: 0x2C01,
|
SPECIES_STAT_BOOSTER: 0x2c01,
|
||||||
RARE_SPECIES_STAT_BOOSTER: 0x2C02,
|
RARE_SPECIES_STAT_BOOSTER: 0x2c02,
|
||||||
VITAMIN: 0x2C03,
|
VITAMIN: 0x2c03,
|
||||||
ATTACK_TYPE_BOOSTER: 0x2C04,
|
ATTACK_TYPE_BOOSTER: 0x2c04,
|
||||||
BERRY: 0x2C05,
|
BERRY: 0x2c05,
|
||||||
|
|
||||||
TEMP_STAT_STAGE_BOOSTER: 0x2D01,
|
TEMP_STAT_STAGE_BOOSTER: 0x2d01,
|
||||||
DIRE_HIT: 0x2D02,
|
DIRE_HIT: 0x2d02,
|
||||||
LURE: 0x2D03,
|
LURE: 0x2d03,
|
||||||
SUPER_LURE: 0x2D04,
|
SUPER_LURE: 0x2d04,
|
||||||
MAX_LURE: 0x2D05,
|
MAX_LURE: 0x2d05,
|
||||||
|
|
||||||
FORM_CHANGE_ITEM: 0x2E01,
|
FORM_CHANGE_ITEM: 0x2e01,
|
||||||
RARE_FORM_CHANGE_ITEM: 0x2E02,
|
RARE_FORM_CHANGE_ITEM: 0x2e02,
|
||||||
} as const;
|
} as const;
|
||||||
|
|
||||||
export type RewardId = ObjectValues<typeof RewardId>;
|
export type RewardId = ObjectValues<typeof RewardId>;
|
||||||
@ -81,17 +81,17 @@ export const RewardCategoryId = {
|
|||||||
REVIVE: 0x0700,
|
REVIVE: 0x0700,
|
||||||
ETHER: 0x0800,
|
ETHER: 0x0800,
|
||||||
ELIXIR: 0x0900,
|
ELIXIR: 0x0900,
|
||||||
PP_UP: 0x0A00,
|
PP_UP: 0x0a00,
|
||||||
TM: 0x0B00,
|
TM: 0x0b00,
|
||||||
OTHER: 0x0C00,
|
OTHER: 0x0c00,
|
||||||
HELD_ITEM: 0x0D00,
|
HELD_ITEM: 0x0d00,
|
||||||
TRAINER_ITEM: 0x0E00,
|
TRAINER_ITEM: 0x0e00,
|
||||||
FORM_CHANGE_ITEM: 0x0F00,
|
FORM_CHANGE_ITEM: 0x0f00,
|
||||||
} as const;
|
} as const;
|
||||||
|
|
||||||
export type RewardCategoryId = ObjectValues<typeof RewardCategoryId>;
|
export type RewardCategoryId = ObjectValues<typeof RewardCategoryId>;
|
||||||
|
|
||||||
const ITEM_CATEGORY_MASK = 0xFF00
|
const ITEM_CATEGORY_MASK = 0xff00;
|
||||||
|
|
||||||
export function getRewardCategory(itemId: RewardId): RewardCategoryId {
|
export function getRewardCategory(itemId: RewardId): RewardCategoryId {
|
||||||
return (itemId & ITEM_CATEGORY_MASK) as RewardCategoryId;
|
return (itemId & ITEM_CATEGORY_MASK) as RewardCategoryId;
|
||||||
|
@ -10,4 +10,4 @@ export enum HeldItemPoolType {
|
|||||||
|
|
||||||
export enum TrainerItemPoolType {
|
export enum TrainerItemPoolType {
|
||||||
ENEMY_BUFF,
|
ENEMY_BUFF,
|
||||||
}
|
}
|
||||||
|
@ -1,62 +1,62 @@
|
|||||||
export const TrainerItemId = {
|
export const TrainerItemId = {
|
||||||
NONE: 0x0000,
|
NONE: 0x0000,
|
||||||
|
|
||||||
MAP: 0x1001,
|
MAP: 0x1001,
|
||||||
IV_SCANNER: 0x1002,
|
IV_SCANNER: 0x1002,
|
||||||
LOCK_CAPSULE: 0x1003,
|
LOCK_CAPSULE: 0x1003,
|
||||||
MEGA_BRACELET: 0x1004,
|
MEGA_BRACELET: 0x1004,
|
||||||
DYNAMAX_BAND: 0x1005,
|
DYNAMAX_BAND: 0x1005,
|
||||||
TERA_ORB: 0x1006,
|
TERA_ORB: 0x1006,
|
||||||
|
|
||||||
GOLDEN_POKEBALL: 0x1007,
|
GOLDEN_POKEBALL: 0x1007,
|
||||||
|
|
||||||
OVAL_CHARM: 0x1008,
|
OVAL_CHARM: 0x1008,
|
||||||
EXP_SHARE: 0x1009,
|
EXP_SHARE: 0x1009,
|
||||||
EXP_BALANCE: 0x100A,
|
EXP_BALANCE: 0x100a,
|
||||||
|
|
||||||
CANDY_JAR: 0x100B,
|
CANDY_JAR: 0x100b,
|
||||||
BERRY_POUCH: 0x100C,
|
BERRY_POUCH: 0x100c,
|
||||||
|
|
||||||
HEALING_CHARM: 0x100D,
|
HEALING_CHARM: 0x100d,
|
||||||
EXP_CHARM: 0x100E,
|
EXP_CHARM: 0x100e,
|
||||||
SUPER_EXP_CHARM: 0x100F,
|
SUPER_EXP_CHARM: 0x100f,
|
||||||
GOLDEN_EXP_CHARM: 0x1010,
|
GOLDEN_EXP_CHARM: 0x1010,
|
||||||
AMULET_COIN: 0x1011,
|
AMULET_COIN: 0x1011,
|
||||||
|
|
||||||
ABILITY_CHARM: 0x1012,
|
ABILITY_CHARM: 0x1012,
|
||||||
SHINY_CHARM: 0x1013,
|
SHINY_CHARM: 0x1013,
|
||||||
CATCHING_CHARM: 0x1014,
|
CATCHING_CHARM: 0x1014,
|
||||||
|
|
||||||
BLACK_SLUDGE: 0x1015,
|
BLACK_SLUDGE: 0x1015,
|
||||||
GOLDEN_BUG_NET: 0x1016,
|
GOLDEN_BUG_NET: 0x1016,
|
||||||
|
|
||||||
LURE: 0x1101,
|
LURE: 0x1101,
|
||||||
SUPER_LURE: 0x1102,
|
SUPER_LURE: 0x1102,
|
||||||
MAX_LURE: 0x1103,
|
MAX_LURE: 0x1103,
|
||||||
|
|
||||||
X_ATTACK: 0x1201,
|
X_ATTACK: 0x1201,
|
||||||
X_DEFENSE: 0x1202,
|
X_DEFENSE: 0x1202,
|
||||||
X_SP_ATK: 0x1203,
|
X_SP_ATK: 0x1203,
|
||||||
X_SP_DEF: 0x1204,
|
X_SP_DEF: 0x1204,
|
||||||
X_SPEED: 0x1205,
|
X_SPEED: 0x1205,
|
||||||
X_ACCURACY: 0x1206,
|
X_ACCURACY: 0x1206,
|
||||||
DIRE_HIT: 0x1207,
|
DIRE_HIT: 0x1207,
|
||||||
|
|
||||||
ENEMY_DAMAGE_BOOSTER: 0x1301,
|
ENEMY_DAMAGE_BOOSTER: 0x1301,
|
||||||
ENEMY_DAMAGE_REDUCTION: 0x1302,
|
ENEMY_DAMAGE_REDUCTION: 0x1302,
|
||||||
ENEMY_HEAL: 0x1303,
|
ENEMY_HEAL: 0x1303,
|
||||||
ENEMY_ATTACK_POISON_CHANCE: 0x1304,
|
ENEMY_ATTACK_POISON_CHANCE: 0x1304,
|
||||||
ENEMY_ATTACK_PARALYZE_CHANCE: 0x1305,
|
ENEMY_ATTACK_PARALYZE_CHANCE: 0x1305,
|
||||||
ENEMY_ATTACK_BURN_CHANCE: 0x1306,
|
ENEMY_ATTACK_BURN_CHANCE: 0x1306,
|
||||||
ENEMY_STATUS_EFFECT_HEAL_CHANCE: 0x1307,
|
ENEMY_STATUS_EFFECT_HEAL_CHANCE: 0x1307,
|
||||||
ENEMY_ENDURE_CHANCE: 0x1308,
|
ENEMY_ENDURE_CHANCE: 0x1308,
|
||||||
ENEMY_FUSED_CHANCE: 0x1309,
|
ENEMY_FUSED_CHANCE: 0x1309,
|
||||||
} as const;
|
} as const;
|
||||||
|
|
||||||
export type TrainerItemId = (typeof TrainerItemId)[keyof typeof TrainerItemId];
|
export type TrainerItemId = (typeof TrainerItemId)[keyof typeof TrainerItemId];
|
||||||
|
|
||||||
type TrainerItemName = keyof typeof TrainerItemId;
|
type TrainerItemName = keyof typeof TrainerItemId;
|
||||||
type TrainerItemValue = typeof TrainerItemId[TrainerItemName];
|
type TrainerItemValue = (typeof TrainerItemId)[TrainerItemName];
|
||||||
|
|
||||||
// Use a type-safe reducer to force number keys and values
|
// Use a type-safe reducer to force number keys and values
|
||||||
export const TrainerItemNames: Record<TrainerItemValue, TrainerItemName> = Object.entries(TrainerItemId).reduce(
|
export const TrainerItemNames: Record<TrainerItemValue, TrainerItemName> = Object.entries(TrainerItemId).reduce(
|
||||||
@ -64,5 +64,5 @@ export const TrainerItemNames: Record<TrainerItemValue, TrainerItemName> = Objec
|
|||||||
acc[value as TrainerItemValue] = key as TrainerItemName;
|
acc[value as TrainerItemValue] = key as TrainerItemName;
|
||||||
return acc;
|
return acc;
|
||||||
},
|
},
|
||||||
{} as Record<TrainerItemValue, TrainerItemName>
|
{} as Record<TrainerItemValue, TrainerItemName>,
|
||||||
);
|
);
|
||||||
|
@ -1377,7 +1377,7 @@ export abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
getCritStage(source: Pokemon, move: Move): number {
|
getCritStage(source: Pokemon, move: Move): number {
|
||||||
const critStage = new NumberHolder(0);
|
const critStage = new NumberHolder(0);
|
||||||
applyMoveAttrs("HighCritAttr", source, this, move, critStage);
|
applyMoveAttrs("HighCritAttr", source, this, move, critStage);
|
||||||
applyHeldItems(HeldItemEffect.CRIT_BOOST, { pokemon: source, critStage: critStage });
|
applyHeldItems(HeldItemEffect.CRIT_BOOST, { pokemon: source, critStage });
|
||||||
globalScene.applyPlayerItems(TrainerItemEffect.TEMP_CRIT_BOOSTER, { numberHolder: critStage });
|
globalScene.applyPlayerItems(TrainerItemEffect.TEMP_CRIT_BOOSTER, { numberHolder: critStage });
|
||||||
applyAbAttrs("BonusCritAbAttr", { pokemon: source, critStage });
|
applyAbAttrs("BonusCritAbAttr", { pokemon: source, critStage });
|
||||||
const critBoostTag = source.getTag(CritBoostTag);
|
const critBoostTag = source.getTag(CritBoostTag);
|
||||||
@ -1433,7 +1433,7 @@ export abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
): number {
|
): number {
|
||||||
const statVal = new NumberHolder(this.getStat(stat, false));
|
const statVal = new NumberHolder(this.getStat(stat, false));
|
||||||
if (!ignoreHeldItems) {
|
if (!ignoreHeldItems) {
|
||||||
applyHeldItems(HeldItemEffect.STAT_BOOST, { pokemon: this, stat: stat, statHolder: statVal });
|
applyHeldItems(HeldItemEffect.STAT_BOOST, { pokemon: this, stat, statHolder: statVal });
|
||||||
}
|
}
|
||||||
|
|
||||||
// The Ruin abilities here are never ignored, but they reveal themselves on summon anyway
|
// The Ruin abilities here are never ignored, but they reveal themselves on summon anyway
|
||||||
@ -1543,7 +1543,7 @@ export abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
const statHolder = new NumberHolder(Math.floor((2 * baseStats[s] + this.ivs[s]) * this.level * 0.01));
|
const statHolder = new NumberHolder(Math.floor((2 * baseStats[s] + this.ivs[s]) * this.level * 0.01));
|
||||||
if (s === Stat.HP) {
|
if (s === Stat.HP) {
|
||||||
statHolder.value = statHolder.value + this.level + 10;
|
statHolder.value = statHolder.value + this.level + 10;
|
||||||
applyHeldItems(HeldItemEffect.MACHO_BRACE, { pokemon: this, stat: s, statHolder: statHolder });
|
applyHeldItems(HeldItemEffect.MACHO_BRACE, { pokemon: this, stat: s, statHolder });
|
||||||
if (this.hasAbility(AbilityId.WONDER_GUARD, false, true)) {
|
if (this.hasAbility(AbilityId.WONDER_GUARD, false, true)) {
|
||||||
statHolder.value = 1;
|
statHolder.value = 1;
|
||||||
}
|
}
|
||||||
@ -1565,7 +1565,7 @@ export abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
1,
|
1,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
applyHeldItems(HeldItemEffect.MACHO_BRACE, { pokemon: this, stat: s, statHolder: statHolder });
|
applyHeldItems(HeldItemEffect.MACHO_BRACE, { pokemon: this, stat: s, statHolder });
|
||||||
}
|
}
|
||||||
|
|
||||||
statHolder.value = Phaser.Math.Clamp(statHolder.value, 1, Number.MAX_SAFE_INTEGER);
|
statHolder.value = Phaser.Math.Clamp(statHolder.value, 1, Number.MAX_SAFE_INTEGER);
|
||||||
@ -1578,7 +1578,7 @@ export abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
const baseStats = this.getSpeciesForm(true).baseStats.slice(0);
|
const baseStats = this.getSpeciesForm(true).baseStats.slice(0);
|
||||||
applyChallenges(ChallengeType.FLIP_STAT, this, baseStats);
|
applyChallenges(ChallengeType.FLIP_STAT, this, baseStats);
|
||||||
// Items that add to the stats
|
// Items that add to the stats
|
||||||
applyHeldItems(HeldItemEffect.BASE_STAT_ADD, { pokemon: this, baseStats: baseStats });
|
applyHeldItems(HeldItemEffect.BASE_STAT_ADD, { pokemon: this, baseStats });
|
||||||
if (this.isFusion()) {
|
if (this.isFusion()) {
|
||||||
const fusionBaseStats = this.getFusionSpeciesForm(true).baseStats;
|
const fusionBaseStats = this.getFusionSpeciesForm(true).baseStats;
|
||||||
applyChallenges(ChallengeType.FLIP_STAT, this, fusionBaseStats);
|
applyChallenges(ChallengeType.FLIP_STAT, this, fusionBaseStats);
|
||||||
@ -1592,7 +1592,7 @@ export abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Vitamins
|
// Vitamins
|
||||||
applyHeldItems(HeldItemEffect.BASE_STAT_MULTIPLY, { pokemon: this, baseStats: baseStats });
|
applyHeldItems(HeldItemEffect.BASE_STAT_MULTIPLY, { pokemon: this, baseStats });
|
||||||
|
|
||||||
return baseStats;
|
return baseStats;
|
||||||
}
|
}
|
||||||
@ -4104,7 +4104,7 @@ export abstract class Pokemon extends Phaser.GameObjects.Container {
|
|||||||
surviveDamage.value = this.lapseTag(BattlerTagType.ENDURE_TOKEN);
|
surviveDamage.value = this.lapseTag(BattlerTagType.ENDURE_TOKEN);
|
||||||
}
|
}
|
||||||
if (!surviveDamage.value) {
|
if (!surviveDamage.value) {
|
||||||
applyHeldItems(HeldItemEffect.SURVIVE_CHANCE, { pokemon: this, surviveDamage: surviveDamage });
|
applyHeldItems(HeldItemEffect.SURVIVE_CHANCE, { pokemon: this, surviveDamage });
|
||||||
}
|
}
|
||||||
if (surviveDamage.value) {
|
if (surviveDamage.value) {
|
||||||
damage = this.hp - 1;
|
damage = this.hp - 1;
|
||||||
|
@ -32,7 +32,7 @@ export class HeldItemManager {
|
|||||||
};
|
};
|
||||||
return itemSpecs;
|
return itemSpecs;
|
||||||
}
|
}
|
||||||
return undefined;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
generateHeldItemConfiguration(restrictedIds?: HeldItemId[]): HeldItemConfiguration {
|
generateHeldItemConfiguration(restrictedIds?: HeldItemId[]): HeldItemConfiguration {
|
||||||
|
@ -133,7 +133,7 @@ function determineItemPoolTier(pool: HeldItemTieredPool, upgradeCount?: number):
|
|||||||
}
|
}
|
||||||
|
|
||||||
tier += upgradeCount;
|
tier += upgradeCount;
|
||||||
while (tier && !pool[tier]?.length) {
|
while (tier && pool[tier]?.length === 0) {
|
||||||
tier--;
|
tier--;
|
||||||
if (upgradeCount) {
|
if (upgradeCount) {
|
||||||
upgradeCount--;
|
upgradeCount--;
|
||||||
@ -168,8 +168,8 @@ export function getNewBerryHeldItem(customWeights: HeldItemWeights = {}, target?
|
|||||||
const weights = items.map(t =>
|
const weights = items.map(t =>
|
||||||
target?.heldItemManager.isMaxStack(t)
|
target?.heldItemManager.isMaxStack(t)
|
||||||
? 0
|
? 0
|
||||||
: (customWeights[t] ??
|
: (customWeights[t]
|
||||||
(t === HeldItemId.SITRUS_BERRY || t === HeldItemId.LUM_BERRY || t === HeldItemId.LEPPA_BERRY))
|
?? (t === HeldItemId.SITRUS_BERRY || t === HeldItemId.LUM_BERRY || t === HeldItemId.LEPPA_BERRY))
|
||||||
? 2
|
? 2
|
||||||
: 1,
|
: 1,
|
||||||
);
|
);
|
||||||
@ -192,7 +192,7 @@ export function getNewAttackTypeBoosterHeldItem(
|
|||||||
.filter(m => m.getMove().is("AttackMove"))
|
.filter(m => m.getMove().is("AttackMove"))
|
||||||
.map(m => p.getMoveType(m.getMove(), true)),
|
.map(m => p.getMoveType(m.getMove(), true)),
|
||||||
);
|
);
|
||||||
if (!attackMoveTypes.length) {
|
if (attackMoveTypes.length === 0) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -168,7 +168,7 @@ export abstract class ConsumableHeldItem<T extends EffectTuple> extends HeldItem
|
|||||||
globalScene.updateItems(pokemon.isPlayer());
|
globalScene.updateItems(pokemon.isPlayer());
|
||||||
}
|
}
|
||||||
if (unburden) {
|
if (unburden) {
|
||||||
applyAbAttrs("PostItemLostAbAttr", { pokemon: pokemon });
|
applyAbAttrs("PostItemLostAbAttr", { pokemon });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -73,7 +73,7 @@ export class BerryHeldItem extends ConsumableHeldItem<[typeof HeldItemEffect.BER
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
const preserve = new BooleanHolder(false);
|
const preserve = new BooleanHolder(false);
|
||||||
globalScene.applyPlayerItems(TrainerItemEffect.PRESERVE_BERRY, { pokemon: pokemon, doPreserve: preserve });
|
globalScene.applyPlayerItems(TrainerItemEffect.PRESERVE_BERRY, { pokemon, doPreserve: preserve });
|
||||||
const consumed = !preserve.value;
|
const consumed = !preserve.value;
|
||||||
|
|
||||||
// munch the berry and trigger unburden-like effects
|
// munch the berry and trigger unburden-like effects
|
||||||
|
@ -68,8 +68,8 @@ export class SpeciesCritBoostHeldItem extends CritBoostHeldItem {
|
|||||||
apply(effect: typeof HeldItemEffect.CRIT_BOOST, params: CritBoostParams): boolean {
|
apply(effect: typeof HeldItemEffect.CRIT_BOOST, params: CritBoostParams): boolean {
|
||||||
const pokemon = params.pokemon;
|
const pokemon = params.pokemon;
|
||||||
const fitsSpecies =
|
const fitsSpecies =
|
||||||
this.species.includes(pokemon.getSpeciesForm(true).speciesId) ||
|
this.species.includes(pokemon.getSpeciesForm(true).speciesId)
|
||||||
(pokemon.isFusion() && this.species.includes(pokemon.getFusionSpeciesForm(true).speciesId));
|
|| (pokemon.isFusion() && this.species.includes(pokemon.getFusionSpeciesForm(true).speciesId));
|
||||||
|
|
||||||
if (fitsSpecies) {
|
if (fitsSpecies) {
|
||||||
return super.apply(effect, params);
|
return super.apply(effect, params);
|
||||||
|
@ -45,10 +45,10 @@ export class GimmighoulEvoTrackerHeldItem extends EvoTrackerHeldItem {
|
|||||||
|
|
||||||
getStackCount(pokemon: Pokemon): number {
|
getStackCount(pokemon: Pokemon): number {
|
||||||
const stackCount =
|
const stackCount =
|
||||||
pokemon.heldItemManager.getStack(this.type) +
|
pokemon.heldItemManager.getStack(this.type)
|
||||||
pokemon.heldItemManager.getStack(HeldItemId.GOLDEN_PUNCH) +
|
+ pokemon.heldItemManager.getStack(HeldItemId.GOLDEN_PUNCH)
|
||||||
globalScene.trainerItems.getStack(TrainerItemId.AMULET_COIN) +
|
+ globalScene.trainerItems.getStack(TrainerItemId.AMULET_COIN)
|
||||||
globalScene.trainerItems.getStack(TrainerItemId.GOLDEN_POKEBALL);
|
+ globalScene.trainerItems.getStack(TrainerItemId.GOLDEN_POKEBALL);
|
||||||
return stackCount;
|
return stackCount;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -28,7 +28,7 @@ export abstract class ItemTransferHeldItem<T extends EffectTuple> extends HeldIt
|
|||||||
applySteal(params: ItemStealParams): boolean {
|
applySteal(params: ItemStealParams): boolean {
|
||||||
const opponents = this.getTargets(params);
|
const opponents = this.getTargets(params);
|
||||||
|
|
||||||
if (!opponents.length) {
|
if (opponents.length === 0) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -46,7 +46,7 @@ export abstract class ItemTransferHeldItem<T extends EffectTuple> extends HeldIt
|
|||||||
const heldItems = targetPokemon.heldItemManager.getTransferableHeldItems();
|
const heldItems = targetPokemon.heldItemManager.getTransferableHeldItems();
|
||||||
|
|
||||||
for (let i = 0; i < transferredItemCount; i++) {
|
for (let i = 0; i < transferredItemCount; i++) {
|
||||||
if (!heldItems.length) {
|
if (heldItems.length === 0) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
const randItemIndex = pokemon.randBattleSeedInt(heldItems.length);
|
const randItemIndex = pokemon.randBattleSeedInt(heldItems.length);
|
||||||
@ -62,7 +62,7 @@ export abstract class ItemTransferHeldItem<T extends EffectTuple> extends HeldIt
|
|||||||
globalScene.phaseManager.queueMessage(this.getTransferMessage(params, mt));
|
globalScene.phaseManager.queueMessage(this.getTransferMessage(params, mt));
|
||||||
}
|
}
|
||||||
|
|
||||||
return !!transferredRewards.length;
|
return transferredRewards.length > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
abstract getTargets(params: ItemStealParams): Pokemon[];
|
abstract getTargets(params: ItemStealParams): Pokemon[];
|
||||||
|
@ -141,8 +141,8 @@ export class SpeciesStatBoostHeldItem extends StatBoostHeldItem {
|
|||||||
apply(effect: typeof HeldItemEffect.STAT_BOOST, params: StatBoostParams): boolean {
|
apply(effect: typeof HeldItemEffect.STAT_BOOST, params: StatBoostParams): boolean {
|
||||||
const pokemon = params.pokemon;
|
const pokemon = params.pokemon;
|
||||||
const fitsSpecies =
|
const fitsSpecies =
|
||||||
this.species.includes(pokemon.getSpeciesForm(true).speciesId) ||
|
this.species.includes(pokemon.getSpeciesForm(true).speciesId)
|
||||||
(pokemon.isFusion() && this.species.includes(pokemon.getFusionSpeciesForm(true).speciesId));
|
|| (pokemon.isFusion() && this.species.includes(pokemon.getFusionSpeciesForm(true).speciesId));
|
||||||
|
|
||||||
if (fitsSpecies) {
|
if (fitsSpecies) {
|
||||||
return super.apply(effect, params);
|
return super.apply(effect, params);
|
||||||
|
@ -54,12 +54,12 @@ function initCommonRewardPool() {
|
|||||||
const thresholdPartyMemberCount = Math.min(
|
const thresholdPartyMemberCount = Math.min(
|
||||||
party.filter(
|
party.filter(
|
||||||
p =>
|
p =>
|
||||||
p.hp &&
|
p.hp
|
||||||
!p.heldItemManager.hasItem(HeldItemId.LEPPA_BERRY) &&
|
&& !p.heldItemManager.hasItem(HeldItemId.LEPPA_BERRY)
|
||||||
p
|
&& p
|
||||||
.getMoveset()
|
.getMoveset()
|
||||||
.filter(m => m.ppUsed && m.getMovePp() - m.ppUsed <= 5 && m.ppUsed > Math.floor(m.getMovePp() / 2))
|
.filter(m => m.ppUsed && m.getMovePp() - m.ppUsed <= 5 && m.ppUsed > Math.floor(m.getMovePp() / 2))
|
||||||
.length,
|
.length > 0,
|
||||||
).length,
|
).length,
|
||||||
3,
|
3,
|
||||||
);
|
);
|
||||||
@ -73,12 +73,12 @@ function initCommonRewardPool() {
|
|||||||
const thresholdPartyMemberCount = Math.min(
|
const thresholdPartyMemberCount = Math.min(
|
||||||
party.filter(
|
party.filter(
|
||||||
p =>
|
p =>
|
||||||
p.hp &&
|
p.hp
|
||||||
!p.heldItemManager.hasItem(HeldItemId.LEPPA_BERRY) &&
|
&& !p.heldItemManager.hasItem(HeldItemId.LEPPA_BERRY)
|
||||||
p
|
&& p
|
||||||
.getMoveset()
|
.getMoveset()
|
||||||
.filter(m => m.ppUsed && m.getMovePp() - m.ppUsed <= 5 && m.ppUsed > Math.floor(m.getMovePp() / 2))
|
.filter(m => m.ppUsed && m.getMovePp() - m.ppUsed <= 5 && m.ppUsed > Math.floor(m.getMovePp() / 2))
|
||||||
.length,
|
.length > 0,
|
||||||
).length,
|
).length,
|
||||||
3,
|
3,
|
||||||
);
|
);
|
||||||
@ -106,9 +106,9 @@ function initGreatRewardPool() {
|
|||||||
const statusEffectPartyMemberCount = Math.min(
|
const statusEffectPartyMemberCount = Math.min(
|
||||||
party.filter(
|
party.filter(
|
||||||
p =>
|
p =>
|
||||||
p.hp &&
|
p.hp
|
||||||
!!p.status &&
|
&& !!p.status
|
||||||
!p
|
&& !p
|
||||||
.getHeldItems()
|
.getHeldItems()
|
||||||
.filter(i => i in [HeldItemId.TOXIC_ORB, HeldItemId.FLAME_ORB])
|
.filter(i => i in [HeldItemId.TOXIC_ORB, HeldItemId.FLAME_ORB])
|
||||||
.some(i => (allHeldItems[i] as TurnEndStatusHeldItem).effect === p.status?.effect),
|
.some(i => (allHeldItems[i] as TurnEndStatusHeldItem).effect === p.status?.effect),
|
||||||
@ -170,9 +170,9 @@ function initGreatRewardPool() {
|
|||||||
const statusEffectPartyMemberCount = Math.min(
|
const statusEffectPartyMemberCount = Math.min(
|
||||||
party.filter(
|
party.filter(
|
||||||
p =>
|
p =>
|
||||||
p.hp &&
|
p.hp
|
||||||
!!p.status &&
|
&& !!p.status
|
||||||
!p
|
&& !p
|
||||||
.getHeldItems()
|
.getHeldItems()
|
||||||
.filter(i => i in [HeldItemId.TOXIC_ORB, HeldItemId.FLAME_ORB])
|
.filter(i => i in [HeldItemId.TOXIC_ORB, HeldItemId.FLAME_ORB])
|
||||||
.some(i => (allHeldItems[i] as TurnEndStatusHeldItem).effect === p.status?.effect),
|
.some(i => (allHeldItems[i] as TurnEndStatusHeldItem).effect === p.status?.effect),
|
||||||
@ -180,9 +180,9 @@ function initGreatRewardPool() {
|
|||||||
3,
|
3,
|
||||||
);
|
);
|
||||||
const thresholdPartyMemberCount = Math.floor(
|
const thresholdPartyMemberCount = Math.floor(
|
||||||
(Math.min(party.filter(p => p.getInverseHp() >= 100 && p.getHpRatio() <= 0.5 && !p.isFainted()).length, 3) +
|
(Math.min(party.filter(p => p.getInverseHp() >= 100 && p.getHpRatio() <= 0.5 && !p.isFainted()).length, 3)
|
||||||
statusEffectPartyMemberCount) /
|
+ statusEffectPartyMemberCount)
|
||||||
2,
|
/ 2,
|
||||||
);
|
);
|
||||||
return thresholdPartyMemberCount;
|
return thresholdPartyMemberCount;
|
||||||
},
|
},
|
||||||
@ -194,12 +194,12 @@ function initGreatRewardPool() {
|
|||||||
const thresholdPartyMemberCount = Math.min(
|
const thresholdPartyMemberCount = Math.min(
|
||||||
party.filter(
|
party.filter(
|
||||||
p =>
|
p =>
|
||||||
p.hp &&
|
p.hp
|
||||||
!p.heldItemManager.hasItem(HeldItemId.LEPPA_BERRY) &&
|
&& !p.heldItemManager.hasItem(HeldItemId.LEPPA_BERRY)
|
||||||
p
|
&& p
|
||||||
.getMoveset()
|
.getMoveset()
|
||||||
.filter(m => m.ppUsed && m.getMovePp() - m.ppUsed <= 5 && m.ppUsed > Math.floor(m.getMovePp() / 2))
|
.filter(m => m.ppUsed && m.getMovePp() - m.ppUsed <= 5 && m.ppUsed > Math.floor(m.getMovePp() / 2))
|
||||||
.length,
|
.length > 0,
|
||||||
).length,
|
).length,
|
||||||
3,
|
3,
|
||||||
);
|
);
|
||||||
@ -213,12 +213,12 @@ function initGreatRewardPool() {
|
|||||||
const thresholdPartyMemberCount = Math.min(
|
const thresholdPartyMemberCount = Math.min(
|
||||||
party.filter(
|
party.filter(
|
||||||
p =>
|
p =>
|
||||||
p.hp &&
|
p.hp
|
||||||
!p.heldItemManager.hasItem(HeldItemId.LEPPA_BERRY) &&
|
&& !p.heldItemManager.hasItem(HeldItemId.LEPPA_BERRY)
|
||||||
p
|
&& p
|
||||||
.getMoveset()
|
.getMoveset()
|
||||||
.filter(m => m.ppUsed && m.getMovePp() - m.ppUsed <= 5 && m.ppUsed > Math.floor(m.getMovePp() / 2))
|
.filter(m => m.ppUsed && m.getMovePp() - m.ppUsed <= 5 && m.ppUsed > Math.floor(m.getMovePp() / 2))
|
||||||
.length,
|
.length > 0,
|
||||||
).length,
|
).length,
|
||||||
3,
|
3,
|
||||||
);
|
);
|
||||||
@ -321,9 +321,9 @@ function initUltraRewardPool() {
|
|||||||
return party.some(p => {
|
return party.some(p => {
|
||||||
// Check if Pokemon's species (or fusion species, if applicable) can evolve or if they're G-Max'd
|
// Check if Pokemon's species (or fusion species, if applicable) can evolve or if they're G-Max'd
|
||||||
if (
|
if (
|
||||||
!p.isMax() &&
|
!p.isMax()
|
||||||
(p.getSpeciesForm(true).speciesId in pokemonEvolutions ||
|
&& (p.getSpeciesForm(true).speciesId in pokemonEvolutions
|
||||||
(p.isFusion() && p.getFusionSpeciesForm(true).speciesId in pokemonEvolutions))
|
|| (p.isFusion() && p.getFusionSpeciesForm(true).speciesId in pokemonEvolutions))
|
||||||
) {
|
) {
|
||||||
// Check if Pokemon is already holding an Eviolite
|
// Check if Pokemon is already holding an Eviolite
|
||||||
return !p.heldItemManager.hasItem(HeldItemId.EVIOLITE);
|
return !p.heldItemManager.hasItem(HeldItemId.EVIOLITE);
|
||||||
@ -344,9 +344,9 @@ function initUltraRewardPool() {
|
|||||||
// If a party member doesn't already have a Leek and is one of the relevant species, Leek can appear
|
// If a party member doesn't already have a Leek and is one of the relevant species, Leek can appear
|
||||||
return party.some(
|
return party.some(
|
||||||
p =>
|
p =>
|
||||||
!p.heldItemManager.hasItem(HeldItemId.LEEK) &&
|
!p.heldItemManager.hasItem(HeldItemId.LEEK)
|
||||||
(checkedSpecies.includes(p.getSpeciesForm(true).speciesId) ||
|
&& (checkedSpecies.includes(p.getSpeciesForm(true).speciesId)
|
||||||
(p.isFusion() && checkedSpecies.includes(p.getFusionSpeciesForm(true).speciesId))),
|
|| (p.isFusion() && checkedSpecies.includes(p.getFusionSpeciesForm(true).speciesId))),
|
||||||
)
|
)
|
||||||
? 12
|
? 12
|
||||||
: 0;
|
: 0;
|
||||||
@ -575,9 +575,9 @@ function initMasterRewardPool() {
|
|||||||
{
|
{
|
||||||
id: RewardId.DNA_SPLICERS,
|
id: RewardId.DNA_SPLICERS,
|
||||||
weight: (party: Pokemon[]) =>
|
weight: (party: Pokemon[]) =>
|
||||||
!(globalScene.gameMode.isClassic && timedEventManager.areFusionsBoosted()) &&
|
!(globalScene.gameMode.isClassic && timedEventManager.areFusionsBoosted())
|
||||||
!globalScene.gameMode.isSplicedOnly &&
|
&& !globalScene.gameMode.isSplicedOnly
|
||||||
party.filter(p => !p.fusionSpecies).length > 1
|
&& party.filter(p => !p.fusionSpecies).length > 1
|
||||||
? 24
|
? 24
|
||||||
: 0,
|
: 0,
|
||||||
maxWeight: 24,
|
maxWeight: 24,
|
||||||
@ -585,8 +585,9 @@ function initMasterRewardPool() {
|
|||||||
{
|
{
|
||||||
id: HeldItemId.MINI_BLACK_HOLE,
|
id: HeldItemId.MINI_BLACK_HOLE,
|
||||||
weight: () =>
|
weight: () =>
|
||||||
globalScene.gameMode.isDaily ||
|
globalScene.gameMode.isDaily
|
||||||
(!globalScene.gameMode.isFreshStartChallenge() && globalScene.gameData.isUnlocked(Unlockables.MINI_BLACK_HOLE))
|
|| (!globalScene.gameMode.isFreshStartChallenge()
|
||||||
|
&& globalScene.gameData.isUnlocked(Unlockables.MINI_BLACK_HOLE))
|
||||||
? 1
|
? 1
|
||||||
: 0,
|
: 0,
|
||||||
maxWeight: 1,
|
maxWeight: 1,
|
||||||
@ -642,8 +643,8 @@ function skipInLastClassicWaveOrDefault(defaultWeight: number): WeightedRewardWe
|
|||||||
function lureWeightFunc(lureId: TrainerItemId, weight: number): WeightedRewardWeightFunc {
|
function lureWeightFunc(lureId: TrainerItemId, weight: number): WeightedRewardWeightFunc {
|
||||||
return () => {
|
return () => {
|
||||||
const lureCount = globalScene.trainerItems.getStack(lureId);
|
const lureCount = globalScene.trainerItems.getStack(lureId);
|
||||||
return !(globalScene.gameMode.isClassic && globalScene.currentBattle.waveIndex === 199) &&
|
return !(globalScene.gameMode.isClassic && globalScene.currentBattle.waveIndex === 199)
|
||||||
lureCount < allTrainerItems[lureId].getMaxStackCount() * 0.6
|
&& lureCount < allTrainerItems[lureId].getMaxStackCount() * 0.6
|
||||||
? weight
|
? weight
|
||||||
: 0;
|
: 0;
|
||||||
};
|
};
|
||||||
|
@ -144,8 +144,8 @@ export function convertModifierSaveData(data: ModifierData[]) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (itemId) {
|
if (itemId) {
|
||||||
const specs = { id: itemId, stack: stack };
|
const specs = { id: itemId, stack };
|
||||||
const pokemonItem = { item: specs, pokemonId: pokemonId };
|
const pokemonItem = { item: specs, pokemonId };
|
||||||
pokemonItems.push(pokemonItem);
|
pokemonItems.push(pokemonItem);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -64,10 +64,8 @@ export interface CustomRewardSettings {
|
|||||||
export function generateRewardPoolWeights(pool: RewardPool, party: Pokemon[], rerollCount = 0) {
|
export function generateRewardPoolWeights(pool: RewardPool, party: Pokemon[], rerollCount = 0) {
|
||||||
for (const tier of Object.keys(pool)) {
|
for (const tier of Object.keys(pool)) {
|
||||||
const poolWeights = pool[tier].map(w => {
|
const poolWeights = pool[tier].map(w => {
|
||||||
if (isTrainerItemId(w.id)) {
|
if (isTrainerItemId(w.id) && globalScene.trainerItems.isMaxStack(w.id)) {
|
||||||
if (globalScene.trainerItems.isMaxStack(w.id)) {
|
return 0;
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (typeof w.weight === "number") {
|
if (typeof w.weight === "number") {
|
||||||
return w.weight;
|
return w.weight;
|
||||||
@ -118,7 +116,7 @@ function getRarityUpgradeCount(pool: RewardPool, baseTier: RarityTier, party: Po
|
|||||||
if (baseTier < RarityTier.MASTER) {
|
if (baseTier < RarityTier.MASTER) {
|
||||||
const partyLuckValue = getPartyLuckValue(party);
|
const partyLuckValue = getPartyLuckValue(party);
|
||||||
const upgradeOdds = Math.floor(128 / ((partyLuckValue + 4) / 4));
|
const upgradeOdds = Math.floor(128 / ((partyLuckValue + 4) / 4));
|
||||||
while (pool.hasOwnProperty(baseTier + upgradeCount + 1) && pool[baseTier + upgradeCount + 1].length) {
|
while (pool.hasOwnProperty(baseTier + upgradeCount + 1) && pool[baseTier + upgradeCount + 1].length > 0) {
|
||||||
if (randSeedInt(upgradeOdds) < 4) {
|
if (randSeedInt(upgradeOdds) < 4) {
|
||||||
upgradeCount++;
|
upgradeCount++;
|
||||||
} else {
|
} else {
|
||||||
@ -212,10 +210,10 @@ function getRewardOptionWithRetry(
|
|||||||
let candidate = getNewRewardOption(pool, weights, party, tier, undefined, 0, allowLuckUpgrades);
|
let candidate = getNewRewardOption(pool, weights, party, tier, undefined, 0, allowLuckUpgrades);
|
||||||
let r = 0;
|
let r = 0;
|
||||||
while (
|
while (
|
||||||
existingOptions.length &&
|
existingOptions.length > 0
|
||||||
++r < retryCount &&
|
&& ++r < retryCount //TODO: Improve this condition to refine what counts as a dupe
|
||||||
//TODO: Improve this condition to refine what counts as a dupe
|
&& existingOptions.filter(o => o.type.name === candidate?.type.name || o.type.group === candidate?.type.group)
|
||||||
existingOptions.filter(o => o.type.name === candidate?.type.name || o.type.group === candidate?.type.group).length
|
.length > 0
|
||||||
) {
|
) {
|
||||||
console.log("Retry count:", r);
|
console.log("Retry count:", r);
|
||||||
console.log(candidate?.type.group);
|
console.log(candidate?.type.group);
|
||||||
|
@ -14,20 +14,20 @@ export class EvolutionItemReward extends PokemonReward {
|
|||||||
constructor(evolutionItem: EvolutionItem) {
|
constructor(evolutionItem: EvolutionItem) {
|
||||||
super("", EvolutionItem[evolutionItem].toLowerCase(), (pokemon: PlayerPokemon) => {
|
super("", EvolutionItem[evolutionItem].toLowerCase(), (pokemon: PlayerPokemon) => {
|
||||||
if (
|
if (
|
||||||
pokemonEvolutions.hasOwnProperty(pokemon.species.speciesId) &&
|
pokemonEvolutions.hasOwnProperty(pokemon.species.speciesId)
|
||||||
pokemonEvolutions[pokemon.species.speciesId].filter(e => e.validate(pokemon, false, this.evolutionItem))
|
&& pokemonEvolutions[pokemon.species.speciesId].filter(e => e.validate(pokemon, false, this.evolutionItem))
|
||||||
.length &&
|
.length > 0
|
||||||
pokemon.getFormKey() !== SpeciesFormKey.GIGANTAMAX
|
&& pokemon.getFormKey() !== SpeciesFormKey.GIGANTAMAX
|
||||||
) {
|
) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
if (
|
if (
|
||||||
pokemon.isFusion() &&
|
pokemon.isFusion()
|
||||||
pokemon.fusionSpecies &&
|
&& pokemon.fusionSpecies
|
||||||
pokemonEvolutions.hasOwnProperty(pokemon.fusionSpecies.speciesId) &&
|
&& pokemonEvolutions.hasOwnProperty(pokemon.fusionSpecies.speciesId)
|
||||||
pokemonEvolutions[pokemon.fusionSpecies.speciesId].filter(e => e.validate(pokemon, true, this.evolutionItem))
|
&& pokemonEvolutions[pokemon.fusionSpecies.speciesId].filter(e => e.validate(pokemon, true, this.evolutionItem))
|
||||||
.length &&
|
.length > 0
|
||||||
pokemon.getFusionFormKey() !== SpeciesFormKey.GIGANTAMAX
|
&& pokemon.getFusionFormKey() !== SpeciesFormKey.GIGANTAMAX
|
||||||
) {
|
) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@ -94,12 +94,12 @@ export class EvolutionItemRewardGenerator extends RewardGenerator {
|
|||||||
party
|
party
|
||||||
.filter(
|
.filter(
|
||||||
p =>
|
p =>
|
||||||
pokemonEvolutions.hasOwnProperty(p.species.speciesId) &&
|
pokemonEvolutions.hasOwnProperty(p.species.speciesId)
|
||||||
(!p.pauseEvolutions ||
|
&& (!p.pauseEvolutions
|
||||||
p.species.speciesId === SpeciesId.SLOWPOKE ||
|
|| p.species.speciesId === SpeciesId.SLOWPOKE
|
||||||
p.species.speciesId === SpeciesId.EEVEE ||
|
|| p.species.speciesId === SpeciesId.EEVEE
|
||||||
p.species.speciesId === SpeciesId.KIRLIA ||
|
|| p.species.speciesId === SpeciesId.KIRLIA
|
||||||
p.species.speciesId === SpeciesId.SNORUNT),
|
|| p.species.speciesId === SpeciesId.SNORUNT),
|
||||||
)
|
)
|
||||||
.flatMap(p => {
|
.flatMap(p => {
|
||||||
const evolutions = pokemonEvolutions[p.species.speciesId];
|
const evolutions = pokemonEvolutions[p.species.speciesId];
|
||||||
@ -108,14 +108,14 @@ export class EvolutionItemRewardGenerator extends RewardGenerator {
|
|||||||
party
|
party
|
||||||
.filter(
|
.filter(
|
||||||
p =>
|
p =>
|
||||||
p.isFusion() &&
|
p.isFusion()
|
||||||
p.fusionSpecies &&
|
&& p.fusionSpecies
|
||||||
pokemonEvolutions.hasOwnProperty(p.fusionSpecies.speciesId) &&
|
&& pokemonEvolutions.hasOwnProperty(p.fusionSpecies.speciesId)
|
||||||
(!p.pauseEvolutions ||
|
&& (!p.pauseEvolutions
|
||||||
p.fusionSpecies.speciesId === SpeciesId.SLOWPOKE ||
|
|| p.fusionSpecies.speciesId === SpeciesId.SLOWPOKE
|
||||||
p.fusionSpecies.speciesId === SpeciesId.EEVEE ||
|
|| p.fusionSpecies.speciesId === SpeciesId.EEVEE
|
||||||
p.fusionSpecies.speciesId === SpeciesId.KIRLIA ||
|
|| p.fusionSpecies.speciesId === SpeciesId.KIRLIA
|
||||||
p.fusionSpecies.speciesId === SpeciesId.SNORUNT),
|
|| p.fusionSpecies.speciesId === SpeciesId.SNORUNT),
|
||||||
)
|
)
|
||||||
.flatMap(p => {
|
.flatMap(p => {
|
||||||
const evolutions = pokemonEvolutions[p.fusionSpecies!.speciesId];
|
const evolutions = pokemonEvolutions[p.fusionSpecies!.speciesId];
|
||||||
@ -126,7 +126,7 @@ export class EvolutionItemRewardGenerator extends RewardGenerator {
|
|||||||
.flatMap(e => e.evoItem)
|
.flatMap(e => e.evoItem)
|
||||||
.filter(i => !!i && i > 50 === this.rare);
|
.filter(i => !!i && i > 50 === this.rare);
|
||||||
|
|
||||||
if (!evolutionItemPool.length) {
|
if (evolutionItemPool.length === 0) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -22,9 +22,8 @@ export class FormChangeItemReward extends PokemonReward {
|
|||||||
super("", allHeldItems[formChangeItem].iconName, (pokemon: PlayerPokemon) => {
|
super("", allHeldItems[formChangeItem].iconName, (pokemon: PlayerPokemon) => {
|
||||||
// Make sure the Pokemon has alternate forms
|
// Make sure the Pokemon has alternate forms
|
||||||
if (
|
if (
|
||||||
pokemonFormChanges.hasOwnProperty(pokemon.species.speciesId) &&
|
pokemonFormChanges.hasOwnProperty(pokemon.species.speciesId) // Get all form changes for this species with an item trigger, including any compound triggers
|
||||||
// Get all form changes for this species with an item trigger, including any compound triggers
|
&& pokemonFormChanges[pokemon.species.speciesId]
|
||||||
pokemonFormChanges[pokemon.species.speciesId]
|
|
||||||
.filter(
|
.filter(
|
||||||
fc => fc.trigger.hasTriggerType(SpeciesFormChangeItemTrigger) && fc.preFormKey === pokemon.getFormKey(),
|
fc => fc.trigger.hasTriggerType(SpeciesFormChangeItemTrigger) && fc.preFormKey === pokemon.getFormKey(),
|
||||||
)
|
)
|
||||||
@ -92,25 +91,24 @@ export class FormChangeItemRewardGenerator extends RewardGenerator {
|
|||||||
let formChangeItemTriggers = formChanges
|
let formChangeItemTriggers = formChanges
|
||||||
.filter(
|
.filter(
|
||||||
fc =>
|
fc =>
|
||||||
((fc.formKey.indexOf(SpeciesFormKey.MEGA) === -1 &&
|
((fc.formKey.indexOf(SpeciesFormKey.MEGA) === -1 && fc.formKey.indexOf(SpeciesFormKey.PRIMAL) === -1)
|
||||||
fc.formKey.indexOf(SpeciesFormKey.PRIMAL) === -1) ||
|
|| globalScene.trainerItems.hasItem(TrainerItemId.MEGA_BRACELET))
|
||||||
globalScene.trainerItems.hasItem(TrainerItemId.MEGA_BRACELET)) &&
|
&& ((fc.formKey.indexOf(SpeciesFormKey.GIGANTAMAX) === -1
|
||||||
((fc.formKey.indexOf(SpeciesFormKey.GIGANTAMAX) === -1 &&
|
&& fc.formKey.indexOf(SpeciesFormKey.ETERNAMAX) === -1)
|
||||||
fc.formKey.indexOf(SpeciesFormKey.ETERNAMAX) === -1) ||
|
|| globalScene.trainerItems.hasItem(TrainerItemId.DYNAMAX_BAND))
|
||||||
globalScene.trainerItems.hasItem(TrainerItemId.DYNAMAX_BAND)) &&
|
&& (fc.conditions.length === 0
|
||||||
(!fc.conditions.length ||
|
|| fc.conditions.filter(cond => cond instanceof SpeciesFormChangeCondition && cond.predicate(p))
|
||||||
fc.conditions.filter(cond => cond instanceof SpeciesFormChangeCondition && cond.predicate(p))
|
.length > 0)
|
||||||
.length) &&
|
&& fc.preFormKey === p.getFormKey(),
|
||||||
fc.preFormKey === p.getFormKey(),
|
|
||||||
)
|
)
|
||||||
.map(fc => fc.findTrigger(SpeciesFormChangeItemTrigger) as SpeciesFormChangeItemTrigger)
|
.map(fc => fc.findTrigger(SpeciesFormChangeItemTrigger) as SpeciesFormChangeItemTrigger)
|
||||||
.filter(t => t?.active && !p.heldItemManager.hasItem(t.item));
|
.filter(t => t?.active && !p.heldItemManager.hasItem(t.item));
|
||||||
|
|
||||||
if (p.species.speciesId === SpeciesId.NECROZMA) {
|
if (p.species.speciesId === SpeciesId.NECROZMA) {
|
||||||
// technically we could use a simplified version and check for formChanges.length > 3, but in case any code changes later, this might break...
|
// technically we could use a simplified version and check for formChanges.length > 3, but in case any code changes later, this might break...
|
||||||
let foundULTRA_Z = false,
|
let foundULTRA_Z = false;
|
||||||
foundN_LUNA = false,
|
let foundN_LUNA = false;
|
||||||
foundN_SOLAR = false;
|
let foundN_SOLAR = false;
|
||||||
formChangeItemTriggers.forEach((fc, _i) => {
|
formChangeItemTriggers.forEach((fc, _i) => {
|
||||||
console.log("Checking ", fc.item);
|
console.log("Checking ", fc.item);
|
||||||
switch (fc.item) {
|
switch (fc.item) {
|
||||||
@ -143,7 +141,7 @@ export class FormChangeItemRewardGenerator extends RewardGenerator {
|
|||||||
.filter(i => (i && i < 100) === this.isRareFormChangeItem);
|
.filter(i => (i && i < 100) === this.isRareFormChangeItem);
|
||||||
// convert it into a set to remove duplicate values, which can appear when the same species with a potential form change is in the party.
|
// convert it into a set to remove duplicate values, which can appear when the same species with a potential form change is in the party.
|
||||||
|
|
||||||
if (!formChangeItemPool.length) {
|
if (formChangeItemPool.length === 0) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -65,7 +65,7 @@ export class PokemonAllMovePpRestoreReward extends PokemonReward {
|
|||||||
localeKey,
|
localeKey,
|
||||||
iconImage,
|
iconImage,
|
||||||
(pokemon: PlayerPokemon) => {
|
(pokemon: PlayerPokemon) => {
|
||||||
if (!pokemon.getMoveset().filter(m => m.ppUsed).length) {
|
if (pokemon.getMoveset().filter(m => m.ppUsed).length === 0) {
|
||||||
return PartyUiHandler.NoEffectMessage;
|
return PartyUiHandler.NoEffectMessage;
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
@ -11,7 +11,7 @@ export class RememberMoveReward extends PokemonReward {
|
|||||||
localeKey,
|
localeKey,
|
||||||
iconImage,
|
iconImage,
|
||||||
(pokemon: PlayerPokemon) => {
|
(pokemon: PlayerPokemon) => {
|
||||||
if (!pokemon.getLearnableLevelMoves().length) {
|
if (pokemon.getLearnableLevelMoves().length === 0) {
|
||||||
return PartyUiHandler.NoEffectMessage;
|
return PartyUiHandler.NoEffectMessage;
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
@ -69,11 +69,12 @@ export class PokemonHpRestoreReward extends PokemonReward {
|
|||||||
super(
|
super(
|
||||||
localeKey,
|
localeKey,
|
||||||
iconImage,
|
iconImage,
|
||||||
selectFilter ||
|
selectFilter
|
||||||
((pokemon: PlayerPokemon) => {
|
|| ((pokemon: PlayerPokemon) => {
|
||||||
if (
|
if (
|
||||||
!pokemon.hp ||
|
!pokemon.hp
|
||||||
(pokemon.isFullHp() && (!this.healStatus || (!pokemon.status && !pokemon.getTag(BattlerTagType.CONFUSED))))
|
|| (pokemon.isFullHp()
|
||||||
|
&& (!this.healStatus || (!pokemon.status && !pokemon.getTag(BattlerTagType.CONFUSED))))
|
||||||
) {
|
) {
|
||||||
return PartyUiHandler.NoEffectMessage;
|
return PartyUiHandler.NoEffectMessage;
|
||||||
}
|
}
|
||||||
|
@ -52,8 +52,8 @@ export class ChangeTeraTypeReward extends PokemonReward {
|
|||||||
*/
|
*/
|
||||||
shouldApply({ pokemon }: PokemonRewardParams): boolean {
|
shouldApply({ pokemon }: PokemonRewardParams): boolean {
|
||||||
return (
|
return (
|
||||||
pokemon.teraType !== this.teraType &&
|
pokemon.teraType !== this.teraType
|
||||||
![SpeciesId.SHEDINJA, SpeciesId.OGERPON, SpeciesId.TERAPAGOS].some(s => pokemon.hasSpecies(s))
|
&& ![SpeciesId.SHEDINJA, SpeciesId.OGERPON, SpeciesId.TERAPAGOS].some(s => pokemon.hasSpecies(s))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -86,9 +86,9 @@ export class TeraTypeRewardGenerator extends RewardGenerator {
|
|||||||
const excludedType = globalScene.getPlayerParty().reduce((prevType, p) => {
|
const excludedType = globalScene.getPlayerParty().reduce((prevType, p) => {
|
||||||
if (
|
if (
|
||||||
// Ignore Pokemon with fixed Tera Types
|
// Ignore Pokemon with fixed Tera Types
|
||||||
p.hasSpecies(SpeciesId.TERAPAGOS) ||
|
p.hasSpecies(SpeciesId.TERAPAGOS)
|
||||||
p.hasSpecies(SpeciesId.OGERPON) ||
|
|| p.hasSpecies(SpeciesId.OGERPON)
|
||||||
p.hasSpecies(SpeciesId.SHEDINJA)
|
|| p.hasSpecies(SpeciesId.SHEDINJA)
|
||||||
) {
|
) {
|
||||||
return prevType;
|
return prevType;
|
||||||
}
|
}
|
||||||
|
@ -20,8 +20,8 @@ export class TmReward extends PokemonReward {
|
|||||||
`tm_${PokemonType[allMoves[moveId].type].toLowerCase()}`,
|
`tm_${PokemonType[allMoves[moveId].type].toLowerCase()}`,
|
||||||
(pokemon: PlayerPokemon) => {
|
(pokemon: PlayerPokemon) => {
|
||||||
if (
|
if (
|
||||||
pokemon.compatibleTms.indexOf(moveId) === -1 ||
|
pokemon.compatibleTms.indexOf(moveId) === -1
|
||||||
pokemon.getMoveset().filter(m => m.moveId === moveId).length
|
|| pokemon.getMoveset().filter(m => m.moveId === moveId).length > 0
|
||||||
) {
|
) {
|
||||||
return PartyUiHandler.NoEffectMessage;
|
return PartyUiHandler.NoEffectMessage;
|
||||||
}
|
}
|
||||||
@ -90,7 +90,7 @@ export class TmRewardGenerator extends RewardGenerator {
|
|||||||
.filter(tm => tmPoolTiers[tm] === this.tier)
|
.filter(tm => tmPoolTiers[tm] === this.tier)
|
||||||
.filter(tm => !allMoves[tm].name.endsWith(" (N)"))
|
.filter(tm => !allMoves[tm].name.endsWith(" (N)"))
|
||||||
.filter((tm, i, array) => array.indexOf(tm) === i);
|
.filter((tm, i, array) => array.indexOf(tm) === i);
|
||||||
if (!tierUniqueCompatibleTms.length) {
|
if (tierUniqueCompatibleTms.length === 0) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ export class TrainerItemManager {
|
|||||||
};
|
};
|
||||||
return itemSpecs;
|
return itemSpecs;
|
||||||
}
|
}
|
||||||
return undefined;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
generateTrainerItemConfiguration(restrictedIds?: TrainerItemId[]): TrainerItemConfiguration {
|
generateTrainerItemConfiguration(restrictedIds?: TrainerItemId[]): TrainerItemConfiguration {
|
||||||
|
@ -51,9 +51,9 @@ export function assignEnemyBuffTokenForWave(tier: RarityTier) {
|
|||||||
let candidate = getNewTrainerItemFromPool(enemyBuffTokenPool[tier], globalScene.enemyTrainerItems);
|
let candidate = getNewTrainerItemFromPool(enemyBuffTokenPool[tier], globalScene.enemyTrainerItems);
|
||||||
let r = 0;
|
let r = 0;
|
||||||
while (
|
while (
|
||||||
++r < retryCount &&
|
++r < retryCount
|
||||||
allTrainerItems[candidate].getMaxStackCount() <
|
&& allTrainerItems[candidate].getMaxStackCount()
|
||||||
globalScene.enemyTrainerItems.getStack(candidate) + (r < 10 ? tierStackCount : 1)
|
< globalScene.enemyTrainerItems.getStack(candidate) + (r < 10 ? tierStackCount : 1)
|
||||||
) {
|
) {
|
||||||
candidate = getNewTrainerItemFromPool(enemyBuffTokenPool[tier], globalScene.enemyTrainerItems);
|
candidate = getNewTrainerItemFromPool(enemyBuffTokenPool[tier], globalScene.enemyTrainerItems);
|
||||||
}
|
}
|
||||||
|
@ -36,8 +36,8 @@ export class BerryPhase extends FieldPhase {
|
|||||||
eatBerries(pokemon: Pokemon): void {
|
eatBerries(pokemon: Pokemon): void {
|
||||||
const hasUsableBerry = pokemon.getHeldItems().some(m => {
|
const hasUsableBerry = pokemon.getHeldItems().some(m => {
|
||||||
return (
|
return (
|
||||||
isItemInCategory(m, HeldItemCategoryId.BERRY) &&
|
isItemInCategory(m, HeldItemCategoryId.BERRY)
|
||||||
(allHeldItems[m] as BerryHeldItem).shouldApply(HeldItemEffect.BERRY, { pokemon: pokemon })
|
&& (allHeldItems[m] as BerryHeldItem).shouldApply(HeldItemEffect.BERRY, { pokemon })
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -64,7 +64,7 @@ export class BerryPhase extends FieldPhase {
|
|||||||
CommonAnim.USE_ITEM,
|
CommonAnim.USE_ITEM,
|
||||||
);
|
);
|
||||||
|
|
||||||
applyHeldItems(HeldItemEffect.BERRY, { pokemon: pokemon });
|
applyHeldItems(HeldItemEffect.BERRY, { pokemon });
|
||||||
globalScene.updateItems(pokemon.isPlayer());
|
globalScene.updateItems(pokemon.isPlayer());
|
||||||
|
|
||||||
// AbilityId.CHEEK_POUCH only works once per round of nom noms
|
// AbilityId.CHEEK_POUCH only works once per round of nom noms
|
||||||
|
@ -430,7 +430,7 @@ export class MoveEffectPhase extends PokemonPhase {
|
|||||||
&& !this.move.hitsSubstitute(user, target)
|
&& !this.move.hitsSubstitute(user, target)
|
||||||
) {
|
) {
|
||||||
const flinched = new BooleanHolder(false);
|
const flinched = new BooleanHolder(false);
|
||||||
applyHeldItems(HeldItemEffect.FLINCH_CHANCE, { pokemon: user, flinched: flinched });
|
applyHeldItems(HeldItemEffect.FLINCH_CHANCE, { pokemon: user, flinched });
|
||||||
if (flinched.value) {
|
if (flinched.value) {
|
||||||
target.addTag(BattlerTagType.FLINCHED, undefined, this.move.id, user.id);
|
target.addTag(BattlerTagType.FLINCHED, undefined, this.move.id, user.id);
|
||||||
}
|
}
|
||||||
@ -882,7 +882,7 @@ export class MoveEffectPhase extends PokemonPhase {
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (user.isPlayer() && target.isEnemy()) {
|
if (user.isPlayer() && target.isEnemy()) {
|
||||||
applyHeldItems(HeldItemEffect.DAMAGE_MONEY_REWARD, { pokemon: user, damage: damage });
|
applyHeldItems(HeldItemEffect.DAMAGE_MONEY_REWARD, { pokemon: user, damage });
|
||||||
}
|
}
|
||||||
|
|
||||||
return [result, isCritical, damage];
|
return [result, isCritical, damage];
|
||||||
@ -1002,7 +1002,7 @@ export class MoveEffectPhase extends PokemonPhase {
|
|||||||
|
|
||||||
// Apply Grip Claw's chance to steal an item from the target
|
// Apply Grip Claw's chance to steal an item from the target
|
||||||
if (this.move.is("AttackMove")) {
|
if (this.move.is("AttackMove")) {
|
||||||
applyHeldItems(HeldItemEffect.CONTACT_ITEM_STEAL_CHANCE, { pokemon: user, target: target });
|
applyHeldItems(HeldItemEffect.CONTACT_ITEM_STEAL_CHANCE, { pokemon: user, target });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -409,10 +409,11 @@ export class MysteryEncounterBattlePhase extends Phase {
|
|||||||
|
|
||||||
// PostSummon and ShinySparkle phases are handled by SummonPhase
|
// PostSummon and ShinySparkle phases are handled by SummonPhase
|
||||||
|
|
||||||
if (encounterMode !== MysteryEncounterMode.TRAINER_BATTLE) {
|
if (
|
||||||
if (globalScene.trainerItems.hasItem(TrainerItemId.IV_SCANNER)) {
|
encounterMode !== MysteryEncounterMode.TRAINER_BATTLE
|
||||||
enemyField.map(p => globalScene.phaseManager.pushNew("ScanIvsPhase", p.getBattlerIndex()));
|
&& globalScene.trainerItems.hasItem(TrainerItemId.IV_SCANNER)
|
||||||
}
|
) {
|
||||||
|
enemyField.map(p => globalScene.phaseManager.pushNew("ScanIvsPhase", p.getBattlerIndex()));
|
||||||
}
|
}
|
||||||
|
|
||||||
const availablePartyMembers = globalScene.getPlayerParty().filter(p => p.isAllowedInBattle());
|
const availablePartyMembers = globalScene.getPlayerParty().filter(p => p.isAllowedInBattle());
|
||||||
|
@ -25,8 +25,8 @@ import { FusePokemonReward } from "#items/rewards/fuse";
|
|||||||
import { RememberMoveReward } from "#items/rewards/remember-move";
|
import { RememberMoveReward } from "#items/rewards/remember-move";
|
||||||
import { TmReward } from "#items/rewards/tm";
|
import { TmReward } from "#items/rewards/tm";
|
||||||
import { BattlePhase } from "#phases/battle-phase";
|
import { BattlePhase } from "#phases/battle-phase";
|
||||||
import { PartyOption, PartyUiHandler, PartyUiMode, type PokemonMoveSelectFilter } from "#ui/party-ui-handler";
|
|
||||||
import { type RewardSelectUiHandler, SHOP_OPTIONS_ROW_LIMIT } from "#ui/handlers/reward-select-ui-handler";
|
import { type RewardSelectUiHandler, SHOP_OPTIONS_ROW_LIMIT } from "#ui/handlers/reward-select-ui-handler";
|
||||||
|
import { PartyOption, PartyUiHandler, PartyUiMode, type PokemonMoveSelectFilter } from "#ui/party-ui-handler";
|
||||||
import { isNullOrUndefined, NumberHolder } from "#utils/common";
|
import { isNullOrUndefined, NumberHolder } from "#utils/common";
|
||||||
import i18next from "i18next";
|
import i18next from "i18next";
|
||||||
|
|
||||||
@ -211,11 +211,11 @@ export class SelectRewardPhase extends BattlePhase {
|
|||||||
-1,
|
-1,
|
||||||
(fromSlotIndex: number, itemIndex: number, itemQuantity: number, toSlotIndex: number) => {
|
(fromSlotIndex: number, itemIndex: number, itemQuantity: number, toSlotIndex: number) => {
|
||||||
if (
|
if (
|
||||||
toSlotIndex !== undefined &&
|
toSlotIndex !== undefined
|
||||||
fromSlotIndex < 6 &&
|
&& fromSlotIndex < 6
|
||||||
toSlotIndex < 6 &&
|
&& toSlotIndex < 6
|
||||||
fromSlotIndex !== toSlotIndex &&
|
&& fromSlotIndex !== toSlotIndex
|
||||||
itemIndex > -1
|
&& itemIndex > -1
|
||||||
) {
|
) {
|
||||||
const items = party[fromSlotIndex].heldItemManager.getTransferableHeldItems();
|
const items = party[fromSlotIndex].heldItemManager.getTransferableHeldItems();
|
||||||
const item = items[itemIndex];
|
const item = items[itemIndex];
|
||||||
@ -262,10 +262,10 @@ export class SelectRewardPhase extends BattlePhase {
|
|||||||
-1,
|
-1,
|
||||||
(fromSlotIndex: number, spliceSlotIndex: number) => {
|
(fromSlotIndex: number, spliceSlotIndex: number) => {
|
||||||
if (
|
if (
|
||||||
spliceSlotIndex !== undefined &&
|
spliceSlotIndex !== undefined
|
||||||
fromSlotIndex < 6 &&
|
&& fromSlotIndex < 6
|
||||||
spliceSlotIndex < 6 &&
|
&& spliceSlotIndex < 6
|
||||||
fromSlotIndex !== spliceSlotIndex
|
&& fromSlotIndex !== spliceSlotIndex
|
||||||
) {
|
) {
|
||||||
globalScene.ui.setMode(UiMode.REWARD_SELECT, this.isPlayer()).then(() => {
|
globalScene.ui.setMode(UiMode.REWARD_SELECT, this.isPlayer()).then(() => {
|
||||||
reward.apply({ pokemon: party[fromSlotIndex], pokemon2: party[spliceSlotIndex] });
|
reward.apply({ pokemon: party[fromSlotIndex], pokemon2: party[spliceSlotIndex] });
|
||||||
@ -302,7 +302,7 @@ export class SelectRewardPhase extends BattlePhase {
|
|||||||
if (isRememberMoveReward(reward)) {
|
if (isRememberMoveReward(reward)) {
|
||||||
partyUiMode = PartyUiMode.REMEMBER_MOVE_REWARD;
|
partyUiMode = PartyUiMode.REMEMBER_MOVE_REWARD;
|
||||||
getParams = (slotIndex: number, option: PartyOption) => {
|
getParams = (slotIndex: number, option: PartyOption) => {
|
||||||
return { pokemon: party[slotIndex], moveIndex: option, cost: cost } as PokemonMoveRecallRewardParams;
|
return { pokemon: party[slotIndex], moveIndex: option, cost } as PokemonMoveRecallRewardParams;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
if (isTmReward(reward)) {
|
if (isTmReward(reward)) {
|
||||||
@ -374,9 +374,9 @@ export class SelectRewardPhase extends BattlePhase {
|
|||||||
// If custom rewards are specified, overrides default item count
|
// If custom rewards are specified, overrides default item count
|
||||||
if (this.customRewardSettings) {
|
if (this.customRewardSettings) {
|
||||||
const newItemCount =
|
const newItemCount =
|
||||||
(this.customRewardSettings.guaranteedRarityTiers?.length ?? 0) +
|
(this.customRewardSettings.guaranteedRarityTiers?.length ?? 0)
|
||||||
(this.customRewardSettings.guaranteedRewardOptions?.length ?? 0) +
|
+ (this.customRewardSettings.guaranteedRewardOptions?.length ?? 0)
|
||||||
(this.customRewardSettings.guaranteedRewardSpecs?.length ?? 0);
|
+ (this.customRewardSettings.guaranteedRewardSpecs?.length ?? 0);
|
||||||
if (this.customRewardSettings.fillRemaining) {
|
if (this.customRewardSettings.fillRemaining) {
|
||||||
const originalCount = rewardCountHolder.value;
|
const originalCount = rewardCountHolder.value;
|
||||||
rewardCountHolder.value = originalCount > newItemCount ? originalCount : newItemCount;
|
rewardCountHolder.value = originalCount > newItemCount ? originalCount : newItemCount;
|
||||||
|
@ -229,7 +229,7 @@ export class StatStageChangePhase extends PokemonPhase {
|
|||||||
);
|
);
|
||||||
if (!existingPhase?.is("StatStageChangePhase")) {
|
if (!existingPhase?.is("StatStageChangePhase")) {
|
||||||
// Apply White Herb if needed
|
// Apply White Herb if needed
|
||||||
applyHeldItems(HeldItemEffect.RESET_NEGATIVE_STAT_STAGE, { pokemon: pokemon });
|
applyHeldItems(HeldItemEffect.RESET_NEGATIVE_STAT_STAGE, { pokemon });
|
||||||
}
|
}
|
||||||
|
|
||||||
pokemon.updateInfo();
|
pokemon.updateInfo();
|
||||||
|
@ -29,26 +29,25 @@ export class TrainerVictoryPhase extends BattlePhase {
|
|||||||
|
|
||||||
const trainerType = globalScene.currentBattle.trainer?.config.trainerType!; // TODO: is this bang correct?
|
const trainerType = globalScene.currentBattle.trainer?.config.trainerType!; // TODO: is this bang correct?
|
||||||
// Validate Voucher for boss trainers
|
// Validate Voucher for boss trainers
|
||||||
if (vouchers.hasOwnProperty(TrainerType[trainerType])) {
|
if (
|
||||||
if (
|
vouchers.hasOwnProperty(TrainerType[trainerType])
|
||||||
!globalScene.validateVoucher(vouchers[TrainerType[trainerType]]) &&
|
&& !globalScene.validateVoucher(vouchers[TrainerType[trainerType]])
|
||||||
globalScene.currentBattle.trainer?.config.isBoss
|
&& globalScene.currentBattle.trainer?.config.isBoss
|
||||||
) {
|
) {
|
||||||
if (timedEventManager.getUpgradeUnlockedVouchers()) {
|
if (timedEventManager.getUpgradeUnlockedVouchers()) {
|
||||||
globalScene.phaseManager.unshiftNew(
|
globalScene.phaseManager.unshiftNew(
|
||||||
"RewardPhase",
|
"RewardPhase",
|
||||||
[RewardId.VOUCHER_PLUS, RewardId.VOUCHER_PLUS, RewardId.VOUCHER_PLUS, RewardId.VOUCHER_PREMIUM][
|
[RewardId.VOUCHER_PLUS, RewardId.VOUCHER_PLUS, RewardId.VOUCHER_PLUS, RewardId.VOUCHER_PREMIUM][
|
||||||
vouchers[TrainerType[trainerType]].voucherType
|
vouchers[TrainerType[trainerType]].voucherType
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
globalScene.phaseManager.unshiftNew(
|
globalScene.phaseManager.unshiftNew(
|
||||||
"RewardPhase",
|
"RewardPhase",
|
||||||
[RewardId.VOUCHER, RewardId.VOUCHER, RewardId.VOUCHER_PLUS, RewardId.VOUCHER_PREMIUM][
|
[RewardId.VOUCHER, RewardId.VOUCHER, RewardId.VOUCHER_PLUS, RewardId.VOUCHER_PREMIUM][
|
||||||
vouchers[TrainerType[trainerType]].voucherType
|
vouchers[TrainerType[trainerType]].voucherType
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Breeders in Space achievement
|
// Breeders in Space achievement
|
||||||
|
@ -28,7 +28,7 @@ export class TurnEndPhase extends FieldPhase {
|
|||||||
if (!pokemon.switchOutStatus) {
|
if (!pokemon.switchOutStatus) {
|
||||||
pokemon.lapseTags(BattlerTagLapseType.TURN_END);
|
pokemon.lapseTags(BattlerTagLapseType.TURN_END);
|
||||||
|
|
||||||
applyHeldItems(HeldItemEffect.TURN_END_HEAL, { pokemon: pokemon });
|
applyHeldItems(HeldItemEffect.TURN_END_HEAL, { pokemon });
|
||||||
|
|
||||||
if (globalScene.arena.terrain?.terrainType === TerrainType.GRASSY && pokemon.isGrounded()) {
|
if (globalScene.arena.terrain?.terrainType === TerrainType.GRASSY && pokemon.isGrounded()) {
|
||||||
globalScene.phaseManager.unshiftNew(
|
globalScene.phaseManager.unshiftNew(
|
||||||
@ -43,16 +43,16 @@ export class TurnEndPhase extends FieldPhase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!pokemon.isPlayer()) {
|
if (!pokemon.isPlayer()) {
|
||||||
globalScene.applyPlayerItems(TrainerItemEffect.ENEMY_HEAL, { pokemon: pokemon });
|
globalScene.applyPlayerItems(TrainerItemEffect.ENEMY_HEAL, { pokemon });
|
||||||
globalScene.applyPlayerItems(TrainerItemEffect.ENEMY_STATUS_HEAL_CHANCE, { pokemon: pokemon });
|
globalScene.applyPlayerItems(TrainerItemEffect.ENEMY_STATUS_HEAL_CHANCE, { pokemon });
|
||||||
}
|
}
|
||||||
|
|
||||||
applyAbAttrs("PostTurnAbAttr", { pokemon });
|
applyAbAttrs("PostTurnAbAttr", { pokemon });
|
||||||
}
|
}
|
||||||
|
|
||||||
applyHeldItems(HeldItemEffect.TURN_END_STATUS, { pokemon: pokemon });
|
applyHeldItems(HeldItemEffect.TURN_END_STATUS, { pokemon });
|
||||||
|
|
||||||
applyHeldItems(HeldItemEffect.TURN_END_ITEM_STEAL, { pokemon: pokemon });
|
applyHeldItems(HeldItemEffect.TURN_END_ITEM_STEAL, { pokemon });
|
||||||
|
|
||||||
pokemon.tempSummonData.turnCount++;
|
pokemon.tempSummonData.turnCount++;
|
||||||
pokemon.tempSummonData.waveTurnCount++;
|
pokemon.tempSummonData.waveTurnCount++;
|
||||||
|
@ -132,6 +132,6 @@ export class VictoryPhase extends PokemonPhase {
|
|||||||
return gameMode.getFixedBattle(waveIndex).customRewardSettings;
|
return gameMode.getFixedBattle(waveIndex).customRewardSettings;
|
||||||
}
|
}
|
||||||
|
|
||||||
return undefined;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -494,12 +494,8 @@ export const achvs = {
|
|||||||
25,
|
25,
|
||||||
).setSecret(true),
|
).setSecret(true),
|
||||||
SPLICE: new Achv("splice", "splice.description", "dna_splicers", 50),
|
SPLICE: new Achv("splice", "splice.description", "dna_splicers", 50),
|
||||||
MINI_BLACK_HOLE: new HeldItemAchv(
|
MINI_BLACK_HOLE: new HeldItemAchv("miniBlackHole", "miniBlackHole.description", "mini_black_hole", 25, pokemon =>
|
||||||
"miniBlackHole",
|
pokemon.heldItemManager.hasItem(HeldItemId.MINI_BLACK_HOLE),
|
||||||
"miniBlackHole.description",
|
|
||||||
"mini_black_hole",
|
|
||||||
25,
|
|
||||||
pokemon => pokemon.heldItemManager.hasItem(HeldItemId.MINI_BLACK_HOLE),
|
|
||||||
).setSecret(),
|
).setSecret(),
|
||||||
HIDDEN_ABILITY: new Achv("hiddenAbility", "hiddenAbility.description", "ability_charm", 25),
|
HIDDEN_ABILITY: new Achv("hiddenAbility", "hiddenAbility.description", "ability_charm", 25),
|
||||||
PERFECT_IVS: new Achv("perfectIvs", "perfectIvs.description", "blunder_policy", 25),
|
PERFECT_IVS: new Achv("perfectIvs", "perfectIvs.description", "blunder_policy", 25),
|
||||||
|
@ -1162,20 +1162,20 @@ export class GameData {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
globalScene.trainerItems.clearItems();
|
globalScene.trainerItems.clearItems();
|
||||||
globalScene.assignTrainerItemsFromSaveData(sessionData.trainerItems, true);
|
globalScene.assignTrainerItemsFromSaveData(sessionData.trainerItems, true);
|
||||||
|
|
||||||
globalScene.arena.positionalTagManager.tags = fromSession.arena.positionalTags.map(tag =>
|
globalScene.arena.positionalTagManager.tags = fromSession.arena.positionalTags.map(tag =>
|
||||||
loadPositionalTag(tag),
|
loadPositionalTag(tag),
|
||||||
);
|
);
|
||||||
|
|
||||||
globalScene.enemyTrainerItems.clearItems();
|
globalScene.enemyTrainerItems.clearItems();
|
||||||
globalScene.assignTrainerItemsFromSaveData(sessionData.enemyTrainerItems, false);
|
globalScene.assignTrainerItemsFromSaveData(sessionData.enemyTrainerItems, false);
|
||||||
|
|
||||||
Promise.all(loadPokemonAssets).then(() => resolve(true));
|
Promise.all(loadPokemonAssets).then(() => resolve(true));
|
||||||
|
|
||||||
globalScene.updateItems(true);
|
globalScene.updateItems(true);
|
||||||
globalScene.updateItems(false);
|
globalScene.updateItems(false);
|
||||||
};
|
};
|
||||||
if (sessionData) {
|
if (sessionData) {
|
||||||
initSessionFromData(sessionData);
|
initSessionFromData(sessionData);
|
||||||
|
@ -177,9 +177,9 @@ export class BattleFlyout extends Phaser.GameObjects.Container {
|
|||||||
private onBerryUsed(event: Event) {
|
private onBerryUsed(event: Event) {
|
||||||
const berryUsedEvent = event as BerryUsedEvent;
|
const berryUsedEvent = event as BerryUsedEvent;
|
||||||
if (
|
if (
|
||||||
!berryUsedEvent ||
|
!berryUsedEvent
|
||||||
berryUsedEvent.pokemon.id !== this.pokemon?.id ||
|
|| berryUsedEvent.pokemon.id !== this.pokemon?.id
|
||||||
berryUsedEvent.berryType !== BerryType.LEPPA
|
|| berryUsedEvent.berryType !== BerryType.LEPPA
|
||||||
) {
|
) {
|
||||||
// We only care about Leppa berries
|
// We only care about Leppa berries
|
||||||
return;
|
return;
|
||||||
|
@ -835,9 +835,9 @@ export class PartyUiHandler extends MessageUiHandler {
|
|||||||
// This is only relevant for PartyUiMode.CHECK
|
// This is only relevant for PartyUiMode.CHECK
|
||||||
// TODO: This risks hitting the other options (.MOVE_i and ALL) so does it? Do we need an extra check?
|
// TODO: This risks hitting the other options (.MOVE_i and ALL) so does it? Do we need an extra check?
|
||||||
if (
|
if (
|
||||||
option >= PartyOption.FORM_CHANGE_ITEM &&
|
option >= PartyOption.FORM_CHANGE_ITEM
|
||||||
globalScene.phaseManager.getCurrentPhase().is("SelectRewardPhase") &&
|
&& globalScene.phaseManager.getCurrentPhase().is("SelectRewardPhase")
|
||||||
this.partyUiMode === PartyUiMode.CHECK
|
&& this.partyUiMode === PartyUiMode.CHECK
|
||||||
) {
|
) {
|
||||||
const formChangeItems = this.getFormChangeItems(pokemon);
|
const formChangeItems = this.getFormChangeItems(pokemon);
|
||||||
const item = formChangeItems[option - PartyOption.FORM_CHANGE_ITEM];
|
const item = formChangeItems[option - PartyOption.FORM_CHANGE_ITEM];
|
||||||
@ -950,7 +950,7 @@ export class PartyUiHandler extends MessageUiHandler {
|
|||||||
return this.moveOptionCursor(button);
|
return this.moveOptionCursor(button);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (button === Button.LEFT || button === Button.RIGHT && this.isItemManageMode()) {
|
if (button === Button.LEFT || (button === Button.RIGHT && this.isItemManageMode())) {
|
||||||
return this.processItemTransferModeLeftRightInput(button);
|
return this.processItemTransferModeLeftRightInput(button);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1017,8 +1017,8 @@ export class PartyUiHandler extends MessageUiHandler {
|
|||||||
const ui = this.getUi();
|
const ui = this.getUi();
|
||||||
if (this.cursor < 6) {
|
if (this.cursor < 6) {
|
||||||
if (
|
if (
|
||||||
(this.partyUiMode === PartyUiMode.ITEM_TRANSFER && !this.transferMode) ||
|
(this.partyUiMode === PartyUiMode.ITEM_TRANSFER && !this.transferMode)
|
||||||
this.partyUiMode === PartyUiMode.DISCARD
|
|| this.partyUiMode === PartyUiMode.DISCARD
|
||||||
) {
|
) {
|
||||||
/** Initialize item quantities for the selected Pokemon */
|
/** Initialize item quantities for the selected Pokemon */
|
||||||
const pokemon = globalScene.getPlayerParty()[this.cursor];
|
const pokemon = globalScene.getPlayerParty()[this.cursor];
|
||||||
@ -1063,8 +1063,8 @@ export class PartyUiHandler extends MessageUiHandler {
|
|||||||
private processPartyCancelInput(): boolean {
|
private processPartyCancelInput(): boolean {
|
||||||
const ui = this.getUi();
|
const ui = this.getUi();
|
||||||
if (
|
if (
|
||||||
(this.partyUiMode === PartyUiMode.ITEM_TRANSFER || this.partyUiMode === PartyUiMode.SPLICE) &&
|
(this.partyUiMode === PartyUiMode.ITEM_TRANSFER || this.partyUiMode === PartyUiMode.SPLICE)
|
||||||
this.transferMode
|
&& this.transferMode
|
||||||
) {
|
) {
|
||||||
this.clearTransfer();
|
this.clearTransfer();
|
||||||
ui.playSelect();
|
ui.playSelect();
|
||||||
@ -1337,8 +1337,8 @@ export class PartyUiHandler extends MessageUiHandler {
|
|||||||
|
|
||||||
private allowBatonSwitch(): boolean {
|
private allowBatonSwitch(): boolean {
|
||||||
return !!(
|
return !!(
|
||||||
this.partyUiMode !== PartyUiMode.FAINT_SWITCH &&
|
this.partyUiMode !== PartyUiMode.FAINT_SWITCH
|
||||||
globalScene.getPlayerField()[this.fieldIndex].heldItemManager.hasItem(HeldItemId.BATON)
|
&& globalScene.getPlayerField()[this.fieldIndex].heldItemManager.hasItem(HeldItemId.BATON)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1580,10 +1580,10 @@ export class PartyUiHandler extends MessageUiHandler {
|
|||||||
} else if (option === PartyOption.SCROLL_DOWN) {
|
} else if (option === PartyOption.SCROLL_DOWN) {
|
||||||
optionName = "↓";
|
optionName = "↓";
|
||||||
} else if (
|
} else if (
|
||||||
(this.partyUiMode !== PartyUiMode.REMEMBER_MOVE_REWARD &&
|
(this.partyUiMode !== PartyUiMode.REMEMBER_MOVE_REWARD
|
||||||
(this.partyUiMode !== PartyUiMode.ITEM_TRANSFER || this.transferMode) &&
|
&& (this.partyUiMode !== PartyUiMode.ITEM_TRANSFER || this.transferMode)
|
||||||
this.partyUiMode !== PartyUiMode.DISCARD) ||
|
&& this.partyUiMode !== PartyUiMode.DISCARD)
|
||||||
option === PartyOption.CANCEL
|
|| option === PartyOption.CANCEL
|
||||||
) {
|
) {
|
||||||
switch (option) {
|
switch (option) {
|
||||||
case PartyOption.MOVE_1:
|
case PartyOption.MOVE_1:
|
||||||
@ -1645,11 +1645,11 @@ export class PartyUiHandler extends MessageUiHandler {
|
|||||||
const items = pokemon.getHeldItems();
|
const items = pokemon.getHeldItems();
|
||||||
const item = items[option];
|
const item = items[option];
|
||||||
if (
|
if (
|
||||||
this.isItemManageMode() &&
|
this.isItemManageMode()
|
||||||
this.transferQuantitiesMax[option] > 1 &&
|
&& this.transferQuantitiesMax[option] > 1
|
||||||
!this.transferMode &&
|
&& !this.transferMode
|
||||||
item !== undefined &&
|
&& item !== undefined
|
||||||
allHeldItems[item].name === optionName
|
&& allHeldItems[item].name === optionName
|
||||||
) {
|
) {
|
||||||
let amountText = ` (${this.transferQuantities[option]})`;
|
let amountText = ` (${this.transferQuantities[option]})`;
|
||||||
|
|
||||||
|
@ -12,8 +12,8 @@ import { TrainerItemId } from "#enums/trainer-item-id";
|
|||||||
import { UiMode } from "#enums/ui-mode";
|
import { UiMode } from "#enums/ui-mode";
|
||||||
import type { RewardOption } from "#items/reward";
|
import type { RewardOption } from "#items/reward";
|
||||||
import { getPlayerShopRewardOptionsForWave, isTmReward } from "#items/reward-utils";
|
import { getPlayerShopRewardOptionsForWave, isTmReward } from "#items/reward-utils";
|
||||||
import { AwaitableUiHandler } from "#ui/handlers/awaitable-ui-handler";
|
|
||||||
import { MoveInfoOverlay } from "#ui/containers/move-info-overlay";
|
import { MoveInfoOverlay } from "#ui/containers/move-info-overlay";
|
||||||
|
import { AwaitableUiHandler } from "#ui/handlers/awaitable-ui-handler";
|
||||||
import { addTextObject, getRarityTierTextTint, getTextColor, getTextStyleOptions } from "#ui/text";
|
import { addTextObject, getRarityTierTextTint, getTextColor, getTextStyleOptions } from "#ui/text";
|
||||||
import { formatMoney, NumberHolder } from "#utils/common";
|
import { formatMoney, NumberHolder } from "#utils/common";
|
||||||
import i18next from "i18next";
|
import i18next from "i18next";
|
||||||
|
@ -28,7 +28,6 @@ import { LoadingModalUiHandler } from "#ui/handlers/loading-modal-ui-handler";
|
|||||||
import { LoginFormUiHandler } from "#ui/handlers/login-form-ui-handler";
|
import { LoginFormUiHandler } from "#ui/handlers/login-form-ui-handler";
|
||||||
import { MenuUiHandler } from "#ui/handlers/menu-ui-handler";
|
import { MenuUiHandler } from "#ui/handlers/menu-ui-handler";
|
||||||
import { MessageUiHandler } from "#ui/handlers/message-ui-handler";
|
import { MessageUiHandler } from "#ui/handlers/message-ui-handler";
|
||||||
import { ModifierSelectUiHandler } from "#ui/handlers/modifier-select-ui-handler";
|
|
||||||
import { MysteryEncounterUiHandler } from "#ui/handlers/mystery-encounter-ui-handler";
|
import { MysteryEncounterUiHandler } from "#ui/handlers/mystery-encounter-ui-handler";
|
||||||
import { PartyUiHandler } from "#ui/handlers/party-ui-handler";
|
import { PartyUiHandler } from "#ui/handlers/party-ui-handler";
|
||||||
import { PokedexPageUiHandler } from "#ui/handlers/pokedex-page-ui-handler";
|
import { PokedexPageUiHandler } from "#ui/handlers/pokedex-page-ui-handler";
|
||||||
@ -61,6 +60,7 @@ import { executeIf } from "#utils/common";
|
|||||||
import i18next from "i18next";
|
import i18next from "i18next";
|
||||||
import { AdminUiHandler } from "./handlers/admin-ui-handler";
|
import { AdminUiHandler } from "./handlers/admin-ui-handler";
|
||||||
import { RenameRunFormUiHandler } from "./handlers/rename-run-ui-handler";
|
import { RenameRunFormUiHandler } from "./handlers/rename-run-ui-handler";
|
||||||
|
import { RewardSelectUiHandler } from "./handlers/reward-select-ui-handler";
|
||||||
|
|
||||||
const transitionModes = [
|
const transitionModes = [
|
||||||
UiMode.SAVE_SLOT,
|
UiMode.SAVE_SLOT,
|
||||||
|
@ -538,7 +538,7 @@ export function pickWeightedIndex(weights: number[]): number | undefined {
|
|||||||
const totalWeight = weights.reduce((sum, w) => sum + w, 0);
|
const totalWeight = weights.reduce((sum, w) => sum + w, 0);
|
||||||
|
|
||||||
if (totalWeight <= 0) {
|
if (totalWeight <= 0) {
|
||||||
return undefined;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
let r = randSeedFloat() * totalWeight;
|
let r = randSeedFloat() * totalWeight;
|
||||||
@ -550,10 +550,10 @@ export function pickWeightedIndex(weights: number[]): number | undefined {
|
|||||||
r -= weights[i];
|
r -= weights[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
return undefined; // TODO: Change to something more appropriate
|
return; // TODO: Change to something more appropriate
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Type helper to check if a given item is in a tuple, returning `true` or `false` as appropriate.
|
* Type helper to check if a given item is in a tuple, returning `true` or `false` as appropriate.
|
||||||
* @typeParam T - The tuple to check
|
* @typeParam T - The tuple to check
|
||||||
* @param X - The item whose inclusion is being checked
|
* @param X - The item whose inclusion is being checked
|
||||||
@ -566,7 +566,7 @@ type InArray<T, X> = T extends readonly [X, ...infer _Rest]
|
|||||||
? InArray<Rest, X>
|
? InArray<Rest, X>
|
||||||
: false;
|
: false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Type helper to allow only unique elements in a tuple (effectively converting it to a Set).
|
* Type helper to allow only unique elements in a tuple (effectively converting it to a Set).
|
||||||
* Within it, any duplicate elements will be flagged and converted to an error message.
|
* Within it, any duplicate elements will be flagged and converted to an error message.
|
||||||
* @typeParam T - The tuple to render unique
|
* @typeParam T - The tuple to render unique
|
||||||
|
@ -98,9 +98,12 @@ describe("Abilities - Harvest", () => {
|
|||||||
|
|
||||||
await game.toNextTurn();
|
await game.toNextTurn();
|
||||||
|
|
||||||
expect(milotic.battleData.berriesEaten).toEqualArrayUnsorted(
|
expect(milotic.battleData.berriesEaten).toEqualArrayUnsorted([
|
||||||
[BerryType.ENIGMA, BerryType.LUM, BerryType.ENIGMA, BerryType.LUM]
|
BerryType.ENIGMA,
|
||||||
);
|
BerryType.LUM,
|
||||||
|
BerryType.ENIGMA,
|
||||||
|
BerryType.LUM,
|
||||||
|
]);
|
||||||
expect(getPartyBerries()).toHaveLength(0);
|
expect(getPartyBerries()).toHaveLength(0);
|
||||||
|
|
||||||
// proc a high roll and we _should_ get a berry back!
|
// proc a high roll and we _should_ get a berry back!
|
||||||
|
@ -202,13 +202,7 @@ describe("LevelAchv", () => {
|
|||||||
|
|
||||||
describe("HeldItemAchv", () => {
|
describe("HeldItemAchv", () => {
|
||||||
it("should create an instance of ModifierAchv", () => {
|
it("should create an instance of ModifierAchv", () => {
|
||||||
const heldItemAchv = new HeldItemAchv(
|
const heldItemAchv = new HeldItemAchv("", "Test Description", "modifier_icon", 10, () => true);
|
||||||
"",
|
|
||||||
"Test Description",
|
|
||||||
"modifier_icon",
|
|
||||||
10,
|
|
||||||
() => true,
|
|
||||||
);
|
|
||||||
expect(heldItemAchv).toBeInstanceOf(HeldItemAchv);
|
expect(heldItemAchv).toBeInstanceOf(HeldItemAchv);
|
||||||
expect(heldItemAchv instanceof Achv).toBe(true);
|
expect(heldItemAchv instanceof Achv).toBe(true);
|
||||||
});
|
});
|
||||||
|
@ -34,7 +34,7 @@ describe("Items - Eviolite", () => {
|
|||||||
|
|
||||||
vi.spyOn(partyMember, "getEffectiveStat").mockImplementation((stat, _opponent?, _move?, _isCritical?) => {
|
vi.spyOn(partyMember, "getEffectiveStat").mockImplementation((stat, _opponent?, _move?, _isCritical?) => {
|
||||||
const statValue = new NumberHolder(partyMember.getStat(stat, false));
|
const statValue = new NumberHolder(partyMember.getStat(stat, false));
|
||||||
applyHeldItems(HeldItemEffect.STAT_BOOST, { pokemon: partyMember, stat: stat, statValue: statValue });
|
applyHeldItems(HeldItemEffect.STAT_BOOST, { pokemon: partyMember, stat, statValue });
|
||||||
|
|
||||||
return Math.floor(statValue.value);
|
return Math.floor(statValue.value);
|
||||||
});
|
});
|
||||||
@ -53,7 +53,7 @@ describe("Items - Eviolite", () => {
|
|||||||
|
|
||||||
vi.spyOn(partyMember, "getEffectiveStat").mockImplementation((stat, _opponent?, _move?, _isCritical?) => {
|
vi.spyOn(partyMember, "getEffectiveStat").mockImplementation((stat, _opponent?, _move?, _isCritical?) => {
|
||||||
const statValue = new NumberHolder(partyMember.getStat(stat, false));
|
const statValue = new NumberHolder(partyMember.getStat(stat, false));
|
||||||
applyHeldItems(HeldItemEffect.STAT_BOOST, { pokemon: partyMember, stat: stat, statValue: statValue });
|
applyHeldItems(HeldItemEffect.STAT_BOOST, { pokemon: partyMember, stat, statValue });
|
||||||
|
|
||||||
// Ignore other calculations for simplicity
|
// Ignore other calculations for simplicity
|
||||||
|
|
||||||
@ -83,7 +83,7 @@ describe("Items - Eviolite", () => {
|
|||||||
|
|
||||||
vi.spyOn(partyMember, "getEffectiveStat").mockImplementation((stat, _opponent?, _move?, _isCritical?) => {
|
vi.spyOn(partyMember, "getEffectiveStat").mockImplementation((stat, _opponent?, _move?, _isCritical?) => {
|
||||||
const statValue = new NumberHolder(partyMember.getStat(stat, false));
|
const statValue = new NumberHolder(partyMember.getStat(stat, false));
|
||||||
applyHeldItems(HeldItemEffect.STAT_BOOST, { pokemon: partyMember, stat: stat, statValue: statValue });
|
applyHeldItems(HeldItemEffect.STAT_BOOST, { pokemon: partyMember, stat, statValue });
|
||||||
|
|
||||||
// Ignore other calculations for simplicity
|
// Ignore other calculations for simplicity
|
||||||
|
|
||||||
@ -113,7 +113,7 @@ describe("Items - Eviolite", () => {
|
|||||||
|
|
||||||
vi.spyOn(partyMember, "getEffectiveStat").mockImplementation((stat, _opponent?, _move?, _isCritical?) => {
|
vi.spyOn(partyMember, "getEffectiveStat").mockImplementation((stat, _opponent?, _move?, _isCritical?) => {
|
||||||
const statValue = new NumberHolder(partyMember.getStat(stat, false));
|
const statValue = new NumberHolder(partyMember.getStat(stat, false));
|
||||||
applyHeldItems(HeldItemEffect.STAT_BOOST, { pokemon: partyMember, stat: stat, statValue: statValue });
|
applyHeldItems(HeldItemEffect.STAT_BOOST, { pokemon: partyMember, stat, statValue });
|
||||||
|
|
||||||
// Ignore other calculations for simplicity
|
// Ignore other calculations for simplicity
|
||||||
|
|
||||||
@ -143,7 +143,7 @@ describe("Items - Eviolite", () => {
|
|||||||
|
|
||||||
vi.spyOn(partyMember, "getEffectiveStat").mockImplementation((stat, _opponent?, _move?, _isCritical?) => {
|
vi.spyOn(partyMember, "getEffectiveStat").mockImplementation((stat, _opponent?, _move?, _isCritical?) => {
|
||||||
const statValue = new NumberHolder(partyMember.getStat(stat, false));
|
const statValue = new NumberHolder(partyMember.getStat(stat, false));
|
||||||
applyHeldItems(HeldItemEffect.STAT_BOOST, { pokemon: partyMember, stat: stat, statValue: statValue });
|
applyHeldItems(HeldItemEffect.STAT_BOOST, { pokemon: partyMember, stat, statValue });
|
||||||
|
|
||||||
// Ignore other calculations for simplicity
|
// Ignore other calculations for simplicity
|
||||||
|
|
||||||
@ -173,7 +173,7 @@ describe("Items - Eviolite", () => {
|
|||||||
|
|
||||||
vi.spyOn(partyMember, "getEffectiveStat").mockImplementation((stat, _opponent?, _move?, _isCritical?) => {
|
vi.spyOn(partyMember, "getEffectiveStat").mockImplementation((stat, _opponent?, _move?, _isCritical?) => {
|
||||||
const statValue = new NumberHolder(partyMember.getStat(stat, false));
|
const statValue = new NumberHolder(partyMember.getStat(stat, false));
|
||||||
applyHeldItems(HeldItemEffect.STAT_BOOST, { pokemon: partyMember, stat: stat, statValue: statValue });
|
applyHeldItems(HeldItemEffect.STAT_BOOST, { pokemon: partyMember, stat, statValue });
|
||||||
|
|
||||||
// Ignore other calculations for simplicity
|
// Ignore other calculations for simplicity
|
||||||
|
|
||||||
@ -203,7 +203,7 @@ describe("Items - Eviolite", () => {
|
|||||||
|
|
||||||
vi.spyOn(partyMember, "getEffectiveStat").mockImplementation((stat, _opponent?, _move?, _isCritical?) => {
|
vi.spyOn(partyMember, "getEffectiveStat").mockImplementation((stat, _opponent?, _move?, _isCritical?) => {
|
||||||
const statValue = new NumberHolder(partyMember.getStat(stat, false));
|
const statValue = new NumberHolder(partyMember.getStat(stat, false));
|
||||||
applyHeldItems(HeldItemEffect.STAT_BOOST, { pokemon: partyMember, stat: stat, statValue: statValue });
|
applyHeldItems(HeldItemEffect.STAT_BOOST, { pokemon: partyMember, stat, statValue });
|
||||||
|
|
||||||
// Ignore other calculations for simplicity
|
// Ignore other calculations for simplicity
|
||||||
|
|
||||||
|
@ -179,8 +179,8 @@ describe("Department Store Sale - Mystery Encounter", () => {
|
|||||||
expect(rewardSelectHandler.options.length).toEqual(5);
|
expect(rewardSelectHandler.options.length).toEqual(5);
|
||||||
for (const option of rewardSelectHandler.options) {
|
for (const option of rewardSelectHandler.options) {
|
||||||
expect(
|
expect(
|
||||||
option.rewardOption.type.id === RewardId.DIRE_HIT ||
|
option.rewardOption.type.id === RewardId.DIRE_HIT
|
||||||
option.rewardOption.type.id === RewardId.TEMP_STAT_STAGE_BOOSTER,
|
|| option.rewardOption.type.id === RewardId.TEMP_STAT_STAGE_BOOSTER,
|
||||||
).toBeTruthy();
|
).toBeTruthy();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -264,7 +264,8 @@ describe("Fiery Fallout - Mystery Encounter", () => {
|
|||||||
await game.phaseInterceptor.to(SelectRewardPhase, false);
|
await game.phaseInterceptor.to(SelectRewardPhase, false);
|
||||||
expect(game).toBeAtPhase("SelectRewardPhase");
|
expect(game).toBeAtPhase("SelectRewardPhase");
|
||||||
|
|
||||||
const hasAttackBooster = game.field.getPlayerPokemon()
|
const hasAttackBooster = game.field
|
||||||
|
.getPlayerPokemon()
|
||||||
.heldItemManager.hasItem(HeldItemCategoryId.TYPE_ATTACK_BOOSTER);
|
.heldItemManager.hasItem(HeldItemCategoryId.TYPE_ATTACK_BOOSTER);
|
||||||
expect(hasAttackBooster).toBe(true);
|
expect(hasAttackBooster).toBe(true);
|
||||||
});
|
});
|
||||||
|
@ -213,20 +213,20 @@ describe("Mysterious Challengers - Mystery Encounter", () => {
|
|||||||
) as RewardSelectUiHandler;
|
) as RewardSelectUiHandler;
|
||||||
expect(rewardSelectHandler.options.length).toEqual(4);
|
expect(rewardSelectHandler.options.length).toEqual(4);
|
||||||
expect(
|
expect(
|
||||||
rewardSelectHandler.options[0].rewardOption.type.tier -
|
rewardSelectHandler.options[0].rewardOption.type.tier
|
||||||
rewardSelectHandler.options[0].rewardOption.upgradeCount,
|
- rewardSelectHandler.options[0].rewardOption.upgradeCount,
|
||||||
).toBe(RarityTier.ULTRA);
|
).toBe(RarityTier.ULTRA);
|
||||||
expect(
|
expect(
|
||||||
rewardSelectHandler.options[1].rewardOption.type.tier -
|
rewardSelectHandler.options[1].rewardOption.type.tier
|
||||||
rewardSelectHandler.options[1].rewardOption.upgradeCount,
|
- rewardSelectHandler.options[1].rewardOption.upgradeCount,
|
||||||
).toBe(RarityTier.ULTRA);
|
).toBe(RarityTier.ULTRA);
|
||||||
expect(
|
expect(
|
||||||
rewardSelectHandler.options[2].rewardOption.type.tier -
|
rewardSelectHandler.options[2].rewardOption.type.tier
|
||||||
rewardSelectHandler.options[2].rewardOption.upgradeCount,
|
- rewardSelectHandler.options[2].rewardOption.upgradeCount,
|
||||||
).toBe(RarityTier.GREAT);
|
).toBe(RarityTier.GREAT);
|
||||||
expect(
|
expect(
|
||||||
rewardSelectHandler.options[3].rewardOption.type.tier -
|
rewardSelectHandler.options[3].rewardOption.type.tier
|
||||||
rewardSelectHandler.options[3].rewardOption.upgradeCount,
|
- rewardSelectHandler.options[3].rewardOption.upgradeCount,
|
||||||
).toBe(RarityTier.GREAT);
|
).toBe(RarityTier.GREAT);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@ -269,20 +269,20 @@ describe("Mysterious Challengers - Mystery Encounter", () => {
|
|||||||
) as RewardSelectUiHandler;
|
) as RewardSelectUiHandler;
|
||||||
expect(rewardSelectHandler.options.length).toEqual(4);
|
expect(rewardSelectHandler.options.length).toEqual(4);
|
||||||
expect(
|
expect(
|
||||||
rewardSelectHandler.options[0].rewardOption.type.tier -
|
rewardSelectHandler.options[0].rewardOption.type.tier
|
||||||
rewardSelectHandler.options[0].rewardOption.upgradeCount,
|
- rewardSelectHandler.options[0].rewardOption.upgradeCount,
|
||||||
).toBe(RarityTier.ROGUE);
|
).toBe(RarityTier.ROGUE);
|
||||||
expect(
|
expect(
|
||||||
rewardSelectHandler.options[1].rewardOption.type.tier -
|
rewardSelectHandler.options[1].rewardOption.type.tier
|
||||||
rewardSelectHandler.options[1].rewardOption.upgradeCount,
|
- rewardSelectHandler.options[1].rewardOption.upgradeCount,
|
||||||
).toBe(RarityTier.ROGUE);
|
).toBe(RarityTier.ROGUE);
|
||||||
expect(
|
expect(
|
||||||
rewardSelectHandler.options[2].rewardOption.type.tier -
|
rewardSelectHandler.options[2].rewardOption.type.tier
|
||||||
rewardSelectHandler.options[2].rewardOption.upgradeCount,
|
- rewardSelectHandler.options[2].rewardOption.upgradeCount,
|
||||||
).toBe(RarityTier.ULTRA);
|
).toBe(RarityTier.ULTRA);
|
||||||
expect(
|
expect(
|
||||||
rewardSelectHandler.options[3].rewardOption.type.tier -
|
rewardSelectHandler.options[3].rewardOption.type.tier
|
||||||
rewardSelectHandler.options[3].rewardOption.upgradeCount,
|
- rewardSelectHandler.options[3].rewardOption.upgradeCount,
|
||||||
).toBe(RarityTier.GREAT);
|
).toBe(RarityTier.GREAT);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -148,7 +148,7 @@ describe("The Strong Stuff - Mystery Encounter", () => {
|
|||||||
|
|
||||||
const bstsAfter = scene.getPlayerParty().map(p => {
|
const bstsAfter = scene.getPlayerParty().map(p => {
|
||||||
const baseStats = p.getSpeciesForm().baseStats.slice(0);
|
const baseStats = p.getSpeciesForm().baseStats.slice(0);
|
||||||
applyHeldItems(HeldItemEffect.BASE_STAT_ADD, { pokemon: p, baseStats: baseStats });
|
applyHeldItems(HeldItemEffect.BASE_STAT_ADD, { pokemon: p, baseStats });
|
||||||
return baseStats.reduce((a, b) => a + b);
|
return baseStats.reduce((a, b) => a + b);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -212,20 +212,20 @@ describe("Trash to Treasure - Mystery Encounter", () => {
|
|||||||
) as RewardSelectUiHandler;
|
) as RewardSelectUiHandler;
|
||||||
expect(rewardSelectHandler.options.length).toEqual(4);
|
expect(rewardSelectHandler.options.length).toEqual(4);
|
||||||
expect(
|
expect(
|
||||||
rewardSelectHandler.options[0].rewardOption.type.tier -
|
rewardSelectHandler.options[0].rewardOption.type.tier
|
||||||
rewardSelectHandler.options[0].rewardOption.upgradeCount,
|
- rewardSelectHandler.options[0].rewardOption.upgradeCount,
|
||||||
).toEqual(RarityTier.ROGUE);
|
).toEqual(RarityTier.ROGUE);
|
||||||
expect(
|
expect(
|
||||||
rewardSelectHandler.options[1].rewardOption.type.tier -
|
rewardSelectHandler.options[1].rewardOption.type.tier
|
||||||
rewardSelectHandler.options[1].rewardOption.upgradeCount,
|
- rewardSelectHandler.options[1].rewardOption.upgradeCount,
|
||||||
).toEqual(RarityTier.ROGUE);
|
).toEqual(RarityTier.ROGUE);
|
||||||
expect(
|
expect(
|
||||||
rewardSelectHandler.options[2].rewardOption.type.tier -
|
rewardSelectHandler.options[2].rewardOption.type.tier
|
||||||
rewardSelectHandler.options[2].rewardOption.upgradeCount,
|
- rewardSelectHandler.options[2].rewardOption.upgradeCount,
|
||||||
).toEqual(RarityTier.ULTRA);
|
).toEqual(RarityTier.ULTRA);
|
||||||
expect(
|
expect(
|
||||||
rewardSelectHandler.options[3].rewardOption.type.tier -
|
rewardSelectHandler.options[3].rewardOption.type.tier
|
||||||
rewardSelectHandler.options[3].rewardOption.upgradeCount,
|
- rewardSelectHandler.options[3].rewardOption.upgradeCount,
|
||||||
).toEqual(RarityTier.GREAT);
|
).toEqual(RarityTier.GREAT);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -204,28 +204,28 @@ describe("Weird Dream - Mystery Encounter", () => {
|
|||||||
) as RewardSelectUiHandler;
|
) as RewardSelectUiHandler;
|
||||||
expect(rewardSelectHandler.options.length).toEqual(6);
|
expect(rewardSelectHandler.options.length).toEqual(6);
|
||||||
expect(
|
expect(
|
||||||
rewardSelectHandler.options[0].rewardOption.type.tier -
|
rewardSelectHandler.options[0].rewardOption.type.tier
|
||||||
rewardSelectHandler.options[0].rewardOption.upgradeCount,
|
- rewardSelectHandler.options[0].rewardOption.upgradeCount,
|
||||||
).toEqual(RarityTier.ROGUE);
|
).toEqual(RarityTier.ROGUE);
|
||||||
expect(
|
expect(
|
||||||
rewardSelectHandler.options[1].rewardOption.type.tier -
|
rewardSelectHandler.options[1].rewardOption.type.tier
|
||||||
rewardSelectHandler.options[1].rewardOption.upgradeCount,
|
- rewardSelectHandler.options[1].rewardOption.upgradeCount,
|
||||||
).toEqual(RarityTier.ROGUE);
|
).toEqual(RarityTier.ROGUE);
|
||||||
expect(
|
expect(
|
||||||
rewardSelectHandler.options[2].rewardOption.type.tier -
|
rewardSelectHandler.options[2].rewardOption.type.tier
|
||||||
rewardSelectHandler.options[2].rewardOption.upgradeCount,
|
- rewardSelectHandler.options[2].rewardOption.upgradeCount,
|
||||||
).toEqual(RarityTier.ULTRA);
|
).toEqual(RarityTier.ULTRA);
|
||||||
expect(
|
expect(
|
||||||
rewardSelectHandler.options[3].rewardOption.type.tier -
|
rewardSelectHandler.options[3].rewardOption.type.tier
|
||||||
rewardSelectHandler.options[3].rewardOption.upgradeCount,
|
- rewardSelectHandler.options[3].rewardOption.upgradeCount,
|
||||||
).toEqual(RarityTier.ULTRA);
|
).toEqual(RarityTier.ULTRA);
|
||||||
expect(
|
expect(
|
||||||
rewardSelectHandler.options[4].rewardOption.type.tier -
|
rewardSelectHandler.options[4].rewardOption.type.tier
|
||||||
rewardSelectHandler.options[4].rewardOption.upgradeCount,
|
- rewardSelectHandler.options[4].rewardOption.upgradeCount,
|
||||||
).toEqual(RarityTier.GREAT);
|
).toEqual(RarityTier.GREAT);
|
||||||
expect(
|
expect(
|
||||||
rewardSelectHandler.options[5].rewardOption.type.tier -
|
rewardSelectHandler.options[5].rewardOption.type.tier
|
||||||
rewardSelectHandler.options[5].rewardOption.upgradeCount,
|
- rewardSelectHandler.options[5].rewardOption.upgradeCount,
|
||||||
).toEqual(RarityTier.GREAT);
|
).toEqual(RarityTier.GREAT);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -48,7 +48,6 @@ import type { PhaseClass, PhaseString } from "#types/phase-types";
|
|||||||
import type { BallUiHandler } from "#ui/handlers/ball-ui-handler";
|
import type { BallUiHandler } from "#ui/handlers/ball-ui-handler";
|
||||||
import type { BattleMessageUiHandler } from "#ui/handlers/battle-message-ui-handler";
|
import type { BattleMessageUiHandler } from "#ui/handlers/battle-message-ui-handler";
|
||||||
import type { CommandUiHandler } from "#ui/handlers/command-ui-handler";
|
import type { CommandUiHandler } from "#ui/handlers/command-ui-handler";
|
||||||
import type { ModifierSelectUiHandler } from "#ui/handlers/reward-select-ui-handler";
|
|
||||||
import type { PartyUiHandler } from "#ui/handlers/party-ui-handler";
|
import type { PartyUiHandler } from "#ui/handlers/party-ui-handler";
|
||||||
import type { StarterSelectUiHandler } from "#ui/handlers/starter-select-ui-handler";
|
import type { StarterSelectUiHandler } from "#ui/handlers/starter-select-ui-handler";
|
||||||
import type { TargetSelectUiHandler } from "#ui/handlers/target-select-ui-handler";
|
import type { TargetSelectUiHandler } from "#ui/handlers/target-select-ui-handler";
|
||||||
|
@ -144,8 +144,8 @@ export class OverridesHelper extends GameManagerHelper {
|
|||||||
* @returns `this`
|
* @returns `this`
|
||||||
*/
|
*/
|
||||||
public startingPokeballs(pokeballs: PokeballCounts): this {
|
public startingPokeballs(pokeballs: PokeballCounts): this {
|
||||||
vi.spyOn(Overrides, "POKEBALL_OVERRIDE", "get").mockReturnValue({ active: true, pokeballs: pokeballs });
|
vi.spyOn(Overrides, "POKEBALL_OVERRIDE", "get").mockReturnValue({ active: true, pokeballs });
|
||||||
this.log("Player Pokemon starting held items set to:", { active: true, pokeballs: pokeballs });
|
this.log("Player Pokemon starting held items set to:", { active: true, pokeballs });
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user