From 53cae9e13587a3d2e6567f8ebb0cd054b4be8c4c Mon Sep 17 00:00:00 2001 From: Temps Ray Date: Wed, 1 May 2024 17:08:13 -0400 Subject: [PATCH] Fix effect spore, tera blast distribution, and IVs shown on catch --- src/data/ability.ts | 15 ++++++++++++++- src/phases.ts | 2 +- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/data/ability.ts b/src/data/ability.ts index 2ac7d6be1ac..35f6da685eb 100644 --- a/src/data/ability.ts +++ b/src/data/ability.ts @@ -679,6 +679,19 @@ export class PostDefendContactApplyStatusEffectAbAttr extends PostDefendAbAttr { } } +export class EffectSporeAbAttr extends PostDefendContactApplyStatusEffectAbAttr { + constructor() { + super(10, StatusEffect.POISON, StatusEffect.PARALYSIS, StatusEffect.SLEEP); + } + + applyPostDefend(pokemon: Pokemon, passive: boolean, attacker: Pokemon, move: PokemonMove, hitResult: HitResult, args: any[]): boolean { + if (attacker.hasAbility(Abilities.OVERCOAT) || attacker.isOfType(Type.GRASS)) { + return false; + } + return super.applyPostDefend(pokemon, passive, attacker, move, hitResult, args); + } +} + export class PostDefendContactApplyTagChanceAbAttr extends PostDefendAbAttr { private chance: integer; private tagType: BattlerTagType; @@ -2572,7 +2585,7 @@ export function initAbilities() { .attr(TypeImmunityAbAttr, Type.GROUND, (pokemon: Pokemon) => !pokemon.getTag(BattlerTagType.IGNORE_FLYING) && !pokemon.scene.arena.getTag(ArenaTagType.GRAVITY) && !pokemon.getTag(BattlerTagType.GROUNDED)) .ignorable(), new Ability(Abilities.EFFECT_SPORE, 3) - .attr(PostDefendContactApplyStatusEffectAbAttr, 10, StatusEffect.POISON, StatusEffect.PARALYSIS, StatusEffect.SLEEP), + .attr(EffectSporeAbAttr), new Ability(Abilities.SYNCHRONIZE, 3) .attr(SyncEncounterNatureAbAttr) .unimplemented(), diff --git a/src/phases.ts b/src/phases.ts index ad2a7537de7..2e0b8425567 100644 --- a/src/phases.ts +++ b/src/phases.ts @@ -4095,7 +4095,7 @@ export class AttemptCapturePhase extends PokemonPhase { this.scene.pokemonInfoContainer.show(pokemon, true); - this.scene.gameData.updateSpeciesDexIvs(pokemon.species.speciesId, pokemon.ivs); + this.scene.gameData.updateSpeciesDexIvs(pokemon.species.getRootSpeciesId(true), pokemon.ivs); this.scene.ui.showText(i18next.t('menu:pokemonCaught', { pokemonName: pokemon.name }), null, () => { const end = () => {