Skip to content

Commit 5c35b07

Browse files
committed
fix(numbers): round skills, round header Gold, correct tests
1 parent 8aabd96 commit 5c35b07

File tree

6 files changed

+17
-18
lines changed

6 files changed

+17
-18
lines changed

test/api/unit/models/group.test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -274,13 +274,13 @@ describe('Group Model', () => {
274274

275275
expect(Group.prototype.sendChat).to.be.calledOnce;
276276
expect(Group.prototype.sendChat).to.be.calledWith({
277-
message: '`Participating Member attacks Wailing Whale for 5.0 damage. Wailing Whale attacks party for 7.5 damage.`',
277+
message: '`Participating Member attacks Wailing Whale for 5 damage. Wailing Whale attacks party for 8 damage.`',
278278
info: {
279-
bossDamage: '7.5',
279+
bossDamage: '8',
280280
quest: 'whale',
281281
type: 'boss_damage',
282282
user: 'Participating Member',
283-
userDamage: '5.0',
283+
userDamage: '5',
284284
},
285285
});
286286
});

website/client/src/components/header/menu.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@
416416
:aria-label="$t('gold')"
417417
v-html="icons.gold"
418418
></div>
419-
<span>{{ Math.floor(user.stats.gp * 100) / 100 }}</span>
419+
<span>{{ Math.floor(user.stats.gp) }}</span>
420420
</div>
421421
</div>
422422
<div class="form-inline desktop-only">

website/client/src/components/tasks/taskModal.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1030,7 +1030,6 @@
10301030
<script>
10311031
import axios from 'axios';
10321032
import moment from 'moment';
1033-
import isNumber from 'lodash/isNumber';
10341033
import Datepicker from '@/components/ui/datepicker';
10351034
import toggleCheckbox from '@/components/ui/toggleCheckbox';
10361035
import markdownDirective from '@/directives/markdown';

website/client/tests/unit/filters/roundBigNumber.spec.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ describe('round big number filter', () => {
88
});
99

1010
test('can round thousands', () => {
11-
expect(roundBigNumberFilter(70065)).to.equal('70.1k');
11+
expect(roundBigNumberFilter(70065)).to.equal('70k');
1212
});
1313

1414
test('can round milions', () => {
15-
expect(roundBigNumberFilter(10000987)).to.equal('10.0m');
15+
expect(roundBigNumberFilter(10000987)).to.equal('10m');
1616
});
1717

1818
test('can round bilions', () => {
19-
expect(roundBigNumberFilter(1000000000)).to.equal('1.0b');
19+
expect(roundBigNumberFilter(1000000000)).to.equal('1b');
2020
});
2121
});

website/common/script/content/spells.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ spells.wizard = {
6767
cast (user, target, req) {
6868
let bonus = statsComputed(user).int * crit.crit(user, 'per');
6969
bonus *= Math.ceil((target.value < 0 ? 1 : target.value + 1) * 0.075);
70-
user.stats.exp += diminishingReturns(bonus, 75);
70+
user.stats.exp += Math.ceil(diminishingReturns(bonus, 75));
7171
if (!user.party.quest.progress.up) user.party.quest.progress.up = 0;
7272
user.party.quest.progress.up += Math.ceil(statsComputed(user).int * 0.1);
7373
updateStats(user, user.stats, req);
@@ -122,9 +122,9 @@ spells.warrior = {
122122
notes: t('spellWarriorSmashNotes'),
123123
cast (user, target) {
124124
const bonus = statsComputed(user).str * crit.crit(user, 'con');
125-
target.value += diminishingReturns(bonus, 2.5, 35);
125+
target.value += Math.ceil(diminishingReturns(bonus, 2.5, 35));
126126
if (!user.party.quest.progress.up) user.party.quest.progress.up = 0;
127-
user.party.quest.progress.up += diminishingReturns(bonus, 55, 70);
127+
user.party.quest.progress.up += Math.ceil(diminishingReturns(bonus, 55, 70));
128128
},
129129
},
130130
defensiveStance: { // Defensive Stance
@@ -174,7 +174,7 @@ spells.rogue = {
174174
notes: t('spellRoguePickPocketNotes'),
175175
cast (user, target) {
176176
const bonus = calculateBonus(target.value, statsComputed(user).per);
177-
user.stats.gp += diminishingReturns(bonus, 25, 75);
177+
user.stats.gp += Math.ceil(diminishingReturns(bonus, 25, 75));
178178
},
179179
},
180180
backStab: { // Backstab
@@ -186,8 +186,8 @@ spells.rogue = {
186186
cast (user, target, req) {
187187
const _crit = crit.crit(user, 'str', 0.3);
188188
const bonus = calculateBonus(target.value, statsComputed(user).str, _crit);
189-
user.stats.exp += diminishingReturns(bonus, 75, 50);
190-
user.stats.gp += diminishingReturns(bonus, 18, 75);
189+
user.stats.exp += Math.ceil(diminishingReturns(bonus, 75, 50));
190+
user.stats.gp += Math.ceil(diminishingReturns(bonus, 18, 75));
191191
updateStats(user, user.stats, req);
192192
},
193193
},
@@ -225,7 +225,7 @@ spells.healer = {
225225
notes: t('spellHealerHealNotes'),
226226
cast (user, target, req) {
227227
if (user.stats.hp >= 50) throw new NotAuthorized(t('messageHealthAlreadyMax')(req.language));
228-
user.stats.hp += (statsComputed(user).con + statsComputed(user).int + 5) * 0.075;
228+
user.stats.hp += Math.ceil((statsComputed(user).con + statsComputed(user).int + 5) * 0.075);
229229
if (user.stats.hp > 50) user.stats.hp = 50;
230230
},
231231
},
@@ -238,7 +238,7 @@ spells.healer = {
238238
cast (user, tasks) {
239239
each(tasks, task => {
240240
if (task.type !== 'reward') {
241-
task.value += 4 * (statsComputed(user).int / (statsComputed(user).int + 40));
241+
task.value += Math.ceil(4 * (statsComputed(user).int / (statsComputed(user).int + 40)));
242242
}
243243
});
244244
},
@@ -263,7 +263,7 @@ spells.healer = {
263263
notes: t('spellHealerHealAllNotes'),
264264
cast (user, target) {
265265
each(target, member => {
266-
member.stats.hp += (statsComputed(user).con + statsComputed(user).int + 5) * 0.04;
266+
member.stats.hp += Math.ceil((statsComputed(user).con + statsComputed(user).int + 5) * 0.04);
267267
if (member.stats.hp > 50) member.stats.hp = 50;
268268
});
269269
},

website/common/script/ops/scoreTask.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ function _calculateDelta (task, direction, cron) {
5151
nextDelta *= 1 + reduce(task.checklist, (m, i) => m + (i.completed ? 1 : 0), 0);
5252
}
5353
}
54-
if (nextDelta < 0) {
54+
if (nextDelta > -1 && nextDelta < 0) {
5555
return Math.floor(nextDelta);
5656
}
5757
return Math.ceil(nextDelta);

0 commit comments

Comments
 (0)