mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-07 17:02:16 +02:00
fix imports
This commit is contained in:
parent
88d05bcec2
commit
18907b5226
357
src/phases.ts
357
src/phases.ts
@ -1,231 +1,63 @@
|
|||||||
import BattleScene, {bypassLogin, startingWave} from "./battle-scene";
|
import BattleScene, { bypassLogin, startingWave } from "./battle-scene";
|
||||||
import {
|
import { default as Pokemon, PlayerPokemon, EnemyPokemon, PokemonMove, MoveResult, DamageResult, FieldPosition, HitResult, TurnMove } from "./field/pokemon";
|
||||||
DamageResult,
|
|
||||||
default as Pokemon,
|
|
||||||
EnemyPokemon,
|
|
||||||
FieldPosition,
|
|
||||||
HitResult,
|
|
||||||
MoveResult,
|
|
||||||
PlayerPokemon,
|
|
||||||
PokemonMove,
|
|
||||||
TurnMove
|
|
||||||
} from "./field/pokemon";
|
|
||||||
import * as Utils from './utils';
|
import * as Utils from './utils';
|
||||||
import {Moves} from "./data/enums/moves";
|
import { Moves } from "./data/enums/moves";
|
||||||
import {
|
import { allMoves, applyMoveAttrs, BypassSleepAttr, ChargeAttr, applyFilteredMoveAttrs, HitsTagAttr, MissEffectAttr, MoveAttr, MoveEffectAttr, MoveFlags, MultiHitAttr, OverrideMoveEffectAttr, VariableAccuracyAttr, MoveTarget, OneHitKOAttr, getMoveTargets, MoveTargetSet, MoveEffectTrigger, CopyMoveAttr, AttackMove, SelfStatusMove, DelayedAttackAttr, RechargeAttr, PreMoveMessageAttr, HealStatusEffectAttr, IgnoreOpponentStatChangesAttr, NoEffectAttr, FixedDamageAttr, OneHitKOAccuracyAttr, ForceSwitchOutAttr } from "./data/move";
|
||||||
allMoves,
|
import { Mode } from './ui/ui';
|
||||||
applyFilteredMoveAttrs,
|
import { Command } from "./ui/command-ui-handler";
|
||||||
applyMoveAttrs,
|
import { Stat } from "./data/pokemon-stat";
|
||||||
AttackMove,
|
import { BerryModifier, ContactHeldItemTransferChanceModifier, EnemyAttackStatusEffectChanceModifier, EnemyPersistentModifier, EnemyStatusEffectHealChanceModifier, EnemyTurnHealModifier, ExpBalanceModifier, ExpBoosterModifier, ExpShareModifier, ExtraModifierModifier, FlinchChanceModifier, FusePokemonModifier, HealingBoosterModifier, HitHealModifier, LapsingPersistentModifier, MapModifier, Modifier, MultipleParticipantExpBonusModifier, PersistentModifier, PokemonExpBoosterModifier, PokemonHeldItemModifier, PokemonInstantReviveModifier, SwitchEffectTransferModifier, TempBattleStatBoosterModifier, TurnHealModifier, TurnHeldItemTransferModifier, MoneyMultiplierModifier, MoneyInterestModifier, IvScannerModifier, PokemonFriendshipBoosterModifier, LapsingPokemonHeldItemModifier, PokemonMultiHitModifier, PokemonMoveAccuracyBoosterModifier } from "./modifier/modifier";
|
||||||
BypassSleepAttr,
|
import PartyUiHandler, { PartyOption, PartyUiMode } from "./ui/party-ui-handler";
|
||||||
ChargeAttr,
|
import { doPokeballBounceAnim, getPokeballAtlasKey, getPokeballCatchMultiplier, getPokeballTintColor, PokeballType } from "./data/pokeball";
|
||||||
CopyMoveAttr,
|
import { CommonAnim, CommonBattleAnim, MoveAnim, initMoveAnim, loadMoveAnimAssets } from "./data/battle-anims";
|
||||||
FixedDamageAttr,
|
import { StatusEffect, getStatusEffectActivationText, getStatusEffectCatchRateMultiplier, getStatusEffectHealText, getStatusEffectObtainText, getStatusEffectOverlapText } from "./data/status-effect";
|
||||||
ForceSwitchOutAttr,
|
import { SummaryUiMode } from "./ui/summary-ui-handler";
|
||||||
getMoveTargets,
|
|
||||||
HealStatusEffectAttr,
|
|
||||||
HitsTagAttr,
|
|
||||||
IgnoreOpponentStatChangesAttr,
|
|
||||||
MissEffectAttr,
|
|
||||||
MoveAttr,
|
|
||||||
MoveEffectAttr,
|
|
||||||
MoveEffectTrigger,
|
|
||||||
MoveFlags,
|
|
||||||
MoveTarget,
|
|
||||||
MoveTargetSet,
|
|
||||||
MultiHitAttr,
|
|
||||||
NoEffectAttr,
|
|
||||||
OneHitKOAccuracyAttr,
|
|
||||||
OverrideMoveEffectAttr,
|
|
||||||
PreMoveMessageAttr,
|
|
||||||
SelfStatusMove,
|
|
||||||
VariableAccuracyAttr
|
|
||||||
} from "./data/move";
|
|
||||||
import {Mode} from './ui/ui';
|
|
||||||
import {Command} from "./ui/command-ui-handler";
|
|
||||||
import {Stat} from "./data/pokemon-stat";
|
|
||||||
import {
|
|
||||||
BerryModifier,
|
|
||||||
ContactHeldItemTransferChanceModifier,
|
|
||||||
EnemyAttackStatusEffectChanceModifier,
|
|
||||||
EnemyPersistentModifier,
|
|
||||||
EnemyStatusEffectHealChanceModifier,
|
|
||||||
EnemyTurnHealModifier,
|
|
||||||
ExpBalanceModifier,
|
|
||||||
ExpBoosterModifier,
|
|
||||||
ExpShareModifier,
|
|
||||||
ExtraModifierModifier,
|
|
||||||
FlinchChanceModifier,
|
|
||||||
HealingBoosterModifier,
|
|
||||||
HitHealModifier,
|
|
||||||
IvScannerModifier,
|
|
||||||
LapsingPersistentModifier,
|
|
||||||
LapsingPokemonHeldItemModifier,
|
|
||||||
MapModifier,
|
|
||||||
Modifier,
|
|
||||||
MoneyInterestModifier,
|
|
||||||
MoneyMultiplierModifier,
|
|
||||||
MultipleParticipantExpBonusModifier,
|
|
||||||
PersistentModifier,
|
|
||||||
PokemonExpBoosterModifier,
|
|
||||||
PokemonFriendshipBoosterModifier,
|
|
||||||
PokemonHeldItemModifier,
|
|
||||||
PokemonInstantReviveModifier,
|
|
||||||
PokemonMoveAccuracyBoosterModifier,
|
|
||||||
PokemonMultiHitModifier,
|
|
||||||
SwitchEffectTransferModifier,
|
|
||||||
TempBattleStatBoosterModifier,
|
|
||||||
TurnHealModifier,
|
|
||||||
TurnHeldItemTransferModifier
|
|
||||||
} from "./modifier/modifier";
|
|
||||||
import PartyUiHandler, {PartyOption, PartyUiMode} from "./ui/party-ui-handler";
|
|
||||||
import {
|
|
||||||
doPokeballBounceAnim,
|
|
||||||
getPokeballAtlasKey,
|
|
||||||
getPokeballCatchMultiplier,
|
|
||||||
getPokeballTintColor,
|
|
||||||
PokeballType
|
|
||||||
} from "./data/pokeball";
|
|
||||||
import {CommonAnim, CommonBattleAnim, initMoveAnim, loadMoveAnimAssets, MoveAnim} from "./data/battle-anims";
|
|
||||||
import {
|
|
||||||
getStatusEffectActivationText,
|
|
||||||
getStatusEffectCatchRateMultiplier,
|
|
||||||
getStatusEffectHealText,
|
|
||||||
getStatusEffectObtainText,
|
|
||||||
getStatusEffectOverlapText,
|
|
||||||
StatusEffect
|
|
||||||
} from "./data/status-effect";
|
|
||||||
import {SummaryUiMode} from "./ui/summary-ui-handler";
|
|
||||||
import EvolutionSceneHandler from "./ui/evolution-scene-handler";
|
import EvolutionSceneHandler from "./ui/evolution-scene-handler";
|
||||||
import {EvolutionPhase} from "./evolution-phase";
|
import { EvolutionPhase } from "./evolution-phase";
|
||||||
import {Phase} from "./phase";
|
import { Phase } from "./phase";
|
||||||
import {BattleStat, getBattleStatLevelChangeDescription, getBattleStatName} from "./data/battle-stat";
|
import { BattleStat, getBattleStatLevelChangeDescription, getBattleStatName } from "./data/battle-stat";
|
||||||
import {biomeLinks, getBiomeName} from "./data/biomes";
|
import { biomeLinks, getBiomeName } from "./data/biomes";
|
||||||
import {Biome} from "./data/enums/biome";
|
import { Biome } from "./data/enums/biome";
|
||||||
import {ModifierTier} from "./modifier/modifier-tier";
|
import { ModifierTier } from "./modifier/modifier-tier";
|
||||||
import {
|
import { FusePokemonModifierType, ModifierPoolType, ModifierType, ModifierTypeFunc, ModifierTypeOption, PokemonModifierType, PokemonMoveModifierType, RememberMoveModifierType, TmModifierType, getDailyRunStarterModifiers, getEnemyBuffModifierForWave, getModifierType, getPlayerModifierTypeOptions, getPlayerShopModifierTypeOptionsForWave, modifierTypes, regenerateModifierPoolThresholds } from "./modifier/modifier-type";
|
||||||
FusePokemonModifierType,
|
|
||||||
getDailyRunStarterModifiers,
|
|
||||||
getEnemyBuffModifierForWave,
|
|
||||||
getModifierType,
|
|
||||||
getPlayerModifierTypeOptions,
|
|
||||||
getPlayerShopModifierTypeOptionsForWave,
|
|
||||||
ModifierPoolType,
|
|
||||||
ModifierType,
|
|
||||||
ModifierTypeFunc,
|
|
||||||
ModifierTypeOption,
|
|
||||||
modifierTypes,
|
|
||||||
PokemonModifierType,
|
|
||||||
PokemonMoveModifierType,
|
|
||||||
regenerateModifierPoolThresholds,
|
|
||||||
RememberMoveModifierType,
|
|
||||||
TmModifierType
|
|
||||||
} from "./modifier/modifier-type";
|
|
||||||
import SoundFade from "phaser3-rex-plugins/plugins/soundfade";
|
import SoundFade from "phaser3-rex-plugins/plugins/soundfade";
|
||||||
import {
|
import { BattlerTagLapseType, BounceTag, EncoreTag, HideSpriteTag as HiddenTag, ProtectedTag, TrappedTag } from "./data/battler-tags";
|
||||||
BattlerTag,
|
import { BattlerTagType } from "./data/enums/battler-tag-type";
|
||||||
BattlerTagLapseType,
|
import { getPokemonMessage } from "./messages";
|
||||||
BounceTag,
|
import { Starter } from "./ui/starter-select-ui-handler";
|
||||||
EncoreTag,
|
import { Gender } from "./data/gender";
|
||||||
HideSpriteTag as HiddenTag,
|
import { Weather, WeatherType, getRandomWeatherType, getTerrainBlockMessage, getWeatherDamageMessage, getWeatherLapseMessage } from "./data/weather";
|
||||||
ProtectedTag,
|
import { TempBattleStat } from "./data/temp-battle-stat";
|
||||||
TrappedTag
|
import { ArenaTagSide, ArenaTrapTag, MistTag, TrickRoomTag } from "./data/arena-tag";
|
||||||
} from "./data/battler-tags";
|
import { ArenaTagType } from "./data/enums/arena-tag-type";
|
||||||
import {BattlerTagType} from "./data/enums/battler-tag-type";
|
import { CheckTrappedAbAttr, IgnoreOpponentStatChangesAbAttr, PostAttackAbAttr, PostBattleAbAttr, PostDefendAbAttr, PostSummonAbAttr, PostTurnAbAttr, PostWeatherLapseAbAttr, PreSwitchOutAbAttr, PreWeatherDamageAbAttr, ProtectStatAbAttr, RedirectMoveAbAttr, RunSuccessAbAttr, StatChangeMultiplierAbAttr, SuppressWeatherEffectAbAttr, SyncEncounterNatureAbAttr, applyAbAttrs, applyCheckTrappedAbAttrs, applyPostAttackAbAttrs, applyPostBattleAbAttrs, applyPostDefendAbAttrs, applyPostSummonAbAttrs, applyPostTurnAbAttrs, applyPostWeatherLapseAbAttrs, applyPreStatChangeAbAttrs, applyPreSwitchOutAbAttrs, applyPreWeatherEffectAbAttrs, BattleStatMultiplierAbAttr, applyBattleStatMultiplierAbAttrs, IncrementMovePriorityAbAttr, applyPostVictoryAbAttrs, PostVictoryAbAttr, applyPostBattleInitAbAttrs, PostBattleInitAbAttr, BlockNonDirectDamageAbAttr as BlockNonDirectDamageAbAttr, applyPostKnockOutAbAttrs, PostKnockOutAbAttr, PostBiomeChangeAbAttr, applyPostFaintAbAttrs, PostFaintAbAttr, IncreasePpAbAttr, PostStatChangeAbAttr, applyPostStatChangeAbAttrs, AlwaysHitAbAttr, PreventBerryUseAbAttr } from "./data/ability";
|
||||||
import {getPokemonMessage} from "./messages";
|
import { Unlockables, getUnlockableName } from "./system/unlockables";
|
||||||
import {Starter} from "./ui/starter-select-ui-handler";
|
import { getBiomeKey } from "./field/arena";
|
||||||
import {Gender} from "./data/gender";
|
import { BattleType, BattlerIndex, TurnCommand } from "./battle";
|
||||||
import {
|
import { BattleSpec } from "./enums/battle-spec";
|
||||||
getRandomWeatherType,
|
import { Species } from "./data/enums/species";
|
||||||
getTerrainBlockMessage,
|
import { HealAchv, LevelAchv, achvs } from "./system/achv";
|
||||||
getWeatherDamageMessage,
|
import { TrainerSlot, trainerConfigs } from "./data/trainer-config";
|
||||||
getWeatherLapseMessage,
|
import { TrainerType } from "./data/enums/trainer-type";
|
||||||
Weather,
|
import { EggHatchPhase } from "./egg-hatch-phase";
|
||||||
WeatherType
|
import { Egg } from "./data/egg";
|
||||||
} from "./data/weather";
|
import { vouchers } from "./system/voucher";
|
||||||
import {TempBattleStat} from "./data/temp-battle-stat";
|
import { loggedInUser, updateUserInfo } from "./account";
|
||||||
import {ArenaTagSide, ArenaTrapTag, MistTag, TrickRoomTag} from "./data/arena-tag";
|
import { PlayerGender, SessionSaveData } from "./system/game-data";
|
||||||
import {ArenaTagType} from "./data/enums/arena-tag-type";
|
import { addPokeballCaptureStars, addPokeballOpenParticles } from "./field/anims";
|
||||||
import {
|
import { SpeciesFormChangeActiveTrigger, SpeciesFormChangeManualTrigger, SpeciesFormChangeMoveLearnedTrigger, SpeciesFormChangePostMoveTrigger, SpeciesFormChangePreMoveTrigger } from "./data/pokemon-forms";
|
||||||
AlwaysHitAbAttr,
|
import { battleSpecDialogue, getCharVariantFromDialogue } from "./data/dialogue";
|
||||||
applyAbAttrs,
|
import ModifierSelectUiHandler, { SHOP_OPTIONS_ROW_LIMIT } from "./ui/modifier-select-ui-handler";
|
||||||
applyBattleStatMultiplierAbAttrs,
|
import { Setting } from "./system/settings";
|
||||||
applyCheckTrappedAbAttrs,
|
import { Tutorial, handleTutorial } from "./tutorial";
|
||||||
applyPostAttackAbAttrs,
|
import { TerrainType } from "./data/terrain";
|
||||||
applyPostBattleAbAttrs,
|
import { OptionSelectConfig, OptionSelectItem } from "./ui/abstact-option-select-ui-handler";
|
||||||
applyPostBattleInitAbAttrs,
|
import { SaveSlotUiMode } from "./ui/save-slot-select-ui-handler";
|
||||||
applyPostDefendAbAttrs,
|
import { fetchDailyRunSeed, getDailyRunStarters } from "./data/daily-run";
|
||||||
applyPostFaintAbAttrs,
|
import { GameModes, gameModes } from "./game-mode";
|
||||||
applyPostKnockOutAbAttrs,
|
import { getPokemonSpecies, speciesStarters } from "./data/pokemon-species";
|
||||||
applyPostStatChangeAbAttrs,
|
|
||||||
applyPostSummonAbAttrs,
|
|
||||||
applyPostTurnAbAttrs,
|
|
||||||
applyPostVictoryAbAttrs,
|
|
||||||
applyPostWeatherLapseAbAttrs,
|
|
||||||
applyPreStatChangeAbAttrs,
|
|
||||||
applyPreSwitchOutAbAttrs,
|
|
||||||
applyPreWeatherEffectAbAttrs,
|
|
||||||
BattleStatMultiplierAbAttr,
|
|
||||||
BlockNonDirectDamageAbAttr as BlockNonDirectDamageAbAttr, MagicBounceAbAttr,
|
|
||||||
CheckTrappedAbAttr,
|
|
||||||
IgnoreOpponentStatChangesAbAttr,
|
|
||||||
IncreasePpAbAttr,
|
|
||||||
IncrementMovePriorityAbAttr,
|
|
||||||
PostAttackAbAttr,
|
|
||||||
PostBattleAbAttr,
|
|
||||||
PostBattleInitAbAttr,
|
|
||||||
PostBiomeChangeAbAttr,
|
|
||||||
PostDefendAbAttr,
|
|
||||||
PostFaintAbAttr,
|
|
||||||
PostKnockOutAbAttr,
|
|
||||||
PostStatChangeAbAttr,
|
|
||||||
PostSummonAbAttr,
|
|
||||||
PostTurnAbAttr,
|
|
||||||
PostVictoryAbAttr,
|
|
||||||
PostWeatherLapseAbAttr,
|
|
||||||
PreSwitchOutAbAttr,
|
|
||||||
PreventBerryUseAbAttr,
|
|
||||||
PreWeatherDamageAbAttr,
|
|
||||||
ProtectStatAbAttr,
|
|
||||||
RedirectMoveAbAttr,
|
|
||||||
RunSuccessAbAttr,
|
|
||||||
StatChangeMultiplierAbAttr,
|
|
||||||
SuppressWeatherEffectAbAttr,
|
|
||||||
SyncEncounterNatureAbAttr
|
|
||||||
} from "./data/ability";
|
|
||||||
import {getUnlockableName, Unlockables} from "./system/unlockables";
|
|
||||||
import {getBiomeKey} from "./field/arena";
|
|
||||||
import {BattlerIndex, BattleType, TurnCommand} from "./battle";
|
|
||||||
import {BattleSpec} from "./enums/battle-spec";
|
|
||||||
import {Species} from "./data/enums/species";
|
|
||||||
import {achvs, HealAchv, LevelAchv} from "./system/achv";
|
|
||||||
import {trainerConfigs, TrainerSlot} from "./data/trainer-config";
|
|
||||||
import {TrainerType} from "./data/enums/trainer-type";
|
|
||||||
import {EggHatchPhase} from "./egg-hatch-phase";
|
|
||||||
import {Egg} from "./data/egg";
|
|
||||||
import {vouchers} from "./system/voucher";
|
|
||||||
import {loggedInUser, updateUserInfo} from "./account";
|
|
||||||
import {PlayerGender, SessionSaveData} from "./system/game-data";
|
|
||||||
import {addPokeballCaptureStars, addPokeballOpenParticles} from "./field/anims";
|
|
||||||
import {
|
|
||||||
SpeciesFormChangeActiveTrigger,
|
|
||||||
SpeciesFormChangeManualTrigger,
|
|
||||||
SpeciesFormChangeMoveLearnedTrigger,
|
|
||||||
SpeciesFormChangePostMoveTrigger,
|
|
||||||
SpeciesFormChangePreMoveTrigger
|
|
||||||
} from "./data/pokemon-forms";
|
|
||||||
import {battleSpecDialogue, getCharVariantFromDialogue} from "./data/dialogue";
|
|
||||||
import ModifierSelectUiHandler, {SHOP_OPTIONS_ROW_LIMIT} from "./ui/modifier-select-ui-handler";
|
|
||||||
import {Setting} from "./system/settings";
|
|
||||||
import {handleTutorial, Tutorial} from "./tutorial";
|
|
||||||
import {TerrainType} from "./data/terrain";
|
|
||||||
import {OptionSelectConfig, OptionSelectItem} from "./ui/abstact-option-select-ui-handler";
|
|
||||||
import {SaveSlotUiMode} from "./ui/save-slot-select-ui-handler";
|
|
||||||
import {fetchDailyRunSeed, getDailyRunStarters} from "./data/daily-run";
|
|
||||||
import {GameModes, gameModes} from "./game-mode";
|
|
||||||
import {getPokemonSpecies, speciesStarters} from "./data/pokemon-species";
|
|
||||||
import i18next from './plugins/i18n';
|
import i18next from './plugins/i18n';
|
||||||
import {STARTER_FORM_OVERRIDE, STARTER_SPECIES_OVERRIDE} from './overrides';
|
import { STARTER_FORM_OVERRIDE, STARTER_SPECIES_OVERRIDE } from './overrides';
|
||||||
|
|
||||||
export class LoginPhase extends Phase {
|
export class LoginPhase extends Phase {
|
||||||
private showText: boolean;
|
private showText: boolean;
|
||||||
@ -249,13 +81,13 @@ export class LoginPhase extends Phase {
|
|||||||
if (!statusCode || statusCode === 400) {
|
if (!statusCode || statusCode === 400) {
|
||||||
if (this.showText)
|
if (this.showText)
|
||||||
this.scene.ui.showText(i18next.t('menu:logInOrCreateAccount'));
|
this.scene.ui.showText(i18next.t('menu:logInOrCreateAccount'));
|
||||||
|
|
||||||
this.scene.playSound('menu_open');
|
this.scene.playSound('menu_open');
|
||||||
|
|
||||||
const loadData = () => {
|
const loadData = () => {
|
||||||
updateUserInfo().then(() => this.scene.gameData.loadSystem().then(() => this.end()));
|
updateUserInfo().then(() => this.scene.gameData.loadSystem().then(() => this.end()));
|
||||||
};
|
};
|
||||||
|
|
||||||
this.scene.ui.setMode(Mode.LOGIN_FORM, {
|
this.scene.ui.setMode(Mode.LOGIN_FORM, {
|
||||||
buttonActions: [
|
buttonActions: [
|
||||||
() => {
|
() => {
|
||||||
@ -300,7 +132,7 @@ export class LoginPhase extends Phase {
|
|||||||
|
|
||||||
if (!this.scene.gameData.gender)
|
if (!this.scene.gameData.gender)
|
||||||
this.scene.unshiftPhase(new SelectGenderPhase(this.scene));
|
this.scene.unshiftPhase(new SelectGenderPhase(this.scene));
|
||||||
|
|
||||||
handleTutorial(this.scene, Tutorial.Intro).then(() => super.end());
|
handleTutorial(this.scene, Tutorial.Intro).then(() => super.end());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -480,7 +312,7 @@ export class TitlePhase extends Phase {
|
|||||||
party.push(starterPokemon);
|
party.push(starterPokemon);
|
||||||
loadPokemonAssets.push(starterPokemon.loadAssets());
|
loadPokemonAssets.push(starterPokemon.loadAssets());
|
||||||
}
|
}
|
||||||
|
|
||||||
regenerateModifierPoolThresholds(party, ModifierPoolType.DAILY_STARTER);
|
regenerateModifierPoolThresholds(party, ModifierPoolType.DAILY_STARTER);
|
||||||
const modifiers: Modifier[] = Array(3).fill(null).map(() => modifierTypes.EXP_SHARE().withIdFromFunc(modifierTypes.EXP_SHARE).newModifier())
|
const modifiers: Modifier[] = Array(3).fill(null).map(() => modifierTypes.EXP_SHARE().withIdFromFunc(modifierTypes.EXP_SHARE).newModifier())
|
||||||
.concat(Array(3).fill(null).map(() => modifierTypes.GOLDEN_EXP_CHARM().withIdFromFunc(modifierTypes.GOLDEN_EXP_CHARM).newModifier()))
|
.concat(Array(3).fill(null).map(() => modifierTypes.GOLDEN_EXP_CHARM().withIdFromFunc(modifierTypes.GOLDEN_EXP_CHARM).newModifier()))
|
||||||
@ -589,7 +421,7 @@ export class SelectGenderPhase extends Phase {
|
|||||||
constructor(scene: BattleScene) {
|
constructor(scene: BattleScene) {
|
||||||
super(scene);
|
super(scene);
|
||||||
}
|
}
|
||||||
|
|
||||||
start(): void {
|
start(): void {
|
||||||
super.start();
|
super.start();
|
||||||
|
|
||||||
@ -886,11 +718,11 @@ export class EncounterPhase extends BattlePhase {
|
|||||||
enemyPokemon.updateScale();
|
enemyPokemon.updateScale();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
totalBst += enemyPokemon.getSpeciesForm().baseTotal;
|
totalBst += enemyPokemon.getSpeciesForm().baseTotal;
|
||||||
|
|
||||||
loadEnemyAssets.push(enemyPokemon.loadAssets());
|
loadEnemyAssets.push(enemyPokemon.loadAssets());
|
||||||
|
|
||||||
console.log(enemyPokemon.name, enemyPokemon.species.speciesId, enemyPokemon.stats);
|
console.log(enemyPokemon.name, enemyPokemon.species.speciesId, enemyPokemon.stats);
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -1013,7 +845,7 @@ export class EncounterPhase extends BattlePhase {
|
|||||||
const trainer = this.scene.currentBattle.trainer;
|
const trainer = this.scene.currentBattle.trainer;
|
||||||
trainer.untint(100, 'Sine.easeOut');
|
trainer.untint(100, 'Sine.easeOut');
|
||||||
trainer.playAnim();
|
trainer.playAnim();
|
||||||
|
|
||||||
const doSummon = () => {
|
const doSummon = () => {
|
||||||
this.scene.currentBattle.started = true;
|
this.scene.currentBattle.started = true;
|
||||||
this.scene.playBgm(undefined);
|
this.scene.playBgm(undefined);
|
||||||
@ -1032,7 +864,7 @@ export class EncounterPhase extends BattlePhase {
|
|||||||
else
|
else
|
||||||
doTrainerSummon();
|
doTrainerSummon();
|
||||||
};
|
};
|
||||||
|
|
||||||
const encounterMessages = this.scene.currentBattle.trainer.getEncounterMessages();
|
const encounterMessages = this.scene.currentBattle.trainer.getEncounterMessages();
|
||||||
|
|
||||||
if (!encounterMessages?.length)
|
if (!encounterMessages?.length)
|
||||||
@ -1089,7 +921,7 @@ export class EncounterPhase extends BattlePhase {
|
|||||||
this.scene.pushPhase(new ReturnPhase(this.scene, 1));
|
this.scene.pushPhase(new ReturnPhase(this.scene, 1));
|
||||||
this.scene.pushPhase(new ToggleDoublePositionPhase(this.scene, false));
|
this.scene.pushPhase(new ToggleDoublePositionPhase(this.scene, false));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.scene.currentBattle.waveIndex > startingWave && this.scene.currentBattle.battleType !== BattleType.TRAINER) {
|
if (this.scene.currentBattle.waveIndex > startingWave && this.scene.currentBattle.battleType !== BattleType.TRAINER) {
|
||||||
this.scene.pushPhase(new CheckSwitchPhase(this.scene, 0, this.scene.currentBattle.double));
|
this.scene.pushPhase(new CheckSwitchPhase(this.scene, 0, this.scene.currentBattle.double));
|
||||||
if (this.scene.currentBattle.double && availablePartyMembers.length > 1)
|
if (this.scene.currentBattle.double && availablePartyMembers.length > 1)
|
||||||
@ -1145,7 +977,7 @@ export class NextEncounterPhase extends EncounterPhase {
|
|||||||
this.scene.arenaNextEnemy.setVisible(false);
|
this.scene.arenaNextEnemy.setVisible(false);
|
||||||
if (this.scene.lastEnemyTrainer)
|
if (this.scene.lastEnemyTrainer)
|
||||||
this.scene.lastEnemyTrainer.destroy();
|
this.scene.lastEnemyTrainer.destroy();
|
||||||
|
|
||||||
if (!this.tryOverrideForBattleSpec())
|
if (!this.tryOverrideForBattleSpec())
|
||||||
this.doEncounterCommon();
|
this.doEncounterCommon();
|
||||||
}
|
}
|
||||||
@ -2037,7 +1869,7 @@ export class EnemyCommandPhase extends FieldPhase {
|
|||||||
if (partyMemberScores.length) {
|
if (partyMemberScores.length) {
|
||||||
const matchupScores = opponents.map(opp => enemyPokemon.getMatchupScore(opp));
|
const matchupScores = opponents.map(opp => enemyPokemon.getMatchupScore(opp));
|
||||||
const matchupScore = matchupScores.reduce((total, score) => total += score, 0) / matchupScores.length;
|
const matchupScore = matchupScores.reduce((total, score) => total += score, 0) / matchupScores.length;
|
||||||
|
|
||||||
const sortedPartyMemberScores = trainer.getSortedPartyMemberMatchupScores(partyMemberScores);
|
const sortedPartyMemberScores = trainer.getSortedPartyMemberMatchupScores(partyMemberScores);
|
||||||
|
|
||||||
const switchMultiplier = 1 - (battle.enemySwitchCounter ? Math.pow(0.1, (1 / battle.enemySwitchCounter)) : 0);
|
const switchMultiplier = 1 - (battle.enemySwitchCounter ? Math.pow(0.1, (1 / battle.enemySwitchCounter)) : 0);
|
||||||
@ -2047,7 +1879,7 @@ export class EnemyCommandPhase extends FieldPhase {
|
|||||||
|
|
||||||
battle.turnCommands[this.fieldIndex + BattlerIndex.ENEMY] =
|
battle.turnCommands[this.fieldIndex + BattlerIndex.ENEMY] =
|
||||||
{ command: Command.POKEMON, cursor: index, args: [ false ] };
|
{ command: Command.POKEMON, cursor: index, args: [ false ] };
|
||||||
|
|
||||||
battle.enemySwitchCounter++;
|
battle.enemySwitchCounter++;
|
||||||
|
|
||||||
return this.end();
|
return this.end();
|
||||||
@ -2122,11 +1954,11 @@ export class TurnStartPhase extends FieldPhase {
|
|||||||
|
|
||||||
applyAbAttrs(IncrementMovePriorityAbAttr, this.scene.getField().find(p => p?.isActive() && p.getBattlerIndex() === a), null, aMove, aPriority);
|
applyAbAttrs(IncrementMovePriorityAbAttr, this.scene.getField().find(p => p?.isActive() && p.getBattlerIndex() === a), null, aMove, aPriority);
|
||||||
applyAbAttrs(IncrementMovePriorityAbAttr, this.scene.getField().find(p => p?.isActive() && p.getBattlerIndex() === b), null, bMove, bPriority);
|
applyAbAttrs(IncrementMovePriorityAbAttr, this.scene.getField().find(p => p?.isActive() && p.getBattlerIndex() === b), null, bMove, bPriority);
|
||||||
|
|
||||||
if (aPriority.value !== bPriority.value)
|
if (aPriority.value !== bPriority.value)
|
||||||
return aPriority.value < bPriority.value ? 1 : -1;
|
return aPriority.value < bPriority.value ? 1 : -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
const aIndex = order.indexOf(a);
|
const aIndex = order.indexOf(a);
|
||||||
const bIndex = order.indexOf(b);
|
const bIndex = order.indexOf(b);
|
||||||
|
|
||||||
@ -2194,10 +2026,10 @@ export class TurnEndPhase extends FieldPhase {
|
|||||||
super.start();
|
super.start();
|
||||||
|
|
||||||
this.scene.currentBattle.incrementTurn(this.scene);
|
this.scene.currentBattle.incrementTurn(this.scene);
|
||||||
|
|
||||||
const handlePokemon = (pokemon: Pokemon) => {
|
const handlePokemon = (pokemon: Pokemon) => {
|
||||||
pokemon.lapseTags(BattlerTagLapseType.TURN_END);
|
pokemon.lapseTags(BattlerTagLapseType.TURN_END);
|
||||||
|
|
||||||
if (pokemon.summonData.disabledMove && !--pokemon.summonData.disabledTurns) {
|
if (pokemon.summonData.disabledMove && !--pokemon.summonData.disabledTurns) {
|
||||||
this.scene.pushPhase(new MessagePhase(this.scene, i18next.t('menu:notDisabled', { moveName: allMoves[pokemon.summonData.disabledMove].name })));
|
this.scene.pushPhase(new MessagePhase(this.scene, i18next.t('menu:notDisabled', { moveName: allMoves[pokemon.summonData.disabledMove].name })));
|
||||||
pokemon.summonData.disabledMove = Moves.NONE;
|
pokemon.summonData.disabledMove = Moves.NONE;
|
||||||
@ -2227,7 +2059,7 @@ export class TurnEndPhase extends FieldPhase {
|
|||||||
};
|
};
|
||||||
|
|
||||||
this.executeForAll(handlePokemon);
|
this.executeForAll(handlePokemon);
|
||||||
|
|
||||||
this.scene.arena.lapseTags();
|
this.scene.arena.lapseTags();
|
||||||
|
|
||||||
if (this.scene.arena.weather && !this.scene.arena.weather.lapse())
|
if (this.scene.arena.weather && !this.scene.arena.weather.lapse())
|
||||||
@ -2385,9 +2217,9 @@ export class MovePhase extends BattlePhase {
|
|||||||
|
|
||||||
const doMove = () => {
|
const doMove = () => {
|
||||||
this.pokemon.turnData.acted = true; // Record that the move was attempted, even if it fails
|
this.pokemon.turnData.acted = true; // Record that the move was attempted, even if it fails
|
||||||
|
|
||||||
this.pokemon.lapseTags(BattlerTagLapseType.PRE_MOVE);
|
this.pokemon.lapseTags(BattlerTagLapseType.PRE_MOVE);
|
||||||
|
|
||||||
if (!this.followUp && this.canMove() && !this.cancelled) {
|
if (!this.followUp && this.canMove() && !this.cancelled) {
|
||||||
this.pokemon.lapseTags(BattlerTagLapseType.MOVE);
|
this.pokemon.lapseTags(BattlerTagLapseType.MOVE);
|
||||||
}
|
}
|
||||||
@ -2402,7 +2234,7 @@ export class MovePhase extends BattlePhase {
|
|||||||
|
|
||||||
if (this.move.moveId)
|
if (this.move.moveId)
|
||||||
this.showMoveText();
|
this.showMoveText();
|
||||||
|
|
||||||
if ((moveQueue.length && moveQueue[0].move === Moves.NONE) || !targets.length) {
|
if ((moveQueue.length && moveQueue[0].move === Moves.NONE) || !targets.length) {
|
||||||
moveQueue.shift();
|
moveQueue.shift();
|
||||||
this.cancel();
|
this.cancel();
|
||||||
@ -2430,11 +2262,16 @@ export class MovePhase extends BattlePhase {
|
|||||||
// Assume conditions affecting targets only apply to moves with a single target
|
// Assume conditions affecting targets only apply to moves with a single target
|
||||||
let success = this.move.getMove().applyConditions(this.pokemon, targets[0], this.move.getMove());
|
let success = this.move.getMove().applyConditions(this.pokemon, targets[0], this.move.getMove());
|
||||||
let failedText = null;
|
let failedText = null;
|
||||||
|
const isBounced = this.move.getMove().hasFlag(MoveFlags.MAGIC_COAT_MOVE) && targets[0].findTags(t => t instanceof BounceTag).find(t => targets[0].lapseTag(t.tagType));
|
||||||
if (success && this.scene.arena.isMoveWeatherCancelled(this.move.getMove()))
|
if (success && this.scene.arena.isMoveWeatherCancelled(this.move.getMove()))
|
||||||
success = false;
|
success = false;
|
||||||
else if (success && this.scene.arena.isMoveTerrainCancelled(this.pokemon, this.move.getMove())) {
|
else if (success && this.scene.arena.isMoveTerrainCancelled(this.pokemon, this.move.getMove())) {
|
||||||
success = false;
|
success = false;
|
||||||
failedText = getTerrainBlockMessage(targets[0], this.scene.arena.terrain.terrainType);
|
failedText = getTerrainBlockMessage(targets[0], this.scene.arena.terrain.terrainType);
|
||||||
|
} else if (success && isBounced) {
|
||||||
|
this.showFailedText(this.pokemon.getOpponentDescriptor() + "\nbounced the move back!");
|
||||||
|
this.targets = [this.pokemon.getBattlerIndex()];
|
||||||
|
this.pokemon = targets[0];
|
||||||
}
|
}
|
||||||
if (success)
|
if (success)
|
||||||
this.scene.unshiftPhase(this.getEffectPhase());
|
this.scene.unshiftPhase(this.getEffectPhase());
|
||||||
@ -2442,7 +2279,7 @@ export class MovePhase extends BattlePhase {
|
|||||||
this.pokemon.pushMoveHistory({ move: this.move.moveId, targets: this.targets, result: MoveResult.FAIL, virtual: this.move.virtual });
|
this.pokemon.pushMoveHistory({ move: this.move.moveId, targets: this.targets, result: MoveResult.FAIL, virtual: this.move.virtual });
|
||||||
this.showFailedText(failedText);
|
this.showFailedText(failedText);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.end();
|
this.end();
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -2450,7 +2287,7 @@ export class MovePhase extends BattlePhase {
|
|||||||
this.pokemon.status.incrementTurn();
|
this.pokemon.status.incrementTurn();
|
||||||
let activated = false;
|
let activated = false;
|
||||||
let healed = false;
|
let healed = false;
|
||||||
|
|
||||||
switch (this.pokemon.status.effect) {
|
switch (this.pokemon.status.effect) {
|
||||||
case StatusEffect.PARALYSIS:
|
case StatusEffect.PARALYSIS:
|
||||||
if (!this.pokemon.randSeedInt(4)) {
|
if (!this.pokemon.randSeedInt(4)) {
|
||||||
@ -2470,7 +2307,7 @@ export class MovePhase extends BattlePhase {
|
|||||||
this.cancelled = activated;
|
this.cancelled = activated;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (activated) {
|
if (activated) {
|
||||||
this.scene.queueMessage(getPokemonMessage(this.pokemon, getStatusEffectActivationText(this.pokemon.status.effect)));
|
this.scene.queueMessage(getPokemonMessage(this.pokemon, getStatusEffectActivationText(this.pokemon.status.effect)));
|
||||||
this.scene.unshiftPhase(new CommonAnimPhase(this.scene, this.pokemon.getBattlerIndex(), undefined, CommonAnim.POISON + (this.pokemon.status.effect - 1)));
|
this.scene.unshiftPhase(new CommonAnimPhase(this.scene, this.pokemon.getBattlerIndex(), undefined, CommonAnim.POISON + (this.pokemon.status.effect - 1)));
|
||||||
@ -2501,7 +2338,7 @@ export class MovePhase extends BattlePhase {
|
|||||||
|
|
||||||
if (this.pokemon.getTag(BattlerTagType.RECHARGING))
|
if (this.pokemon.getTag(BattlerTagType.RECHARGING))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
this.scene.queueMessage(getPokemonMessage(this.pokemon, ` used\n${this.move.getName()}!`), 500);
|
this.scene.queueMessage(getPokemonMessage(this.pokemon, ` used\n${this.move.getName()}!`), 500);
|
||||||
applyMoveAttrs(PreMoveMessageAttr, this.pokemon, this.pokemon.getOpponents().find(() => true), this.move.getMove());
|
applyMoveAttrs(PreMoveMessageAttr, this.pokemon, this.pokemon.getOpponents().find(() => true), this.move.getMove());
|
||||||
}
|
}
|
||||||
@ -2521,7 +2358,7 @@ export class MovePhase extends BattlePhase {
|
|||||||
export class MoveEffectPhase extends PokemonPhase {
|
export class MoveEffectPhase extends PokemonPhase {
|
||||||
public move: PokemonMove;
|
public move: PokemonMove;
|
||||||
protected targets: BattlerIndex[];
|
protected targets: BattlerIndex[];
|
||||||
|
|
||||||
constructor(scene: BattleScene, battlerIndex: BattlerIndex, targets: BattlerIndex[], move: PokemonMove) {
|
constructor(scene: BattleScene, battlerIndex: BattlerIndex, targets: BattlerIndex[], move: PokemonMove) {
|
||||||
super(scene, battlerIndex);
|
super(scene, battlerIndex);
|
||||||
|
|
||||||
@ -2532,8 +2369,8 @@ export class MoveEffectPhase extends PokemonPhase {
|
|||||||
start() {
|
start() {
|
||||||
super.start();
|
super.start();
|
||||||
|
|
||||||
let user = this.getUserPokemon();
|
const user = this.getUserPokemon();
|
||||||
let targets = this.getTargets();
|
const targets = this.getTargets();
|
||||||
|
|
||||||
if (!user?.isOnField())
|
if (!user?.isOnField())
|
||||||
return super.end();
|
return super.end();
|
||||||
@ -2545,7 +2382,7 @@ export class MoveEffectPhase extends PokemonPhase {
|
|||||||
|
|
||||||
if (overridden.value)
|
if (overridden.value)
|
||||||
return this.end();
|
return this.end();
|
||||||
|
|
||||||
user.lapseTags(BattlerTagLapseType.MOVE_EFFECT);
|
user.lapseTags(BattlerTagLapseType.MOVE_EFFECT);
|
||||||
|
|
||||||
if (user.turnData.hitsLeft === undefined) {
|
if (user.turnData.hitsLeft === undefined) {
|
||||||
@ -2576,24 +2413,12 @@ export class MoveEffectPhase extends PokemonPhase {
|
|||||||
return this.end();
|
return this.end();
|
||||||
}
|
}
|
||||||
|
|
||||||
let isBounced: BattlerTag | boolean = false;
|
|
||||||
for (let opponent of targets) {
|
|
||||||
isBounced = this.move.getMove().hasFlag(MoveFlags.MAGIC_COAT_MOVE) && (targets[0].findTags(t => t instanceof BounceTag).find(t => targets[0].lapseTag(t.tagType)) || opponent.hasAbilityWithAttr(MagicBounceAbAttr));
|
|
||||||
if (isBounced) {
|
|
||||||
this.scene.queueMessage(getPokemonMessage(targets[0], '\nbounced the move back!'));
|
|
||||||
const tempTargets = targets;
|
|
||||||
targets = [user];
|
|
||||||
user = tempTargets[0];
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const applyAttrs: Promise<void>[] = [];
|
const applyAttrs: Promise<void>[] = [];
|
||||||
|
|
||||||
// Move animation only needs one target
|
// Move animation only needs one target
|
||||||
new MoveAnim(this.move.getMove().id as Moves, user, this.getTarget()?.getBattlerIndex()).play(this.scene, () => {
|
new MoveAnim(this.move.getMove().id as Moves, user, this.getTarget()?.getBattlerIndex()).play(this.scene, () => {
|
||||||
for (let target of targets) {
|
for (let target of targets) {
|
||||||
if (!targetHitChecks[target.getBattlerIndex()] && !isBounced) {
|
if (!targetHitChecks[target.getBattlerIndex()]) {
|
||||||
user.turnData.hitCount = 1;
|
user.turnData.hitCount = 1;
|
||||||
user.turnData.hitsLeft = 1;
|
user.turnData.hitsLeft = 1;
|
||||||
this.scene.queueMessage(getPokemonMessage(user, '\'s\nattack missed!'));
|
this.scene.queueMessage(getPokemonMessage(user, '\'s\nattack missed!'));
|
||||||
|
Loading…
Reference in New Issue
Block a user