Merge branch 'master' into production

This commit is contained in:
Nick Winter 2016-01-20 09:34:59 -08:00
commit 1a20d3fab6
3 changed files with 9 additions and 9 deletions

View file

@ -15,7 +15,7 @@ module.exports = class Label extends CocoClass
@sprite = options.sprite @sprite = options.sprite
@camera = options.camera @camera = options.camera
@layer = options.layer @layer = options.layer
@style = options.style ? Label.STYLE_SAY @style = options.style ? (@sprite?.thang?.labelStyle || Label.STYLE_SAY)
console.error @toString(), 'needs a sprite.' unless @sprite console.error @toString(), 'needs a sprite.' unless @sprite
console.error @toString(), 'needs a camera.' unless @camera console.error @toString(), 'needs a camera.' unless @camera
console.error @toString(), 'needs a layer.' unless @layer console.error @toString(), 'needs a layer.' unless @layer

View file

@ -684,7 +684,10 @@ module.exports = Lank = class Lank extends CocoClass
return unless @thang return unless @thang
blurb = if @thang.health <= 0 then null else @thang.sayMessage # Dead men tell no tales blurb = if @thang.health <= 0 then null else @thang.sayMessage # Dead men tell no tales
blurb = null if blurb in ['For Thoktar!', 'Bones!', 'Behead!', 'Destroy!', 'Die, humans!'] # Let's just hear, not see, these ones. blurb = null if blurb in ['For Thoktar!', 'Bones!', 'Behead!', 'Destroy!', 'Die, humans!'] # Let's just hear, not see, these ones.
labelStyle = if /Hero Placeholder/.test(@thang.id) then Label.STYLE_DIALOGUE else Label.STYLE_SAY if /Hero Placeholder/.test(@thang.id)
labelStyle = Label.STYLE_DIALOGUE
else
labelStyle = @thang.labelStyle ? Label.STYLE_SAY
@addLabel 'say', labelStyle if blurb @addLabel 'say', labelStyle if blurb
if @labels.say?.setText blurb if @labels.say?.setText blurb
@notifySpeechUpdated blurb: blurb @notifySpeechUpdated blurb: blurb

View file

@ -44,13 +44,10 @@ module.exports.calculateSessionScores = (callback) ->
sessionIDs = _.map @clientResponseObject.sessions, 'sessionID' sessionIDs = _.map @clientResponseObject.sessions, 'sessionID'
async.map sessionIDs, retrieveOldSessionData.bind(@), (err, oldScores) => async.map sessionIDs, retrieveOldSessionData.bind(@), (err, oldScores) =>
if err? then return callback err, {error: 'There was an error retrieving the old scores'} if err? then return callback err, {error: 'There was an error retrieving the old scores'}
try oldScoreArray = _.toArray putRankingFromMetricsIntoScoreObject @clientResponseObject, oldScores
oldScoreArray = _.toArray putRankingFromMetricsIntoScoreObject @clientResponseObject, oldScores newScoreArray = updatePlayerSkills oldScoreArray
newScoreArray = updatePlayerSkills oldScoreArray createSessionScoreUpdate.call @, scoreObject for scoreObject in newScoreArray
createSessionScoreUpdate.call @, scoreObject for scoreObject in newScoreArray callback null, newScoreArray
callback err, newScoreArray
catch e
callback e
retrieveOldSessionData = (sessionID, callback) -> retrieveOldSessionData = (sessionID, callback) ->
formatOldScoreObject = (session) => formatOldScoreObject = (session) =>