pull/850/merge
Griffin Zody 2024-05-15 19:23:36 +02:00 committed by GitHub
commit a309009eeb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 1 deletions

View File

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