diff --git a/public/images/trainer/player_f.json b/public/images/trainer/player_f.json new file mode 100644 index 000000000..d0dc9eaaa --- /dev/null +++ b/public/images/trainer/player_f.json @@ -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$" + } +} diff --git a/public/images/trainer/player_f.png b/public/images/trainer/player_f.png new file mode 100644 index 000000000..f2f9169d6 Binary files /dev/null and b/public/images/trainer/player_f.png differ diff --git a/public/images/trainer/player_m.json b/public/images/trainer/player_m.json new file mode 100644 index 000000000..0aedb277c --- /dev/null +++ b/public/images/trainer/player_m.json @@ -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$" + } +} diff --git a/public/images/trainer/player_m.png b/public/images/trainer/player_m.png new file mode 100644 index 000000000..7dd60695f Binary files /dev/null and b/public/images/trainer/player_m.png differ diff --git a/public/images/trainer/rival_f.json b/public/images/trainer/rival_f.json new file mode 100644 index 000000000..a0bcbc1f0 --- /dev/null +++ b/public/images/trainer/rival_f.json @@ -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$" + } +} diff --git a/public/images/trainer/rival_f.png b/public/images/trainer/rival_f.png new file mode 100644 index 000000000..b244076da Binary files /dev/null and b/public/images/trainer/rival_f.png differ diff --git a/public/images/trainer/rival_m.json b/public/images/trainer/rival_m.json new file mode 100644 index 000000000..db9e53a25 --- /dev/null +++ b/public/images/trainer/rival_m.json @@ -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$" + } +} diff --git a/public/images/trainer/rival_m.png b/public/images/trainer/rival_m.png new file mode 100644 index 000000000..935c7b8ba Binary files /dev/null and b/public/images/trainer/rival_m.png differ diff --git a/public/images/trainer/trainer_f_back.json b/public/images/trainer/trainer_f_back.json new file mode 100644 index 000000000..13f7c7489 --- /dev/null +++ b/public/images/trainer/trainer_f_back.json @@ -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$" + } +} diff --git a/public/images/trainer/trainer_f_back.png b/public/images/trainer/trainer_f_back.png new file mode 100644 index 000000000..8c528ad56 Binary files /dev/null and b/public/images/trainer/trainer_f_back.png differ diff --git a/public/images/trainer/trainer_f_back_pb.json b/public/images/trainer/trainer_f_back_pb.json new file mode 100644 index 000000000..f90fe05d4 --- /dev/null +++ b/public/images/trainer/trainer_f_back_pb.json @@ -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$" + } +} diff --git a/public/images/trainer/trainer_f_back_pb.png b/public/images/trainer/trainer_f_back_pb.png new file mode 100644 index 000000000..e1c9b6d6c Binary files /dev/null and b/public/images/trainer/trainer_f_back_pb.png differ diff --git a/public/images/trainer/trainer_m.png b/public/images/trainer/trainer_m.png deleted file mode 100644 index 5d8254e11..000000000 Binary files a/public/images/trainer/trainer_m.png and /dev/null differ diff --git a/public/images/trainer/trainer_m_back.json b/public/images/trainer/trainer_m_back.json new file mode 100644 index 000000000..920bedda1 --- /dev/null +++ b/public/images/trainer/trainer_m_back.json @@ -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$" + } +} diff --git a/public/images/trainer/trainer_m_back.png b/public/images/trainer/trainer_m_back.png new file mode 100644 index 000000000..9e40d634a Binary files /dev/null and b/public/images/trainer/trainer_m_back.png differ diff --git a/public/images/trainer/trainer_m_back_pb.json b/public/images/trainer/trainer_m_back_pb.json new file mode 100644 index 000000000..91fed7e41 --- /dev/null +++ b/public/images/trainer/trainer_m_back_pb.json @@ -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$" + } +} diff --git a/public/images/trainer/trainer_m_back_pb.png b/public/images/trainer/trainer_m_back_pb.png new file mode 100644 index 000000000..8980a4e82 Binary files /dev/null and b/public/images/trainer/trainer_m_back_pb.png differ diff --git a/public/images/trainer/trainer_m_pb.json b/public/images/trainer/trainer_m_pb.json deleted file mode 100644 index 97232e4a9..000000000 --- a/public/images/trainer/trainer_m_pb.json +++ /dev/null @@ -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$" - } -} diff --git a/public/images/trainer/trainer_m_pb.png b/public/images/trainer/trainer_m_pb.png deleted file mode 100644 index b8d362b0b..000000000 Binary files a/public/images/trainer/trainer_m_pb.png and /dev/null differ diff --git a/src/battle-phases.ts b/src/battle-phases.ts index c4d3513f8..4d5204f20 100644 --- a/src/battle-phases.ts +++ b/src/battle-phases.ts @@ -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) { diff --git a/src/battle-scene.ts b/src/battle-scene.ts index d83a3234a..57cdcbe30 100644 --- a/src/battle-scene.ts +++ b/src/battle-scene.ts @@ -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); diff --git a/src/data/trainer-config.ts b/src/data/trainer-config.ts index 3a0cbb5c5..8faeb4f90 100644 --- a/src/data/trainer-config.ts +++ b/src/data/trainer-config.ts @@ -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)) diff --git a/src/trainer.ts b/src/trainer.ts index 2d9257827..6b2a3f322 100644 --- a/src/trainer.ts +++ b/src/trainer.ts @@ -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 {