Add new player and rival sprites and trainer titles

pull/14/head
Flashfyre 2024-02-05 23:05:56 -05:00
parent 550c65d6f5
commit b12e7106ed
23 changed files with 450 additions and 299 deletions

View File

@ -0,0 +1,41 @@
{
"textures": [
{
"image": "player_f.png",
"format": "RGBA8888",
"size": {
"w": 70,
"h": 70
},
"scale": 1,
"frames": [
{
"filename": "0001.png",
"rotated": false,
"trimmed": false,
"sourceSize": {
"w": 27,
"h": 70
},
"spriteSourceSize": {
"x": 0,
"y": 0,
"w": 27,
"h": 70
},
"frame": {
"x": 0,
"y": 0,
"w": 27,
"h": 70
}
}
]
}
],
"meta": {
"app": "https://www.codeandweb.com/texturepacker",
"version": "3.0",
"smartupdate": "$TexturePacker:SmartUpdate:61e0fa9a991ad072a72407f92271121d:748b57cb41fc465527ac9fce58c10ad0:001f13d438089d8d7bc52849cc088fa0$"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 725 B

View File

@ -0,0 +1,41 @@
{
"textures": [
{
"image": "player_m.png",
"format": "RGBA8888",
"size": {
"w": 73,
"h": 73
},
"scale": 1,
"frames": [
{
"filename": "0001.png",
"rotated": false,
"trimmed": false,
"sourceSize": {
"w": 34,
"h": 73
},
"spriteSourceSize": {
"x": 0,
"y": 0,
"w": 34,
"h": 73
},
"frame": {
"x": 0,
"y": 0,
"w": 34,
"h": 73
}
}
]
}
],
"meta": {
"app": "https://www.codeandweb.com/texturepacker",
"version": "3.0",
"smartupdate": "$TexturePacker:SmartUpdate:0c81ec9126339a455d3ae3ee367ae886:1d82098bbf0a31014a36eafbc36aec65:9a0697a8c22f31abc83ce66786cc3e77$"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 740 B

View File

@ -0,0 +1,41 @@
{
"textures": [
{
"image": "rival_f.png",
"format": "RGBA8888",
"size": {
"w": 69,
"h": 69
},
"scale": 1,
"frames": [
{
"filename": "0001.png",
"rotated": false,
"trimmed": false,
"sourceSize": {
"w": 27,
"h": 69
},
"spriteSourceSize": {
"x": 0,
"y": 0,
"w": 27,
"h": 69
},
"frame": {
"x": 0,
"y": 0,
"w": 27,
"h": 69
}
}
]
}
],
"meta": {
"app": "https://www.codeandweb.com/texturepacker",
"version": "3.0",
"smartupdate": "$TexturePacker:SmartUpdate:5f971489695d808dd4a75244472baa7a:5390e2006b9312c8b6d7c2f5a93a3dad:0aaa288a75ecf87b6647cbb7fd0d2ecc$"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 721 B

View File

@ -0,0 +1,41 @@
{
"textures": [
{
"image": "rival_m.png",
"format": "RGBA8888",
"size": {
"w": 73,
"h": 73
},
"scale": 1,
"frames": [
{
"filename": "0001.png",
"rotated": false,
"trimmed": false,
"sourceSize": {
"w": 34,
"h": 73
},
"spriteSourceSize": {
"x": 0,
"y": 0,
"w": 34,
"h": 73
},
"frame": {
"x": 0,
"y": 0,
"w": 34,
"h": 73
}
}
]
}
],
"meta": {
"app": "https://www.codeandweb.com/texturepacker",
"version": "3.0",
"smartupdate": "$TexturePacker:SmartUpdate:4c2a08a8a0acbbe63d0adb2453b1990b:81d51f69c08909cd8d28932a6c1b4f71:7ef6104245066e3b4078d0f6ef5e5edf$"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 743 B

View File

@ -0,0 +1,41 @@
{
"textures": [
{
"image": "trainer_f_back.png",
"format": "RGBA8888",
"size": {
"w": 100,
"h": 100
},
"scale": 1,
"frames": [
{
"filename": "1",
"rotated": false,
"trimmed": false,
"sourceSize": {
"w": 49,
"h": 100
},
"spriteSourceSize": {
"x": 0,
"y": 0,
"w": 49,
"h": 100
},
"frame": {
"x": 0,
"y": 0,
"w": 49,
"h": 100
}
}
]
}
],
"meta": {
"app": "https://www.codeandweb.com/texturepacker",
"version": "3.0",
"smartupdate": "$TexturePacker:SmartUpdate:37094505617acfd230145dc66672da10:6e3e539898ea6ace66caac40253fe1d9:10a006cb9dc3d266b3827d6d92b8ea03$"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -0,0 +1,83 @@
{
"textures": [
{
"image": "trainer_f_back_pb.png",
"format": "RGBA8888",
"size": {
"w": 55,
"h": 299
},
"scale": 1,
"frames": [
{
"filename": "1",
"rotated": false,
"trimmed": true,
"sourceSize": {
"w": 80,
"h": 117
},
"spriteSourceSize": {
"x": 13,
"y": 16,
"w": 53,
"h": 101
},
"frame": {
"x": 0,
"y": 0,
"w": 53,
"h": 101
}
},
{
"filename": "2",
"rotated": false,
"trimmed": true,
"sourceSize": {
"w": 80,
"h": 117
},
"spriteSourceSize": {
"x": 4,
"y": 12,
"w": 55,
"h": 105
},
"frame": {
"x": 0,
"y": 101,
"w": 55,
"h": 105
}
},
{
"filename": "3",
"rotated": false,
"trimmed": true,
"sourceSize": {
"w": 80,
"h": 117
},
"spriteSourceSize": {
"x": 9,
"y": 24,
"w": 55,
"h": 93
},
"frame": {
"x": 0,
"y": 206,
"w": 55,
"h": 93
}
}
]
}
],
"meta": {
"app": "https://www.codeandweb.com/texturepacker",
"version": "3.0",
"smartupdate": "$TexturePacker:SmartUpdate:96b7edf3cc6b5e48350576ce7f1d3f8b:f544772e0743b2abd40e4495217ede47:92848464f31dc35aabc927a65bbb58b8$"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

View File

@ -0,0 +1,41 @@
{
"textures": [
{
"image": "trainer_m_back.png",
"format": "RGBA8888",
"size": {
"w": 105,
"h": 105
},
"scale": 1,
"frames": [
{
"filename": "1",
"rotated": false,
"trimmed": false,
"sourceSize": {
"w": 48,
"h": 105
},
"spriteSourceSize": {
"x": 0,
"y": 0,
"w": 48,
"h": 105
},
"frame": {
"x": 0,
"y": 0,
"w": 48,
"h": 105
}
}
]
}
],
"meta": {
"app": "https://www.codeandweb.com/texturepacker",
"version": "3.0",
"smartupdate": "$TexturePacker:SmartUpdate:0e30e04a108dbcbcc6455e7f2adaf00a:30b46f18ce6dc2b96b9949c7dddca304:4707104d267c3cfbc1415484c4c121a9$"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -0,0 +1,83 @@
{
"textures": [
{
"image": "trainer_m_back_pb.png",
"format": "RGBA8888",
"size": {
"w": 119,
"h": 208
},
"scale": 1,
"frames": [
{
"filename": "1",
"rotated": false,
"trimmed": true,
"sourceSize": {
"w": 80,
"h": 117
},
"spriteSourceSize": {
"x": 7,
"y": 11,
"w": 60,
"h": 106
},
"frame": {
"x": 0,
"y": 0,
"w": 60,
"h": 106
}
},
{
"filename": "2",
"rotated": false,
"trimmed": true,
"sourceSize": {
"w": 80,
"h": 117
},
"spriteSourceSize": {
"x": 5,
"y": 1,
"w": 59,
"h": 116
},
"frame": {
"x": 60,
"y": 0,
"w": 59,
"h": 116
}
},
{
"filename": "3",
"rotated": false,
"trimmed": true,
"sourceSize": {
"w": 80,
"h": 117
},
"spriteSourceSize": {
"x": 0,
"y": 25,
"w": 76,
"h": 92
},
"frame": {
"x": 0,
"y": 116,
"w": 76,
"h": 92
}
}
]
}
],
"meta": {
"app": "https://www.codeandweb.com/texturepacker",
"version": "3.0",
"smartupdate": "$TexturePacker:SmartUpdate:36135e173a201c11f063d344d0e1043e:c712b22058aabbe8d84a901cb26122c9:a2415e768fe30271bee6a79b25f7fd21$"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

View File

@ -1,272 +0,0 @@
{
"textures": [
{
"image": "trainer_m_pb.png",
"format": "RGBA8888",
"size": {
"w": 176,
"h": 54
},
"scale": 1,
"frames": [
{
"filename": "01",
"rotated": false,
"trimmed": true,
"sourceSize": {
"w": 70,
"h": 58
},
"spriteSourceSize": {
"x": 0,
"y": 6,
"w": 65,
"h": 52
},
"frame": {
"x": 1,
"y": 1,
"w": 65,
"h": 52
}
},
{
"filename": "02",
"rotated": false,
"trimmed": true,
"sourceSize": {
"w": 70,
"h": 58
},
"spriteSourceSize": {
"x": 0,
"y": 6,
"w": 65,
"h": 52
},
"frame": {
"x": 1,
"y": 1,
"w": 65,
"h": 52
}
},
{
"filename": "03",
"rotated": false,
"trimmed": true,
"sourceSize": {
"w": 70,
"h": 58
},
"spriteSourceSize": {
"x": 0,
"y": 6,
"w": 65,
"h": 52
},
"frame": {
"x": 1,
"y": 1,
"w": 65,
"h": 52
}
},
{
"filename": "04",
"rotated": false,
"trimmed": true,
"sourceSize": {
"w": 70,
"h": 58
},
"spriteSourceSize": {
"x": 0,
"y": 6,
"w": 65,
"h": 52
},
"frame": {
"x": 1,
"y": 1,
"w": 65,
"h": 52
}
},
{
"filename": "05",
"rotated": false,
"trimmed": true,
"sourceSize": {
"w": 70,
"h": 58
},
"spriteSourceSize": {
"x": 0,
"y": 6,
"w": 65,
"h": 52
},
"frame": {
"x": 1,
"y": 1,
"w": 65,
"h": 52
}
},
{
"filename": "06",
"rotated": false,
"trimmed": true,
"sourceSize": {
"w": 70,
"h": 58
},
"spriteSourceSize": {
"x": 0,
"y": 6,
"w": 65,
"h": 52
},
"frame": {
"x": 1,
"y": 1,
"w": 65,
"h": 52
}
},
{
"filename": "07",
"rotated": false,
"trimmed": true,
"sourceSize": {
"w": 70,
"h": 58
},
"spriteSourceSize": {
"x": 0,
"y": 6,
"w": 65,
"h": 52
},
"frame": {
"x": 1,
"y": 1,
"w": 65,
"h": 52
}
},
{
"filename": "08",
"rotated": false,
"trimmed": true,
"sourceSize": {
"w": 70,
"h": 58
},
"spriteSourceSize": {
"x": 0,
"y": 6,
"w": 65,
"h": 52
},
"frame": {
"x": 1,
"y": 1,
"w": 65,
"h": 52
}
},
{
"filename": "09",
"rotated": false,
"trimmed": true,
"sourceSize": {
"w": 70,
"h": 58
},
"spriteSourceSize": {
"x": 6,
"y": 7,
"w": 40,
"h": 51
},
"frame": {
"x": 68,
"y": 1,
"w": 40,
"h": 51
}
},
{
"filename": "10",
"rotated": false,
"trimmed": true,
"sourceSize": {
"w": 70,
"h": 58
},
"spriteSourceSize": {
"x": 6,
"y": 7,
"w": 40,
"h": 51
},
"frame": {
"x": 68,
"y": 1,
"w": 40,
"h": 51
}
},
{
"filename": "11",
"rotated": false,
"trimmed": true,
"sourceSize": {
"w": 70,
"h": 58
},
"spriteSourceSize": {
"x": 6,
"y": 7,
"w": 40,
"h": 51
},
"frame": {
"x": 68,
"y": 1,
"w": 40,
"h": 51
}
},
{
"filename": "12",
"rotated": false,
"trimmed": true,
"sourceSize": {
"w": 70,
"h": 58
},
"spriteSourceSize": {
"x": 5,
"y": 8,
"w": 65,
"h": 50
},
"frame": {
"x": 110,
"y": 1,
"w": 65,
"h": 50
}
}
]
}
],
"meta": {
"app": "https://www.codeandweb.com/texturepacker",
"version": "3.0",
"smartupdate": "$TexturePacker:SmartUpdate:2868aaf88f829f088565db8706340b0b:7b0efc1a4cb30d1b16f72c44af27d65d:90c8f32a14ac0e0757248d0e566cf6a8$"
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

View File

@ -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) {

View File

@ -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);

View File

@ -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))

View File

@ -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 {