File tree 3 files changed +22
-14
lines changed
3 files changed +22
-14
lines changed Original file line number Diff line number Diff line change @@ -3438,10 +3438,13 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = {
3438
3438
// Protosynthesis is not affected by Utility Umbrella
3439
3439
if ( this . field . isWeather ( 'sunnyday' ) ) {
3440
3440
pokemon . addVolatile ( 'protosynthesis' ) ;
3441
- } else if ( ! pokemon . volatiles [ 'protosynthesis' ] && pokemon . hasItem ( 'boosterenergy' ) ) {
3442
- pokemon . useItem ( ) ;
3443
- } else if ( ! pokemon . volatiles [ 'protosynthesis' ] ?. fromBooster ) {
3444
- pokemon . removeVolatile ( 'protosynthesis' ) ;
3441
+ } else {
3442
+ if ( ! pokemon . volatiles [ 'protosynthesis' ] ?. fromBooster ) {
3443
+ pokemon . removeVolatile ( 'protosynthesis' ) ;
3444
+ }
3445
+ if ( ! pokemon . volatiles [ 'protosynthesis' ] && pokemon . hasItem ( 'boosterenergy' ) ) {
3446
+ pokemon . useItem ( ) ;
3447
+ }
3445
3448
}
3446
3449
} ,
3447
3450
onUpdate ( pokemon ) {
@@ -3584,10 +3587,13 @@ export const Abilities: import('../sim/dex-abilities').AbilityDataTable = {
3584
3587
onTerrainChange ( pokemon ) {
3585
3588
if ( this . field . isTerrain ( 'electricterrain' ) ) {
3586
3589
pokemon . addVolatile ( 'quarkdrive' ) ;
3587
- } else if ( ! pokemon . volatiles [ 'quarkdrive' ] && pokemon . hasItem ( 'boosterenergy' ) ) {
3588
- pokemon . useItem ( ) ;
3589
- } else if ( ! pokemon . volatiles [ 'quarkdrive' ] ?. fromBooster ) {
3590
- pokemon . removeVolatile ( 'quarkdrive' ) ;
3590
+ } else {
3591
+ if ( ! pokemon . volatiles [ 'quarkdrive' ] ?. fromBooster ) {
3592
+ pokemon . removeVolatile ( 'quarkdrive' ) ;
3593
+ }
3594
+ if ( ! pokemon . volatiles [ 'quarkdrive' ] && pokemon . hasItem ( 'boosterenergy' ) ) {
3595
+ pokemon . useItem ( ) ;
3596
+ }
3591
3597
}
3592
3598
} ,
3593
3599
onUpdate ( pokemon ) {
Original file line number Diff line number Diff line change @@ -614,7 +614,7 @@ export const Items: import('../sim/dex-items').ItemDataTable = {
614
614
basePower : 30 ,
615
615
} ,
616
616
onUseItem ( item , pokemon ) {
617
- return [ 'protosynthesis' , 'quarkdrive' ] . includes ( pokemon . ability ) ;
617
+ return item . id === 'boosterenergy' && ( pokemon . hasAbility ( 'protosynthesis' ) || pokemon . hasAbility ( 'quarkdrive' ) ) ;
618
618
} ,
619
619
onUse ( pokemon ) {
620
620
pokemon . addVolatile ( pokemon . ability ) ;
Original file line number Diff line number Diff line change @@ -13,11 +13,13 @@ export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTa
13
13
// Protosynthesis is not affected by Utility Umbrella
14
14
if ( this . field . isWeather ( 'sunnyday' ) ) {
15
15
pokemon . addVolatile ( 'protosynthesis' ) ;
16
- } else if ( ! pokemon . volatiles [ 'protosynthesis' ] && pokemon . hasItem ( 'boosterenergy' ) ) {
17
- pokemon . useItem ( ) ;
18
- } else if ( ! pokemon . volatiles [ 'protosynthesis' ] ?. fromBooster && this . field . weather !== 'sunnyday' ) {
19
- // Protosynthesis will not deactivite if Sun is suppressed, hence the direct ID check (isWeather respects supression)
20
- pokemon . removeVolatile ( 'protosynthesis' ) ;
16
+ } else {
17
+ if ( ! pokemon . volatiles [ 'protosynthesis' ] ?. fromBooster && this . field . weather !== 'sunnyday' ) {
18
+ pokemon . removeVolatile ( 'protosynthesis' ) ;
19
+ }
20
+ if ( ! pokemon . volatiles [ 'protosynthesis' ] && pokemon . hasItem ( 'boosterenergy' ) ) {
21
+ pokemon . useItem ( ) ;
22
+ }
21
23
}
22
24
} ,
23
25
condition : {
You can’t perform that action at this time.
0 commit comments