mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 22:57:21 +01:00
lint common
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
import predictableRandom from './predictableRandom';
|
||||
import statsComputed from '../libs/statsComputed';
|
||||
import statsComputed from '../libs/statsComputed'; // eslint-disable-line import/no-cycle
|
||||
|
||||
function crit (user, stat = 'str', chance = 0.03) {
|
||||
const s = statsComputed(user)[stat];
|
||||
if (predictableRandom(user) <= chance * (1 + s / 100)) {
|
||||
return 1.5 + 4 * s / (s + 200);
|
||||
return 1.5 + (4 * s) / (s + 200);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user