mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-05-21 13:18:53 +00:00
some passive stats balancing, not yet using @jfriendlys's algos, still
needs work
This commit is contained in:
parent
bbc38a6532
commit
aa3a5c06b4
2 changed files with 20 additions and 20 deletions
14
dist/habitrpg-shared.js
vendored
14
dist/habitrpg-shared.js
vendored
|
|
@ -10498,7 +10498,7 @@ var global=self;/**
|
|||
|
||||
},{"lodash":3}],6:[function(require,module,exports){
|
||||
var process=require("__browserify_process");(function() {
|
||||
var HP, XP, api, content, dayMapping, moment, preenHistory, sanitizeOptions, _,
|
||||
var api, content, dayMapping, moment, preenHistory, sanitizeOptions, _,
|
||||
__indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
|
||||
|
||||
moment = require('moment');
|
||||
|
|
@ -10507,10 +10507,6 @@ var process=require("__browserify_process");(function() {
|
|||
|
||||
content = require('./content.coffee');
|
||||
|
||||
XP = 7.5;
|
||||
|
||||
HP = 2;
|
||||
|
||||
api = module.exports = {};
|
||||
|
||||
/*
|
||||
|
|
@ -11539,7 +11535,7 @@ var process=require("__browserify_process");(function() {
|
|||
if (adjustvalue) {
|
||||
task.value += nextDelta;
|
||||
if (direction === 'up' && task.type !== 'reward' && !(task.type === 'habit' && !task.down)) {
|
||||
task.value += user._statsComputed.str * .25;
|
||||
task.value += nextDelta * user._statsComputed.str * .005;
|
||||
}
|
||||
}
|
||||
return delta += nextDelta;
|
||||
|
|
@ -11548,8 +11544,8 @@ var process=require("__browserify_process");(function() {
|
|||
addPoints = function() {
|
||||
var afterStreak, crit, gpMod, intMod, streakBonus;
|
||||
crit = user.fns.predictableRandom() <= .03 ? 1.5 + (.05 * user._statsComputed.str) : 1;
|
||||
intMod = 1 + (user._statsComputed.int / 100);
|
||||
stats.exp += Math.round(delta * XP * intMod * task.priority * crit);
|
||||
intMod = 1 + (user._statsComputed.int * .075);
|
||||
stats.exp += Math.round(delta * intMod * task.priority * crit);
|
||||
gpMod = delta * task.priority * crit;
|
||||
gpMod *= 1 + user._statsComputed.per * .03;
|
||||
return stats.gp += task.streak ? (streakBonus = task.streak / 100 + 1, afterStreak = gpMod * streakBonus, gpMod > 0 ? user._tmp.streakBonus = afterStreak - gpMod : void 0, afterStreak) : gpMod;
|
||||
|
|
@ -11557,7 +11553,7 @@ var process=require("__browserify_process");(function() {
|
|||
subtractPoints = function() {
|
||||
var conMod, hpMod;
|
||||
conMod = 1 - (user._statsComputed.con / 100);
|
||||
hpMod = delta * HP * conMod * task.priority;
|
||||
hpMod = delta * conMod * task.priority;
|
||||
return stats.hp += Math.round(hpMod * 10) / 10;
|
||||
};
|
||||
switch (task.type) {
|
||||
|
|
|
|||
|
|
@ -2,12 +2,8 @@ moment = require('moment')
|
|||
_ = require('lodash')
|
||||
content = require('./content.coffee')
|
||||
|
||||
XP = 7.5 # originally 15, users were complaining that they gained exp too fast
|
||||
HP = 2
|
||||
|
||||
api = module.exports = {}
|
||||
|
||||
|
||||
###
|
||||
------------------------------------------------------
|
||||
Time / Day
|
||||
|
|
@ -676,24 +672,30 @@ api.wrap = (user) ->
|
|||
nextDelta = Math.pow(0.9747, currVal) * (if direction is 'down' then -1 else 1)
|
||||
if adjustvalue
|
||||
task.value += nextDelta
|
||||
# Factor in STR. Only for up-scoring, ignore up-onlies and rewards
|
||||
# ===== STRENGTH =====
|
||||
# (Only for up-scoring, ignore up-onlies and rewards)
|
||||
if direction is 'up' and task.type != 'reward' and !(task.type is 'habit' and !task.down)
|
||||
task.value += user._statsComputed.str * .25
|
||||
# TODO STR Improves the amount by which Dailies and +/- Habits decrease in threat when scored, by .25% per point.
|
||||
task.value += nextDelta * user._statsComputed.str * .005
|
||||
delta += nextDelta
|
||||
|
||||
addPoints = ->
|
||||
# Critical
|
||||
# ===== CRITICAL HITS =====
|
||||
crit =
|
||||
if user.fns.predictableRandom() <= .03 then 1.5 + (.05*user._statsComputed.str)
|
||||
else 1
|
||||
|
||||
# Exp Modifier
|
||||
intMod = 1 + (user._statsComputed.int / 100)
|
||||
stats.exp += Math.round(delta * XP * intMod * task.priority * crit)
|
||||
# ===== Intelligence =====
|
||||
# TODO Increases Experience gain by .2% per point.
|
||||
intMod = 1 + (user._statsComputed.int * .075)
|
||||
stats.exp += Math.round(delta * intMod * task.priority * crit)
|
||||
|
||||
# GP modifier
|
||||
gpMod = delta * task.priority * crit
|
||||
gpMod *= (1 + user._statsComputed.per *.03) # Factor in PER
|
||||
# ===== PERCEPTION =====
|
||||
# TODO Increases Gold gained from tasks by .3% per point.
|
||||
gpMod *= (1 + user._statsComputed.per *.03)
|
||||
stats.gp +=
|
||||
if task.streak
|
||||
streakBonus = task.streak / 100 + 1 # eg, 1-day streak is 1.1, 2-day is 1.2, etc
|
||||
|
|
@ -704,8 +706,10 @@ api.wrap = (user) ->
|
|||
|
||||
# HP modifier
|
||||
subtractPoints = ->
|
||||
# ===== CONSTITUTION =====
|
||||
# TODO Decreases HP loss from bad habits / missed dailies by 0.5% per point.
|
||||
conMod = 1 - (user._statsComputed.con / 100)
|
||||
hpMod = delta * HP * conMod * task.priority
|
||||
hpMod = delta * conMod * task.priority
|
||||
stats.hp += Math.round(hpMod * 10) / 10 # round to 1dp
|
||||
|
||||
switch task.type
|
||||
|
|
|
|||
Loading…
Reference in a new issue