Fix damage display issues with battle info
This commit is contained in:
1 parent
1f6a6f4621
commit
6f54fa7741
6 files changed
+25
-18
No files matched your search
+1
-2
@@ -905,8 +905,7 @@ export class PostWeatherLapseDamageAbAttr extends PostWeatherLapseAbAttr {
|
||||
if (pokemon.getHpRatio() < 1) {
|
||||
const scene = pokemon.scene;
|
||||
scene.queueMessage(getPokemonMessage(pokemon, ` is hurt\nby its ${pokemon.getAbility()}!`));
|
||||
const damage = pokemon.damage(Math.ceil(pokemon.getMaxHp() / (16 / this.damageFactor)));
|
||||
scene.unshiftPhase(new DamagePhase(pokemon.scene, pokemon.getBattlerIndex(), damage, HitResult.OTHER));
|
||||
pokemon.damageAndUpdate(Math.ceil(pokemon.getMaxHp() / (16 / this.damageFactor)), HitResult.OTHER);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -173,7 +173,7 @@ class SpikesTag extends ArenaTrapTag {
|
||||
const damage = Math.ceil(pokemon.getMaxHp() * damageHpRatio);
|
||||
|
||||
pokemon.scene.queueMessage(getPokemonMessage(pokemon, ' is hurt\nby the spikes!'));
|
||||
pokemon.scene.unshiftPhase(new DamagePhase(pokemon.scene, pokemon.getBattlerIndex(), pokemon.damage(damage), HitResult.OTHER));
|
||||
pokemon.damageAndUpdate(damage, HitResult.OTHER);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -268,7 +268,7 @@ class StealthRockTag extends ArenaTrapTag {
|
||||
if (damageHpRatio) {
|
||||
const damage = Math.ceil(pokemon.getMaxHp() * damageHpRatio);
|
||||
pokemon.scene.queueMessage(`Pointed stones dug into\n${pokemon.name}!`);
|
||||
pokemon.scene.unshiftPhase(new DamagePhase(pokemon.scene, pokemon.getBattlerIndex(), pokemon.damage(damage), HitResult.OTHER));
|
||||
pokemon.damageAndUpdate(damage, HitResult.OTHER);
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
@@ -179,7 +179,7 @@ export class ConfusedTag extends BattlerTag {
|
||||
const def = pokemon.getBattleStat(Stat.DEF);
|
||||
const damage = Math.ceil(((((2 * pokemon.level / 5 + 2) * 40 * atk / def) / 50) + 2) * (pokemon.randSeedInt(15, 85) / 100));
|
||||
pokemon.scene.queueMessage('It hurt itself in its\nconfusion!');
|
||||
pokemon.scene.unshiftPhase(new DamagePhase(pokemon.scene, pokemon.getBattlerIndex(), pokemon.damage(damage)));
|
||||
pokemon.damageAndUpdate(damage);
|
||||
pokemon.battleData.hitCount++;
|
||||
(pokemon.scene.getCurrentPhase() as MovePhase).cancel();
|
||||
}
|
||||
@@ -263,9 +263,7 @@ export class SeedTag extends BattlerTag {
|
||||
if (source) {
|
||||
pokemon.scene.unshiftPhase(new CommonAnimPhase(pokemon.scene, source.getBattlerIndex(), pokemon.getBattlerIndex(), CommonAnim.LEECH_SEED));
|
||||
|
||||
const damage = pokemon.damage(Math.max(Math.floor(pokemon.getMaxHp() / 8), 1));
|
||||
|
||||
pokemon.scene.unshiftPhase(new DamagePhase(pokemon.scene, pokemon.getBattlerIndex(), damage));
|
||||
const damage = pokemon.damageAndUpdate(Math.max(Math.floor(pokemon.getMaxHp() / 8), 1));
|
||||
pokemon.scene.unshiftPhase(new PokemonHealPhase(pokemon.scene, source.getBattlerIndex(), damage, getPokemonMessage(pokemon, '\'s health is\nsapped by Leech Seed!'), false, true));
|
||||
}
|
||||
}
|
||||
@@ -302,8 +300,7 @@ export class NightmareTag extends BattlerTag {
|
||||
pokemon.scene.queueMessage(getPokemonMessage(pokemon, ' is locked\nin a Nightmare!'));
|
||||
pokemon.scene.unshiftPhase(new CommonAnimPhase(pokemon.scene, pokemon.getBattlerIndex(), undefined, CommonAnim.CURSE)); // TODO: Update animation type
|
||||
|
||||
const damage = Math.ceil(pokemon.getMaxHp() / 4);
|
||||
pokemon.scene.unshiftPhase(new DamagePhase(pokemon.scene, pokemon.getBattlerIndex(), pokemon.damage(damage)));
|
||||
pokemon.damageAndUpdate(Math.ceil(pokemon.getMaxHp() / 4));
|
||||
}
|
||||
|
||||
return ret;
|
||||
@@ -470,8 +467,7 @@ export abstract class DamagingTrapTag extends TrappedTag {
|
||||
pokemon.scene.queueMessage(getPokemonMessage(pokemon, ` is hurt\nby ${this.getMoveName()}!`));
|
||||
pokemon.scene.unshiftPhase(new CommonAnimPhase(pokemon.scene, pokemon.getBattlerIndex(), undefined, this.commonAnim));
|
||||
|
||||
const damage = Math.ceil(pokemon.getMaxHp() / 8);
|
||||
pokemon.scene.unshiftPhase(new DamagePhase(pokemon.scene, pokemon.getBattlerIndex(), pokemon.damage(damage)));
|
||||
pokemon.damageAndUpdate(Math.ceil(pokemon.getMaxHp() / 8))
|
||||
}
|
||||
|
||||
return ret;
|
||||
@@ -615,7 +611,7 @@ export class PerishSongTag extends BattlerTag {
|
||||
if (ret)
|
||||
pokemon.scene.queueMessage(getPokemonMessage(pokemon, `\'s perish count fell to ${this.turnCount}.`));
|
||||
else
|
||||
pokemon.scene.unshiftPhase(new DamagePhase(pokemon.scene, pokemon.getBattlerIndex(), pokemon.damage(pokemon.hp, true, true), HitResult.ONE_HIT_KO));
|
||||
pokemon.damageAndUpdate(pokemon.hp, HitResult.ONE_HIT_KO, false, true, true);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
+2
-2
@@ -532,7 +532,7 @@ export class RecoilAttr extends MoveEffectAttr {
|
||||
if (!recoilDamage)
|
||||
return false;
|
||||
|
||||
user.scene.unshiftPhase(new DamagePhase(user.scene, user.getBattlerIndex(), user.damage(recoilDamage, true), HitResult.OTHER));
|
||||
user.damageAndUpdate(recoilDamage, HitResult.OTHER, false, true);
|
||||
user.scene.queueMessage(getPokemonMessage(user, ' is hit\nwith recoil!'));
|
||||
|
||||
return true;
|
||||
@@ -552,7 +552,7 @@ export class SacrificialAttr extends MoveEffectAttr {
|
||||
if (!super.apply(user, target, move, args))
|
||||
return false;
|
||||
|
||||
user.scene.unshiftPhase(new DamagePhase(user.scene, user.getBattlerIndex(), user.damage(user.hp, true, true), HitResult.OTHER));
|
||||
user.damageAndUpdate(user.hp, HitResult.OTHER, false, true, true);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user