mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2024-11-26 08:46:55 +00:00
[Bug] Remove redundant damage number popups (#3024)
* Remove magic number from Belly Drum's attr * Remove redundant damage number popup * Fix merge issue and remove another duplicate damage number instance
This commit is contained in:
parent
4bf5031304
commit
21f2e6981c
@ -2528,20 +2528,17 @@ export class HalfHpStatMaxAttr extends StatChangeAttr {
|
||||
|
||||
apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): Promise<boolean> {
|
||||
return new Promise<boolean>(resolve => {
|
||||
const damage = user.damageAndUpdate(Math.floor(user.getMaxHp() / 2), HitResult.OTHER, false, true);
|
||||
if (damage) {
|
||||
user.scene.damageNumberHandler.add(user, damage);
|
||||
}
|
||||
user.damageAndUpdate(Math.floor(user.getMaxHp() / 2), HitResult.OTHER, false, true);
|
||||
user.updateInfo().then(() => {
|
||||
const ret = super.apply(user, target, move, args);
|
||||
user.scene.queueMessage(getPokemonMessage(user, ` cut its own HP\nand maximized its ${getBattleStatName(this.stats[0])}!`));
|
||||
user.scene.queueMessage(getPokemonMessage(user, ` cut its own HP\nand maximized its ${getBattleStatName(this.stats[BattleStat.ATK])}!`));
|
||||
resolve(ret);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
getCondition(): MoveConditionFunc {
|
||||
return (user, target, move) => user.getHpRatio() > 0.5 && user.summonData.battleStats[this.stats[0]] < 6;
|
||||
return (user, target, move) => user.getHpRatio() > 0.5 && user.summonData.battleStats[this.stats[BattleStat.ATK]] < 6;
|
||||
}
|
||||
|
||||
// TODO: Add benefit score that considers HP cut
|
||||
@ -2558,10 +2555,7 @@ export class CutHpStatBoostAttr extends StatChangeAttr {
|
||||
|
||||
apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): Promise<boolean> {
|
||||
return new Promise<boolean>(resolve => {
|
||||
const damage = user.damageAndUpdate(Math.floor(user.getMaxHp() / this.cutRatio), HitResult.OTHER, false, true);
|
||||
if (damage) {
|
||||
user.scene.damageNumberHandler.add(user, damage);
|
||||
}
|
||||
user.damageAndUpdate(Math.floor(user.getMaxHp() / this.cutRatio), HitResult.OTHER, false, true);
|
||||
user.updateInfo().then(() => {
|
||||
const ret = super.apply(user, target, move, args);
|
||||
resolve(ret);
|
||||
|
Loading…
Reference in New Issue
Block a user