Do not trigger focus band effect on status damage

pull/850/head
Griffin Zody 2024-05-14 17:31:16 -06:00
parent 4e279224c5
commit f0872ed608
2 changed files with 6 additions and 2 deletions

View File

@ -630,7 +630,7 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
let value = Math.floor(((2 * baseStat + this.ivs[s]) * this.level) * 0.01);
if (isHp) {
value = value + this.level + 10;
if (this.hasAbility(Abilities.WONDER_GUARD, false, true))
if (this.hasAbility(Abilities.WONDER_GUARD, false, true) || this.species.speciesId == Species.SHEDINJA)
value = 1;
if (this.hp > value || this.hp === undefined)
this.hp = value;

View File

@ -2976,19 +2976,23 @@ export class PostTurnStatusEffectPhase extends PokemonPhase {
if (!cancelled.value) {
this.scene.queueMessage(getPokemonMessage(pokemon, getStatusEffectActivationText(pokemon.status.effect)));
let damage: integer = 0;
let statusDamage: boolean = false;
switch (pokemon.status.effect) {
case StatusEffect.POISON:
damage = Math.max(pokemon.getMaxHp() >> 3, 1);
statusDamage = true;
break;
case StatusEffect.TOXIC:
damage = Math.max(Math.floor((pokemon.getMaxHp() / 16) * pokemon.status.turnCount), 1);
statusDamage = true;
break;
case StatusEffect.BURN:
damage = Math.max(pokemon.getMaxHp() >> 4, 1);
statusDamage = true;
break;
}
if (damage) {
this.scene.damageNumberHandler.add(this.getPokemon(), pokemon.damage(damage));
this.scene.damageNumberHandler.add(this.getPokemon(), pokemon.damage(damage, statusDamage));
pokemon.updateInfo();
}
new CommonBattleAnim(CommonAnim.POISON + (pokemon.status.effect - 1), pokemon).play(this.scene, () => this.end());