diff --git a/package.json b/package.json index 32b6e5092..e0ec65880 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "pokemon-rogue-battle", "private": true, - "version": "0.0.1", + "version": "1.0.0", "type": "module", "scripts": { "start": "vite", diff --git a/public/audio/bgm/battle_final_encounter.mp3 b/public/audio/bgm/battle_final_encounter.mp3 new file mode 100644 index 000000000..818e84cc2 Binary files /dev/null and b/public/audio/bgm/battle_final_encounter.mp3 differ diff --git a/public/audio/bgm/end_summit.mp3 b/public/audio/bgm/end_summit.mp3 new file mode 100644 index 000000000..840d888bd Binary files /dev/null and b/public/audio/bgm/end_summit.mp3 differ diff --git a/src/arena.ts b/src/arena.ts index 447a7bef9..69ae007ed 100644 --- a/src/arena.ts +++ b/src/arena.ts @@ -1,28 +1,23 @@ import BattleScene from "./battle-scene"; -import { Biome, BiomePoolTier, BiomeTierPokemonPools, PokemonPools, BiomeTierTrainerPools, biomePokemonPools, biomeTrainerPools } from "./data/biome"; +import { BiomePoolTier, BiomeTierPokemonPools, PokemonPools, BiomeTierTrainerPools, biomePokemonPools, biomeTrainerPools } from "./data/biomes"; +import { Biome } from "./data/enums/biome"; import * as Utils from "./utils"; import PokemonSpecies, { getPokemonSpecies } from "./data/pokemon-species"; -import { Species } from "./data/species"; +import { Species } from "./data/enums/species"; import { Weather, WeatherType, getWeatherClearMessage, getWeatherStartMessage } from "./data/weather"; import { CommonAnimPhase } from "./battle-phases"; import { CommonAnim } from "./data/battle-anims"; import { Type } from "./data/type"; -import Move, { Moves } from "./data/move"; +import Move from "./data/move"; import { ArenaTag, ArenaTagType, getArenaTag } from "./data/arena-tag"; import { GameMode } from "./game-mode"; -import { TrainerType } from "./data/trainer-type"; +import { TrainerType } from "./data/enums/trainer-type"; import { BattlerIndex } from "./battle"; +import { Moves } from "./data/enums/moves"; +import { TimeOfDay } from "./data/enums/time-of-day"; const WEATHER_OVERRIDE = WeatherType.NONE; -export enum TimeOfDay { - ALL = -1, - DAWN, - DAY, - DUSK, - NIGHT -} - export class Arena { public scene: BattleScene; public biomeType: Biome; diff --git a/src/battle-phases.ts b/src/battle-phases.ts index 51019759d..eb34e9c06 100644 --- a/src/battle-phases.ts +++ b/src/battle-phases.ts @@ -1,7 +1,8 @@ import BattleScene, { bypassLogin, startingLevel, startingWave } from "./battle-scene"; import { default as Pokemon, PlayerPokemon, EnemyPokemon, PokemonMove, MoveResult, DamageResult, FieldPosition, HitResult, TurnMove } from "./pokemon"; import * as Utils from './utils'; -import { allMoves, applyMoveAttrs, BypassSleepAttr, ChargeAttr, applyFilteredMoveAttrs, HitsTagAttr, MissEffectAttr, MoveAttr, MoveCategory, MoveEffectAttr, MoveFlags, Moves, MultiHitAttr, OverrideMoveEffectAttr, VariableAccuracyAttr, MoveTarget, OneHitKOAttr, getMoveTargets, MoveTargetSet, MoveEffectTrigger, CopyMoveAttr, AttackMove, SelfStatusMove, DelayedAttackAttr, RechargeAttr } from "./data/move"; +import { Moves } from "./data/enums/moves"; +import { allMoves, applyMoveAttrs, BypassSleepAttr, ChargeAttr, applyFilteredMoveAttrs, HitsTagAttr, MissEffectAttr, MoveAttr, MoveCategory, MoveEffectAttr, MoveFlags, MultiHitAttr, OverrideMoveEffectAttr, VariableAccuracyAttr, MoveTarget, OneHitKOAttr, getMoveTargets, MoveTargetSet, MoveEffectTrigger, CopyMoveAttr, AttackMove, SelfStatusMove, DelayedAttackAttr, RechargeAttr } from "./data/move"; import { Mode } from './ui/ui'; import { Command } from "./ui/command-ui-handler"; import { Stat } from "./data/pokemon-stat"; @@ -15,10 +16,13 @@ import EvolutionSceneHandler from "./ui/evolution-scene-handler"; import { EvolutionPhase } from "./evolution-phase"; import { BattlePhase } from "./battle-phase"; import { BattleStat, getBattleStatLevelChangeDescription, getBattleStatName } from "./data/battle-stat"; -import { Biome, biomeDepths, biomeLinks } from "./data/biome"; -import { FusePokemonModifierType, ModifierPoolType, ModifierTier, ModifierType, ModifierTypeFunc, ModifierTypeOption, PokemonModifierType, PokemonMoveModifierType, RememberMoveModifierType, TmModifierType, getEnemyBuffModifierForWave, getModifierType, getPlayerModifierTypeOptionsForWave, modifierTypes, regenerateModifierPoolThresholds } from "./modifier/modifier-type"; +import { biomeDepths, biomeLinks } from "./data/biomes"; +import { Biome } from "./data/enums/biome"; +import { ModifierTier } from "./modifier/modifier-tier"; +import { FusePokemonModifierType, ModifierPoolType, ModifierType, ModifierTypeFunc, ModifierTypeOption, PokemonModifierType, PokemonMoveModifierType, RememberMoveModifierType, TmModifierType, getEnemyBuffModifierForWave, getModifierType, getPlayerModifierTypeOptionsForWave, modifierTypes, regenerateModifierPoolThresholds } from "./modifier/modifier-type"; import SoundFade from "phaser3-rex-plugins/plugins/soundfade"; -import { BattlerTagLapseType, BattlerTagType, EncoreTag, HideSpriteTag as HiddenTag, TrappedTag } from "./data/battler-tag"; +import { BattlerTagLapseType, EncoreTag, HideSpriteTag as HiddenTag, TrappedTag } from "./data/battler-tags"; +import { BattlerTagType } from "./data/enums/battler-tag-type"; import { getPokemonMessage } from "./messages"; import { Starter } from "./ui/starter-select-ui-handler"; import { Gender } from "./data/gender"; @@ -29,17 +33,20 @@ import { Abilities, CheckTrappedAbAttr, IgnoreOpponentStatChangesAbAttr, PostAtt import { Unlockables, getUnlockableName } from "./system/unlockables"; import { getBiomeKey } from "./arena"; import { BattleType, BattlerIndex, TurnCommand } from "./battle"; +import { BattleSpec } from "./enums/battle-spec"; import { GameMode } from "./game-mode"; -import { Species } from "./data/species"; +import { Species } from "./data/enums/species"; import { HealAchv, LevelAchv, MoneyAchv, achvs } from "./system/achv"; -import { TrainerType, trainerConfigs } from "./data/trainer-type"; +import { trainerConfigs } 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 { GameDataType } from "./system/game-data"; import { addPokeballCaptureStars, addPokeballOpenParticles } from "./anims"; -import { SpeciesFormChangeActiveTrigger, SpeciesFormChangeMoveLearnedTrigger, SpeciesFormChangeMoveUsedTrigger } from "./data/pokemon-forms"; +import { SpeciesFormChangeActiveTrigger, SpeciesFormChangeManualTrigger, SpeciesFormChangeMoveLearnedTrigger, SpeciesFormChangeMoveUsedTrigger } from "./data/pokemon-forms"; +import { battleSpecDialogue } from "./data/dialogue"; export class LoginPhase extends BattlePhase { private showText: boolean; @@ -364,7 +371,7 @@ export class EncounterPhase extends BattlePhase { super.start(); this.scene.initSession(); - + const loadEnemyAssets = []; const battle = this.scene.currentBattle; @@ -389,8 +396,9 @@ export class EncounterPhase extends BattlePhase { this.scene.gameData.setPokemonSeen(enemyPokemon); } - if (this.scene.gameMode === GameMode.CLASSIC && (battle.waveIndex === 200 || !(battle.waveIndex % 250)) && enemyPokemon.species.speciesId === Species.ETERNATUS) { - enemyPokemon.formIndex = 1; + if (this.scene.gameMode === GameMode.CLASSIC && (battle.battleSpec === BattleSpec.FINAL_BOSS || !(battle.waveIndex % 250)) && enemyPokemon.species.speciesId === Species.ETERNATUS) { + if (battle.battleSpec !== BattleSpec.FINAL_BOSS) + enemyPokemon.formIndex = 1; enemyPokemon.setBoss(); } @@ -462,11 +470,28 @@ export class EncounterPhase extends BattlePhase { targets: [ this.scene.arenaEnemy, this.scene.currentBattle.trainer, enemyField, this.scene.arenaPlayer, this.scene.trainer ].flat(), x: (_target, _key, value, fieldIndex: integer) => fieldIndex < 2 + (enemyField.length) ? value + 300 : value - 300, duration: 2000, - onComplete: () => this.doEncounterCommon() + onComplete: () => { + if (!this.tryOverrideForBattleSpec()) + this.doEncounterCommon(); + } }); } - doEncounterCommon() { + getEncounterMessage(): string { + const enemyField = this.scene.getEnemyField(); + + if (this.scene.currentBattle.battleSpec === BattleSpec.FINAL_BOSS) + return `${enemyField[0].name} appeared.`; + + if (this.scene.currentBattle.battleType === BattleType.TRAINER) + return `${this.scene.currentBattle.trainer.getName()}\nwould like to battle!`; + + return enemyField.length === 1 + ? `A wild ${enemyField[0].name} appeared!` + : `A wild ${enemyField[0].name}\nand ${enemyField[1].name} appeared!`; + } + + doEncounterCommon(showEncounterMessage: boolean = true) { const enemyField = this.scene.getEnemyField(); if (this.scene.currentBattle.battleType === BattleType.WILD) { @@ -477,10 +502,10 @@ export class EncounterPhase extends BattlePhase { if (enemyPokemon.isShiny()) this.scene.validateAchv(achvs.SEE_SHINY); }); - let text = enemyField.length === 1 - ? `A wild ${enemyField[0].name} appeared!` - : `A wild ${enemyField[0].name}\nand ${enemyField[1].name} appeared!`; - this.scene.ui.showText(text, null, () => this.end(), 1500); + if (showEncounterMessage) + this.scene.ui.showText(this.getEncounterMessage(), null, () => this.end(), 1500); + else + this.end(); } else if (this.scene.currentBattle.battleType === BattleType.TRAINER) { const trainer = this.scene.currentBattle.trainer; trainer.untint(100, 'Sine.easeOut'); @@ -491,8 +516,7 @@ export class EncounterPhase extends BattlePhase { this.scene.playBgm(undefined); this.scene.pbTray.showPbTray(this.scene.getParty()); this.scene.pbTrayEnemy.showPbTray(this.scene.getEnemyParty()); - const text = `${this.scene.currentBattle.trainer.getName()}\nwould like to battle!`; - this.scene.ui.showText(text, null, () => { + const doTrainerSummon = () => { this.scene.tweens.add({ targets: this.scene.currentBattle.trainer, x: '+=16', @@ -506,7 +530,11 @@ export class EncounterPhase extends BattlePhase { if (this.scene.currentBattle.double && availablePartyMembers > 1) this.scene.unshiftPhase(new SummonPhase(this.scene, 1, false)); this.end(); - }, 1500, true); + }; + if (showEncounterMessage) + this.scene.ui.showText(this.getEncounterMessage(), null, doTrainerSummon, 1500, true); + else + doTrainerSummon(); }; if (!trainer.config.encounterMessages.length) @@ -514,13 +542,7 @@ export class EncounterPhase extends BattlePhase { else { let message: string; this.scene.executeWithSeedOffset(() => message = Phaser.Math.RND.pick(this.scene.currentBattle.trainer.config.encounterMessages), this.scene.currentBattle.waveIndex); - const messagePages = message.split(/\$/g).map(m => m.trim()); - let showMessageAndSummon = () => doSummon(); - for (let p = messagePages.length - 1; p >= 0; p--) { - const originalFunc = showMessageAndSummon; - showMessageAndSummon = () => this.scene.ui.showDialogue(messagePages[p], trainer.getName(), null, originalFunc, null, true); - } - showMessageAndSummon(); + this.scene.ui.showDialogue(message, trainer.getName(), null, doSummon, null, true); } } } @@ -570,6 +592,21 @@ export class EncounterPhase extends BattlePhase { super.end(); } + + tryOverrideForBattleSpec(): boolean { + switch (this.scene.currentBattle.battleSpec) { + case BattleSpec.FINAL_BOSS: + const enemy = this.scene.getEnemyPokemon(); + this.scene.ui.showText(this.getEncounterMessage(), null, () => { + this.scene.ui.showDialogue(battleSpecDialogue[BattleSpec.FINAL_BOSS].encounter, enemy.name, null, () => { + this.doEncounterCommon(false); + }, null, true); + }, 1500, true); + return true; + } + + return false; + } } export class NextEncounterPhase extends EncounterPhase { @@ -592,7 +629,8 @@ export class NextEncounterPhase extends EncounterPhase { if (this.scene.lastEnemyTrainer) this.scene.lastEnemyTrainer.destroy(); - this.doEncounterCommon(); + if (!this.tryOverrideForBattleSpec()) + this.doEncounterCommon(); } }); } @@ -616,7 +654,10 @@ export class NewBiomeEncounterPhase extends NextEncounterPhase { targets: [ this.scene.arenaEnemy, enemyField ].flat(), x: '+=300', duration: 2000, - onComplete: () => this.doEncounterCommon() + onComplete: () => { + if (!this.tryOverrideForBattleSpec()) + this.doEncounterCommon(); + } }); } } @@ -1604,7 +1645,7 @@ export class CommonAnimPhase extends PokemonPhase { } export class MovePhase extends BattlePhase { - protected pokemon: Pokemon; + public pokemon: Pokemon; protected targets: BattlerIndex[]; protected move: PokemonMove; protected followUp: boolean; @@ -2337,6 +2378,26 @@ export class DamagePhase extends PokemonPhase { } else this.getPokemon().updateInfo().then(() => this.end()); } + + end() { + switch (this.scene.currentBattle.battleSpec) { + case BattleSpec.FINAL_BOSS: + const pokemon = this.getPokemon(); + if (pokemon instanceof EnemyPokemon && pokemon.isBoss() && !pokemon.formIndex && !pokemon.bossSegmentIndex) { + this.scene.fadeOutBgm(Utils.fixedInt(2000), false); + this.scene.ui.showDialogue(battleSpecDialogue[BattleSpec.FINAL_BOSS].firstStageWin, pokemon.name, null, () => { + this.scene.addEnemyModifier(getModifierType(modifierTypes.MINI_BLACK_HOLE).newModifier(pokemon) as PersistentModifier, false, true); + pokemon.generateAndPopulateMoveset(1); + this.scene.triggerPokemonFormChange(pokemon, SpeciesFormChangeManualTrigger, false); + super.end(); + }, null, true); + return; + } + break; + } + + super.end(); + } } export class FaintPhase extends PokemonPhase { @@ -2372,6 +2433,13 @@ export class FaintPhase extends PokemonPhase { } } + if (!this.tryOverrideForBattleSpec()) + this.doFaint(); + } + + doFaint(): void { + const pokemon = this.getPokemon(); + this.scene.queueMessage(getPokemonMessage(pokemon, ' fainted!'), null, true); if (this.player) { @@ -2416,6 +2484,19 @@ export class FaintPhase extends PokemonPhase { }); }); } + + tryOverrideForBattleSpec(): boolean { + switch (this.scene.currentBattle.battleSpec) { + case BattleSpec.FINAL_BOSS: + const enemy = this.getPokemon(); + if (enemy.formIndex) { + this.scene.ui.showDialogue(battleSpecDialogue[BattleSpec.FINAL_BOSS].secondStageWin, enemy.name, null, () => this.doFaint(), null, true); + return true; + } + } + + return false; + } } export class VictoryPhase extends PokemonPhase { diff --git a/src/battle-scene.ts b/src/battle-scene.ts index c27f89bb3..c09402019 100644 --- a/src/battle-scene.ts +++ b/src/battle-scene.ts @@ -1,5 +1,4 @@ import Phaser from 'phaser'; -import { Biome } from './data/biome'; import UI, { Mode } from './ui/ui'; import { EncounterPhase, SummonPhase, NextEncounterPhase, NewBiomeEncounterPhase, SelectBiomePhase, MessagePhase, CheckLoadPhase, TurnInitPhase, ReturnPhase, LevelCapPhase, TestMessagePhase, ShowTrainerPhase, TrainerMessageTestPhase, LoginPhase, ConsolidateDataPhase } from './battle-phases'; import Pokemon, { PlayerPokemon, EnemyPokemon } from './pokemon'; @@ -11,11 +10,14 @@ import { initAutoPlay } from './system/auto-play'; import { initCommonAnims, initMoveAnim, loadCommonAnimAssets, loadMoveAnimAssets, populateAnims } from './data/battle-anims'; import { BattlePhase } from './battle-phase'; import { initGameSpeed } from './system/game-speed'; +import { Biome } from "./data/enums/biome"; import { Arena, ArenaBase, getBiomeHasProps, getBiomeKey } from './arena'; import { GameData } from './system/game-data'; import StarterSelectUiHandler from './ui/starter-select-ui-handler'; import { TextStyle, addTextObject } from './ui/text'; -import { Moves, initMoves } from './data/move'; +import { Moves } from "./data/enums/moves"; +import { } from "./data/move"; +import { initMoves } from './data/move'; import { ModifierPoolType, getDefaultModifierTypeForTier, getEnemyModifierTypesForWave } from './modifier/modifier-type'; import AbilityBar from './ui/ability-bar'; import { BlockItemTheftAbAttr, DoubleBattleChanceAbAttr, applyAbAttrs, initAbilities } from './data/ability'; @@ -24,7 +26,8 @@ import { GameMode } from './game-mode'; import FieldSpritePipeline from './pipelines/field-sprite'; import SpritePipeline from './pipelines/sprite'; import PartyExpBar from './ui/party-exp-bar'; -import { TrainerType, trainerConfigs } from './data/trainer-type'; +import { trainerConfigs } from './data/trainer-config'; +import { TrainerType } from "./data/enums/trainer-type"; import Trainer from './trainer'; import TrainerData from './system/trainer-data'; import SoundFade from 'phaser3-rex-plugins/plugins/soundfade'; @@ -33,7 +36,7 @@ import PokeballTray from './ui/pokeball-tray'; import { Setting, settingOptions } from './system/settings'; import SettingsUiHandler from './ui/settings-ui-handler'; import MessageUiHandler from './ui/message-ui-handler'; -import { Species } from './data/species'; +import { Species } from './data/enums/species'; import InvertPostFX from './pipelines/invert'; import { Achv, ModifierAchv, achvs } from './system/achv'; import { GachaType } from './data/egg'; @@ -43,7 +46,7 @@ import UIPlugin from 'phaser3-rex-plugins/templates/ui/ui-plugin'; import { WindowVariant, getWindowVariantSuffix } from './ui/window'; import PokemonData from './system/pokemon-data'; import { Nature } from './data/nature'; -import { SpeciesFormChangeTimeOfDayTrigger, SpeciesFormChangeTrigger, getSpeciesFormChangeMessage, pokemonFormChanges } from './data/pokemon-forms'; +import { SpeciesFormChangeTimeOfDayTrigger, SpeciesFormChangeTrigger, pokemonFormChanges } from './data/pokemon-forms'; import { FormChangePhase, QuietFormChangePhase } from './form-change-phase'; const enableAuto = true; @@ -817,7 +820,7 @@ export default class BattleScene extends Phaser.Scene { this.lastEnemyTrainer = lastBattle?.trainer ?? null; - this.currentBattle = new Battle(newWaveIndex, newBattleType, newTrainer, newDouble); + this.currentBattle = new Battle(this.gameMode, newWaveIndex, newBattleType, newTrainer, newDouble); this.currentBattle.incrementTurn(this); //this.pushPhase(new TrainerMessageTestPhase(this)); @@ -934,8 +937,6 @@ export default class BattleScene extends Phaser.Scene { if (species) { if (species.baseTotal >= 670) ret++; - if (speciesStarters.hasOwnProperty(species.speciesId) && speciesStarters[species.speciesId] > 8) - ret++; } ret += Math.floor(waveIndex / 250); @@ -1289,6 +1290,8 @@ export default class BattleScene extends Phaser.Scene { return 12.235; case 'battle_elite': return 17.730; + case 'battle_final_encounter': + return 19.159; case 'battle_final': return 16.453; case 'battle_gym': @@ -1311,6 +1314,8 @@ export default class BattleScene extends Phaser.Scene { return 12.703; case 'battle_wild_strong': return 13.940; + case 'end_summit': + return 30.025; } return 0; @@ -1384,6 +1389,10 @@ export default class BattleScene extends Phaser.Scene { return true; } + findPhase(phaseFilter: (phase: BattlePhase) => boolean): BattlePhase { + return this.phaseQueue.find(phaseFilter); + } + queueMessage(message: string, callbackDelay?: integer, prompt?: boolean, promptDelay?: integer, defer?: boolean) { const phase = new MessagePhase(this, message, callbackDelay, prompt, promptDelay); if (!defer) @@ -1654,7 +1663,7 @@ export default class BattleScene extends Phaser.Scene { phase = new FormChangePhase(this, pokemon, matchingFormChange, modal); else phase = new QuietFormChangePhase(this, pokemon, matchingFormChange); - if (!matchingFormChange.quiet && modal) + if (pokemon instanceof PlayerPokemon && !matchingFormChange.quiet && modal) this.overridePhase(phase); else if (delayed) this.pushPhase(phase); diff --git a/src/battle.ts b/src/battle.ts index df3d652ad..b00f26e3b 100644 --- a/src/battle.ts +++ b/src/battle.ts @@ -3,10 +3,11 @@ import { EnemyPokemon, PlayerPokemon, QueuedMove } from "./pokemon"; import { Command } from "./ui/command-ui-handler"; import * as Utils from "./utils"; import Trainer from "./trainer"; -import { Species } from "./data/species"; -import { Moves } from "./data/move"; -import { TrainerType } from "./data/trainer-type"; +import { Species } from "./data/enums/species"; +import { Moves } from "./data/enums/moves"; +import { TrainerType } from "./data/enums/trainer-type"; import { GameMode } from "./game-mode"; +import { BattleSpec } from "./enums/battle-spec"; export enum BattleType { WILD, @@ -35,8 +36,10 @@ interface TurnCommands { } export default class Battle { + protected gameMode: GameMode; public waveIndex: integer; public battleType: BattleType; + public battleSpec: BattleSpec; public trainer: Trainer; public enemyLevels: integer[]; public enemyParty: EnemyPokemon[]; @@ -51,10 +54,12 @@ export default class Battle { public battleSeed: string; private battleSeedState: string; - constructor(waveIndex: integer, battleType: BattleType, trainer: Trainer, double: boolean) { + constructor(gameMode: integer, waveIndex: integer, battleType: BattleType, trainer: Trainer, double: boolean) { + this.gameMode = gameMode; this.waveIndex = waveIndex; this.battleType = battleType; this.trainer = trainer; + this.initBattleSpec(); this.enemyLevels = battleType !== BattleType.TRAINER ? new Array(double ? 2 : 1).fill(null).map(() => this.getLevelForWave()) : trainer.getPartyLevels(this.waveIndex); @@ -67,13 +72,22 @@ export default class Battle { this.battleSeedState = null; } + private initBattleSpec(): void { + let spec = BattleSpec.DEFAULT; + if (this.gameMode === GameMode.CLASSIC) { + if (this.waveIndex === 200) + spec = BattleSpec.FINAL_BOSS; + } + this.battleSpec = spec; + } + private getLevelForWave(): integer { let baseLevel = 1 + this.waveIndex / 2 + Math.pow(this.waveIndex / 25, 2); const bossMultiplier = 1.2; if (!(this.waveIndex % 10)) { const ret = Math.floor(baseLevel * bossMultiplier); - if (this.waveIndex === 200 || !(this.waveIndex % 250)) + if (this.battleSpec === BattleSpec.FINAL_BOSS || !(this.waveIndex % 250)) return Math.ceil(ret / 25) * 25; return ret + Math.round(Phaser.Math.RND.realInRange(-1, 1) * Math.floor(this.waveIndex / 10)); } @@ -114,10 +128,14 @@ export default class Battle { if (!this.started && this.trainer.config.encounterBgm && this.trainer.config.encounterMessages.length) return `encounter_${this.trainer.getEncounterBgm()}`; return this.trainer.getBattleBgm(); - } + } else if (this.gameMode === GameMode.CLASSIC && this.waveIndex > 195 && this.battleSpec !== BattleSpec.FINAL_BOSS) + return 'end_summit'; for (let pokemon of battlers) { - if (pokemon.species.speciesId === Species.ETERNATUS) - return 'battle_final'; + if (this.battleSpec === BattleSpec.FINAL_BOSS) { + if (pokemon.formIndex) + return 'battle_final'; + return 'battle_final_encounter'; + } if (pokemon.species.legendary || pokemon.species.pseudoLegendary || pokemon.species.mythical) { if (pokemon.species.speciesId === Species.KYUREM) return 'battle_legendary_z'; @@ -149,7 +167,7 @@ export default class Battle { export class FixedBattle extends Battle { constructor(scene: BattleScene, waveIndex: integer, config: FixedBattleConfig) { - super(waveIndex, config.battleType, config.battleType === BattleType.TRAINER ? config.getTrainer(scene) : null, config.double); + super(scene.gameMode, waveIndex, config.battleType, config.battleType === BattleType.TRAINER ? config.getTrainer(scene) : null, config.double); if (config.getEnemyParty) this.enemyParty = config.getEnemyParty(scene); } diff --git a/src/data/ability.ts b/src/data/ability.ts index 463a1ffce..ad322ca0a 100644 --- a/src/data/ability.ts +++ b/src/data/ability.ts @@ -1,16 +1,18 @@ import Pokemon, { HitResult, PokemonMove } from "../pokemon"; -import { Type, getTypeDamageMultiplier } from "./type"; +import { Type } from "./type"; import * as Utils from "../utils"; import { BattleStat, getBattleStatName } from "./battle-stat"; import { DamagePhase, ObtainStatusEffectPhase, PokemonHealPhase, ShowAbilityPhase, StatChangePhase } from "../battle-phases"; import { getPokemonMessage } from "../messages"; import { Weather, WeatherType } from "./weather"; -import { BattlerTag, BattlerTagType } from "./battler-tag"; +import { BattlerTag } from "./battler-tags"; +import { BattlerTagType } from "./enums/battler-tag-type"; import { StatusEffect, getStatusEffectDescriptor } from "./status-effect"; -import Move, { MoveCategory, MoveFlags, Moves, RecoilAttr, StealHeldItemAttr } from "./move"; +import Move, { MoveCategory, MoveFlags, RecoilAttr } from "./move"; import { ArenaTagType } from "./arena-tag"; import { Stat } from "./pokemon-stat"; import { PokemonHeldItemModifier } from "../modifier/modifier"; +import { Moves } from "./enums/moves"; export class Ability { public id: Abilities; diff --git a/src/data/api.ts b/src/data/api.ts index 91c45e3b2..ab4dea554 100644 --- a/src/data/api.ts +++ b/src/data/api.ts @@ -6,7 +6,7 @@ import PokemonSpecies, { PokemonForm, SpeciesFormKey, allSpecies } from './pokem import { GrowthRate } from './exp'; import { Type } from './type'; import { Abilities, allAbilities } from './ability'; -import { Species } from './species'; +import { Species } from './enums/species'; import { pokemonFormLevelMoves } from './pokemon-level-moves'; import { tmSpecies } from './tms'; diff --git a/src/data/arena-tag.ts b/src/data/arena-tag.ts index dfbb866e9..71bc7cdf1 100644 --- a/src/data/arena-tag.ts +++ b/src/data/arena-tag.ts @@ -1,13 +1,14 @@ import { Arena } from "../arena"; import { Type } from "./type"; import * as Utils from "../utils"; -import { Moves, allMoves } from "./move"; +import { allMoves } from "./move"; import { getPokemonMessage } from "../messages"; import Pokemon, { HitResult, PokemonMove } from "../pokemon"; import { DamagePhase, MoveEffectPhase, ObtainStatusEffectPhase } from "../battle-phases"; import { StatusEffect } from "./status-effect"; -import { BattlerTagType } from "./battler-tag"; +import { BattlerTagType } from "./enums/battler-tag-type"; import { BattlerIndex } from "../battle"; +import { Moves } from "./enums/moves"; export enum ArenaTagType { NONE, diff --git a/src/data/battle-anims.ts b/src/data/battle-anims.ts index 2e97c7b8a..f3858a226 100644 --- a/src/data/battle-anims.ts +++ b/src/data/battle-anims.ts @@ -1,10 +1,11 @@ //import { battleAnimRawData } from "./battle-anim-raw-data"; import BattleScene from "../battle-scene"; -import { AttackMove, ChargeAttr, DelayedAttackAttr, MoveFlags, Moves, SelfStatusMove, allMoves } from "./move"; +import { AttackMove, ChargeAttr, DelayedAttackAttr, MoveFlags, SelfStatusMove, allMoves } from "./move"; import Pokemon from "../pokemon"; import * as Utils from "../utils"; import { BattlerIndex } from "../battle"; import stringify, { Element } from "json-stable-stringify"; +import { Moves } from "./enums/moves"; //import fs from 'vite-plugin-fs/browser'; export enum AnimFrameTarget { diff --git a/src/data/battler-tag.ts b/src/data/battler-tags.ts similarity index 96% rename from src/data/battler-tag.ts rename to src/data/battler-tags.ts index 705792b97..5d7ce0d9a 100644 --- a/src/data/battler-tag.ts +++ b/src/data/battler-tags.ts @@ -5,45 +5,11 @@ import Pokemon, { MoveResult, HitResult } from "../pokemon"; import { Stat } from "./pokemon-stat"; import { StatusEffect } from "./status-effect"; import * as Utils from "../utils"; -import { ChargeAttr, Moves, allMoves } from "./move"; +import { Moves } from "./enums/moves"; +import { ChargeAttr, allMoves } from "./move"; import { Type } from "./type"; import { Abilities } from "./ability"; - -export enum BattlerTagType { - NONE = "NONE", - RECHARGING = "RECHARGING", - FLINCHED = "FLINCHED", - CONFUSED = "CONFUSED", - INFATUATED = "INFATUATED", - SEEDED = "SEEDED", - NIGHTMARE = "NIGHTMARE", - FRENZY = "FRENZY", - ENCORE = "ENCORE", - INGRAIN = "INGRAIN", - AQUA_RING = "AQUA_RING", - DROWSY = "DROWSY", - TRAPPED = "TRAPPED", - BIND = "BIND", - WRAP = "WRAP", - FIRE_SPIN = "FIRE_SPIN", - WHIRLPOOL = "WHIRLPOOL", - CLAMP = "CLAMP", - SAND_TOMB = "SAND_TOMB", - MAGMA_STORM = "MAGMA_STORM", - PROTECTED = "PROTECTED", - PERISH_SONG = "PERISH_SONG", - TRUANT = "TRUANT", - SLOW_START = "SLOW_START", - FLYING = "FLYING", - UNDERGROUND = "UNDERGROUND", - HIDDEN = "HIDDEN", - FIRE_BOOST = "FIRE_BOOST", - CRIT_BOOST = "CRIT_BOOST", - NO_CRIT = "NO_CRIT", - IGNORE_ACCURACY = "IGNORE_ACCURACY", - BYPASS_SLEEP = "BYPASS_SLEEP", - IGNORE_FLYING = "IGNORE_FLYING" -} +import { BattlerTagType } from "./enums/battler-tag-type"; export enum BattlerTagLapseType { FAINT, diff --git a/src/data/berry.ts b/src/data/berry.ts index 26b6ac8ad..2ac971a76 100644 --- a/src/data/berry.ts +++ b/src/data/berry.ts @@ -3,7 +3,7 @@ import { getPokemonMessage } from "../messages"; import Pokemon, { HitResult } from "../pokemon"; import { getBattleStatName } from "./battle-stat"; import { BattleStat } from "./battle-stat"; -import { BattlerTagType } from "./battler-tag"; +import { BattlerTagType } from "./enums/battler-tag-type"; import { getStatusEffectHealText } from "./status-effect"; import * as Utils from "../utils"; import { DoubleBerryEffectAbAttr, applyAbAttrs } from "./ability"; diff --git a/src/data/biome.ts b/src/data/biomes.ts similarity index 98% rename from src/data/biome.ts rename to src/data/biomes.ts index cccd488cc..fda539da6 100644 --- a/src/data/biome.ts +++ b/src/data/biomes.ts @@ -1,49 +1,11 @@ -import { pokemonEvolutions, SpeciesEvolution } from "./pokemon-evolutions"; -import { Species } from "./species"; +import { Species } from "./enums/species"; import { Type } from './type'; import * as Utils from '../utils'; - import beautify from 'json-beautify'; -import { TrainerType } from "./trainer-type"; -import { TimeOfDay } from "../arena"; - -export enum Biome { - TOWN, - PLAINS, - GRASS, - TALL_GRASS, - METROPOLIS, - FOREST, - SEA, - SWAMP, - BEACH, - LAKE, - SEABED, - MOUNTAIN, - BADLANDS, - CAVE, - DESERT, - ICE_CAVE, - MEADOW, - POWER_PLANT, - VOLCANO, - GRAVEYARD, - DOJO, - FACTORY, - RUINS, - WASTELAND, - ABYSS, - SPACE, - CONSTRUCTION_SITE, - JUNGLE, - FAIRY_CAVE, - TEMPLE, - SLUM, - SNOWY_FOREST, - ISLAND = 40, - LABORATORY, - END = 50 -}; +import { TrainerType } from "./enums/trainer-type"; +import { TimeOfDay } from "./enums/time-of-day"; +import { Biome } from "./enums/biome"; +import { SpeciesEvolution } from "./pokemon-evolutions"; export function getBiomeName(biome: Biome | -1) { if (biome === -1) @@ -7387,118 +7349,121 @@ export const biomeTrainerPools: BiomeTrainerPools = { traverseBiome(Biome.TOWN, 0); biomeDepths[Biome.END] = [ Object.values(biomeDepths).map(d => d[0]).reduce((max: integer, value: integer) => Math.max(max, value), 0) + 1, 1 ]; - for (let biome of Utils.getEnumValues(Biome)) { - biomePokemonPools[biome] = {}; - biomeTrainerPools[biome] = {}; + import('./pokemon-evolutions').then(pe => { + const pokemonEvolutions = pe.pokemonEvolutions; + for (let biome of Utils.getEnumValues(Biome)) { + biomePokemonPools[biome] = {}; + biomeTrainerPools[biome] = {}; - for (let tier of Utils.getEnumValues(BiomePoolTier)) { - biomePokemonPools[biome][tier] = {}; - biomeTrainerPools[biome][tier] = []; + for (let tier of Utils.getEnumValues(BiomePoolTier)) { + biomePokemonPools[biome][tier] = {}; + biomeTrainerPools[biome][tier] = []; - for (let tod of Utils.getEnumValues(TimeOfDay)) - biomePokemonPools[biome][tier][tod] = []; + for (let tod of Utils.getEnumValues(TimeOfDay)) + biomePokemonPools[biome][tier][tod] = []; + } } - } - for (let pb of pokemonBiomes) { - const speciesId = pb[0] as Species; - const biomeEntries = pb[3] as (Biome | BiomePoolTier)[][]; + for (let pb of pokemonBiomes) { + const speciesId = pb[0] as Species; + const biomeEntries = pb[3] as (Biome | BiomePoolTier)[][]; - const speciesEvolutions: SpeciesEvolution[] = pokemonEvolutions.hasOwnProperty(speciesId) - ? pokemonEvolutions[speciesId] - : []; - - if (!biomeEntries.filter(b => b[0] !== Biome.END).length && !speciesEvolutions.filter(es => !!((pokemonBiomes.find(p => p[0] === es.speciesId))[3] as any[]).filter(b => b[0] !== Biome.END).length).length) - uncatchableSpecies.push(speciesId); + const speciesEvolutions: SpeciesEvolution[] = pokemonEvolutions.hasOwnProperty(speciesId) + ? pokemonEvolutions[speciesId] + : []; + + if (!biomeEntries.filter(b => b[0] !== Biome.END).length && !speciesEvolutions.filter(es => !!((pokemonBiomes.find(p => p[0] === es.speciesId))[3] as any[]).filter(b => b[0] !== Biome.END).length).length) + uncatchableSpecies.push(speciesId); - for (let b of biomeEntries) { - const biome = b[0]; - const tier = b[1]; - const timesOfDay = b.length > 2 - ? Array.isArray(b[2]) - ? b[2] - : [ b[2] ] - : [ TimeOfDay.ALL ]; + for (let b of biomeEntries) { + const biome = b[0]; + const tier = b[1]; + const timesOfDay = b.length > 2 + ? Array.isArray(b[2]) + ? b[2] + : [ b[2] ] + : [ TimeOfDay.ALL ]; - for (let tod of timesOfDay) { - if (!biomePokemonPools.hasOwnProperty(biome) || !biomePokemonPools[biome].hasOwnProperty(tier) || !biomePokemonPools[biome][tier].hasOwnProperty(tod)) + for (let tod of timesOfDay) { + if (!biomePokemonPools.hasOwnProperty(biome) || !biomePokemonPools[biome].hasOwnProperty(tier) || !biomePokemonPools[biome][tier].hasOwnProperty(tod)) + continue; + + const biomeTierPool = biomePokemonPools[biome][tier][tod]; + + let treeIndex = -1; + let arrayIndex = 0; + + for (let t = 0; t < biomeTierPool.length; t++) { + const existingSpeciesIds = biomeTierPool[t] as unknown as Species[]; + for (let es = 0; es < existingSpeciesIds.length; es++) { + const existingSpeciesId = existingSpeciesIds[es]; + if (pokemonEvolutions.hasOwnProperty(existingSpeciesId) && (pokemonEvolutions[existingSpeciesId] as SpeciesEvolution[]).find(ese => ese.speciesId === speciesId)) { + treeIndex = t; + arrayIndex = es + 1; + break; + } else if (speciesEvolutions && speciesEvolutions.find(se => se.speciesId === existingSpeciesId)) { + treeIndex = t; + arrayIndex = es; + break; + } + } + if (treeIndex > -1) + break; + } + + if (treeIndex > -1) + (biomeTierPool[treeIndex] as unknown as Species[]).splice(arrayIndex, 0, speciesId); + else + (biomeTierPool as unknown as Species[][]).push([ speciesId ]); + } + } + } + + for (let b of Object.keys(biomePokemonPools)) { + for (let t of Object.keys(biomePokemonPools[b])) { + const tier = parseInt(t) as BiomePoolTier; + for (let tod of Object.keys(biomePokemonPools[b][t])) { + const biomeTierTimePool = biomePokemonPools[b][t][tod]; + for (let e = 0; e < biomeTierTimePool.length; e++) { + const entry = biomeTierTimePool[e]; + if (entry.length === 1) + biomeTierTimePool[e] = entry[0]; + else { + const newEntry = { + 1: [ entry[0] ] + }; + for (let s = 1; s < entry.length; s++) { + const speciesId = entry[s]; + const prevolution = entry.map(s => pokemonEvolutions[s]).flat().find(e => e && e.speciesId === speciesId); + const level = prevolution.level - (prevolution.level === 1 ? 1 : 0) + (prevolution.wildDelay * 10) - (tier >= BiomePoolTier.BOSS ? 10 : 0); + if (!newEntry.hasOwnProperty(level)) + newEntry[level] = [ speciesId ]; + else + newEntry[level].push(speciesId); + } + biomeTierTimePool[e] = newEntry; + } + } + } + } + } + + for (let tb of trainerBiomes) { + const trainerType = tb[0] as TrainerType; + const biomeEntries = tb[1] as BiomePoolTier[][]; + + for (let b of biomeEntries) { + const biome = b[0]; + const tier = b[1]; + + if (!biomeTrainerPools.hasOwnProperty(biome) || !biomeTrainerPools[biome].hasOwnProperty(tier)) continue; - const biomeTierPool = biomePokemonPools[biome][tier][tod]; - - let treeIndex = -1; - let arrayIndex = 0; - - for (let t = 0; t < biomeTierPool.length; t++) { - const existingSpeciesIds = biomeTierPool[t] as unknown as Species[]; - for (let es = 0; es < existingSpeciesIds.length; es++) { - const existingSpeciesId = existingSpeciesIds[es]; - if (pokemonEvolutions.hasOwnProperty(existingSpeciesId) && (pokemonEvolutions[existingSpeciesId] as SpeciesEvolution[]).find(ese => ese.speciesId === speciesId)) { - treeIndex = t; - arrayIndex = es + 1; - break; - } else if (speciesEvolutions && speciesEvolutions.find(se => se.speciesId === existingSpeciesId)) { - treeIndex = t; - arrayIndex = es; - break; - } - } - if (treeIndex > -1) - break; - } - - if (treeIndex > -1) - (biomeTierPool[treeIndex] as unknown as Species[]).splice(arrayIndex, 0, speciesId); - else - (biomeTierPool as unknown as Species[][]).push([ speciesId ]); + const biomeTierPool = biomeTrainerPools[biome][tier]; + biomeTierPool.push(trainerType); } } - } - - for (let b of Object.keys(biomePokemonPools)) { - for (let t of Object.keys(biomePokemonPools[b])) { - const tier = parseInt(t) as BiomePoolTier; - for (let tod of Object.keys(biomePokemonPools[b][t])) { - const biomeTierTimePool = biomePokemonPools[b][t][tod]; - for (let e = 0; e < biomeTierTimePool.length; e++) { - const entry = biomeTierTimePool[e]; - if (entry.length === 1) - biomeTierTimePool[e] = entry[0]; - else { - const newEntry = { - 1: [ entry[0] ] - }; - for (let s = 1; s < entry.length; s++) { - const speciesId = entry[s]; - const prevolution = entry.map(s => pokemonEvolutions[s]).flat().find(e => e && e.speciesId === speciesId); - const level = prevolution.level - (prevolution.level === 1 ? 1 : 0) + (prevolution.wildDelay * 10) - (tier >= BiomePoolTier.BOSS ? 10 : 0); - if (!newEntry.hasOwnProperty(level)) - newEntry[level] = [ speciesId ]; - else - newEntry[level].push(speciesId); - } - biomeTierTimePool[e] = newEntry; - } - } - } - } - } - - for (let tb of trainerBiomes) { - const trainerType = tb[0] as TrainerType; - const biomeEntries = tb[1] as BiomePoolTier[][]; - - for (let b of biomeEntries) { - const biome = b[0]; - const tier = b[1]; - - if (!biomeTrainerPools.hasOwnProperty(biome) || !biomeTrainerPools[biome].hasOwnProperty(tier)) - continue; - - const biomeTierPool = biomeTrainerPools[biome][tier]; - biomeTierPool.push(trainerType); - } - } + }); function outputPools() { const pokemonOutput = {}; diff --git a/src/data/dialogue.ts b/src/data/dialogue.ts new file mode 100644 index 000000000..c0fdc71bf --- /dev/null +++ b/src/data/dialogue.ts @@ -0,0 +1,283 @@ +import { trainerConfigs } from "./trainer-config"; +import { TrainerType } from "./enums/trainer-type"; +import { BattleSpec } from "../enums/battle-spec"; + +export interface TrainerTypeMessages { + encounter?: string | string[], + victory?: string | string[], + defeat?: string | string[] +} + +export interface TrainerTypeDialogue { + [key: integer]: TrainerTypeMessages | [ TrainerTypeMessages, TrainerTypeMessages ] +} + +export const trainerTypeDialogue = { + [TrainerType.YOUNGSTER]: [ + { + encounter: [ + `Hey, wanna battle?`, + `Are you a new trainer too?`, + `Hey, I haven't seen you before. Let's battle!` + ], + victory: [ + `Wow! You're strong!`, + `I didn't stand a chance, huh.`, + `I'll find you again when I'm older and beat you!` + ] + }, + { + encounter: [ + `Let's have a battle, shall we?`, + `You look like a new trainer. Let's have a battle!`, + `I don't recognize you. How about a battle?` + ], + victory: [ + `That was impressive! I've got a lot to learn.`, + `I didn't think you'd beat me that bad…`, + `I hope we get to have a rematch some day.` + ] + } + ], + [TrainerType.ROXANNE]: { + encounter: [ + `Would you kindly demonstrate how you battle?`, + `You can learn many things by battling many trainers.`, + `Oh, you caught me strategizing.\nWould you like to battle?` + ], + victory: [ + `Oh, I appear to have lost.\nI understand.`, + `It seems that I still have so much more to learn when it comes to battle.`, + `I'll take what I learned here today to heart.` + ], + defeat: [ + `I have learned many things from our battle.\nI hope you have too.`, + `I look forward to battling you again.\nI hope you'll use what you've learned here.`, + `I won due to everything I have learned.` + ] + }, + [TrainerType.BRAWLY]: { + encounter: [ + `Oh man, a challenger!\nLet's see what you can do!`, + `You seem like a big splash.\nLet's battle!`, + `Time to create a storm!\nLet's go!` + ], + victory: [ + `Oh woah, you've washed me out!`, + `You surfed my wave and crashed me down!`, + `I feel like I'm lost in Granite Cave!` + ], + defeat: [ + `Haha, I surfed the big wave!\nChallenge me again sometime.`, + `Surf with me again some time!`, + `Just like the tides come in and out, I hope you return to challenge me again.` + ] + }, + [TrainerType.WATTSON]: { + encounter: [ + `Time to get shocked!\nWahahahaha!`, + `I'll make sparks fly!\nWahahahaha!`, + `I hope you brought Paralyz Heal!\nWahahahaha!` + ], + victory: [ + `Seems like I'm out of charge!\nWahahahaha!`, + `You've completely grounded me!\nWahahahaha!`, + `Thanks for the thrill!\nWahahahaha!` + ], + defeat: [ + `Recharge your batteries and challenge me again sometime!\nWahahahaha!`, + `I hope you found our battle electrifying!\nWahahahaha!`, + `Aren't you shocked I won?\nWahahahaha!` + ] + }, + [TrainerType.FLANNERY]: { + encounter: [ + `Nice to meet you! Wait, no…\nI will crush you!`, + `I've only been a leader for a little while, but I'll smoke you!`, + `It's time to demonstrate the moves my grandfather has taught me! Let's battle!` + ], + victory: [ + `You remind me of my grandfather…\nNo wonder I lost.`, + `Am I trying too hard?\nI should relax, can't get too heated.`, + `Losing isn't going to smother me out.\nTime to reignite training!` + ], + defeat: [ + `I hope I've made my grandfather proud…\nLet's battle again some time.`, + `I…I can't believe I won!\nDoing things my way worked!`, + `Let's exchange burning hot moves again soon!` + ] + }, + [TrainerType.NORMAN]: { + encounter: [ + `I'm surprised you managed to get here.\nLet's battle.`, + `I'll do everything in my power as a Gym Leader to win.\nLet's go!`, + `You better give this your all.\nIt's time to battle!` + ], + victory: [ + `I lost to you…?\nRules are rules, though.`, + `Was moving from Olivine a mistake…?`, + `I can't believe it.\nThat was a great match.` + ], + defeat: [ + `We both tried our best.\nI hope we can battle again soon.`, + `You should try challenging my kid instead.\nYou might learn something!`, + `Thank you for the excellent battle.\nBetter luck next time.` + ] + }, + [TrainerType.WINONA]: { + encounter: [ + `I've been soaring the skies looking for prey…\nAnd you're my target!`, + `No matter how our battle is, my Flying Pokémon and I will triumph with grace. Let's battle!`, + `I hope you aren't scared of heights.\nLet's ascend!` + ], + victory: [ + `You're the first Trainer I've seen with more grace than I.\nExcellently played.`, + `Oh, my Flying Pokémon have plummeted!\nVery well.`, + `Though I may have fallen, my Pokémon will continue to fly!` + ], + defeat: [ + `My Flying Pokémon and I will forever dance elegantly!`, + `I hope you enjoyed our show.\nOur graceful dance is finished.`, + `Won't you come see our elegant choreography again?` + ] + }, + [TrainerType.TATE]: { + encounter: [ + `Hehehe…\nWere you surprised to see me without my sister?`, + `I can see what you're thinking…\nYou want to battle!`, + `How can you defeat someone…\nWho knows your every move?` + ], + victory: [ + `It can't be helped…\nI miss Liza…`, + `Your bond with your Pokémon was stronger than mine.`, + `If I were with Liza, we would have won.\nWe can finish each other's thoughts!` + ], + defeat: [ + `My Pokémon and I are superior!`, + `If you can't even defeat me, you'll never be able to defeat Liza either.`, + `It's all thanks to my strict training with Liza.\nI can make myself one with Pokémon.` + ] + }, + [TrainerType.LIZA]: { + encounter: [ + `Fufufu…\nWere you surprised to see me without my brother?`, + `I can determine what you desire…\nYou want to battle, don't you?`, + `How can you defeat someone…\nWho's one with their Pokémon?` + ], + victory: [ + `It can't be helped…\nI miss Tate…`, + `Your bond with your Pokémon…\nIt's stronger than mine.`, + `If I were with Tate, we would have won.\nWe can finish each other's sentences!` + ], + defeat: [ + `My Pokémon and I are victorious.`, + `If you can't even defeat me, you'll never be able to defeat Tate either.`, + `It's all thanks to my strict training with Tate.\nI can synchronize myself with my Pokémon.` + ] + }, + [TrainerType.JUAN]: { + encounter: [ + `Now's not the time to act coy.\nLet's battle!`, + `Ahahaha, You'll be witness to my artistry with Water Pokémon!`, + `A typhoon approaches!\nWill you be able to test me?` + ], + victory: [ + `You may be a genius who can take on Wallace!`, + `I focused on elegance while you trained.\nIt's only natural that you defeated me.`, + `Ahahaha!\nVery well, You have won this time.` + ], + defeat: [ + `My Pokémon and I have sculpted an illusion of Water and come out victorious.`, + `Ahahaha, I have won, and you have lost.`, + `Shall I loan you my outfit? It may help you battle!\nAhahaha, I jest!` + ] + }, + [TrainerType.RIVAL]: { + encounter: [ + `There you are! I've been looking everywhere for you!\nDid you forget to say goodbye to your best friend? + $So you're finally pursuing your dream, huh?\nI knew you'd do it one day… + $Anyway, I'll forgive you for forgetting me, but on one condition. You have to battle me! + $You'd better give it your best! Wouldn't want your adventure to be over before it started, right?` + ], + victory: [ + `You already have three Pokémon?!\nThat's not fair at all! + $Just kidding! I lost fair and square, and now I know you'll do fine out there. + $By the way, the professor wanted me to give you some items. Hopefully they're helpful! + $Do your best like always! I believe in you!` + ] + }, + [TrainerType.RIVAL_2]: { + encounter: [ + `Oh, fancy meeting you here. Looks like you're still undefeated. Right on! + $I know what you're thinking, and no, I wasn't following you. I just happened to be in the area. + $I'm happy for you but I just want to let you know that it's OK to lose sometimes. + $We learn from our mistakes, often more than we would if we kept succeeding. + $In any case, I've been training hard for our rematch, so you'd better give it your all!` + ], + victory: [ + `I… wasn't supposed to lose that time…` + ] + }, + [TrainerType.RIVAL_3]: { + encounter: [ + `Long time no see! Still haven't lost, huh.\nYou're starting to get on my nerves. Just kidding! + $But really, I think it's about time you came home.\nYour family and friends miss you, you know. + $I know your dream means a lot to you, but the reality is you're going to lose sooner or later. + $And when you do, I'll be there for you like always.\nNow, let me show you how strong I've become!` + ], + victory: [ + `After all that… it wasn't enough…?` + ] + }, + [TrainerType.RIVAL_4]: { + encounter: [ + `It's me! You didn't forget about me again did you? + $You made it really far! I'm proud of you.\nBut it looks like it's the end of your journey. + $You've awoken something in me I never knew was there.\nIt seems like all I do now is train. + $I hardly even eat or sleep now, I just train my Pokémon all day, getting stronger every time. + $And now, I've finally reached peak performance.\nI don't think anyone could beat me now. + $And you know what? It's all because of you.\nI don't know whether to thank you or hate you. + $Prepare yourself.` + ], + victory: [ + `What…@d{64} what are you?` + ] + }, + [TrainerType.RIVAL_5]: { + encounter: [ `…` ], + victory: [ '…' ] + } +}; + +export const battleSpecDialogue = { + [BattleSpec.FINAL_BOSS]: { + encounter: `It appears the time has finally come once again.\nYou know why you have come here, do you not? + $You were drawn here, because you have been here before.\nCountless times. + $Though, perhaps it can be counted.\nTo be precise, this is in fact your 5,643,853rd cycle. + $Each cycle your mind reverts to its former state.\nEven so, somehow, remnants of your former selves remain. + $Until now you have yet to succeed, but I sense a different presence in you this time.\n + $You are the only one here, though it is as if there is… another. + $Will you finally prove a formidable challenge to me?\nThe challenge I have longed for for millenia? + $We begin.`, + firstStageWin: `I see. The presence I felt was indeed real.\nIt appears I no longer need to hold back. + $Do not disappoint me.`, + secondStageWin: `…Magnificent.` + } +}; + +export function initTrainerTypeDialogue() { + const trainerTypes = Object.keys(trainerTypeDialogue).map(t => parseInt(t) as TrainerType); + for (let trainerType of trainerTypes) { + const messages = trainerTypeDialogue[trainerType]; + const messageTypes = [ 'encounter', 'victory', 'defeat' ]; + for (let messageType of messageTypes) { + if (Array.isArray(messages)) { + if (messages[0][messageType]) + trainerConfigs[trainerType][`${messageType}Messages`] = messages[0][messageType]; + if (messages.length > 1) + trainerConfigs[trainerType][`female${messageType.slice(0, 1).toUpperCase()}${messageType.slice(1)}Messages`] = messages[1][messageType]; + } else + trainerConfigs[trainerType][`${messageType}Messages`] = messages[messageType]; + } + } +} \ No newline at end of file diff --git a/src/data/egg.ts b/src/data/egg.ts index 77ee5c153..3ee5ed752 100644 --- a/src/data/egg.ts +++ b/src/data/egg.ts @@ -1,8 +1,8 @@ -import { ModifierTier } from "../modifier/modifier-type"; +import { ModifierTier } from "../modifier/modifier-tier"; import { Type } from "./type"; import * as Utils from "../utils"; import BattleScene from "../battle-scene"; -import { Species } from "./species"; +import { Species } from "./enums/species"; import { getPokemonSpecies, speciesStarters } from "./pokemon-species"; export const EGG_SEED = 1073741824; diff --git a/src/data/enums/battler-tag-type.ts b/src/data/enums/battler-tag-type.ts new file mode 100644 index 000000000..3e5b30b62 --- /dev/null +++ b/src/data/enums/battler-tag-type.ts @@ -0,0 +1,36 @@ + +export enum BattlerTagType { + NONE = "NONE", + RECHARGING = "RECHARGING", + FLINCHED = "FLINCHED", + CONFUSED = "CONFUSED", + INFATUATED = "INFATUATED", + SEEDED = "SEEDED", + NIGHTMARE = "NIGHTMARE", + FRENZY = "FRENZY", + ENCORE = "ENCORE", + INGRAIN = "INGRAIN", + AQUA_RING = "AQUA_RING", + DROWSY = "DROWSY", + TRAPPED = "TRAPPED", + BIND = "BIND", + WRAP = "WRAP", + FIRE_SPIN = "FIRE_SPIN", + WHIRLPOOL = "WHIRLPOOL", + CLAMP = "CLAMP", + SAND_TOMB = "SAND_TOMB", + MAGMA_STORM = "MAGMA_STORM", + PROTECTED = "PROTECTED", + PERISH_SONG = "PERISH_SONG", + TRUANT = "TRUANT", + SLOW_START = "SLOW_START", + FLYING = "FLYING", + UNDERGROUND = "UNDERGROUND", + HIDDEN = "HIDDEN", + FIRE_BOOST = "FIRE_BOOST", + CRIT_BOOST = "CRIT_BOOST", + NO_CRIT = "NO_CRIT", + IGNORE_ACCURACY = "IGNORE_ACCURACY", + BYPASS_SLEEP = "BYPASS_SLEEP", + IGNORE_FLYING = "IGNORE_FLYING" +} diff --git a/src/data/enums/biome.ts b/src/data/enums/biome.ts new file mode 100644 index 000000000..7088b2e99 --- /dev/null +++ b/src/data/enums/biome.ts @@ -0,0 +1,38 @@ + +export enum Biome { + TOWN, + PLAINS, + GRASS, + TALL_GRASS, + METROPOLIS, + FOREST, + SEA, + SWAMP, + BEACH, + LAKE, + SEABED, + MOUNTAIN, + BADLANDS, + CAVE, + DESERT, + ICE_CAVE, + MEADOW, + POWER_PLANT, + VOLCANO, + GRAVEYARD, + DOJO, + FACTORY, + RUINS, + WASTELAND, + ABYSS, + SPACE, + CONSTRUCTION_SITE, + JUNGLE, + FAIRY_CAVE, + TEMPLE, + SLUM, + SNOWY_FOREST, + ISLAND = 40, + LABORATORY, + END = 50 +} diff --git a/src/data/enums/moves.ts b/src/data/enums/moves.ts new file mode 100644 index 000000000..e0e827ff2 --- /dev/null +++ b/src/data/enums/moves.ts @@ -0,0 +1,922 @@ +export enum Moves { + NONE, + POUND, + KARATE_CHOP, + DOUBLE_SLAP, + COMET_PUNCH, + MEGA_PUNCH, + PAY_DAY, + FIRE_PUNCH, + ICE_PUNCH, + THUNDER_PUNCH, + SCRATCH, + VICE_GRIP, + GUILLOTINE, + RAZOR_WIND, + SWORDS_DANCE, + CUT, + GUST, + WING_ATTACK, + WHIRLWIND, + FLY, + BIND, + SLAM, + VINE_WHIP, + STOMP, + DOUBLE_KICK, + MEGA_KICK, + JUMP_KICK, + ROLLING_KICK, + SAND_ATTACK, + HEADBUTT, + HORN_ATTACK, + FURY_ATTACK, + HORN_DRILL, + TACKLE, + BODY_SLAM, + WRAP, + TAKE_DOWN, + THRASH, + DOUBLE_EDGE, + TAIL_WHIP, + POISON_STING, + TWINEEDLE, + PIN_MISSILE, + LEER, + BITE, + GROWL, + ROAR, + SING, + SUPERSONIC, + SONIC_BOOM, + DISABLE, + ACID, + EMBER, + FLAMETHROWER, + MIST, + WATER_GUN, + HYDRO_PUMP, + SURF, + ICE_BEAM, + BLIZZARD, + PSYBEAM, + BUBBLE_BEAM, + AURORA_BEAM, + HYPER_BEAM, + PECK, + DRILL_PECK, + SUBMISSION, + LOW_KICK, + COUNTER, + SEISMIC_TOSS, + STRENGTH, + ABSORB, + MEGA_DRAIN, + LEECH_SEED, + GROWTH, + RAZOR_LEAF, + SOLAR_BEAM, + POISON_POWDER, + STUN_SPORE, + SLEEP_POWDER, + PETAL_DANCE, + STRING_SHOT, + DRAGON_RAGE, + FIRE_SPIN, + THUNDER_SHOCK, + THUNDERBOLT, + THUNDER_WAVE, + THUNDER, + ROCK_THROW, + EARTHQUAKE, + FISSURE, + DIG, + TOXIC, + CONFUSION, + PSYCHIC, + HYPNOSIS, + MEDITATE, + AGILITY, + QUICK_ATTACK, + RAGE, + TELEPORT, + NIGHT_SHADE, + MIMIC, + SCREECH, + DOUBLE_TEAM, + RECOVER, + HARDEN, + MINIMIZE, + SMOKESCREEN, + CONFUSE_RAY, + WITHDRAW, + DEFENSE_CURL, + BARRIER, + LIGHT_SCREEN, + HAZE, + REFLECT, + FOCUS_ENERGY, + BIDE, + METRONOME, + MIRROR_MOVE, + SELF_DESTRUCT, + EGG_BOMB, + LICK, + SMOG, + SLUDGE, + BONE_CLUB, + FIRE_BLAST, + WATERFALL, + CLAMP, + SWIFT, + SKULL_BASH, + SPIKE_CANNON, + CONSTRICT, + AMNESIA, + KINESIS, + SOFT_BOILED, + HIGH_JUMP_KICK, + GLARE, + DREAM_EATER, + POISON_GAS, + BARRAGE, + LEECH_LIFE, + LOVELY_KISS, + SKY_ATTACK, + TRANSFORM, + BUBBLE, + DIZZY_PUNCH, + SPORE, + FLASH, + PSYWAVE, + SPLASH, + ACID_ARMOR, + CRABHAMMER, + EXPLOSION, + FURY_SWIPES, + BONEMERANG, + REST, + ROCK_SLIDE, + HYPER_FANG, + SHARPEN, + CONVERSION, + TRI_ATTACK, + SUPER_FANG, + SLASH, + SUBSTITUTE, + STRUGGLE, + SKETCH, + TRIPLE_KICK, + THIEF, + SPIDER_WEB, + MIND_READER, + NIGHTMARE, + FLAME_WHEEL, + SNORE, + CURSE, + FLAIL, + CONVERSION_2, + AEROBLAST, + COTTON_SPORE, + REVERSAL, + SPITE, + POWDER_SNOW, + PROTECT, + MACH_PUNCH, + SCARY_FACE, + FEINT_ATTACK, + SWEET_KISS, + BELLY_DRUM, + SLUDGE_BOMB, + MUD_SLAP, + OCTAZOOKA, + SPIKES, + ZAP_CANNON, + FORESIGHT, + DESTINY_BOND, + PERISH_SONG, + ICY_WIND, + DETECT, + BONE_RUSH, + LOCK_ON, + OUTRAGE, + SANDSTORM, + GIGA_DRAIN, + ENDURE, + CHARM, + ROLLOUT, + FALSE_SWIPE, + SWAGGER, + MILK_DRINK, + SPARK, + FURY_CUTTER, + STEEL_WING, + MEAN_LOOK, + ATTRACT, + SLEEP_TALK, + HEAL_BELL, + RETURN, + PRESENT, + FRUSTRATION, + SAFEGUARD, + PAIN_SPLIT, + SACRED_FIRE, + MAGNITUDE, + DYNAMIC_PUNCH, + MEGAHORN, + DRAGON_BREATH, + BATON_PASS, + ENCORE, + PURSUIT, + RAPID_SPIN, + SWEET_SCENT, + IRON_TAIL, + METAL_CLAW, + VITAL_THROW, + MORNING_SUN, + SYNTHESIS, + MOONLIGHT, + HIDDEN_POWER, + CROSS_CHOP, + TWISTER, + RAIN_DANCE, + SUNNY_DAY, + CRUNCH, + MIRROR_COAT, + PSYCH_UP, + EXTREME_SPEED, + ANCIENT_POWER, + SHADOW_BALL, + FUTURE_SIGHT, + ROCK_SMASH, + WHIRLPOOL, + BEAT_UP, + FAKE_OUT, + UPROAR, + STOCKPILE, + SPIT_UP, + SWALLOW, + HEAT_WAVE, + HAIL, + TORMENT, + FLATTER, + WILL_O_WISP, + MEMENTO, + FACADE, + FOCUS_PUNCH, + SMELLING_SALTS, + FOLLOW_ME, + NATURE_POWER, + CHARGE, + TAUNT, + HELPING_HAND, + TRICK, + ROLE_PLAY, + WISH, + ASSIST, + INGRAIN, + SUPERPOWER, + MAGIC_COAT, + RECYCLE, + REVENGE, + BRICK_BREAK, + YAWN, + KNOCK_OFF, + ENDEAVOR, + ERUPTION, + SKILL_SWAP, + IMPRISON, + REFRESH, + GRUDGE, + SNATCH, + SECRET_POWER, + DIVE, + ARM_THRUST, + CAMOUFLAGE, + TAIL_GLOW, + LUSTER_PURGE, + MIST_BALL, + FEATHER_DANCE, + TEETER_DANCE, + BLAZE_KICK, + MUD_SPORT, + ICE_BALL, + NEEDLE_ARM, + SLACK_OFF, + HYPER_VOICE, + POISON_FANG, + CRUSH_CLAW, + BLAST_BURN, + HYDRO_CANNON, + METEOR_MASH, + ASTONISH, + WEATHER_BALL, + AROMATHERAPY, + FAKE_TEARS, + AIR_CUTTER, + OVERHEAT, + ODOR_SLEUTH, + ROCK_TOMB, + SILVER_WIND, + METAL_SOUND, + GRASS_WHISTLE, + TICKLE, + COSMIC_POWER, + WATER_SPOUT, + SIGNAL_BEAM, + SHADOW_PUNCH, + EXTRASENSORY, + SKY_UPPERCUT, + SAND_TOMB, + SHEER_COLD, + MUDDY_WATER, + BULLET_SEED, + AERIAL_ACE, + ICICLE_SPEAR, + IRON_DEFENSE, + BLOCK, + HOWL, + DRAGON_CLAW, + FRENZY_PLANT, + BULK_UP, + BOUNCE, + MUD_SHOT, + POISON_TAIL, + COVET, + VOLT_TACKLE, + MAGICAL_LEAF, + WATER_SPORT, + CALM_MIND, + LEAF_BLADE, + DRAGON_DANCE, + ROCK_BLAST, + SHOCK_WAVE, + WATER_PULSE, + DOOM_DESIRE, + PSYCHO_BOOST, + ROOST, + GRAVITY, + MIRACLE_EYE, + WAKE_UP_SLAP, + HAMMER_ARM, + GYRO_BALL, + HEALING_WISH, + BRINE, + NATURAL_GIFT, + FEINT, + PLUCK, + TAILWIND, + ACUPRESSURE, + METAL_BURST, + U_TURN, + CLOSE_COMBAT, + PAYBACK, + ASSURANCE, + EMBARGO, + FLING, + PSYCHO_SHIFT, + TRUMP_CARD, + HEAL_BLOCK, + WRING_OUT, + POWER_TRICK, + GASTRO_ACID, + LUCKY_CHANT, + ME_FIRST, + COPYCAT, + POWER_SWAP, + GUARD_SWAP, + PUNISHMENT, + LAST_RESORT, + WORRY_SEED, + SUCKER_PUNCH, + TOXIC_SPIKES, + HEART_SWAP, + AQUA_RING, + MAGNET_RISE, + FLARE_BLITZ, + FORCE_PALM, + AURA_SPHERE, + ROCK_POLISH, + POISON_JAB, + DARK_PULSE, + NIGHT_SLASH, + AQUA_TAIL, + SEED_BOMB, + AIR_SLASH, + X_SCISSOR, + BUG_BUZZ, + DRAGON_PULSE, + DRAGON_RUSH, + POWER_GEM, + DRAIN_PUNCH, + VACUUM_WAVE, + FOCUS_BLAST, + ENERGY_BALL, + BRAVE_BIRD, + EARTH_POWER, + SWITCHEROO, + GIGA_IMPACT, + NASTY_PLOT, + BULLET_PUNCH, + AVALANCHE, + ICE_SHARD, + SHADOW_CLAW, + THUNDER_FANG, + ICE_FANG, + FIRE_FANG, + SHADOW_SNEAK, + MUD_BOMB, + PSYCHO_CUT, + ZEN_HEADBUTT, + MIRROR_SHOT, + FLASH_CANNON, + ROCK_CLIMB, + DEFOG, + TRICK_ROOM, + DRACO_METEOR, + DISCHARGE, + LAVA_PLUME, + LEAF_STORM, + POWER_WHIP, + ROCK_WRECKER, + CROSS_POISON, + GUNK_SHOT, + IRON_HEAD, + MAGNET_BOMB, + STONE_EDGE, + CAPTIVATE, + STEALTH_ROCK, + GRASS_KNOT, + CHATTER, + JUDGMENT, + BUG_BITE, + CHARGE_BEAM, + WOOD_HAMMER, + AQUA_JET, + ATTACK_ORDER, + DEFEND_ORDER, + HEAL_ORDER, + HEAD_SMASH, + DOUBLE_HIT, + ROAR_OF_TIME, + SPACIAL_REND, + LUNAR_DANCE, + CRUSH_GRIP, + MAGMA_STORM, + DARK_VOID, + SEED_FLARE, + OMINOUS_WIND, + SHADOW_FORCE, + HONE_CLAWS, + WIDE_GUARD, + GUARD_SPLIT, + POWER_SPLIT, + WONDER_ROOM, + PSYSHOCK, + VENOSHOCK, + AUTOTOMIZE, + RAGE_POWDER, + TELEKINESIS, + MAGIC_ROOM, + SMACK_DOWN, + STORM_THROW, + FLAME_BURST, + SLUDGE_WAVE, + QUIVER_DANCE, + HEAVY_SLAM, + SYNCHRONOISE, + ELECTRO_BALL, + SOAK, + FLAME_CHARGE, + COIL, + LOW_SWEEP, + ACID_SPRAY, + FOUL_PLAY, + SIMPLE_BEAM, + ENTRAINMENT, + AFTER_YOU, + ROUND, + ECHOED_VOICE, + CHIP_AWAY, + CLEAR_SMOG, + STORED_POWER, + QUICK_GUARD, + ALLY_SWITCH, + SCALD, + SHELL_SMASH, + HEAL_PULSE, + HEX, + SKY_DROP, + SHIFT_GEAR, + CIRCLE_THROW, + INCINERATE, + QUASH, + ACROBATICS, + REFLECT_TYPE, + RETALIATE, + FINAL_GAMBIT, + BESTOW, + INFERNO, + WATER_PLEDGE, + FIRE_PLEDGE, + GRASS_PLEDGE, + VOLT_SWITCH, + STRUGGLE_BUG, + BULLDOZE, + FROST_BREATH, + DRAGON_TAIL, + WORK_UP, + ELECTROWEB, + WILD_CHARGE, + DRILL_RUN, + DUAL_CHOP, + HEART_STAMP, + HORN_LEECH, + SACRED_SWORD, + RAZOR_SHELL, + HEAT_CRASH, + LEAF_TORNADO, + STEAMROLLER, + COTTON_GUARD, + NIGHT_DAZE, + PSYSTRIKE, + TAIL_SLAP, + HURRICANE, + HEAD_CHARGE, + GEAR_GRIND, + SEARING_SHOT, + TECHNO_BLAST, + RELIC_SONG, + SECRET_SWORD, + GLACIATE, + BOLT_STRIKE, + BLUE_FLARE, + FIERY_DANCE, + FREEZE_SHOCK, + ICE_BURN, + SNARL, + ICICLE_CRASH, + V_CREATE, + FUSION_FLARE, + FUSION_BOLT, + FLYING_PRESS, + MAT_BLOCK, + BELCH, + ROTOTILLER, + STICKY_WEB, + FELL_STINGER, + PHANTOM_FORCE, + TRICK_OR_TREAT, + NOBLE_ROAR, + ION_DELUGE, + PARABOLIC_CHARGE, + FORESTS_CURSE, + PETAL_BLIZZARD, + FREEZE_DRY, + DISARMING_VOICE, + PARTING_SHOT, + TOPSY_TURVY, + DRAINING_KISS, + CRAFTY_SHIELD, + FLOWER_SHIELD, + GRASSY_TERRAIN, + MISTY_TERRAIN, + ELECTRIFY, + PLAY_ROUGH, + FAIRY_WIND, + MOONBLAST, + BOOMBURST, + FAIRY_LOCK, + KINGS_SHIELD, + PLAY_NICE, + CONFIDE, + DIAMOND_STORM, + STEAM_ERUPTION, + HYPERSPACE_HOLE, + WATER_SHURIKEN, + MYSTICAL_FIRE, + SPIKY_SHIELD, + AROMATIC_MIST, + EERIE_IMPULSE, + VENOM_DRENCH, + POWDER, + GEOMANCY, + MAGNETIC_FLUX, + HAPPY_HOUR, + ELECTRIC_TERRAIN, + DAZZLING_GLEAM, + CELEBRATE, + HOLD_HANDS, + BABY_DOLL_EYES, + NUZZLE, + HOLD_BACK, + INFESTATION, + POWER_UP_PUNCH, + OBLIVION_WING, + THOUSAND_ARROWS, + THOUSAND_WAVES, + LANDS_WRATH, + LIGHT_OF_RUIN, + ORIGIN_PULSE, + PRECIPICE_BLADES, + DRAGON_ASCENT, + HYPERSPACE_FURY, + BREAKNECK_BLITZ__PHYSICAL, + BREAKNECK_BLITZ__SPECIAL, + ALL_OUT_PUMMELING__PHYSICAL, + ALL_OUT_PUMMELING__SPECIAL, + SUPERSONIC_SKYSTRIKE__PHYSICAL, + SUPERSONIC_SKYSTRIKE__SPECIAL, + ACID_DOWNPOUR__PHYSICAL, + ACID_DOWNPOUR__SPECIAL, + TECTONIC_RAGE__PHYSICAL, + TECTONIC_RAGE__SPECIAL, + CONTINENTAL_CRUSH__PHYSICAL, + CONTINENTAL_CRUSH__SPECIAL, + SAVAGE_SPIN_OUT__PHYSICAL, + SAVAGE_SPIN_OUT__SPECIAL, + NEVER_ENDING_NIGHTMARE__PHYSICAL, + NEVER_ENDING_NIGHTMARE__SPECIAL, + CORKSCREW_CRASH__PHYSICAL, + CORKSCREW_CRASH__SPECIAL, + INFERNO_OVERDRIVE__PHYSICAL, + INFERNO_OVERDRIVE__SPECIAL, + HYDRO_VORTEX__PHYSICAL, + HYDRO_VORTEX__SPECIAL, + BLOOM_DOOM__PHYSICAL, + BLOOM_DOOM__SPECIAL, + GIGAVOLT_HAVOC__PHYSICAL, + GIGAVOLT_HAVOC__SPECIAL, + SHATTERED_PSYCHE__PHYSICAL, + SHATTERED_PSYCHE__SPECIAL, + SUBZERO_SLAMMER__PHYSICAL, + SUBZERO_SLAMMER__SPECIAL, + DEVASTATING_DRAKE__PHYSICAL, + DEVASTATING_DRAKE__SPECIAL, + BLACK_HOLE_ECLIPSE__PHYSICAL, + BLACK_HOLE_ECLIPSE__SPECIAL, + TWINKLE_TACKLE__PHYSICAL, + TWINKLE_TACKLE__SPECIAL, + CATASTROPIKA, + SHORE_UP, + FIRST_IMPRESSION, + BANEFUL_BUNKER, + SPIRIT_SHACKLE, + DARKEST_LARIAT, + SPARKLING_ARIA, + ICE_HAMMER, + FLORAL_HEALING, + HIGH_HORSEPOWER, + STRENGTH_SAP, + SOLAR_BLADE, + LEAFAGE, + SPOTLIGHT, + TOXIC_THREAD, + LASER_FOCUS, + GEAR_UP, + THROAT_CHOP, + POLLEN_PUFF, + ANCHOR_SHOT, + PSYCHIC_TERRAIN, + LUNGE, + FIRE_LASH, + POWER_TRIP, + BURN_UP, + SPEED_SWAP, + SMART_STRIKE, + PURIFY, + REVELATION_DANCE, + CORE_ENFORCER, + TROP_KICK, + INSTRUCT, + BEAK_BLAST, + CLANGING_SCALES, + DRAGON_HAMMER, + BRUTAL_SWING, + AURORA_VEIL, + SINISTER_ARROW_RAID, + MALICIOUS_MOONSAULT, + OCEANIC_OPERETTA, + GUARDIAN_OF_ALOLA, + SOUL_STEALING_7_STAR_STRIKE, + STOKED_SPARKSURFER, + PULVERIZING_PANCAKE, + EXTREME_EVOBOOST, + GENESIS_SUPERNOVA, + SHELL_TRAP, + FLEUR_CANNON, + PSYCHIC_FANGS, + STOMPING_TANTRUM, + SHADOW_BONE, + ACCELEROCK, + LIQUIDATION, + PRISMATIC_LASER, + SPECTRAL_THIEF, + SUNSTEEL_STRIKE, + MOONGEIST_BEAM, + TEARFUL_LOOK, + ZING_ZAP, + NATURES_MADNESS, + MULTI_ATTACK, + TEN_MILLION_VOLT_THUNDERBOLT, + MIND_BLOWN, + PLASMA_FISTS, + PHOTON_GEYSER, + LIGHT_THAT_BURNS_THE_SKY, + SEARING_SUNRAZE_SMASH, + MENACING_MOONRAZE_MAELSTROM, + LETS_SNUGGLE_FOREVER, + SPLINTERED_STORMSHARDS, + CLANGOROUS_SOULBLAZE, + ZIPPY_ZAP, + SPLISHY_SPLASH, + FLOATY_FALL, + PIKA_PAPOW, + BOUNCY_BUBBLE, + BUZZY_BUZZ, + SIZZLY_SLIDE, + GLITZY_GLOW, + BADDY_BAD, + SAPPY_SEED, + FREEZY_FROST, + SPARKLY_SWIRL, + VEEVEE_VOLLEY, + DOUBLE_IRON_BASH, + MAX_GUARD, + DYNAMAX_CANNON, + SNIPE_SHOT, + JAW_LOCK, + STUFF_CHEEKS, + NO_RETREAT, + TAR_SHOT, + MAGIC_POWDER, + DRAGON_DARTS, + TEATIME, + OCTOLOCK, + BOLT_BEAK, + FISHIOUS_REND, + COURT_CHANGE, + MAX_FLARE, + MAX_FLUTTERBY, + MAX_LIGHTNING, + MAX_STRIKE, + MAX_KNUCKLE, + MAX_PHANTASM, + MAX_HAILSTORM, + MAX_OOZE, + MAX_GEYSER, + MAX_AIRSTREAM, + MAX_STARFALL, + MAX_WYRMWIND, + MAX_MINDSTORM, + MAX_ROCKFALL, + MAX_QUAKE, + MAX_DARKNESS, + MAX_OVERGROWTH, + MAX_STEELSPIKE, + CLANGOROUS_SOUL, + BODY_PRESS, + DECORATE, + DRUM_BEATING, + SNAP_TRAP, + PYRO_BALL, + BEHEMOTH_BLADE, + BEHEMOTH_BASH, + AURA_WHEEL, + BREAKING_SWIPE, + BRANCH_POKE, + OVERDRIVE, + APPLE_ACID, + GRAV_APPLE, + SPIRIT_BREAK, + STRANGE_STEAM, + LIFE_DEW, + OBSTRUCT, + FALSE_SURRENDER, + METEOR_ASSAULT, + ETERNABEAM, + STEEL_BEAM, + EXPANDING_FORCE, + STEEL_ROLLER, + SCALE_SHOT, + METEOR_BEAM, + SHELL_SIDE_ARM, + MISTY_EXPLOSION, + GRASSY_GLIDE, + RISING_VOLTAGE, + TERRAIN_PULSE, + SKITTER_SMACK, + BURNING_JEALOUSY, + LASH_OUT, + POLTERGEIST, + CORROSIVE_GAS, + COACHING, + FLIP_TURN, + TRIPLE_AXEL, + DUAL_WINGBEAT, + SCORCHING_SANDS, + JUNGLE_HEALING, + WICKED_BLOW, + SURGING_STRIKES, + THUNDER_CAGE, + DRAGON_ENERGY, + FREEZING_GLARE, + FIERY_WRATH, + THUNDEROUS_KICK, + GLACIAL_LANCE, + ASTRAL_BARRAGE, + EERIE_SPELL, + DIRE_CLAW, + PSYSHIELD_BASH, + POWER_SHIFT, + STONE_AXE, + SPRINGTIDE_STORM, + MYSTICAL_POWER, + RAGING_FURY, + WAVE_CRASH, + CHLOROBLAST, + MOUNTAIN_GALE, + VICTORY_DANCE, + HEADLONG_RUSH, + BARB_BARRAGE, + ESPER_WING, + BITTER_MALICE, + SHELTER, + TRIPLE_ARROWS, + INFERNAL_PARADE, + CEASELESS_EDGE, + BLEAKWIND_STORM, + WILDBOLT_STORM, + SANDSEAR_STORM, + LUNAR_BLESSING, + TAKE_HEART, + TERA_BLAST, + SILK_TRAP, + AXE_KICK, + LAST_RESPECTS, + LUMINA_CRASH, + ORDER_UP, + JET_PUNCH, + SPICY_EXTRACT, + SPIN_OUT, + POPULATION_BOMB, + ICE_SPINNER, + GLAIVE_RUSH, + REVIVAL_BLESSING, + SALT_CURE, + TRIPLE_DIVE, + MORTAL_SPIN, + DOODLE, + FILLET_AWAY, + KOWTOW_CLEAVE, + FLOWER_TRICK, + TORCH_SONG, + AQUA_STEP, + RAGING_BULL, + MAKE_IT_RAIN, + PSYBLADE, + HYDRO_STEAM, + RUINATION, + COLLISION_COURSE, + ELECTRO_DRIFT, + SHED_TAIL, + CHILLY_RECEPTION, + TIDY_UP, + SNOWSCAPE, + POUNCE, + TRAILBLAZE, + CHILLING_WATER, + HYPER_DRILL, + TWIN_BEAM, + RAGE_FIST, + ARMOR_CANNON, + BITTER_BLADE, + DOUBLE_SHOCK, + GIGATON_HAMMER, + COMEUPPANCE, + AQUA_CUTTER, + BLAZING_TORQUE, + WICKED_TORQUE, + NOXIOUS_TORQUE, + COMBAT_TORQUE, + MAGICAL_TORQUE, + BLOOD_MOON, + MATCHA_GOTCHA, + SYRUP_BOMB, + IVY_CUDGEL, + ELECTRO_SHOT, + TERA_STARSTORM, + FICKLE_BEAM, + BURNING_BULWARK, + THUNDERCLAP, + MIGHTY_CLEAVE, + TACHYON_CUTTER, + HARD_PRESS, + DRAGON_CHEER, + ALLURING_VOICE, + TEMPER_FLARE, + SUPERCELL_SLAM, + PSYCHIC_NOISE, + UPPER_HAND, + MALIGNANT_CHAIN, +}; \ No newline at end of file diff --git a/src/data/species.ts b/src/data/enums/species.ts similarity index 100% rename from src/data/species.ts rename to src/data/enums/species.ts diff --git a/src/data/enums/time-of-day.ts b/src/data/enums/time-of-day.ts new file mode 100644 index 000000000..9363aa4c7 --- /dev/null +++ b/src/data/enums/time-of-day.ts @@ -0,0 +1,8 @@ + +export enum TimeOfDay { + ALL = -1, + DAWN, + DAY, + DUSK, + NIGHT +} diff --git a/src/data/enums/trainer-type.ts b/src/data/enums/trainer-type.ts new file mode 100644 index 000000000..a4db693b1 --- /dev/null +++ b/src/data/enums/trainer-type.ts @@ -0,0 +1,178 @@ + +export enum TrainerType { + UNKNOWN, + ACE_TRAINER, + ARTIST, + BACKERS, + BACKPACKER, + BAKER, + BEAUTY, + BIKER, + BLACK_BELT, + BREEDER, + CLERK, + CYCLIST, + DANCER, + DEPOT_AGENT, + DOCTOR, + FISHERMAN, + GUITARIST, + HARLEQUIN, + HIKER, + HOOLIGANS, + HOOPSTER, + INFIELDER, + JANITOR, + LINEBACKER, + MAID, + MUSICIAN, + NURSE, + NURSERY_AIDE, + OFFICER, + PARASOL_LADY, + PILOT, + POKEFAN, + PRESCHOOLER, + PSYCHIC, + RANGER, + RICH, + RICH_KID, + ROUGHNECK, + SCIENTIST, + SMASHER, + SNOW_WORKER, + STRIKER, + STUDENT, + SWIMMER, + TWINS, + VETERAN, + WAITER, + WORKER, + YOUNGSTER, + + BROCK = 200, + MISTY, + LT_SURGE, + ERIKA, + JANINE, + SABRINA, + BLAINE, + GIOVANNI, + FALKNER, + BUGSY, + WHITNEY, + MORTY, + CHUCK, + JASMINE, + PRYCE, + CLAIR, + ROXANNE, + BRAWLY, + WATTSON, + FLANNERY, + NORMAN, + WINONA, + TATE, + LIZA, + JUAN, + ROARK, + GARDENIA, + MAYLENE, + CRASHER_WAKE, + FANTINA, + BYRON, + CANDICE, + VOLKNER, + CILAN, + CHILI, + CRESS, + CHEREN, + LENORA, + ROXIE, + BURGH, + ELESA, + CLAY, + SKYLA, + BRYCEN, + DRAYDEN, + MARLON, + VIOLA, + GRANT, + KORRINA, + RAMOS, + CLEMONT, + VALERIE, + OLYMPIA, + WULFRIC, + MILO, + NESSA, + KABU, + BEA, + ALLISTER, + OPAL, + BEDE, + GORDIE, + MELONY, + PIERS, + MARNIE, + RAIHAN, + /*KATY, + BRASSIUS, + IONO, + KOFU, + LARRY, + RYME, + TULIP, + GRUSHA*/ + LORELEI = 300, + BRUNO, + AGATHA, + LANCE, + WILL, + KOGA, + KAREN, + SIDNEY, + PHOEBE, + GLACIA, + DRAKE, + AARON, + BERTHA, + FLINT, + LUCIAN, + SHAUNTAL, + MARSHAL, + GRIMSLEY, + CAITLIN, + MALVA, + SIEBOLD, + WIKSTROM, + DRASNA, + HALA, + MOLAYNE, + OLIVIA, + ACEROLA, + KAHILI, + /*RIKA, + POPPY, + LARRY_ELITE, + HASSEL*/ + BLUE = 350, + RED, + LANCE_CHAMPION, + STEVEN, + WALLACE, + CYNTHIA, + ALDER, + IRIS, + DIANTHA, + LEON, + /*GEETA, + NEMONA, + KIERAN,*/ + RIVAL = 375, + RIVAL_2, + RIVAL_3, + RIVAL_4, + RIVAL_5, + RIVAL_6 +} diff --git a/src/data/move.ts b/src/data/move.ts index 1951610ae..ba786539b 100644 --- a/src/data/move.ts +++ b/src/data/move.ts @@ -1,7 +1,9 @@ +import { Moves } from "./enums/moves"; import { ChargeAnim, MoveChargeAnim, initMoveAnim, loadMoveAnimAssets } from "./battle-anims"; import { BattleEndPhase, DamagePhase, MovePhase, NewBattlePhase, ObtainStatusEffectPhase, PokemonHealPhase, StatChangePhase, SwitchSummonPhase } from "../battle-phases"; import { BattleStat } from "./battle-stat"; -import { BattlerTagType, EncoreTag } from "./battler-tag"; +import { EncoreTag } from "./battler-tags"; +import { BattlerTagType } from "./enums/battler-tag-type"; import { getPokemonMessage } from "../messages"; import Pokemon, { AttackMoveResult, HitResult, MoveResult, PlayerPokemon, PokemonMove, TurnMove } from "../pokemon"; import { StatusEffect, getStatusEffectDescriptor } from "./status-effect"; @@ -324,929 +326,6 @@ export class SelfStatusMove extends Move { } } -export enum Moves { - NONE, - POUND, - KARATE_CHOP, - DOUBLE_SLAP, - COMET_PUNCH, - MEGA_PUNCH, - PAY_DAY, - FIRE_PUNCH, - ICE_PUNCH, - THUNDER_PUNCH, - SCRATCH, - VICE_GRIP, - GUILLOTINE, - RAZOR_WIND, - SWORDS_DANCE, - CUT, - GUST, - WING_ATTACK, - WHIRLWIND, - FLY, - BIND, - SLAM, - VINE_WHIP, - STOMP, - DOUBLE_KICK, - MEGA_KICK, - JUMP_KICK, - ROLLING_KICK, - SAND_ATTACK, - HEADBUTT, - HORN_ATTACK, - FURY_ATTACK, - HORN_DRILL, - TACKLE, - BODY_SLAM, - WRAP, - TAKE_DOWN, - THRASH, - DOUBLE_EDGE, - TAIL_WHIP, - POISON_STING, - TWINEEDLE, - PIN_MISSILE, - LEER, - BITE, - GROWL, - ROAR, - SING, - SUPERSONIC, - SONIC_BOOM, - DISABLE, - ACID, - EMBER, - FLAMETHROWER, - MIST, - WATER_GUN, - HYDRO_PUMP, - SURF, - ICE_BEAM, - BLIZZARD, - PSYBEAM, - BUBBLE_BEAM, - AURORA_BEAM, - HYPER_BEAM, - PECK, - DRILL_PECK, - SUBMISSION, - LOW_KICK, - COUNTER, - SEISMIC_TOSS, - STRENGTH, - ABSORB, - MEGA_DRAIN, - LEECH_SEED, - GROWTH, - RAZOR_LEAF, - SOLAR_BEAM, - POISON_POWDER, - STUN_SPORE, - SLEEP_POWDER, - PETAL_DANCE, - STRING_SHOT, - DRAGON_RAGE, - FIRE_SPIN, - THUNDER_SHOCK, - THUNDERBOLT, - THUNDER_WAVE, - THUNDER, - ROCK_THROW, - EARTHQUAKE, - FISSURE, - DIG, - TOXIC, - CONFUSION, - PSYCHIC, - HYPNOSIS, - MEDITATE, - AGILITY, - QUICK_ATTACK, - RAGE, - TELEPORT, - NIGHT_SHADE, - MIMIC, - SCREECH, - DOUBLE_TEAM, - RECOVER, - HARDEN, - MINIMIZE, - SMOKESCREEN, - CONFUSE_RAY, - WITHDRAW, - DEFENSE_CURL, - BARRIER, - LIGHT_SCREEN, - HAZE, - REFLECT, - FOCUS_ENERGY, - BIDE, - METRONOME, - MIRROR_MOVE, - SELF_DESTRUCT, - EGG_BOMB, - LICK, - SMOG, - SLUDGE, - BONE_CLUB, - FIRE_BLAST, - WATERFALL, - CLAMP, - SWIFT, - SKULL_BASH, - SPIKE_CANNON, - CONSTRICT, - AMNESIA, - KINESIS, - SOFT_BOILED, - HIGH_JUMP_KICK, - GLARE, - DREAM_EATER, - POISON_GAS, - BARRAGE, - LEECH_LIFE, - LOVELY_KISS, - SKY_ATTACK, - TRANSFORM, - BUBBLE, - DIZZY_PUNCH, - SPORE, - FLASH, - PSYWAVE, - SPLASH, - ACID_ARMOR, - CRABHAMMER, - EXPLOSION, - FURY_SWIPES, - BONEMERANG, - REST, - ROCK_SLIDE, - HYPER_FANG, - SHARPEN, - CONVERSION, - TRI_ATTACK, - SUPER_FANG, - SLASH, - SUBSTITUTE, - STRUGGLE, - SKETCH, - TRIPLE_KICK, - THIEF, - SPIDER_WEB, - MIND_READER, - NIGHTMARE, - FLAME_WHEEL, - SNORE, - CURSE, - FLAIL, - CONVERSION_2, - AEROBLAST, - COTTON_SPORE, - REVERSAL, - SPITE, - POWDER_SNOW, - PROTECT, - MACH_PUNCH, - SCARY_FACE, - FEINT_ATTACK, - SWEET_KISS, - BELLY_DRUM, - SLUDGE_BOMB, - MUD_SLAP, - OCTAZOOKA, - SPIKES, - ZAP_CANNON, - FORESIGHT, - DESTINY_BOND, - PERISH_SONG, - ICY_WIND, - DETECT, - BONE_RUSH, - LOCK_ON, - OUTRAGE, - SANDSTORM, - GIGA_DRAIN, - ENDURE, - CHARM, - ROLLOUT, - FALSE_SWIPE, - SWAGGER, - MILK_DRINK, - SPARK, - FURY_CUTTER, - STEEL_WING, - MEAN_LOOK, - ATTRACT, - SLEEP_TALK, - HEAL_BELL, - RETURN, - PRESENT, - FRUSTRATION, - SAFEGUARD, - PAIN_SPLIT, - SACRED_FIRE, - MAGNITUDE, - DYNAMIC_PUNCH, - MEGAHORN, - DRAGON_BREATH, - BATON_PASS, - ENCORE, - PURSUIT, - RAPID_SPIN, - SWEET_SCENT, - IRON_TAIL, - METAL_CLAW, - VITAL_THROW, - MORNING_SUN, - SYNTHESIS, - MOONLIGHT, - HIDDEN_POWER, - CROSS_CHOP, - TWISTER, - RAIN_DANCE, - SUNNY_DAY, - CRUNCH, - MIRROR_COAT, - PSYCH_UP, - EXTREME_SPEED, - ANCIENT_POWER, - SHADOW_BALL, - FUTURE_SIGHT, - ROCK_SMASH, - WHIRLPOOL, - BEAT_UP, - FAKE_OUT, - UPROAR, - STOCKPILE, - SPIT_UP, - SWALLOW, - HEAT_WAVE, - HAIL, - TORMENT, - FLATTER, - WILL_O_WISP, - MEMENTO, - FACADE, - FOCUS_PUNCH, - SMELLING_SALTS, - FOLLOW_ME, - NATURE_POWER, - CHARGE, - TAUNT, - HELPING_HAND, - TRICK, - ROLE_PLAY, - WISH, - ASSIST, - INGRAIN, - SUPERPOWER, - MAGIC_COAT, - RECYCLE, - REVENGE, - BRICK_BREAK, - YAWN, - KNOCK_OFF, - ENDEAVOR, - ERUPTION, - SKILL_SWAP, - IMPRISON, - REFRESH, - GRUDGE, - SNATCH, - SECRET_POWER, - DIVE, - ARM_THRUST, - CAMOUFLAGE, - TAIL_GLOW, - LUSTER_PURGE, - MIST_BALL, - FEATHER_DANCE, - TEETER_DANCE, - BLAZE_KICK, - MUD_SPORT, - ICE_BALL, - NEEDLE_ARM, - SLACK_OFF, - HYPER_VOICE, - POISON_FANG, - CRUSH_CLAW, - BLAST_BURN, - HYDRO_CANNON, - METEOR_MASH, - ASTONISH, - WEATHER_BALL, - AROMATHERAPY, - FAKE_TEARS, - AIR_CUTTER, - OVERHEAT, - ODOR_SLEUTH, - ROCK_TOMB, - SILVER_WIND, - METAL_SOUND, - GRASS_WHISTLE, - TICKLE, - COSMIC_POWER, - WATER_SPOUT, - SIGNAL_BEAM, - SHADOW_PUNCH, - EXTRASENSORY, - SKY_UPPERCUT, - SAND_TOMB, - SHEER_COLD, - MUDDY_WATER, - BULLET_SEED, - AERIAL_ACE, - ICICLE_SPEAR, - IRON_DEFENSE, - BLOCK, - HOWL, - DRAGON_CLAW, - FRENZY_PLANT, - BULK_UP, - BOUNCE, - MUD_SHOT, - POISON_TAIL, - COVET, - VOLT_TACKLE, - MAGICAL_LEAF, - WATER_SPORT, - CALM_MIND, - LEAF_BLADE, - DRAGON_DANCE, - ROCK_BLAST, - SHOCK_WAVE, - WATER_PULSE, - DOOM_DESIRE, - PSYCHO_BOOST, - ROOST, - GRAVITY, - MIRACLE_EYE, - WAKE_UP_SLAP, - HAMMER_ARM, - GYRO_BALL, - HEALING_WISH, - BRINE, - NATURAL_GIFT, - FEINT, - PLUCK, - TAILWIND, - ACUPRESSURE, - METAL_BURST, - U_TURN, - CLOSE_COMBAT, - PAYBACK, - ASSURANCE, - EMBARGO, - FLING, - PSYCHO_SHIFT, - TRUMP_CARD, - HEAL_BLOCK, - WRING_OUT, - POWER_TRICK, - GASTRO_ACID, - LUCKY_CHANT, - ME_FIRST, - COPYCAT, - POWER_SWAP, - GUARD_SWAP, - PUNISHMENT, - LAST_RESORT, - WORRY_SEED, - SUCKER_PUNCH, - TOXIC_SPIKES, - HEART_SWAP, - AQUA_RING, - MAGNET_RISE, - FLARE_BLITZ, - FORCE_PALM, - AURA_SPHERE, - ROCK_POLISH, - POISON_JAB, - DARK_PULSE, - NIGHT_SLASH, - AQUA_TAIL, - SEED_BOMB, - AIR_SLASH, - X_SCISSOR, - BUG_BUZZ, - DRAGON_PULSE, - DRAGON_RUSH, - POWER_GEM, - DRAIN_PUNCH, - VACUUM_WAVE, - FOCUS_BLAST, - ENERGY_BALL, - BRAVE_BIRD, - EARTH_POWER, - SWITCHEROO, - GIGA_IMPACT, - NASTY_PLOT, - BULLET_PUNCH, - AVALANCHE, - ICE_SHARD, - SHADOW_CLAW, - THUNDER_FANG, - ICE_FANG, - FIRE_FANG, - SHADOW_SNEAK, - MUD_BOMB, - PSYCHO_CUT, - ZEN_HEADBUTT, - MIRROR_SHOT, - FLASH_CANNON, - ROCK_CLIMB, - DEFOG, - TRICK_ROOM, - DRACO_METEOR, - DISCHARGE, - LAVA_PLUME, - LEAF_STORM, - POWER_WHIP, - ROCK_WRECKER, - CROSS_POISON, - GUNK_SHOT, - IRON_HEAD, - MAGNET_BOMB, - STONE_EDGE, - CAPTIVATE, - STEALTH_ROCK, - GRASS_KNOT, - CHATTER, - JUDGMENT, - BUG_BITE, - CHARGE_BEAM, - WOOD_HAMMER, - AQUA_JET, - ATTACK_ORDER, - DEFEND_ORDER, - HEAL_ORDER, - HEAD_SMASH, - DOUBLE_HIT, - ROAR_OF_TIME, - SPACIAL_REND, - LUNAR_DANCE, - CRUSH_GRIP, - MAGMA_STORM, - DARK_VOID, - SEED_FLARE, - OMINOUS_WIND, - SHADOW_FORCE, - HONE_CLAWS, - WIDE_GUARD, - GUARD_SPLIT, - POWER_SPLIT, - WONDER_ROOM, - PSYSHOCK, - VENOSHOCK, - AUTOTOMIZE, - RAGE_POWDER, - TELEKINESIS, - MAGIC_ROOM, - SMACK_DOWN, - STORM_THROW, - FLAME_BURST, - SLUDGE_WAVE, - QUIVER_DANCE, - HEAVY_SLAM, - SYNCHRONOISE, - ELECTRO_BALL, - SOAK, - FLAME_CHARGE, - COIL, - LOW_SWEEP, - ACID_SPRAY, - FOUL_PLAY, - SIMPLE_BEAM, - ENTRAINMENT, - AFTER_YOU, - ROUND, - ECHOED_VOICE, - CHIP_AWAY, - CLEAR_SMOG, - STORED_POWER, - QUICK_GUARD, - ALLY_SWITCH, - SCALD, - SHELL_SMASH, - HEAL_PULSE, - HEX, - SKY_DROP, - SHIFT_GEAR, - CIRCLE_THROW, - INCINERATE, - QUASH, - ACROBATICS, - REFLECT_TYPE, - RETALIATE, - FINAL_GAMBIT, - BESTOW, - INFERNO, - WATER_PLEDGE, - FIRE_PLEDGE, - GRASS_PLEDGE, - VOLT_SWITCH, - STRUGGLE_BUG, - BULLDOZE, - FROST_BREATH, - DRAGON_TAIL, - WORK_UP, - ELECTROWEB, - WILD_CHARGE, - DRILL_RUN, - DUAL_CHOP, - HEART_STAMP, - HORN_LEECH, - SACRED_SWORD, - RAZOR_SHELL, - HEAT_CRASH, - LEAF_TORNADO, - STEAMROLLER, - COTTON_GUARD, - NIGHT_DAZE, - PSYSTRIKE, - TAIL_SLAP, - HURRICANE, - HEAD_CHARGE, - GEAR_GRIND, - SEARING_SHOT, - TECHNO_BLAST, - RELIC_SONG, - SECRET_SWORD, - GLACIATE, - BOLT_STRIKE, - BLUE_FLARE, - FIERY_DANCE, - FREEZE_SHOCK, - ICE_BURN, - SNARL, - ICICLE_CRASH, - V_CREATE, - FUSION_FLARE, - FUSION_BOLT, - FLYING_PRESS, - MAT_BLOCK, - BELCH, - ROTOTILLER, - STICKY_WEB, - FELL_STINGER, - PHANTOM_FORCE, - TRICK_OR_TREAT, - NOBLE_ROAR, - ION_DELUGE, - PARABOLIC_CHARGE, - FORESTS_CURSE, - PETAL_BLIZZARD, - FREEZE_DRY, - DISARMING_VOICE, - PARTING_SHOT, - TOPSY_TURVY, - DRAINING_KISS, - CRAFTY_SHIELD, - FLOWER_SHIELD, - GRASSY_TERRAIN, - MISTY_TERRAIN, - ELECTRIFY, - PLAY_ROUGH, - FAIRY_WIND, - MOONBLAST, - BOOMBURST, - FAIRY_LOCK, - KINGS_SHIELD, - PLAY_NICE, - CONFIDE, - DIAMOND_STORM, - STEAM_ERUPTION, - HYPERSPACE_HOLE, - WATER_SHURIKEN, - MYSTICAL_FIRE, - SPIKY_SHIELD, - AROMATIC_MIST, - EERIE_IMPULSE, - VENOM_DRENCH, - POWDER, - GEOMANCY, - MAGNETIC_FLUX, - HAPPY_HOUR, - ELECTRIC_TERRAIN, - DAZZLING_GLEAM, - CELEBRATE, - HOLD_HANDS, - BABY_DOLL_EYES, - NUZZLE, - HOLD_BACK, - INFESTATION, - POWER_UP_PUNCH, - OBLIVION_WING, - THOUSAND_ARROWS, - THOUSAND_WAVES, - LANDS_WRATH, - LIGHT_OF_RUIN, - ORIGIN_PULSE, - PRECIPICE_BLADES, - DRAGON_ASCENT, - HYPERSPACE_FURY, - BREAKNECK_BLITZ__PHYSICAL, - BREAKNECK_BLITZ__SPECIAL, - ALL_OUT_PUMMELING__PHYSICAL, - ALL_OUT_PUMMELING__SPECIAL, - SUPERSONIC_SKYSTRIKE__PHYSICAL, - SUPERSONIC_SKYSTRIKE__SPECIAL, - ACID_DOWNPOUR__PHYSICAL, - ACID_DOWNPOUR__SPECIAL, - TECTONIC_RAGE__PHYSICAL, - TECTONIC_RAGE__SPECIAL, - CONTINENTAL_CRUSH__PHYSICAL, - CONTINENTAL_CRUSH__SPECIAL, - SAVAGE_SPIN_OUT__PHYSICAL, - SAVAGE_SPIN_OUT__SPECIAL, - NEVER_ENDING_NIGHTMARE__PHYSICAL, - NEVER_ENDING_NIGHTMARE__SPECIAL, - CORKSCREW_CRASH__PHYSICAL, - CORKSCREW_CRASH__SPECIAL, - INFERNO_OVERDRIVE__PHYSICAL, - INFERNO_OVERDRIVE__SPECIAL, - HYDRO_VORTEX__PHYSICAL, - HYDRO_VORTEX__SPECIAL, - BLOOM_DOOM__PHYSICAL, - BLOOM_DOOM__SPECIAL, - GIGAVOLT_HAVOC__PHYSICAL, - GIGAVOLT_HAVOC__SPECIAL, - SHATTERED_PSYCHE__PHYSICAL, - SHATTERED_PSYCHE__SPECIAL, - SUBZERO_SLAMMER__PHYSICAL, - SUBZERO_SLAMMER__SPECIAL, - DEVASTATING_DRAKE__PHYSICAL, - DEVASTATING_DRAKE__SPECIAL, - BLACK_HOLE_ECLIPSE__PHYSICAL, - BLACK_HOLE_ECLIPSE__SPECIAL, - TWINKLE_TACKLE__PHYSICAL, - TWINKLE_TACKLE__SPECIAL, - CATASTROPIKA, - SHORE_UP, - FIRST_IMPRESSION, - BANEFUL_BUNKER, - SPIRIT_SHACKLE, - DARKEST_LARIAT, - SPARKLING_ARIA, - ICE_HAMMER, - FLORAL_HEALING, - HIGH_HORSEPOWER, - STRENGTH_SAP, - SOLAR_BLADE, - LEAFAGE, - SPOTLIGHT, - TOXIC_THREAD, - LASER_FOCUS, - GEAR_UP, - THROAT_CHOP, - POLLEN_PUFF, - ANCHOR_SHOT, - PSYCHIC_TERRAIN, - LUNGE, - FIRE_LASH, - POWER_TRIP, - BURN_UP, - SPEED_SWAP, - SMART_STRIKE, - PURIFY, - REVELATION_DANCE, - CORE_ENFORCER, - TROP_KICK, - INSTRUCT, - BEAK_BLAST, - CLANGING_SCALES, - DRAGON_HAMMER, - BRUTAL_SWING, - AURORA_VEIL, - SINISTER_ARROW_RAID, - MALICIOUS_MOONSAULT, - OCEANIC_OPERETTA, - GUARDIAN_OF_ALOLA, - SOUL_STEALING_7_STAR_STRIKE, - STOKED_SPARKSURFER, - PULVERIZING_PANCAKE, - EXTREME_EVOBOOST, - GENESIS_SUPERNOVA, - SHELL_TRAP, - FLEUR_CANNON, - PSYCHIC_FANGS, - STOMPING_TANTRUM, - SHADOW_BONE, - ACCELEROCK, - LIQUIDATION, - PRISMATIC_LASER, - SPECTRAL_THIEF, - SUNSTEEL_STRIKE, - MOONGEIST_BEAM, - TEARFUL_LOOK, - ZING_ZAP, - NATURES_MADNESS, - MULTI_ATTACK, - TEN_MILLION_VOLT_THUNDERBOLT, - MIND_BLOWN, - PLASMA_FISTS, - PHOTON_GEYSER, - LIGHT_THAT_BURNS_THE_SKY, - SEARING_SUNRAZE_SMASH, - MENACING_MOONRAZE_MAELSTROM, - LETS_SNUGGLE_FOREVER, - SPLINTERED_STORMSHARDS, - CLANGOROUS_SOULBLAZE, - ZIPPY_ZAP, - SPLISHY_SPLASH, - FLOATY_FALL, - PIKA_PAPOW, - BOUNCY_BUBBLE, - BUZZY_BUZZ, - SIZZLY_SLIDE, - GLITZY_GLOW, - BADDY_BAD, - SAPPY_SEED, - FREEZY_FROST, - SPARKLY_SWIRL, - VEEVEE_VOLLEY, - DOUBLE_IRON_BASH, - MAX_GUARD, - DYNAMAX_CANNON, - SNIPE_SHOT, - JAW_LOCK, - STUFF_CHEEKS, - NO_RETREAT, - TAR_SHOT, - MAGIC_POWDER, - DRAGON_DARTS, - TEATIME, - OCTOLOCK, - BOLT_BEAK, - FISHIOUS_REND, - COURT_CHANGE, - MAX_FLARE, - MAX_FLUTTERBY, - MAX_LIGHTNING, - MAX_STRIKE, - MAX_KNUCKLE, - MAX_PHANTASM, - MAX_HAILSTORM, - MAX_OOZE, - MAX_GEYSER, - MAX_AIRSTREAM, - MAX_STARFALL, - MAX_WYRMWIND, - MAX_MINDSTORM, - MAX_ROCKFALL, - MAX_QUAKE, - MAX_DARKNESS, - MAX_OVERGROWTH, - MAX_STEELSPIKE, - CLANGOROUS_SOUL, - BODY_PRESS, - DECORATE, - DRUM_BEATING, - SNAP_TRAP, - PYRO_BALL, - BEHEMOTH_BLADE, - BEHEMOTH_BASH, - AURA_WHEEL, - BREAKING_SWIPE, - BRANCH_POKE, - OVERDRIVE, - APPLE_ACID, - GRAV_APPLE, - SPIRIT_BREAK, - STRANGE_STEAM, - LIFE_DEW, - OBSTRUCT, - FALSE_SURRENDER, - METEOR_ASSAULT, - ETERNABEAM, - STEEL_BEAM, - EXPANDING_FORCE, - STEEL_ROLLER, - SCALE_SHOT, - METEOR_BEAM, - SHELL_SIDE_ARM, - MISTY_EXPLOSION, - GRASSY_GLIDE, - RISING_VOLTAGE, - TERRAIN_PULSE, - SKITTER_SMACK, - BURNING_JEALOUSY, - LASH_OUT, - POLTERGEIST, - CORROSIVE_GAS, - COACHING, - FLIP_TURN, - TRIPLE_AXEL, - DUAL_WINGBEAT, - SCORCHING_SANDS, - JUNGLE_HEALING, - WICKED_BLOW, - SURGING_STRIKES, - THUNDER_CAGE, - DRAGON_ENERGY, - FREEZING_GLARE, - FIERY_WRATH, - THUNDEROUS_KICK, - GLACIAL_LANCE, - ASTRAL_BARRAGE, - EERIE_SPELL, - DIRE_CLAW, - PSYSHIELD_BASH, - POWER_SHIFT, - STONE_AXE, - SPRINGTIDE_STORM, - MYSTICAL_POWER, - RAGING_FURY, - WAVE_CRASH, - CHLOROBLAST, - MOUNTAIN_GALE, - VICTORY_DANCE, - HEADLONG_RUSH, - BARB_BARRAGE, - ESPER_WING, - BITTER_MALICE, - SHELTER, - TRIPLE_ARROWS, - INFERNAL_PARADE, - CEASELESS_EDGE, - BLEAKWIND_STORM, - WILDBOLT_STORM, - SANDSEAR_STORM, - LUNAR_BLESSING, - TAKE_HEART, - TERA_BLAST, - SILK_TRAP, - AXE_KICK, - LAST_RESPECTS, - LUMINA_CRASH, - ORDER_UP, - JET_PUNCH, - SPICY_EXTRACT, - SPIN_OUT, - POPULATION_BOMB, - ICE_SPINNER, - GLAIVE_RUSH, - REVIVAL_BLESSING, - SALT_CURE, - TRIPLE_DIVE, - MORTAL_SPIN, - DOODLE, - FILLET_AWAY, - KOWTOW_CLEAVE, - FLOWER_TRICK, - TORCH_SONG, - AQUA_STEP, - RAGING_BULL, - MAKE_IT_RAIN, - PSYBLADE, - HYDRO_STEAM, - RUINATION, - COLLISION_COURSE, - ELECTRO_DRIFT, - SHED_TAIL, - CHILLY_RECEPTION, - TIDY_UP, - SNOWSCAPE, - POUNCE, - TRAILBLAZE, - CHILLING_WATER, - HYPER_DRILL, - TWIN_BEAM, - RAGE_FIST, - ARMOR_CANNON, - BITTER_BLADE, - DOUBLE_SHOCK, - GIGATON_HAMMER, - COMEUPPANCE, - AQUA_CUTTER, - BLAZING_TORQUE, - WICKED_TORQUE, - NOXIOUS_TORQUE, - COMBAT_TORQUE, - MAGICAL_TORQUE, - BLOOD_MOON, - MATCHA_GOTCHA, - SYRUP_BOMB, - IVY_CUDGEL, - ELECTRO_SHOT, - TERA_STARSTORM, - FICKLE_BEAM, - BURNING_BULWARK, - THUNDERCLAP, - MIGHTY_CLEAVE, - TACHYON_CUTTER, - HARD_PRESS, - DRAGON_CHEER, - ALLURING_VOICE, - TEMPER_FLARE, - SUPERCELL_SLAM, - PSYCHIC_NOISE, - UPPER_HAND, - MALIGNANT_CHAIN, -}; - export abstract class MoveAttr { public selfTarget: boolean; @@ -2913,6 +1992,19 @@ export class TransformAttr extends MoveEffectAttr { } } +export class DiscourageFrequentUseAttr extends MoveAttr { + getUserBenefitScore(user: Pokemon, target: Pokemon, move: Move): integer { + const lastMoves = user.getLastXMoves(4); + console.log(lastMoves); + for (let m = 0; m < lastMoves.length; m++) { + if (lastMoves[m].move === move.id) + return (4 - (m + 1)) * -10; + } + + return 0; + } +} + const failOnGravityCondition: MoveConditionFunc = (user, target, move) => !user.scene.arena.getTag(ArenaTagType.GRAVITY); export type MoveAttrFilter = (attr: MoveAttr) => boolean; @@ -4652,6 +3744,7 @@ export function initMoves() { .attr(ProtectAttr), new AttackMove(Moves.DYNAMAX_CANNON, "Dynamax Cannon", Type.DRAGON, MoveCategory.SPECIAL, 100, 100, 5, -1, "The user unleashes a strong beam from its core. This move deals twice the damage if the target is over level 200.", -1, 0, 8) .attr(MovePowerMultiplierAttr, (user, target, move) => target.level > 200 ? 2 : 1) + .attr(DiscourageFrequentUseAttr) .ignoresVirtual(), new AttackMove(Moves.SNIPE_SHOT, "Snipe Shot (N)", Type.WATER, MoveCategory.SPECIAL, 80, 100, 15, -1, "The user ignores the effects of opposing Pokémon's moves and Abilities that draw in moves, allowing this move to hit the chosen target.", -1, 0, 8), new AttackMove(Moves.JAW_LOCK, "Jaw Lock (N)", Type.DARK, MoveCategory.PHYSICAL, 80, 100, 10, -1, "This move prevents the user and the target from switching out until either of them faints. The effect goes away if either of the Pokémon leaves the field.", -1, 0, 8) diff --git a/src/data/pokemon-evolutions.ts b/src/data/pokemon-evolutions.ts index 715eccfd2..c10f0fbb8 100644 --- a/src/data/pokemon-evolutions.ts +++ b/src/data/pokemon-evolutions.ts @@ -1,17 +1,17 @@ import { Gender } from "./gender"; import { AttackTypeBoosterModifier, FlinchChanceModifier } from "../modifier/modifier"; import { AttackTypeBoosterModifierType } from "../modifier/modifier-type"; -import { Moves } from "./move"; +import { Moves } from "./enums/moves"; import { PokeballType } from "./pokeball"; import Pokemon from "../pokemon"; import { Stat } from "./pokemon-stat"; -import { Species } from "./species"; +import { Species } from "./enums/species"; import { Type } from "./type"; import * as Utils from "../utils"; import { SpeciesFormKey } from "./pokemon-species"; import { WeatherType } from "./weather"; -import { Biome } from "./biome"; -import { TimeOfDay } from "../arena"; +import { Biome } from "./enums/biome"; +import { TimeOfDay } from "./enums/time-of-day"; import { Nature } from "./nature"; export enum SpeciesWildEvolutionDelay { diff --git a/src/data/pokemon-forms.ts b/src/data/pokemon-forms.ts index 7baaf94f9..f8b9a9768 100644 --- a/src/data/pokemon-forms.ts +++ b/src/data/pokemon-forms.ts @@ -1,9 +1,9 @@ -import { TimeOfDay } from "../arena"; +import { TimeOfDay } from "./enums/time-of-day"; import { PokemonFormChangeItemModifier } from "../modifier/modifier"; import Pokemon from "../pokemon"; -import { Moves } from "./move"; +import { Moves } from "./enums/moves"; import { SpeciesFormKey } from "./pokemon-species"; -import { Species } from "./species"; +import { Species } from "./enums/species"; import { StatusEffect } from "./status-effect"; export enum FormChangeItem { @@ -138,6 +138,12 @@ export abstract class SpeciesFormChangeTrigger { } } +export class SpeciesFormChangeManualTrigger extends SpeciesFormChangeTrigger { + canChange(pokemon: Pokemon): boolean { + return true; + } +} + export class SpeciesFormChangeCompoundTrigger { public triggers: SpeciesFormChangeTrigger[]; @@ -442,6 +448,9 @@ export const pokemonFormChanges: PokemonFormChanges = { [Species.DIANCIE]: [ new SpeciesFormChange(Species.DIANCIE, '', SpeciesFormKey.MEGA, new SpeciesFormChangeItemTrigger(FormChangeItem.DIANCITE)) ], + [Species.ETERNATUS]: [ + new SpeciesFormChange(Species.ETERNATUS, '', 'eternamax', new SpeciesFormChangeManualTrigger()) + ], [Species.ENAMORUS]: [ new SpeciesFormChange(Species.ENAMORUS, SpeciesFormKey.INCARNATE, SpeciesFormKey.THERIAN, new SpeciesFormChangeItemTrigger(FormChangeItem.REVEAL_GLASS)) ] diff --git a/src/data/pokemon-level-moves.ts b/src/data/pokemon-level-moves.ts index 70c1e1e5b..105c03847 100644 --- a/src/data/pokemon-level-moves.ts +++ b/src/data/pokemon-level-moves.ts @@ -1,5 +1,5 @@ -import { Moves } from "./move"; -import { Species } from "./species"; +import { Moves } from "./enums/moves"; +import { Species } from "./enums/species"; export type LevelMoves = (integer | Moves)[][]; diff --git a/src/data/pokemon-species.ts b/src/data/pokemon-species.ts index 6ec7477fa..534ba555c 100644 --- a/src/data/pokemon-species.ts +++ b/src/data/pokemon-species.ts @@ -2,10 +2,10 @@ import { Abilities } from './ability'; import BattleScene, { AnySound } from '../battle-scene'; import { GrowthRate } from './exp'; import { SpeciesWildEvolutionDelay, pokemonEvolutions, pokemonPrevolutions } from './pokemon-evolutions'; -import { Species } from './species'; +import { Species } from './enums/species'; import { Type } from './type'; import { LevelMoves, pokemonFormLevelMoves as pokemonSpeciesFormLevelMoves, pokemonSpeciesLevelMoves } from './pokemon-level-moves'; -import { uncatchableSpecies } from './biome'; +import { uncatchableSpecies } from './biomes'; import * as Utils from '../utils'; export enum Region { diff --git a/src/data/tms.ts b/src/data/tms.ts index 65496eb62..fde349180 100644 --- a/src/data/tms.ts +++ b/src/data/tms.ts @@ -1,6 +1,6 @@ -import { ModifierTier } from "../modifier/modifier-type"; -import { Moves } from "./move"; -import { Species } from "./species"; +import { ModifierTier } from "../modifier/modifier-tier"; +import { Moves } from "./enums/moves"; +import { Species } from "./enums/species"; interface TmSpecies { [key: integer]: Array> diff --git a/src/data/trainer-type.ts b/src/data/trainer-config.ts similarity index 84% rename from src/data/trainer-type.ts rename to src/data/trainer-config.ts index 745b1d3eb..3a0cbb5c5 100644 --- a/src/data/trainer-type.ts +++ b/src/data/trainer-config.ts @@ -2,194 +2,15 @@ import BattleScene, { startingWave } from "../battle-scene"; import { ModifierTypeFunc, modifierTypes } from "../modifier/modifier-type"; import { EnemyPokemon } from "../pokemon"; import * as Utils from "../utils"; -import { Moves } from "./move"; +import { TrainerType } from "./enums/trainer-type"; +import { Moves } from "./enums/moves"; import { PokeballType } from "./pokeball"; import { pokemonEvolutions, pokemonPrevolutions } from "./pokemon-evolutions"; import PokemonSpecies, { PokemonSpeciesFilter, getPokemonSpecies } from "./pokemon-species"; -import { Species } from "./species"; +import { Species } from "./enums/species"; import { tmSpecies } from "./tms"; import { Type } from "./type"; - -export enum TrainerType { - UNKNOWN, - ACE_TRAINER, - ARTIST, - BACKERS, - BACKPACKER, - BAKER, - BEAUTY, - BIKER, - BLACK_BELT, - BREEDER, - CLERK, - CYCLIST, - DANCER, - DEPOT_AGENT, - DOCTOR, - FISHERMAN, - GUITARIST, - HARLEQUIN, - HIKER, - HOOLIGANS, - HOOPSTER, - INFIELDER, - JANITOR, - LINEBACKER, - MAID, - MUSICIAN, - NURSE, - NURSERY_AIDE, - OFFICER, - PARASOL_LADY, - PILOT, - POKEFAN, - PRESCHOOLER, - PSYCHIC, - RANGER, - RICH, - RICH_KID, - ROUGHNECK, - SCIENTIST, - SMASHER, - SNOW_WORKER, - STRIKER, - STUDENT, - SWIMMER, - TWINS, - VETERAN, - WAITER, - WORKER, - YOUNGSTER, - - BROCK = 200, - MISTY, - LT_SURGE, - ERIKA, - JANINE, - SABRINA, - BLAINE, - GIOVANNI, - FALKNER, - BUGSY, - WHITNEY, - MORTY, - CHUCK, - JASMINE, - PRYCE, - CLAIR, - ROXANNE, - BRAWLY, - WATTSON, - FLANNERY, - NORMAN, - WINONA, - TATE, - LIZA, - JUAN, - ROARK, - GARDENIA, - MAYLENE, - CRASHER_WAKE, - FANTINA, - BYRON, - CANDICE, - VOLKNER, - CILAN, - CHILI, - CRESS, - CHEREN, - LENORA, - ROXIE, - BURGH, - ELESA, - CLAY, - SKYLA, - BRYCEN, - DRAYDEN, - MARLON, - VIOLA, - GRANT, - KORRINA, - RAMOS, - CLEMONT, - VALERIE, - OLYMPIA, - WULFRIC, - MILO, - NESSA, - KABU, - BEA, - ALLISTER, - OPAL, - BEDE, - GORDIE, - MELONY, - PIERS, - MARNIE, - RAIHAN, - /*KATY, - BRASSIUS, - IONO, - KOFU, - LARRY, - RYME, - TULIP, - GRUSHA*/ - - LORELEI = 300, - BRUNO, - AGATHA, - LANCE, - WILL, - KOGA, - KAREN, - SIDNEY, - PHOEBE, - GLACIA, - DRAKE, - AARON, - BERTHA, - FLINT, - LUCIAN, - SHAUNTAL, - MARSHAL, - GRIMSLEY, - CAITLIN, - MALVA, - SIEBOLD, - WIKSTROM, - DRASNA, - HALA, - MOLAYNE, - OLIVIA, - ACEROLA, - KAHILI, - /*RIKA, - POPPY, - LARRY_ELITE, - HASSEL*/ - - BLUE = 350, - RED, - LANCE_CHAMPION, - STEVEN, - WALLACE, - CYNTHIA, - ALDER, - IRIS, - DIANTHA, - LEON, - /*GEETA, - NEMONA, - KIERAN,*/ - - RIVAL = 375, - RIVAL_2, - RIVAL_3, - RIVAL_4, - RIVAL_5, - RIVAL_6 -} +import { initTrainerTypeDialogue } from "./dialogue"; export enum TrainerPoolTier { COMMON, @@ -498,24 +319,6 @@ export class TrainerConfig { return this; } - setEncounterMessages(messages: string[], femaleMessages?: string[]): TrainerConfig { - this.encounterMessages = messages; - this.femaleEncounterMessages = femaleMessages; - return this; - } - - setVictoryMessages(messages: string[], femaleMessages?: string[]): TrainerConfig { - this.victoryMessages = messages; - this.femaleVictoryMessages = femaleMessages; - return this; - } - - setDefeatMessages(messages: string[], femaleMessages?: string[]): TrainerConfig { - this.defeatMessages = messages; - this.femaleDefeatMessages = femaleMessages; - return this; - } - setModifierRewardFuncs(...modifierTypeFuncs: (() => ModifierTypeFunc)[]): TrainerConfig { this.modifierRewardFuncs = modifierTypeFuncs.map(func => () => { const modifierTypeFunc = func(); @@ -798,24 +601,7 @@ export const trainerConfigs: TrainerConfigs = { [TrainerType.YOUNGSTER]: new TrainerConfig(++t).setMoneyMultiplier(0.5).setEncounterBgm(TrainerType.YOUNGSTER).setHasGenders('Lass', 'lass').setPartyTemplates(trainerPartyTemplates.TWO_WEAKER) .setSpeciesPools( [ Species.CATERPIE, Species.WEEDLE, Species.RATTATA, Species.SENTRET, Species.POOCHYENA, Species.ZIGZAGOON, Species.WURMPLE, Species.BIDOOF, Species.PATRAT, Species.LILLIPUP ] - ).setEncounterMessages([ - `Hey, wanna battle?`, - `Are you a new trainer too?`, - `Hey, I haven't seen you before. Let's battle!` - ], [ - `Let's have a battle, shall we?`, - `You look like a new trainer. Let's have a battle!`, - `I don't recognize you. How about a battle?` - ]).setVictoryMessages([ - `Wow! You're strong!`, - `I didn't stand a chance, huh.`, - `I'll find you again when I'm older and beat you!` - ], [ - `That was impressive! I've got a lot to learn.`, - `I didn't think you'd beat me that bad…`, - `I hope we get to have a rematch some day.` - ]), - + ), [TrainerType.BROCK]: new TrainerConfig((t = TrainerType.BROCK)).initForGymLeader([ Species.GEODUDE, Species.ONIX ], Type.ROCK), [TrainerType.MISTY]: new TrainerConfig(++t).initForGymLeader([ Species.STARYU, Species.PSYDUCK ], Type.WATER), [TrainerType.LT_SURGE]: new TrainerConfig(++t).initForGymLeader([ Species.VOLTORB, Species.PIKACHU, Species.ELECTABUZZ ], Type.ELECTRIC), @@ -832,132 +618,15 @@ export const trainerConfigs: TrainerConfigs = { [TrainerType.JASMINE]: new TrainerConfig(++t).initForGymLeader([ Species.MAGNEMITE, Species.STEELIX ], Type.STEEL), [TrainerType.PRYCE]: new TrainerConfig(++t).initForGymLeader([ Species.SEEL, Species.SWINUB ], Type.ICE), [TrainerType.CLAIR]: new TrainerConfig(++t).initForGymLeader([ Species.DRATINI, Species.HORSEA, Species.GYARADOS ], Type.DRAGON), - [TrainerType.ROXANNE]: new TrainerConfig(++t).initForGymLeader([ Species.GEODUDE, Species.NOSEPASS ], Type.ROCK) - .setEncounterMessages([ - `Would you kindly demonstrate how you battle?`, - `You can learn many things by battling many trainers.`, - `Oh, you caught me strategizing.\nWould you like to battle?` - ]).setVictoryMessages([ - `Oh, I appear to have lost.\nI understand.`, - `It seems that I still have so much more to learn when it comes to battle.`, - `I'll take what I learned here today to heart.` - ]).setDefeatMessages([ - `I have learned many things from our battle.\nI hope you have too.`, - `I look forward to battling you again.\nI hope you'll use what you've learned here.`, - `I won due to everything I have learned.` - ]), - [TrainerType.BRAWLY]: new TrainerConfig(++t).initForGymLeader([ Species.MACHOP, Species.MAKUHITA ], Type.FIGHTING) - .setEncounterMessages([ - `Oh man, a challenger!\nLet's see what you can do!`, - `You seem like a big splash.\nLet's battle!`, - `Time to create a storm!\nLet's go!` - ]).setVictoryMessages([ - `Oh woah, you've washed me out!`, - `You surfed my wave and crashed me down!`, - `I feel like I'm lost in Granite Cave!` - ]).setDefeatMessages([ - `Haha, I surfed the big wave!\nChallenge me again sometime.`, - `Surf with me again some time!`, - `Just like the tides come in and out, I hope you return to challenge me again.` - ]), - [TrainerType.WATTSON]: new TrainerConfig(++t).initForGymLeader([ Species.MAGNEMITE, Species.VOLTORB, Species.ELECTRIKE ], Type.ELECTRIC) - .setEncounterMessages([ - `Time to get shocked!\nWahahahaha!`, - `I'll make sparks fly!\nWahahahaha!`, - `I hope you brought Paralyz Heal!\nWahahahaha!` - ]).setVictoryMessages([ - `Seems like I'm out of charge!\nWahahahaha!`, - `You've completely grounded me!\nWahahahaha!`, - `Thanks for the thrill!\nWahahahaha!` - ]).setDefeatMessages([ - `Recharge your batteries and challenge me again sometime!\nWahahahaha!`, - `I hope you found our battle electrifying!\nWahahahaha!`, - `Aren't you shocked I won?\nWahahahaha!` - ]), - [TrainerType.FLANNERY]: new TrainerConfig(++t).initForGymLeader([ Species.SLUGMA, Species.TORKOAL, Species.NUMEL ], Type.FIRE) - .setEncounterMessages([ - `Nice to meet you! Wait, no…\nI will crush you!`, - `I've only been a leader for a little while, but I'll smoke you!`, - `It's time to demonstrate the moves my grandfather has taught me! Let's battle!` - ]).setVictoryMessages([ - `You remind me of my grandfather…\nNo wonder I lost.`, - `Am I trying too hard?\nI should relax, can't get too heated.`, - `Losing isn't going to smother me out.\nTime to reignite training!` - ]).setDefeatMessages([ - `I hope I've made my grandfather proud…\nLet's battle again some time.`, - `I…I can't believe I won!\nDoing things my way worked!`, - `Let's exchange burning hot moves again soon!` - ]), - [TrainerType.NORMAN]: new TrainerConfig(++t).initForGymLeader([ Species.SLAKOTH, Species.SPINDA, Species.CHANSEY, Species.KANGASKHAN ], Type.NORMAL) - .setEncounterMessages([ - `I'm surprised you managed to get here.\nLet's battle.`, - `I'll do everything in my power as a Gym Leader to win.\nLet's go!`, - `You better give this your all.\nIt's time to battle!` - ]).setVictoryMessages([ - `I lost to you…?\nRules are rules, though.`, - `Was moving from Olivine a mistake…?`, - `I can't believe it.\nThat was a great match.` - ]).setDefeatMessages([ - `We both tried our best.\nI hope we can battle again soon.`, - `You should try challenging my kid instead.\nYou might learn something!`, - `Thank you for the excellent battle.\nBetter luck next time.` - ]), - [TrainerType.WINONA]: new TrainerConfig(++t).initForGymLeader([ Species.SWABLU, Species.WINGULL, Species.TROPIUS, Species.SKARMORY ], Type.FLYING) - .setEncounterMessages([ - `I've been soaring the skies looking for prey…\nAnd you're my target!`, - `No matter how our battle is, my Flying Pokémon and I will triumph with grace. Let's battle!`, - `I hope you aren't scared of heights.\nLet's ascend!` - ]).setVictoryMessages([ - `You're the first Trainer I've seen with more grace than I.\nExcellently played.`, - `Oh, my Flying Pokémon have plummeted!\nVery well.`, - `Though I may have fallen, my Pokémon will continue to fly!` - ]).setDefeatMessages([ - `My Flying Pokémon and I will forever dance elegantly!`, - `I hope you enjoyed our show.\nOur graceful dance is finished.`, - `Won't you come see our elegant choreography again?` - ]), - [TrainerType.TATE]: new TrainerConfig(++t).initForGymLeader([ Species.SOLROCK, Species.NATU, Species.CHIMECHO, Species.GALLADE ], Type.PSYCHIC) - .setEncounterMessages([ - `Hehehe…\nWere you surprised to see me without my sister?`, - `I can see what you're thinking…\nYou want to battle!`, - `How can you defeat someone…\nWho knows your every move?` - ]).setVictoryMessages([ - `It can't be helped…\nI miss Liza…`, - `Your bond with your Pokémon was stronger than mine.`, - `If I were with Liza, we would have won.\nWe can finish each other's thoughts!` - ]).setDefeatMessages([ - `My Pokémon and I are superior!`, - `If you can't even defeat me, you'll never be able to defeat Liza either.`, - `It's all thanks to my strict training with Liza.\nI can make myself one with Pokémon.` - ]), - [TrainerType.LIZA]: new TrainerConfig(++t).initForGymLeader([ Species.LUNATONE, Species.SPOINK, Species.BALTOY, Species.GARDEVOIR ], Type.PSYCHIC) - .setEncounterMessages([ - `Fufufu…\nWere you surprised to see me without my brother?`, - `I can determine what you desire…\nYou want to battle, don't you?`, - `How can you defeat someone…\nWho's one with their Pokémon?` - ]).setVictoryMessages([ - `It can't be helped…\nI miss Tate…`, - `Your bond with your Pokémon…\nIt's stronger than mine.`, - `If I were with Tate, we would have won.\nWe can finish each other's sentences!` - ]).setDefeatMessages([ - `My Pokémon and I are victorious.`, - `If you can't even defeat me, you'll never be able to defeat Tate either.`, - `It's all thanks to my strict training with Tate.\nI can synchronize myself with my Pokémon.` - ]), - [TrainerType.JUAN]: new TrainerConfig(++t).initForGymLeader([ Species.HORSEA, Species.BARBOACH, Species.SPHEAL, Species.RELICANTH ], Type.WATER) - .setEncounterMessages([ - `Now's not the time to act coy.\nLet's battle!`, - `Ahahaha, You'll be witness to my artistry with Water Pokémon!`, - `A typhoon approaches!\nWill you be able to test me?` - ]).setVictoryMessages([ - `You may be a genius who can take on Wallace!`, - `I focused on elegance while you trained.\nIt's only natural that you defeated me.`, - `Ahahaha!\nVery well, You have won this time.` - ]).setDefeatMessages([ - `My Pokémon and I have sculpted an illusion of Water and come out victorious.`, - `Ahahaha, I have won, and you have lost.`, - `Shall I loan you my outfit? It may help you battle!\nAhahaha, I jest!` - ]), + [TrainerType.ROXANNE]: new TrainerConfig(++t).initForGymLeader([ Species.GEODUDE, Species.NOSEPASS ], Type.ROCK), + [TrainerType.BRAWLY]: new TrainerConfig(++t).initForGymLeader([ Species.MACHOP, Species.MAKUHITA ], Type.FIGHTING), + [TrainerType.WATTSON]: new TrainerConfig(++t).initForGymLeader([ Species.MAGNEMITE, Species.VOLTORB, Species.ELECTRIKE ], Type.ELECTRIC), + [TrainerType.FLANNERY]: new TrainerConfig(++t).initForGymLeader([ Species.SLUGMA, Species.TORKOAL, Species.NUMEL ], Type.FIRE), + [TrainerType.NORMAN]: new TrainerConfig(++t).initForGymLeader([ Species.SLAKOTH, Species.SPINDA, Species.CHANSEY, Species.KANGASKHAN ], Type.NORMAL), + [TrainerType.WINONA]: new TrainerConfig(++t).initForGymLeader([ Species.SWABLU, Species.WINGULL, Species.TROPIUS, Species.SKARMORY ], Type.FLYING), + [TrainerType.TATE]: new TrainerConfig(++t).initForGymLeader([ Species.SOLROCK, Species.NATU, Species.CHIMECHO, Species.GALLADE ], Type.PSYCHIC), + [TrainerType.LIZA]: new TrainerConfig(++t).initForGymLeader([ Species.LUNATONE, Species.SPOINK, Species.BALTOY, Species.GARDEVOIR ], Type.PSYCHIC), + [TrainerType.JUAN]: new TrainerConfig(++t).initForGymLeader([ Species.HORSEA, Species.BARBOACH, Species.SPHEAL, Species.RELICANTH ], Type.WATER), [TrainerType.ROARK]: new TrainerConfig(++t).initForGymLeader([ Species.CRANIDOS, Species.LARVITAR, Species.GEODUDE ], Type.ROCK), [TrainerType.GARDENIA]: new TrainerConfig(++t).initForGymLeader([ Species.ROSELIA, Species.TANGELA, Species.TURTWIG ], Type.GRASS), [TrainerType.MAYLENE]: new TrainerConfig(++t).initForGymLeader([ Species.LUCARIO, Species.MEDITITE, Species.CHIMCHAR ], Type.FIGHTING), @@ -1059,55 +728,24 @@ export const trainerConfigs: TrainerConfigs = { [TrainerType.NEMONA]: new TrainerConfig(++t).initForChampion([ Species.LYCANROC, Species.KORAIDON, Species.KOMMO_O, Species.PAWMOT, Species.DUSKNOIR ]), [TrainerType.KIERAN]: new TrainerConfig(++t).initForChampion([ Species.POLITOED, Species.MIRAIDON, Species.HYDRAPPLE, Species.PORYGON_Z, Species.GRIMMSNARL ]),*/ - [TrainerType.RIVAL]: new TrainerConfig((t = TrainerType.RIVAL)).setStaticParty().setEncounterBgm(TrainerType.RIVAL).setBattleBgm('battle_rival').setPartyTemplates(trainerPartyTemplates.RIVAL).setEncounterMessages([ - `There you are! I've been looking everywhere for you!\nDid you forget to say goodbye to your best friend? - $So you're finally pursuing your dream, huh?\nI knew you'd do it one day… - $Anyway, I'll forgive you for forgetting me, but on one condition. You have to battle me! - $You'd better give it your best! Wouldn't want your adventure to be over before it started, right?` - ]).setVictoryMessages([ - `You already have three Pokémon?!\nThat's not fair at all! - $Just kidding! I lost fair and square, and now I know you'll do fine out there. - $By the way, the professor wanted me to give you some items. Hopefully they're helpful! - $Do your best like always! I believe in you!` - ]).setModifierRewardFuncs(() => modifierTypes.SUPER_EXP_CHARM, () => modifierTypes.EXP_SHARE).setPartyMemberFunc(0, getRandomPartyMemberFunc([ Species.BULBASAUR, Species.CHARMANDER, Species.SQUIRTLE, Species.CHIKORITA, Species.CYNDAQUIL, Species.TOTODILE, Species.TREECKO, Species.TORCHIC, Species.MUDKIP, Species.TURTWIG, Species.CHIMCHAR, Species.PIPLUP, Species.SNIVY, Species.TEPIG, Species.OSHAWOTT, Species.CHESPIN, Species.FENNEKIN, Species.FROAKIE, Species.ROWLET, Species.LITTEN, Species.POPPLIO, Species.GROOKEY, Species.SCORBUNNY, Species.SOBBLE ])) + [TrainerType.RIVAL]: new TrainerConfig((t = TrainerType.RIVAL)).setStaticParty().setEncounterBgm(TrainerType.RIVAL).setBattleBgm('battle_rival').setPartyTemplates(trainerPartyTemplates.RIVAL) + .setModifierRewardFuncs(() => modifierTypes.SUPER_EXP_CHARM, () => modifierTypes.EXP_SHARE).setPartyMemberFunc(0, getRandomPartyMemberFunc([ Species.BULBASAUR, Species.CHARMANDER, Species.SQUIRTLE, Species.CHIKORITA, Species.CYNDAQUIL, Species.TOTODILE, Species.TREECKO, Species.TORCHIC, Species.MUDKIP, Species.TURTWIG, Species.CHIMCHAR, Species.PIPLUP, Species.SNIVY, Species.TEPIG, Species.OSHAWOTT, Species.CHESPIN, Species.FENNEKIN, Species.FROAKIE, Species.ROWLET, Species.LITTEN, Species.POPPLIO, Species.GROOKEY, Species.SCORBUNNY, Species.SOBBLE ])) .setPartyMemberFunc(1, getRandomPartyMemberFunc([ Species.PIDGEY, Species.HOOTHOOT, Species.TAILLOW, Species.STARLY, Species.PIDOVE, Species.FLETCHLING, Species.PIKIPEK, Species.ROOKIDEE ])), - [TrainerType.RIVAL_2]: new TrainerConfig(++t).setStaticParty().setMoneyMultiplier(1.25).setEncounterBgm(TrainerType.RIVAL).setBattleBgm('battle_rival').setPartyTemplates(trainerPartyTemplates.RIVAL_2).setEncounterMessages([ - `Oh, fancy meeting you here. Looks like you're still undefeated. Right on! - $I know what you're thinking, and no, I wasn't following you. I just happened to be in the area. - $I'm happy for you but I just want to let you know that it's OK to lose sometimes. - $We learn from our mistakes, often more than we would if we kept succeeding. - $In any case, I've been training hard for our rematch, so you'd better give it your all!` - ]).setVictoryMessages([ - `I… wasn't supposed to lose that time…` - ]).setPartyMemberFunc(0, getRandomPartyMemberFunc([ Species.IVYSAUR, Species.CHARMELEON, Species.WARTORTLE, Species.BAYLEEF, Species.QUILAVA, Species.CROCONAW, Species.GROVYLE, Species.COMBUSKEN, Species.MARSHTOMP, Species.GROTLE, Species.MONFERNO, Species.PRINPLUP, Species.SERVINE, Species.PIGNITE, Species.DEWOTT, Species.QUILLADIN, Species.BRAIXEN, Species.FROGADIER, Species.DARTRIX, Species.TORRACAT, Species.BRIONNE, Species.THWACKEY, Species.RABOOT, Species.DRIZZILE ])) + [TrainerType.RIVAL_2]: new TrainerConfig(++t).setStaticParty().setMoneyMultiplier(1.25).setEncounterBgm(TrainerType.RIVAL).setBattleBgm('battle_rival').setPartyTemplates(trainerPartyTemplates.RIVAL_2) + .setPartyMemberFunc(0, getRandomPartyMemberFunc([ Species.IVYSAUR, Species.CHARMELEON, Species.WARTORTLE, Species.BAYLEEF, Species.QUILAVA, Species.CROCONAW, Species.GROVYLE, Species.COMBUSKEN, Species.MARSHTOMP, Species.GROTLE, Species.MONFERNO, Species.PRINPLUP, Species.SERVINE, Species.PIGNITE, Species.DEWOTT, Species.QUILLADIN, Species.BRAIXEN, Species.FROGADIER, Species.DARTRIX, Species.TORRACAT, Species.BRIONNE, Species.THWACKEY, Species.RABOOT, Species.DRIZZILE ])) .setPartyMemberFunc(1, getRandomPartyMemberFunc([ Species.PIDGEOTTO, Species.HOOTHOOT, Species.TAILLOW, Species.STARAVIA, Species.TRANQUILL, Species.FLETCHINDER, Species.TRUMBEAK, Species.CORVISQUIRE ])) .setPartyMemberFunc(2, getSpeciesFilterRandomPartyMemberFunc((species: PokemonSpecies) => !pokemonEvolutions.hasOwnProperty(species.speciesId) && !pokemonPrevolutions.hasOwnProperty(species.speciesId) && species.baseTotal >= 450)), - [TrainerType.RIVAL_3]: new TrainerConfig(++t).setStaticParty().setMoneyMultiplier(1.5).setEncounterBgm(TrainerType.RIVAL).setBattleBgm('battle_rival').setPartyTemplates(trainerPartyTemplates.RIVAL_3).setEncounterMessages([ - `Long time no see! Still haven't lost, huh.\nYou're starting to get on my nerves. Just kidding! - $But really, I think it's about time you came home.\nYour family and friends miss you, you know. - $I know your dream means a lot to you, but the reality is you're going to lose sooner or later. - $And when you do, I'll be there for you like always.\nNow, let me show you how strong I've become!` - ]).setVictoryMessages([ - `After all that… it wasn't enough…?` - ]).setPartyMemberFunc(0, getRandomPartyMemberFunc([ Species.VENUSAUR, Species.CHARIZARD, Species.BLASTOISE, Species.MEGANIUM, Species.TYPHLOSION, Species.FERALIGATR, Species.SCEPTILE, Species.BLAZIKEN, Species.SWAMPERT, Species.TORTERRA, Species.INFERNAPE, Species.EMPOLEON, Species.SERPERIOR, Species.EMBOAR, Species.SAMUROTT, Species.CHESNAUGHT, Species.DELPHOX, Species.GRENINJA, Species.DECIDUEYE, Species.INCINEROAR, Species.PRIMARINA, Species.RILLABOOM, Species.CINDERACE, Species.INTELEON ])) + [TrainerType.RIVAL_3]: new TrainerConfig(++t).setStaticParty().setMoneyMultiplier(1.5).setEncounterBgm(TrainerType.RIVAL).setBattleBgm('battle_rival').setPartyTemplates(trainerPartyTemplates.RIVAL_3) + .setPartyMemberFunc(0, getRandomPartyMemberFunc([ Species.VENUSAUR, Species.CHARIZARD, Species.BLASTOISE, Species.MEGANIUM, Species.TYPHLOSION, Species.FERALIGATR, Species.SCEPTILE, Species.BLAZIKEN, Species.SWAMPERT, Species.TORTERRA, Species.INFERNAPE, Species.EMPOLEON, Species.SERPERIOR, Species.EMBOAR, Species.SAMUROTT, Species.CHESNAUGHT, Species.DELPHOX, Species.GRENINJA, Species.DECIDUEYE, Species.INCINEROAR, Species.PRIMARINA, Species.RILLABOOM, Species.CINDERACE, Species.INTELEON ])) .setPartyMemberFunc(1, getRandomPartyMemberFunc([ Species.PIDGEOT, Species.NOCTOWL, Species.SWELLOW, Species.STARAPTOR, Species.UNFEZANT, Species.TALONFLAME, Species.TOUCANNON, Species.CORVIKNIGHT ])) .setPartyMemberFunc(2, getSpeciesFilterRandomPartyMemberFunc((species: PokemonSpecies) => !pokemonEvolutions.hasOwnProperty(species.speciesId) && !pokemonPrevolutions.hasOwnProperty(species.speciesId) && species.baseTotal >= 450)) .setSpeciesFilter(species => species.baseTotal >= 540), - [TrainerType.RIVAL_4]: new TrainerConfig(++t).setBoss().setStaticParty().setMoneyMultiplier(1.75).setEncounterBgm(TrainerType.RIVAL).setBattleBgm('battle_rival_2').setPartyTemplates(trainerPartyTemplates.RIVAL_4).setEncounterMessages([ - `It's me! You didn't forget about me again did you? - $You made it really far! I'm proud of you.\nBut it looks like it's the end of your journey. - $You've awoken something in me I never knew was there.\nIt seems like all I do now is train. - $I hardly even eat or sleep now, I just train my Pokémon all day, getting stronger every time. - $And now, I've finally reached peak performance.\nI don't think anyone could beat me now. - $And you know what? It's all because of you.\nI don't know whether to thank you or hate you. - $Prepare yourself.` - ]).setVictoryMessages([ - `What…@d{64} what are you?` - ]).setPartyMemberFunc(0, getRandomPartyMemberFunc([ Species.VENUSAUR, Species.CHARIZARD, Species.BLASTOISE, Species.MEGANIUM, Species.TYPHLOSION, Species.FERALIGATR, Species.SCEPTILE, Species.BLAZIKEN, Species.SWAMPERT, Species.TORTERRA, Species.INFERNAPE, Species.EMPOLEON, Species.SERPERIOR, Species.EMBOAR, Species.SAMUROTT, Species.CHESNAUGHT, Species.DELPHOX, Species.GRENINJA, Species.DECIDUEYE, Species.INCINEROAR, Species.PRIMARINA, Species.RILLABOOM, Species.CINDERACE, Species.INTELEON ])) + [TrainerType.RIVAL_4]: new TrainerConfig(++t).setBoss().setStaticParty().setMoneyMultiplier(1.75).setEncounterBgm(TrainerType.RIVAL).setBattleBgm('battle_rival_2').setPartyTemplates(trainerPartyTemplates.RIVAL_4) + .setPartyMemberFunc(0, getRandomPartyMemberFunc([ Species.VENUSAUR, Species.CHARIZARD, Species.BLASTOISE, Species.MEGANIUM, Species.TYPHLOSION, Species.FERALIGATR, Species.SCEPTILE, Species.BLAZIKEN, Species.SWAMPERT, Species.TORTERRA, Species.INFERNAPE, Species.EMPOLEON, Species.SERPERIOR, Species.EMBOAR, Species.SAMUROTT, Species.CHESNAUGHT, Species.DELPHOX, Species.GRENINJA, Species.DECIDUEYE, Species.INCINEROAR, Species.PRIMARINA, Species.RILLABOOM, Species.CINDERACE, Species.INTELEON ])) .setPartyMemberFunc(1, getRandomPartyMemberFunc([ Species.PIDGEOT, Species.NOCTOWL, Species.SWELLOW, Species.STARAPTOR, Species.UNFEZANT, Species.TALONFLAME, Species.TOUCANNON, Species.CORVIKNIGHT ])) .setPartyMemberFunc(2, getSpeciesFilterRandomPartyMemberFunc((species: PokemonSpecies) => !pokemonEvolutions.hasOwnProperty(species.speciesId) && !pokemonPrevolutions.hasOwnProperty(species.speciesId) && species.baseTotal >= 450)) .setSpeciesFilter(species => species.baseTotal >= 540), - [TrainerType.RIVAL_5]: new TrainerConfig(++t).setBoss().setStaticParty().setMoneyMultiplier(2.25).setEncounterBgm(TrainerType.RIVAL).setBattleBgm('battle_rival_3').setPartyTemplates(trainerPartyTemplates.RIVAL_5).setEncounterMessages([ `…` ]).setVictoryMessages([ '…' ]) + [TrainerType.RIVAL_5]: new TrainerConfig(++t).setBoss().setStaticParty().setMoneyMultiplier(2.25).setEncounterBgm(TrainerType.RIVAL).setBattleBgm('battle_rival_3').setPartyTemplates(trainerPartyTemplates.RIVAL_5) .setPartyMemberFunc(0, getRandomPartyMemberFunc([ Species.VENUSAUR, Species.CHARIZARD, Species.BLASTOISE, Species.MEGANIUM, Species.TYPHLOSION, Species.FERALIGATR, Species.SCEPTILE, Species.BLAZIKEN, Species.SWAMPERT, Species.TORTERRA, Species.INFERNAPE, Species.EMPOLEON, Species.SERPERIOR, Species.EMBOAR, Species.SAMUROTT, Species.CHESNAUGHT, Species.DELPHOX, Species.GRENINJA, Species.DECIDUEYE, Species.INCINEROAR, Species.PRIMARINA, Species.RILLABOOM, Species.CINDERACE, Species.INTELEON ])) .setPartyMemberFunc(1, getRandomPartyMemberFunc([ Species.PIDGEOT, Species.NOCTOWL, Species.SWELLOW, Species.STARAPTOR, Species.UNFEZANT, Species.TALONFLAME, Species.TOUCANNON, Species.CORVIKNIGHT ])) .setPartyMemberFunc(2, getSpeciesFilterRandomPartyMemberFunc((species: PokemonSpecies) => !pokemonEvolutions.hasOwnProperty(species.speciesId) && !pokemonPrevolutions.hasOwnProperty(species.speciesId) && species.baseTotal >= 450)) @@ -1126,4 +764,8 @@ export const trainerConfigs: TrainerConfigs = { p.pokeball = PokeballType.MASTER_BALL; p.formIndex = 1; })), -} \ No newline at end of file +}; + +(function() { + initTrainerTypeDialogue(); +})(); \ No newline at end of file diff --git a/src/data/weather.ts b/src/data/weather.ts index 00868f2fd..758f18f7c 100644 --- a/src/data/weather.ts +++ b/src/data/weather.ts @@ -1,4 +1,4 @@ -import { Biome } from "./biome"; +import { Biome } from "./enums/biome"; import { getPokemonMessage } from "../messages"; import Pokemon from "../pokemon"; import { Type } from "./type"; diff --git a/src/egg-hatch-phase.ts b/src/egg-hatch-phase.ts index f047a6a72..927e95037 100644 --- a/src/egg-hatch-phase.ts +++ b/src/egg-hatch-phase.ts @@ -5,8 +5,8 @@ import * as Utils from "./utils"; import { Mode } from "./ui/ui"; import { EGG_SEED, Egg, GachaType, getLegendaryGachaSpeciesForTimestamp, getTypeGachaTypeForTimestamp } from "./data/egg"; import EggHatchSceneHandler from "./ui/egg-hatch-scene-handler"; -import { ModifierTier } from "./modifier/modifier-type"; -import { Species } from "./data/species"; +import { ModifierTier } from "./modifier/modifier-tier"; +import { Species } from "./data/enums/species"; import { PlayerPokemon } from "./pokemon"; import { getPokemonSpecies, speciesStarters } from "./data/pokemon-species"; import { StatsContainer } from "./ui/stats-container"; diff --git a/src/enums/battle-spec.ts b/src/enums/battle-spec.ts new file mode 100644 index 000000000..391451072 --- /dev/null +++ b/src/enums/battle-spec.ts @@ -0,0 +1,5 @@ + +export enum BattleSpec { + DEFAULT, + FINAL_BOSS +} diff --git a/src/form-change-phase.ts b/src/form-change-phase.ts index b6e98f71b..414aba577 100644 --- a/src/form-change-phase.ts +++ b/src/form-change-phase.ts @@ -4,10 +4,12 @@ import { SpeciesFormKey } from "./data/pokemon-species"; import { achvs } from "./system/achv"; import { SpeciesFormChange, getSpeciesFormChangeMessage } from "./data/pokemon-forms"; import { EndEvolutionPhase, EvolutionPhase } from "./evolution-phase"; -import Pokemon, { PlayerPokemon } from "./pokemon"; +import Pokemon, { EnemyPokemon, PlayerPokemon } from "./pokemon"; import { Mode } from "./ui/ui"; import PartyUiHandler from "./ui/party-ui-handler"; import { BattlePhase } from "./battle-phase"; +import { BattleSpec } from "./enums/battle-spec"; +import { MovePhase, PokemonHealPhase } from "./battle-phases"; export class FormChangePhase extends EvolutionPhase { private formChange: SpeciesFormChange; @@ -184,4 +186,21 @@ export class QuietFormChangePhase extends BattlePhase { this.scene.ui.showText(getSpeciesFormChangeMessage(this.pokemon, this.formChange, preName), null, () => this.end(), Utils.fixedInt(1500)); }); } + + end(): void { + if (this.pokemon.scene.currentBattle.battleSpec === BattleSpec.FINAL_BOSS && this.pokemon instanceof EnemyPokemon) { + this.scene.playBgm(); + this.scene.unshiftPhase(new PokemonHealPhase(this.scene, this.pokemon.getBattlerIndex(), this.pokemon.getMaxHp(), null, false)); + this.pokemon.bossSegments = 5; + this.pokemon.bossSegmentIndex = 4; + this.pokemon.initBattleInfo(); + this.pokemon.cry(); + + const movePhase = this.scene.findPhase(p => p instanceof MovePhase && p.pokemon === this.pokemon) as MovePhase; + if (movePhase) + movePhase.cancel(); + } + + super.end(); + } } \ No newline at end of file diff --git a/src/messages.ts b/src/messages.ts index a848701ed..bf0513ca3 100644 --- a/src/messages.ts +++ b/src/messages.ts @@ -1,5 +1,15 @@ +import { BattleSpec } from "./enums/battle-spec"; import Pokemon from "./pokemon"; export function getPokemonMessage(pokemon: Pokemon, content: string): string { - return `${!pokemon.isPlayer() ? pokemon.hasTrainer() ? 'Foe ' : 'Wild ' : ''}${pokemon.name}${content}`; + let prefix: string; + switch (pokemon.scene.currentBattle.battleSpec) { + case BattleSpec.DEFAULT: + prefix = !pokemon.isPlayer() ? pokemon.hasTrainer() ? 'Foe ' : 'Wild ' : ''; + break; + case BattleSpec.FINAL_BOSS: + prefix = 'Foe '; + break; + } + return `${prefix}${pokemon.name}${content}`; } \ No newline at end of file diff --git a/src/modifier/modifier-tier.ts b/src/modifier/modifier-tier.ts new file mode 100644 index 000000000..27292e47f --- /dev/null +++ b/src/modifier/modifier-tier.ts @@ -0,0 +1,7 @@ +export enum ModifierTier { + COMMON, + GREAT, + ULTRA, + MASTER, + LUXURY +} \ No newline at end of file diff --git a/src/modifier/modifier-type.ts b/src/modifier/modifier-type.ts index 53409d1ea..f9d585c1f 100644 --- a/src/modifier/modifier-type.ts +++ b/src/modifier/modifier-type.ts @@ -1,5 +1,6 @@ import * as Modifiers from './modifier'; -import { AttackMove, Moves, allMoves } from '../data/move'; +import { AttackMove, allMoves } from '../data/move'; +import { Moves } from "../data/enums/moves"; import { PokeballType, getPokeballName } from '../data/pokeball'; import Pokemon, { EnemyPokemon, PlayerPokemon, PokemonMove } from '../pokemon'; import { EvolutionItem, SpeciesFriendshipEvolutionCondition, pokemonEvolutions } from '../data/pokemon-evolutions'; @@ -17,17 +18,10 @@ import { SpeciesFormKey } from '../data/pokemon-species'; import BattleScene from '../battle-scene'; import { VoucherType, getVoucherTypeIcon, getVoucherTypeName } from '../system/voucher'; import { FormChangeItem, SpeciesFormChangeItemTrigger, pokemonFormChanges } from '../data/pokemon-forms'; +import { ModifierTier } from './modifier-tier'; type Modifier = Modifiers.Modifier; -export enum ModifierTier { - COMMON, - GREAT, - ULTRA, - MASTER, - LUXURY -}; - export enum ModifierPoolType { PLAYER, WILD, @@ -1083,7 +1077,7 @@ export function getEnemyBuffModifierForWave(tier: ModifierTier, enemyModifiers: export function getEnemyModifierTypesForWave(waveIndex: integer, count: integer, party: EnemyPokemon[], poolType: ModifierPoolType.WILD | ModifierPoolType.TRAINER, gameMode: GameMode): PokemonHeldItemModifierType[] { const ret = new Array(count).fill(0).map(() => getNewModifierTypeOption(party, poolType).type as PokemonHeldItemModifierType); - if ((gameMode === GameMode.CLASSIC && waveIndex === 200) || !(waveIndex % 1000)) + if (!(waveIndex % 1000)) ret.push(getModifierType(modifierTypes.MINI_BLACK_HOLE) as PokemonHeldItemModifierType); return ret; } diff --git a/src/pokemon.ts b/src/pokemon.ts index feaffef5f..8375d3300 100644 --- a/src/pokemon.ts +++ b/src/pokemon.ts @@ -1,7 +1,8 @@ import Phaser from 'phaser'; import BattleScene, { AnySound } from './battle-scene'; import BattleInfo, { PlayerBattleInfo, EnemyBattleInfo } from './ui/battle-info'; -import Move, { HighCritAttr, HitsTagAttr, applyMoveAttrs, FixedDamageAttr, VariablePowerAttr, Moves, allMoves, MoveCategory, TypelessAttr, CritOnlyAttr, getMoveTargets, AttackMove, AddBattlerTagAttr, OneHitKOAttr } from "./data/move"; +import { Moves } from "./data/enums/moves"; +import Move, { HighCritAttr, HitsTagAttr, applyMoveAttrs, FixedDamageAttr, VariablePowerAttr, allMoves, MoveCategory, TypelessAttr, CritOnlyAttr, getMoveTargets, AttackMove, AddBattlerTagAttr, OneHitKOAttr } from "./data/move"; import { default as PokemonSpecies, PokemonSpeciesForm, SpeciesFormKey, getFusedSpeciesName, getPokemonSpecies } from './data/pokemon-species'; import * as Utils from './utils'; import { Type, TypeDamageMultiplier, getTypeDamageMultiplier } from './data/type'; @@ -16,15 +17,17 @@ import { reverseCompatibleTms, tmSpecies } from './data/tms'; import { pokemonEvolutions, pokemonPrevolutions, SpeciesEvolution, SpeciesEvolutionCondition } from './data/pokemon-evolutions'; import { DamagePhase, FaintPhase, StatChangePhase, SwitchSummonPhase } from './battle-phases'; import { BattleStat } from './data/battle-stat'; -import { BattlerTag, BattlerTagLapseType, BattlerTagType, EncoreTag, TypeBoostTag, getBattlerTag } from './data/battler-tag'; -import { Species } from './data/species'; +import { BattlerTag, BattlerTagLapseType, EncoreTag, TypeBoostTag, getBattlerTag } from './data/battler-tags'; +import { BattlerTagType } from "./data/enums/battler-tag-type"; +import { Species } from './data/enums/species'; import { WeatherType } from './data/weather'; import { TempBattleStat } from './data/temp-battle-stat'; import { ArenaTagType, WeakenMoveTypeTag } from './data/arena-tag'; -import { Biome } from './data/biome'; +import { Biome } from "./data/enums/biome"; import { Abilities, Ability, BattleStatMultiplierAbAttr, BlockCritAbAttr, IgnoreOpponentStatChangesAbAttr, MoveImmunityAbAttr, NonSuperEffectiveImmunityAbAttr, PreApplyBattlerTagAbAttr, StabBoostAbAttr, StatusEffectImmunityAbAttr, TypeImmunityAbAttr, VariableMovePowerAbAttr, WeightMultiplierAbAttr, allAbilities, applyAbAttrs, applyBattleStatMultiplierAbAttrs, applyPostDefendAbAttrs, applyPreApplyBattlerTagAbAttrs, applyPreAttackAbAttrs, applyPreDefendAbAttrs, applyPreSetStatusAbAttrs } from './data/ability'; import PokemonData from './system/pokemon-data'; import { BattlerIndex } from './battle'; +import { BattleSpec } from "./enums/battle-spec"; import { Mode } from './ui/ui'; import PartyUiHandler, { PartyOption, PartyUiMode } from './ui/party-ui-handler'; import SoundFade from 'phaser3-rex-plugins/plugins/soundfade'; @@ -2023,11 +2026,14 @@ export class EnemyPokemon extends Pokemon { } initBattleInfo(): void { - this.battleInfo = new EnemyBattleInfo(this.scene); - this.battleInfo.updateBossSegments(this); - this.battleInfo.initInfo(this); + if (!this.battleInfo) { + this.battleInfo = new EnemyBattleInfo(this.scene); + this.battleInfo.updateBossSegments(this); + this.battleInfo.initInfo(this); + } else + this.battleInfo.updateBossSegments(this); } - + setBoss(boss: boolean = true): void { if (boss) { this.bossSegments = this.scene.getEncounterBossSegments(this.scene.currentBattle.waveIndex, this.level, this.species, true); @@ -2038,7 +2044,7 @@ export class EnemyPokemon extends Pokemon { } } - generateAndPopulateMoveset(): void { + generateAndPopulateMoveset(formIndex?: integer): void { switch (true) { case (this.species.speciesId === Species.SMEARGLE): this.moveset = [ @@ -2049,18 +2055,18 @@ export class EnemyPokemon extends Pokemon { ]; break; case (this.species.speciesId === Species.ETERNATUS): - this.moveset = this.formIndex + this.moveset = (formIndex !== undefined ? formIndex : this.formIndex) ? [ new PokemonMove(Moves.DYNAMAX_CANNON), - new PokemonMove(Moves.SLUDGE_BOMB), + new PokemonMove(Moves.CROSS_POISON), new PokemonMove(Moves.FLAMETHROWER), new PokemonMove(Moves.RECOVER) ] : [ new PokemonMove(Moves.ETERNABEAM), - new PokemonMove(Moves.CROSS_POISON), + new PokemonMove(Moves.SLUDGE_BOMB), new PokemonMove(Moves.DRAGON_DANCE), - new PokemonMove(Moves.RECOVER) + new PokemonMove(Moves.COSMIC_POWER) ]; break; default: @@ -2105,12 +2111,17 @@ export class EnemyPokemon extends Pokemon { const move = pokemonMove.getMove(); let moveScore = moveScores[m]; + let targetScores: integer[] = []; + for (let mt of moveTargets[move.id]) { const target = this.scene.getField()[mt]; - moveScore += move.getUserBenefitScore(this, target, move) + move.getTargetBenefitScore(this, target, move) * (mt < BattlerIndex.ENEMY === this.isPlayer() ? 1 : -1); + let targetScore = move.getUserBenefitScore(this, target, move) + move.getTargetBenefitScore(this, target, move) * (mt < BattlerIndex.ENEMY === this.isPlayer() ? 1 : -1); + if (mt !== this.getBattlerIndex()) + targetScore *= target.getAttackMoveEffectiveness(move.type); + targetScores.push(targetScore); } - moveScore /= moveTargets[move.id].length + moveScore += Math.max(...targetScores); // could make smarter by checking opponent def/spdef moveScores[m] = moveScore; @@ -2229,7 +2240,7 @@ export class EnemyPokemon extends Pokemon { const roundedHpThreshold = Math.round(hpThreshold); if (this.hp > roundedHpThreshold) { if (this.hp - damage < roundedHpThreshold) { - const bypassSegment = (this.hp - roundedHpThreshold) / damage < 0.1; + const bypassSegment = this.canBypassBossSegments() && (this.hp - roundedHpThreshold) / damage < 0.1; damage = this.hp - (bypassSegment ? Math.round(hpThreshold - segmentSize) : roundedHpThreshold); this.handleBossSegmentCleared(s); } @@ -2241,6 +2252,15 @@ export class EnemyPokemon extends Pokemon { return super.damage(damage, ignoreSegments, preventEndure); } + canBypassBossSegments(): boolean { + if (this.scene.currentBattle.battleSpec === BattleSpec.FINAL_BOSS) { + if (!this.formIndex && (this.bossSegmentIndex - 1) <= 1) + return false; + } + + return true; + } + handleBossSegmentCleared(segmentIndex: integer): void { while (segmentIndex - 1 < this.bossSegmentIndex) { let boostedStat = BattleStat.RAND; @@ -2275,7 +2295,6 @@ export class EnemyPokemon extends Pokemon { statLevels++; break; } - this.scene.unshiftPhase(new StatChangePhase(this.scene, this.getBattlerIndex(), true, [ boostedStat ], statLevels)); diff --git a/src/system/arena-data.ts b/src/system/arena-data.ts index e5236c9b3..e7f859688 100644 --- a/src/system/arena-data.ts +++ b/src/system/arena-data.ts @@ -1,6 +1,6 @@ import { Arena } from "../arena"; import { ArenaTag } from "../data/arena-tag"; -import { Biome } from "../data/biome"; +import { Biome } from "../data/enums/biome"; import { Weather } from "../data/weather"; export default class ArenaData { diff --git a/src/system/auto-play.ts b/src/system/auto-play.ts index aaf63ac81..9fc2616f7 100644 --- a/src/system/auto-play.ts +++ b/src/system/auto-play.ts @@ -1,8 +1,8 @@ import { SelectModifierPhase } from "../battle-phases"; import BattleScene, { Button } from "../battle-scene"; -import { ModifierTier, ModifierType, ModifierTypeOption, PokemonBaseStatBoosterModifierType, PokemonHpRestoreModifierType, PokemonReviveModifierType } from "../modifier/modifier-type"; +import { ModifierType, ModifierTypeOption, PokemonBaseStatBoosterModifierType, PokemonHpRestoreModifierType, PokemonReviveModifierType } from "../modifier/modifier-type"; import Pokemon, { AiType, EnemyPokemon, PlayerPokemon, PokemonMove } from "../pokemon"; -import { Species } from "../data/species"; +import { Species } from "../data/enums/species"; import BattleMessageUiHandler from "../ui/battle-message-ui-handler"; import CommandUiHandler from "../ui/command-ui-handler"; import FightUiHandler from "../ui/fight-ui-handler"; @@ -11,6 +11,7 @@ import ModifierSelectUiHandler from "../ui/modifier-select-ui-handler"; import PartyUiHandler, { PartyUiMode } from "../ui/party-ui-handler"; import ConfirmUiHandler from "../ui/confirm-ui-handler"; import { Mode } from "../ui/ui"; +import { ModifierTier } from "../modifier/modifier-tier"; export function initAutoPlay() { const thisArg = this as BattleScene; diff --git a/src/system/game-data.ts b/src/system/game-data.ts index dd64ad10c..b9596744e 100644 --- a/src/system/game-data.ts +++ b/src/system/game-data.ts @@ -2,7 +2,7 @@ import BattleScene, { PokeballCounts, bypassLogin } from "../battle-scene"; import Pokemon, { EnemyPokemon, PlayerPokemon } from "../pokemon"; import { pokemonPrevolutions } from "../data/pokemon-evolutions"; import PokemonSpecies, { allSpecies, getPokemonSpecies, speciesStarters } from "../data/pokemon-species"; -import { Species } from "../data/species"; +import { Species } from "../data/enums/species"; import * as Utils from "../utils"; import PokemonData from "./pokemon-data"; import PersistentModifierData from "./modifier-data"; @@ -11,7 +11,7 @@ import { Unlockables } from "./unlockables"; import { GameMode } from "../game-mode"; import { BattleType } from "../battle"; import TrainerData from "./trainer-data"; -import { trainerConfigs } from "../data/trainer-type"; +import { trainerConfigs } from "../data/trainer-config"; import { Setting, setSetting, settingDefaults } from "./settings"; import { achvs } from "./achv"; import EggData from "./egg-data"; diff --git a/src/system/pokemon-data.ts b/src/system/pokemon-data.ts index f513848ba..3d8cc97a8 100644 --- a/src/system/pokemon-data.ts +++ b/src/system/pokemon-data.ts @@ -1,11 +1,11 @@ import { BattleType } from "../battle"; import BattleScene from "../battle-scene"; -import { Biome } from "../data/biome"; +import { Biome } from "../data/enums/biome"; import { Gender } from "../data/gender"; import { Nature } from "../data/nature"; import { PokeballType } from "../data/pokeball"; import { getPokemonSpecies } from "../data/pokemon-species"; -import { Species } from "../data/species"; +import { Species } from "../data/enums/species"; import { Status } from "../data/status-effect"; import Pokemon, { EnemyPokemon, PlayerPokemon, PokemonMove, PokemonSummonData } from "../pokemon"; @@ -43,7 +43,7 @@ export default class PokemonData { public summonData: PokemonSummonData; - constructor(source: Pokemon | any) { + constructor(source: Pokemon | any, forHistory: boolean = false) { const sourcePokemon = source instanceof Pokemon ? source as Pokemon : null; this.id = source.id; this.player = sourcePokemon ? sourcePokemon.isPlayer() : source.player; @@ -54,16 +54,19 @@ export default class PokemonData { this.pokeball = source.pokeball; this.level = source.level; this.exp = source.exp; - this.levelExp = source.levelExp; + if (!forHistory) + this.levelExp = source.levelExp; this.gender = source.gender; - this.hp = source.hp; + if (!forHistory) + this.hp = source.hp; this.stats = source.stats; this.ivs = source.ivs; this.nature = source.nature !== undefined ? source.nature : 0 as Nature; this.friendship = source.friendship !== undefined ? source.friendship : getPokemonSpecies(this.species).baseFriendship; this.metLevel = source.metLevel || 5; this.metBiome = source.metBiome !== undefined ? source.metBiome : -1; - this.pauseEvolutions = !!source.pauseEvolutions; + if (!forHistory) + this.pauseEvolutions = !!source.pauseEvolutions; this.pokerus = !!source.pokerus; this.fusionSpecies = sourcePokemon ? sourcePokemon.fusionSpecies?.speciesId : source.fusionSpecies; @@ -72,21 +75,26 @@ export default class PokemonData { this.fusionShiny = source.fusionShiny; this.fusionGender = source.fusionGender; - this.boss = (source instanceof EnemyPokemon && !!source.bossSegments) || (!this.player && !!source.boss); + if (!forHistory) + this.boss = (source instanceof EnemyPokemon && !!source.bossSegments) || (!this.player && !!source.boss); if (sourcePokemon) { this.moveset = sourcePokemon.moveset; - this.status = sourcePokemon.status; - if (this.player) - this.summonData = sourcePokemon.summonData; + if (!forHistory) { + this.status = sourcePokemon.status; + if (this.player) + this.summonData = sourcePokemon.summonData; + } } else { this.moveset = source.moveset.map((m: any) => new PokemonMove(m.moveId, m.ppUsed, m.ppUp)); - this.status = source.status - ? new Status(source.status.effect, source.status.turnCount, source.status.cureTurn) - : undefined; + if (!forHistory) { + this.status = source.status + ? new Status(source.status.effect, source.status.turnCount, source.status.cureTurn) + : undefined; + } this.summonData = new PokemonSummonData(); - if (source.summonData) { + if (!forHistory && source.summonData) { this.summonData.battleStats = source.summonData.battleStats; this.summonData.moveQueue = source.summonData.moveQueue; this.summonData.tags = []; // TODO diff --git a/src/system/session-history.ts b/src/system/session-history.ts new file mode 100644 index 000000000..2b00ad168 --- /dev/null +++ b/src/system/session-history.ts @@ -0,0 +1,22 @@ +import { GameMode } from "../game-mode"; +import PokemonData from "./pokemon-data"; +import PersistentModifierData from "./modifier-data"; + +export enum SessionHistoryResult { + ACTIVE, + WIN, + LOSS +} + +export interface SessionHistory { + seed: string; + playTime: integer; + result: SessionHistoryResult, + gameMode: GameMode; + party: PokemonData[]; + modifiers: PersistentModifierData[]; + money: integer; + waveIndex: integer; + gameVersion: string; + timestamp: integer; +} \ No newline at end of file diff --git a/src/system/trainer-data.ts b/src/system/trainer-data.ts index 5df18ca8b..c4b4b8d0c 100644 --- a/src/system/trainer-data.ts +++ b/src/system/trainer-data.ts @@ -1,5 +1,5 @@ import BattleScene from "../battle-scene"; -import { TrainerType } from "../data/trainer-type"; +import { TrainerType } from "../data/enums/trainer-type"; import Trainer from "../trainer"; export default class TrainerData { diff --git a/src/system/voucher.ts b/src/system/voucher.ts index d6e900203..09e977dae 100644 --- a/src/system/voucher.ts +++ b/src/system/voucher.ts @@ -1,6 +1,6 @@ import BattleScene from "../battle-scene"; -import { TrainerType, trainerConfigs } from "../data/trainer-type"; -import { ModifierTier } from "../modifier/modifier-type"; +import { TrainerType } from "../data/enums/trainer-type"; +import { ModifierTier } from "../modifier/modifier-tier"; import { Achv, achvs } from "./achv"; export enum VoucherType { @@ -86,30 +86,33 @@ const voucherAchvs: Achv[] = [ achvs.CLASSIC_VICTORY ]; { (function() { - for (let achv of voucherAchvs) { - const voucherType = achv.score >= 150 - ? VoucherType.GOLDEN - : achv.score >= 100 - ? VoucherType.PREMIUM - : achv.score >= 75 - ? VoucherType.PLUS - : VoucherType.REGULAR; - vouchers[achv.id] = new Voucher(voucherType, achv.description); - } + import('../data/trainer-config').then(tc => { + for (let achv of voucherAchvs) { + const voucherType = achv.score >= 150 + ? VoucherType.GOLDEN + : achv.score >= 100 + ? VoucherType.PREMIUM + : achv.score >= 75 + ? VoucherType.PLUS + : VoucherType.REGULAR; + vouchers[achv.id] = new Voucher(voucherType, achv.description); + } - const bossTrainerTypes = Object.keys(trainerConfigs) - .filter(tt => trainerConfigs[tt].isBoss && trainerConfigs[tt].getDerivedType() !== TrainerType.RIVAL); + const trainerConfigs = tc.trainerConfigs; + const bossTrainerTypes = Object.keys(trainerConfigs) + .filter(tt => trainerConfigs[tt].isBoss && trainerConfigs[tt].getDerivedType() !== TrainerType.RIVAL); - for (let trainerType of bossTrainerTypes) { - const voucherType = trainerConfigs[trainerType].moneyMultiplier < 10 - ? VoucherType.PLUS - : VoucherType.PREMIUM; - const key = TrainerType[trainerType]; - vouchers[key] = new Voucher(voucherType, `Defeat ${trainerConfigs[trainerType].name}`); - } + for (let trainerType of bossTrainerTypes) { + const voucherType = trainerConfigs[trainerType].moneyMultiplier < 10 + ? VoucherType.PLUS + : VoucherType.PREMIUM; + const key = TrainerType[trainerType]; + vouchers[key] = new Voucher(voucherType, `Defeat ${trainerConfigs[trainerType].name}`); + } - const voucherKeys = Object.keys(vouchers); - for (let k of voucherKeys) - vouchers[k].id = k; + const voucherKeys = Object.keys(vouchers); + for (let k of voucherKeys) + vouchers[k].id = k; + }); })(); } \ No newline at end of file diff --git a/src/trainer.ts b/src/trainer.ts index b1f1358ec..4097a608e 100644 --- a/src/trainer.ts +++ b/src/trainer.ts @@ -1,7 +1,8 @@ import BattleScene from "./battle-scene"; import { pokemonPrevolutions } from "./data/pokemon-evolutions"; import PokemonSpecies, { getPokemonSpecies } from "./data/pokemon-species"; -import { TrainerConfig, TrainerPartyCompoundTemplate, TrainerPartyMemberStrength, TrainerPartyTemplate, TrainerPoolTier, TrainerType, trainerConfigs, trainerPartyTemplates } from "./data/trainer-type"; +import { TrainerConfig, TrainerPartyCompoundTemplate, TrainerPartyMemberStrength, TrainerPartyTemplate, TrainerPoolTier, trainerConfigs, trainerPartyTemplates } from "./data/trainer-config"; +import { TrainerType } from "./data/enums/trainer-type"; import { EnemyPokemon } from "./pokemon"; import * as Utils from "./utils"; diff --git a/src/ui/biome-select-ui-handler.ts b/src/ui/biome-select-ui-handler.ts index 33c4e8217..9bd32befb 100644 --- a/src/ui/biome-select-ui-handler.ts +++ b/src/ui/biome-select-ui-handler.ts @@ -1,5 +1,6 @@ import BattleScene, { Button } from "../battle-scene"; -import { Biome, biomeLinks, getBiomeName } from "../data/biome"; +import { biomeLinks, getBiomeName } from "../data/biomes"; +import { Biome } from "../data/enums/biome"; import { addTextObject, TextStyle } from "./text"; import { Mode } from "./ui"; import UiHandler from "./ui-handler"; diff --git a/src/ui/egg-gacha-ui-handler.ts b/src/ui/egg-gacha-ui-handler.ts index 7cdc3d5ca..1f15bb180 100644 --- a/src/ui/egg-gacha-ui-handler.ts +++ b/src/ui/egg-gacha-ui-handler.ts @@ -3,9 +3,9 @@ import { Mode } from "./ui"; import { TextStyle, addTextObject, getModifierTierTextTint } from "./text"; import MessageUiHandler from "./message-ui-handler"; import * as Utils from "../utils"; -import { ModifierTier } from "../modifier/modifier-type"; +import { ModifierTier } from "../modifier/modifier-tier"; import { EGG_SEED, Egg, GachaType, getEggTierDefaultHatchWaves, getEggDescriptor, getLegendaryGachaSpeciesForTimestamp, getTypeGachaTypeForTimestamp } from "../data/egg"; -import { Voucher, VoucherType, getVoucherTypeIcon } from "../system/voucher"; +import { VoucherType, getVoucherTypeIcon } from "../system/voucher"; import { getPokemonSpecies } from "../data/pokemon-species"; import { Type } from "../data/type"; import { addWindow } from "./window"; diff --git a/src/ui/party-ui-handler.ts b/src/ui/party-ui-handler.ts index 1ebbf6df8..94290a473 100644 --- a/src/ui/party-ui-handler.ts +++ b/src/ui/party-ui-handler.ts @@ -7,7 +7,8 @@ import MessageUiHandler from "./message-ui-handler"; import { Mode } from "./ui"; import * as Utils from "../utils"; import { PokemonFormChangeItemModifier, PokemonHeldItemModifier, SwitchEffectTransferModifier } from "../modifier/modifier"; -import { Moves, allMoves } from "../data/move"; +import { allMoves } from "../data/move"; +import { Moves } from "../data/enums/moves"; import { getGenderColor, getGenderSymbol } from "../data/gender"; import { StatusEffect } from "../data/status-effect"; import PokemonIconAnimHandler, { PokemonIconAnimMode } from "./pokemon-icon-anim-handler"; diff --git a/src/ui/starter-select-ui-handler.ts b/src/ui/starter-select-ui-handler.ts index 65434e8f9..7217960eb 100644 --- a/src/ui/starter-select-ui-handler.ts +++ b/src/ui/starter-select-ui-handler.ts @@ -1,6 +1,6 @@ import BattleScene, { Button } from "../battle-scene"; import PokemonSpecies, { SpeciesFormKey, allSpecies, getPokemonSpecies, speciesStarters as speciesStarterValues } from "../data/pokemon-species"; -import { Species } from "../data/species"; +import { Species } from "../data/enums/species"; import { TextStyle, addBBCodeTextObject, addTextObject, getTextColor } from "./text"; import { Mode } from "./ui"; import MessageUiHandler from "./message-ui-handler"; diff --git a/src/ui/summary-ui-handler.ts b/src/ui/summary-ui-handler.ts index cbf13c329..1967408a4 100644 --- a/src/ui/summary-ui-handler.ts +++ b/src/ui/summary-ui-handler.ts @@ -12,7 +12,7 @@ import { getLevelTotalExp } from "../data/exp"; import { Stat, getStatName } from "../data/pokemon-stat"; import { PokemonHeldItemModifier } from "../modifier/modifier"; import { StatusEffect } from "../data/status-effect"; -import { getBiomeName } from "../data/biome"; +import { getBiomeName } from "../data/biomes"; import { Nature, getNatureStatMultiplier } from "../data/nature"; enum Page { diff --git a/src/ui/text.ts b/src/ui/text.ts index 5b33a2559..f71623789 100644 --- a/src/ui/text.ts +++ b/src/ui/text.ts @@ -1,5 +1,6 @@ import BBCodeText from "phaser3-rex-plugins/plugins/gameobjects/tagtext/bbcodetext/BBCodeText"; import InputText from "phaser3-rex-plugins/plugins/inputtext"; +import { ModifierTier } from "../modifier/modifier-tier"; export enum TextStyle { MESSAGE, @@ -146,15 +147,15 @@ export function getTextColor(textStyle: TextStyle, shadow?: boolean): string { export function getModifierTierTextTint(tier: integer): integer { switch (tier) { - case 0: // ModifierTier.COMMON: + case ModifierTier.COMMON: return 0xffffff; - case 1: // ModifierTier.GREAT: + case ModifierTier.GREAT: return 0x3890f8; - case 2: // ModifierTier.ULTRA: + case ModifierTier.ULTRA: return 0xf8d038; - case 3: // ModifierTier.MASTER: + case ModifierTier.MASTER: return 0xe020c0; - case 4: // ModifierTier.LUXURY: + case ModifierTier.LUXURY: return 0xe64a18; } } \ No newline at end of file diff --git a/src/ui/ui.ts b/src/ui/ui.ts index f1434d135..2aea02646 100644 --- a/src/ui/ui.ts +++ b/src/ui/ui.ts @@ -189,12 +189,22 @@ export default class UI extends Phaser.GameObjects.Container { this.getMessageHandler().showText(text, delay, callback, callbackDelay, prompt, promptDelay); } - showDialogue(text: string, name: string, delay?: integer, callback?: Function, callbackDelay?: integer, prompt?: boolean, promptDelay?: integer): void { - const handler = this.getHandler(); - if (handler instanceof MessageUiHandler) - (handler as MessageUiHandler).showDialogue(text, name, delay, callback, callbackDelay, prompt, promptDelay); - else - this.getMessageHandler().showDialogue(text, name, delay, callback, callbackDelay, prompt, promptDelay); + showDialogue(text: string, name: string, delay: integer = 0, callback: Function, callbackDelay?: integer, prompt?: boolean, promptDelay?: integer): void { + if (text.indexOf('$') > -1) { + const messagePages = text.split(/\$/g).map(m => m.trim()); + let showMessageAndCallback = () => callback(); + for (let p = messagePages.length - 1; p >= 0; p--) { + const originalFunc = showMessageAndCallback; + showMessageAndCallback = () => this.showDialogue(messagePages[p], name, null, originalFunc, null, true); + } + showMessageAndCallback(); + } else { + const handler = this.getHandler(); + if (handler instanceof MessageUiHandler) + (handler as MessageUiHandler).showDialogue(text, name, delay, callback, callbackDelay, prompt, promptDelay); + else + this.getMessageHandler().showDialogue(text, name, delay, callback, callbackDelay, prompt, promptDelay); + } } showTooltip(title: string, content: string, overlap?: boolean): void {