Skip to content

Commit 4e1b3de

Browse files
committed
Protosynthesis should ignore weather supressing abilities
1 parent 42f7c42 commit 4e1b3de

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

data/abilities.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -3420,8 +3420,9 @@ export const Abilities: {[abilityid: string]: AbilityData} = {
34203420
this.singleEvent('WeatherChange', this.effect, this.effectState, pokemon);
34213421
},
34223422
onWeatherChange(pokemon) {
3423-
// Protosynthesis is not affected by Utility Umbrella
3424-
if (this.field.isWeather('sunnyday')) {
3423+
// Protosynthesis is not affected by Utility Umbrella, or any weather supressing ability
3424+
// As a result, we check the weather directly instead of via field#isWeather which calls field#effectiveWeather
3425+
if (this.field.weather === 'sunnyday') {
34253426
pokemon.addVolatile('protosynthesis');
34263427
} else if (!pokemon.volatiles['protosynthesis']?.fromBooster) {
34273428
pokemon.removeVolatile('protosynthesis');

test/sim/abilities/protosynthesis.js

+12
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,18 @@ describe('Protosynthesis', function () {
7777
assert.equal(tail.volatiles['protosynthesis'].bestStat, 'spd', `Scream Tail's SpD should have been boosted by Protosynthesis in Sun while holding Utility Umbrella`);
7878
});
7979

80+
it(`should not be prevented from activating by weather suppressing abilities`, function () {
81+
battle = common.createBattle([[
82+
{species: 'Scream Tail', ability: 'protosynthesis', moves: ['splash']},
83+
], [
84+
{species: 'Altaria', ability: 'cloudnine', moves: ['sunnyday']},
85+
]]);
86+
87+
const tail = battle.p1.active[0];
88+
battle.makeChoices('move splash', 'move sunnyday');
89+
assert.equal(tail.volatiles['protosynthesis'].bestStat, 'spd', `Scream Tail's SpD should have been boosted by Protosynthesis in Sun even though a weather supressing ability was active`);
90+
});
91+
8092
it(`should have its boost nullified by Neutralizing Gas`, function () {
8193
battle = common.createBattle([[
8294
{species: 'Scream Tail', ability: 'protosynthesis', item: 'boosterenergy', moves: ['luckychant', 'recover']},

0 commit comments

Comments
 (0)