Add weather change abilities

This commit is contained in:
Flashfyre 2023-05-04 10:25:11 -04:00
parent 85caa97b72
commit 884c5cc40f
2 changed files with 8 additions and 3 deletions

View File

@ -25,7 +25,7 @@ import { Gender } from "./data/gender";
import { Weather, WeatherType, getRandomWeatherType, getWeatherDamageMessage, getWeatherLapseMessage } from "./data/weather"; import { Weather, WeatherType, getRandomWeatherType, getWeatherDamageMessage, getWeatherLapseMessage } from "./data/weather";
import { TempBattleStat } from "./data/temp-battle-stat"; import { TempBattleStat } from "./data/temp-battle-stat";
import { ArenaTrapTag, TrickRoomTag } from "./data/arena-tag"; import { ArenaTrapTag, TrickRoomTag } from "./data/arena-tag";
import { ArenaTrapAbAttr, PostTurnAbAttr, PostWeatherLapseAbAttr, PreWeatherDamageAbAttr, ProtectStatAttr, SuppressWeatherEffectAbAttr, applyPostTurnAbAttrs, applyPostWeatherLapseAbAttrs, applyPreStatChangeAbAttrs, applyPreWeatherEffectAbAttrs } from "./data/ability"; import { ArenaTrapAbAttr, PostSummonAbAttr, PostTurnAbAttr, PostWeatherLapseAbAttr, PreWeatherDamageAbAttr, ProtectStatAttr, SuppressWeatherEffectAbAttr, applyPostSummonAbAttrs, applyPostTurnAbAttrs, applyPostWeatherLapseAbAttrs, applyPreStatChangeAbAttrs, applyPreWeatherEffectAbAttrs } from "./data/ability";
import { Unlockables, getUnlockableName } from "./system/unlockables"; import { Unlockables, getUnlockableName } from "./system/unlockables";
export class CheckLoadPhase extends BattlePhase { export class CheckLoadPhase extends BattlePhase {
@ -183,6 +183,8 @@ export class EncounterPhase extends BattlePhase {
this.scene.unshiftPhase(new ShinySparklePhase(this.scene, false)); this.scene.unshiftPhase(new ShinySparklePhase(this.scene, false));
this.scene.arena.applyTags(ArenaTrapTag, this.scene.getEnemyPokemon()); this.scene.arena.applyTags(ArenaTrapTag, this.scene.getEnemyPokemon());
applyPostSummonAbAttrs(PostSummonAbAttr, this.scene.getEnemyPokemon());
// TODO: Remove // TODO: Remove
//this.scene.unshiftPhase(new SelectModifierPhase(this.scene)); //this.scene.unshiftPhase(new SelectModifierPhase(this.scene));
@ -402,7 +404,6 @@ export class SummonPhase extends BattlePhase {
playerPokemon.getSprite().clearTint(); playerPokemon.getSprite().clearTint();
playerPokemon.resetSummonData(); playerPokemon.resetSummonData();
this.scene.time.delayedCall(1000, () => this.end()); this.scene.time.delayedCall(1000, () => this.end());
this.scene.arena.applyTags(ArenaTrapTag, playerPokemon);
} }
}); });
} }
@ -415,6 +416,10 @@ export class SummonPhase extends BattlePhase {
if (this.scene.getPlayerPokemon().shiny) if (this.scene.getPlayerPokemon().shiny)
this.scene.unshiftPhase(new ShinySparklePhase(this.scene, true)); this.scene.unshiftPhase(new ShinySparklePhase(this.scene, true));
this.scene.arena.applyTags(ArenaTrapTag, this.scene.getPlayerPokemon());
applyPostSummonAbAttrs(PostSummonAbAttr, this.scene.getPlayerPokemon());
super.end(); super.end();
} }
} }

View File

@ -23,7 +23,7 @@ import { WeatherType } from './data/weather';
import { TempBattleStat } from './data/temp-battle-stat'; import { TempBattleStat } from './data/temp-battle-stat';
import { WeakenMoveTypeTag } from './data/arena-tag'; import { WeakenMoveTypeTag } from './data/arena-tag';
import { Biome } from './data/biome'; import { Biome } from './data/biome';
import { Ability, BattleStatMultiplierAbAttr, BlockCritAbAttr, TypeImmunityAbAttr, VariableMovePowerAbAttr, abilities, applyBattleStatMultiplierAbAttrs, applyPreAttackAbAttrs, applyPreDefendAbAttrs } from './data/ability'; import { Abilities, Ability, BattleStatMultiplierAbAttr, BlockCritAbAttr, TypeImmunityAbAttr, VariableMovePowerAbAttr, abilities, applyBattleStatMultiplierAbAttrs, applyPreAttackAbAttrs, applyPreDefendAbAttrs } from './data/ability';
import PokemonData from './system/pokemon-data'; import PokemonData from './system/pokemon-data';
export default abstract class Pokemon extends Phaser.GameObjects.Container { export default abstract class Pokemon extends Phaser.GameObjects.Container {