Added sync on mage fireball spell

This commit is contained in:
kholliday
2015-03-26 00:18:18 -05:00
parent 98220ed0e5
commit 258da77586
2 changed files with 10 additions and 6 deletions

View File

@@ -3,7 +3,7 @@ api = module.exports
moment = require 'moment' moment = require 'moment'
i18n = require './i18n.coffee' i18n = require './i18n.coffee'
t = (string, vars) -> t = (string, vars) ->
func = (lang) -> func = (lang) ->
vars ?= {a: 'a'} vars ?= {a: 'a'}
i18n.t(string, vars, lang) i18n.t(string, vars, lang)
func.i18nLangFunc = true #Trick to recognize this type of function func.i18nLangFunc = true #Trick to recognize this type of function
@@ -54,7 +54,7 @@ _.each api.mystery, (v,k)->v.key = k
gear = gear =
weapon: weapon:
base: base:
0: 0:
text: t('weaponBase0Text'), notes: t('weaponBase0Notes'), value:0 text: t('weaponBase0Text'), notes: t('weaponBase0Notes'), value:0
warrior: warrior:
0: text: t('weaponWarrior0Text'), notes: t('weaponWarrior0Notes'), value:1 0: text: t('weaponWarrior0Text'), notes: t('weaponWarrior0Notes'), value:1
@@ -395,7 +395,7 @@ gear =
spring2015Warrior: event: events.spring2015, specialClass: 'warrior', text: t('headAccessorySpecialSpring2015WarriorText'), notes: t('headAccessorySpecialSpring2015WarriorNotes'), value: 20 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 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 spring2015Healer: event: events.spring2015, specialClass: 'healer', text: t('headAccessorySpecialSpring2015HealerText'), notes: t('headAccessorySpecialSpring2015HealerNotes'), value: 20
mystery: mystery:
201403: text: t('headAccessoryMystery201403Text'), notes: t('headAccessoryMystery201403Notes'), mystery:'201403', value: 0 201403: text: t('headAccessoryMystery201403Text'), notes: t('headAccessoryMystery201403Notes'), mystery:'201403', value: 0
201404: text: t('headAccessoryMystery201404Text'), notes: t('headAccessoryMystery201404Notes'), mystery:'201404', value: 0 201404: text: t('headAccessoryMystery201404Text'), notes: t('headAccessoryMystery201404Notes'), mystery:'201404', value: 0
@@ -521,6 +521,9 @@ api.spells =
#console.log {bonus, expBonus:bonus,upBonus:bonus*.1} #console.log {bonus, expBonus:bonus,upBonus:bonus*.1}
user.stats.exp += diminishingReturns(bonus,75) user.stats.exp += diminishingReturns(bonus,75)
user.party.quest.progress.up += diminishingReturns(bonus*.1,50,30) user.party.quest.progress.up += diminishingReturns(bonus*.1,50,30)
#Sync the user stats to see if we level the user
req = { language: user.preferences.language }
user.fns.updateStats( user.stats , req )
mpheal: mpheal:
text: t('spellWizardMPHealText') text: t('spellWizardMPHealText')
@@ -773,7 +776,7 @@ api.spells =
target.markModified? 'items.special.valentineReceived' target.markModified? 'items.special.valentineReceived'
user.stats.gp -= 10 user.stats.gp -= 10
# Intercept all spells to reduce user.stats.mp after casting the spell # Intercept all spells to reduce user.stats.mp after casting the spell
_.each api.spells, (spellClass) -> _.each api.spells, (spellClass) ->
_.each spellClass, (spell, key) -> _.each spellClass, (spell, key) ->
@@ -1070,7 +1073,7 @@ api.quests =
gp: 25 gp: 25
exp: 125 exp: 125
unlock: t('questGryphonUnlockText') unlock: t('questGryphonUnlockText')
hedgehog: hedgehog:
text: t('questHedgehogText') text: t('questHedgehogText')
notes: t('questHedgehogNotes') notes: t('questHedgehogNotes')
@@ -1570,7 +1573,7 @@ api.quests =
gp: 31 gp: 31
exp: 200 exp: 200
unlock: t('questRockUnlockText') unlock: t('questRockUnlockText')
bunny: bunny:
text: t('questBunnyText') text: t('questBunnyText')
notes: t('questBunnyNotes') notes: t('questBunnyNotes')

View File

@@ -228,6 +228,7 @@ habitrpg.controller("RootCtrl", ['$scope', '$rootScope', '$location', 'User', '$
case 'party': msg = window.env.t('youCastParty', {spell: spell.text()});break; case 'party': msg = window.env.t('youCastParty', {spell: spell.text()});break;
} }
Notification.text(msg); Notification.text(msg);
User.sync();
}); });
} }