fix(strength): Remove threat reduction, increase crit chance

Tweaks the STR attribute's algorithmic effects. (1) Task "redness" no longer declines faster with high STR. (2) The 3% chance of a critical hit is multiplied by a percentage factor equal to STR. (3) The value of STR in dealing damage to bosses is increased by 25% (.5% instead of .4%).

Fixes HabitRPG/habitrpg/#2464.
This commit is contained in:
Sabe Jones 2014-02-27 21:21:04 -06:00
parent 734d558580
commit b0f574d598
2 changed files with 9 additions and 14 deletions

View file

@ -12426,7 +12426,7 @@ var process=require("__browserify_process");(function() {
delta = 0;
calculateDelta = function() {
return _.times(options.times, function() {
var adjustAmt, currVal, nextDelta, _ref2, _ref3;
var currVal, nextDelta, _ref2, _ref3;
currVal = task.value < -47.27 ? -47.27 : task.value > 21.27 ? 21.27 : task.value;
nextDelta = Math.pow(0.9747, currVal) * (direction === 'down' ? -1 : 1);
@ -12446,15 +12446,13 @@ var process=require("__browserify_process");(function() {
if (user.preferences.automaticAllocation === true && user.preferences.allocationMode === 'taskbased' && !(task.type === 'todo' && direction === 'down')) {
user.stats.training[task.attribute] += nextDelta;
}
adjustAmt = nextDelta;
if (direction === 'up' && task.type !== 'reward' && !(task.type === 'habit' && !task.down)) {
adjustAmt = nextDelta * (1 + user._statsComputed.str * .004);
if (direction === 'up' && !(task.type === 'habit' && !task.down)) {
user.party.quest.progress.up = user.party.quest.progress.up || 0;
if ((_ref3 = task.type) === 'daily' || _ref3 === 'todo') {
user.party.quest.progress.up += adjustAmt;
user.party.quest.progress.up += nextDelta * (1 + (user._statsComputed.str / 200));
}
}
task.value += adjustAmt;
task.value += nextDelta;
}
return delta += nextDelta;
});
@ -12631,7 +12629,7 @@ var process=require("__browserify_process");(function() {
if (chance == null) {
chance = .03;
}
if (user.fns.predictableRandom() <= chance) {
if (user.fns.predictableRandom() <= chance * (1 + stat / 100)) {
return 1.5 + (.02 * user._statsComputed[stat]);
} else {
return 1;

View file

@ -793,16 +793,13 @@ api.wrap = (user, main=true) ->
unless task.type is 'reward'
if (user.preferences.automaticAllocation is true and user.preferences.allocationMode is 'taskbased' and !(task.type is 'todo' and direction is 'down')) then user.stats.training[task.attribute] += nextDelta
adjustAmt = nextDelta
# ===== STRENGTH =====
# (Only for up-scoring, ignore up-onlies and rewards)
# Note, we create a new val (adjustAmt) to add to task.value, since delta will be used in Exp & GP calculations - we don't want STR to bonus that
# TODO STR Improves the amount by which Dailies and +/- Habits decrease in threat when scored, by .25% per point.
if direction is 'up' and task.type != 'reward' and !(task.type is 'habit' and !task.down)
adjustAmt = nextDelta * (1 + user._statsComputed.str * .004)
if direction is 'up' and !(task.type is 'habit' and !task.down)
user.party.quest.progress.up = user.party.quest.progress.up || 0;
user.party.quest.progress.up += adjustAmt if task.type in ['daily','todo']
task.value += adjustAmt
user.party.quest.progress.up += (nextDelta * (1 + (user._statsComputed.str / 200))) if task.type in ['daily','todo']
task.value += nextDelta
delta += nextDelta
addPoints = ->
@ -943,7 +940,7 @@ api.wrap = (user, main=true) ->
x - Math.floor(x)
crit: (stat='str', chance=.03) ->
if user.fns.predictableRandom() <= chance then 1.5 + (.02*user._statsComputed[stat])
if user.fns.predictableRandom() <= chance*(1+stat/100) then 1.5 + (.02*user._statsComputed[stat])
else 1
###