diff --git a/data/abilities.ts b/data/abilities.ts index 6cafbc88a6d3..d0fc33e2f4a6 100644 --- a/data/abilities.ts +++ b/data/abilities.ts @@ -1167,7 +1167,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { }, embodyaspectcornerstone: { onStart(pokemon) { - if (pokemon.baseSpecies.name === 'Ogerpon-Cornerstone-Tera' && + if (pokemon.baseSpecies.name === 'Ogerpon-Cornerstone-Tera' && pokemon.terastallized && this.effectState.embodied !== pokemon.previouslySwitchedIn) { this.effectState.embodied = pokemon.previouslySwitchedIn; this.boost({def: 1}, pokemon); @@ -1180,7 +1180,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { }, embodyaspecthearthflame: { onStart(pokemon) { - if (pokemon.baseSpecies.name === 'Ogerpon-Hearthflame-Tera' && + if (pokemon.baseSpecies.name === 'Ogerpon-Hearthflame-Tera' && pokemon.terastallized && this.effectState.embodied !== pokemon.previouslySwitchedIn) { this.effectState.embodied = pokemon.previouslySwitchedIn; this.boost({atk: 1}, pokemon); @@ -1193,7 +1193,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { }, embodyaspectteal: { onStart(pokemon) { - if (pokemon.baseSpecies.name === 'Ogerpon-Teal-Tera' && + if (pokemon.baseSpecies.name === 'Ogerpon-Teal-Tera' && pokemon.terastallized && this.effectState.embodied !== pokemon.previouslySwitchedIn) { this.effectState.embodied = pokemon.previouslySwitchedIn; this.boost({spe: 1}, pokemon); @@ -1206,7 +1206,7 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = { }, embodyaspectwellspring: { onStart(pokemon) { - if (pokemon.baseSpecies.name === 'Ogerpon-Wellspring-Tera' && + if (pokemon.baseSpecies.name === 'Ogerpon-Wellspring-Tera' && pokemon.terastallized && this.effectState.embodied !== pokemon.previouslySwitchedIn) { this.effectState.embodied = pokemon.previouslySwitchedIn; this.boost({spd: 1}, pokemon); diff --git a/data/cg-teams.ts b/data/cg-teams.ts index 826833072007..9ac9d0e85fd4 100644 --- a/data/cg-teams.ts +++ b/data/cg-teams.ts @@ -346,8 +346,8 @@ export default class TeamGenerator { const hasTeraBlast = moves.some(m => m.id === 'terablast'); const hasRevelationDance = moves.some(m => m.id === 'revelationdance'); let teraType; - if (species.forceTeraType) { - teraType = species.forceTeraType; + if (species.requiredTeraType) { + teraType = species.requiredTeraType; } else if (item === 'blacksludge' && this.prng.randomChance(2, 3)) { teraType = 'Poison'; } else if (hasTeraBlast && ability === 'Contrary' && this.prng.randomChance(2, 3)) { @@ -728,7 +728,7 @@ export default class TeamGenerator { // Oricorio should rarely get Tera Blast, as Revelation Dance is strictly better // Tera Blast is also bad on species with forced Tera types, a.k.a. Ogerpon and Terapagos - if (move.id === 'terablast' && (species.baseSpecies === 'Oricorio' || species.forceTeraType)) weight *= 0.5; + if (move.id === 'terablast' && (species.baseSpecies === 'Oricorio' || species.requiredTeraType)) weight *= 0.5; return weight; } diff --git a/data/mods/mixandmega/scripts.ts b/data/mods/mixandmega/scripts.ts index c9c05eaf7d8d..68cb95967561 100644 --- a/data/mods/mixandmega/scripts.ts +++ b/data/mods/mixandmega/scripts.ts @@ -434,7 +434,7 @@ export const Scripts: ModdedBattleScriptsData = { let type = pokemon.teraType; if (pokemon.species.baseSpecies !== 'Ogerpon' && pokemon.getItem().name.endsWith('Mask')) { - type = this.dex.species.get(pokemon.getItem().forcedForme).forceTeraType!; + type = this.dex.species.get(pokemon.getItem().forcedForme).requiredTeraType!; } this.battle.add('-terastallize', pokemon, type); pokemon.terastallized = type; diff --git a/data/pokedex.ts b/data/pokedex.ts index f80acd870965..286f099d5f42 100644 --- a/data/pokedex.ts +++ b/data/pokedex.ts @@ -18195,7 +18195,7 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { eggGroups: ["Undiscovered"], otherFormes: ["Ogerpon-Wellspring", "Ogerpon-Hearthflame", "Ogerpon-Cornerstone", "Ogerpon-Teal-Tera", "Ogerpon-Wellspring-Tera", "Ogerpon-Hearthflame-Tera", "Ogerpon-Cornerstone-Tera"], formeOrder: ["Ogerpon", "Ogerpon-Wellspring", "Ogerpon-Hearthflame", "Ogerpon-Cornerstone", "Ogerpon-Teal-Tera", "Ogerpon-Wellspring-Tera", "Ogerpon-Hearthflame-Tera", "Ogerpon-Cornerstone-Tera"], - forceTeraType: "Grass", + requiredTeraType: "Grass", }, ogerponwellspring: { num: 1017, @@ -18212,7 +18212,7 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { eggGroups: ["Undiscovered"], requiredItem: "Wellspring Mask", changesFrom: "Ogerpon", - forceTeraType: "Water", + requiredTeraType: "Water", }, ogerponhearthflame: { num: 1017, @@ -18229,7 +18229,7 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { eggGroups: ["Undiscovered"], requiredItem: "Hearthflame Mask", changesFrom: "Ogerpon", - forceTeraType: "Fire", + requiredTeraType: "Fire", }, ogerponcornerstone: { num: 1017, @@ -18246,7 +18246,7 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { eggGroups: ["Undiscovered"], requiredItem: "Cornerstone Mask", changesFrom: "Ogerpon", - forceTeraType: "Rock", + requiredTeraType: "Rock", }, ogerpontealtera: { num: 1017, @@ -18262,7 +18262,7 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { color: "Green", eggGroups: ["Undiscovered"], battleOnly: "Ogerpon", - forceTeraType: "Grass", + requiredTeraType: "Grass", }, ogerponwellspringtera: { num: 1017, @@ -18279,7 +18279,7 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { eggGroups: ["Undiscovered"], requiredItem: "Wellspring Mask", battleOnly: "Ogerpon-Wellspring", - forceTeraType: "Water", + requiredTeraType: "Water", }, ogerponhearthflametera: { num: 1017, @@ -18296,7 +18296,7 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { eggGroups: ["Undiscovered"], requiredItem: "Hearthflame Mask", battleOnly: "Ogerpon-Hearthflame", - forceTeraType: "Fire", + requiredTeraType: "Fire", }, ogerponcornerstonetera: { num: 1017, @@ -18313,7 +18313,7 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { eggGroups: ["Undiscovered"], requiredItem: "Cornerstone Mask", battleOnly: "Ogerpon-Cornerstone", - forceTeraType: "Rock", + requiredTeraType: "Rock", }, archaludon: { num: 1018, @@ -18404,7 +18404,7 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { eggGroups: ["Undiscovered"], otherFormes: ["Terapagos-Terastal", "Terapagos-Stellar"], formeOrder: ["Terapagos", "Terapagos-Terastal", "Terapagos-Stellar"], - forceTeraType: "Stellar", + requiredTeraType: "Stellar", }, terapagosterastal: { num: 1024, @@ -18419,7 +18419,7 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { color: "Blue", eggGroups: ["Undiscovered"], battleOnly: "Terapagos", - forceTeraType: "Stellar", + requiredTeraType: "Stellar", }, terapagosstellar: { num: 1024, @@ -18434,7 +18434,7 @@ export const Pokedex: import('../sim/dex-species').SpeciesDataTable = { color: "Blue", eggGroups: ["Undiscovered"], battleOnly: "Terapagos", - forceTeraType: "Stellar", + requiredTeraType: "Stellar", }, pecharunt: { num: 1025, diff --git a/sim/battle-actions.ts b/sim/battle-actions.ts index 64408001b5fa..600384c68e03 100644 --- a/sim/battle-actions.ts +++ b/sim/battle-actions.ts @@ -1932,6 +1932,11 @@ export class BattleActions { } terastallize(pokemon: Pokemon) { + if (pokemon.species.baseSpecies === 'Ogerpon' && !['Fire', 'Grass', 'Rock', 'Water'].includes(pokemon.teraType)) { + this.battle.hint("If Ogerpon Terastallizes into a type other than Fire, Grass, Rock, or Water, the game softlocks."); + return; + } + if (pokemon.illusion && ['Ogerpon', 'Terapagos'].includes(pokemon.illusion.species.baseSpecies)) { this.battle.singleEvent('End', this.dex.abilities.get('Illusion'), pokemon.abilityState, pokemon); } @@ -1946,10 +1951,11 @@ export class BattleActions { pokemon.knownType = true; pokemon.apparentType = type; if (pokemon.species.baseSpecies === 'Ogerpon') { - const tera = pokemon.species.id === 'ogerpon' ? 'tealtera' : 'tera'; - pokemon.formeChange(pokemon.species.id + tera, null, true); + let ogerponSpecies = toID(pokemon.species.battleOnly || pokemon.species.id); + ogerponSpecies += ogerponSpecies === 'ogerpon' ? 'tealtera' : 'tera'; + pokemon.formeChange(ogerponSpecies, null, true); } - if (pokemon.species.name === 'Terapagos-Terastal' && type === 'Stellar') { + if (pokemon.species.name === 'Terapagos-Terastal') { pokemon.formeChange('Terapagos-Stellar', null, true); pokemon.baseMaxhp = Math.floor(Math.floor( 2 * pokemon.species.baseStats['hp'] + pokemon.set.ivs['hp'] + Math.floor(pokemon.set.evs['hp'] / 4) + 100 diff --git a/sim/dex-species.ts b/sim/dex-species.ts index dacfdc48f96b..2e6f99bbb496 100644 --- a/sim/dex-species.ts +++ b/sim/dex-species.ts @@ -226,7 +226,7 @@ export class Species extends BasicEffect implements Readonly