mirror of
https://github.com/smogon/pokemon-showdown.git
synced 2026-06-02 22:08:36 -05:00
Use ceiling HP percentages only with the HP Percentage Mod
This commit is contained in:
parent
e0551883ff
commit
ed6da51a1f
|
|
@ -1352,7 +1352,7 @@ export const Rulesets: import('../sim/dex-formats').FormatDataTable = {
|
|||
hppercentagemod: {
|
||||
effectType: 'Rule',
|
||||
name: 'HP Percentage Mod',
|
||||
desc: "Shows the HP of Pokémon in percentages",
|
||||
desc: "Shows the HP of Pokémon in rounded-up percentages",
|
||||
onBegin() {
|
||||
this.add('rule', 'HP Percentage Mod: HP is shown in percentages');
|
||||
this.reportPercentages = true;
|
||||
|
|
|
|||
|
|
@ -2063,7 +2063,14 @@ export class Pokemon {
|
|||
let shared;
|
||||
if (this.battle.reportExactHP) {
|
||||
shared = secret;
|
||||
} else if (this.battle.dex.currentMod === 'champions') {
|
||||
} else if (this.battle.reportPercentages) {
|
||||
// HP Percentage Mod mechanics
|
||||
let percentage = Math.ceil(100 * this.hp / this.maxhp);
|
||||
if (percentage === 100 && this.hp < this.maxhp) {
|
||||
percentage = 99;
|
||||
}
|
||||
shared = `${percentage}/100`;
|
||||
} else if (this.battle.gen >= 7) {
|
||||
// Pokemon Champions mechanics
|
||||
const percentage = Math.floor(100 * this.hp / this.maxhp) || 1;
|
||||
shared = `${percentage}/100`;
|
||||
|
|
@ -2072,13 +2079,6 @@ export class Pokemon {
|
|||
} else if (percentage === 50) {
|
||||
shared += this.hp * 2 > this.maxhp ? 'g' : 'y';
|
||||
}
|
||||
} else if (this.battle.reportPercentages || this.battle.gen >= 7) {
|
||||
// HP Percentage Mod mechanics
|
||||
let percentage = Math.ceil(100 * this.hp / this.maxhp);
|
||||
if (percentage === 100 && this.hp < this.maxhp) {
|
||||
percentage = 99;
|
||||
}
|
||||
shared = `${percentage}/100`;
|
||||
} else {
|
||||
/**
|
||||
* In-game accurate pixel health mechanics
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user