mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-29 11:42:21 +02:00
Implement tera for ME trainers
This commit is contained in:
parent
245fca63fb
commit
9fdcf31c0b
@ -1,5 +1,5 @@
|
|||||||
import type { EnemyPartyConfig } from "#app/data/mystery-encounters/utils/encounter-phase-utils";
|
import type { EnemyPartyConfig } from "#app/data/mystery-encounters/utils/encounter-phase-utils";
|
||||||
import { generateModifierType, handleMysteryEncounterBattleFailed, initBattleWithEnemyConfig, setEncounterRewards, } from "#app/data/mystery-encounters/utils/encounter-phase-utils";
|
import { handleMysteryEncounterBattleFailed, initBattleWithEnemyConfig, setEncounterRewards, } from "#app/data/mystery-encounters/utils/encounter-phase-utils";
|
||||||
import { trainerConfigs } from "#app/data/trainer-config";
|
import { trainerConfigs } from "#app/data/trainer-config";
|
||||||
import { MysteryEncounterType } from "#enums/mystery-encounter-type";
|
import { MysteryEncounterType } from "#enums/mystery-encounter-type";
|
||||||
import { globalScene } from "#app/global-scene";
|
import { globalScene } from "#app/global-scene";
|
||||||
@ -23,7 +23,6 @@ import { EggSourceType } from "#enums/egg-source-types";
|
|||||||
import { EggTier } from "#enums/egg-type";
|
import { EggTier } from "#enums/egg-type";
|
||||||
import { MysteryEncounterOptionBuilder } from "#app/data/mystery-encounters/mystery-encounter-option";
|
import { MysteryEncounterOptionBuilder } from "#app/data/mystery-encounters/mystery-encounter-option";
|
||||||
import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode";
|
import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode";
|
||||||
import type { PokemonHeldItemModifierType } from "#app/modifier/modifier-type";
|
|
||||||
import { modifierTypes } from "#app/modifier/modifier-type";
|
import { modifierTypes } from "#app/modifier/modifier-type";
|
||||||
import { Type } from "#enums/type";
|
import { Type } from "#enums/type";
|
||||||
import { getPokeballTintColor } from "#app/data/pokeball";
|
import { getPokeballTintColor } from "#app/data/pokeball";
|
||||||
@ -387,11 +386,7 @@ function getPartyConfig(): EnemyPartyConfig {
|
|||||||
nature: Nature.ADAMANT,
|
nature: Nature.ADAMANT,
|
||||||
moveSet: [ Moves.METEOR_MASH, Moves.FIRE_PUNCH, Moves.ICE_PUNCH, Moves.THUNDER_PUNCH ],
|
moveSet: [ Moves.METEOR_MASH, Moves.FIRE_PUNCH, Moves.ICE_PUNCH, Moves.THUNDER_PUNCH ],
|
||||||
ivs: [ 31, 31, 31, 31, 31, 31 ],
|
ivs: [ 31, 31, 31, 31, 31, 31 ],
|
||||||
modifierConfigs: [
|
tera: Type.STEEL,
|
||||||
{
|
|
||||||
modifier: generateModifierType(modifierTypes.TERA_SHARD, [ Type.STEEL ]) as PokemonHeldItemModifierType,
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
@ -46,6 +46,7 @@ import type { Variant } from "#app/data/variant";
|
|||||||
import { StatusEffect } from "#enums/status-effect";
|
import { StatusEffect } from "#enums/status-effect";
|
||||||
import { globalScene } from "#app/global-scene";
|
import { globalScene } from "#app/global-scene";
|
||||||
import { getPokemonSpecies } from "#app/data/pokemon-species";
|
import { getPokemonSpecies } from "#app/data/pokemon-species";
|
||||||
|
import { Type } from "#app/enums/type";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Animates exclamation sprite over trainer's head at start of encounter
|
* Animates exclamation sprite over trainer's head at start of encounter
|
||||||
@ -98,6 +99,7 @@ export interface EnemyPokemonConfig {
|
|||||||
modifierConfigs?: HeldModifierConfig[];
|
modifierConfigs?: HeldModifierConfig[];
|
||||||
tags?: BattlerTagType[];
|
tags?: BattlerTagType[];
|
||||||
dataSource?: PokemonData;
|
dataSource?: PokemonData;
|
||||||
|
tera?: Type;
|
||||||
aiType?: AiType;
|
aiType?: AiType;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -329,6 +331,14 @@ export async function initBattleWithEnemyConfig(partyConfig: EnemyPartyConfig):
|
|||||||
tags.forEach(tag => enemyPokemon.addTag(tag));
|
tags.forEach(tag => enemyPokemon.addTag(tag));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Set tera
|
||||||
|
if (config.tera && config.tera !== Type.UNKNOWN) {
|
||||||
|
enemyPokemon.teraType = config.tera;
|
||||||
|
if (battle.trainer) {
|
||||||
|
battle.trainer.config.setInstantTera(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// mysteryEncounterBattleEffects will only be used IFF MYSTERY_ENCOUNTER_POST_SUMMON tag is applied
|
// mysteryEncounterBattleEffects will only be used IFF MYSTERY_ENCOUNTER_POST_SUMMON tag is applied
|
||||||
if (config.mysteryEncounterBattleEffects) {
|
if (config.mysteryEncounterBattleEffects) {
|
||||||
enemyPokemon.mysteryEncounterBattleEffects = config.mysteryEncounterBattleEffects;
|
enemyPokemon.mysteryEncounterBattleEffects = config.mysteryEncounterBattleEffects;
|
||||||
|
@ -593,6 +593,11 @@ export class TrainerConfig {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets random pokemon from the trainers team to instant tera. Uses their specialty types is they have one.
|
||||||
|
* @param count The amount of pokemon to have instant tera
|
||||||
|
* @returns this
|
||||||
|
*/
|
||||||
setRandomTeraModifiers(count: () => integer): TrainerConfig {
|
setRandomTeraModifiers(count: () => integer): TrainerConfig {
|
||||||
this.genAIFuncs.push((party: EnemyPokemon[]) => {
|
this.genAIFuncs.push((party: EnemyPokemon[]) => {
|
||||||
const partyMemberIndexes = new Array(party.length).fill(null).map((_, i) => i);
|
const partyMemberIndexes = new Array(party.length).fill(null).map((_, i) => i);
|
||||||
@ -608,6 +613,11 @@ export class TrainerConfig {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets a specific pokemon to instant tera
|
||||||
|
* @param index The index within the team to have instant tera
|
||||||
|
* @returns this
|
||||||
|
*/
|
||||||
setInstantTera(index: number): TrainerConfig {
|
setInstantTera(index: number): TrainerConfig {
|
||||||
this.trainerAI.setInstantTera(index);
|
this.trainerAI.setInstantTera(index);
|
||||||
return this;
|
return this;
|
||||||
|
Loading…
Reference in New Issue
Block a user