level 100 modal strings and removing level cap

This commit is contained in:
deilann
2014-05-11 07:53:31 -07:00
parent ca4f88754f
commit 5fd1f2eb0f
2 changed files with 37 additions and 28 deletions
+30 -27
View File
@@ -66,8 +66,7 @@ api.shouldDo = (day, repeat, options={}) ->
###
api.tnl = (lvl) ->
if lvl >= 100 then 0
else Math.round(((Math.pow(lvl, 2) * 0.25) + (10 * lvl) + 139.75) / 10) * 10
Math.round(((Math.pow(lvl, 2) * 0.25) + (10 * lvl) + 139.75) / 10) * 10
# round to nearest 10?
###
@@ -430,7 +429,10 @@ api.wrap = (user, main=true) ->
if user.stats.lvl < 100
user.balance -= 2
# Save off user's level, for calculating achievement eligibility later
lvl = user.stats.lvl
if user.stats.lvl < 100
lvl = user.stats.lvl
else
lvl = 100
# Turn tasks yellow, zero out streaks
_.each user.tasks, (task) ->
unless task.type is 'reward'
@@ -1099,30 +1101,23 @@ api.wrap = (user, main=true) ->
user.stats.gp = if stats.gp >= 0 then stats.gp else 0
tnl = api.tnl(user.stats.lvl)
# if we're at level 100, turn xp to gold
if user.stats.lvl >= 100
stats.gp += stats.exp / 15
stats.exp = 0
user.stats.lvl = 100
else
# level up & carry-over exp
if stats.exp >= tnl
#silent = true # push through the negative xp silently
user.stats.exp = stats.exp # push normal + notification
while stats.exp >= tnl and user.stats.lvl < 100 # keep levelling up
stats.exp -= tnl
user.stats.lvl++
tnl = api.tnl(user.stats.lvl)
# level up & carry-over exp
if stats.exp >= tnl
#silent = true # push through the negative xp silently
user.stats.exp = stats.exp # push normal + notification
while stats.exp >= tnl # keep levelling up
stats.exp -= tnl
user.stats.lvl++
tnl = api.tnl(user.stats.lvl)
# Auto-allocate a point, or give them a new manual point
if user.preferences.automaticAllocation
user.fns.autoAllocate()
else
# add new allocatable points. We could do user.stats.points++, but this does a fail-safe just in case
user.stats.points = user.stats.lvl - (user.stats.con + user.stats.str + user.stats.per + user.stats.int);
# Auto-allocate a point, or give them a new manual point
if user.preferences.automaticAllocation
user.fns.autoAllocate()
else
# add new allocatable points. We could do user.stats.points++, but this does a fail-safe just in case
user.stats.points = user.stats.lvl - (user.stats.con + user.stats.str + user.stats.per + user.stats.int);
if user.stats.lvl == 100
stats.exp = 0
user.stats.hp = 50
user.stats.exp = stats.exp
@@ -1149,6 +1144,8 @@ api.wrap = (user, main=true) ->
dialog: i18n.t('messageFoundQuest', {questText: content.quests.vice1.text(req.language)}, req.language)
if !user.flags.rebirthEnabled and (user.stats.lvl >= 50 or user.achievements.ultimateGear or user.achievements.beastMaster)
user.flags.rebirthEnabled = true
if !user.flags.freeRebirth = true and user.stats.lvl >= 100
user.flags.freeRebirth = true
###
------------------------------------------------------
@@ -1259,7 +1256,10 @@ api.wrap = (user, main=true) ->
if perfect
user.achievements.perfect ?= 0
user.achievements.perfect++
lvlDiv2 = Math.ceil(user.stats.lvl/2)
if user.stats.lvl < 100
lvlDiv2 = Math.ceil(user.stats.lvl/2)
else
lvlDiv2 = 50
{str:lvlDiv2,int:lvlDiv2,per:lvlDiv2,con:lvlDiv2,stealth:0,streaks:false}
else clearBuffs
@@ -1343,7 +1343,10 @@ api.wrap = (user, main=true) ->
else
+val[stat] or 0
, 0
m[stat] += (user.stats.lvl - 1) / 2
if user.stats.lvl < 100
m[stat] += (user.stats.lvl - 1) / 2
else
m[stat] += 50
m
, {}
computed.maxMP = computed.int*2 + 30