mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-04 15:32:18 +02:00
Merge 03a0b429c5
into dd2f475ded
This commit is contained in:
commit
91f4923dce
@ -19,7 +19,7 @@ import {
|
||||
type Constructor,
|
||||
} from "#app/utils/common";
|
||||
import { deepMergeSpriteData } from "#app/utils/data";
|
||||
import type { Modifier, ModifierPredicate, TurnHeldItemTransferModifier } from "./modifier/modifier";
|
||||
import type { Modifier, ModifierPredicate } from "./modifier/modifier";
|
||||
import {
|
||||
ConsumableModifier,
|
||||
ConsumablePokemonModifier,
|
||||
@ -28,14 +28,9 @@ import {
|
||||
ExpShareModifier,
|
||||
FusePokemonModifier,
|
||||
HealingBoosterModifier,
|
||||
ModifierBar,
|
||||
MultipleParticipantExpBonusModifier,
|
||||
PersistentModifier,
|
||||
PokemonExpBoosterModifier,
|
||||
PokemonFormChangeItemModifier,
|
||||
PokemonHeldItemModifier,
|
||||
PokemonHpRestoreModifier,
|
||||
PokemonIncrementingStatModifier,
|
||||
RememberMoveModifier,
|
||||
} from "./modifier/modifier";
|
||||
import { PokeballType } from "#enums/pokeball";
|
||||
@ -53,18 +48,13 @@ import { GameData } from "#app/system/game-data";
|
||||
import { addTextObject, getTextColor, TextStyle } from "#app/ui/text";
|
||||
import { allMoves } from "./data/data-lists";
|
||||
import { MusicPreference } from "#app/system/settings/settings";
|
||||
import { getModifierType, modifierTypes, PokemonHeldItemModifierType } from "#app/modifier/modifier-type";
|
||||
import {
|
||||
getDefaultModifierTypeForTier,
|
||||
getEnemyModifierTypesForWave,
|
||||
getLuckString,
|
||||
getLuckTextTint,
|
||||
getModifierPoolForType,
|
||||
getModifierType,
|
||||
getPartyLuckValue,
|
||||
ModifierPoolType,
|
||||
modifierTypes,
|
||||
PokemonHeldItemModifierType,
|
||||
} from "#app/modifier/modifier-type";
|
||||
} from "#app/modifier/modifier-pool";
|
||||
import { getLuckString, getLuckTextTint, getPartyLuckValue } from "#app/modifier/modifier-utils";
|
||||
import AbilityBar from "#app/ui/ability-bar";
|
||||
import {
|
||||
applyAbAttrs,
|
||||
@ -186,6 +176,15 @@ import { hasExpSprite } from "./sprites/sprite-utils";
|
||||
import { timedEventManager } from "./global-event-manager";
|
||||
import { starterColors } from "./global-vars/starter-colors";
|
||||
import { startingWave } from "./starting-wave";
|
||||
import { ModifierBar } from "./modifier/modifier-bar";
|
||||
import {
|
||||
PokemonExpBoosterModifier,
|
||||
PokemonFormChangeItemModifier,
|
||||
PokemonHeldItemModifier,
|
||||
PokemonIncrementingStatModifier,
|
||||
type TurnHeldItemTransferModifier,
|
||||
} from "./modifier/held-item-modifier";
|
||||
import { ModifierPoolType } from "./modifier/modifier-pool-type";
|
||||
|
||||
const DEBUG_RNG = false;
|
||||
|
||||
|
@ -11,7 +11,7 @@ import {
|
||||
} from "#app/utils/common";
|
||||
import Trainer, { TrainerVariant } from "./field/trainer";
|
||||
import type { GameMode } from "./game-mode";
|
||||
import { MoneyMultiplierModifier, PokemonHeldItemModifier } from "./modifier/modifier";
|
||||
import { MoneyMultiplierModifier } from "./modifier/modifier";
|
||||
import type { PokeballType } from "#enums/pokeball";
|
||||
import { trainerConfigs } from "#app/data/trainers/trainer-config";
|
||||
import { SpeciesFormKey } from "#enums/species-form-key";
|
||||
@ -27,11 +27,12 @@ import { TrainerType } from "#enums/trainer-type";
|
||||
import i18next from "#app/plugins/i18n";
|
||||
import type MysteryEncounter from "#app/data/mystery-encounters/mystery-encounter";
|
||||
import { MysteryEncounterMode } from "#enums/mystery-encounter-mode";
|
||||
import type { CustomModifierSettings } from "#app/modifier/modifier-type";
|
||||
import type { CustomModifierSettings } from "#app/modifier/modifier-pool";
|
||||
import { ModifierTier } from "#app/modifier/modifier-tier";
|
||||
import type { MysteryEncounterType } from "#enums/mystery-encounter-type";
|
||||
import { BattleType } from "#enums/battle-type";
|
||||
import { ClassicFixedBossWaves } from "#enums/fixed-boss-waves";
|
||||
import { PokemonHeldItemModifier } from "./modifier/held-item-modifier";
|
||||
|
||||
export enum BattlerIndex {
|
||||
ATTACKER = -1,
|
||||
|
@ -22,7 +22,7 @@ import {
|
||||
} from "#app/data/moves/move";
|
||||
import { allMoves } from "../data-lists";
|
||||
import { ArenaTagSide } from "#app/data/arena-tag";
|
||||
import { BerryModifier, HitHealModifier, PokemonHeldItemModifier } from "#app/modifier/modifier";
|
||||
import { BerryModifier, HitHealModifier, PokemonHeldItemModifier } from "#app/modifier/held-item-modifier";
|
||||
import { TerrainType } from "#app/data/terrain";
|
||||
import { SpeciesFormChangeAbilityTrigger, SpeciesFormChangeRevertWeatherFormTrigger, SpeciesFormChangeWeatherTrigger } from "#app/data/pokemon-forms";
|
||||
import i18next from "i18next";
|
||||
|
@ -11,11 +11,12 @@ import { Moves } from "#enums/moves";
|
||||
import { Species } from "#enums/species";
|
||||
import { SpeciesFormKey } from "#enums/species-form-key";
|
||||
import { TimeOfDay } from "#enums/time-of-day";
|
||||
import { DamageMoneyRewardModifier, ExtraModifierModifier, MoneyMultiplierModifier, SpeciesStatBoosterModifier, TempExtraModifierModifier } from "#app/modifier/modifier";
|
||||
import { ExtraModifierModifier, MoneyMultiplierModifier, TempExtraModifierModifier } from "#app/modifier/modifier";
|
||||
import type { SpeciesStatBoosterModifierType } from "#app/modifier/modifier-type";
|
||||
import { speciesStarterCosts } from "./starters";
|
||||
import i18next from "i18next";
|
||||
import { initI18n } from "#app/plugins/i18n";
|
||||
import { DamageMoneyRewardModifier, SpeciesStatBoosterModifier } from "#app/modifier/held-item-modifier";
|
||||
|
||||
export enum SpeciesWildEvolutionDelay {
|
||||
NONE,
|
||||
|
@ -73,12 +73,11 @@ import {
|
||||
PokemonHeldItemModifier,
|
||||
PokemonMoveAccuracyBoosterModifier,
|
||||
PokemonMultiHitModifier,
|
||||
PreserveBerryModifier,
|
||||
} from "../../modifier/modifier";
|
||||
} from "../../modifier/held-item-modifier";
|
||||
import type { BattlerIndex } from "../../battle";
|
||||
import { BattleType } from "#enums/battle-type";
|
||||
import { TerrainType } from "../terrain";
|
||||
import { ModifierPoolType } from "#app/modifier/modifier-type";
|
||||
import { getOrInferTier } from "#app/modifier/modifier-pool";
|
||||
import { Command } from "../../ui/command-ui-handler";
|
||||
import i18next from "i18next";
|
||||
import type { Localizable } from "#app/interfaces/locales";
|
||||
@ -123,6 +122,8 @@ import { MoveEffectTrigger } from "#enums/MoveEffectTrigger";
|
||||
import { MultiHitType } from "#enums/MultiHitType";
|
||||
import { invalidAssistMoves, invalidCopycatMoves, invalidMetronomeMoves, invalidMirrorMoveMoves, invalidSleepTalkMoves } from "./invalid-moves";
|
||||
import { SelectBiomePhase } from "#app/phases/select-biome-phase";
|
||||
import { PreserveBerryModifier } from "#app/modifier/modifier";
|
||||
import { ModifierPoolType } from "#app/modifier/modifier-pool-type";
|
||||
|
||||
type MoveConditionFunc = (user: Pokemon, target: Pokemon, move: Move) => boolean;
|
||||
type UserMoveConditionFunc = (user: Pokemon, move: Move) => boolean;
|
||||
@ -2558,8 +2559,8 @@ export class StealHeldItemChanceAttr extends MoveEffectAttr {
|
||||
}
|
||||
|
||||
const poolType = target.isPlayer() ? ModifierPoolType.PLAYER : target.hasTrainer() ? ModifierPoolType.TRAINER : ModifierPoolType.WILD;
|
||||
const highestItemTier = heldItems.map((m) => m.type.getOrInferTier(poolType)).reduce((highestTier, tier) => Math.max(tier!, highestTier), 0); // TODO: is the bang after tier correct?
|
||||
const tierHeldItems = heldItems.filter((m) => m.type.getOrInferTier(poolType) === highestItemTier);
|
||||
const highestItemTier = heldItems.map((m) => getOrInferTier(m.type, poolType)).reduce((highestTier, tier) => Math.max(tier!, highestTier), 0); // TODO: is the bang after tier correct?
|
||||
const tierHeldItems = heldItems.filter((m) => getOrInferTier(m.type, poolType) === highestItemTier);
|
||||
const stolenItem = tierHeldItems[user.randBattleSeedInt(tierHeldItems.length)];
|
||||
if (!globalScene.tryTransferHeldItemModifier(stolenItem, user, false)) {
|
||||
return false;
|
||||
|
@ -20,7 +20,7 @@ import { PersistentModifierRequirement } from "#app/data/mystery-encounters/myst
|
||||
import { queueEncounterMessage } from "#app/data/mystery-encounters/utils/encounter-dialogue-utils";
|
||||
import { MysteryEncounterTier } from "#enums/mystery-encounter-tier";
|
||||
import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode";
|
||||
import { BerryModifier, PokemonInstantReviveModifier } from "#app/modifier/modifier";
|
||||
import { BerryModifier, PokemonInstantReviveModifier } from "#app/modifier/held-item-modifier";
|
||||
import { getPokemonSpecies } from "#app/data/pokemon-species";
|
||||
import { Moves } from "#enums/moves";
|
||||
import { BattlerTagType } from "#enums/battler-tag-type";
|
||||
|
@ -12,7 +12,8 @@ import {
|
||||
import type { PlayerPokemon } from "#app/field/pokemon";
|
||||
import type Pokemon from "#app/field/pokemon";
|
||||
import type { BerryModifierType, ModifierTypeOption } from "#app/modifier/modifier-type";
|
||||
import { ModifierPoolType, modifierTypes, regenerateModifierPoolThresholds } from "#app/modifier/modifier-type";
|
||||
import { modifierTypes } from "#app/modifier/modifier-type";
|
||||
import { regenerateModifierPoolThresholds } from "#app/modifier/modifier-pool";
|
||||
import { randSeedInt } from "#app/utils/common";
|
||||
import { BattlerTagType } from "#enums/battler-tag-type";
|
||||
import { MysteryEncounterType } from "#enums/mystery-encounter-type";
|
||||
@ -31,12 +32,13 @@ import {
|
||||
STANDARD_ENCOUNTER_BOOSTED_LEVEL_MODIFIER,
|
||||
} from "#app/data/mystery-encounters/utils/encounter-pokemon-utils";
|
||||
import PokemonData from "#app/system/pokemon-data";
|
||||
import { BerryModifier } from "#app/modifier/modifier";
|
||||
import { BerryModifier } from "#app/modifier/held-item-modifier";
|
||||
import i18next from "#app/plugins/i18n";
|
||||
import { BerryType } from "#enums/berry-type";
|
||||
import { PERMANENT_STATS, Stat } from "#enums/stat";
|
||||
import { StatStageChangePhase } from "#app/phases/stat-stage-change-phase";
|
||||
import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/constants";
|
||||
import { ModifierPoolType } from "#app/modifier/modifier-pool-type";
|
||||
|
||||
/** the i18n namespace for the encounter */
|
||||
const namespace = "mysteryEncounters/berriesAbound";
|
||||
|
@ -40,14 +40,13 @@ import {
|
||||
import { PokemonType } from "#enums/pokemon-type";
|
||||
import type { AttackTypeBoosterModifierType, ModifierTypeOption } from "#app/modifier/modifier-type";
|
||||
import { modifierTypes } from "#app/modifier/modifier-type";
|
||||
import type { PokemonHeldItemModifier } from "#app/modifier/modifier";
|
||||
import {
|
||||
AttackTypeBoosterModifier,
|
||||
BypassSpeedChanceModifier,
|
||||
ContactHeldItemTransferChanceModifier,
|
||||
GigantamaxAccessModifier,
|
||||
MegaEvolutionAccessModifier,
|
||||
} from "#app/modifier/modifier";
|
||||
type PokemonHeldItemModifier,
|
||||
} from "#app/modifier/held-item-modifier";
|
||||
import { GigantamaxAccessModifier, MegaEvolutionAccessModifier } from "#app/modifier/modifier";
|
||||
import i18next from "i18next";
|
||||
import MoveInfoOverlay from "#app/ui/move-info-overlay";
|
||||
import { allMoves } from "#app/data/data-lists";
|
||||
|
@ -13,7 +13,8 @@ import { TrainerPartyCompoundTemplate } from "#app/data/trainers/TrainerPartyTem
|
||||
import { TrainerPartyTemplate } from "#app/data/trainers/TrainerPartyTemplate";
|
||||
import { ModifierTier } from "#app/modifier/modifier-tier";
|
||||
import type { PokemonHeldItemModifierType } from "#app/modifier/modifier-type";
|
||||
import { ModifierPoolType, modifierTypes } from "#app/modifier/modifier-type";
|
||||
import { modifierTypes } from "#app/modifier/modifier-type";
|
||||
import { ModifierPoolType } from "#app/modifier/modifier-pool-type";
|
||||
import { MysteryEncounterType } from "#enums/mystery-encounter-type";
|
||||
import { PartyMemberStrength } from "#enums/party-member-strength";
|
||||
import { globalScene } from "#app/global-scene";
|
||||
@ -39,7 +40,7 @@ import type { OptionSelectConfig } from "#app/ui/abstact-option-select-ui-handle
|
||||
import type { PlayerPokemon } from "#app/field/pokemon";
|
||||
import { PokemonMove } from "#app/field/pokemon";
|
||||
import { Ability } from "#app/data/abilities/ability-class";
|
||||
import { BerryModifier } from "#app/modifier/modifier";
|
||||
import { BerryModifier } from "#app/modifier/held-item-modifier";
|
||||
import { BerryType } from "#enums/berry-type";
|
||||
import { BattlerIndex } from "#app/battle";
|
||||
import { Moves } from "#enums/moves";
|
||||
@ -49,6 +50,7 @@ import { CustomPokemonData } from "#app/data/custom-pokemon-data";
|
||||
import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/constants";
|
||||
import { EncounterAnim } from "#enums/encounter-anims";
|
||||
import { Challenges } from "#enums/challenges";
|
||||
import { withTierFromPool } from "#app/modifier/modifier-pool";
|
||||
|
||||
/** the i18n namespace for the encounter */
|
||||
const namespace = "mysteryEncounters/clowningAround";
|
||||
@ -318,7 +320,7 @@ export const ClowningAroundEncounter: MysteryEncounter = MysteryEncounterBuilder
|
||||
let numRogue = 0;
|
||||
|
||||
for (const m of items.filter(m => m.isTransferable && !(m instanceof BerryModifier))) {
|
||||
const type = m.type.withTierFromPool(ModifierPoolType.PLAYER, party);
|
||||
const type = withTierFromPool(m.type, ModifierPoolType.PLAYER, party);
|
||||
const tier = type.tier ?? ModifierTier.ULTRA;
|
||||
if (type.id === "GOLDEN_EGG" || tier === ModifierTier.ROGUE) {
|
||||
numRogue += m.stackCount;
|
||||
|
@ -17,8 +17,8 @@ import {
|
||||
import { MysteryEncounterTier } from "#enums/mystery-encounter-tier";
|
||||
import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode";
|
||||
import { ModifierRewardPhase } from "#app/phases/modifier-reward-phase";
|
||||
import type { PokemonHeldItemModifier } from "#app/modifier/modifier";
|
||||
import { PokemonFormChangeItemModifier } from "#app/modifier/modifier";
|
||||
import type { PokemonHeldItemModifier } from "#app/modifier/held-item-modifier";
|
||||
import { PokemonFormChangeItemModifier } from "#app/modifier/held-item-modifier";
|
||||
import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/constants";
|
||||
import { Challenges } from "#enums/challenges";
|
||||
|
||||
|
@ -19,9 +19,12 @@ import { getPokemonSpecies } from "#app/data/pokemon-species";
|
||||
import type { PlayerPokemon } from "#app/field/pokemon";
|
||||
import type Pokemon from "#app/field/pokemon";
|
||||
import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/constants";
|
||||
import type { PokemonHeldItemModifier, PokemonInstantReviveModifier } from "#app/modifier/modifier";
|
||||
import {
|
||||
BerryModifier,
|
||||
type PokemonHeldItemModifier,
|
||||
type PokemonInstantReviveModifier,
|
||||
} from "#app/modifier/held-item-modifier";
|
||||
import {
|
||||
HealingBoosterModifier,
|
||||
LevelIncrementBoosterModifier,
|
||||
MoneyMultiplierModifier,
|
||||
|
@ -11,11 +11,7 @@ import { STEALING_MOVES } from "#app/data/mystery-encounters/requirements/requir
|
||||
import type Pokemon from "#app/field/pokemon";
|
||||
import { ModifierTier } from "#app/modifier/modifier-tier";
|
||||
import type { ModifierTypeOption } from "#app/modifier/modifier-type";
|
||||
import {
|
||||
getPlayerModifierTypeOptions,
|
||||
ModifierPoolType,
|
||||
regenerateModifierPoolThresholds,
|
||||
} from "#app/modifier/modifier-type";
|
||||
import { getPlayerModifierTypeOptions, regenerateModifierPoolThresholds } from "#app/modifier/modifier-pool";
|
||||
import { MysteryEncounterType } from "#enums/mystery-encounter-type";
|
||||
import { globalScene } from "#app/global-scene";
|
||||
import type MysteryEncounter from "#app/data/mystery-encounters/mystery-encounter";
|
||||
@ -34,6 +30,7 @@ import { queueEncounterMessage } from "#app/data/mystery-encounters/utils/encoun
|
||||
import { randSeedInt } from "#app/utils/common";
|
||||
import { StatStageChangePhase } from "#app/phases/stat-stage-change-phase";
|
||||
import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/constants";
|
||||
import { ModifierPoolType } from "#app/modifier/modifier-pool-type";
|
||||
|
||||
/** the i18n namespace for the encounter */
|
||||
const namespace = "mysteryEncounters/fightOrFlight";
|
||||
|
@ -7,11 +7,7 @@ import { TrainerSlot } from "#enums/trainer-slot";
|
||||
import { ModifierTier } from "#app/modifier/modifier-tier";
|
||||
import { MusicPreference } from "#app/system/settings/settings";
|
||||
import type { ModifierTypeOption } from "#app/modifier/modifier-type";
|
||||
import {
|
||||
getPlayerModifierTypeOptions,
|
||||
ModifierPoolType,
|
||||
regenerateModifierPoolThresholds,
|
||||
} from "#app/modifier/modifier-type";
|
||||
import { getPlayerModifierTypeOptions, regenerateModifierPoolThresholds } from "#app/modifier/modifier-pool";
|
||||
import { MysteryEncounterType } from "#enums/mystery-encounter-type";
|
||||
import { globalScene } from "#app/global-scene";
|
||||
import type MysteryEncounter from "#app/data/mystery-encounters/mystery-encounter";
|
||||
@ -34,13 +30,12 @@ import {
|
||||
import type { PlayerPokemon } from "#app/field/pokemon";
|
||||
import type Pokemon from "#app/field/pokemon";
|
||||
import { EnemyPokemon, PokemonMove } from "#app/field/pokemon";
|
||||
import type { PokemonHeldItemModifier } from "#app/modifier/modifier";
|
||||
import {
|
||||
HiddenAbilityRateBoosterModifier,
|
||||
PokemonFormChangeItemModifier,
|
||||
ShinyRateBoosterModifier,
|
||||
SpeciesStatBoosterModifier,
|
||||
} from "#app/modifier/modifier";
|
||||
type PokemonHeldItemModifier,
|
||||
} from "#app/modifier/held-item-modifier";
|
||||
import { HiddenAbilityRateBoosterModifier, ShinyRateBoosterModifier } from "#app/modifier/modifier";
|
||||
import type { OptionSelectItem } from "#app/ui/abstact-option-select-ui-handler";
|
||||
import PokemonData from "#app/system/pokemon-data";
|
||||
import i18next from "i18next";
|
||||
@ -54,6 +49,8 @@ import type { PokeballType } from "#enums/pokeball";
|
||||
import { doShinySparkleAnim } from "#app/field/anims";
|
||||
import { TrainerType } from "#enums/trainer-type";
|
||||
import { timedEventManager } from "#app/global-event-manager";
|
||||
import { withTierFromPool } from "#app/modifier/modifier-pool";
|
||||
import { ModifierPoolType } from "#app/modifier/modifier-pool-type";
|
||||
|
||||
/** the i18n namespace for the encounter */
|
||||
const namespace = "mysteryEncounters/globalTradeSystem";
|
||||
@ -437,7 +434,7 @@ export const GlobalTradeSystemEncounter: MysteryEncounter = MysteryEncounterBuil
|
||||
const chosenPokemon: PlayerPokemon = encounter.misc.chosenPokemon;
|
||||
|
||||
// Check tier of the traded item, the received item will be one tier up
|
||||
const type = modifier.type.withTierFromPool(ModifierPoolType.PLAYER, party);
|
||||
const type = withTierFromPool(modifier.type, ModifierPoolType.PLAYER, party);
|
||||
let tier = type.tier ?? ModifierTier.GREAT;
|
||||
// Eggs and White Herb are not in the pool
|
||||
if (type.id === "WHITE_HERB") {
|
||||
|
@ -23,7 +23,8 @@ import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode
|
||||
import { Biome } from "#enums/biome";
|
||||
import { getBiomeKey } from "#app/field/arena";
|
||||
import { PokemonType } from "#enums/pokemon-type";
|
||||
import { getPartyLuckValue, modifierTypes } from "#app/modifier/modifier-type";
|
||||
import { modifierTypes } from "#app/modifier/modifier-type";
|
||||
import { getPartyLuckValue } from "#app/modifier/modifier-utils";
|
||||
import { TrainerSlot } from "#enums/trainer-slot";
|
||||
import { BattlerTagType } from "#enums/battler-tag-type";
|
||||
import { getPokemonNameWithAffix } from "#app/messages";
|
||||
|
@ -11,7 +11,7 @@ import { getNatureName } from "#app/data/nature";
|
||||
import { speciesStarterCosts } from "#app/data/balance/starters";
|
||||
import type { PlayerPokemon } from "#app/field/pokemon";
|
||||
import type Pokemon from "#app/field/pokemon";
|
||||
import type { PokemonHeldItemModifier } from "#app/modifier/modifier";
|
||||
import type { PokemonHeldItemModifier } from "#app/modifier/held-item-modifier";
|
||||
import { AbilityAttr } from "#app/system/game-data";
|
||||
import PokemonData from "#app/system/pokemon-data";
|
||||
import type { OptionSelectItem } from "#app/ui/abstact-option-select-ui-handler";
|
||||
|
@ -17,7 +17,7 @@ import { MysteryEncounterOptionBuilder } from "#app/data/mystery-encounters/myst
|
||||
import { MysteryEncounterTier } from "#enums/mystery-encounter-tier";
|
||||
import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode";
|
||||
import { Species } from "#enums/species";
|
||||
import { HitHealModifier, PokemonHeldItemModifier, TurnHealModifier } from "#app/modifier/modifier";
|
||||
import { HitHealModifier, PokemonHeldItemModifier, TurnHealModifier } from "#app/modifier/held-item-modifier";
|
||||
import { applyModifierTypeToPlayerPokemon } from "#app/data/mystery-encounters/utils/encounter-pokemon-utils";
|
||||
import { showEncounterText } from "#app/data/mystery-encounters/utils/encounter-dialogue-utils";
|
||||
import i18next from "#app/plugins/i18n";
|
||||
|
@ -34,7 +34,7 @@ import { SelfStatusMove } from "#app/data/moves/move";
|
||||
import { PokeballType } from "#enums/pokeball";
|
||||
import { BattlerTagType } from "#enums/battler-tag-type";
|
||||
import { queueEncounterMessage } from "#app/data/mystery-encounters/utils/encounter-dialogue-utils";
|
||||
import { BerryModifier } from "#app/modifier/modifier";
|
||||
import { BerryModifier } from "#app/modifier/held-item-modifier";
|
||||
import { StatStageChangePhase } from "#app/phases/stat-stage-change-phase";
|
||||
import { Stat } from "#enums/stat";
|
||||
import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/constants";
|
||||
|
@ -20,8 +20,8 @@ import { PokemonMove } from "#app/field/pokemon";
|
||||
import { NumberHolder, isNullOrUndefined, randSeedInt, randSeedShuffle } from "#app/utils/common";
|
||||
import type PokemonSpecies from "#app/data/pokemon-species";
|
||||
import { allSpecies, getPokemonSpecies } from "#app/data/pokemon-species";
|
||||
import type { PokemonHeldItemModifier } from "#app/modifier/modifier";
|
||||
import { HiddenAbilityRateBoosterModifier, PokemonFormChangeItemModifier } from "#app/modifier/modifier";
|
||||
import { PokemonFormChangeItemModifier, type PokemonHeldItemModifier } from "#app/modifier/held-item-modifier";
|
||||
import { HiddenAbilityRateBoosterModifier } from "#app/modifier/modifier";
|
||||
import { achvs } from "#app/system/achv";
|
||||
import { showEncounterText } from "#app/data/mystery-encounters/utils/encounter-dialogue-utils";
|
||||
import type { PokemonHeldItemModifierType } from "#app/modifier/modifier-type";
|
||||
|
@ -7,7 +7,7 @@ import { StatusEffect } from "#enums/status-effect";
|
||||
import { PokemonType } from "#enums/pokemon-type";
|
||||
import { WeatherType } from "#enums/weather-type";
|
||||
import type { PlayerPokemon } from "#app/field/pokemon";
|
||||
import { AttackTypeBoosterModifier } from "#app/modifier/modifier";
|
||||
import { AttackTypeBoosterModifier } from "#app/modifier/held-item-modifier";
|
||||
import type { AttackTypeBoosterModifierType } from "#app/modifier/modifier-type";
|
||||
import { isNullOrUndefined } from "#app/utils/common";
|
||||
import type { Abilities } from "#enums/abilities";
|
||||
|
@ -11,15 +11,18 @@ import { showEncounterText } from "#app/data/mystery-encounters/utils/encounter-
|
||||
import type { AiType, PlayerPokemon } from "#app/field/pokemon";
|
||||
import type Pokemon from "#app/field/pokemon";
|
||||
import { EnemyPokemon, FieldPosition, PokemonMove } from "#app/field/pokemon";
|
||||
import type { CustomModifierSettings, ModifierType } from "#app/modifier/modifier-type";
|
||||
import {
|
||||
getPartyLuckValue,
|
||||
ModifierPoolType,
|
||||
type ModifierType,
|
||||
ModifierTypeGenerator,
|
||||
ModifierTypeOption,
|
||||
modifierTypes,
|
||||
regenerateModifierPoolThresholds,
|
||||
} from "#app/modifier/modifier-type";
|
||||
import {
|
||||
type CustomModifierSettings,
|
||||
regenerateModifierPoolThresholds,
|
||||
withTierFromPool,
|
||||
} from "#app/modifier/modifier-pool";
|
||||
import { getPartyLuckValue } from "#app/modifier/modifier-utils";
|
||||
import {
|
||||
MysteryEncounterBattlePhase,
|
||||
MysteryEncounterBattleStartCleanupPhase,
|
||||
@ -66,6 +69,7 @@ import { PokemonType } from "#enums/pokemon-type";
|
||||
import { getNatureName } from "#app/data/nature";
|
||||
import { getPokemonNameWithAffix } from "#app/messages";
|
||||
import { timedEventManager } from "#app/global-event-manager";
|
||||
import { ModifierPoolType } from "#app/modifier/modifier-pool-type";
|
||||
|
||||
/**
|
||||
* Animates exclamation sprite over trainer's head at start of encounter
|
||||
@ -513,9 +517,11 @@ export function generateModifierType(modifier: () => ModifierType, pregenArgs?:
|
||||
let result: ModifierType = modifierTypes[modifierId]();
|
||||
|
||||
// Populates item id and tier (order matters)
|
||||
result = result
|
||||
.withIdFromFunc(modifierTypes[modifierId])
|
||||
.withTierFromPool(ModifierPoolType.PLAYER, globalScene.getPlayerParty());
|
||||
result = withTierFromPool(
|
||||
result.withIdFromFunc(modifierTypes[modifierId]),
|
||||
ModifierPoolType.PLAYER,
|
||||
globalScene.getPlayerParty(),
|
||||
);
|
||||
|
||||
return result instanceof ModifierTypeGenerator
|
||||
? result.generateType(globalScene.getPlayerParty(), pregenArgs)
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { globalScene } from "#app/global-scene";
|
||||
import i18next from "i18next";
|
||||
import { isNullOrUndefined, randSeedInt } from "#app/utils/common";
|
||||
import { PokemonHeldItemModifier } from "#app/modifier/modifier";
|
||||
import { PokemonHeldItemModifier } from "#app/modifier/held-item-modifier";
|
||||
import type { EnemyPokemon, PlayerPokemon } from "#app/field/pokemon";
|
||||
import type Pokemon from "#app/field/pokemon";
|
||||
import {
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { PokemonFormChangeItemModifier } from "../modifier/modifier";
|
||||
import { PokemonFormChangeItemModifier } from "../modifier/held-item-modifier";
|
||||
import type Pokemon from "../field/pokemon";
|
||||
import { StatusEffect } from "#enums/status-effect";
|
||||
import { allMoves } from "./data-lists";
|
||||
|
@ -1,5 +1,5 @@
|
||||
import type Move from "../data/moves/move";
|
||||
import type { BerryModifier } from "../modifier/modifier";
|
||||
import type { BerryModifier } from "../modifier/held-item-modifier";
|
||||
|
||||
/** Alias for all {@linkcode BattleScene} events */
|
||||
export enum BattleSceneEventType {
|
||||
|
@ -40,7 +40,7 @@ import { Abilities } from "#enums/abilities";
|
||||
import { SpeciesFormChangeRevertWeatherFormTrigger, SpeciesFormChangeWeatherTrigger } from "#app/data/pokemon-forms";
|
||||
import { CommonAnimPhase } from "#app/phases/common-anim-phase";
|
||||
import { WeatherType } from "#enums/weather-type";
|
||||
import { FieldEffectModifier } from "#app/modifier/modifier";
|
||||
import { FieldEffectModifier } from "#app/modifier/held-item-modifier";
|
||||
|
||||
export class Arena {
|
||||
public biomeType: Biome;
|
||||
|
@ -87,14 +87,16 @@ import {
|
||||
EnemyDamageReducerModifier,
|
||||
EnemyFusionChanceModifier,
|
||||
HiddenAbilityRateBoosterModifier,
|
||||
ShinyRateBoosterModifier,
|
||||
TempStatStageBoosterModifier,
|
||||
TempCritBoosterModifier,
|
||||
} from "#app/modifier/modifier";
|
||||
import {
|
||||
BaseStatModifier,
|
||||
PokemonFriendshipBoosterModifier,
|
||||
PokemonHeldItemModifier,
|
||||
PokemonNatureWeightModifier,
|
||||
ShinyRateBoosterModifier,
|
||||
SurviveDamageModifier,
|
||||
TempStatStageBoosterModifier,
|
||||
TempCritBoosterModifier,
|
||||
StatBoosterModifier,
|
||||
CritBoosterModifier,
|
||||
PokemonBaseStatFlatModifier,
|
||||
@ -102,7 +104,7 @@ import {
|
||||
PokemonIncrementingStatModifier,
|
||||
EvoTrackerModifier,
|
||||
PokemonMultiHitModifier,
|
||||
} from "#app/modifier/modifier";
|
||||
} from "#app/modifier/held-item-modifier";
|
||||
import { PokeballType } from "#enums/pokeball";
|
||||
import { Gender } from "#app/data/gender";
|
||||
import { Status, getRandomStatus } from "#app/data/status-effect";
|
||||
@ -6702,7 +6704,6 @@ export class EnemyPokemon extends Pokemon {
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Show or hide the type effectiveness multiplier window
|
||||
* Passing undefined will hide the window
|
||||
|
@ -1,5 +1,5 @@
|
||||
import type { PokemonHeldItemModifierType } from "#app/modifier/modifier-type";
|
||||
import type { PokemonHeldItemModifier } from "#app/modifier/modifier";
|
||||
import type { PokemonHeldItemModifier } from "#app/modifier/held-item-modifier";
|
||||
|
||||
export default interface HeldModifierConfig {
|
||||
modifier: PokemonHeldItemModifierType | PokemonHeldItemModifier;
|
||||
|
1906
src/modifier/held-item-modifier.ts
Normal file
1906
src/modifier/held-item-modifier.ts
Normal file
File diff suppressed because it is too large
Load Diff
106
src/modifier/modifier-bar.ts
Normal file
106
src/modifier/modifier-bar.ts
Normal file
@ -0,0 +1,106 @@
|
||||
import { globalScene } from "#app/global-scene";
|
||||
import { PokemonHeldItemModifier } from "./held-item-modifier";
|
||||
import type { Modifier, PersistentModifier } from "./modifier";
|
||||
|
||||
const iconOverflowIndex = 24;
|
||||
|
||||
export class ModifierBar extends Phaser.GameObjects.Container {
|
||||
private player: boolean;
|
||||
private modifierCache: PersistentModifier[];
|
||||
|
||||
constructor(enemy?: boolean) {
|
||||
super(globalScene, 1 + (enemy ? 302 : 0), 2);
|
||||
|
||||
this.player = !enemy;
|
||||
this.setScale(0.5);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to update content displayed in {@linkcode ModifierBar}
|
||||
* @param {PersistentModifier[]} modifiers - The list of modifiers to be displayed in the {@linkcode ModifierBar}
|
||||
* @param {boolean} hideHeldItems - If set to "true", only modifiers not assigned to a Pokémon are displayed
|
||||
*/
|
||||
updateModifiers(modifiers: PersistentModifier[], hideHeldItems = false) {
|
||||
this.removeAll(true);
|
||||
|
||||
const visibleIconModifiers = modifiers.filter(m => m.isIconVisible());
|
||||
const nonPokemonSpecificModifiers = visibleIconModifiers
|
||||
.filter(m => !(m as PokemonHeldItemModifier).pokemonId)
|
||||
.sort(modifierSortFunc);
|
||||
const pokemonSpecificModifiers = visibleIconModifiers
|
||||
.filter(m => (m as PokemonHeldItemModifier).pokemonId)
|
||||
.sort(modifierSortFunc);
|
||||
|
||||
const sortedVisibleIconModifiers = hideHeldItems
|
||||
? nonPokemonSpecificModifiers
|
||||
: nonPokemonSpecificModifiers.concat(pokemonSpecificModifiers);
|
||||
|
||||
sortedVisibleIconModifiers.forEach((modifier: PersistentModifier, i: number) => {
|
||||
const icon = modifier.getIcon();
|
||||
if (i >= iconOverflowIndex) {
|
||||
icon.setVisible(false);
|
||||
}
|
||||
this.add(icon);
|
||||
this.setModifierIconPosition(icon, sortedVisibleIconModifiers.length);
|
||||
icon.setInteractive(new Phaser.Geom.Rectangle(0, 0, 32, 24), Phaser.Geom.Rectangle.Contains);
|
||||
icon.on("pointerover", () => {
|
||||
globalScene.ui.showTooltip(modifier.type.name, modifier.type.getDescription());
|
||||
if (this.modifierCache && this.modifierCache.length > iconOverflowIndex) {
|
||||
this.updateModifierOverflowVisibility(true);
|
||||
}
|
||||
});
|
||||
icon.on("pointerout", () => {
|
||||
globalScene.ui.hideTooltip();
|
||||
if (this.modifierCache && this.modifierCache.length > iconOverflowIndex) {
|
||||
this.updateModifierOverflowVisibility(false);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
for (const icon of this.getAll()) {
|
||||
this.sendToBack(icon);
|
||||
}
|
||||
|
||||
this.modifierCache = modifiers;
|
||||
}
|
||||
|
||||
updateModifierOverflowVisibility(ignoreLimit: boolean) {
|
||||
const modifierIcons = this.getAll().reverse();
|
||||
for (const modifier of modifierIcons.map(m => m as Phaser.GameObjects.Container).slice(iconOverflowIndex)) {
|
||||
modifier.setVisible(ignoreLimit);
|
||||
}
|
||||
}
|
||||
|
||||
setModifierIconPosition(icon: Phaser.GameObjects.Container, modifierCount: number) {
|
||||
const rowIcons: number = 12 + 6 * Math.max(Math.ceil(Math.min(modifierCount, 24) / 12) - 2, 0);
|
||||
|
||||
const x = ((this.getIndex(icon) % rowIcons) * 26) / (rowIcons / 12);
|
||||
const y = Math.floor(this.getIndex(icon) / rowIcons) * 20;
|
||||
|
||||
icon.setPosition(this.player ? x : -x, y);
|
||||
}
|
||||
}
|
||||
|
||||
export const modifierSortFunc = (a: Modifier, b: Modifier): number => {
|
||||
const itemNameMatch = a.type.name.localeCompare(b.type.name);
|
||||
const typeNameMatch = a.constructor.name.localeCompare(b.constructor.name);
|
||||
const aId = a instanceof PokemonHeldItemModifier && a.pokemonId ? a.pokemonId : 4294967295;
|
||||
const bId = b instanceof PokemonHeldItemModifier && b.pokemonId ? b.pokemonId : 4294967295;
|
||||
|
||||
//First sort by pokemonID
|
||||
if (aId < bId) {
|
||||
return 1;
|
||||
}
|
||||
if (aId > bId) {
|
||||
return -1;
|
||||
}
|
||||
if (aId === bId) {
|
||||
//Then sort by item type
|
||||
if (typeNameMatch === 0) {
|
||||
return itemNameMatch;
|
||||
//Finally sort by item name
|
||||
}
|
||||
return typeNameMatch;
|
||||
}
|
||||
return 0;
|
||||
};
|
7
src/modifier/modifier-pool-type.ts
Normal file
7
src/modifier/modifier-pool-type.ts
Normal file
@ -0,0 +1,7 @@
|
||||
export enum ModifierPoolType {
|
||||
PLAYER,
|
||||
WILD,
|
||||
TRAINER,
|
||||
ENEMY_BUFF,
|
||||
DAILY_STARTER,
|
||||
}
|
1468
src/modifier/modifier-pool.ts
Normal file
1468
src/modifier/modifier-pool.ts
Normal file
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
67
src/modifier/modifier-utils.ts
Normal file
67
src/modifier/modifier-utils.ts
Normal file
@ -0,0 +1,67 @@
|
||||
import { MAX_PER_TYPE_POKEBALLS } from "#app/data/pokeball";
|
||||
import type Pokemon from "#app/field/pokemon";
|
||||
import { timedEventManager } from "#app/global-event-manager";
|
||||
import { globalScene } from "#app/global-scene";
|
||||
import { getModifierTierTextTint } from "#app/ui/text";
|
||||
import { NumberHolder, randSeedInt } from "#app/utils/common";
|
||||
import type { PokeballType } from "#enums/pokeball";
|
||||
import { ModifierTier } from "./modifier-tier";
|
||||
|
||||
/**
|
||||
* Used to check if the player has max of a given ball type in Classic
|
||||
* @param ballType The {@linkcode PokeballType} being checked
|
||||
* @returns boolean: true if the player has the maximum of a given ball type
|
||||
*/
|
||||
export function hasMaximumBalls(ballType: PokeballType): boolean {
|
||||
return globalScene.gameMode.isClassic && globalScene.pokeballCounts[ballType] >= MAX_PER_TYPE_POKEBALLS;
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculates the team's luck value.
|
||||
* @param party The player's party.
|
||||
* @returns A number between 0 and 14 based on the party's total luck value, or a random number between 0 and 14 if the player is in Daily Run mode.
|
||||
*/
|
||||
export function getPartyLuckValue(party: Pokemon[]): number {
|
||||
if (globalScene.gameMode.isDaily) {
|
||||
const DailyLuck = new NumberHolder(0);
|
||||
globalScene.executeWithSeedOffset(
|
||||
() => {
|
||||
DailyLuck.value = randSeedInt(15); // Random number between 0 and 14
|
||||
},
|
||||
0,
|
||||
globalScene.seed,
|
||||
);
|
||||
return DailyLuck.value;
|
||||
}
|
||||
const eventSpecies = timedEventManager.getEventLuckBoostedSpecies();
|
||||
const luck = Phaser.Math.Clamp(
|
||||
party
|
||||
.map(p => (p.isAllowedInBattle() ? p.getLuck() + (eventSpecies.includes(p.species.speciesId) ? 1 : 0) : 0))
|
||||
.reduce((total: number, value: number) => (total += value), 0),
|
||||
0,
|
||||
14,
|
||||
);
|
||||
return Math.min(timedEventManager.getEventLuckBoost() + (luck ?? 0), 14);
|
||||
}
|
||||
|
||||
export function getLuckString(luckValue: number): string {
|
||||
return ["D", "C", "C+", "B-", "B", "B+", "A-", "A", "A+", "A++", "S", "S+", "SS", "SS+", "SSS"][luckValue];
|
||||
}
|
||||
|
||||
export function getLuckTextTint(luckValue: number): number {
|
||||
let modifierTier: ModifierTier;
|
||||
if (luckValue > 11) {
|
||||
modifierTier = ModifierTier.LUXURY;
|
||||
} else if (luckValue > 9) {
|
||||
modifierTier = ModifierTier.MASTER;
|
||||
} else if (luckValue > 5) {
|
||||
modifierTier = ModifierTier.ROGUE;
|
||||
} else if (luckValue > 2) {
|
||||
modifierTier = ModifierTier.ULTRA;
|
||||
} else if (luckValue) {
|
||||
modifierTier = ModifierTier.GREAT;
|
||||
} else {
|
||||
modifierTier = ModifierTier.COMMON;
|
||||
}
|
||||
return getModifierTierTextTint(modifierTier);
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@ -1,12 +1,9 @@
|
||||
import { ModifierTier } from "#app/modifier/modifier-tier";
|
||||
import {
|
||||
regenerateModifierPoolThresholds,
|
||||
ModifierPoolType,
|
||||
getEnemyBuffModifierForWave,
|
||||
} from "#app/modifier/modifier-type";
|
||||
import { regenerateModifierPoolThresholds, getEnemyBuffModifierForWave } from "#app/modifier/modifier-pool";
|
||||
import { EnemyPersistentModifier } from "#app/modifier/modifier";
|
||||
import { Phase } from "#app/phase";
|
||||
import { globalScene } from "#app/global-scene";
|
||||
import { ModifierPoolType } from "#app/modifier/modifier-pool-type";
|
||||
|
||||
export class AddEnemyBuffModifierPhase extends Phase {
|
||||
start() {
|
||||
|
@ -12,7 +12,7 @@ import { getStatusEffectCatchRateMultiplier } from "#app/data/status-effect";
|
||||
import { addPokeballCaptureStars, addPokeballOpenParticles } from "#app/field/anims";
|
||||
import type { EnemyPokemon } from "#app/field/pokemon";
|
||||
import { getPokemonNameWithAffix } from "#app/messages";
|
||||
import { PokemonHeldItemModifier } from "#app/modifier/modifier";
|
||||
import { PokemonHeldItemModifier } from "#app/modifier/held-item-modifier";
|
||||
import { PokemonPhase } from "#app/phases/pokemon-phase";
|
||||
import { VictoryPhase } from "#app/phases/victory-phase";
|
||||
import { achvs } from "#app/system/achv";
|
||||
|
@ -1,8 +1,9 @@
|
||||
import { globalScene } from "#app/global-scene";
|
||||
import { applyPostBattleAbAttrs, PostBattleAbAttr } from "#app/data/abilities/ability";
|
||||
import { LapsingPersistentModifier, LapsingPokemonHeldItemModifier } from "#app/modifier/modifier";
|
||||
import { LapsingPersistentModifier } from "#app/modifier/modifier";
|
||||
import { BattlePhase } from "./battle-phase";
|
||||
import { GameOverPhase } from "./game-over-phase";
|
||||
import { LapsingPokemonHeldItemModifier } from "#app/modifier/held-item-modifier";
|
||||
|
||||
export class BattleEndPhase extends BattlePhase {
|
||||
/** If true, will increment battles won */
|
||||
|
@ -7,7 +7,7 @@ import {
|
||||
import { CommonAnim } from "#app/data/battle-anims";
|
||||
import { BerryUsedEvent } from "#app/events/battle-scene";
|
||||
import { getPokemonNameWithAffix } from "#app/messages";
|
||||
import { BerryModifier } from "#app/modifier/modifier";
|
||||
import { BerryModifier } from "#app/modifier/held-item-modifier";
|
||||
import i18next from "i18next";
|
||||
import { BooleanHolder } from "#app/utils/common";
|
||||
import { FieldPhase } from "./field-phase";
|
||||
|
@ -19,8 +19,8 @@ import { EncounterPhaseEvent } from "#app/events/battle-scene";
|
||||
import type Pokemon from "#app/field/pokemon";
|
||||
import { FieldPosition } from "#app/field/pokemon";
|
||||
import { getPokemonNameWithAffix } from "#app/messages";
|
||||
import { BoostBugSpawnModifier, IvScannerModifier, TurnHeldItemTransferModifier } from "#app/modifier/modifier";
|
||||
import { ModifierPoolType, regenerateModifierPoolThresholds } from "#app/modifier/modifier-type";
|
||||
import { BoostBugSpawnModifier, IvScannerModifier } from "#app/modifier/modifier";
|
||||
import { regenerateModifierPoolThresholds } from "#app/modifier/modifier-pool";
|
||||
import Overrides from "#app/overrides";
|
||||
import { BattlePhase } from "#app/phases/battle-phase";
|
||||
import { CheckSwitchPhase } from "#app/phases/check-switch-phase";
|
||||
@ -41,10 +41,13 @@ import { Biome } from "#enums/biome";
|
||||
import { MysteryEncounterMode } from "#enums/mystery-encounter-mode";
|
||||
import { PlayerGender } from "#enums/player-gender";
|
||||
import { Species } from "#enums/species";
|
||||
import { overrideHeldItems, overrideModifiers } from "#app/modifier/modifier";
|
||||
import { overrideModifiers } from "#app/modifier/modifier";
|
||||
import i18next from "i18next";
|
||||
import { WEIGHT_INCREMENT_ON_SPAWN_MISS } from "#app/data/mystery-encounters/mystery-encounters";
|
||||
import { getNatureName } from "#app/data/nature";
|
||||
import { TurnHeldItemTransferModifier } from "#app/modifier/held-item-modifier";
|
||||
import { ModifierPoolType } from "#app/modifier/modifier-pool-type";
|
||||
import { overrideHeldItems } from "#app/modifier/modifier-type";
|
||||
|
||||
export class EncounterPhase extends BattlePhase {
|
||||
private loaded: boolean;
|
||||
|
@ -20,7 +20,7 @@ import type { EnemyPokemon } from "#app/field/pokemon";
|
||||
import type Pokemon from "#app/field/pokemon";
|
||||
import { HitResult, PlayerPokemon, PokemonMove } from "#app/field/pokemon";
|
||||
import { getPokemonNameWithAffix } from "#app/messages";
|
||||
import { PokemonInstantReviveModifier } from "#app/modifier/modifier";
|
||||
import { PokemonInstantReviveModifier } from "#app/modifier/held-item-modifier";
|
||||
import { SwitchType } from "#enums/switch-type";
|
||||
import i18next from "i18next";
|
||||
import { DamageAnimPhase } from "./damage-anim-phase";
|
||||
|
@ -55,12 +55,10 @@ import { getPokemonNameWithAffix } from "#app/messages";
|
||||
import {
|
||||
ContactHeldItemTransferChanceModifier,
|
||||
DamageMoneyRewardModifier,
|
||||
EnemyAttackStatusEffectChanceModifier,
|
||||
EnemyEndureChanceModifier,
|
||||
FlinchChanceModifier,
|
||||
HitHealModifier,
|
||||
PokemonMultiHitModifier,
|
||||
} from "#app/modifier/modifier";
|
||||
} from "#app/modifier/held-item-modifier";
|
||||
import { PokemonPhase } from "#app/phases/pokemon-phase";
|
||||
import { BooleanHolder, isNullOrUndefined, NumberHolder } from "#app/utils/common";
|
||||
import type { nil } from "#app/utils/common";
|
||||
@ -78,6 +76,7 @@ import type Move from "#app/data/moves/move";
|
||||
import { isFieldTargeted } from "#app/data/moves/move-utils";
|
||||
import { FaintPhase } from "./faint-phase";
|
||||
import { DamageAchv } from "#app/system/achv";
|
||||
import { EnemyAttackStatusEffectChanceModifier, EnemyEndureChanceModifier } from "#app/modifier/modifier";
|
||||
|
||||
type HitCheckEntry = [HitCheckResult, TypeDamageMultiplier];
|
||||
|
||||
|
@ -2,8 +2,6 @@ import { globalScene } from "#app/global-scene";
|
||||
import type { ModifierTier } from "#app/modifier/modifier-tier";
|
||||
import type { ModifierTypeOption, ModifierType } from "#app/modifier/modifier-type";
|
||||
import {
|
||||
regenerateModifierPoolThresholds,
|
||||
getPlayerShopModifierTypeOptionsForWave,
|
||||
PokemonModifierType,
|
||||
FusePokemonModifierType,
|
||||
PokemonMoveModifierType,
|
||||
@ -11,16 +9,15 @@ import {
|
||||
RememberMoveModifierType,
|
||||
PokemonPpRestoreModifierType,
|
||||
PokemonPpUpModifierType,
|
||||
ModifierPoolType,
|
||||
getPlayerModifierTypeOptions,
|
||||
} from "#app/modifier/modifier-type";
|
||||
import type { Modifier } from "#app/modifier/modifier";
|
||||
import {
|
||||
ExtraModifierModifier,
|
||||
HealShopCostModifier,
|
||||
PokemonHeldItemModifier,
|
||||
TempExtraModifierModifier,
|
||||
} from "#app/modifier/modifier";
|
||||
regenerateModifierPoolThresholds,
|
||||
getPlayerShopModifierTypeOptionsForWave,
|
||||
getPlayerModifierTypeOptions,
|
||||
type CustomModifierSettings,
|
||||
} from "#app/modifier/modifier-pool";
|
||||
import type { Modifier } from "#app/modifier/modifier";
|
||||
import { ExtraModifierModifier, HealShopCostModifier, TempExtraModifierModifier } from "#app/modifier/modifier";
|
||||
import type ModifierSelectUiHandler from "#app/ui/modifier-select-ui-handler";
|
||||
import { SHOP_OPTIONS_ROW_LIMIT } from "#app/ui/modifier-select-ui-handler";
|
||||
import PartyUiHandler, { PartyUiMode, PartyOption } from "#app/ui/party-ui-handler";
|
||||
@ -28,8 +25,9 @@ import { UiMode } from "#enums/ui-mode";
|
||||
import i18next from "i18next";
|
||||
import { BattlePhase } from "./battle-phase";
|
||||
import Overrides from "#app/overrides";
|
||||
import type { CustomModifierSettings } from "#app/modifier/modifier-type";
|
||||
import { isNullOrUndefined, NumberHolder } from "#app/utils/common";
|
||||
import { PokemonHeldItemModifier } from "#app/modifier/held-item-modifier";
|
||||
import { ModifierPoolType } from "#app/modifier/modifier-pool-type";
|
||||
|
||||
export class SelectModifierPhase extends BattlePhase {
|
||||
private rerollCount: number;
|
||||
|
@ -3,7 +3,7 @@ import { applyChallenges, ChallengeType } from "#app/data/challenge";
|
||||
import { Gender } from "#app/data/gender";
|
||||
import { SpeciesFormChangeMoveLearnedTrigger } from "#app/data/pokemon-forms";
|
||||
import { getPokemonSpecies } from "#app/data/pokemon-species";
|
||||
import { overrideHeldItems, overrideModifiers } from "#app/modifier/modifier";
|
||||
import { overrideModifiers } from "#app/modifier/modifier";
|
||||
import Overrides from "#app/overrides";
|
||||
import { Phase } from "#app/phase";
|
||||
import { TitlePhase } from "#app/phases/title-phase";
|
||||
@ -13,6 +13,7 @@ import { UiMode } from "#enums/ui-mode";
|
||||
import type { Species } from "#enums/species";
|
||||
import SoundFade from "phaser3-rex-plugins/plugins/soundfade";
|
||||
import { isNullOrUndefined } from "#app/utils/common";
|
||||
import { overrideHeldItems } from "#app/modifier/modifier-type";
|
||||
|
||||
export class SelectStarterPhase extends Phase {
|
||||
start() {
|
||||
|
@ -15,7 +15,7 @@ import { ArenaTagSide, MistTag } from "#app/data/arena-tag";
|
||||
import type { ArenaTag } from "#app/data/arena-tag";
|
||||
import type Pokemon from "#app/field/pokemon";
|
||||
import { getPokemonNameWithAffix } from "#app/messages";
|
||||
import { ResetNegativeStatStageModifier } from "#app/modifier/modifier";
|
||||
import { ResetNegativeStatStageModifier } from "#app/modifier/held-item-modifier";
|
||||
import { handleTutorial, Tutorial } from "#app/tutorial";
|
||||
import { NumberHolder, BooleanHolder, isNullOrUndefined } from "#app/utils/common";
|
||||
import i18next from "i18next";
|
||||
|
@ -13,7 +13,7 @@ import { SpeciesFormChangeActiveTrigger } from "#app/data/pokemon-forms";
|
||||
import { TrainerSlot } from "#enums/trainer-slot";
|
||||
import type Pokemon from "#app/field/pokemon";
|
||||
import { getPokemonNameWithAffix } from "#app/messages";
|
||||
import { SwitchEffectTransferModifier } from "#app/modifier/modifier";
|
||||
import { SwitchEffectTransferModifier } from "#app/modifier/held-item-modifier";
|
||||
import { Command } from "#app/ui/command-ui-handler";
|
||||
import i18next from "i18next";
|
||||
import { PostSummonPhase } from "./post-summon-phase";
|
||||
@ -138,7 +138,6 @@ export class SwitchSummonPhase extends SummonPhase {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (this.switchType === SwitchType.BATON_PASS) {
|
||||
// If switching via baton pass, update opposing tags coming from the prior pokemon
|
||||
(this.player ? globalScene.getEnemyField() : globalScene.getPlayerField()).forEach((enemyPokemon: Pokemon) =>
|
||||
|
@ -5,12 +5,8 @@ import { Gender } from "#app/data/gender";
|
||||
import { getBiomeKey } from "#app/field/arena";
|
||||
import { GameMode, GameModes, getGameMode } from "#app/game-mode";
|
||||
import type { Modifier } from "#app/modifier/modifier";
|
||||
import {
|
||||
getDailyRunStarterModifiers,
|
||||
ModifierPoolType,
|
||||
modifierTypes,
|
||||
regenerateModifierPoolThresholds,
|
||||
} from "#app/modifier/modifier-type";
|
||||
import { modifierTypes } from "#app/modifier/modifier-type";
|
||||
import { getDailyRunStarterModifiers, regenerateModifierPoolThresholds } from "#app/modifier/modifier-pool";
|
||||
import { Phase } from "#app/phase";
|
||||
import type { SessionSaveData } from "#app/system/game-data";
|
||||
import { Unlockables } from "#app/system/unlockables";
|
||||
@ -27,6 +23,7 @@ import { SelectStarterPhase } from "./select-starter-phase";
|
||||
import { SummonPhase } from "./summon-phase";
|
||||
import { globalScene } from "#app/global-scene";
|
||||
import Overrides from "#app/overrides";
|
||||
import { ModifierPoolType } from "#app/modifier/modifier-pool-type";
|
||||
|
||||
export class TitlePhase extends Phase {
|
||||
private loaded = false;
|
||||
|
@ -5,17 +5,16 @@ import { WeatherType } from "#app/enums/weather-type";
|
||||
import { TurnEndEvent } from "#app/events/battle-scene";
|
||||
import type Pokemon from "#app/field/pokemon";
|
||||
import { getPokemonNameWithAffix } from "#app/messages";
|
||||
import {
|
||||
TurnHealModifier,
|
||||
EnemyTurnHealModifier,
|
||||
EnemyStatusEffectHealChanceModifier,
|
||||
TurnStatusEffectModifier,
|
||||
TurnHeldItemTransferModifier,
|
||||
} from "#app/modifier/modifier";
|
||||
import { EnemyTurnHealModifier, EnemyStatusEffectHealChanceModifier } from "#app/modifier/modifier";
|
||||
import i18next from "i18next";
|
||||
import { FieldPhase } from "./field-phase";
|
||||
import { PokemonHealPhase } from "./pokemon-heal-phase";
|
||||
import { globalScene } from "#app/global-scene";
|
||||
import {
|
||||
TurnHealModifier,
|
||||
TurnHeldItemTransferModifier,
|
||||
TurnStatusEffectModifier,
|
||||
} from "#app/modifier/held-item-modifier";
|
||||
|
||||
export class TurnEndPhase extends FieldPhase {
|
||||
start() {
|
||||
|
@ -5,7 +5,7 @@ import { Abilities } from "#app/enums/abilities";
|
||||
import { Stat } from "#app/enums/stat";
|
||||
import type Pokemon from "#app/field/pokemon";
|
||||
import { PokemonMove } from "#app/field/pokemon";
|
||||
import { BypassSpeedChanceModifier } from "#app/modifier/modifier";
|
||||
import { BypassSpeedChanceModifier } from "#app/modifier/held-item-modifier";
|
||||
import { Command } from "#app/ui/command-ui-handler";
|
||||
import { randSeedShuffle, BooleanHolder } from "#app/utils/common";
|
||||
import { AttemptCapturePhase } from "./attempt-capture-phase";
|
||||
|
@ -1,7 +1,7 @@
|
||||
import type { BattlerIndex } from "#app/battle";
|
||||
import { ClassicFixedBossWaves } from "#enums/fixed-boss-waves";
|
||||
import { BattleType } from "#enums/battle-type";
|
||||
import type { CustomModifierSettings } from "#app/modifier/modifier-type";
|
||||
import type { CustomModifierSettings } from "#app/modifier/modifier-pool";
|
||||
import { modifierTypes } from "#app/modifier/modifier-type";
|
||||
import { BattleEndPhase } from "./battle-end-phase";
|
||||
import { NewBattlePhase } from "./new-battle-phase";
|
||||
|
@ -1,5 +1,5 @@
|
||||
import type { Modifier } from "typescript";
|
||||
import { TurnHeldItemTransferModifier } from "../modifier/modifier";
|
||||
import { TurnHeldItemTransferModifier } from "../modifier/held-item-modifier";
|
||||
import { pokemonEvolutions } from "#app/data/balance/pokemon-evolutions";
|
||||
import i18next from "i18next";
|
||||
import { NumberHolder } from "#app/utils/common";
|
||||
|
@ -1,11 +1,11 @@
|
||||
import { globalScene } from "#app/global-scene";
|
||||
import type { ModifierTypeOption } from "../modifier/modifier-type";
|
||||
import { getPlayerShopModifierTypeOptionsForWave, TmModifierType } from "../modifier/modifier-type";
|
||||
import { TmModifierType } from "../modifier/modifier-type";
|
||||
import { getPokeballAtlasKey } from "#app/data/pokeball";
|
||||
import { addTextObject, getTextStyleOptions, getModifierTierTextTint, getTextColor, TextStyle } from "./text";
|
||||
import AwaitableUiHandler from "./awaitable-ui-handler";
|
||||
import { UiMode } from "#enums/ui-mode";
|
||||
import { LockModifierTiersModifier, PokemonHeldItemModifier, HealShopCostModifier } from "../modifier/modifier";
|
||||
import { LockModifierTiersModifier, HealShopCostModifier } from "../modifier/modifier";
|
||||
import { handleTutorial, Tutorial } from "../tutorial";
|
||||
import { Button } from "#enums/buttons";
|
||||
import MoveInfoOverlay from "./move-info-overlay";
|
||||
@ -16,6 +16,8 @@ import i18next from "i18next";
|
||||
import { ShopCursorTarget } from "#app/enums/shop-cursor-target";
|
||||
import Phaser from "phaser";
|
||||
import type { PokeballType } from "#enums/pokeball";
|
||||
import { getPlayerShopModifierTypeOptionsForWave } from "#app/modifier/modifier-pool";
|
||||
import { PokemonHeldItemModifier } from "#app/modifier/held-item-modifier";
|
||||
|
||||
export const SHOP_OPTIONS_ROW_LIMIT = 7;
|
||||
const SINGLE_SHOP_ROW_YOFFSET = 12;
|
||||
|
@ -10,7 +10,7 @@ import {
|
||||
PokemonFormChangeItemModifier,
|
||||
PokemonHeldItemModifier,
|
||||
SwitchEffectTransferModifier,
|
||||
} from "#app/modifier/modifier";
|
||||
} from "#app/modifier/held-item-modifier";
|
||||
import { ForceSwitchOutAttr } from "#app/data/moves/move";
|
||||
import { allMoves } from "#app/data/data-lists";
|
||||
import { Gender, getGenderColor, getGenderSymbol } from "#app/data/gender";
|
||||
@ -1165,8 +1165,7 @@ export default class PartyUiHandler extends MessageUiHandler {
|
||||
this.partyUiMode !== PartyUiMode.FAINT_SWITCH &&
|
||||
globalScene.findModifier(
|
||||
m =>
|
||||
m instanceof SwitchEffectTransferModifier &&
|
||||
m.pokemonId === globalScene.getPlayerField()[this.fieldIndex].id,
|
||||
m instanceof SwitchEffectTransferModifier && m.pokemonId === globalScene.getPlayerField()[this.fieldIndex].id,
|
||||
)
|
||||
);
|
||||
}
|
||||
|
@ -12,7 +12,7 @@ import { Button } from "../enums/buttons";
|
||||
import { BattleType } from "#enums/battle-type";
|
||||
import { TrainerVariant } from "../field/trainer";
|
||||
import { Challenges } from "#enums/challenges";
|
||||
import { getLuckString, getLuckTextTint } from "../modifier/modifier-type";
|
||||
import { getLuckString, getLuckTextTint } from "../modifier/modifier-utils";
|
||||
import RoundRectangle from "phaser3-rex-plugins/plugins/roundrectangle";
|
||||
import { getTypeRgb } from "#app/data/type";
|
||||
import { PokemonType } from "#enums/pokemon-type";
|
||||
@ -27,6 +27,8 @@ import { SettingKeyboard } from "#app/system/settings/settings-keyboard";
|
||||
import { getBiomeName } from "#app/data/balance/biomes";
|
||||
import type { MysteryEncounterType } from "#enums/mystery-encounter-type";
|
||||
import { globalScene } from "#app/global-scene";
|
||||
import { PokemonHeldItemModifier } from "#app/modifier/held-item-modifier";
|
||||
import { modifierSortFunc } from "#app/modifier/modifier-bar";
|
||||
|
||||
/**
|
||||
* RunInfoUiMode indicates possible overlays of RunInfoUiHandler.
|
||||
@ -650,7 +652,7 @@ export default class RunInfoUiHandler extends UiHandler {
|
||||
modifierIconsContainer.setScale(0.45);
|
||||
for (const m of this.runInfo.modifiers) {
|
||||
const modifier = m.toModifier(this.modifiersModule[m.className]);
|
||||
if (modifier instanceof Modifier.PokemonHeldItemModifier) {
|
||||
if (modifier instanceof PokemonHeldItemModifier) {
|
||||
continue;
|
||||
}
|
||||
const icon = modifier?.getIcon(false);
|
||||
@ -881,17 +883,17 @@ export default class RunInfoUiHandler extends UiHandler {
|
||||
const heldItemsScale =
|
||||
this.runInfo.gameMode === GameModes.SPLICED_ENDLESS || this.runInfo.gameMode === GameModes.ENDLESS ? 0.25 : 0.5;
|
||||
const heldItemsContainer = globalScene.add.container(-82, 2);
|
||||
const heldItemsList: Modifier.PokemonHeldItemModifier[] = [];
|
||||
const heldItemsList: PokemonHeldItemModifier[] = [];
|
||||
if (this.runInfo.modifiers.length) {
|
||||
for (const m of this.runInfo.modifiers) {
|
||||
const modifier = m.toModifier(this.modifiersModule[m.className]);
|
||||
if (modifier instanceof Modifier.PokemonHeldItemModifier && modifier.pokemonId === pokemon.id) {
|
||||
if (modifier instanceof PokemonHeldItemModifier && modifier.pokemonId === pokemon.id) {
|
||||
modifier.stackCount = m["stackCount"];
|
||||
heldItemsList.push(modifier);
|
||||
}
|
||||
}
|
||||
if (heldItemsList.length > 0) {
|
||||
(heldItemsList as Modifier.PokemonHeldItemModifier[]).sort(Modifier.modifierSortFunc);
|
||||
(heldItemsList as PokemonHeldItemModifier[]).sort(modifierSortFunc);
|
||||
let row = 0;
|
||||
for (const [index, item] of heldItemsList.entries()) {
|
||||
if (index > 36) {
|
||||
|
@ -12,6 +12,7 @@ import { TextStyle, addTextObject } from "./text";
|
||||
import { UiMode } from "#enums/ui-mode";
|
||||
import { addWindow } from "./ui-theme";
|
||||
import { RunDisplayMode } from "#app/ui/run-info-ui-handler";
|
||||
import { PokemonHeldItemModifier } from "#app/modifier/held-item-modifier";
|
||||
|
||||
const SESSION_SLOTS_COUNT = 5;
|
||||
const SLOTS_ON_SCREEN = 3;
|
||||
@ -445,7 +446,7 @@ class SessionSlot extends Phaser.GameObjects.Container {
|
||||
let visibleModifierIndex = 0;
|
||||
for (const m of data.modifiers) {
|
||||
const modifier = m.toModifier(Modifier[m.className]);
|
||||
if (modifier instanceof Modifier.PokemonHeldItemModifier) {
|
||||
if (modifier instanceof PokemonHeldItemModifier) {
|
||||
continue;
|
||||
}
|
||||
const icon = modifier?.getIcon(false);
|
||||
|
@ -24,7 +24,6 @@ import { MoveCategory } from "#enums/MoveCategory";
|
||||
import { getPokeballAtlasKey } from "#app/data/pokeball";
|
||||
import { getGenderColor, getGenderSymbol } from "#app/data/gender";
|
||||
import { getLevelRelExp, getLevelTotalExp } from "#app/data/exp";
|
||||
import { PokemonHeldItemModifier } from "#app/modifier/modifier";
|
||||
import { StatusEffect } from "#enums/status-effect";
|
||||
import { getBiomeName } from "#app/data/balance/biomes";
|
||||
import { getNatureName, getNatureStatMultiplier } from "#app/data/nature";
|
||||
@ -34,11 +33,12 @@ import { getVariantTint } from "#app/sprites/variant";
|
||||
import { Button } from "#enums/buttons";
|
||||
import type { Ability } from "#app/data/abilities/ability-class";
|
||||
import i18next from "i18next";
|
||||
import { modifierSortFunc } from "#app/modifier/modifier";
|
||||
import { PlayerGender } from "#enums/player-gender";
|
||||
import { Stat, PERMANENT_STATS, getStatKey } from "#enums/stat";
|
||||
import { Nature } from "#enums/nature";
|
||||
import { achvs } from "#app/system/achv";
|
||||
import { PokemonHeldItemModifier } from "#app/modifier/held-item-modifier";
|
||||
import { modifierSortFunc } from "#app/modifier/modifier-bar";
|
||||
|
||||
enum Page {
|
||||
PROFILE,
|
||||
|
@ -6,7 +6,7 @@ import { getMoveTargets } from "../data/moves/move";
|
||||
import { Button } from "#enums/buttons";
|
||||
import type { Moves } from "#enums/moves";
|
||||
import type Pokemon from "#app/field/pokemon";
|
||||
import type { ModifierBar } from "#app/modifier/modifier";
|
||||
import type { ModifierBar } from "#app/modifier/modifier-bar";
|
||||
import { SubstituteTag } from "#app/data/battler-tags";
|
||||
import { globalScene } from "#app/global-scene";
|
||||
|
||||
|
@ -1,7 +1,8 @@
|
||||
import { BattlerIndex } from "#app/battle";
|
||||
import { PostTurnRestoreBerryAbAttr } from "#app/data/abilities/ability";
|
||||
import type Pokemon from "#app/field/pokemon";
|
||||
import { BerryModifier, PreserveBerryModifier } from "#app/modifier/modifier";
|
||||
import { BerryModifier } from "#app/modifier/held-item-modifier";
|
||||
import { PreserveBerryModifier } from "#app/modifier/modifier";
|
||||
import type { ModifierOverride } from "#app/modifier/modifier-type";
|
||||
import type { BooleanHolder } from "#app/utils/common";
|
||||
import { Abilities } from "#enums/abilities";
|
||||
|
@ -3,7 +3,7 @@ import { PostItemLostAbAttr } from "#app/data/abilities/ability";
|
||||
import { StealHeldItemChanceAttr } from "#app/data/moves/move";
|
||||
import { allMoves } from "#app/data/data-lists";
|
||||
import type Pokemon from "#app/field/pokemon";
|
||||
import type { ContactHeldItemTransferChanceModifier } from "#app/modifier/modifier";
|
||||
import type {} from "#app/modifier/modifier";
|
||||
import { Abilities } from "#enums/abilities";
|
||||
import { BattlerTagType } from "#enums/battler-tag-type";
|
||||
import { BerryType } from "#enums/berry-type";
|
||||
@ -13,6 +13,7 @@ import { Stat } from "#enums/stat";
|
||||
import GameManager from "#test/testUtils/gameManager";
|
||||
import Phaser from "phaser";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import type { ContactHeldItemTransferChanceModifier } from "#app/modifier/held-item-modifier";
|
||||
|
||||
describe("Abilities - Unburden", () => {
|
||||
let phaserGame: Phaser.Game;
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { TurnHeldItemTransferModifier } from "#app/modifier/modifier";
|
||||
import { TurnHeldItemTransferModifier } from "#app/modifier/held-item-modifier";
|
||||
import {
|
||||
Achv,
|
||||
AchvTier,
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { GameModes } from "#app/game-mode";
|
||||
import { TurnHeldItemTransferModifier } from "#app/modifier/modifier";
|
||||
import { TurnHeldItemTransferModifier } from "#app/modifier/held-item-modifier";
|
||||
import { Abilities } from "#enums/abilities";
|
||||
import { Biome } from "#enums/biome";
|
||||
import { Moves } from "#enums/moves";
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { StatBoosterModifier } from "#app/modifier/modifier";
|
||||
import { StatBoosterModifier } from "#app/modifier/held-item-modifier";
|
||||
import { NumberHolder, randItem } from "#app/utils/common";
|
||||
import { Species } from "#enums/species";
|
||||
import { Stat } from "#enums/stat";
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { Abilities } from "#app/enums/abilities";
|
||||
import { PokemonExpBoosterModifier } from "#app/modifier/modifier";
|
||||
import { PokemonExpBoosterModifier } from "#app/modifier/held-item-modifier";
|
||||
import { NumberHolder } from "#app/utils/common";
|
||||
import GameManager from "#test/testUtils/gameManager";
|
||||
import Phase from "phaser";
|
||||
|
@ -1,6 +1,7 @@
|
||||
import { BattlerIndex } from "#app/battle";
|
||||
import type Pokemon from "#app/field/pokemon";
|
||||
import type { ContactHeldItemTransferChanceModifier } from "#app/modifier/modifier";
|
||||
import type { ContactHeldItemTransferChanceModifier } from "#app/modifier/held-item-modifier";
|
||||
import type {} from "#app/modifier/modifier";
|
||||
import { Abilities } from "#enums/abilities";
|
||||
import { BerryType } from "#enums/berry-type";
|
||||
import { Moves } from "#enums/moves";
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { Stat } from "#enums/stat";
|
||||
import { SpeciesStatBoosterModifier } from "#app/modifier/modifier";
|
||||
import { SpeciesStatBoosterModifier } from "#app/modifier/held-item-modifier";
|
||||
import { modifierTypes } from "#app/modifier/modifier-type";
|
||||
import i18next from "#app/plugins/i18n";
|
||||
import { NumberHolder } from "#app/utils/common";
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { Stat } from "#enums/stat";
|
||||
import { SpeciesStatBoosterModifier } from "#app/modifier/modifier";
|
||||
import { SpeciesStatBoosterModifier } from "#app/modifier/held-item-modifier";
|
||||
import { modifierTypes } from "#app/modifier/modifier-type";
|
||||
import i18next from "#app/plugins/i18n";
|
||||
import { NumberHolder } from "#app/utils/common";
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { Stat } from "#enums/stat";
|
||||
import { SpeciesStatBoosterModifier } from "#app/modifier/modifier";
|
||||
import { SpeciesStatBoosterModifier } from "#app/modifier/held-item-modifier";
|
||||
import { modifierTypes } from "#app/modifier/modifier-type";
|
||||
import i18next from "#app/plugins/i18n";
|
||||
import { NumberHolder } from "#app/utils/common";
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { BattlerIndex } from "#app/battle";
|
||||
import { allMoves } from "#app/data/data-lists";
|
||||
import { BattlerTagType } from "#app/enums/battler-tag-type";
|
||||
import type { PokemonInstantReviveModifier } from "#app/modifier/modifier";
|
||||
import type { PokemonInstantReviveModifier } from "#app/modifier/held-item-modifier";
|
||||
import { Abilities } from "#enums/abilities";
|
||||
import { Moves } from "#enums/moves";
|
||||
import { Species } from "#enums/species";
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { Stat } from "#enums/stat";
|
||||
import { SpeciesStatBoosterModifier } from "#app/modifier/modifier";
|
||||
import { SpeciesStatBoosterModifier } from "#app/modifier/held-item-modifier";
|
||||
import { modifierTypes } from "#app/modifier/modifier-type";
|
||||
import i18next from "#app/plugins/i18n";
|
||||
import { NumberHolder, randInt } from "#app/utils/common";
|
||||
|
@ -10,7 +10,7 @@ import Phaser from "phaser";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import { BattlerIndex } from "#app/battle";
|
||||
import { StatusEffect } from "#enums/status-effect";
|
||||
import { PokemonInstantReviveModifier } from "#app/modifier/modifier";
|
||||
import { PokemonInstantReviveModifier } from "#app/modifier/held-item-modifier";
|
||||
|
||||
describe("Moves - Destiny Bond", () => {
|
||||
let phaserGame: Phaser.Game;
|
||||
|
@ -12,7 +12,7 @@ import type BattleScene from "#app/battle-scene";
|
||||
import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode";
|
||||
import { MysteryEncounterTier } from "#enums/mystery-encounter-tier";
|
||||
import * as MysteryEncounters from "#app/data/mystery-encounters/mystery-encounters";
|
||||
import { BerryModifier, PokemonHeldItemModifier } from "#app/modifier/modifier";
|
||||
import { BerryModifier, PokemonHeldItemModifier } from "#app/modifier/held-item-modifier";
|
||||
import { BerryType } from "#enums/berry-type";
|
||||
import { AbsoluteAvariceEncounter } from "#app/data/mystery-encounters/encounters/absolute-avarice-encounter";
|
||||
import { Moves } from "#enums/moves";
|
||||
|
@ -11,7 +11,7 @@ import {
|
||||
import type BattleScene from "#app/battle-scene";
|
||||
import { UiMode } from "#enums/ui-mode";
|
||||
import ModifierSelectUiHandler from "#app/ui/modifier-select-ui-handler";
|
||||
import { BerryModifier } from "#app/modifier/modifier";
|
||||
import { BerryModifier } from "#app/modifier/held-item-modifier";
|
||||
import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode";
|
||||
import { MysteryEncounterTier } from "#enums/mystery-encounter-tier";
|
||||
import { initSceneWithoutEncounterPhase } from "#test/testUtils/gameManagerUtils";
|
||||
|
@ -18,12 +18,13 @@ import { MysteryEncounterTier } from "#enums/mystery-encounter-tier";
|
||||
import { initSceneWithoutEncounterPhase } from "#test/testUtils/gameManagerUtils";
|
||||
import { TrainerType } from "#enums/trainer-type";
|
||||
import { MysteryEncounterPhase, MysteryEncounterRewardsPhase } from "#app/phases/mystery-encounter-phases";
|
||||
import { ContactHeldItemTransferChanceModifier } from "#app/modifier/modifier";
|
||||
import {} from "#app/modifier/modifier";
|
||||
import { CommandPhase } from "#app/phases/command-phase";
|
||||
import { BugTypeSuperfanEncounter } from "#app/data/mystery-encounters/encounters/bug-type-superfan-encounter";
|
||||
import * as encounterPhaseUtils from "#app/data/mystery-encounters/utils/encounter-phase-utils";
|
||||
import { SelectModifierPhase } from "#app/phases/select-modifier-phase";
|
||||
import ModifierSelectUiHandler from "#app/ui/modifier-select-ui-handler";
|
||||
import { ContactHeldItemTransferChanceModifier } from "#app/modifier/held-item-modifier";
|
||||
|
||||
const namespace = "mysteryEncounters/bugTypeSuperfan";
|
||||
const defaultParty = [Species.LAPRAS, Species.GENGAR, Species.WEEDLE];
|
||||
@ -116,20 +117,14 @@ const POOL_3_POKEMON: { species: Species; formIndex?: number }[] = [
|
||||
|
||||
const POOL_4_POKEMON = [Species.GENESECT, Species.SLITHER_WING, Species.BUZZWOLE, Species.PHEROMOSA];
|
||||
|
||||
const PHYSICAL_TUTOR_MOVES = [
|
||||
Moves.MEGAHORN,
|
||||
Moves.ATTACK_ORDER,
|
||||
Moves.BUG_BITE,
|
||||
Moves.FIRST_IMPRESSION,
|
||||
Moves.LUNGE
|
||||
];
|
||||
const PHYSICAL_TUTOR_MOVES = [Moves.MEGAHORN, Moves.ATTACK_ORDER, Moves.BUG_BITE, Moves.FIRST_IMPRESSION, Moves.LUNGE];
|
||||
|
||||
const SPECIAL_TUTOR_MOVES = [
|
||||
Moves.SILVER_WIND,
|
||||
Moves.SIGNAL_BEAM,
|
||||
Moves.BUG_BUZZ,
|
||||
Moves.POLLEN_PUFF,
|
||||
Moves.STRUGGLE_BUG
|
||||
Moves.STRUGGLE_BUG,
|
||||
];
|
||||
|
||||
const STATUS_TUTOR_MOVES = [
|
||||
@ -137,16 +132,10 @@ const STATUS_TUTOR_MOVES = [
|
||||
Moves.DEFEND_ORDER,
|
||||
Moves.RAGE_POWDER,
|
||||
Moves.STICKY_WEB,
|
||||
Moves.SILK_TRAP
|
||||
Moves.SILK_TRAP,
|
||||
];
|
||||
|
||||
const MISC_TUTOR_MOVES = [
|
||||
Moves.LEECH_LIFE,
|
||||
Moves.U_TURN,
|
||||
Moves.HEAL_ORDER,
|
||||
Moves.QUIVER_DANCE,
|
||||
Moves.INFESTATION,
|
||||
];
|
||||
const MISC_TUTOR_MOVES = [Moves.LEECH_LIFE, Moves.U_TURN, Moves.HEAL_ORDER, Moves.QUIVER_DANCE, Moves.INFESTATION];
|
||||
|
||||
describe("Bug-Type Superfan - Mystery Encounter", () => {
|
||||
let phaserGame: Phaser.Game;
|
||||
|
@ -31,7 +31,7 @@ import type OptionSelectUiHandler from "#app/ui/settings/option-select-ui-handle
|
||||
import type { PokemonHeldItemModifierType } from "#app/modifier/modifier-type";
|
||||
import { modifierTypes } from "#app/modifier/modifier-type";
|
||||
import { BerryType } from "#enums/berry-type";
|
||||
import type { PokemonHeldItemModifier } from "#app/modifier/modifier";
|
||||
import type { PokemonHeldItemModifier } from "#app/modifier/held-item-modifier";
|
||||
import { PokemonType } from "#enums/pokemon-type";
|
||||
import { CommandPhase } from "#app/phases/command-phase";
|
||||
import { MovePhase } from "#app/phases/move-phase";
|
||||
|
@ -16,18 +16,20 @@ import * as MysteryEncounters from "#app/data/mystery-encounters/mystery-encount
|
||||
import type { MoneyRequirement } from "#app/data/mystery-encounters/mystery-encounter-requirements";
|
||||
import {
|
||||
BerryModifier,
|
||||
HealingBoosterModifier,
|
||||
HitHealModifier,
|
||||
LevelIncrementBoosterModifier,
|
||||
MoneyMultiplierModifier,
|
||||
PokemonInstantReviveModifier,
|
||||
PokemonNatureWeightModifier,
|
||||
PreserveBerryModifier,
|
||||
} from "#app/modifier/modifier";
|
||||
} from "#app/modifier/held-item-modifier";
|
||||
import { MysteryEncounterPhase } from "#app/phases/mystery-encounter-phases";
|
||||
import { generateModifierType } from "#app/data/mystery-encounters/utils/encounter-phase-utils";
|
||||
import { modifierTypes } from "#app/modifier/modifier-type";
|
||||
import { BerryType } from "#enums/berry-type";
|
||||
import {
|
||||
HealingBoosterModifier,
|
||||
LevelIncrementBoosterModifier,
|
||||
MoneyMultiplierModifier,
|
||||
PreserveBerryModifier,
|
||||
} from "#app/modifier/modifier";
|
||||
|
||||
const namespace = "mysteryEncounters/delibirdy";
|
||||
const defaultParty = [Species.LAPRAS, Species.GENGAR, Species.ABRA];
|
||||
|
@ -16,7 +16,7 @@ import {
|
||||
} from "#test/mystery-encounter/encounter-test-utils";
|
||||
import { Moves } from "#enums/moves";
|
||||
import type BattleScene from "#app/battle-scene";
|
||||
import { AttackTypeBoosterModifier, PokemonHeldItemModifier } from "#app/modifier/modifier";
|
||||
import { AttackTypeBoosterModifier, PokemonHeldItemModifier } from "#app/modifier/held-item-modifier";
|
||||
import { PokemonType } from "#enums/pokemon-type";
|
||||
import { Status } from "#app/data/status-effect";
|
||||
import { MysteryEncounterPhase } from "#app/phases/mystery-encounter-phases";
|
||||
|
@ -9,7 +9,6 @@ import type BattleScene from "#app/battle-scene";
|
||||
import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode";
|
||||
import { MysteryEncounterTier } from "#enums/mystery-encounter-tier";
|
||||
import * as MysteryEncounters from "#app/data/mystery-encounters/mystery-encounters";
|
||||
import { PokemonNatureWeightModifier } from "#app/modifier/modifier";
|
||||
import { generateModifierType } from "#app/data/mystery-encounters/utils/encounter-phase-utils";
|
||||
import { modifierTypes } from "#app/modifier/modifier-type";
|
||||
import { GlobalTradeSystemEncounter } from "#app/data/mystery-encounters/encounters/global-trade-system-encounter";
|
||||
@ -19,6 +18,7 @@ import { UiMode } from "#enums/ui-mode";
|
||||
import ModifierSelectUiHandler from "#app/ui/modifier-select-ui-handler";
|
||||
import { ModifierTier } from "#app/modifier/modifier-tier";
|
||||
import * as Utils from "#app/utils/common";
|
||||
import { PokemonNatureWeightModifier } from "#app/modifier/held-item-modifier";
|
||||
|
||||
const namespace = "mysteryEncounters/globalTradeSystem";
|
||||
const defaultParty = [Species.LAPRAS, Species.GENGAR, Species.ABRA];
|
||||
|
@ -20,7 +20,7 @@ import { BattlerTagType } from "#enums/battler-tag-type";
|
||||
import { PokemonMove } from "#app/field/pokemon";
|
||||
import { UiMode } from "#enums/ui-mode";
|
||||
import ModifierSelectUiHandler from "#app/ui/modifier-select-ui-handler";
|
||||
import { BerryModifier, PokemonBaseStatTotalModifier } from "#app/modifier/modifier";
|
||||
import { BerryModifier, PokemonBaseStatTotalModifier } from "#app/modifier/held-item-modifier";
|
||||
import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode";
|
||||
import { MysteryEncounterTier } from "#enums/mystery-encounter-tier";
|
||||
import { initSceneWithoutEncounterPhase } from "#test/testUtils/gameManagerUtils";
|
||||
|
@ -13,7 +13,7 @@ import { Biome } from "#app/enums/biome";
|
||||
import { MysteryEncounterType } from "#app/enums/mystery-encounter-type";
|
||||
import { Species } from "#app/enums/species";
|
||||
import { PokemonMove } from "#app/field/pokemon";
|
||||
import { HealShopCostModifier, HitHealModifier, TurnHealModifier } from "#app/modifier/modifier";
|
||||
import { HitHealModifier, TurnHealModifier } from "#app/modifier/held-item-modifier";
|
||||
import { ModifierTier } from "#app/modifier/modifier-tier";
|
||||
import { modifierTypes, type PokemonHeldItemModifierType } from "#app/modifier/modifier-type";
|
||||
import { CommandPhase } from "#app/phases/command-phase";
|
||||
@ -32,6 +32,7 @@ import {
|
||||
import GameManager from "#test/testUtils/gameManager";
|
||||
import { initSceneWithoutEncounterPhase } from "#test/testUtils/gameManagerUtils";
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import { HealShopCostModifier } from "#app/modifier/modifier";
|
||||
|
||||
const namespace = "mysteryEncounters/trashToTreasure";
|
||||
const defaultParty = [Species.LAPRAS, Species.GENGAR, Species.ABRA];
|
||||
|
@ -25,7 +25,7 @@ import { getPokemonSpecies } from "#app/data/pokemon-species";
|
||||
import { BerryType } from "#enums/berry-type";
|
||||
import { StatStageChangePhase } from "#app/phases/stat-stage-change-phase";
|
||||
import { Stat } from "#enums/stat";
|
||||
import type { BerryModifier } from "#app/modifier/modifier";
|
||||
import type { BerryModifier } from "#app/modifier/held-item-modifier";
|
||||
import { modifierTypes } from "#app/modifier/modifier-type";
|
||||
import { Abilities } from "#enums/abilities";
|
||||
|
||||
|
@ -2,7 +2,7 @@ import type BattleScene from "#app/battle-scene";
|
||||
import { getPokemonSpecies } from "#app/data/pokemon-species";
|
||||
import { PlayerPokemon } from "#app/field/pokemon";
|
||||
import { ModifierTier } from "#app/modifier/modifier-tier";
|
||||
import type { CustomModifierSettings } from "#app/modifier/modifier-type";
|
||||
import type { CustomModifierSettings } from "#app/modifier/modifier-pool";
|
||||
import { ModifierTypeOption, modifierTypes } from "#app/modifier/modifier-type";
|
||||
import { SelectModifierPhase } from "#app/phases/select-modifier-phase";
|
||||
import ModifierSelectUiHandler from "#app/ui/modifier-select-ui-handler";
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { expect } from "vitest";
|
||||
import { GameManagerHelper } from "./gameManagerHelper";
|
||||
import type { ModifierTypeKeys } from "#app/modifier/modifier-type";
|
||||
import { itemPoolChecks } from "#app/modifier/modifier-type";
|
||||
import { itemPoolChecks } from "#app/modifier/modifier-pool";
|
||||
|
||||
export class ModifierHelper extends GameManagerHelper {
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user