Add new player and rival sprites and trainer titles
This commit is contained in:
1 parent
550c65d6f5
commit
b12e7106ed
23 files changed
+450
-299
No files matched your search
+13
-7
@@ -490,7 +490,7 @@ export class EncounterPhase extends BattlePhase {
|
||||
return `${enemyField[0].name} appeared.`;
|
||||
|
||||
if (this.scene.currentBattle.battleType === BattleType.TRAINER)
|
||||
return `${this.scene.currentBattle.trainer.getName()}\nwould like to battle!`;
|
||||
return `${this.scene.currentBattle.trainer.getName(true)}\nwould like to battle!`;
|
||||
|
||||
return enemyField.length === 1
|
||||
? `A wild ${enemyField[0].name} appeared!`
|
||||
@@ -841,7 +841,13 @@ export class SummonPhase extends PartyMemberPokemonPhase {
|
||||
this.scene.ui.showText(`Go! ${this.getPokemon().name}!`);
|
||||
if (this.player)
|
||||
this.scene.pbTray.hide();
|
||||
this.scene.trainer.play('trainer_m_pb');
|
||||
this.scene.trainer.setTexture('trainer_m_back_pb');
|
||||
this.scene.time.delayedCall(562, () => {
|
||||
this.scene.trainer.setFrame('2');
|
||||
this.scene.time.delayedCall(64, () => {
|
||||
this.scene.trainer.setFrame('3');
|
||||
});
|
||||
});
|
||||
this.scene.tweens.add({
|
||||
targets: this.scene.trainer,
|
||||
x: -36,
|
||||
@@ -851,7 +857,7 @@ export class SummonPhase extends PartyMemberPokemonPhase {
|
||||
this.scene.time.delayedCall(750, () => this.summon());
|
||||
} else {
|
||||
this.scene.pbTrayEnemy.hide();
|
||||
this.scene.ui.showText(`${this.scene.currentBattle.trainer.getName()} sent out\n${this.getPokemon().name}!`, null, () => this.summon());
|
||||
this.scene.ui.showText(`${this.scene.currentBattle.trainer.getName(true)} sent out\n${this.getPokemon().name}!`, null, () => this.summon());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -985,7 +991,7 @@ export class SwitchSummonPhase extends SummonPhase {
|
||||
|
||||
applyPreSwitchOutAbAttrs(PreSwitchOutAbAttr, pokemon);
|
||||
|
||||
this.scene.ui.showText(this.player ? `Come back, ${pokemon.name}!` : `${this.scene.currentBattle.trainer.getName()}\nwithdrew ${pokemon.name}!`);
|
||||
this.scene.ui.showText(this.player ? `Come back, ${pokemon.name}!` : `${this.scene.currentBattle.trainer.getName(true)}\nwithdrew ${pokemon.name}!`);
|
||||
this.scene.playSound('pb_rel');
|
||||
pokemon.hideInfo();
|
||||
pokemon.tint(getPokeballTintColor(pokemon.pokeball), 1, 250, 'Sine.easeIn');
|
||||
@@ -1019,7 +1025,7 @@ export class SwitchSummonPhase extends SummonPhase {
|
||||
if (switchedPokemon) {
|
||||
party[this.slotIndex] = this.lastPokemon;
|
||||
party[this.fieldIndex] = switchedPokemon;
|
||||
this.scene.ui.showText(this.player ? `Go! ${switchedPokemon.name}!` : `${this.scene.currentBattle.trainer.getName()} sent out\n${this.getPokemon().name}!`);
|
||||
this.scene.ui.showText(this.player ? `Go! ${switchedPokemon.name}!` : `${this.scene.currentBattle.trainer.getName(true)} sent out\n${this.getPokemon().name}!`);
|
||||
this.summon();
|
||||
} else
|
||||
this.end();
|
||||
@@ -1074,7 +1080,7 @@ export class ShowTrainerPhase extends BattlePhase {
|
||||
|
||||
this.scene.trainer.setVisible(true)
|
||||
|
||||
this.scene.trainer.setTexture('trainer_m');
|
||||
this.scene.trainer.setTexture('trainer_m_back');
|
||||
|
||||
this.scene.tweens.add({
|
||||
targets: this.scene.trainer,
|
||||
@@ -2703,7 +2709,7 @@ export class TrainerVictoryPhase extends BattlePhase {
|
||||
this.scene.pushPhase(new ModifierRewardPhase(this.scene, modifierTypes.VOUCHER));
|
||||
}
|
||||
|
||||
this.scene.ui.showText(`You defeated\n${this.scene.currentBattle.trainer.getName()}!`, null, () => {
|
||||
this.scene.ui.showText(`You defeated\n${this.scene.currentBattle.trainer.getName(true)}!`, null, () => {
|
||||
const defeatMessages = this.scene.currentBattle.trainer.config.victoryMessages;
|
||||
let showMessageAndEnd = () => this.end();
|
||||
if (defeatMessages.length) {
|
||||
|
||||
+7
-12
@@ -300,8 +300,10 @@ export default class BattleScene extends Phaser.Scene {
|
||||
});
|
||||
|
||||
// Load trainer images
|
||||
this.loadImage('trainer_m', 'trainer');
|
||||
this.loadAtlas('trainer_m_pb', 'trainer');
|
||||
this.loadAtlas('trainer_m_back', 'trainer');
|
||||
this.loadAtlas('trainer_m_back_pb', 'trainer');
|
||||
this.loadAtlas('trainer_f_back', 'trainer');
|
||||
this.loadAtlas('trainer_f_back_pb', 'trainer');
|
||||
|
||||
Utils.getEnumValues(TrainerType).map(tt => {
|
||||
const config = trainerConfigs[tt];
|
||||
@@ -519,14 +521,7 @@ export default class BattleScene extends Phaser.Scene {
|
||||
field.add(a);
|
||||
});
|
||||
|
||||
const trainerPbFrameNames = this.anims.generateFrameNames('trainer_m_pb', { zeroPad: 2, start: 1, end: 12 });
|
||||
this.anims.create({
|
||||
key: 'trainer_m_pb',
|
||||
frames: trainerPbFrameNames,
|
||||
frameRate: 16
|
||||
});
|
||||
|
||||
const trainer = this.addFieldSprite(0, 0, 'trainer_m');
|
||||
const trainer = this.addFieldSprite(0, 0, 'trainer_m_back');
|
||||
trainer.setOrigin(0.5, 1);
|
||||
|
||||
field.add(trainer);
|
||||
@@ -733,8 +728,8 @@ export default class BattleScene extends Phaser.Scene {
|
||||
[ this.arenaEnemy, this.arenaNextEnemy ].forEach(a => a.setPosition(-280, 0));
|
||||
this.arenaNextEnemy.setVisible(false);
|
||||
|
||||
this.trainer.setTexture('trainer_m');
|
||||
this.trainer.setPosition(406, 132);
|
||||
this.trainer.setTexture('trainer_m_back');
|
||||
this.trainer.setPosition(406, 186);
|
||||
|
||||
if (clearScene) {
|
||||
this.fadeOutBgm(250, false);
|
||||
|
||||
@@ -172,6 +172,7 @@ export class TrainerConfig {
|
||||
public trainerType: TrainerType;
|
||||
public name: string;
|
||||
public nameFemale: string;
|
||||
public title: string;
|
||||
public hasGenders: boolean = false;
|
||||
public isDouble: boolean = false;
|
||||
public moneyMultiplier: number = 1;
|
||||
@@ -219,6 +220,11 @@ export class TrainerConfig {
|
||||
return this;
|
||||
}
|
||||
|
||||
setTitle(title: string): TrainerConfig {
|
||||
this.title = title;
|
||||
return this;
|
||||
}
|
||||
|
||||
getDerivedType(): TrainerType {
|
||||
let trainerType = this.trainerType;
|
||||
switch (trainerType) {
|
||||
@@ -340,6 +346,7 @@ export class TrainerConfig {
|
||||
this.setSpeciesFilter(p => specialtyTypes.find(t => p.isOfType(t)) !== undefined);
|
||||
this.setSpecialtyTypes(...specialtyTypes);
|
||||
}
|
||||
this.setTitle('Gym Leader');
|
||||
this.setMoneyMultiplier(2.5);
|
||||
this.setBoss();
|
||||
this.setStaticParty();
|
||||
@@ -360,6 +367,7 @@ export class TrainerConfig {
|
||||
this.setSpecialtyTypes(...specialtyTypes);
|
||||
} else
|
||||
this.setSpeciesFilter(p => p.baseTotal >= 450);
|
||||
this.setTitle('Elite Four');
|
||||
this.setMoneyMultiplier(3.25);
|
||||
this.setBoss();
|
||||
this.setStaticParty();
|
||||
@@ -376,6 +384,7 @@ export class TrainerConfig {
|
||||
this.setPartyMemberFunc(-(s + 1), getRandomPartyMemberFunc(speciesPool));
|
||||
});
|
||||
this.setSpeciesFilter(p => p.baseTotal >= 470);
|
||||
this.setTitle('Champion');
|
||||
this.setMoneyMultiplier(10);
|
||||
this.setBoss();
|
||||
this.setStaticParty();
|
||||
@@ -728,24 +737,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)
|
||||
[TrainerType.RIVAL]: new TrainerConfig((t = TrainerType.RIVAL)).setName('Kyle').setHasGenders('Amber').setTitle('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)
|
||||
[TrainerType.RIVAL_2]: new TrainerConfig(++t).setName('Kyle').setHasGenders('Amber').setTitle('Rival').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)
|
||||
[TrainerType.RIVAL_3]: new TrainerConfig(++t).setName('Kyle').setHasGenders('Amber').setTitle('Rival').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)
|
||||
[TrainerType.RIVAL_4]: new TrainerConfig(++t).setName('Kyle').setHasGenders('Amber').setTitle('Rival').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)
|
||||
[TrainerType.RIVAL_5]: new TrainerConfig(++t).setName('Kyle').setHasGenders('Amber').setTitle('Rival').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))
|
||||
@@ -754,7 +763,7 @@ export const trainerConfigs: TrainerConfigs = {
|
||||
p.setBoss();
|
||||
p.pokeball = PokeballType.MASTER_BALL;
|
||||
})),
|
||||
[TrainerType.RIVAL_6]: new TrainerConfig(++t).setBoss().setStaticParty().setMoneyMultiplier(3).setEncounterBgm('final').setBattleBgm('battle_rival_3').setPartyTemplates(trainerPartyTemplates.RIVAL_6)
|
||||
[TrainerType.RIVAL_6]: new TrainerConfig(++t).setName('Kyle').setHasGenders('Amber').setTitle('Rival').setBoss().setStaticParty().setMoneyMultiplier(3).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, 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))
|
||||
|
||||
+3
-2
@@ -46,8 +46,9 @@ export default class Trainer extends Phaser.GameObjects.Container {
|
||||
return this.config.getKey(this.female);
|
||||
}
|
||||
|
||||
getName(): string {
|
||||
return this.config.getName(this.female);
|
||||
getName(includeTitle: boolean = false): string {
|
||||
let name = this.config.getName(this.female);
|
||||
return includeTitle ? `${this.config.title} ${name}` : name;
|
||||
}
|
||||
|
||||
getBattleBgm(): string {
|
||||
|
||||
Reference in new issue
Block a user