2024-01-13 17:24:24 +00:00
import { TimeOfDay } from "./enums/time-of-day" ;
2024-01-10 04:34:43 +00:00
import { PokemonFormChangeItemModifier } from "../modifier/modifier" ;
2024-03-01 01:08:50 +00:00
import Pokemon from "../field/pokemon" ;
2024-01-13 17:24:24 +00:00
import { Moves } from "./enums/moves" ;
2024-01-10 04:34:43 +00:00
import { SpeciesFormKey } from "./pokemon-species" ;
2024-01-13 17:24:24 +00:00
import { Species } from "./enums/species" ;
2024-01-10 04:34:43 +00:00
import { StatusEffect } from "./status-effect" ;
2024-03-30 22:46:33 +00:00
import { MoveCategory , allMoves } from "./move" ;
2024-03-30 22:57:21 +00:00
import { Abilities } from "./ability" ;
2024-01-10 04:34:43 +00:00
export enum FormChangeItem {
NONE ,
ABOMASITE ,
ABSOLITE ,
AERODACTYLITE ,
AGGRONITE ,
ALAKAZITE ,
ALTARIANITE ,
AMPHAROSITE ,
AUDINITE ,
BANETTITE ,
BEEDRILLITE ,
BLASTOISINITE ,
BLAZIKENITE ,
CAMERUPTITE ,
CHARIZARDITE_X ,
CHARIZARDITE_Y ,
DIANCITE ,
GALLADITE ,
GARCHOMPITE ,
GARDEVOIRITE ,
GENGARITE ,
GLALITITE ,
GYARADOSITE ,
HERACRONITE ,
HOUNDOOMINITE ,
KANGASKHANITE ,
LATIASITE ,
LATIOSITE ,
LOPUNNITE ,
LUCARIONITE ,
MANECTITE ,
MAWILITE ,
MEDICHAMITE ,
METAGROSSITE ,
MEWTWONITE_X ,
MEWTWONITE_Y ,
PIDGEOTITE ,
PINSIRITE ,
RAYQUAZITE ,
SABLENITE ,
SALAMENCITE ,
SCEPTILITE ,
SCIZORITE ,
SHARPEDONITE ,
SLOWBRONITE ,
STEELIXITE ,
SWAMPERTITE ,
TYRANITARITE ,
VENUSAURITE ,
BLUE_ORB = 50 ,
RED_ORB ,
ADAMANT_CRYSTAL ,
LUSTROUS_ORB ,
GRISEOUS_CORE ,
REVEAL_GLASS ,
2024-02-14 05:21:44 +00:00
GRACIDEA ,
2024-02-20 00:37:28 +00:00
MAX_MUSHROOMS ,
2024-02-25 23:49:31 +00:00
DARK_STONE ,
LIGHT_STONE ,
2024-02-22 01:59:08 +00:00
PRISON_BOTTLE ,
N_LUNARIZER ,
N_SOLARIZER ,
RUSTED_SWORD ,
RUSTED_SHIELD ,
ICY_REINS_OF_UNITY ,
SHADOW_REINS_OF_UNITY ,
2024-02-20 00:37:28 +00:00
WELLSPRING_MASK ,
HEARTHFLAME_MASK ,
CORNERSTONE_MASK
2024-01-10 04:34:43 +00:00
}
export type SpeciesFormChangeConditionPredicate = ( p : Pokemon ) = > boolean ;
export type SpeciesFormChangeConditionEnforceFunc = ( p : Pokemon ) = > void ;
export class SpeciesFormChange {
public speciesId : Species ;
public preFormKey : string ;
public formKey : string ;
public trigger : SpeciesFormChangeTrigger ;
public quiet : boolean ;
2024-03-30 22:57:21 +00:00
private conditions : SpeciesFormChangeCondition [ ] ;
2024-01-10 04:34:43 +00:00
2024-03-30 22:57:21 +00:00
constructor ( speciesId : Species , preFormKey : string , evoFormKey : string , trigger : SpeciesFormChangeTrigger , quiet : boolean = false , . . . conditions : SpeciesFormChangeCondition [ ] ) {
2024-01-10 04:34:43 +00:00
this . speciesId = speciesId ;
this . preFormKey = preFormKey ;
this . formKey = evoFormKey ;
this . trigger = trigger ;
this . quiet = quiet ;
2024-03-30 22:57:21 +00:00
this . conditions = conditions ;
2024-01-10 04:34:43 +00:00
}
canChange ( pokemon : Pokemon ) : boolean {
if ( pokemon . species . speciesId !== this . speciesId )
return false ;
if ( ! pokemon . species . forms . length )
return false ;
const formKeys = pokemon . species . forms . map ( f = > f . formKey ) ;
if ( formKeys [ pokemon . formIndex ] !== this . preFormKey )
return false ;
if ( formKeys [ pokemon . formIndex ] === this . formKey )
return false ;
2024-03-30 22:57:21 +00:00
for ( let condition of this . conditions ) {
if ( ! condition . predicate ( pokemon ) )
return false ;
}
2024-01-10 04:34:43 +00:00
if ( ! this . trigger . canChange ( pokemon ) )
return false ;
return true ;
}
findTrigger ( triggerType : { new ( . . . args : any [ ] ) : SpeciesFormChangeTrigger } ) : SpeciesFormChangeTrigger {
if ( ! this . trigger . hasTriggerType ( triggerType ) )
return null ;
let trigger = this . trigger ;
if ( trigger instanceof SpeciesFormChangeCompoundTrigger )
return trigger . triggers . find ( t = > t . hasTriggerType ( triggerType ) ) ;
return trigger ;
}
}
export class SpeciesFormChangeCondition {
public predicate : SpeciesFormChangeConditionPredicate ;
public enforceFunc : SpeciesFormChangeConditionEnforceFunc ;
constructor ( predicate : SpeciesFormChangeConditionPredicate , enforceFunc? : SpeciesFormChangeConditionEnforceFunc ) {
this . predicate = predicate ;
this . enforceFunc = enforceFunc ;
}
}
export abstract class SpeciesFormChangeTrigger {
canChange ( pokemon : Pokemon ) : boolean {
return true ;
}
hasTriggerType ( triggerType : { new ( . . . args : any [ ] ) : SpeciesFormChangeTrigger } ) : boolean {
return this instanceof triggerType ;
}
}
2024-01-13 17:24:24 +00:00
export class SpeciesFormChangeManualTrigger extends SpeciesFormChangeTrigger {
canChange ( pokemon : Pokemon ) : boolean {
return true ;
}
}
2024-01-10 04:34:43 +00:00
export class SpeciesFormChangeCompoundTrigger {
public triggers : SpeciesFormChangeTrigger [ ] ;
constructor ( . . . triggers : SpeciesFormChangeTrigger [ ] ) {
this . triggers = triggers ;
}
canChange ( pokemon : Pokemon ) : boolean {
for ( let trigger of this . triggers ) {
if ( ! trigger . canChange ( pokemon ) )
return false ;
}
return true ;
}
hasTriggerType ( triggerType : { new ( . . . args : any [ ] ) : SpeciesFormChangeTrigger } ) : boolean {
return ! ! this . triggers . find ( t = > t . hasTriggerType ( triggerType ) ) ;
}
}
export class SpeciesFormChangeItemTrigger extends SpeciesFormChangeTrigger {
public item : FormChangeItem ;
public active : boolean ;
constructor ( item : FormChangeItem , active : boolean = true ) {
super ( ) ;
this . item = item ;
this . active = active ;
}
canChange ( pokemon : Pokemon ) : boolean {
2024-02-14 05:21:44 +00:00
return ! ! pokemon . scene . findModifier ( m = > m instanceof PokemonFormChangeItemModifier && m . pokemonId === pokemon . id && m . formChangeItem === this . item && m . active === this . active ) ;
2024-01-10 04:34:43 +00:00
}
}
export class SpeciesFormChangeTimeOfDayTrigger extends SpeciesFormChangeTrigger {
public timesOfDay : TimeOfDay [ ] ;
constructor ( . . . timesOfDay : TimeOfDay [ ] ) {
super ( ) ;
this . timesOfDay = timesOfDay ;
}
canChange ( pokemon : Pokemon ) : boolean {
return this . timesOfDay . indexOf ( pokemon . scene . arena . getTimeOfDay ( ) ) > - 1 ;
}
}
export class SpeciesFormChangeActiveTrigger extends SpeciesFormChangeTrigger {
public active : boolean ;
constructor ( active : boolean = false ) {
super ( ) ;
this . active = active ;
}
canChange ( pokemon : Pokemon ) : boolean {
return pokemon . isActive ( true ) === this . active ;
}
}
export class SpeciesFormChangeStatusEffectTrigger extends SpeciesFormChangeTrigger {
public statusEffects : StatusEffect [ ] ;
public invert : boolean ;
constructor ( statusEffects : StatusEffect | StatusEffect [ ] , invert : boolean = false ) {
super ( ) ;
if ( ! Array . isArray ( statusEffects ) )
statusEffects = [ statusEffects ] ;
this . statusEffects = statusEffects ;
this . invert = invert ;
}
canChange ( pokemon : Pokemon ) : boolean {
return ( this . statusEffects . indexOf ( pokemon . status ? . effect || StatusEffect . NONE ) > - 1 ) !== this . invert ;
}
}
export class SpeciesFormChangeMoveLearnedTrigger extends SpeciesFormChangeTrigger {
public move : Moves ;
public known : boolean ;
constructor ( move : Moves , known : boolean = true ) {
super ( ) ;
this . move = move ;
this . known = known ;
}
canChange ( pokemon : Pokemon ) : boolean {
return ( ! ! pokemon . moveset . filter ( m = > m . moveId === this . move ) . length ) === this . known ;
}
}
2024-03-30 22:46:33 +00:00
export abstract class SpeciesFormChangeMoveTrigger extends SpeciesFormChangeTrigger {
public movePredicate : ( m : Moves ) = > boolean ;
2024-01-10 04:34:43 +00:00
public used : boolean ;
2024-03-30 22:46:33 +00:00
constructor ( move : Moves | ( ( m : Moves ) = > boolean ) , used : boolean = true ) {
2024-01-10 04:34:43 +00:00
super ( ) ;
2024-03-30 22:46:33 +00:00
this . movePredicate = typeof move === 'function' ? move : ( m : Moves ) = > m === move ;
2024-01-10 04:34:43 +00:00
this . used = used ;
}
2024-03-30 22:46:33 +00:00
}
export class SpeciesFormChangePreMoveTrigger extends SpeciesFormChangeMoveTrigger {
canChange ( pokemon : Pokemon ) : boolean {
2024-03-31 05:10:47 +01:00
const command = pokemon . scene . currentBattle . turnCommands [ pokemon . getBattlerIndex ( ) ] ;
2024-03-30 22:46:33 +00:00
return command ? . move && this . movePredicate ( command . move . move ) === this . used ;
}
}
2024-01-10 04:34:43 +00:00
2024-03-30 22:46:33 +00:00
export class SpeciesFormChangePostMoveTrigger extends SpeciesFormChangeMoveTrigger {
2024-01-10 04:34:43 +00:00
canChange ( pokemon : Pokemon ) : boolean {
2024-03-30 22:46:33 +00:00
return pokemon . summonData && ! ! pokemon . getLastXMoves ( 1 ) . filter ( m = > this . movePredicate ( m . move ) ) . length === this . used ;
2024-01-10 04:34:43 +00:00
}
}
2024-02-14 05:21:44 +00:00
export class SpeciesDefaultFormMatchTrigger extends SpeciesFormChangeTrigger {
private formKey : string ;
constructor ( formKey : string ) {
super ( ) ;
this . formKey = formKey ;
}
canChange ( pokemon : Pokemon ) : boolean {
2024-04-03 04:00:56 +01:00
return this . formKey === pokemon . species . forms [ pokemon . scene . getSpeciesFormIndex ( pokemon . species , pokemon . gender , pokemon . getNature ( ) , true ) ] . formKey ;
2024-02-14 05:21:44 +00:00
}
}
2024-01-10 04:34:43 +00:00
export function getSpeciesFormChangeMessage ( pokemon : Pokemon , formChange : SpeciesFormChange , preName : string ) : string {
const isMega = formChange . formKey . indexOf ( SpeciesFormKey . MEGA ) > - 1 ;
2024-02-14 05:21:44 +00:00
const isGmax = formChange . formKey . indexOf ( SpeciesFormKey . GIGANTAMAX ) > - 1 ;
const isEmax = formChange . formKey . indexOf ( 'eternamax' ) > - 1 ;
2024-01-10 04:34:43 +00:00
const isRevert = ! isMega && formChange . formKey === pokemon . species . forms [ 0 ] . formKey ;
const prefix = ! pokemon . isPlayer ( ) ? pokemon . hasTrainer ( ) ? 'Foe ' : 'Wild ' : 'Your ' ;
if ( isMega )
return ` ${ prefix } ${ preName } mega-evolved \ ninto ${ pokemon . name } ! ` ;
2024-02-14 05:21:44 +00:00
if ( isGmax )
return ` ${ prefix } ${ preName } Gigantamaxed \ ninto ${ pokemon . name } ! ` ;
if ( isEmax )
return ` ${ prefix } ${ preName } Eternamaxed \ ninto ${ pokemon . name } ! ` ;
2024-01-10 04:34:43 +00:00
if ( isRevert )
return ` ${ prefix } ${ pokemon . name } reverted \ nto its original form! ` ;
return ` ${ prefix } ${ preName } changed form! ` ;
}
interface PokemonFormChanges {
[ key : string ] : SpeciesFormChange [ ]
}
export const pokemonFormChanges : PokemonFormChanges = {
[ Species . VENUSAUR ] : [
2024-02-14 05:21:44 +00:00
new SpeciesFormChange ( Species . VENUSAUR , '' , SpeciesFormKey . MEGA , new SpeciesFormChangeItemTrigger ( FormChangeItem . VENUSAURITE ) ) ,
new SpeciesFormChange ( Species . VENUSAUR , '' , SpeciesFormKey . GIGANTAMAX , new SpeciesFormChangeItemTrigger ( FormChangeItem . MAX_MUSHROOMS ) )
2024-01-10 04:34:43 +00:00
] ,
[ Species . BLASTOISE ] : [
2024-02-14 05:21:44 +00:00
new SpeciesFormChange ( Species . BLASTOISE , '' , SpeciesFormKey . MEGA , new SpeciesFormChangeItemTrigger ( FormChangeItem . BLASTOISINITE ) ) ,
new SpeciesFormChange ( Species . BLASTOISE , '' , SpeciesFormKey . GIGANTAMAX , new SpeciesFormChangeItemTrigger ( FormChangeItem . MAX_MUSHROOMS ) )
2024-01-10 04:34:43 +00:00
] ,
[ Species . CHARIZARD ] : [
new SpeciesFormChange ( Species . CHARIZARD , '' , SpeciesFormKey . MEGA_X , new SpeciesFormChangeItemTrigger ( FormChangeItem . CHARIZARDITE_X ) ) ,
2024-02-14 05:21:44 +00:00
new SpeciesFormChange ( Species . CHARIZARD , '' , SpeciesFormKey . MEGA_Y , new SpeciesFormChangeItemTrigger ( FormChangeItem . CHARIZARDITE_Y ) ) ,
new SpeciesFormChange ( Species . CHARIZARD , '' , SpeciesFormKey . GIGANTAMAX , new SpeciesFormChangeItemTrigger ( FormChangeItem . MAX_MUSHROOMS ) )
] ,
[ Species . BUTTERFREE ] : [
new SpeciesFormChange ( Species . BUTTERFREE , '' , SpeciesFormKey . GIGANTAMAX , new SpeciesFormChangeItemTrigger ( FormChangeItem . MAX_MUSHROOMS ) )
2024-01-10 04:34:43 +00:00
] ,
[ Species . BEEDRILL ] : [
new SpeciesFormChange ( Species . BEEDRILL , '' , SpeciesFormKey . MEGA , new SpeciesFormChangeItemTrigger ( FormChangeItem . BEEDRILLITE ) )
] ,
[ Species . PIDGEOT ] : [
new SpeciesFormChange ( Species . PIDGEOT , '' , SpeciesFormKey . MEGA , new SpeciesFormChangeItemTrigger ( FormChangeItem . PIDGEOTITE ) )
] ,
2024-02-14 05:21:44 +00:00
[ Species . PIKACHU ] : [
new SpeciesFormChange ( Species . PIKACHU , '' , SpeciesFormKey . GIGANTAMAX , new SpeciesFormChangeItemTrigger ( FormChangeItem . MAX_MUSHROOMS ) )
] ,
[ Species . MEOWTH ] : [
new SpeciesFormChange ( Species . MEOWTH , '' , SpeciesFormKey . GIGANTAMAX , new SpeciesFormChangeItemTrigger ( FormChangeItem . MAX_MUSHROOMS ) )
] ,
2024-01-10 04:34:43 +00:00
[ Species . ALAKAZAM ] : [
new SpeciesFormChange ( Species . ALAKAZAM , '' , SpeciesFormKey . MEGA , new SpeciesFormChangeItemTrigger ( FormChangeItem . ALAKAZITE ) )
] ,
2024-02-14 05:21:44 +00:00
[ Species . MACHAMP ] : [
new SpeciesFormChange ( Species . MACHAMP , '' , SpeciesFormKey . GIGANTAMAX , new SpeciesFormChangeItemTrigger ( FormChangeItem . MAX_MUSHROOMS ) )
] ,
2024-01-10 04:34:43 +00:00
[ Species . SLOWBRO ] : [
new SpeciesFormChange ( Species . SLOWBRO , '' , SpeciesFormKey . MEGA , new SpeciesFormChangeItemTrigger ( FormChangeItem . SLOWBRONITE ) )
] ,
[ Species . GENGAR ] : [
2024-02-14 05:21:44 +00:00
new SpeciesFormChange ( Species . GENGAR , '' , SpeciesFormKey . MEGA , new SpeciesFormChangeItemTrigger ( FormChangeItem . GENGARITE ) ) ,
new SpeciesFormChange ( Species . GENGAR , '' , SpeciesFormKey . GIGANTAMAX , new SpeciesFormChangeItemTrigger ( FormChangeItem . MAX_MUSHROOMS ) )
] ,
[ Species . KINGLER ] : [
new SpeciesFormChange ( Species . KINGLER , '' , SpeciesFormKey . GIGANTAMAX , new SpeciesFormChangeItemTrigger ( FormChangeItem . MAX_MUSHROOMS ) )
2024-01-10 04:34:43 +00:00
] ,
[ Species . KANGASKHAN ] : [
new SpeciesFormChange ( Species . KANGASKHAN , '' , SpeciesFormKey . MEGA , new SpeciesFormChangeItemTrigger ( FormChangeItem . KANGASKHANITE ) )
] ,
[ Species . PINSIR ] : [
new SpeciesFormChange ( Species . PINSIR , '' , SpeciesFormKey . MEGA , new SpeciesFormChangeItemTrigger ( FormChangeItem . PINSIRITE ) )
] ,
[ Species . GYARADOS ] : [
new SpeciesFormChange ( Species . GYARADOS , '' , SpeciesFormKey . MEGA , new SpeciesFormChangeItemTrigger ( FormChangeItem . GYARADOSITE ) )
] ,
2024-02-14 05:21:44 +00:00
[ Species . LAPRAS ] : [
new SpeciesFormChange ( Species . LAPRAS , '' , SpeciesFormKey . GIGANTAMAX , new SpeciesFormChangeItemTrigger ( FormChangeItem . MAX_MUSHROOMS ) )
] ,
[ Species . EEVEE ] : [
new SpeciesFormChange ( Species . EEVEE , '' , SpeciesFormKey . GIGANTAMAX , new SpeciesFormChangeItemTrigger ( FormChangeItem . MAX_MUSHROOMS ) )
] ,
[ Species . SNORLAX ] : [
new SpeciesFormChange ( Species . SNORLAX , '' , SpeciesFormKey . GIGANTAMAX , new SpeciesFormChangeItemTrigger ( FormChangeItem . MAX_MUSHROOMS ) )
] ,
2024-01-10 04:34:43 +00:00
[ Species . AERODACTYL ] : [
new SpeciesFormChange ( Species . AERODACTYL , '' , SpeciesFormKey . MEGA , new SpeciesFormChangeItemTrigger ( FormChangeItem . AERODACTYLITE ) )
] ,
[ Species . MEWTWO ] : [
new SpeciesFormChange ( Species . MEWTWO , '' , SpeciesFormKey . MEGA_X , new SpeciesFormChangeItemTrigger ( FormChangeItem . MEWTWONITE_X ) ) ,
new SpeciesFormChange ( Species . MEWTWO , '' , SpeciesFormKey . MEGA_Y , new SpeciesFormChangeItemTrigger ( FormChangeItem . MEWTWONITE_Y ) )
] ,
[ Species . AMPHAROS ] : [
new SpeciesFormChange ( Species . AMPHAROS , '' , SpeciesFormKey . MEGA , new SpeciesFormChangeItemTrigger ( FormChangeItem . AMPHAROSITE ) )
] ,
[ Species . STEELIX ] : [
new SpeciesFormChange ( Species . STEELIX , '' , SpeciesFormKey . MEGA , new SpeciesFormChangeItemTrigger ( FormChangeItem . STEELIXITE ) )
] ,
[ Species . SCIZOR ] : [
new SpeciesFormChange ( Species . SCIZOR , '' , SpeciesFormKey . MEGA , new SpeciesFormChangeItemTrigger ( FormChangeItem . SCIZORITE ) )
] ,
[ Species . HERACROSS ] : [
new SpeciesFormChange ( Species . HERACROSS , '' , SpeciesFormKey . MEGA , new SpeciesFormChangeItemTrigger ( FormChangeItem . HERACRONITE ) )
] ,
[ Species . HOUNDOOM ] : [
new SpeciesFormChange ( Species . HOUNDOOM , '' , SpeciesFormKey . MEGA , new SpeciesFormChangeItemTrigger ( FormChangeItem . HOUNDOOMINITE ) )
] ,
[ Species . TYRANITAR ] : [
new SpeciesFormChange ( Species . TYRANITAR , '' , SpeciesFormKey . MEGA , new SpeciesFormChangeItemTrigger ( FormChangeItem . TYRANITARITE ) )
] ,
[ Species . SCEPTILE ] : [
new SpeciesFormChange ( Species . SCEPTILE , '' , SpeciesFormKey . MEGA , new SpeciesFormChangeItemTrigger ( FormChangeItem . SCEPTILITE ) )
] ,
[ Species . BLAZIKEN ] : [
new SpeciesFormChange ( Species . BLAZIKEN , '' , SpeciesFormKey . MEGA , new SpeciesFormChangeItemTrigger ( FormChangeItem . BLAZIKENITE ) )
] ,
[ Species . SWAMPERT ] : [
new SpeciesFormChange ( Species . SWAMPERT , '' , SpeciesFormKey . MEGA , new SpeciesFormChangeItemTrigger ( FormChangeItem . SWAMPERTITE ) )
] ,
[ Species . GARDEVOIR ] : [
new SpeciesFormChange ( Species . GARDEVOIR , '' , SpeciesFormKey . MEGA , new SpeciesFormChangeItemTrigger ( FormChangeItem . GARDEVOIRITE ) )
] ,
[ Species . SABLEYE ] : [
new SpeciesFormChange ( Species . SABLEYE , '' , SpeciesFormKey . MEGA , new SpeciesFormChangeItemTrigger ( FormChangeItem . SABLENITE ) )
] ,
[ Species . MAWILE ] : [
new SpeciesFormChange ( Species . MAWILE , '' , SpeciesFormKey . MEGA , new SpeciesFormChangeItemTrigger ( FormChangeItem . MAWILITE ) )
] ,
[ Species . AGGRON ] : [
new SpeciesFormChange ( Species . AGGRON , '' , SpeciesFormKey . MEGA , new SpeciesFormChangeItemTrigger ( FormChangeItem . AGGRONITE ) )
] ,
[ Species . MEDICHAM ] : [
new SpeciesFormChange ( Species . MEDICHAM , '' , SpeciesFormKey . MEGA , new SpeciesFormChangeItemTrigger ( FormChangeItem . MEDICHAMITE ) )
] ,
[ Species . MANECTRIC ] : [
new SpeciesFormChange ( Species . MANECTRIC , '' , SpeciesFormKey . MEGA , new SpeciesFormChangeItemTrigger ( FormChangeItem . MANECTITE ) )
] ,
[ Species . SHARPEDO ] : [
new SpeciesFormChange ( Species . SHARPEDO , '' , SpeciesFormKey . MEGA , new SpeciesFormChangeItemTrigger ( FormChangeItem . SHARPEDONITE ) )
] ,
[ Species . CAMERUPT ] : [
new SpeciesFormChange ( Species . CAMERUPT , '' , SpeciesFormKey . MEGA , new SpeciesFormChangeItemTrigger ( FormChangeItem . CAMERUPTITE ) )
] ,
[ Species . ALTARIA ] : [
new SpeciesFormChange ( Species . ALTARIA , '' , SpeciesFormKey . MEGA , new SpeciesFormChangeItemTrigger ( FormChangeItem . ALTARIANITE ) )
] ,
[ Species . BANETTE ] : [
new SpeciesFormChange ( Species . BANETTE , '' , SpeciesFormKey . MEGA , new SpeciesFormChangeItemTrigger ( FormChangeItem . BANETTITE ) )
] ,
[ Species . ABSOL ] : [
new SpeciesFormChange ( Species . ABSOL , '' , SpeciesFormKey . MEGA , new SpeciesFormChangeItemTrigger ( FormChangeItem . ABSOLITE ) )
] ,
[ Species . GLALIE ] : [
new SpeciesFormChange ( Species . GLALIE , '' , SpeciesFormKey . MEGA , new SpeciesFormChangeItemTrigger ( FormChangeItem . GLALITITE ) )
] ,
[ Species . SALAMENCE ] : [
new SpeciesFormChange ( Species . SALAMENCE , '' , SpeciesFormKey . MEGA , new SpeciesFormChangeItemTrigger ( FormChangeItem . SALAMENCITE ) )
] ,
[ Species . METAGROSS ] : [
new SpeciesFormChange ( Species . METAGROSS , '' , SpeciesFormKey . MEGA , new SpeciesFormChangeItemTrigger ( FormChangeItem . METAGROSSITE ) )
] ,
[ Species . LATIAS ] : [
new SpeciesFormChange ( Species . LATIAS , '' , SpeciesFormKey . MEGA , new SpeciesFormChangeItemTrigger ( FormChangeItem . LATIASITE ) )
] ,
[ Species . LATIOS ] : [
new SpeciesFormChange ( Species . LATIOS , '' , SpeciesFormKey . MEGA , new SpeciesFormChangeItemTrigger ( FormChangeItem . LATIOSITE ) )
] ,
[ Species . KYOGRE ] : [
new SpeciesFormChange ( Species . KYOGRE , '' , SpeciesFormKey . PRIMAL , new SpeciesFormChangeItemTrigger ( FormChangeItem . BLUE_ORB ) )
] ,
[ Species . GROUDON ] : [
new SpeciesFormChange ( Species . GROUDON , '' , SpeciesFormKey . PRIMAL , new SpeciesFormChangeItemTrigger ( FormChangeItem . RED_ORB ) )
] ,
[ Species . RAYQUAZA ] : [
new SpeciesFormChange ( Species . RAYQUAZA , '' , SpeciesFormKey . MEGA , new SpeciesFormChangeCompoundTrigger ( new SpeciesFormChangeItemTrigger ( FormChangeItem . RAYQUAZITE ) , new SpeciesFormChangeMoveLearnedTrigger ( Moves . DRAGON_ASCENT ) ) )
] ,
[ Species . LOPUNNY ] : [
new SpeciesFormChange ( Species . LOPUNNY , '' , SpeciesFormKey . MEGA , new SpeciesFormChangeItemTrigger ( FormChangeItem . LOPUNNITE ) )
] ,
[ Species . GARCHOMP ] : [
new SpeciesFormChange ( Species . GARCHOMP , '' , SpeciesFormKey . MEGA , new SpeciesFormChangeItemTrigger ( FormChangeItem . GARCHOMPITE ) )
] ,
[ Species . LUCARIO ] : [
new SpeciesFormChange ( Species . LUCARIO , '' , SpeciesFormKey . MEGA , new SpeciesFormChangeItemTrigger ( FormChangeItem . LUCARIONITE ) )
] ,
[ Species . ABOMASNOW ] : [
new SpeciesFormChange ( Species . ABOMASNOW , '' , SpeciesFormKey . MEGA , new SpeciesFormChangeItemTrigger ( FormChangeItem . ABOMASITE ) )
] ,
[ Species . GALLADE ] : [
new SpeciesFormChange ( Species . GALLADE , '' , SpeciesFormKey . MEGA , new SpeciesFormChangeItemTrigger ( FormChangeItem . GALLADITE ) )
] ,
[ Species . AUDINO ] : [
new SpeciesFormChange ( Species . AUDINO , '' , SpeciesFormKey . MEGA , new SpeciesFormChangeItemTrigger ( FormChangeItem . AUDINITE ) )
] ,
[ Species . DIALGA ] : [
new SpeciesFormChange ( Species . DIALGA , '' , SpeciesFormKey . ORIGIN , new SpeciesFormChangeItemTrigger ( FormChangeItem . ADAMANT_CRYSTAL ) )
] ,
[ Species . PALKIA ] : [
new SpeciesFormChange ( Species . PALKIA , '' , SpeciesFormKey . ORIGIN , new SpeciesFormChangeItemTrigger ( FormChangeItem . LUSTROUS_ORB ) )
] ,
[ Species . GIRATINA ] : [
2024-04-02 15:12:21 +01:00
new SpeciesFormChange ( Species . GIRATINA , 'altered' , SpeciesFormKey . ORIGIN , new SpeciesFormChangeItemTrigger ( FormChangeItem . GRISEOUS_CORE ) )
2024-01-10 04:34:43 +00:00
] ,
[ Species . SHAYMIN ] : [
new SpeciesFormChange ( Species . SHAYMIN , 'land' , 'sky' , new SpeciesFormChangeCompoundTrigger ( new SpeciesFormChangeTimeOfDayTrigger ( TimeOfDay . DAY , TimeOfDay . DUSK ) ,
new SpeciesFormChangeItemTrigger ( FormChangeItem . GRACIDEA ) , new SpeciesFormChangeStatusEffectTrigger ( StatusEffect . FREEZE , true ) ) ) ,
new SpeciesFormChange ( Species . SHAYMIN , 'sky' , 'land' , new SpeciesFormChangeTimeOfDayTrigger ( TimeOfDay . DAWN , TimeOfDay . NIGHT ) ) ,
new SpeciesFormChange ( Species . SHAYMIN , 'sky' , 'land' , new SpeciesFormChangeStatusEffectTrigger ( StatusEffect . FREEZE ) )
] ,
2024-03-30 18:02:58 +00:00
[ Species . DARMANITAN ] : [
new SpeciesFormChange ( Species . DARMANITAN , '' , 'zen' , new SpeciesFormChangeManualTrigger ( ) , true ) ,
new SpeciesFormChange ( Species . DARMANITAN , 'zen' , '' , new SpeciesFormChangeManualTrigger ( ) , true )
] ,
2024-02-14 05:21:44 +00:00
[ Species . GARBODOR ] : [
new SpeciesFormChange ( Species . GARBODOR , '' , SpeciesFormKey . GIGANTAMAX , new SpeciesFormChangeItemTrigger ( FormChangeItem . MAX_MUSHROOMS ) )
] ,
2024-01-10 04:34:43 +00:00
[ Species . TORNADUS ] : [
new SpeciesFormChange ( Species . TORNADUS , SpeciesFormKey . INCARNATE , SpeciesFormKey . THERIAN , new SpeciesFormChangeItemTrigger ( FormChangeItem . REVEAL_GLASS ) )
] ,
[ Species . THUNDURUS ] : [
new SpeciesFormChange ( Species . THUNDURUS , SpeciesFormKey . INCARNATE , SpeciesFormKey . THERIAN , new SpeciesFormChangeItemTrigger ( FormChangeItem . REVEAL_GLASS ) )
] ,
[ Species . LANDORUS ] : [
new SpeciesFormChange ( Species . LANDORUS , SpeciesFormKey . INCARNATE , SpeciesFormKey . THERIAN , new SpeciesFormChangeItemTrigger ( FormChangeItem . REVEAL_GLASS ) )
] ,
2024-02-25 23:49:31 +00:00
[ Species . KYUREM ] : [
new SpeciesFormChange ( Species . KYUREM , '' , 'black' , new SpeciesFormChangeItemTrigger ( FormChangeItem . DARK_STONE ) ) ,
new SpeciesFormChange ( Species . KYUREM , '' , 'white' , new SpeciesFormChangeItemTrigger ( FormChangeItem . LIGHT_STONE ) )
] ,
2024-01-10 04:34:43 +00:00
[ Species . KELDEO ] : [
2024-01-10 04:48:23 +00:00
new SpeciesFormChange ( Species . KELDEO , 'ordinary' , 'resolute' , new SpeciesFormChangeMoveLearnedTrigger ( Moves . SECRET_SWORD ) ) ,
new SpeciesFormChange ( Species . KELDEO , 'resolute' , 'ordinary' , new SpeciesFormChangeMoveLearnedTrigger ( Moves . SECRET_SWORD , false ) )
2024-01-10 04:34:43 +00:00
] ,
[ Species . MELOETTA ] : [
2024-03-30 22:46:33 +00:00
new SpeciesFormChange ( Species . MELOETTA , 'aria' , 'pirouette' , new SpeciesFormChangePostMoveTrigger ( Moves . RELIC_SONG ) , true ) ,
new SpeciesFormChange ( Species . MELOETTA , 'pirouette' , 'aria' , new SpeciesFormChangePostMoveTrigger ( Moves . RELIC_SONG ) , true ) ,
2024-01-10 04:34:43 +00:00
new SpeciesFormChange ( Species . MELOETTA , 'pirouette' , 'aria' , new SpeciesFormChangeActiveTrigger ( false ) , true )
] ,
2024-03-30 22:46:33 +00:00
[ Species . AEGISLASH ] : [
2024-03-30 22:57:21 +00:00
new SpeciesFormChange ( Species . AEGISLASH , 'blade' , 'shield' , new SpeciesFormChangePreMoveTrigger ( Moves . KINGS_SHIELD ) , true , new SpeciesFormChangeCondition ( p = > p . getAbility ( ) . id === Abilities . STANCE_CHANGE ) ) ,
new SpeciesFormChange ( Species . AEGISLASH , 'shield' , 'blade' , new SpeciesFormChangePreMoveTrigger ( m = > allMoves [ m ] . category !== MoveCategory . STATUS ) , true , new SpeciesFormChangeCondition ( p = > p . getAbility ( ) . id === Abilities . STANCE_CHANGE ) )
2024-03-30 22:46:33 +00:00
] ,
2024-01-10 04:34:43 +00:00
[ Species . DIANCIE ] : [
new SpeciesFormChange ( Species . DIANCIE , '' , SpeciesFormKey . MEGA , new SpeciesFormChangeItemTrigger ( FormChangeItem . DIANCITE ) )
] ,
2024-02-22 01:59:08 +00:00
[ Species . HOOPA ] : [
new SpeciesFormChange ( Species . HOOPA , '' , 'unbound' , new SpeciesFormChangeItemTrigger ( FormChangeItem . PRISON_BOTTLE ) )
] ,
2024-03-30 04:53:35 +00:00
[ Species . WISHIWASHI ] : [
new SpeciesFormChange ( Species . WISHIWASHI , '' , 'school' , new SpeciesFormChangeManualTrigger ( ) , true ) ,
new SpeciesFormChange ( Species . WISHIWASHI , 'school' , '' , new SpeciesFormChangeManualTrigger ( ) , true )
] ,
2024-02-22 01:59:08 +00:00
[ Species . NECROZMA ] : [
new SpeciesFormChange ( Species . NECROZMA , '' , 'dawn-wings' , new SpeciesFormChangeItemTrigger ( FormChangeItem . N_LUNARIZER ) ) ,
new SpeciesFormChange ( Species . NECROZMA , '' , 'dusk-mane' , new SpeciesFormChangeItemTrigger ( FormChangeItem . N_SOLARIZER ) )
] ,
2024-02-14 05:21:44 +00:00
[ Species . MELMETAL ] : [
new SpeciesFormChange ( Species . MELMETAL , '' , SpeciesFormKey . GIGANTAMAX , new SpeciesFormChangeItemTrigger ( FormChangeItem . MAX_MUSHROOMS ) )
] ,
[ Species . RILLABOOM ] : [
new SpeciesFormChange ( Species . RILLABOOM , '' , SpeciesFormKey . GIGANTAMAX , new SpeciesFormChangeItemTrigger ( FormChangeItem . MAX_MUSHROOMS ) )
] ,
[ Species . CINDERACE ] : [
new SpeciesFormChange ( Species . CINDERACE , '' , SpeciesFormKey . GIGANTAMAX , new SpeciesFormChangeItemTrigger ( FormChangeItem . MAX_MUSHROOMS ) )
] ,
[ Species . INTELEON ] : [
new SpeciesFormChange ( Species . INTELEON , '' , SpeciesFormKey . GIGANTAMAX , new SpeciesFormChangeItemTrigger ( FormChangeItem . MAX_MUSHROOMS ) )
] ,
[ Species . CORVIKNIGHT ] : [
new SpeciesFormChange ( Species . CORVIKNIGHT , '' , SpeciesFormKey . GIGANTAMAX , new SpeciesFormChangeItemTrigger ( FormChangeItem . MAX_MUSHROOMS ) )
] ,
[ Species . ORBEETLE ] : [
new SpeciesFormChange ( Species . ORBEETLE , '' , SpeciesFormKey . GIGANTAMAX , new SpeciesFormChangeItemTrigger ( FormChangeItem . MAX_MUSHROOMS ) )
] ,
[ Species . DREDNAW ] : [
new SpeciesFormChange ( Species . DREDNAW , '' , SpeciesFormKey . GIGANTAMAX , new SpeciesFormChangeItemTrigger ( FormChangeItem . MAX_MUSHROOMS ) )
] ,
[ Species . COALOSSAL ] : [
new SpeciesFormChange ( Species . COALOSSAL , '' , SpeciesFormKey . GIGANTAMAX , new SpeciesFormChangeItemTrigger ( FormChangeItem . MAX_MUSHROOMS ) )
] ,
[ Species . FLAPPLE ] : [
new SpeciesFormChange ( Species . FLAPPLE , '' , SpeciesFormKey . GIGANTAMAX , new SpeciesFormChangeItemTrigger ( FormChangeItem . MAX_MUSHROOMS ) )
] ,
[ Species . APPLETUN ] : [
new SpeciesFormChange ( Species . APPLETUN , '' , SpeciesFormKey . GIGANTAMAX , new SpeciesFormChangeItemTrigger ( FormChangeItem . MAX_MUSHROOMS ) )
] ,
[ Species . SANDACONDA ] : [
new SpeciesFormChange ( Species . SANDACONDA , '' , SpeciesFormKey . GIGANTAMAX , new SpeciesFormChangeItemTrigger ( FormChangeItem . MAX_MUSHROOMS ) )
] ,
[ Species . TOXTRICITY ] : [
new SpeciesFormChange ( Species . TOXTRICITY , 'amped' , SpeciesFormKey . GIGANTAMAX , new SpeciesFormChangeItemTrigger ( FormChangeItem . MAX_MUSHROOMS ) ) ,
new SpeciesFormChange ( Species . TOXTRICITY , 'lowkey' , SpeciesFormKey . GIGANTAMAX , new SpeciesFormChangeItemTrigger ( FormChangeItem . MAX_MUSHROOMS ) ) ,
new SpeciesFormChange ( Species . TOXTRICITY , SpeciesFormKey . GIGANTAMAX , 'amped' , new SpeciesFormChangeCompoundTrigger ( new SpeciesFormChangeItemTrigger ( FormChangeItem . MAX_MUSHROOMS , false ) , new SpeciesDefaultFormMatchTrigger ( 'amped' ) ) ) ,
new SpeciesFormChange ( Species . TOXTRICITY , SpeciesFormKey . GIGANTAMAX , 'lowkey' , new SpeciesFormChangeCompoundTrigger ( new SpeciesFormChangeItemTrigger ( FormChangeItem . MAX_MUSHROOMS , false ) , new SpeciesDefaultFormMatchTrigger ( 'lowkey' ) ) )
] ,
[ Species . CENTISKORCH ] : [
new SpeciesFormChange ( Species . CENTISKORCH , '' , SpeciesFormKey . GIGANTAMAX , new SpeciesFormChangeItemTrigger ( FormChangeItem . MAX_MUSHROOMS ) )
] ,
[ Species . HATTERENE ] : [
new SpeciesFormChange ( Species . HATTERENE , '' , SpeciesFormKey . GIGANTAMAX , new SpeciesFormChangeItemTrigger ( FormChangeItem . MAX_MUSHROOMS ) )
] ,
[ Species . GRIMMSNARL ] : [
new SpeciesFormChange ( Species . GRIMMSNARL , '' , SpeciesFormKey . GIGANTAMAX , new SpeciesFormChangeItemTrigger ( FormChangeItem . MAX_MUSHROOMS ) )
] ,
[ Species . ALCREMIE ] : [
new SpeciesFormChange ( Species . ALCREMIE , 'vanilla-cream' , SpeciesFormKey . GIGANTAMAX , new SpeciesFormChangeItemTrigger ( FormChangeItem . MAX_MUSHROOMS ) )
] ,
2024-03-30 17:01:49 +00:00
[ Species . MORPEKO ] : [
new SpeciesFormChange ( Species . MORPEKO , 'full-belly' , 'hangry' , new SpeciesFormChangeManualTrigger ( ) , true ) ,
new SpeciesFormChange ( Species . MORPEKO , 'hangry' , 'full-belly' , new SpeciesFormChangeManualTrigger ( ) , true )
] ,
2024-02-14 05:21:44 +00:00
[ Species . COPPERAJAH ] : [
new SpeciesFormChange ( Species . COPPERAJAH , '' , SpeciesFormKey . GIGANTAMAX , new SpeciesFormChangeItemTrigger ( FormChangeItem . MAX_MUSHROOMS ) )
] ,
[ Species . DURALUDON ] : [
new SpeciesFormChange ( Species . DURALUDON , '' , SpeciesFormKey . GIGANTAMAX , new SpeciesFormChangeItemTrigger ( FormChangeItem . MAX_MUSHROOMS ) )
] ,
2024-02-22 01:59:08 +00:00
[ Species . ZACIAN ] : [
new SpeciesFormChange ( Species . ZACIAN , 'hero' , 'crowned' , new SpeciesFormChangeItemTrigger ( FormChangeItem . RUSTED_SWORD ) )
] ,
[ Species . ZAMAZENTA ] : [
new SpeciesFormChange ( Species . ZAMAZENTA , 'hero' , 'crowned' , new SpeciesFormChangeItemTrigger ( FormChangeItem . RUSTED_SHIELD ) )
] ,
2024-02-20 00:37:28 +00:00
[ Species . ETERNATUS ] : [
new SpeciesFormChange ( Species . ETERNATUS , '' , SpeciesFormKey . ETERNAMAX , new SpeciesFormChangeManualTrigger ( ) ) ,
new SpeciesFormChange ( Species . ETERNATUS , '' , SpeciesFormKey . ETERNAMAX , new SpeciesFormChangeItemTrigger ( FormChangeItem . MAX_MUSHROOMS ) )
] ,
2024-02-14 05:21:44 +00:00
[ Species . URSHIFU ] : [
new SpeciesFormChange ( Species . URSHIFU , 'single-strike' , SpeciesFormKey . GIGANTAMAX_SINGLE , new SpeciesFormChangeItemTrigger ( FormChangeItem . MAX_MUSHROOMS ) ) ,
new SpeciesFormChange ( Species . URSHIFU , 'rapid-strike' , SpeciesFormKey . GIGANTAMAX_RAPID , new SpeciesFormChangeItemTrigger ( FormChangeItem . MAX_MUSHROOMS ) )
2024-02-20 00:37:28 +00:00
] ,
2024-02-22 01:59:08 +00:00
[ Species . CALYREX ] : [
new SpeciesFormChange ( Species . CALYREX , '' , 'ice' , new SpeciesFormChangeItemTrigger ( FormChangeItem . ICY_REINS_OF_UNITY ) ) ,
new SpeciesFormChange ( Species . CALYREX , '' , 'shadow' , new SpeciesFormChangeItemTrigger ( FormChangeItem . SHADOW_REINS_OF_UNITY ) )
] ,
2024-02-20 00:37:28 +00:00
[ Species . ENAMORUS ] : [
new SpeciesFormChange ( Species . ENAMORUS , SpeciesFormKey . INCARNATE , SpeciesFormKey . THERIAN , new SpeciesFormChangeItemTrigger ( FormChangeItem . REVEAL_GLASS ) )
] ,
[ Species . OGERPON ] : [
new SpeciesFormChange ( Species . OGERPON , 'teal-mask' , 'wellspring-mask' , new SpeciesFormChangeItemTrigger ( FormChangeItem . WELLSPRING_MASK ) ) ,
new SpeciesFormChange ( Species . OGERPON , 'teal-mask' , 'hearthflame-mask' , new SpeciesFormChangeItemTrigger ( FormChangeItem . HEARTHFLAME_MASK ) ) ,
2024-04-03 00:03:49 +01:00
new SpeciesFormChange ( Species . OGERPON , 'teal-mask' , 'cornerstone-mask' , new SpeciesFormChangeItemTrigger ( FormChangeItem . CORNERSTONE_MASK ) ) ,
new SpeciesFormChange ( Species . OGERPON , 'teal-mask' , 'teal-mask-tera' , new SpeciesFormChangeManualTrigger ( ) , true ) , //When holding a Grass Tera Shard
new SpeciesFormChange ( Species . OGERPON , 'teal-mask-tera' , 'teal-mask' , new SpeciesFormChangeManualTrigger ( ) , true ) , //When no longer holding a Grass Tera Shard
new SpeciesFormChange ( Species . OGERPON , 'wellspring-mask' , 'wellspring-mask-tera' , new SpeciesFormChangeManualTrigger ( ) , true ) , //When holding a Water Tera Shard
new SpeciesFormChange ( Species . OGERPON , 'wellspring-mask-tera' , 'wellspring-mask' , new SpeciesFormChangeManualTrigger ( ) , true ) , //When no longer holding a Water Tera Shard
new SpeciesFormChange ( Species . OGERPON , 'hearthflame-mask' , 'hearthflame-mask-tera' , new SpeciesFormChangeManualTrigger ( ) , true ) , //When holding a Fire Tera Shard
new SpeciesFormChange ( Species . OGERPON , 'hearthflame-mask-tera' , 'hearthflame-mask' , new SpeciesFormChangeManualTrigger ( ) , true ) , //When no longer holding a Fire Tera Shard
new SpeciesFormChange ( Species . OGERPON , 'cornerstone-mask' , 'cornerstone-mask-tera' , new SpeciesFormChangeManualTrigger ( ) , true ) , //When holding a Rock Tera Shard
new SpeciesFormChange ( Species . OGERPON , 'cornerstone-mask-tera' , 'cornerstone-mask' , new SpeciesFormChangeManualTrigger ( ) , true ) //When no longer holding a Rock Tera Shard
2024-03-30 05:19:54 +00:00
] ,
[ Species . TERAPAGOS ] : [
new SpeciesFormChange ( Species . TERAPAGOS , '' , 'terastal' , new SpeciesFormChangeManualTrigger ( ) , true )
2024-03-30 18:02:58 +00:00
] ,
[ Species . GALAR_DARMANITAN ] : [
new SpeciesFormChange ( Species . GALAR_DARMANITAN , '' , 'zen' , new SpeciesFormChangeManualTrigger ( ) , true ) ,
new SpeciesFormChange ( Species . GALAR_DARMANITAN , 'zen' , '' , new SpeciesFormChangeManualTrigger ( ) , true )
2024-01-10 04:34:43 +00:00
]
} ;
{
const formChangeKeys = Object . keys ( pokemonFormChanges ) ;
formChangeKeys . forEach ( pk = > {
const formChanges = pokemonFormChanges [ pk ] ;
let newFormChanges : SpeciesFormChange [ ] = [ ] ;
for ( let fc of formChanges ) {
const itemTrigger = fc . findTrigger ( SpeciesFormChangeItemTrigger ) as SpeciesFormChangeItemTrigger ;
if ( itemTrigger && ! formChanges . find ( c = > fc . formKey === c . preFormKey && fc . preFormKey === c . formKey ) )
newFormChanges . push ( new SpeciesFormChange ( fc . speciesId , fc . formKey , fc . preFormKey , new SpeciesFormChangeItemTrigger ( itemTrigger . item , false ) ) ) ;
}
formChanges . push ( . . . newFormChanges ) ;
} ) ;
}