Fix immutable weather conditions expiring
parent
5ebc351e4f
commit
7fc4dbce85
|
@ -3043,8 +3043,6 @@ export const noStarterFormKeys: string[] = [
|
||||||
SpeciesFormKey.ETERNAMAX
|
SpeciesFormKey.ETERNAMAX
|
||||||
].map(k => k.toString());
|
].map(k => k.toString());
|
||||||
|
|
||||||
console.log(noStarterFormKeys)
|
|
||||||
|
|
||||||
// TODO: Remove
|
// TODO: Remove
|
||||||
{
|
{
|
||||||
//setTimeout(() => {
|
//setTimeout(() => {
|
||||||
|
|
|
@ -26,10 +26,12 @@ export class Weather {
|
||||||
|
|
||||||
constructor(weatherType: WeatherType, turnsLeft?: integer) {
|
constructor(weatherType: WeatherType, turnsLeft?: integer) {
|
||||||
this.weatherType = weatherType;
|
this.weatherType = weatherType;
|
||||||
this.turnsLeft = turnsLeft || 0;
|
this.turnsLeft = !this.isImmutable() ? turnsLeft || 0 : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
lapse(): boolean {
|
lapse(): boolean {
|
||||||
|
if (this.isImmutable())
|
||||||
|
return true;
|
||||||
if (this.turnsLeft)
|
if (this.turnsLeft)
|
||||||
return !!--this.turnsLeft;
|
return !!--this.turnsLeft;
|
||||||
|
|
||||||
|
|
|
@ -269,9 +269,8 @@ export class Arena {
|
||||||
|
|
||||||
trySetWeather(weather: WeatherType, hasPokemonSource: boolean): boolean {
|
trySetWeather(weather: WeatherType, hasPokemonSource: boolean): boolean {
|
||||||
// override hook for debugging
|
// override hook for debugging
|
||||||
if (WEATHER_OVERRIDE) {
|
if (WEATHER_OVERRIDE)
|
||||||
return this.trySetWeatherOverride(WEATHER_OVERRIDE);
|
return this.trySetWeatherOverride(WEATHER_OVERRIDE);
|
||||||
}
|
|
||||||
|
|
||||||
if (this.weather?.weatherType === (weather || undefined))
|
if (this.weather?.weatherType === (weather || undefined))
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in New Issue