@@ -1167,59 +1167,47 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = {
1167
1167
} ,
1168
1168
embodyaspectcornerstone : {
1169
1169
onStart ( pokemon ) {
1170
- if ( pokemon . baseSpecies . name === 'Ogerpon-Cornerstone-Tera' && ! this . effectState . embodied ) {
1171
- this . effectState . embodied = true ;
1170
+ if ( pokemon . baseSpecies . name === 'Ogerpon-Cornerstone-Tera' && this . effectState . embodied !== pokemon . previouslySwitchedIn ) {
1171
+ this . effectState . embodied = pokemon . previouslySwitchedIn ;
1172
1172
this . boost ( { def : 1 } , pokemon ) ;
1173
1173
}
1174
1174
} ,
1175
- onSwitchIn ( ) {
1176
- delete this . effectState . embodied ;
1177
- } ,
1178
1175
flags : { failroleplay : 1 , noreceiver : 1 , noentrain : 1 , notrace : 1 , failskillswap : 1 , notransform : 1 } ,
1179
1176
name : "Embody Aspect (Cornerstone)" ,
1180
1177
rating : 3.5 ,
1181
1178
num : 304 ,
1182
1179
} ,
1183
1180
embodyaspecthearthflame : {
1184
1181
onStart ( pokemon ) {
1185
- if ( pokemon . baseSpecies . name === 'Ogerpon-Hearthflame-Tera' && ! this . effectState . embodied ) {
1186
- this . effectState . embodied = true ;
1182
+ if ( pokemon . baseSpecies . name === 'Ogerpon-Hearthflame-Tera' && this . effectState . embodied !== pokemon . previouslySwitchedIn ) {
1183
+ this . effectState . embodied = pokemon . previouslySwitchedIn ;
1187
1184
this . boost ( { atk : 1 } , pokemon ) ;
1188
1185
}
1189
1186
} ,
1190
- onSwitchIn ( ) {
1191
- delete this . effectState . embodied ;
1192
- } ,
1193
1187
flags : { failroleplay : 1 , noreceiver : 1 , noentrain : 1 , notrace : 1 , failskillswap : 1 , notransform : 1 } ,
1194
1188
name : "Embody Aspect (Hearthflame)" ,
1195
1189
rating : 3.5 ,
1196
1190
num : 303 ,
1197
1191
} ,
1198
1192
embodyaspectteal : {
1199
1193
onStart ( pokemon ) {
1200
- if ( pokemon . baseSpecies . name === 'Ogerpon-Teal-Tera' && ! this . effectState . embodied ) {
1201
- this . effectState . embodied = true ;
1194
+ if ( pokemon . baseSpecies . name === 'Ogerpon-Teal-Tera' && this . effectState . embodied !== pokemon . previouslySwitchedIn ) {
1195
+ this . effectState . embodied = pokemon . previouslySwitchedIn ;
1202
1196
this . boost ( { spe : 1 } , pokemon ) ;
1203
1197
}
1204
1198
} ,
1205
- onSwitchIn ( ) {
1206
- delete this . effectState . embodied ;
1207
- } ,
1208
1199
flags : { failroleplay : 1 , noreceiver : 1 , noentrain : 1 , notrace : 1 , failskillswap : 1 , notransform : 1 } ,
1209
1200
name : "Embody Aspect (Teal)" ,
1210
1201
rating : 3.5 ,
1211
1202
num : 301 ,
1212
1203
} ,
1213
1204
embodyaspectwellspring : {
1214
1205
onStart ( pokemon ) {
1215
- if ( pokemon . baseSpecies . name === 'Ogerpon-Wellspring-Tera' && ! this . effectState . embodied ) {
1216
- this . effectState . embodied = true ;
1206
+ if ( pokemon . baseSpecies . name === 'Ogerpon-Wellspring-Tera' && this . effectState . embodied !== pokemon . previouslySwitchedIn ) {
1207
+ this . effectState . embodied = pokemon . previouslySwitchedIn ;
1217
1208
this . boost ( { spd : 1 } , pokemon ) ;
1218
1209
}
1219
1210
} ,
1220
- onSwitchIn ( ) {
1221
- delete this . effectState . embodied ;
1222
- } ,
1223
1211
flags : { failroleplay : 1 , noreceiver : 1 , noentrain : 1 , notrace : 1 , failskillswap : 1 , notransform : 1 } ,
1224
1212
name : "Embody Aspect (Wellspring)" ,
1225
1213
rating : 3.5 ,
@@ -2272,18 +2260,15 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = {
2272
2260
} ,
2273
2261
libero : {
2274
2262
onPrepareHit ( source , target , move ) {
2275
- if ( this . effectState . protean ) return ;
2263
+ if ( this . effectState . libero === source . previouslySwitchedIn ) return ;
2276
2264
if ( move . hasBounced || move . flags [ 'futuremove' ] || move . sourceEffect === 'snatch' || move . callsMove ) return ;
2277
2265
const type = move . type ;
2278
2266
if ( type && type !== '???' && source . getTypes ( ) . join ( ) !== type ) {
2279
2267
if ( ! source . setType ( type ) ) return ;
2280
- this . effectState . protean = true ;
2268
+ this . effectState . libero = source . previouslySwitchedIn ;
2281
2269
this . add ( '-start' , source , 'typechange' , type , '[from] ability: Libero' ) ;
2282
2270
}
2283
2271
} ,
2284
- onSwitchIn ( ) {
2285
- delete this . effectState . protean ;
2286
- } ,
2287
2272
flags : { } ,
2288
2273
name : "Libero" ,
2289
2274
rating : 4 ,
@@ -2875,11 +2860,6 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = {
2875
2860
}
2876
2861
}
2877
2862
} ,
2878
- onAnySwitchIn ( pokemon ) {
2879
- if ( [ 'libero' , 'protean' ] . includes ( pokemon . getAbility ( ) . id ) ) {
2880
- delete pokemon . abilityState . protean ;
2881
- }
2882
- } ,
2883
2863
onEnd ( source ) {
2884
2864
if ( source . transformed ) return ;
2885
2865
for ( const pokemon of this . getAllActive ( ) ) {
@@ -3421,18 +3401,15 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = {
3421
3401
} ,
3422
3402
protean : {
3423
3403
onPrepareHit ( source , target , move ) {
3424
- if ( this . effectState . protean ) return ;
3404
+ if ( this . effectState . protean === source . previouslySwitchedIn ) return ;
3425
3405
if ( move . hasBounced || move . flags [ 'futuremove' ] || move . sourceEffect === 'snatch' || move . callsMove ) return ;
3426
3406
const type = move . type ;
3427
3407
if ( type && type !== '???' && source . getTypes ( ) . join ( ) !== type ) {
3428
3408
if ( ! source . setType ( type ) ) return ;
3429
- this . effectState . protean = true ;
3409
+ this . effectState . protean = source . previouslySwitchedIn ;
3430
3410
this . add ( '-start' , source , 'typechange' , type , '[from] ability: Protean' ) ;
3431
3411
}
3432
3412
} ,
3433
- onSwitchIn ( ) {
3434
- delete this . effectState . protean ;
3435
- } ,
3436
3413
flags : { } ,
3437
3414
name : "Protean" ,
3438
3415
rating : 4 ,
0 commit comments