mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 07:07:35 +01:00
* improves rounding for boss hp and player pending damage * use floor filter function for user's pending damage for party page and tavern boss
This commit is contained in:
@@ -55,10 +55,12 @@ div
|
||||
.row.boss-details
|
||||
.col-6
|
||||
span.float-left
|
||||
| {{parseFloat(group.quest.progress.hp).toFixed(2)}} / {{parseFloat(questData.boss.hp).toFixed(2)}}
|
||||
| {{ Math.ceil(parseFloat(group.quest.progress.hp) * 100) / 100 }} / {{ parseFloat(questData.boss.hp).toFixed(2) }}
|
||||
// current boss hp uses ceil so you don't underestimate damage needed to end quest
|
||||
.col-6(v-if='userIsOnQuest')
|
||||
// @TODO: Why do we not sync quset progress on the group doc? Each user could have different progress
|
||||
span.float-right {{parseFloat(user.party.quest.progress.up).toFixed(1) || 0}} pending damage
|
||||
// @TODO: Why do we not sync quest progress on the group doc? Each user could have different progress.
|
||||
span.float-right {{ user.party.quest.progress.up | floor(10) }} {{ $t('pendingDamageLabel') }}
|
||||
// player's pending damage uses floor so you don't overestimate damage you've already done
|
||||
.row.rage-bar-row(v-if='questData.boss.rage')
|
||||
.col-12
|
||||
.grey-progress-bar
|
||||
|
||||
@@ -765,7 +765,8 @@ export default {
|
||||
},
|
||||
pendingDamage () {
|
||||
if (!this.user.party.quest.progress.up) return 0;
|
||||
return parseFloat(this.user.party.quest.progress.up).toFixed(1);
|
||||
return this.$options.filters.floor(this.user.party.quest.progress.up, 10);
|
||||
// keep user's pending damage consistent with how it's displayed on the party page
|
||||
},
|
||||
bossCurrentHealth () {
|
||||
if (!this.group.quest.progress.hp) return 0;
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
export default function floor (val) {
|
||||
return Math.floor(val * 100) / 100;
|
||||
export default function floor (val, power = 100) {
|
||||
return Math.floor(val * power) / power;
|
||||
}
|
||||
@@ -123,6 +123,7 @@
|
||||
"buyQuestBundle": "Buy Quest Bundle",
|
||||
"noQuestToStart": "Can’t find a quest to start? Try checking out the Quest Shop in the Market for new releases!",
|
||||
"pendingDamage": "<%= damage %> pending damage",
|
||||
"pendingDamageLabel": "pending damage",
|
||||
"bossHealth": "<%= currentHealth %> / <%= maxHealth %> Health",
|
||||
"rageAttack": "Rage Attack:",
|
||||
"bossRage": "<%= currentRage %> / <%= maxRage %> Rage",
|
||||
|
||||
Reference in New Issue
Block a user