fix(numbers): round skills, round header Gold, correct tests
This commit is contained in:
@@ -67,7 +67,7 @@ spells.wizard = {
|
||||
cast (user, target, req) {
|
||||
let bonus = statsComputed(user).int * crit.crit(user, 'per');
|
||||
bonus *= Math.ceil((target.value < 0 ? 1 : target.value + 1) * 0.075);
|
||||
user.stats.exp += diminishingReturns(bonus, 75);
|
||||
user.stats.exp += Math.ceil(diminishingReturns(bonus, 75));
|
||||
if (!user.party.quest.progress.up) user.party.quest.progress.up = 0;
|
||||
user.party.quest.progress.up += Math.ceil(statsComputed(user).int * 0.1);
|
||||
updateStats(user, user.stats, req);
|
||||
@@ -122,9 +122,9 @@ spells.warrior = {
|
||||
notes: t('spellWarriorSmashNotes'),
|
||||
cast (user, target) {
|
||||
const bonus = statsComputed(user).str * crit.crit(user, 'con');
|
||||
target.value += diminishingReturns(bonus, 2.5, 35);
|
||||
target.value += Math.ceil(diminishingReturns(bonus, 2.5, 35));
|
||||
if (!user.party.quest.progress.up) user.party.quest.progress.up = 0;
|
||||
user.party.quest.progress.up += diminishingReturns(bonus, 55, 70);
|
||||
user.party.quest.progress.up += Math.ceil(diminishingReturns(bonus, 55, 70));
|
||||
},
|
||||
},
|
||||
defensiveStance: { // Defensive Stance
|
||||
@@ -174,7 +174,7 @@ spells.rogue = {
|
||||
notes: t('spellRoguePickPocketNotes'),
|
||||
cast (user, target) {
|
||||
const bonus = calculateBonus(target.value, statsComputed(user).per);
|
||||
user.stats.gp += diminishingReturns(bonus, 25, 75);
|
||||
user.stats.gp += Math.ceil(diminishingReturns(bonus, 25, 75));
|
||||
},
|
||||
},
|
||||
backStab: { // Backstab
|
||||
@@ -186,8 +186,8 @@ spells.rogue = {
|
||||
cast (user, target, req) {
|
||||
const _crit = crit.crit(user, 'str', 0.3);
|
||||
const bonus = calculateBonus(target.value, statsComputed(user).str, _crit);
|
||||
user.stats.exp += diminishingReturns(bonus, 75, 50);
|
||||
user.stats.gp += diminishingReturns(bonus, 18, 75);
|
||||
user.stats.exp += Math.ceil(diminishingReturns(bonus, 75, 50));
|
||||
user.stats.gp += Math.ceil(diminishingReturns(bonus, 18, 75));
|
||||
updateStats(user, user.stats, req);
|
||||
},
|
||||
},
|
||||
@@ -225,7 +225,7 @@ spells.healer = {
|
||||
notes: t('spellHealerHealNotes'),
|
||||
cast (user, target, req) {
|
||||
if (user.stats.hp >= 50) throw new NotAuthorized(t('messageHealthAlreadyMax')(req.language));
|
||||
user.stats.hp += (statsComputed(user).con + statsComputed(user).int + 5) * 0.075;
|
||||
user.stats.hp += Math.ceil((statsComputed(user).con + statsComputed(user).int + 5) * 0.075);
|
||||
if (user.stats.hp > 50) user.stats.hp = 50;
|
||||
},
|
||||
},
|
||||
@@ -238,7 +238,7 @@ spells.healer = {
|
||||
cast (user, tasks) {
|
||||
each(tasks, task => {
|
||||
if (task.type !== 'reward') {
|
||||
task.value += 4 * (statsComputed(user).int / (statsComputed(user).int + 40));
|
||||
task.value += Math.ceil(4 * (statsComputed(user).int / (statsComputed(user).int + 40)));
|
||||
}
|
||||
});
|
||||
},
|
||||
@@ -263,7 +263,7 @@ spells.healer = {
|
||||
notes: t('spellHealerHealAllNotes'),
|
||||
cast (user, target) {
|
||||
each(target, member => {
|
||||
member.stats.hp += (statsComputed(user).con + statsComputed(user).int + 5) * 0.04;
|
||||
member.stats.hp += Math.ceil((statsComputed(user).con + statsComputed(user).int + 5) * 0.04);
|
||||
if (member.stats.hp > 50) member.stats.hp = 50;
|
||||
});
|
||||
},
|
||||
|
||||
@@ -51,7 +51,7 @@ function _calculateDelta (task, direction, cron) {
|
||||
nextDelta *= 1 + reduce(task.checklist, (m, i) => m + (i.completed ? 1 : 0), 0);
|
||||
}
|
||||
}
|
||||
if (nextDelta < 0) {
|
||||
if (nextDelta > -1 && nextDelta < 0) {
|
||||
return Math.floor(nextDelta);
|
||||
}
|
||||
return Math.ceil(nextDelta);
|
||||
|
||||
Reference in New Issue
Block a user