mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 15:17:25 +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
|
.row.boss-details
|
||||||
.col-6
|
.col-6
|
||||||
span.float-left
|
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')
|
.col-6(v-if='userIsOnQuest')
|
||||||
// @TODO: Why do we not sync quset progress on the group doc? Each user could have different progress
|
// @TODO: Why do we not sync quest 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
|
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')
|
.row.rage-bar-row(v-if='questData.boss.rage')
|
||||||
.col-12
|
.col-12
|
||||||
.grey-progress-bar
|
.grey-progress-bar
|
||||||
|
|||||||
@@ -765,7 +765,8 @@ export default {
|
|||||||
},
|
},
|
||||||
pendingDamage () {
|
pendingDamage () {
|
||||||
if (!this.user.party.quest.progress.up) return 0;
|
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 () {
|
bossCurrentHealth () {
|
||||||
if (!this.group.quest.progress.hp) return 0;
|
if (!this.group.quest.progress.hp) return 0;
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
export default function floor (val) {
|
export default function floor (val, power = 100) {
|
||||||
return Math.floor(val * 100) / 100;
|
return Math.floor(val * power) / power;
|
||||||
}
|
}
|
||||||
@@ -123,6 +123,7 @@
|
|||||||
"buyQuestBundle": "Buy Quest Bundle",
|
"buyQuestBundle": "Buy Quest Bundle",
|
||||||
"noQuestToStart": "Can’t find a quest to start? Try checking out the Quest Shop in the Market for new releases!",
|
"noQuestToStart": "Can’t find a quest to start? Try checking out the Quest Shop in the Market for new releases!",
|
||||||
"pendingDamage": "<%= damage %> pending damage",
|
"pendingDamage": "<%= damage %> pending damage",
|
||||||
|
"pendingDamageLabel": "pending damage",
|
||||||
"bossHealth": "<%= currentHealth %> / <%= maxHealth %> Health",
|
"bossHealth": "<%= currentHealth %> / <%= maxHealth %> Health",
|
||||||
"rageAttack": "Rage Attack:",
|
"rageAttack": "Rage Attack:",
|
||||||
"bossRage": "<%= currentRage %> / <%= maxRage %> Rage",
|
"bossRage": "<%= currentRage %> / <%= maxRage %> Rage",
|
||||||
|
|||||||
Reference in New Issue
Block a user