Add gym leaders, elite four, and champions
Add gym leaders, elite four, and champions; add modifier rewards for initial rival battle
This commit is contained in:
1 parent
f5a2723d3d
commit
988438cc81
147 files changed
+123834
-108
No files matched your search
+1
-1
@@ -102,7 +102,7 @@ export class Arena {
|
||||
}
|
||||
|
||||
randomTrainerType(waveIndex: integer): TrainerType {
|
||||
const isBoss = waveIndex % 10 === 0 && !!this.trainerPool[BiomePoolTier.BOSS].length
|
||||
const isBoss = waveIndex > 10 && waveIndex % 20 === 10 && !!this.trainerPool[BiomePoolTier.BOSS].length
|
||||
&& (this.biomeType !== Biome.END || this.scene.gameMode !== GameMode.ENDLESS || waveIndex % 250 === 0);
|
||||
const tierValue = Utils.randSeedInt(!isBoss ? 512 : 64);
|
||||
let tier = !isBoss
|
||||
|
||||
+37
-14
@@ -16,7 +16,7 @@ import { EvolutionPhase } from "./evolution-phase";
|
||||
import { BattlePhase } from "./battle-phase";
|
||||
import { BattleStat, getBattleStatLevelChangeDescription, getBattleStatName } from "./data/battle-stat";
|
||||
import { Biome, biomeLinks } from "./data/biome";
|
||||
import { ModifierTypeOption, PokemonModifierType, PokemonMoveModifierType, TmModifierType, getPlayerModifierTypeOptionsForWave, regenerateModifierPoolThresholds } from "./modifier/modifier-type";
|
||||
import { ModifierType, ModifierTypeOption, PokemonModifierType, PokemonMoveModifierType, TmModifierType, getPlayerModifierTypeOptionsForWave, regenerateModifierPoolThresholds } from "./modifier/modifier-type";
|
||||
import SoundFade from "phaser3-rex-plugins/plugins/soundfade";
|
||||
import { BattlerTagLapseType, BattlerTagType, HideSpriteTag as HiddenTag, TrappedTag } from "./data/battler-tag";
|
||||
import { getPokemonMessage } from "./messages";
|
||||
@@ -943,10 +943,10 @@ export class CommandPhase extends FieldPhase {
|
||||
if (moveIndex > -1 && playerPokemon.getMoveset()[moveIndex].isUsable(queuedMove.ignorePP)) {
|
||||
this.handleCommand(Command.FIGHT, moveIndex, queuedMove.ignorePP, { targets: queuedMove.targets, multiple: queuedMove.targets.length > 1 });
|
||||
} else
|
||||
this.scene.ui.setMode(Mode.COMMAND);
|
||||
this.scene.ui.setMode(Mode.COMMAND, this.fieldIndex);
|
||||
}
|
||||
} else
|
||||
this.scene.ui.setMode(Mode.COMMAND);
|
||||
this.scene.ui.setMode(Mode.COMMAND, this.fieldIndex);
|
||||
}
|
||||
|
||||
handleCommand(command: Command, cursor: integer, ...args: any[]): boolean {
|
||||
@@ -981,18 +981,18 @@ export class CommandPhase extends FieldPhase {
|
||||
break;
|
||||
case Command.BALL:
|
||||
if (this.scene.arena.biomeType === Biome.END) {
|
||||
this.scene.ui.setMode(Mode.COMMAND);
|
||||
this.scene.ui.setMode(Mode.COMMAND, this.fieldIndex);
|
||||
this.scene.ui.setMode(Mode.MESSAGE);
|
||||
this.scene.ui.showText(`A strange force\nprevents using Poké Balls.`, null, () => {
|
||||
this.scene.ui.showText(null, 0);
|
||||
this.scene.ui.setMode(Mode.COMMAND);
|
||||
this.scene.ui.setMode(Mode.COMMAND, this.fieldIndex);
|
||||
}, null, true);
|
||||
} else if (this.scene.currentBattle.battleType === BattleType.TRAINER) {
|
||||
this.scene.ui.setMode(Mode.COMMAND);
|
||||
this.scene.ui.setMode(Mode.COMMAND, this.fieldIndex);
|
||||
this.scene.ui.setMode(Mode.MESSAGE);
|
||||
this.scene.ui.showText(`You can't catch\nanother trainer's Pokémon!`, null, () => {
|
||||
this.scene.ui.showText(null, 0);
|
||||
this.scene.ui.setMode(Mode.COMMAND);
|
||||
this.scene.ui.setMode(Mode.COMMAND, this.fieldIndex);
|
||||
}, null, true);
|
||||
} else if (cursor < 4) {
|
||||
const targets = this.scene.getEnemyField().filter(p => p.isActive(true)).map(p => p.getBattlerIndex());
|
||||
@@ -1009,11 +1009,11 @@ export class CommandPhase extends FieldPhase {
|
||||
case Command.RUN:
|
||||
const isSwitch = command === Command.POKEMON;
|
||||
if (!isSwitch && this.scene.currentBattle.battleType === BattleType.TRAINER) {
|
||||
this.scene.ui.setMode(Mode.COMMAND);
|
||||
this.scene.ui.setMode(Mode.COMMAND, this.fieldIndex);
|
||||
this.scene.ui.setMode(Mode.MESSAGE);
|
||||
this.scene.ui.showText(`You can't run\nfrom a trainer battle!`, null, () => {
|
||||
this.scene.ui.showText(null, 0);
|
||||
this.scene.ui.setMode(Mode.COMMAND);
|
||||
this.scene.ui.setMode(Mode.COMMAND, this.fieldIndex);
|
||||
}, null, true);
|
||||
} else {
|
||||
const trapTag = playerPokemon.findTag(t => t instanceof TrappedTag) as TrappedTag;
|
||||
@@ -1027,11 +1027,11 @@ export class CommandPhase extends FieldPhase {
|
||||
: { command: Command.RUN };
|
||||
success = true;
|
||||
} else if (trapTag) {
|
||||
this.scene.ui.setMode(Mode.COMMAND);
|
||||
this.scene.ui.setMode(Mode.COMMAND, this.fieldIndex);
|
||||
this.scene.ui.setMode(Mode.MESSAGE);
|
||||
this.scene.ui.showText(`${this.scene.getPokemonById(trapTag.sourceId).name}'s ${trapTag.getMoveName()}\nprevents ${isSwitch ? 'switching' : 'fleeing'}!`, null, () => {
|
||||
this.scene.ui.showText(null, 0);
|
||||
this.scene.ui.setMode(Mode.COMMAND);
|
||||
this.scene.ui.setMode(Mode.COMMAND, this.fieldIndex);
|
||||
}, null, true);
|
||||
}
|
||||
}
|
||||
@@ -2086,14 +2086,18 @@ export class TrainerVictoryPhase extends BattlePhase {
|
||||
}
|
||||
|
||||
start() {
|
||||
this.scene.playBgm('victory');
|
||||
this.scene.playBgm(this.scene.currentBattle.trainer.config.victoryBgm);
|
||||
|
||||
const modifierRewardFuncs = this.scene.currentBattle.trainer.config.modifierRewardFuncs;
|
||||
for (let modifierRewardFunc of modifierRewardFuncs)
|
||||
this.scene.unshiftPhase(new ModifierRewardPhase(this.scene, modifierRewardFunc()));
|
||||
|
||||
this.scene.ui.showText(`You defeated\n${this.scene.currentBattle.trainer.getName()}!`, null, () => {
|
||||
const defeatMessages = this.scene.currentBattle.trainer.config.defeatMessages;
|
||||
const defeatMessages = this.scene.currentBattle.trainer.config.victoryMessages;
|
||||
let showMessageAndEnd = () => this.end();//this.scene.ui.showText(`You got ₽0\nfor winning!`, null, () => this.end(), null, true);
|
||||
if (defeatMessages.length) {
|
||||
let message: string;
|
||||
this.scene.executeWithSeedOffset(() => message = Phaser.Math.RND.pick(this.scene.currentBattle.trainer.config.defeatMessages), this.scene.currentBattle.waveIndex);
|
||||
this.scene.executeWithSeedOffset(() => message = Phaser.Math.RND.pick(this.scene.currentBattle.trainer.config.victoryMessages), this.scene.currentBattle.waveIndex);
|
||||
const messagePages = message.split(/\$/g).map(m => m.trim());
|
||||
|
||||
for (let p = messagePages.length - 1; p >= 0; p--) {
|
||||
@@ -2115,6 +2119,24 @@ export class TrainerVictoryPhase extends BattlePhase {
|
||||
}
|
||||
}
|
||||
|
||||
export class ModifierRewardPhase extends BattlePhase {
|
||||
private modifierType: ModifierType;
|
||||
|
||||
constructor(scene: BattleScene, modifierType: ModifierType) {
|
||||
super(scene);
|
||||
|
||||
this.modifierType = modifierType;
|
||||
}
|
||||
|
||||
start() {
|
||||
super.start();
|
||||
|
||||
const newModifier = this.modifierType.newModifier();
|
||||
|
||||
this.scene.addModifier(newModifier, true).then(() => this.scene.ui.showText(`You received\n${newModifier.type.name}!`, null, () => this.end(), null, true));
|
||||
}
|
||||
}
|
||||
|
||||
export class GameOverPhase extends BattlePhase {
|
||||
private victory: boolean;
|
||||
|
||||
@@ -2813,6 +2835,7 @@ export class PartyHealPhase extends BattlePhase {
|
||||
pokemon.resetStatus();
|
||||
for (let move of pokemon.moveset)
|
||||
move.ppUsed = 0;
|
||||
pokemon.updateInfo(true);
|
||||
}
|
||||
const healSong = this.scene.sound.add('heal');
|
||||
healSong.play();
|
||||
|
||||
+12
-4
@@ -309,7 +309,9 @@ export default class BattleScene extends Phaser.Scene {
|
||||
|
||||
this.loadBgm('level_up_fanfare', 'bw/level_up_fanfare.mp3');
|
||||
this.loadBgm('heal', 'bw/heal.mp3');
|
||||
this.loadBgm('victory', 'bw/victory.mp3');
|
||||
this.loadBgm('victory_trainer', 'bw/victory_trainer.mp3');
|
||||
this.loadBgm('victory_gym', 'bw/victory_gym.mp3');
|
||||
this.loadBgm('victory_champion', 'bw/victory_champion.mp3');
|
||||
this.loadBgm('evolution', 'bw/evolution.mp3');
|
||||
this.loadBgm('evolution_fanfare', 'bw/evolution_fanfare.mp3');
|
||||
|
||||
@@ -578,13 +580,17 @@ export default class BattleScene extends Phaser.Scene {
|
||||
battleConfig = fixedBattles[newWaveIndex];
|
||||
newDouble = battleConfig.double;
|
||||
newBattleType = battleConfig.battleType;
|
||||
newTrainer = battleConfig.getTrainer(this);
|
||||
this.executeWithSeedOffset(() => newTrainer = battleConfig.getTrainer(this), newWaveIndex);
|
||||
if (newTrainer)
|
||||
this.field.add(newTrainer);
|
||||
} else {
|
||||
if (battleType === undefined) {
|
||||
const trainerChance = this.arena.getTrainerChance();
|
||||
newBattleType = trainerChance && !Utils.randSeedInt(trainerChance) ? BattleType.TRAINER : BattleType.WILD;
|
||||
if (newWaveIndex > 10 && newWaveIndex % 20 === 10)
|
||||
newBattleType = BattleType.TRAINER;
|
||||
else {
|
||||
const trainerChance = this.arena.getTrainerChance();
|
||||
newBattleType = trainerChance && !Utils.randSeedInt(trainerChance) ? BattleType.TRAINER : BattleType.WILD;
|
||||
}
|
||||
} else
|
||||
newBattleType = battleType;
|
||||
|
||||
@@ -883,6 +889,8 @@ export default class BattleScene extends Phaser.Scene {
|
||||
|
||||
getBgmLoopPoint(bgmName: string): number {
|
||||
switch (bgmName) {
|
||||
case 'battle_champion':
|
||||
return 27.653;
|
||||
case 'battle_cynthia':
|
||||
return 12.235;
|
||||
case 'battle_elite':
|
||||
|
||||
+13
-3
@@ -94,7 +94,7 @@ export default class Battle {
|
||||
getBgmOverride(): string {
|
||||
const battlers = this.enemyParty.slice(0, this.getBattlerCount());
|
||||
if (this.battleType === BattleType.TRAINER) {
|
||||
if (!this.started && this.trainer.config.encounterMessages.length)
|
||||
if (!this.started && this.trainer.config.encounterBgm && this.trainer.config.encounterMessages.length)
|
||||
return `encounter_${this.trainer.getEncounterBgm()}`;
|
||||
return this.trainer.getBattleBgm();
|
||||
}
|
||||
@@ -110,7 +110,7 @@ export default class Battle {
|
||||
}
|
||||
}
|
||||
|
||||
if (this.waveIndex <= 3)
|
||||
if (this.waveIndex <= 4)
|
||||
return 'battle_wild';
|
||||
|
||||
return null;
|
||||
@@ -161,7 +161,7 @@ interface FixedBattleConfigs {
|
||||
|
||||
export const fixedBattles: FixedBattleConfigs = {
|
||||
[5]: new FixedBattleConfig().setBattleType(BattleType.TRAINER)
|
||||
.setGetTrainerFunc(scene => new Trainer(scene, TrainerType.YOUNGSTER, !!Utils.randInt(2))),
|
||||
.setGetTrainerFunc(scene => new Trainer(scene, TrainerType.YOUNGSTER, !!Utils.randSeedInt(2))),
|
||||
[8]: new FixedBattleConfig().setBattleType(BattleType.TRAINER)
|
||||
.setGetTrainerFunc(scene => new Trainer(scene, TrainerType.RIVAL, true)),
|
||||
[25]: new FixedBattleConfig().setBattleType(BattleType.TRAINER)
|
||||
@@ -172,6 +172,16 @@ export const fixedBattles: FixedBattleConfigs = {
|
||||
.setGetTrainerFunc(scene => new Trainer(scene, TrainerType.RIVAL_4, true)),
|
||||
[145]: new FixedBattleConfig().setBattleType(BattleType.TRAINER)
|
||||
.setGetTrainerFunc(scene => new Trainer(scene, TrainerType.RIVAL_5, true)),
|
||||
[186]: new FixedBattleConfig().setBattleType(BattleType.TRAINER)
|
||||
.setGetTrainerFunc(scene => new Trainer(scene, TrainerType.SHAUNTAL)),
|
||||
[187]: new FixedBattleConfig().setBattleType(BattleType.TRAINER)
|
||||
.setGetTrainerFunc(scene => new Trainer(scene, TrainerType.MARSHAL)),
|
||||
[188]: new FixedBattleConfig().setBattleType(BattleType.TRAINER)
|
||||
.setGetTrainerFunc(scene => new Trainer(scene, TrainerType.GRIMSLEY)),
|
||||
[189]: new FixedBattleConfig().setBattleType(BattleType.TRAINER)
|
||||
.setGetTrainerFunc(scene => new Trainer(scene, TrainerType.CAITLIN)),
|
||||
[190]: new FixedBattleConfig().setBattleType(BattleType.TRAINER)
|
||||
.setGetTrainerFunc(scene => new Trainer(scene, Phaser.Math.RND.pick([ TrainerType.BLUE, TrainerType.RED, TrainerType.LANCE, TrainerType.STEVEN, TrainerType.WALLACE, TrainerType.CYNTHIA, TrainerType.IRIS, TrainerType.ALDER, TrainerType.CYNTHIA ]))),
|
||||
[199]: new FixedBattleConfig().setBattleType(BattleType.TRAINER)
|
||||
.setGetTrainerFunc(scene => new Trainer(scene, TrainerType.RIVAL_6, true))
|
||||
}
|
||||
+223
-30
@@ -5,6 +5,7 @@ import * as Utils from '../utils';
|
||||
|
||||
import beautify from 'json-beautify';
|
||||
import { TrainerType } from "./trainer-type";
|
||||
import { allSpecies } from "./pokemon-species";
|
||||
|
||||
export enum Biome {
|
||||
TOWN,
|
||||
@@ -776,7 +777,7 @@ export const biomeTrainerPools: BiomeTrainerPools = {
|
||||
[BiomePoolTier.RARE]: [ TrainerType.BLACK_BELT ],
|
||||
[BiomePoolTier.SUPER_RARE]: [],
|
||||
[BiomePoolTier.ULTRA_RARE]: [],
|
||||
[BiomePoolTier.BOSS]: [],
|
||||
[BiomePoolTier.BOSS]: [ TrainerType.NORMAN, TrainerType.CHEREN, TrainerType.LENORA ],
|
||||
[BiomePoolTier.BOSS_RARE]: [],
|
||||
[BiomePoolTier.BOSS_SUPER_RARE]: [],
|
||||
[BiomePoolTier.BOSS_ULTRA_RARE]: []
|
||||
@@ -787,7 +788,7 @@ export const biomeTrainerPools: BiomeTrainerPools = {
|
||||
[BiomePoolTier.RARE]: [ TrainerType.BLACK_BELT ],
|
||||
[BiomePoolTier.SUPER_RARE]: [],
|
||||
[BiomePoolTier.ULTRA_RARE]: [],
|
||||
[BiomePoolTier.BOSS]: [],
|
||||
[BiomePoolTier.BOSS]: [ TrainerType.ERIKA, TrainerType.GARDENIA ],
|
||||
[BiomePoolTier.BOSS_RARE]: [],
|
||||
[BiomePoolTier.BOSS_SUPER_RARE]: [],
|
||||
[BiomePoolTier.BOSS_ULTRA_RARE]: []
|
||||
@@ -798,7 +799,7 @@ export const biomeTrainerPools: BiomeTrainerPools = {
|
||||
[BiomePoolTier.RARE]: [],
|
||||
[BiomePoolTier.SUPER_RARE]: [],
|
||||
[BiomePoolTier.ULTRA_RARE]: [],
|
||||
[BiomePoolTier.BOSS]: [],
|
||||
[BiomePoolTier.BOSS]: [ TrainerType.ERIKA, TrainerType.GARDENIA ],
|
||||
[BiomePoolTier.BOSS_RARE]: [],
|
||||
[BiomePoolTier.BOSS_SUPER_RARE]: [],
|
||||
[BiomePoolTier.BOSS_ULTRA_RARE]: []
|
||||
@@ -820,7 +821,7 @@ export const biomeTrainerPools: BiomeTrainerPools = {
|
||||
[BiomePoolTier.RARE]: [],
|
||||
[BiomePoolTier.SUPER_RARE]: [],
|
||||
[BiomePoolTier.ULTRA_RARE]: [],
|
||||
[BiomePoolTier.BOSS]: [],
|
||||
[BiomePoolTier.BOSS]: [ TrainerType.BUGSY, TrainerType.BURGH ],
|
||||
[BiomePoolTier.BOSS_RARE]: [],
|
||||
[BiomePoolTier.BOSS_SUPER_RARE]: [],
|
||||
[BiomePoolTier.BOSS_ULTRA_RARE]: []
|
||||
@@ -831,7 +832,7 @@ export const biomeTrainerPools: BiomeTrainerPools = {
|
||||
[BiomePoolTier.RARE]: [],
|
||||
[BiomePoolTier.SUPER_RARE]: [],
|
||||
[BiomePoolTier.ULTRA_RARE]: [],
|
||||
[BiomePoolTier.BOSS]: [],
|
||||
[BiomePoolTier.BOSS]: [ TrainerType.JUAN, TrainerType.CRASHER_WAKE, TrainerType.MARLON ],
|
||||
[BiomePoolTier.BOSS_RARE]: [],
|
||||
[BiomePoolTier.BOSS_SUPER_RARE]: [],
|
||||
[BiomePoolTier.BOSS_ULTRA_RARE]: []
|
||||
@@ -842,7 +843,7 @@ export const biomeTrainerPools: BiomeTrainerPools = {
|
||||
[BiomePoolTier.RARE]: [ TrainerType.BLACK_BELT ],
|
||||
[BiomePoolTier.SUPER_RARE]: [],
|
||||
[BiomePoolTier.ULTRA_RARE]: [],
|
||||
[BiomePoolTier.BOSS]: [],
|
||||
[BiomePoolTier.BOSS]: [ TrainerType.JANINE, TrainerType.ROXIE ],
|
||||
[BiomePoolTier.BOSS_RARE]: [],
|
||||
[BiomePoolTier.BOSS_SUPER_RARE]: [],
|
||||
[BiomePoolTier.BOSS_ULTRA_RARE]: []
|
||||
@@ -853,7 +854,7 @@ export const biomeTrainerPools: BiomeTrainerPools = {
|
||||
[BiomePoolTier.RARE]: [ TrainerType.BLACK_BELT ],
|
||||
[BiomePoolTier.SUPER_RARE]: [],
|
||||
[BiomePoolTier.ULTRA_RARE]: [],
|
||||
[BiomePoolTier.BOSS]: [],
|
||||
[BiomePoolTier.BOSS]: [ TrainerType.MISTY ],
|
||||
[BiomePoolTier.BOSS_RARE]: [],
|
||||
[BiomePoolTier.BOSS_SUPER_RARE]: [],
|
||||
[BiomePoolTier.BOSS_ULTRA_RARE]: []
|
||||
@@ -864,7 +865,7 @@ export const biomeTrainerPools: BiomeTrainerPools = {
|
||||
[BiomePoolTier.RARE]: [ TrainerType.BLACK_BELT ],
|
||||
[BiomePoolTier.SUPER_RARE]: [],
|
||||
[BiomePoolTier.ULTRA_RARE]: [],
|
||||
[BiomePoolTier.BOSS]: [],
|
||||
[BiomePoolTier.BOSS]: [ TrainerType.MISTY ],
|
||||
[BiomePoolTier.BOSS_RARE]: [],
|
||||
[BiomePoolTier.BOSS_SUPER_RARE]: [],
|
||||
[BiomePoolTier.BOSS_ULTRA_RARE]: []
|
||||
@@ -875,7 +876,7 @@ export const biomeTrainerPools: BiomeTrainerPools = {
|
||||
[BiomePoolTier.RARE]: [],
|
||||
[BiomePoolTier.SUPER_RARE]: [],
|
||||
[BiomePoolTier.ULTRA_RARE]: [],
|
||||
[BiomePoolTier.BOSS]: [],
|
||||
[BiomePoolTier.BOSS]: [ TrainerType.JUAN, TrainerType.CRASHER_WAKE, TrainerType.MARLON ],
|
||||
[BiomePoolTier.BOSS_RARE]: [],
|
||||
[BiomePoolTier.BOSS_SUPER_RARE]: [],
|
||||
[BiomePoolTier.BOSS_ULTRA_RARE]: []
|
||||
@@ -886,7 +887,7 @@ export const biomeTrainerPools: BiomeTrainerPools = {
|
||||
[BiomePoolTier.RARE]: [],
|
||||
[BiomePoolTier.SUPER_RARE]: [],
|
||||
[BiomePoolTier.ULTRA_RARE]: [],
|
||||
[BiomePoolTier.BOSS]: [],
|
||||
[BiomePoolTier.BOSS]: [ TrainerType.FALKNER, TrainerType.WINONA, TrainerType.SKYLA ],
|
||||
[BiomePoolTier.BOSS_RARE]: [],
|
||||
[BiomePoolTier.BOSS_SUPER_RARE]: [],
|
||||
[BiomePoolTier.BOSS_ULTRA_RARE]: []
|
||||
@@ -897,7 +898,7 @@ export const biomeTrainerPools: BiomeTrainerPools = {
|
||||
[BiomePoolTier.RARE]: [],
|
||||
[BiomePoolTier.SUPER_RARE]: [],
|
||||
[BiomePoolTier.ULTRA_RARE]: [],
|
||||
[BiomePoolTier.BOSS]: [],
|
||||
[BiomePoolTier.BOSS]: [ TrainerType.GIOVANNI ],
|
||||
[BiomePoolTier.BOSS_RARE]: [],
|
||||
[BiomePoolTier.BOSS_SUPER_RARE]: [],
|
||||
[BiomePoolTier.BOSS_ULTRA_RARE]: []
|
||||
@@ -908,7 +909,7 @@ export const biomeTrainerPools: BiomeTrainerPools = {
|
||||
[BiomePoolTier.RARE]: [],
|
||||
[BiomePoolTier.SUPER_RARE]: [],
|
||||
[BiomePoolTier.ULTRA_RARE]: [],
|
||||
[BiomePoolTier.BOSS]: [],
|
||||
[BiomePoolTier.BOSS]: [ TrainerType.BROCK, TrainerType.ROXANNE, TrainerType.ROARK ],
|
||||
[BiomePoolTier.BOSS_RARE]: [],
|
||||
[BiomePoolTier.BOSS_SUPER_RARE]: [],
|
||||
[BiomePoolTier.BOSS_ULTRA_RARE]: []
|
||||
@@ -919,7 +920,7 @@ export const biomeTrainerPools: BiomeTrainerPools = {
|
||||
[BiomePoolTier.RARE]: [],
|
||||
[BiomePoolTier.SUPER_RARE]: [],
|
||||
[BiomePoolTier.ULTRA_RARE]: [],
|
||||
[BiomePoolTier.BOSS]: [],
|
||||
[BiomePoolTier.BOSS]: [ TrainerType.CLAY ],
|
||||
[BiomePoolTier.BOSS_RARE]: [],
|
||||
[BiomePoolTier.BOSS_SUPER_RARE]: [],
|
||||
[BiomePoolTier.BOSS_ULTRA_RARE]: []
|
||||
@@ -930,7 +931,7 @@ export const biomeTrainerPools: BiomeTrainerPools = {
|
||||
[BiomePoolTier.RARE]: [],
|
||||
[BiomePoolTier.SUPER_RARE]: [],
|
||||
[BiomePoolTier.ULTRA_RARE]: [],
|
||||
[BiomePoolTier.BOSS]: [],
|
||||
[BiomePoolTier.BOSS]: [ TrainerType.PRYCE, TrainerType.CANDICE, TrainerType.BRYCEN ],
|
||||
[BiomePoolTier.BOSS_RARE]: [],
|
||||
[BiomePoolTier.BOSS_SUPER_RARE]: [],
|
||||
[BiomePoolTier.BOSS_ULTRA_RARE]: []
|
||||
@@ -941,7 +942,7 @@ export const biomeTrainerPools: BiomeTrainerPools = {
|
||||
[BiomePoolTier.RARE]: [],
|
||||
[BiomePoolTier.SUPER_RARE]: [],
|
||||
[BiomePoolTier.ULTRA_RARE]: [],
|
||||
[BiomePoolTier.BOSS]: [],
|
||||
[BiomePoolTier.BOSS]: [ TrainerType.WHITNEY ],
|
||||
[BiomePoolTier.BOSS_RARE]: [],
|
||||
[BiomePoolTier.BOSS_SUPER_RARE]: [],
|
||||
[BiomePoolTier.BOSS_ULTRA_RARE]: []
|
||||
@@ -952,7 +953,7 @@ export const biomeTrainerPools: BiomeTrainerPools = {
|
||||
[BiomePoolTier.RARE]: [],
|
||||
[BiomePoolTier.SUPER_RARE]: [],
|
||||
[BiomePoolTier.ULTRA_RARE]: [],
|
||||
[BiomePoolTier.BOSS]: [],
|
||||
[BiomePoolTier.BOSS]: [ TrainerType.LT_SURGE, TrainerType.WATTSON, TrainerType.VOLKNER, TrainerType.ELESA ],
|
||||
[BiomePoolTier.BOSS_RARE]: [],
|
||||
[BiomePoolTier.BOSS_SUPER_RARE]: [],
|
||||
[BiomePoolTier.BOSS_ULTRA_RARE]: []
|
||||
@@ -963,7 +964,7 @@ export const biomeTrainerPools: BiomeTrainerPools = {
|
||||
[BiomePoolTier.RARE]: [],
|
||||
[BiomePoolTier.SUPER_RARE]: [],
|
||||
[BiomePoolTier.ULTRA_RARE]: [],
|
||||
[BiomePoolTier.BOSS]: [],
|
||||
[BiomePoolTier.BOSS]: [ TrainerType.BLAINE, TrainerType.FLANNERY ],
|
||||
[BiomePoolTier.BOSS_RARE]: [],
|
||||
[BiomePoolTier.BOSS_SUPER_RARE]: [],
|
||||
[BiomePoolTier.BOSS_ULTRA_RARE]: []
|
||||
@@ -974,7 +975,7 @@ export const biomeTrainerPools: BiomeTrainerPools = {
|
||||
[BiomePoolTier.RARE]: [],
|
||||
[BiomePoolTier.SUPER_RARE]: [],
|
||||
[BiomePoolTier.ULTRA_RARE]: [],
|
||||
[BiomePoolTier.BOSS]: [],
|
||||
[BiomePoolTier.BOSS]: [ TrainerType.FANTINA ],
|
||||
[BiomePoolTier.BOSS_RARE]: [],
|
||||
[BiomePoolTier.BOSS_SUPER_RARE]: [],
|
||||
[BiomePoolTier.BOSS_ULTRA_RARE]: []
|
||||
@@ -985,7 +986,7 @@ export const biomeTrainerPools: BiomeTrainerPools = {
|
||||
[BiomePoolTier.RARE]: [],
|
||||
[BiomePoolTier.SUPER_RARE]: [],
|
||||
[BiomePoolTier.ULTRA_RARE]: [],
|
||||
[BiomePoolTier.BOSS]: [],
|
||||
[BiomePoolTier.BOSS]: [ TrainerType.CHUCK, TrainerType.BRAWLY ],
|
||||
[BiomePoolTier.BOSS_RARE]: [],
|
||||
[BiomePoolTier.BOSS_SUPER_RARE]: [],
|
||||
[BiomePoolTier.BOSS_ULTRA_RARE]: []
|
||||
@@ -996,7 +997,7 @@ export const biomeTrainerPools: BiomeTrainerPools = {
|
||||
[BiomePoolTier.RARE]: [],
|
||||
[BiomePoolTier.SUPER_RARE]: [],
|
||||
[BiomePoolTier.ULTRA_RARE]: [],
|
||||
[BiomePoolTier.BOSS]: [],
|
||||
[BiomePoolTier.BOSS]: [ TrainerType.JASMINE, TrainerType.BYRON ],
|
||||
[BiomePoolTier.BOSS_RARE]: [],
|
||||
[BiomePoolTier.BOSS_SUPER_RARE]: [],
|
||||
[BiomePoolTier.BOSS_ULTRA_RARE]: []
|
||||
@@ -1007,7 +1008,7 @@ export const biomeTrainerPools: BiomeTrainerPools = {
|
||||
[BiomePoolTier.RARE]: [],
|
||||
[BiomePoolTier.SUPER_RARE]: [],
|
||||
[BiomePoolTier.ULTRA_RARE]: [],
|
||||
[BiomePoolTier.BOSS]: [],
|
||||
[BiomePoolTier.BOSS]: [ TrainerType.SABRINA, TrainerType.TATE, TrainerType.LIZA ],
|
||||
[BiomePoolTier.BOSS_RARE]: [],
|
||||
[BiomePoolTier.BOSS_SUPER_RARE]: [],
|
||||
[BiomePoolTier.BOSS_ULTRA_RARE]: []
|
||||
@@ -1018,7 +1019,7 @@ export const biomeTrainerPools: BiomeTrainerPools = {
|
||||
[BiomePoolTier.RARE]: [],
|
||||
[BiomePoolTier.SUPER_RARE]: [],
|
||||
[BiomePoolTier.ULTRA_RARE]: [],
|
||||
[BiomePoolTier.BOSS]: [],
|
||||
[BiomePoolTier.BOSS]: [ TrainerType.CLAIR, TrainerType.DRAYDEN ],
|
||||
[BiomePoolTier.BOSS_RARE]: [],
|
||||
[BiomePoolTier.BOSS_SUPER_RARE]: [],
|
||||
[BiomePoolTier.BOSS_ULTRA_RARE]: []
|
||||
@@ -1029,7 +1030,7 @@ export const biomeTrainerPools: BiomeTrainerPools = {
|
||||
[BiomePoolTier.RARE]: [],
|
||||
[BiomePoolTier.SUPER_RARE]: [],
|
||||
[BiomePoolTier.ULTRA_RARE]: [],
|
||||
[BiomePoolTier.BOSS]: [],
|
||||
[BiomePoolTier.BOSS]: [ TrainerType.MORTY ],
|
||||
[BiomePoolTier.BOSS_RARE]: [],
|
||||
[BiomePoolTier.BOSS_SUPER_RARE]: [],
|
||||
[BiomePoolTier.BOSS_ULTRA_RARE]: []
|
||||
@@ -1040,7 +1041,7 @@ export const biomeTrainerPools: BiomeTrainerPools = {
|
||||
[BiomePoolTier.RARE]: [],
|
||||
[BiomePoolTier.SUPER_RARE]: [],
|
||||
[BiomePoolTier.ULTRA_RARE]: [],
|
||||
[BiomePoolTier.BOSS]: [],
|
||||
[BiomePoolTier.BOSS]: [ TrainerType.SABRINA ],
|
||||
[BiomePoolTier.BOSS_RARE]: [],
|
||||
[BiomePoolTier.BOSS_SUPER_RARE]: [],
|
||||
[BiomePoolTier.BOSS_ULTRA_RARE]: []
|
||||
@@ -1051,7 +1052,7 @@ export const biomeTrainerPools: BiomeTrainerPools = {
|
||||
[BiomePoolTier.RARE]: [],
|
||||
[BiomePoolTier.SUPER_RARE]: [],
|
||||
[BiomePoolTier.ULTRA_RARE]: [],
|
||||
[BiomePoolTier.BOSS]: [],
|
||||
[BiomePoolTier.BOSS]: [ TrainerType.CHUCK ],
|
||||
[BiomePoolTier.BOSS_RARE]: [],
|
||||
[BiomePoolTier.BOSS_SUPER_RARE]: [],
|
||||
[BiomePoolTier.BOSS_ULTRA_RARE]: []
|
||||
@@ -1062,7 +1063,7 @@ export const biomeTrainerPools: BiomeTrainerPools = {
|
||||
[BiomePoolTier.RARE]: [],
|
||||
[BiomePoolTier.SUPER_RARE]: [],
|
||||
[BiomePoolTier.ULTRA_RARE]: [],
|
||||
[BiomePoolTier.BOSS]: [],
|
||||
[BiomePoolTier.BOSS]: [ TrainerType.ERIKA, TrainerType.GARDENIA ],
|
||||
[BiomePoolTier.BOSS_RARE]: [],
|
||||
[BiomePoolTier.BOSS_SUPER_RARE]: [],
|
||||
[BiomePoolTier.BOSS_ULTRA_RARE]: []
|
||||
@@ -4362,9 +4363,201 @@ export const biomeTrainerPools: BiomeTrainerPools = {
|
||||
[ Biome.TOWN, BiomePoolTier.COMMON ]
|
||||
]
|
||||
],
|
||||
[ TrainerType.RIVAL, [] ],
|
||||
[ TrainerType.CYNTHIA, [] ]
|
||||
]
|
||||
[ TrainerType.BROCK, [
|
||||
[ Biome.CAVE, BiomePoolTier.BOSS ]
|
||||
]
|
||||
],
|
||||
[ TrainerType.MISTY, [
|
||||
[ Biome.LAKE, BiomePoolTier.BOSS ],
|
||||
[ Biome.BEACH, BiomePoolTier.BOSS ]
|
||||
]
|
||||
],
|
||||
[ TrainerType.LT_SURGE, [
|
||||
[ Biome.POWER_PLANT, BiomePoolTier.BOSS ]
|
||||
]
|
||||
],
|
||||
[ TrainerType.ERIKA, [
|
||||
[ Biome.GRASS, BiomePoolTier.BOSS ],
|
||||
[ Biome.TALL_GRASS, BiomePoolTier.BOSS ],
|
||||
[ Biome.JUNGLE, BiomePoolTier.BOSS ]
|
||||
]
|
||||
],
|
||||
[ TrainerType.JANINE, [
|
||||
[ Biome.SWAMP, BiomePoolTier.BOSS ]
|
||||
]
|
||||
],
|
||||
[ TrainerType.SABRINA, [
|
||||
[ Biome.RUINS, BiomePoolTier.BOSS ],
|
||||
[ Biome.SPACE, BiomePoolTier.BOSS ]
|
||||
]
|
||||
],
|
||||
[ TrainerType.GIOVANNI, [
|
||||
[ Biome.BADLANDS, BiomePoolTier.BOSS ]
|
||||
]
|
||||
],
|
||||
[ TrainerType.BLAINE, [
|
||||
[ Biome.VOLCANO, BiomePoolTier.BOSS ]
|
||||
]
|
||||
],
|
||||
[ TrainerType.FALKNER, [
|
||||
[ Biome.MOUNTAIN, BiomePoolTier.BOSS ]
|
||||
]
|
||||
],
|
||||
[ TrainerType.BUGSY, [
|
||||
[ Biome.FOREST, BiomePoolTier.BOSS ]
|
||||
]
|
||||
],
|
||||
[ TrainerType.WHITNEY, [
|
||||
[ Biome.MEADOW, BiomePoolTier.BOSS ]
|
||||
]
|
||||
],
|
||||
[ TrainerType.MORTY, [
|
||||
[ Biome.ABYSS, BiomePoolTier.BOSS ]
|
||||
]
|
||||
],
|
||||
[ TrainerType.CHUCK, [
|
||||
[ Biome.DOJO, BiomePoolTier.BOSS ],
|
||||
[ Biome.CONSTRUCTION_SITE, BiomePoolTier.BOSS ]
|
||||
]
|
||||
],
|
||||
[ TrainerType.JASMINE, [
|
||||
[ Biome.FACTORY, BiomePoolTier.BOSS ]
|
||||
]
|
||||
],
|
||||
[ TrainerType.PRYCE, [
|
||||
[ Biome.ICE_CAVE, BiomePoolTier.BOSS ]
|
||||
]
|
||||
],
|
||||
[ TrainerType.CLAIR, [
|
||||
[ Biome.WASTELAND, BiomePoolTier.BOSS ]
|
||||
]
|
||||
],
|
||||
[ TrainerType.ROXANNE, [
|
||||
[ Biome.CAVE, BiomePoolTier.BOSS ]
|
||||
]
|
||||
],
|
||||
[ TrainerType.BRAWLY, [
|
||||
[ Biome.DOJO, BiomePoolTier.BOSS ]
|
||||
]
|
||||
],
|
||||
[ TrainerType.WATTSON, [
|
||||
[ Biome.POWER_PLANT, BiomePoolTier.BOSS ]
|
||||
]
|
||||
],
|
||||
[ TrainerType.FLANNERY, [
|
||||
[ Biome.VOLCANO, BiomePoolTier.BOSS ]
|
||||
]
|
||||
],
|
||||
[ TrainerType.NORMAN, [
|
||||
[ Biome.PLAINS, BiomePoolTier.BOSS ]
|
||||
]
|
||||
],
|
||||
[ TrainerType.WINONA, [
|
||||
[ Biome.MOUNTAIN, BiomePoolTier.BOSS ]
|
||||
]
|
||||
],
|
||||
[ TrainerType.TATE, [
|
||||
[ Biome.RUINS, BiomePoolTier.BOSS ]
|
||||
]
|
||||
],
|
||||
[ TrainerType.LIZA, [
|
||||
[ Biome.RUINS, BiomePoolTier.BOSS ]
|
||||
]
|
||||
],
|
||||
[ TrainerType.JUAN, [
|
||||
[ Biome.SEA, BiomePoolTier.BOSS ],
|
||||
[ Biome.SEABED, BiomePoolTier.BOSS ]
|
||||
]
|
||||
],
|
||||
[ TrainerType.ROARK, [
|
||||
[ Biome.CAVE, BiomePoolTier.BOSS ]
|
||||
]
|
||||
],
|
||||
[ TrainerType.GARDENIA, [
|
||||
[ Biome.GRASS, BiomePoolTier.BOSS ],
|
||||
[ Biome.TALL_GRASS, BiomePoolTier.BOSS ],
|
||||
[ Biome.JUNGLE, BiomePoolTier.BOSS ]
|
||||
]
|
||||
],
|
||||
[ TrainerType.CRASHER_WAKE, [
|
||||
[ Biome.SEA, BiomePoolTier.BOSS ],
|
||||
[ Biome.SEABED, BiomePoolTier.BOSS ]
|
||||
]
|
||||
],
|
||||
[ TrainerType.FANTINA, [
|
||||
[ Biome.GRAVEYARD, BiomePoolTier.BOSS ]
|
||||
]
|
||||
],
|
||||
[ TrainerType.BYRON, [
|
||||
[ Biome.FACTORY, BiomePoolTier.BOSS ]
|
||||
]
|
||||
],
|
||||
[ TrainerType.CANDICE, [
|
||||
[ Biome.ICE_CAVE, BiomePoolTier.BOSS ]
|
||||
]
|
||||
],
|
||||
[ TrainerType.VOLKNER, [
|
||||
[ Biome.POWER_PLANT, BiomePoolTier.BOSS ]
|
||||
]
|
||||
],
|
||||
[ TrainerType.CILAN, [] ],
|
||||
[ TrainerType.CHILI, [] ],
|
||||
[ TrainerType.CRESS, [] ],
|
||||
[ TrainerType.CHEREN, [
|
||||
[ Biome.PLAINS, BiomePoolTier.BOSS ]
|
||||
]
|
||||
],
|
||||
[ TrainerType.LENORA, [
|
||||
[ Biome.PLAINS, BiomePoolTier.BOSS ]
|
||||
]
|
||||
],
|
||||
[ TrainerType.ROXIE, [
|
||||
[ Biome.SWAMP, BiomePoolTier.BOSS ]
|
||||
]
|
||||
],
|
||||
[ TrainerType.BURGH, [
|
||||
[ Biome.FOREST, BiomePoolTier.BOSS ]
|
||||
]
|
||||
],
|
||||
[ TrainerType.ELESA, [
|
||||
[ Biome.POWER_PLANT, BiomePoolTier.BOSS ]
|
||||
]
|
||||
],
|
||||
[ TrainerType.CLAY, [
|
||||
[ Biome.DESERT, BiomePoolTier.BOSS ]
|
||||
]
|
||||
],
|
||||
[ TrainerType.SKYLA, [
|
||||
[ Biome.MOUNTAIN, BiomePoolTier.BOSS ]
|
||||
]
|
||||
],
|
||||
[ TrainerType.BRYCEN, [
|
||||
[ Biome.ICE_CAVE, BiomePoolTier.BOSS ]
|
||||
]
|
||||
],
|
||||
[ TrainerType.DRAYDEN, [
|
||||
[ Biome.WASTELAND, BiomePoolTier.BOSS ]
|
||||
]
|
||||
],
|
||||
[ TrainerType.MARLON, [
|
||||
[ Biome.SEA, BiomePoolTier.BOSS ],
|
||||
[ Biome.SEABED, BiomePoolTier.BOSS ]
|
||||
]
|
||||
],
|
||||
[ TrainerType.SHAUNTAL, [] ],
|
||||
[ TrainerType.MARSHAL, [] ],
|
||||
[ TrainerType.GRIMSLEY, [] ],
|
||||
[ TrainerType.CAITLIN, [] ],
|
||||
[ TrainerType.BLUE, [] ],
|
||||
[ TrainerType.RED, [] ],
|
||||
[ TrainerType.LANCE, [] ],
|
||||
[ TrainerType.STEVEN, [] ],
|
||||
[ TrainerType.WALLACE, [] ],
|
||||
[ TrainerType.CYNTHIA, [] ],
|
||||
[ TrainerType.ALDER, [] ],
|
||||
[ TrainerType.IRIS, [] ],
|
||||
[ TrainerType.RIVAL, [] ]
|
||||
];
|
||||
|
||||
for (let biome of Utils.getEnumValues(Biome)) {
|
||||
biomePokemonPools[biome] = {};
|
||||
@@ -4530,7 +4723,7 @@ export const biomeTrainerPools: BiomeTrainerPools = {
|
||||
}
|
||||
}
|
||||
if (poolTier > -1)
|
||||
pokemonBiomes[pokemon.speciesId - 1][3].push([ Biome[b], BiomePoolTier[BiomePoolTier] ]);
|
||||
pokemonBiomes[pokemon.speciesId - 1][3].push([ Biome[b], BiomePoolTier[poolTier] ]);
|
||||
} else if (biomePoolPredicates[b](pokemon)) {
|
||||
pokemonBiomes[pokemon.speciesId - 1][3].push([ Biome[b], BiomePoolTier[BiomePoolTier.COMMON] ]);
|
||||
}
|
||||
|
||||
+225
-31
@@ -1,4 +1,5 @@
|
||||
import BattleScene from "../battle-scene";
|
||||
import { ModifierType, modifierTypes } from "../modifier/modifier-type";
|
||||
import { EnemyPokemon } from "../pokemon";
|
||||
import * as Utils from "../utils";
|
||||
import { Moves } from "./move";
|
||||
@@ -58,7 +59,68 @@ export enum TrainerType {
|
||||
WAITER,
|
||||
WORKER,
|
||||
YOUNGSTER,
|
||||
|
||||
BROCK,
|
||||
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,
|
||||
|
||||
SHAUNTAL,
|
||||
MARSHAL,
|
||||
GRIMSLEY,
|
||||
CAITLIN,
|
||||
|
||||
BLUE,
|
||||
RED,
|
||||
LANCE,
|
||||
STEVEN,
|
||||
WALLACE,
|
||||
CYNTHIA,
|
||||
ALDER,
|
||||
IRIS,
|
||||
|
||||
RIVAL,
|
||||
RIVAL_2,
|
||||
RIVAL_3,
|
||||
@@ -184,6 +246,15 @@ export const trainerPartyTemplates = {
|
||||
SIX_WEAKER_SAME: new TrainerPartyTemplate(6, TrainerPartyMemberStrength.WEAKER, true),
|
||||
SIX_WEAK_BALANCED: new TrainerPartyTemplate(6, TrainerPartyMemberStrength.WEAK, false, true),
|
||||
|
||||
GYM_LEADER_1: new TrainerPartyCompoundTemplate(new TrainerPartyTemplate(1, TrainerPartyMemberStrength.STRONG), new TrainerPartyTemplate(1, TrainerPartyMemberStrength.STRONGER)),
|
||||
GYM_LEADER_2: new TrainerPartyCompoundTemplate(new TrainerPartyTemplate(2, TrainerPartyMemberStrength.AVERAGE), new TrainerPartyTemplate(1, TrainerPartyMemberStrength.STRONG), new TrainerPartyTemplate(1, TrainerPartyMemberStrength.STRONGER)),
|
||||
GYM_LEADER_3: new TrainerPartyCompoundTemplate(new TrainerPartyTemplate(3, TrainerPartyMemberStrength.AVERAGE), new TrainerPartyTemplate(1, TrainerPartyMemberStrength.STRONG), new TrainerPartyTemplate(1, TrainerPartyMemberStrength.STRONGER)),
|
||||
GYM_LEADER_4: new TrainerPartyCompoundTemplate(new TrainerPartyTemplate(4, TrainerPartyMemberStrength.AVERAGE), new TrainerPartyTemplate(1, TrainerPartyMemberStrength.STRONG), new TrainerPartyTemplate(1, TrainerPartyMemberStrength.STRONGER)),
|
||||
|
||||
ELITE_FOUR: new TrainerPartyCompoundTemplate(new TrainerPartyTemplate(3, TrainerPartyMemberStrength.AVERAGE), new TrainerPartyTemplate(2, TrainerPartyMemberStrength.STRONG), new TrainerPartyTemplate(1, TrainerPartyMemberStrength.STRONGER)),
|
||||
|
||||
CHAMPION: new TrainerPartyCompoundTemplate(new TrainerPartyTemplate(1, TrainerPartyMemberStrength.STRONGER), new TrainerPartyTemplate(5, TrainerPartyMemberStrength.STRONG, false, true)),
|
||||
|
||||
RIVAL: new TrainerPartyCompoundTemplate(new TrainerPartyTemplate(1, TrainerPartyMemberStrength.STRONG), new TrainerPartyTemplate(1, TrainerPartyMemberStrength.AVERAGE)),
|
||||
RIVAL_2: new TrainerPartyCompoundTemplate(new TrainerPartyTemplate(1, TrainerPartyMemberStrength.STRONG), new TrainerPartyTemplate(1, TrainerPartyMemberStrength.AVERAGE)),
|
||||
RIVAL_3: new TrainerPartyCompoundTemplate(new TrainerPartyTemplate(1, TrainerPartyMemberStrength.STRONG), new TrainerPartyTemplate(1, TrainerPartyMemberStrength.AVERAGE), new TrainerPartyTemplate(1, TrainerPartyMemberStrength.AVERAGE, false, true)),
|
||||
@@ -192,6 +263,7 @@ export const trainerPartyTemplates = {
|
||||
RIVAL_6: new TrainerPartyCompoundTemplate(new TrainerPartyTemplate(1, TrainerPartyMemberStrength.STRONG), new TrainerPartyTemplate(1, TrainerPartyMemberStrength.AVERAGE), new TrainerPartyTemplate(3, TrainerPartyMemberStrength.AVERAGE, false, true), new TrainerPartyTemplate(1, TrainerPartyMemberStrength.STRONGER))
|
||||
};
|
||||
|
||||
type PartyTemplateFunc = (scene: BattleScene) => TrainerPartyTemplate;
|
||||
type PartyMemberFunc = (scene: BattleScene, level: integer) => EnemyPokemon;
|
||||
|
||||
export interface PartyMemberFuncs {
|
||||
@@ -208,7 +280,10 @@ export class TrainerConfig {
|
||||
public battleBgm: string;
|
||||
public encounterBgm: string;
|
||||
public femaleEncounterBgm: string;
|
||||
public victoryBgm: string;
|
||||
public modifierRewardFuncs: (() => ModifierType)[] = [];
|
||||
public partyTemplates: TrainerPartyTemplate[];
|
||||
public partyTemplateFunc: PartyTemplateFunc;
|
||||
public partyMemberFuncs: PartyMemberFuncs = {};
|
||||
public speciesPools: TrainerTierPools;
|
||||
public speciesFilter: PokemonSpeciesFilter;
|
||||
@@ -225,7 +300,7 @@ export class TrainerConfig {
|
||||
this.trainerType = trainerType;
|
||||
this.name = Utils.toReadableString(TrainerType[this.getDerivedType()]);
|
||||
this.battleBgm = 'battle_trainer';
|
||||
this.encounterBgm = this.name.toLowerCase();
|
||||
this.victoryBgm = 'victory_trainer';
|
||||
this.partyTemplates = [ trainerPartyTemplates.TWO_AVG ];
|
||||
this.speciesFilter = species => allowLegendaries || (!species.legendary && !species.pseudoLegendary && !species.mythical);
|
||||
}
|
||||
@@ -285,11 +360,21 @@ export class TrainerConfig {
|
||||
return this;
|
||||
}
|
||||
|
||||
setVictoryBgm(victoryBgm: string): TrainerConfig {
|
||||
this.victoryBgm = victoryBgm;
|
||||
return this;
|
||||
}
|
||||
|
||||
setPartyTemplates(...partyTemplates: TrainerPartyTemplate[]): TrainerConfig {
|
||||
this.partyTemplates = partyTemplates;
|
||||
return this;
|
||||
}
|
||||
|
||||
setPartyTemplateFunc(partyTemplateFunc: PartyTemplateFunc): TrainerConfig {
|
||||
this.partyTemplateFunc = partyTemplateFunc;
|
||||
return this;
|
||||
}
|
||||
|
||||
setPartyMemberFunc(slotIndex: integer, partyMemberFunc: PartyMemberFunc): TrainerConfig {
|
||||
this.partyMemberFuncs[slotIndex] = partyMemberFunc;
|
||||
return this;
|
||||
@@ -324,6 +409,45 @@ export class TrainerConfig {
|
||||
return this;
|
||||
}
|
||||
|
||||
setModifierRewardFuncs(...modifierTypeFuncs: (() => ModifierType)[]): TrainerConfig {
|
||||
this.modifierRewardFuncs = modifierTypeFuncs;
|
||||
return this;
|
||||
}
|
||||
|
||||
initForGymLeader(signatureSpecies: Species, specialtyType?: Type): TrainerConfig {
|
||||
this.setPartyTemplateFunc(getGymLeaderPartyTemplate);
|
||||
this.setPartyMemberFunc(-1, getRandomPartyMemberFunc([ signatureSpecies ]));
|
||||
if (specialtyType !== undefined)
|
||||
this.setSpeciesFilter(p => p.isOfType(specialtyType));
|
||||
this.setStaticParty();
|
||||
this.setBattleBgm('battle_gym');
|
||||
this.setVictoryBgm('victory_gym');
|
||||
return this;
|
||||
}
|
||||
|
||||
initForEliteFour(signatureSpecies: Species, specialtyType?: Type): TrainerConfig {
|
||||
this.setPartyTemplates(trainerPartyTemplates.ELITE_FOUR);
|
||||
this.setPartyMemberFunc(-1, getRandomPartyMemberFunc([ signatureSpecies ]));
|
||||
if (specialtyType !== undefined)
|
||||
this.setSpeciesFilter(p => p.isOfType(specialtyType) && p.baseTotal >= 450);
|
||||
else
|
||||
this.setSpeciesFilter(p => p.baseTotal >= 450);
|
||||
this.setStaticParty();
|
||||
this.setBattleBgm('battle_elite');
|
||||
this.setVictoryBgm('victory_gym');
|
||||
return this;
|
||||
}
|
||||
|
||||
initForChampion(signatureSpecies: Species): TrainerConfig {
|
||||
this.setPartyTemplates(trainerPartyTemplates.CHAMPION);
|
||||
this.setPartyMemberFunc(-1, getRandomPartyMemberFunc([ signatureSpecies ]));
|
||||
this.setSpeciesFilter(p => p.baseTotal >= 470);
|
||||
this.setStaticParty();
|
||||
this.setBattleBgm('battle_champion');
|
||||
this.setVictoryBgm('victory_champion');
|
||||
return this;
|
||||
}
|
||||
|
||||
getName(female?: boolean): string {
|
||||
let ret = this.name;
|
||||
|
||||
@@ -346,12 +470,12 @@ export class TrainerConfig {
|
||||
const originalWarn = console.warn;
|
||||
// Ignore warnings for missing frames, because there will be a lot
|
||||
console.warn = () => {};
|
||||
const frameNames = scene.anims.generateFrameNames(trainerKey, { zeroPad: 4, suffix: ".png", start: 1, end: 24 });
|
||||
const frameNames = scene.anims.generateFrameNames(trainerKey, { zeroPad: 4, suffix: ".png", start: 1, end: 128 });
|
||||
console.warn = originalWarn;
|
||||
scene.anims.create({
|
||||
key: trainerKey,
|
||||
frames: frameNames,
|
||||
frameRate: 12,
|
||||
frameRate: 24,
|
||||
repeat: -1
|
||||
});
|
||||
resolve();
|
||||
@@ -368,9 +492,21 @@ interface TrainerConfigs {
|
||||
[key: integer]: TrainerConfig
|
||||
}
|
||||
|
||||
function getRandomPartyMemberFunc(species: Species[], postProcess?: (enemyPokemon: EnemyPokemon) => void): PartyMemberFunc {
|
||||
function getGymLeaderPartyTemplate(scene: BattleScene) {
|
||||
const waveIndex = scene.currentBattle.waveIndex;
|
||||
if (waveIndex <= 30)
|
||||
return trainerPartyTemplates.GYM_LEADER_1;
|
||||
if (waveIndex <= 50)
|
||||
return trainerPartyTemplates.GYM_LEADER_2;
|
||||
if (waveIndex <= 70)
|
||||
return trainerPartyTemplates.GYM_LEADER_3;
|
||||
return trainerPartyTemplates.GYM_LEADER_4;
|
||||
}
|
||||
|
||||
function getRandomPartyMemberFunc(speciesPool: Species[], postProcess?: (enemyPokemon: EnemyPokemon) => void): PartyMemberFunc {
|
||||
return (scene: BattleScene, level: integer) => {
|
||||
const ret = new EnemyPokemon(scene, getPokemonSpecies(Phaser.Math.RND.pick(species)), level);
|
||||
const species = getPokemonSpecies(Phaser.Math.RND.pick(speciesPool)).getSpeciesForLevel(level, true);
|
||||
const ret = new EnemyPokemon(scene, getPokemonSpecies(species), level);
|
||||
if (postProcess)
|
||||
postProcess(ret);
|
||||
return ret;
|
||||
@@ -389,17 +525,17 @@ function getSpeciesFilterRandomPartyMemberFunc(speciesFilter: PokemonSpeciesFilt
|
||||
}
|
||||
|
||||
export const trainerConfigs: TrainerConfigs = {
|
||||
[TrainerType.ACE_TRAINER]: new TrainerConfig(++t).setHasGenders().setPartyTemplates(trainerPartyTemplates.SIX_WEAK_BALANCED),
|
||||
[TrainerType.ACE_TRAINER]: new TrainerConfig(++t).setHasGenders().setEncounterBgm(TrainerType.ACE_TRAINER).setPartyTemplates(trainerPartyTemplates.SIX_WEAK_BALANCED),
|
||||
[TrainerType.ARTIST]: new TrainerConfig(++t).setEncounterBgm(TrainerType.RICH).setPartyTemplates(trainerPartyTemplates.ONE_STRONG, trainerPartyTemplates.TWO_AVG, trainerPartyTemplates.THREE_AVG).setSpeciesPools([ Species.SMEARGLE ]),
|
||||
[TrainerType.BACKERS]: new TrainerConfig(++t).setHasGenders().setEncounterBgm(TrainerType.CYCLIST).setDouble(),
|
||||
[TrainerType.BACKPACKER]: new TrainerConfig(++t).setHasGenders().setSpeciesFilter(s => s.isOfType(Type.FLYING) || s.isOfType(Type.ROCK)),
|
||||
[TrainerType.BACKERS]: new TrainerConfig(++t).setHasGenders().setDouble().setEncounterBgm(TrainerType.CYCLIST),
|
||||
[TrainerType.BACKPACKER]: new TrainerConfig(++t).setHasGenders().setSpeciesFilter(s => s.isOfType(Type.FLYING) || s.isOfType(Type.ROCK)).setEncounterBgm(TrainerType.BACKPACKER),
|
||||
[TrainerType.BAKER]: new TrainerConfig(++t).setEncounterBgm(TrainerType.CLERK).setSpeciesFilter(s => s.isOfType(Type.GRASS) || s.isOfType(Type.FIRE)),
|
||||
[TrainerType.BEAUTY]: new TrainerConfig(++t).setEncounterBgm(TrainerType.PARASOL_LADY),
|
||||
[TrainerType.BIKER]: new TrainerConfig(++t).setEncounterBgm(TrainerType.ROUGHNECK).setSpeciesFilter(s => s.isOfType(Type.POISON)),
|
||||
[TrainerType.BLACK_BELT]: new TrainerConfig(++t).setHasGenders('Battle Girl', TrainerType.PSYCHIC).setEncounterBgm(TrainerType.ROUGHNECK).setSpeciesFilter(s => s.isOfType(Type.FIGHTING)),
|
||||
[TrainerType.BREEDER]: new TrainerConfig(++t).setHasGenders().setDouble().setEncounterBgm(TrainerType.POKEFAN).setPartyTemplates(trainerPartyTemplates.SIX_WEAKER),
|
||||
[TrainerType.CLERK]: new TrainerConfig(++t).setHasGenders(),
|
||||
[TrainerType.CYCLIST]: new TrainerConfig(++t).setHasGenders().setSpeciesFilter(s => !!pokemonLevelMoves[s.speciesId].find(plm => plm[1] === Moves.QUICK_ATTACK)),
|
||||
[TrainerType.BREEDER]: new TrainerConfig(++t).setEncounterBgm(TrainerType.POKEFAN).setHasGenders().setDouble().setPartyTemplates(trainerPartyTemplates.SIX_WEAKER),
|
||||
[TrainerType.CLERK]: new TrainerConfig(++t).setHasGenders().setEncounterBgm(TrainerType.CLERK),
|
||||
[TrainerType.CYCLIST]: new TrainerConfig(++t).setHasGenders().setEncounterBgm(TrainerType.CYCLIST).setSpeciesFilter(s => !!pokemonLevelMoves[s.speciesId].find(plm => plm[1] === Moves.QUICK_ATTACK)),
|
||||
[TrainerType.DANCER]: new TrainerConfig(++t).setEncounterBgm(TrainerType.CYCLIST),
|
||||
[TrainerType.DEPOT_AGENT]: new TrainerConfig(++t).setEncounterBgm(TrainerType.CLERK),
|
||||
[TrainerType.DOCTOR]: new TrainerConfig(++t).setEncounterBgm(TrainerType.CLERK),
|
||||
@@ -426,17 +562,17 @@ export const trainerConfigs: TrainerConfigs = {
|
||||
[TrainerType.NURSE]: new TrainerConfig(++t).setEncounterBgm('lass').setSpeciesFilter(s => !!pokemonLevelMoves[s.speciesId].find(plm => plm[1] === Moves.CHARM) || !!pokemonLevelMoves[s.speciesId].find(plm => plm[1] === Moves.HEAL_PULSE)),
|
||||
[TrainerType.NURSERY_AIDE]: new TrainerConfig(++t).setEncounterBgm('lass'),
|
||||
[TrainerType.OFFICER]: new TrainerConfig(++t).setEncounterBgm(TrainerType.CLERK).setSpeciesPools([ Species.VULPIX, Species.GROWLITHE, Species.SNUBBULL, Species.HOUNDOUR, Species.POOCHYENA, Species.ELECTRIKE, Species.LILLIPUP ]),
|
||||
[TrainerType.PARASOL_LADY]: new TrainerConfig(++t).setSpeciesFilter(s => s.isOfType(Type.WATER)),
|
||||
[TrainerType.PARASOL_LADY]: new TrainerConfig(++t).setEncounterBgm(TrainerType.PARASOL_LADY).setSpeciesFilter(s => s.isOfType(Type.WATER)),
|
||||
[TrainerType.PILOT]: new TrainerConfig(++t).setEncounterBgm(TrainerType.CLERK).setSpeciesFilter(s => tmSpecies[Moves.FLY].indexOf(s.speciesId) > -1),
|
||||
[TrainerType.POKEFAN]: new TrainerConfig(++t).setHasGenders()
|
||||
[TrainerType.POKEFAN]: new TrainerConfig(++t).setHasGenders().setEncounterBgm(TrainerType.POKEFAN)
|
||||
.setPartyTemplates(trainerPartyTemplates.SIX_WEAKER, trainerPartyTemplates.FOUR_WEAK, trainerPartyTemplates.TWO_AVG, trainerPartyTemplates.ONE_STRONG, trainerPartyTemplates.FOUR_WEAK_SAME, trainerPartyTemplates.FIVE_WEAK, trainerPartyTemplates.SIX_WEAKER_SAME),
|
||||
[TrainerType.PRESCHOOLER]: new TrainerConfig(++t).setEncounterBgm(TrainerType.YOUNGSTER).setHasGenders(undefined, 'lass'),
|
||||
[TrainerType.PSYCHIC]: new TrainerConfig(++t).setHasGenders(),
|
||||
[TrainerType.PSYCHIC]: new TrainerConfig(++t).setHasGenders().setEncounterBgm(TrainerType.PSYCHIC),
|
||||
[TrainerType.RANGER]: new TrainerConfig(++t).setEncounterBgm(TrainerType.BACKPACKER).setHasGenders(),
|
||||
[TrainerType.RICH]: new TrainerConfig(++t).setName('Gentleman').setHasGenders().setSpeciesFilter(s => s.eggType1 === 'Field' || s.eggType2 === 'Field'),
|
||||
[TrainerType.RICH_KID]: new TrainerConfig(++t).setName('Rich Boy').setHasGenders('Lady').setEncounterBgm(TrainerType.RICH),
|
||||
[TrainerType.ROUGHNECK]: new TrainerConfig(++t).setSpeciesFilter(s => s.isOfType(Type.DARK)),
|
||||
[TrainerType.SCIENTIST]: new TrainerConfig(++t).setHasGenders().setSpeciesPools({
|
||||
[TrainerType.ROUGHNECK]: new TrainerConfig(++t).setEncounterBgm(TrainerType.ROUGHNECK).setSpeciesFilter(s => s.isOfType(Type.DARK)),
|
||||
[TrainerType.SCIENTIST]: new TrainerConfig(++t).setHasGenders().setEncounterBgm(TrainerType.SCIENTIST).setSpeciesPools({
|
||||
[TrainerPoolTier.COMMON]: [ Species.MAGNEMITE, Species.GRIMER, Species.DROWZEE, Species.VOLTORB, Species.KOFFING ],
|
||||
[TrainerPoolTier.UNCOMMON]: [ Species.KLINK ],
|
||||
[TrainerPoolTier.RARE ]: [ Species.ABRA, Species.PORYGON ],
|
||||
@@ -446,12 +582,12 @@ export const trainerConfigs: TrainerConfigs = {
|
||||
[TrainerType.SNOW_WORKER]: new TrainerConfig(++t).setName('Worker').setEncounterBgm(TrainerType.CLERK).setSpeciesFilter(s => s.isOfType(Type.ICE) || s.isOfType(Type.STEEL)),
|
||||
[TrainerType.STRIKER]: new TrainerConfig(++t).setEncounterBgm(TrainerType.CYCLIST),
|
||||
[TrainerType.STUDENT]: new TrainerConfig(++t).setHasGenders(),
|
||||
[TrainerType.SWIMMER]: new TrainerConfig(++t).setHasGenders().setEncounterBgm(TrainerType.PARASOL_LADY).setSpeciesFilter(s => s.isOfType(Type.WATER)),
|
||||
[TrainerType.TWINS]: new TrainerConfig(++t).setDouble(),
|
||||
[TrainerType.SWIMMER]: new TrainerConfig(++t).setEncounterBgm(TrainerType.PARASOL_LADY).setHasGenders().setSpeciesFilter(s => s.isOfType(Type.WATER)),
|
||||
[TrainerType.TWINS]: new TrainerConfig(++t).setDouble().setEncounterBgm(TrainerType.TWINS),
|
||||
[TrainerType.VETERAN]: new TrainerConfig(++t).setHasGenders().setEncounterBgm(TrainerType.RICH),
|
||||
[TrainerType.WAITER]: new TrainerConfig(++t).setHasGenders().setEncounterBgm(TrainerType.CLERK),
|
||||
[TrainerType.WORKER]: new TrainerConfig(++t).setEncounterBgm(TrainerType.CLERK).setSpeciesFilter(s => s.isOfType(Type.ROCK) || s.isOfType(Type.STEEL)),
|
||||
[TrainerType.YOUNGSTER]: new TrainerConfig(++t).setHasGenders('Lass', 'lass').setPartyTemplates(trainerPartyTemplates.TWO_WEAKER).setEncounterBgm(TrainerType.YOUNGSTER).setEncounterMessages([
|
||||
[TrainerType.YOUNGSTER]: new TrainerConfig(++t).setEncounterBgm(TrainerType.YOUNGSTER).setHasGenders('Lass', 'lass').setPartyTemplates(trainerPartyTemplates.TWO_WEAKER).setEncounterMessages([
|
||||
`Hey, wanna battle?`,
|
||||
`Are you a new trainer too?`,
|
||||
`Hey, I haven't seen you before. Let's battle!`
|
||||
@@ -468,41 +604,99 @@ export const trainerConfigs: TrainerConfigs = {
|
||||
`I didn't think you'd beat me that bad…`,
|
||||
`I hope we get to have a rematch some day.`
|
||||
]),
|
||||
[TrainerType.CYNTHIA]: new TrainerConfig(++t),
|
||||
[TrainerType.RIVAL]: new TrainerConfig(++t).setStaticParty().setBattleBgm('battle_rival').setPartyTemplates(trainerPartyTemplates.RIVAL).setEncounterMessages([
|
||||
[TrainerType.BROCK]: new TrainerConfig(++t).initForGymLeader(Species.GEODUDE, Type.ROCK),
|
||||
[TrainerType.MISTY]: new TrainerConfig(++t).initForGymLeader(Species.STARYU, Type.WATER),
|
||||
[TrainerType.LT_SURGE]: new TrainerConfig(++t).initForGymLeader(Species.ELECTABUZZ, Type.ELECTRIC),
|
||||
[TrainerType.ERIKA]: new TrainerConfig(++t).initForGymLeader(Species.TANGELA, Type.GRASS),
|
||||
[TrainerType.JANINE]: new TrainerConfig(++t).initForGymLeader(Species.VENONAT, Type.POISON),
|
||||
[TrainerType.SABRINA]: new TrainerConfig(++t).initForGymLeader(Species.ALAKAZAM, Type.PSYCHIC),
|
||||
[TrainerType.BLAINE]: new TrainerConfig(++t).initForGymLeader(Species.MAGMAR, Type.FIRE),
|
||||
[TrainerType.GIOVANNI]: new TrainerConfig(++t).initForGymLeader(Species.RHYHORN, Type.GROUND),
|
||||
[TrainerType.FALKNER]: new TrainerConfig(++t).initForGymLeader(Species.PIDGEY, Type.FLYING),
|
||||
[TrainerType.BUGSY]: new TrainerConfig(++t).initForGymLeader(Species.SCYTHER, Type.BUG),
|
||||
[TrainerType.WHITNEY]: new TrainerConfig(++t).initForGymLeader(Species.MILTANK, Type.NORMAL),
|
||||
[TrainerType.MORTY]: new TrainerConfig(++t).initForGymLeader(Species.GASTLY, Type.GHOST),
|
||||
[TrainerType.CHUCK]: new TrainerConfig(++t).initForGymLeader(Species.POLIWRATH, Type.FIGHTING),
|
||||
[TrainerType.JASMINE]: new TrainerConfig(++t).initForGymLeader(Species.STEELIX, Type.STEEL),
|
||||
[TrainerType.PRYCE]: new TrainerConfig(++t).initForGymLeader(Species.SWINUB, Type.ICE),
|
||||
[TrainerType.CLAIR]: new TrainerConfig(++t).initForGymLeader(Species.DRATINI, Type.DRAGON),
|
||||
[TrainerType.ROXANNE]: new TrainerConfig(++t).initForGymLeader(Species.NOSEPASS, Type.ROCK),
|
||||
[TrainerType.BRAWLY]: new TrainerConfig(++t).initForGymLeader(Species.MAKUHITA, Type.FIGHTING),
|
||||
[TrainerType.WATTSON]: new TrainerConfig(++t).initForGymLeader(Species.ELECTRIKE, Type.ELECTRIC),
|
||||
[TrainerType.FLANNERY]: new TrainerConfig(++t).initForGymLeader(Species.TORKOAL, Type.FIRE),
|
||||
[TrainerType.NORMAN]: new TrainerConfig(++t).initForGymLeader(Species.SLAKOTH, Type.NORMAL),
|
||||
[TrainerType.WINONA]: new TrainerConfig(++t).initForGymLeader(Species.SWABLU, Type.FLYING),
|
||||
[TrainerType.TATE]: new TrainerConfig(++t).initForGymLeader(Species.SOLROCK, Type.PSYCHIC),
|
||||
[TrainerType.LIZA]: new TrainerConfig(++t).initForGymLeader(Species.LUNATONE, Type.PSYCHIC),
|
||||
[TrainerType.JUAN]: new TrainerConfig(++t).initForGymLeader(Species.HORSEA, Type.WATER),
|
||||
[TrainerType.ROARK]: new TrainerConfig(++t).initForGymLeader(Species.CRANIDOS, Type.ROCK),
|
||||
[TrainerType.GARDENIA]: new TrainerConfig(++t).initForGymLeader(Species.ROSELIA, Type.GRASS),
|
||||
[TrainerType.MAYLENE]: new TrainerConfig(++t).initForGymLeader(Species.LUCARIO, Type.FIGHTING),
|
||||
[TrainerType.CRASHER_WAKE]: new TrainerConfig(++t).initForGymLeader(Species.BUIZEL, Type.WATER),
|
||||
[TrainerType.FANTINA]: new TrainerConfig(++t).initForGymLeader(Species.MISDREAVUS, Type.GHOST),
|
||||
[TrainerType.BYRON]: new TrainerConfig(++t).initForGymLeader(Species.SHIELDON, Type.STEEL),
|
||||
[TrainerType.CANDICE]: new TrainerConfig(++t).initForGymLeader(Species.SNEASEL, Type.ICE),
|
||||
[TrainerType.VOLKNER]: new TrainerConfig(++t).initForGymLeader(Species.SHINX, Type.ELECTRIC),
|
||||
[TrainerType.CILAN]: new TrainerConfig(++t).initForGymLeader(Species.PANSAGE, Type.GRASS),
|
||||
[TrainerType.CHILI]: new TrainerConfig(++t).initForGymLeader(Species.PANSEAR, Type.FIRE),
|
||||
[TrainerType.CRESS]: new TrainerConfig(++t).initForGymLeader(Species.PANPOUR, Type.WATER),
|
||||
[TrainerType.CHEREN]: new TrainerConfig(++t).initForGymLeader(Species.LILLIPUP, Type.NORMAL),
|
||||
[TrainerType.LENORA]: new TrainerConfig(++t).initForGymLeader(Species.KANGASKHAN, Type.NORMAL),
|
||||
[TrainerType.ROXIE]: new TrainerConfig(++t).initForGymLeader(Species.SCOLIPEDE, Type.POISON),
|
||||
[TrainerType.BURGH]: new TrainerConfig(++t).initForGymLeader(Species.SEWADDLE, Type.BUG),
|
||||
[TrainerType.ELESA]: new TrainerConfig(++t).initForGymLeader(Species.EMOLGA, Type.ELECTRIC),
|
||||
[TrainerType.CLAY]: new TrainerConfig(++t).initForGymLeader(Species.DRILBUR, Type.GROUND),
|
||||
[TrainerType.SKYLA]: new TrainerConfig(++t).initForGymLeader(Species.DUCKLETT, Type.WATER),
|
||||
[TrainerType.BRYCEN]: new TrainerConfig(++t).initForGymLeader(Species.CRYOGONAL, Type.ICE),
|
||||
[TrainerType.DRAYDEN]: new TrainerConfig(++t).initForGymLeader(Species.DRUDDIGON, Type.DRAGON),
|
||||
[TrainerType.MARLON]: new TrainerConfig(++t).initForGymLeader(Species.WAILMER, Type.WATER),
|
||||
[TrainerType.SHAUNTAL]: new TrainerConfig(++t).initForEliteFour(Species.LITWICK, Type.GHOST),
|
||||
[TrainerType.MARSHAL]: new TrainerConfig(++t).initForEliteFour(Species.TIMBURR, Type.FIGHTING),
|
||||
[TrainerType.GRIMSLEY]: new TrainerConfig(++t).initForEliteFour(Species.PAWNIARD, Type.DARK),
|
||||
[TrainerType.CAITLIN]: new TrainerConfig(++t).initForEliteFour(Species.GOTHITA, Type.PSYCHIC),
|
||||
[TrainerType.BLUE]: new TrainerConfig(++t).initForChampion(Species.GYARADOS),
|
||||
[TrainerType.RED]: new TrainerConfig(++t).initForChampion(Species.CHARIZARD),
|
||||
[TrainerType.LANCE]: new TrainerConfig(++t).initForChampion(Species.DRAGONITE),
|
||||
[TrainerType.STEVEN]: new TrainerConfig(++t).initForChampion(Species.BELDUM),
|
||||
[TrainerType.WALLACE]: new TrainerConfig(++t).initForChampion(Species.MILOTIC),
|
||||
[TrainerType.CYNTHIA]: new TrainerConfig(++t).initForChampion(Species.GARCHOMP).setBattleBgm('battle_cynthia'),
|
||||
[TrainerType.ALDER]: new TrainerConfig(++t).initForChampion(Species.VOLCARONA),
|
||||
[TrainerType.IRIS]: new TrainerConfig(++t).initForChampion(Species.AXEW),
|
||||
[TrainerType.RIVAL]: new TrainerConfig(++t).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?`
|
||||
]).setDefeatMessages([
|
||||
]).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!`
|
||||
]).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 ]))
|
||||
]).setModifierRewardFuncs(() => modifierTypes.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 ]))
|
||||
.setPartyMemberFunc(1, getRandomPartyMemberFunc([ Species.PIDGEY, Species.HOOTHOOT, Species.TAILLOW, Species.STARLY, Species.PIDOVE ])),
|
||||
[TrainerType.RIVAL_2]: new TrainerConfig(++t).setStaticParty().setBattleBgm('battle_rival').setPartyTemplates(trainerPartyTemplates.RIVAL_2).setEncounterMessages([
|
||||
[TrainerType.RIVAL_2]: new TrainerConfig(++t).setStaticParty().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!`
|
||||
]).setDefeatMessages([
|
||||
]).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 ]))
|
||||
.setPartyMemberFunc(1, getRandomPartyMemberFunc([ Species.PIDGEOTTO, Species.HOOTHOOT, Species.TAILLOW, Species.STARAVIA, Species.TRANQUILL ]))
|
||||
.setPartyMemberFunc(2, getSpeciesFilterRandomPartyMemberFunc((species: PokemonSpecies) => !pokemonEvolutions.hasOwnProperty(species.speciesId) && !pokemonPrevolutions.hasOwnProperty(species.speciesId) && species.baseTotal >= 450)),
|
||||
[TrainerType.RIVAL_3]: new TrainerConfig(++t).setStaticParty().setBattleBgm('battle_rival').setPartyTemplates(trainerPartyTemplates.RIVAL_3).setEncounterMessages([
|
||||
[TrainerType.RIVAL_3]: new TrainerConfig(++t).setStaticParty().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!`
|
||||
]).setDefeatMessages([
|
||||
]).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 ]))
|
||||
.setPartyMemberFunc(1, getRandomPartyMemberFunc([ Species.PIDGEOT, Species.NOCTOWL, Species.SWELLOW, Species.STARAPTOR, Species.UNFEZANT ]))
|
||||
.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).setStaticParty().setBattleBgm('battle_rival_2').setPartyTemplates(trainerPartyTemplates.RIVAL_4).setEncounterMessages([
|
||||
[TrainerType.RIVAL_4]: new TrainerConfig(++t).setStaticParty().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.
|
||||
@@ -510,19 +704,19 @@ export const trainerConfigs: TrainerConfigs = {
|
||||
$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.`
|
||||
]).setDefeatMessages([
|
||||
]).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 ]))
|
||||
.setPartyMemberFunc(1, getRandomPartyMemberFunc([ Species.PIDGEOT, Species.NOCTOWL, Species.SWELLOW, Species.STARAPTOR, Species.UNFEZANT ]))
|
||||
.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).setStaticParty().setBattleBgm('battle_rival_3').setPartyTemplates(trainerPartyTemplates.RIVAL_5).setEncounterMessages([ `…` ]).setDefeatMessages([ '…' ])
|
||||
[TrainerType.RIVAL_5]: new TrainerConfig(++t).setStaticParty().setEncounterBgm(TrainerType.RIVAL).setBattleBgm('battle_rival_3').setPartyTemplates(trainerPartyTemplates.RIVAL_5).setEncounterMessages([ `…` ]).setVictoryMessages([ '…' ])
|
||||
.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 ]))
|
||||
.setPartyMemberFunc(1, getRandomPartyMemberFunc([ Species.PIDGEOT, Species.NOCTOWL, Species.SWELLOW, Species.STARAPTOR, Species.UNFEZANT ]))
|
||||
.setPartyMemberFunc(2, getSpeciesFilterRandomPartyMemberFunc((species: PokemonSpecies) => !pokemonEvolutions.hasOwnProperty(species.speciesId) && !pokemonPrevolutions.hasOwnProperty(species.speciesId) && species.baseTotal >= 450))
|
||||
.setSpeciesFilter(species => species.baseTotal >= 540)
|
||||
.setPartyMemberFunc(5, getRandomPartyMemberFunc([ Species.RAYQUAZA ])),
|
||||
[TrainerType.RIVAL_6]: new TrainerConfig(++t).setStaticParty().setBattleBgm('battle_rival_3').setPartyTemplates(trainerPartyTemplates.RIVAL_6)
|
||||
[TrainerType.RIVAL_6]: new TrainerConfig(++t).setStaticParty().setEncounterBgm('final').setBattleBgm('battle_rival_3').setPartyTemplates(trainerPartyTemplates.RIVAL_6)
|
||||
.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 ]))
|
||||
.setPartyMemberFunc(1, getRandomPartyMemberFunc([ Species.PIDGEOT, Species.NOCTOWL, Species.SWELLOW, Species.STARAPTOR, Species.UNFEZANT ]))
|
||||
.setPartyMemberFunc(2, getSpeciesFilterRandomPartyMemberFunc((species: PokemonSpecies) => !pokemonEvolutions.hasOwnProperty(species.speciesId) && !pokemonPrevolutions.hasOwnProperty(species.speciesId) && species.baseTotal >= 450))
|
||||
|
||||
@@ -536,7 +536,7 @@ class WeightedModifierType {
|
||||
}
|
||||
}
|
||||
|
||||
const modifierTypes = {
|
||||
export const modifierTypes = {
|
||||
POKEBALL: () => new AddPokeballModifierType(PokeballType.POKEBALL, 5, 'pb'),
|
||||
GREAT_BALL: () => new AddPokeballModifierType(PokeballType.GREAT_BALL, 5, 'gb'),
|
||||
ULTRA_BALL: () => new AddPokeballModifierType(PokeballType.ULTRA_BALL, 5, 'ub'),
|
||||
|
||||
+14
-5
@@ -50,6 +50,8 @@ export default class Trainer extends Phaser.GameObjects.Container {
|
||||
}
|
||||
|
||||
getPartyTemplate(): TrainerPartyTemplate {
|
||||
if (this.config.partyTemplateFunc)
|
||||
return this.config.partyTemplateFunc(this.scene);
|
||||
return this.config.partyTemplates[this.partyTemplateIndex];
|
||||
}
|
||||
|
||||
@@ -102,12 +104,18 @@ export default class Trainer extends Phaser.GameObjects.Container {
|
||||
let ret: EnemyPokemon;
|
||||
|
||||
this.scene.executeWithSeedOffset(() => {
|
||||
const template = this.getPartyTemplate();
|
||||
|
||||
const isLastIndex = index === template.size - 1;
|
||||
|
||||
if (this.config.partyMemberFuncs.hasOwnProperty(index)) {
|
||||
ret = this.config.partyMemberFuncs[index](this.scene, level);
|
||||
return;
|
||||
}
|
||||
|
||||
const template = this.getPartyTemplate();
|
||||
if (isLastIndex && this.config.partyMemberFuncs.hasOwnProperty(-1)) {
|
||||
ret = this.config.partyMemberFuncs[-1](this.scene, level);
|
||||
return;
|
||||
}
|
||||
|
||||
let offset = 0;
|
||||
|
||||
@@ -187,14 +195,15 @@ export default class Trainer extends Phaser.GameObjects.Container {
|
||||
}
|
||||
|
||||
initSprite(): void {
|
||||
this.getSprite().setTexture(this.getKey());
|
||||
this.getTintSprite().setTexture(this.getKey());
|
||||
this.getSprite().setTexture(this.getKey()).setFrame(0);
|
||||
this.getTintSprite().setTexture(this.getKey()).setFrame(0);
|
||||
}
|
||||
|
||||
playAnim(): void {
|
||||
const trainerAnimConfig = {
|
||||
key: this.getKey(),
|
||||
repeat: 0
|
||||
repeat: 0,
|
||||
startFrame: 0
|
||||
};
|
||||
this.getSprite().play(trainerAnimConfig);
|
||||
this.getTintSprite().play(trainerAnimConfig);
|
||||
|
||||
@@ -63,18 +63,19 @@ export default class BallUiHandler extends UiHandler {
|
||||
const pokeballTypeCount = Object.keys(this.scene.currentBattle.turnPokeballCounts).length;
|
||||
|
||||
if (button === Button.ACTION || button === Button.CANCEL) {
|
||||
const commandPhase = this.scene.getCurrentPhase() as CommandPhase;
|
||||
success = true;
|
||||
if (button === Button.ACTION && this.cursor < pokeballTypeCount) {
|
||||
if (this.scene.currentBattle.turnPokeballCounts[this.cursor]) {
|
||||
if ((this.scene.getCurrentPhase() as CommandPhase).handleCommand(Command.BALL, this.cursor)) {
|
||||
this.scene.ui.setMode(Mode.COMMAND);
|
||||
if (commandPhase.handleCommand(Command.BALL, this.cursor)) {
|
||||
this.scene.ui.setMode(Mode.COMMAND, commandPhase.getFieldIndex());
|
||||
this.scene.ui.setMode(Mode.MESSAGE);
|
||||
success = true;
|
||||
}
|
||||
} else
|
||||
ui.playError();
|
||||
} else {
|
||||
ui.setMode(Mode.COMMAND);
|
||||
ui.setMode(Mode.COMMAND, commandPhase.getFieldIndex());
|
||||
success = true;
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -16,6 +16,9 @@ export default class CommandUiHandler extends UiHandler {
|
||||
private commandsContainer: Phaser.GameObjects.Container;
|
||||
private cursorObj: Phaser.GameObjects.Image;
|
||||
|
||||
protected fieldIndex: integer = 0;
|
||||
protected cursor2: integer = 0;
|
||||
|
||||
constructor(scene: BattleScene) {
|
||||
super(scene, Mode.COMMAND);
|
||||
}
|
||||
@@ -37,13 +40,15 @@ export default class CommandUiHandler extends UiHandler {
|
||||
show(args: any[]) {
|
||||
super.show(args);
|
||||
|
||||
this.fieldIndex = args.length ? args[0] as integer : 0;
|
||||
|
||||
this.commandsContainer.setVisible(true);
|
||||
|
||||
const messageHandler = this.getUi().getMessageHandler();
|
||||
messageHandler.bg.setTexture('bg_command');
|
||||
messageHandler.message.setWordWrapWidth(1110);
|
||||
messageHandler.showText(`What will\n${(this.scene.getCurrentPhase() as CommandPhase).getPokemon().name} do?`, 0);
|
||||
this.setCursor(this.cursor);
|
||||
this.setCursor(this.getCursor());
|
||||
}
|
||||
|
||||
processInput(button: Button) {
|
||||
@@ -51,10 +56,12 @@ export default class CommandUiHandler extends UiHandler {
|
||||
|
||||
let success = false;
|
||||
|
||||
const cursor = this.getCursor();
|
||||
|
||||
if (button === Button.CANCEL || button === Button.ACTION) {
|
||||
|
||||
if (button === Button.ACTION) {
|
||||
switch (this.cursor) {
|
||||
switch (cursor) {
|
||||
case 0:
|
||||
ui.setMode(Mode.FIGHT, (this.scene.getCurrentPhase() as CommandPhase).getFieldIndex());
|
||||
success = true;
|
||||
@@ -77,20 +84,20 @@ export default class CommandUiHandler extends UiHandler {
|
||||
} else {
|
||||
switch (button) {
|
||||
case Button.UP:
|
||||
if (this.cursor >= 2)
|
||||
success = this.setCursor(this.cursor - 2);
|
||||
if (cursor >= 2)
|
||||
success = this.setCursor(cursor - 2);
|
||||
break;
|
||||
case Button.DOWN:
|
||||
if (this.cursor < 2)
|
||||
success = this.setCursor(this.cursor + 2);
|
||||
if (cursor < 2)
|
||||
success = this.setCursor(cursor + 2);
|
||||
break;
|
||||
case Button.LEFT:
|
||||
if (this.cursor % 2 === 1)
|
||||
success = this.setCursor(this.cursor - 1);
|
||||
if (cursor % 2 === 1)
|
||||
success = this.setCursor(cursor - 1);
|
||||
break;
|
||||
case Button.RIGHT:
|
||||
if (this.cursor % 2 === 0)
|
||||
success = this.setCursor(this.cursor + 1);
|
||||
if (cursor % 2 === 0)
|
||||
success = this.setCursor(cursor + 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -99,9 +106,20 @@ export default class CommandUiHandler extends UiHandler {
|
||||
ui.playSelect();
|
||||
}
|
||||
|
||||
getCursor(): integer {
|
||||
return !this.fieldIndex ? this.cursor : this.cursor2;
|
||||
}
|
||||
|
||||
setCursor(cursor: integer): boolean {
|
||||
const ui = this.getUi();
|
||||
const ret = super.setCursor(cursor);
|
||||
|
||||
const changed = this.getCursor() !== cursor;
|
||||
if (changed) {
|
||||
if (!this.fieldIndex)
|
||||
this.cursor = cursor;
|
||||
else
|
||||
this.cursor2 = cursor;
|
||||
}
|
||||
|
||||
if (!this.cursorObj) {
|
||||
this.cursorObj = this.scene.add.image(0, 0, 'cursor');
|
||||
@@ -110,7 +128,7 @@ export default class CommandUiHandler extends UiHandler {
|
||||
|
||||
this.cursorObj.setPosition(211 + (cursor % 2 === 1 ? 56 : 0), -31 + (cursor >= 2 ? 16 : 0));
|
||||
|
||||
return ret;
|
||||
return changed;
|
||||
}
|
||||
|
||||
clear(): void {
|
||||
|
||||
@@ -61,7 +61,7 @@ export default class FightUiHandler extends UiHandler {
|
||||
else
|
||||
ui.playError();
|
||||
} else {
|
||||
ui.setMode(Mode.COMMAND);
|
||||
ui.setMode(Mode.COMMAND, this.fieldIndex);
|
||||
success = true;
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -287,7 +287,7 @@ export default class PartyUiHandler extends MessageUiHandler {
|
||||
selectCallback(6, PartyOption.CANCEL);
|
||||
ui.playSelect();
|
||||
} else {
|
||||
ui.setMode(Mode.COMMAND);
|
||||
ui.setMode(Mode.COMMAND, this.fieldIndex);
|
||||
ui.playSelect();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user