add a bunch of possible shared items for now, will clean up later
110
algos.js
Normal file
|
|
@ -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;
|
||||
};
|
||||
BIN
favicon.ico
Normal file
|
After Width: | Height: | Size: 789 B |
BIN
img/add.png
Normal file
|
After Width: | Height: | Size: 2 KiB |
BIN
img/calendar_google.png
Normal file
|
After Width: | Height: | Size: 387 B |
BIN
img/calendar_ical.png
Normal file
|
After Width: | Height: | Size: 729 B |
BIN
img/coin_single_gold.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
img/coin_single_silver.png
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
img/facebook-login-register.jpeg
Normal file
|
After Width: | Height: | Size: 9.4 KiB |
BIN
img/glyphicons-halflings-white.png
Normal file
|
After Width: | Height: | Size: 8.6 KiB |
BIN
img/glyphicons-halflings.png
Normal file
|
After Width: | Height: | Size: 14 KiB |
BIN
img/logo/habitrpg.jpg
Normal file
|
After Width: | Height: | Size: 28 KiB |
BIN
img/logo/habitrpg_pixel.png
Normal file
|
After Width: | Height: | Size: 7.2 KiB |
BIN
img/original_user.png
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
BIN
img/party-unlocked.png
Normal file
|
After Width: | Height: | Size: 7.6 KiB |
BIN
img/play_screenshot.jpeg
Normal file
|
After Width: | Height: | Size: 194 KiB |
BIN
img/remove.png
Normal file
|
After Width: | Height: | Size: 2.1 KiB |
BIN
img/screenshot.jpeg
Normal file
|
After Width: | Height: | Size: 189 KiB |
BIN
img/sprites/Armor6_m.xcf
Normal file
BIN
img/sprites/Armor7_m.xcf
Normal file
BIN
img/sprites/Armor8_m.xcf
Normal file
BIN
img/sprites/Mount-Bear-Base.png
Normal file
|
After Width: | Height: | Size: 3.2 KiB |
BIN
img/sprites/Mount-Lion-Base.png
Normal file
|
After Width: | Height: | Size: 3.3 KiB |
BIN
img/sprites/Mount-Panda-Base.png
Normal file
|
After Width: | Height: | Size: 2.9 KiB |
BIN
img/sprites/Mount-PolarBear-Base.png
Normal file
|
After Width: | Height: | Size: 3.4 KiB |
BIN
img/sprites/Mount-Tiger-Base.png
Normal file
|
After Width: | Height: | Size: 4.1 KiB |
BIN
img/sprites/Pet-BearCub-Base.png
Normal file
|
After Width: | Height: | Size: 2.3 KiB |
BIN
img/sprites/Pet-BearCub-CottonCandyBlue.png
Normal file
|
After Width: | Height: | Size: 2.4 KiB |
BIN
img/sprites/Pet-BearCub-CottonCandyPink.png
Normal file
|
After Width: | Height: | Size: 2.4 KiB |
BIN
img/sprites/Pet-BearCub-Desert.png
Normal file
|
After Width: | Height: | Size: 2.3 KiB |
BIN
img/sprites/Pet-BearCub-Golden.png
Normal file
|
After Width: | Height: | Size: 2.4 KiB |
BIN
img/sprites/Pet-BearCub-Red.png
Normal file
|
After Width: | Height: | Size: 2.3 KiB |
BIN
img/sprites/Pet-BearCub-Shade.png
Normal file
|
After Width: | Height: | Size: 2.3 KiB |
BIN
img/sprites/Pet-BearCub-Skeleton.png
Normal file
|
After Width: | Height: | Size: 2 KiB |
BIN
img/sprites/Pet-BearCub-White.png
Normal file
|
After Width: | Height: | Size: 2.2 KiB |
BIN
img/sprites/Pet-BearCub-Zombie.png
Normal file
|
After Width: | Height: | Size: 2.4 KiB |
BIN
img/sprites/Pet-Cactus-Base.png
Normal file
|
After Width: | Height: | Size: 2.2 KiB |
BIN
img/sprites/Pet-Cactus-Chocolate.png
Normal file
|
After Width: | Height: | Size: 2 KiB |
BIN
img/sprites/Pet-Cactus-CottonCandyBlue.png
Normal file
|
After Width: | Height: | Size: 2.1 KiB |
BIN
img/sprites/Pet-Cactus-CottonCandyPink.png
Normal file
|
After Width: | Height: | Size: 2 KiB |
BIN
img/sprites/Pet-Cactus-Cream.png
Normal file
|
After Width: | Height: | Size: 2 KiB |
BIN
img/sprites/Pet-Cactus-Golden.png
Normal file
|
After Width: | Height: | Size: 2 KiB |
BIN
img/sprites/Pet-Cactus-Licorice.png
Normal file
|
After Width: | Height: | Size: 2 KiB |
BIN
img/sprites/Pet-Cactus-Rotten.png
Normal file
|
After Width: | Height: | Size: 2.4 KiB |
BIN
img/sprites/Pet-Cactus-Strawberry.png
Normal file
|
After Width: | Height: | Size: 2 KiB |
BIN
img/sprites/Pet-Cactus-SugarCube.png
Normal file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
img/sprites/Pet-Dragon-Base.png
Normal file
|
After Width: | Height: | Size: 2.6 KiB |
BIN
img/sprites/Pet-Dragon-CottonCandyBlue.png
Normal file
|
After Width: | Height: | Size: 2.6 KiB |
BIN
img/sprites/Pet-Dragon-CottonCandyPink.png
Normal file
|
After Width: | Height: | Size: 2.6 KiB |
BIN
img/sprites/Pet-Dragon-Desert.png
Normal file
|
After Width: | Height: | Size: 2.5 KiB |
BIN
img/sprites/Pet-Dragon-Golden.png
Normal file
|
After Width: | Height: | Size: 2.6 KiB |
BIN
img/sprites/Pet-Dragon-Red.png
Normal file
|
After Width: | Height: | Size: 2.5 KiB |
BIN
img/sprites/Pet-Dragon-Shade.png
Normal file
|
After Width: | Height: | Size: 2.5 KiB |
BIN
img/sprites/Pet-Dragon-Skeleton.png
Normal file
|
After Width: | Height: | Size: 2.3 KiB |
BIN
img/sprites/Pet-Dragon-White.png
Normal file
|
After Width: | Height: | Size: 2.5 KiB |
BIN
img/sprites/Pet-Dragon-Zombie.png
Normal file
|
After Width: | Height: | Size: 2.7 KiB |
BIN
img/sprites/Pet-FlyingPig-Base.png
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
img/sprites/Pet-FlyingPig-CottonCandyBlue.png
Normal file
|
After Width: | Height: | Size: 2.9 KiB |
BIN
img/sprites/Pet-FlyingPig-CottonCandyPink.png
Normal file
|
After Width: | Height: | Size: 2.9 KiB |
BIN
img/sprites/Pet-FlyingPig-Desert.png
Normal file
|
After Width: | Height: | Size: 2.7 KiB |
BIN
img/sprites/Pet-FlyingPig-Golden.png
Normal file
|
After Width: | Height: | Size: 2.9 KiB |
BIN
img/sprites/Pet-FlyingPig-Red.png
Normal file
|
After Width: | Height: | Size: 2.7 KiB |
BIN
img/sprites/Pet-FlyingPig-Shade.png
Normal file
|
After Width: | Height: | Size: 2.7 KiB |
BIN
img/sprites/Pet-FlyingPig-Skeleton.png
Normal file
|
After Width: | Height: | Size: 2.5 KiB |
BIN
img/sprites/Pet-FlyingPig-White.png
Normal file
|
After Width: | Height: | Size: 2.7 KiB |
BIN
img/sprites/Pet-FlyingPig-Zombie.png
Normal file
|
After Width: | Height: | Size: 3 KiB |
BIN
img/sprites/Pet-Fox-Base.png
Normal file
|
After Width: | Height: | Size: 2.3 KiB |
BIN
img/sprites/Pet-Fox-CottonCandyBlue.png
Normal file
|
After Width: | Height: | Size: 2.3 KiB |
BIN
img/sprites/Pet-Fox-CottonCandyPink.png
Normal file
|
After Width: | Height: | Size: 2.2 KiB |
BIN
img/sprites/Pet-Fox-Desert.png
Normal file
|
After Width: | Height: | Size: 2.3 KiB |
BIN
img/sprites/Pet-Fox-Golden.png
Normal file
|
After Width: | Height: | Size: 2.3 KiB |
BIN
img/sprites/Pet-Fox-Red.png
Normal file
|
After Width: | Height: | Size: 2.3 KiB |
BIN
img/sprites/Pet-Fox-Shade.png
Normal file
|
After Width: | Height: | Size: 2.2 KiB |
BIN
img/sprites/Pet-Fox-Skeleton.png
Normal file
|
After Width: | Height: | Size: 1.9 KiB |
BIN
img/sprites/Pet-Fox-White.png
Normal file
|
After Width: | Height: | Size: 2.2 KiB |
BIN
img/sprites/Pet-Fox-Zombie.png
Normal file
|
After Width: | Height: | Size: 2.3 KiB |
BIN
img/sprites/Pet-LionCub-Base.png
Normal file
|
After Width: | Height: | Size: 2.3 KiB |
BIN
img/sprites/Pet-LionCub-CottonCandyBlue.png
Normal file
|
After Width: | Height: | Size: 2.2 KiB |
BIN
img/sprites/Pet-LionCub-CottonCandyPink.png
Normal file
|
After Width: | Height: | Size: 2.2 KiB |
BIN
img/sprites/Pet-LionCub-Desert.png
Normal file
|
After Width: | Height: | Size: 2.2 KiB |
BIN
img/sprites/Pet-LionCub-Golden.png
Normal file
|
After Width: | Height: | Size: 2.3 KiB |
BIN
img/sprites/Pet-LionCub-Red.png
Normal file
|
After Width: | Height: | Size: 2.3 KiB |
BIN
img/sprites/Pet-LionCub-Shade.png
Normal file
|
After Width: | Height: | Size: 2.1 KiB |
BIN
img/sprites/Pet-LionCub-Skeleton.png
Normal file
|
After Width: | Height: | Size: 2 KiB |
BIN
img/sprites/Pet-LionCub-White.png
Normal file
|
After Width: | Height: | Size: 2.2 KiB |
BIN
img/sprites/Pet-LionCub-Zombie.png
Normal file
|
After Width: | Height: | Size: 2.6 KiB |
BIN
img/sprites/Pet-PandaCub-Base.png
Normal file
|
After Width: | Height: | Size: 2 KiB |
BIN
img/sprites/Pet-PandaCub-CottonCandyBlue.png
Normal file
|
After Width: | Height: | Size: 2.1 KiB |
BIN
img/sprites/Pet-PandaCub-CottonCandyPink.png
Normal file
|
After Width: | Height: | Size: 2 KiB |
BIN
img/sprites/Pet-PandaCub-Desert.png
Normal file
|
After Width: | Height: | Size: 2 KiB |
BIN
img/sprites/Pet-PandaCub-Golden.png
Normal file
|
After Width: | Height: | Size: 2.1 KiB |
BIN
img/sprites/Pet-PandaCub-Red.png
Normal file
|
After Width: | Height: | Size: 2 KiB |
BIN
img/sprites/Pet-PandaCub-Shade.png
Normal file
|
After Width: | Height: | Size: 1.9 KiB |
BIN
img/sprites/Pet-PandaCub-Skeleton.png
Normal file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
img/sprites/Pet-PandaCub-White.png
Normal file
|
After Width: | Height: | Size: 2 KiB |
BIN
img/sprites/Pet-PandaCub-Zombie.png
Normal file
|
After Width: | Height: | Size: 2.3 KiB |
BIN
img/sprites/Pet-PolarBearCub-Base.png
Normal file
|
After Width: | Height: | Size: 2.2 KiB |
BIN
img/sprites/Pet-TigerCub-Base.png
Normal file
|
After Width: | Height: | Size: 2.5 KiB |
BIN
img/sprites/Pet-TigerCub-CottonCandyBlue.png
Normal file
|
After Width: | Height: | Size: 2.6 KiB |
BIN
img/sprites/Pet-TigerCub-CottonCandyPink.png
Normal file
|
After Width: | Height: | Size: 2.4 KiB |
BIN
img/sprites/Pet-TigerCub-Desert.png
Normal file
|
After Width: | Height: | Size: 2.5 KiB |