mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-16 22:27:26 +01:00
fix linting
This commit is contained in:
@@ -144,8 +144,6 @@ import axios from 'axios';
|
|||||||
import isArray from 'lodash/isArray';
|
import isArray from 'lodash/isArray';
|
||||||
|
|
||||||
import spells from '../../../common/script/content/spells';
|
import spells from '../../../common/script/content/spells';
|
||||||
import { crit } from '../../../common/script/fns/crit';
|
|
||||||
import updateStats from '../../../common/script/fns/updateStats';
|
|
||||||
|
|
||||||
import { mapState } from 'client/libs/store';
|
import { mapState } from 'client/libs/store';
|
||||||
import notifications from 'client/mixins/notifications';
|
import notifications from 'client/mixins/notifications';
|
||||||
|
|||||||
@@ -31,8 +31,8 @@ function diminishingReturns (bonus, max, halfway) {
|
|||||||
return max * (bonus / (bonus + halfway));
|
return max * (bonus / (bonus + halfway));
|
||||||
}
|
}
|
||||||
|
|
||||||
function calculateBonus (value, stat, crit = 1, statScale = 0.5) {
|
function calculateBonus (value, stat, critVal = 1, statScale = 0.5) {
|
||||||
return (value < 0 ? 1 : value + 1) + stat * statScale * crit;
|
return (value < 0 ? 1 : value + 1) + stat * statScale * critVal;
|
||||||
}
|
}
|
||||||
|
|
||||||
let spells = {};
|
let spells = {};
|
||||||
@@ -45,7 +45,7 @@ spells.wizard = {
|
|||||||
target: 'task',
|
target: 'task',
|
||||||
notes: t('spellWizardFireballNotes'),
|
notes: t('spellWizardFireballNotes'),
|
||||||
cast (user, target, req) {
|
cast (user, target, req) {
|
||||||
let bonus = statsComputed(user).int * crit(user, 'per');
|
let bonus = statsComputed(user).int * crit.crit(user, 'per');
|
||||||
bonus *= Math.ceil((target.value < 0 ? 1 : target.value + 1) * 0.075);
|
bonus *= Math.ceil((target.value < 0 ? 1 : target.value + 1) * 0.075);
|
||||||
user.stats.exp += diminishingReturns(bonus, 75);
|
user.stats.exp += diminishingReturns(bonus, 75);
|
||||||
if (!user.party.quest.progress.up) user.party.quest.progress.up = 0;
|
if (!user.party.quest.progress.up) user.party.quest.progress.up = 0;
|
||||||
@@ -102,7 +102,7 @@ spells.warrior = {
|
|||||||
target: 'task',
|
target: 'task',
|
||||||
notes: t('spellWarriorSmashNotes'),
|
notes: t('spellWarriorSmashNotes'),
|
||||||
cast (user, target) {
|
cast (user, target) {
|
||||||
let bonus = statsComputed(user).str * crit(user, 'con');
|
let bonus = statsComputed(user).str * crit.crit(user, 'con');
|
||||||
target.value += diminishingReturns(bonus, 2.5, 35);
|
target.value += diminishingReturns(bonus, 2.5, 35);
|
||||||
if (!user.party.quest.progress.up) user.party.quest.progress.up = 0;
|
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 += diminishingReturns(bonus, 55, 70);
|
||||||
@@ -169,7 +169,7 @@ spells.rogue = {
|
|||||||
target: 'task',
|
target: 'task',
|
||||||
notes: t('spellRogueBackStabNotes'),
|
notes: t('spellRogueBackStabNotes'),
|
||||||
cast (user, target, req) {
|
cast (user, target, req) {
|
||||||
let _crit = crit(user, 'str', 0.3);
|
let _crit = crit.crit(user, 'str', 0.3);
|
||||||
let bonus = calculateBonus(target.value, statsComputed(user).str, _crit);
|
let bonus = calculateBonus(target.value, statsComputed(user).str, _crit);
|
||||||
user.stats.exp += diminishingReturns(bonus, 75, 50);
|
user.stats.exp += diminishingReturns(bonus, 75, 50);
|
||||||
user.stats.gp += diminishingReturns(bonus, 18, 75);
|
user.stats.gp += diminishingReturns(bonus, 18, 75);
|
||||||
|
|||||||
Reference in New Issue
Block a user