Actually fix single battle summoning issue
This commit is contained in:
1 parent
918a0d77f1
commit
7189258095
3 files changed
+6
-3
No files matched your search
@@ -583,7 +583,7 @@ export class GameData {
|
||||
scene.newArena(sessionData.arena.biome, true);
|
||||
|
||||
sessionData.enemyParty.forEach((enemyData, e) => {
|
||||
const enemyPokemon = enemyData.toPokemon(scene, battleType, e) as EnemyPokemon;
|
||||
const enemyPokemon = enemyData.toPokemon(scene, battleType, e, sessionData.trainer?.variant === TrainerVariant.DOUBLE) as EnemyPokemon;
|
||||
battle.enemyParty[e] = enemyPokemon;
|
||||
if (battleType === BattleType.WILD)
|
||||
battle.seenEnemyPartyMemberIds.add(enemyPokemon.id);
|
||||
|
||||
@@ -105,10 +105,10 @@ export default class PokemonData {
|
||||
}
|
||||
}
|
||||
|
||||
toPokemon(scene: BattleScene, battleType?: BattleType, partyMemberIndex: integer = 0): Pokemon {
|
||||
toPokemon(scene: BattleScene, battleType?: BattleType, partyMemberIndex: integer = 0, double: boolean = false): Pokemon {
|
||||
const species = getPokemonSpecies(this.species);
|
||||
if (this.player)
|
||||
return scene.addPlayerPokemon(species, this.level, this.abilityIndex, this.formIndex, this.gender, this.shiny, this.ivs, this.nature, this);
|
||||
return scene.addEnemyPokemon(species, this.level, battleType === BattleType.TRAINER ? !(partyMemberIndex % 2) ? TrainerSlot.TRAINER : TrainerSlot.TRAINER_PARTNER : TrainerSlot.NONE, this.boss, this);
|
||||
return scene.addEnemyPokemon(species, this.level, battleType === BattleType.TRAINER ? !double || !(partyMemberIndex % 2) ? TrainerSlot.TRAINER : TrainerSlot.TRAINER_PARTNER : TrainerSlot.NONE, this.boss, this);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user