mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-29 11:42:21 +02:00
Removed post faint clear weather
This commit is contained in:
parent
2cd192b2f0
commit
2e76754613
@ -4183,59 +4183,6 @@ export class PostFaintUnsuppressedWeatherFormChangeAbAttr extends PostFaintAbAtt
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Clears Desolate Land/Primordial Sea/Delta Stream upon the Pokemon fainting
|
|
||||||
*/
|
|
||||||
export class PostFaintClearWeatherAbAttr extends PostFaintAbAttr {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param pokemon The {@linkcode Pokemon} with the ability
|
|
||||||
* @param passive N/A
|
|
||||||
* @param attacker N/A
|
|
||||||
* @param move N/A
|
|
||||||
* @param hitResult N/A
|
|
||||||
* @param args N/A
|
|
||||||
* @returns {boolean} Returns true if the weather clears, otherwise false.
|
|
||||||
*/
|
|
||||||
applyPostFaint(pokemon: Pokemon, passive: boolean, simulated: boolean, attacker?: Pokemon, move?: Move, hitResult?: HitResult, ...args: any[]): boolean {
|
|
||||||
const weatherType = globalScene.arena.weather?.weatherType;
|
|
||||||
let turnOffWeather = false;
|
|
||||||
|
|
||||||
// Clear weather only if user's ability matches the weather and no other pokemon has the ability.
|
|
||||||
switch (weatherType) {
|
|
||||||
case (WeatherType.HARSH_SUN):
|
|
||||||
if (pokemon.hasAbility(Abilities.DESOLATE_LAND)
|
|
||||||
&& globalScene.getField(true).filter(p => p.hasAbility(Abilities.DESOLATE_LAND)).length === 0) {
|
|
||||||
turnOffWeather = true;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case (WeatherType.HEAVY_RAIN):
|
|
||||||
if (pokemon.hasAbility(Abilities.PRIMORDIAL_SEA)
|
|
||||||
&& globalScene.getField(true).filter(p => p.hasAbility(Abilities.PRIMORDIAL_SEA)).length === 0) {
|
|
||||||
turnOffWeather = true;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case (WeatherType.STRONG_WINDS):
|
|
||||||
if (pokemon.hasAbility(Abilities.DELTA_STREAM)
|
|
||||||
&& globalScene.getField(true).filter(p => p.hasAbility(Abilities.DELTA_STREAM)).length === 0) {
|
|
||||||
turnOffWeather = true;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (simulated) {
|
|
||||||
return turnOffWeather;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (turnOffWeather) {
|
|
||||||
globalScene.arena.trySetWeather(WeatherType.NONE, false);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export class PostFaintContactDamageAbAttr extends PostFaintAbAttr {
|
export class PostFaintContactDamageAbAttr extends PostFaintAbAttr {
|
||||||
private damageRatio: integer;
|
private damageRatio: integer;
|
||||||
|
|
||||||
@ -5930,19 +5877,16 @@ export function initAbilities() {
|
|||||||
.attr(PostSummonWeatherChangeAbAttr, WeatherType.HEAVY_RAIN)
|
.attr(PostSummonWeatherChangeAbAttr, WeatherType.HEAVY_RAIN)
|
||||||
.attr(PostBiomeChangeWeatherChangeAbAttr, WeatherType.HEAVY_RAIN)
|
.attr(PostBiomeChangeWeatherChangeAbAttr, WeatherType.HEAVY_RAIN)
|
||||||
.attr(PreLeaveFieldClearWeatherAbAttr)
|
.attr(PreLeaveFieldClearWeatherAbAttr)
|
||||||
.attr(PostFaintClearWeatherAbAttr)
|
|
||||||
.bypassFaint(),
|
.bypassFaint(),
|
||||||
new Ability(Abilities.DESOLATE_LAND, 6)
|
new Ability(Abilities.DESOLATE_LAND, 6)
|
||||||
.attr(PostSummonWeatherChangeAbAttr, WeatherType.HARSH_SUN)
|
.attr(PostSummonWeatherChangeAbAttr, WeatherType.HARSH_SUN)
|
||||||
.attr(PostBiomeChangeWeatherChangeAbAttr, WeatherType.HARSH_SUN)
|
.attr(PostBiomeChangeWeatherChangeAbAttr, WeatherType.HARSH_SUN)
|
||||||
.attr(PreLeaveFieldClearWeatherAbAttr)
|
.attr(PreLeaveFieldClearWeatherAbAttr)
|
||||||
.attr(PostFaintClearWeatherAbAttr)
|
|
||||||
.bypassFaint(),
|
.bypassFaint(),
|
||||||
new Ability(Abilities.DELTA_STREAM, 6)
|
new Ability(Abilities.DELTA_STREAM, 6)
|
||||||
.attr(PostSummonWeatherChangeAbAttr, WeatherType.STRONG_WINDS)
|
.attr(PostSummonWeatherChangeAbAttr, WeatherType.STRONG_WINDS)
|
||||||
.attr(PostBiomeChangeWeatherChangeAbAttr, WeatherType.STRONG_WINDS)
|
.attr(PostBiomeChangeWeatherChangeAbAttr, WeatherType.STRONG_WINDS)
|
||||||
.attr(PreLeaveFieldClearWeatherAbAttr)
|
.attr(PreLeaveFieldClearWeatherAbAttr)
|
||||||
.attr(PostFaintClearWeatherAbAttr)
|
|
||||||
.bypassFaint(),
|
.bypassFaint(),
|
||||||
new Ability(Abilities.STAMINA, 7)
|
new Ability(Abilities.STAMINA, 7)
|
||||||
.attr(PostDefendStatStageChangeAbAttr, (target, user, move) => move.category !== MoveCategory.STATUS, Stat.DEF, 1),
|
.attr(PostDefendStatStageChangeAbAttr, (target, user, move) => move.category !== MoveCategory.STATUS, Stat.DEF, 1),
|
||||||
|
Loading…
Reference in New Issue
Block a user