add a bunch of possible shared items for now, will clean up later
@@ -0,0 +1,110 @@
|
||||
// Generated by CoffeeScript 1.4.0
|
||||
var HP, XP, priorityValue;
|
||||
|
||||
XP = 15;
|
||||
|
||||
HP = 2;
|
||||
|
||||
priorityValue = function(priority) {
|
||||
if (priority == null) {
|
||||
priority = '!';
|
||||
}
|
||||
switch (priority) {
|
||||
case '!':
|
||||
return 1;
|
||||
case '!!':
|
||||
return 1.5;
|
||||
case '!!!':
|
||||
return 2;
|
||||
default:
|
||||
return 1;
|
||||
}
|
||||
};
|
||||
|
||||
module.exports.tnl = function(level) {
|
||||
var value;
|
||||
if (level >= 100) {
|
||||
value = 0;
|
||||
} else {
|
||||
value = Math.round(((Math.pow(level, 2) * 0.25) + (10 * level) + 139.75) / 10) * 10;
|
||||
}
|
||||
return value;
|
||||
};
|
||||
|
||||
/*
|
||||
Calculates Exp modificaiton based on level and weapon strength
|
||||
{value} task.value for exp gain
|
||||
{weaponStrength) weapon strength
|
||||
{level} current user level
|
||||
{priority} user-defined priority multiplier
|
||||
*/
|
||||
|
||||
|
||||
module.exports.expModifier = function(value, weaponStr, level, priority) {
|
||||
var exp, str, strMod, totalStr;
|
||||
if (priority == null) {
|
||||
priority = '!';
|
||||
}
|
||||
str = (level - 1) / 2;
|
||||
totalStr = (str + weaponStr) / 100;
|
||||
strMod = 1 + totalStr;
|
||||
exp = value * XP * strMod * priorityValue(priority);
|
||||
return Math.round(exp);
|
||||
};
|
||||
|
||||
/*
|
||||
Calculates HP modification based on level and armor defence
|
||||
{value} task.value for hp loss
|
||||
{armorDefense} defense from armor
|
||||
{helmDefense} defense from helm
|
||||
{level} current user level
|
||||
{priority} user-defined priority multiplier
|
||||
*/
|
||||
|
||||
|
||||
module.exports.hpModifier = function(value, armorDef, helmDef, shieldDef, level, priority) {
|
||||
var def, defMod, hp, totalDef;
|
||||
if (priority == null) {
|
||||
priority = '!';
|
||||
}
|
||||
def = (level - 1) / 2;
|
||||
totalDef = (def + armorDef + helmDef + shieldDef) / 100;
|
||||
defMod = 1 - totalDef;
|
||||
hp = value * HP * defMod * priorityValue(priority);
|
||||
return Math.round(hp * 10) / 10;
|
||||
};
|
||||
|
||||
/*
|
||||
Future use
|
||||
{priority} user-defined priority multiplier
|
||||
*/
|
||||
|
||||
|
||||
module.exports.gpModifier = function(value, modifier, priority) {
|
||||
if (priority == null) {
|
||||
priority = '!';
|
||||
}
|
||||
return value * modifier * priorityValue(priority);
|
||||
};
|
||||
|
||||
/*
|
||||
Calculates the next task.value based on direction
|
||||
Uses a capped inverse log y=.95^x, y>= -5
|
||||
{currentValue} the current value of the task
|
||||
{direction} up or down
|
||||
*/
|
||||
|
||||
|
||||
module.exports.taskDeltaFormula = function(currentValue, direction) {
|
||||
var delta;
|
||||
if (currentValue < -47.27) {
|
||||
currentValue = -47.27;
|
||||
} else if (currentValue > 21.27) {
|
||||
currentValue = 21.27;
|
||||
}
|
||||
delta = Math.pow(0.9747, currentValue);
|
||||
if (direction === 'up') {
|
||||
return delta;
|
||||
}
|
||||
return -delta;
|
||||
};
|
||||
|
After Width: | Height: | Size: 789 B |
|
After Width: | Height: | Size: 2.0 KiB |
|
After Width: | Height: | Size: 387 B |
|
After Width: | Height: | Size: 729 B |
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 9.4 KiB |
|
After Width: | Height: | Size: 8.6 KiB |
|
After Width: | Height: | Size: 14 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 7.2 KiB |
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 7.6 KiB |
|
After Width: | Height: | Size: 194 KiB |
|
After Width: | Height: | Size: 2.1 KiB |
|
After Width: | Height: | Size: 189 KiB |
|
After Width: | Height: | Size: 3.2 KiB |
|
After Width: | Height: | Size: 3.3 KiB |
|
After Width: | Height: | Size: 2.9 KiB |
|
After Width: | Height: | Size: 3.4 KiB |
|
After Width: | Height: | Size: 4.1 KiB |
|
After Width: | Height: | Size: 2.3 KiB |
|
After Width: | Height: | Size: 2.4 KiB |
|
After Width: | Height: | Size: 2.4 KiB |
|
After Width: | Height: | Size: 2.3 KiB |
|
After Width: | Height: | Size: 2.4 KiB |
|
After Width: | Height: | Size: 2.3 KiB |
|
After Width: | Height: | Size: 2.3 KiB |
|
After Width: | Height: | Size: 2.0 KiB |
|
After Width: | Height: | Size: 2.2 KiB |
|
After Width: | Height: | Size: 2.4 KiB |
|
After Width: | Height: | Size: 2.2 KiB |
|
After Width: | Height: | Size: 2.0 KiB |
|
After Width: | Height: | Size: 2.1 KiB |
|
After Width: | Height: | Size: 2.0 KiB |
|
After Width: | Height: | Size: 2.0 KiB |
|
After Width: | Height: | Size: 2.0 KiB |
|
After Width: | Height: | Size: 2.0 KiB |
|
After Width: | Height: | Size: 2.4 KiB |
|
After Width: | Height: | Size: 2.0 KiB |
|
After Width: | Height: | Size: 1.8 KiB |
|
After Width: | Height: | Size: 2.6 KiB |
|
After Width: | Height: | Size: 2.6 KiB |
|
After Width: | Height: | Size: 2.6 KiB |
|
After Width: | Height: | Size: 2.5 KiB |
|
After Width: | Height: | Size: 2.6 KiB |
|
After Width: | Height: | Size: 2.5 KiB |
|
After Width: | Height: | Size: 2.5 KiB |
|
After Width: | Height: | Size: 2.3 KiB |
|
After Width: | Height: | Size: 2.5 KiB |
|
After Width: | Height: | Size: 2.7 KiB |
|
After Width: | Height: | Size: 2.8 KiB |
|
After Width: | Height: | Size: 2.9 KiB |
|
After Width: | Height: | Size: 2.9 KiB |
|
After Width: | Height: | Size: 2.7 KiB |
|
After Width: | Height: | Size: 2.9 KiB |
|
After Width: | Height: | Size: 2.7 KiB |
|
After Width: | Height: | Size: 2.7 KiB |
|
After Width: | Height: | Size: 2.5 KiB |
|
After Width: | Height: | Size: 2.7 KiB |
|
After Width: | Height: | Size: 3.0 KiB |
|
After Width: | Height: | Size: 2.3 KiB |
|
After Width: | Height: | Size: 2.3 KiB |
|
After Width: | Height: | Size: 2.2 KiB |
|
After Width: | Height: | Size: 2.3 KiB |
|
After Width: | Height: | Size: 2.3 KiB |
|
After Width: | Height: | Size: 2.3 KiB |
|
After Width: | Height: | Size: 2.2 KiB |
|
After Width: | Height: | Size: 1.9 KiB |
|
After Width: | Height: | Size: 2.2 KiB |
|
After Width: | Height: | Size: 2.3 KiB |
|
After Width: | Height: | Size: 2.3 KiB |
|
After Width: | Height: | Size: 2.2 KiB |
|
After Width: | Height: | Size: 2.2 KiB |
|
After Width: | Height: | Size: 2.2 KiB |
|
After Width: | Height: | Size: 2.3 KiB |
|
After Width: | Height: | Size: 2.3 KiB |
|
After Width: | Height: | Size: 2.1 KiB |
|
After Width: | Height: | Size: 2.0 KiB |
|
After Width: | Height: | Size: 2.2 KiB |
|
After Width: | Height: | Size: 2.6 KiB |
|
After Width: | Height: | Size: 2.0 KiB |
|
After Width: | Height: | Size: 2.1 KiB |
|
After Width: | Height: | Size: 2.0 KiB |
|
After Width: | Height: | Size: 2.0 KiB |
|
After Width: | Height: | Size: 2.1 KiB |
|
After Width: | Height: | Size: 2.0 KiB |
|
After Width: | Height: | Size: 1.9 KiB |
|
After Width: | Height: | Size: 1.8 KiB |
|
After Width: | Height: | Size: 2.0 KiB |
|
After Width: | Height: | Size: 2.3 KiB |
|
After Width: | Height: | Size: 2.2 KiB |
|
After Width: | Height: | Size: 2.5 KiB |
|
After Width: | Height: | Size: 2.6 KiB |
|
After Width: | Height: | Size: 2.4 KiB |
|
After Width: | Height: | Size: 2.5 KiB |