From: xangelo Date: Fri, 18 Aug 2023 18:38:28 +0000 (-0400) Subject: fix: missing % from player bar X-Git-Tag: v0.2.10~1 X-Git-Url: https://git.xangelo.ca/?a=commitdiff_plain;h=a0606a53ae2079289237ce700ceec0601ded3119;p=risinglegends.git fix: missing % from player bar --- diff --git a/src/server/views/player-bar.ts b/src/server/views/player-bar.ts index 3b57789..d02ea68 100644 --- a/src/server/views/player-bar.ts +++ b/src/server/views/player-bar.ts @@ -75,7 +75,7 @@ function progressBar(current: number, max: number, id: string, opts: ProgressBar } return `
${current}/${max} - ${percent}
`; +title="${percent}% - ${current}/${max}">${current}/${max} - ${percent}%`; } export function renderPlayerBar(player: Player, inventory: EquippedItemDetails[]): string { diff --git a/src/shared/player.ts b/src/shared/player.ts index e3af5f7..ca94496 100644 --- a/src/shared/player.ts +++ b/src/shared/player.ts @@ -26,7 +26,7 @@ export type PlayerWithSkills = Player & { } export function maxHp(constitution: number, playerLevel: number): number { - return Math.ceil((constitution + (playerLevel * 1.3)) * 1.7); + return Math.ceil((constitution * 1.7) + (playerLevel * 1.3)); } export function expToLevel(level: number): number {