Merge remote-tracking branch 'upstream/develop' into rebalancing-2015-03
Conflicts: common/dist/scripts/habitrpg-shared.js common/script/content.coffee common/script/index.coffee
This commit is contained in:
@@ -397,7 +397,7 @@ gear =
|
||||
spring2015Warrior: event: events.spring2015, specialClass: 'warrior', text: t('headAccessorySpecialSpring2015WarriorText'), notes: t('headAccessorySpecialSpring2015WarriorNotes'), value: 20
|
||||
spring2015Mage: event: events.spring2015, specialClass: 'wizard', text: t('headAccessorySpecialSpring2015MageText'), notes: t('headAccessorySpecialSpring2015MageNotes'), value: 20
|
||||
spring2015Healer: event: events.spring2015, specialClass: 'healer', text: t('headAccessorySpecialSpring2015HealerText'), notes: t('headAccessorySpecialSpring2015HealerNotes'), value: 20
|
||||
|
||||
|
||||
mystery:
|
||||
201403: text: t('headAccessoryMystery201403Text'), notes: t('headAccessoryMystery201403Notes'), mystery:'201403', value: 0
|
||||
201404: text: t('headAccessoryMystery201404Text'), notes: t('headAccessoryMystery201404Notes'), mystery:'201404', value: 0
|
||||
@@ -524,6 +524,9 @@ api.spells =
|
||||
user.stats.exp += diminishingReturns(bonus,75)
|
||||
user.party.quest.progress.up ?= 0
|
||||
user.party.quest.progress.up += Math.ceil(user._statsComputed.int * .1)
|
||||
# Sync the user stats to see if we level the user
|
||||
req = { language: user.preferences.language }
|
||||
user.fns.updateStats( user.stats , req )
|
||||
|
||||
mpheal:
|
||||
text: t('spellWizardMPHealText')
|
||||
@@ -627,6 +630,9 @@ api.spells =
|
||||
bonus = calculateBonus(target.value, user._statsComputed.str, _crit)
|
||||
user.stats.exp += diminishingReturns(bonus, 75, 50)
|
||||
user.stats.gp += diminishingReturns(bonus, 18, 75)
|
||||
# Sync the user stats to see if we level the user
|
||||
req = { language: user.preferences.language }
|
||||
user.fns.updateStats( user.stats , req )
|
||||
|
||||
toolsOfTrade:
|
||||
text: t('spellRogueToolsOfTradeText')
|
||||
@@ -1114,7 +1120,7 @@ api.quests =
|
||||
gp: 25
|
||||
exp: 125
|
||||
unlock: t('questGryphonUnlockText')
|
||||
|
||||
|
||||
hedgehog:
|
||||
text: t('questHedgehogText')
|
||||
notes: t('questHedgehogNotes')
|
||||
@@ -1614,7 +1620,7 @@ api.quests =
|
||||
gp: 31
|
||||
exp: 200
|
||||
unlock: t('questRockUnlockText')
|
||||
|
||||
|
||||
bunny:
|
||||
text: t('questBunnyText')
|
||||
notes: t('questBunnyNotes')
|
||||
@@ -1743,6 +1749,16 @@ api.backgrounds =
|
||||
rolling_hills:
|
||||
text: t('backgroundRollingHillsText')
|
||||
notes: t('backgroundRollingHillsNotes')
|
||||
backgrounds042015:
|
||||
cherry_trees:
|
||||
text: t('backgroundCherryTreesText')
|
||||
notes: t('backgroundCherryTreesNotes')
|
||||
floral_meadow:
|
||||
text: t('backgroundFloralMeadowText')
|
||||
notes: t('backgroundFloralMeadowNotes')
|
||||
gumdrop_land:
|
||||
text: t('backgroundGumdropLandText')
|
||||
notes: t('backgroundGumdropLandNotes')
|
||||
|
||||
api.subscriptionBlocks =
|
||||
basic_earned: months:1, price:5
|
||||
|
||||
@@ -483,7 +483,7 @@ api.wrap = (user, main=true) ->
|
||||
task.value = 0
|
||||
user.stats.hp = 50
|
||||
cb? null, user
|
||||
ga?.event('purchase', 'reroll').send()
|
||||
ga?.event('behavior', 'gems', 'reroll').send()
|
||||
|
||||
rebirth: (req, cb, ga) ->
|
||||
# Cost is 8 Gems ($2)
|
||||
@@ -541,7 +541,7 @@ api.wrap = (user, main=true) ->
|
||||
user.stats.buffs = {}
|
||||
# user.markModified? 'stats'
|
||||
cb? null, user
|
||||
ga?.event('purchase', 'Rebirth').send()
|
||||
ga?.event('behavior', 'gems', 'rebirth').send()
|
||||
|
||||
allocateNow: (req, cb) ->
|
||||
_.times user.stats.points, user.fns.autoAllocate
|
||||
@@ -757,13 +757,13 @@ api.wrap = (user, main=true) ->
|
||||
user.items[type][key] = 0 unless user.items[type][key] > 0
|
||||
user.items[type][key]++
|
||||
cb? null, _.pick(user,$w 'items balance')
|
||||
ga?.event('purchase', key).send()
|
||||
ga?.event('behavior', 'gems', key).send()
|
||||
|
||||
releasePets: (req, cb) ->
|
||||
if user.balance < 1
|
||||
return cb? {code:401,message: i18n.t('notEnoughGems', req.language)}
|
||||
else
|
||||
user.balance--
|
||||
user.balance -= 1
|
||||
for pet of content.pets
|
||||
user.items.pets[pet] = 0
|
||||
if not user.achievements.beastMasterCount
|
||||
@@ -786,11 +786,12 @@ api.wrap = (user, main=true) ->
|
||||
cb? null, user
|
||||
|
||||
releaseBoth: (req, cb) ->
|
||||
if user.balance < 1.5
|
||||
if user.balance < 1.5 and not user.achievements.triadBingo
|
||||
return cb? {code:401,message: i18n.t('notEnoughGems', req.language)}
|
||||
else
|
||||
giveTriadBingo = true
|
||||
user.balance -= 1.5
|
||||
if not user.achievements.triadBingo
|
||||
user.balance -= 1.5
|
||||
user.items.currentMount = ""
|
||||
user.items.currentPet = ""
|
||||
for animal of content.pets
|
||||
@@ -905,7 +906,7 @@ api.wrap = (user, main=true) ->
|
||||
user.balance -= cost
|
||||
user.markModified? 'purchased'
|
||||
cb? null, _.pick(user,$w 'purchased preferences')
|
||||
ga?.event('purchase', path).send()
|
||||
ga?.event('behavior', 'gems', path).send()
|
||||
|
||||
# ------
|
||||
# Classes
|
||||
@@ -944,7 +945,7 @@ api.wrap = (user, main=true) ->
|
||||
user.balance -= .75
|
||||
_.merge user.stats, {str: 0, con: 0, per: 0, int: 0, points: api.capByLevel(user.stats.lvl)}
|
||||
user.flags.classSelected = false
|
||||
ga?.event('purchase', 'changeClass').send()
|
||||
ga?.event('behavior', 'gems', 'changeClass').send()
|
||||
#'stats.points': this is handled on the server
|
||||
cb? null, _.pick(user,$w 'stats flags items preferences')
|
||||
|
||||
@@ -1401,6 +1402,10 @@ api.wrap = (user, main=true) ->
|
||||
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.points < 0
|
||||
user.stats.points = 0
|
||||
# This happens after dropping level with Fix Character Values and perhaps from other causes.
|
||||
# TODO: Subtract points from attributes in the same manner as on death.
|
||||
user.stats.exp = stats.exp
|
||||
|
||||
# Set flags when they unlock features
|
||||
@@ -1593,7 +1598,7 @@ api.wrap = (user, main=true) ->
|
||||
# Analytics
|
||||
user.flags.cronCount?=0
|
||||
user.flags.cronCount++
|
||||
options.ga?.event('cron', user.flags.cronCount).send(); #TODO userId for cohort
|
||||
options.ga?.event('behavior', 'cron', 'cron', user.flags.cronCount).send(); #TODO userId for cohort
|
||||
|
||||
# After all is said and done, progress up user's effect on quest, return those values & reset the user's
|
||||
progress = user.party.quest.progress; _progress = _.cloneDeep progress
|
||||
|
||||
Reference in New Issue
Block a user