This commit is contained in:
torranx 2024-09-01 03:39:33 +08:00
parent a43678db11
commit 1fa97e3615
2 changed files with 10 additions and 10 deletions

View File

@ -2410,8 +2410,8 @@ export class PostSummonFormChangeByWeatherAbAttr extends PostSummonAbAttr {
* @returns whether the form change was triggered
*/
applyPostSummon(pokemon: Pokemon, passive: boolean, simulated: boolean, args: any[]): boolean {
const isCastformWithForecast = pokemon.species.speciesId === Species.CASTFORM && this.ability === Abilities.FORECAST;
const isCherrimWithFlowerGift = pokemon.species.speciesId === Species.CHERRIM && this.ability === Abilities.FLOWER_GIFT;
const isCastformWithForecast = (pokemon.species.speciesId === Species.CASTFORM && this.ability === Abilities.FORECAST);
const isCherrimWithFlowerGift = (pokemon.species.speciesId === Species.CHERRIM && this.ability === Abilities.FLOWER_GIFT);
if (isCastformWithForecast || isCherrimWithFlowerGift) {
if (simulated) {
@ -3110,8 +3110,8 @@ export class PostWeatherChangeFormChangeAbAttr extends PostWeatherChangeAbAttr {
* @returns whether the form change was triggered
*/
applyPostWeatherChange(pokemon: Pokemon, passive: boolean, simulated: boolean, weather: WeatherType, args: any[]): boolean {
const isCastformWithForecast = pokemon.species.speciesId === Species.CASTFORM && this.ability === Abilities.FORECAST;
const isCherrimWithFlowerGift = pokemon.species.speciesId === Species.CHERRIM && this.ability === Abilities.FLOWER_GIFT;
const isCastformWithForecast = (pokemon.species.speciesId === Species.CASTFORM && this.ability === Abilities.FORECAST);
const isCherrimWithFlowerGift = (pokemon.species.speciesId === Species.CHERRIM && this.ability === Abilities.FLOWER_GIFT);
if (isCastformWithForecast || isCherrimWithFlowerGift) {
if (simulated) {
@ -4710,8 +4710,8 @@ function setAbilityRevealed(pokemon: Pokemon): void {
*/
function getPokemonWithWeatherBasedForms(scene: BattleScene) {
return scene.getField(true).filter(p =>
p.hasAbility(Abilities.FORECAST) && p.species.speciesId === Species.CASTFORM
|| p.hasAbility(Abilities.FLOWER_GIFT) && p.species.speciesId === Species.CHERRIM
(p.hasAbility(Abilities.FORECAST) && p.species.speciesId === Species.CASTFORM)
|| (p.hasAbility(Abilities.FLOWER_GIFT) && p.species.speciesId === Species.CHERRIM)
);
}

View File

@ -339,8 +339,8 @@ export class Arena {
*/
triggerWeatherBasedFormChanges(): void {
this.scene.getField(true).forEach( p => {
const isCastformWithForecast = p.hasAbility(Abilities.FORECAST) && p.species.speciesId === Species.CASTFORM;
const isCherrimWithFlowerGift = p.hasAbility(Abilities.FLOWER_GIFT) && p.species.speciesId === Species.CHERRIM;
const isCastformWithForecast = (p.hasAbility(Abilities.FORECAST) && p.species.speciesId === Species.CASTFORM);
const isCherrimWithFlowerGift = (p.hasAbility(Abilities.FLOWER_GIFT) && p.species.speciesId === Species.CHERRIM);
if (isCastformWithForecast || isCherrimWithFlowerGift) {
new ShowAbilityPhase(this.scene, p.getBattlerIndex());
@ -354,8 +354,8 @@ export class Arena {
*/
triggerWeatherBasedFormChangesToNormal(): void {
this.scene.getField(true).forEach( p => {
const isCastformWithForecast = p.hasAbility(Abilities.FORECAST, false, true) && p.species.speciesId === Species.CASTFORM;
const isCherrimWithFlowerGift = p.hasAbility(Abilities.FLOWER_GIFT, false, true) && p.species.speciesId === Species.CHERRIM;
const isCastformWithForecast = (p.hasAbility(Abilities.FORECAST, false, true) && p.species.speciesId === Species.CASTFORM);
const isCherrimWithFlowerGift = (p.hasAbility(Abilities.FLOWER_GIFT, false, true) && p.species.speciesId === Species.CHERRIM);
if (isCastformWithForecast || isCherrimWithFlowerGift) {
new ShowAbilityPhase(this.scene, p.getBattlerIndex());