Started A/B test for whether the AnnouncesAction and take-damage audio help.

This commit is contained in:
Nick Winter 2014-12-07 19:38:24 -08:00
parent 346ace6ac3
commit 4a659903fe
3 changed files with 26 additions and 4 deletions
app
lib/surface
models
views/play/level/modal

View file

@ -691,10 +691,13 @@ module.exports = Lank = class Lank extends CocoClass
Backbone.Mediator.publish 'surface:gold-changed', {team: @thang.team, gold: gold, goldEarned: Math.floor(@thang.goldEarned ? 0)}
shouldMuteMessage: (m) ->
if me.getAnnouncesActionAudioGroup() in ['no-audio', 'just-take-damage']
return true if m in ['moveRight', 'moveUp', 'moveDown', 'moveLeft']
return true if /^attack /.test m
return true if /^Repeating loop/.test m
return true if /^findNearestEnemy/.test m
return false if m in ['moveRight', 'moveUp', 'moveDown', 'moveLeft']
#return true if /^attack /.test m
#return true if /^Repeating loop/.test m
#return true if /^findNearestEnemy/.test m
@previouslySaidMessages ?= {}
t0 = @previouslySaidMessages[m] ? 0
t1 = new Date()
@ -704,7 +707,10 @@ module.exports = Lank = class Lank extends CocoClass
playSounds: (withDelay=true, volume=1.0) ->
for event in @thang.currentEvents ? []
@playSound event, withDelay, volume
if event is 'take-damage' and me.getAnnouncesActionAudioGroup() in ['no-audio', 'without-take-damage']
null # Skip playing it
else
@playSound event, withDelay, volume
if event is 'pay-bounty-gold' and @thang.bountyGold > 25 and @thang.team isnt me.team
AudioPlayer.playInterfaceSound 'coin_1', 0.25
if @thang.actionActivated and (action = @thang.getActionName()) isnt 'say'

View file

@ -103,6 +103,18 @@ module.exports = class User extends CocoModel
myHeroClasses.push heroClass for heroClass, heroSlugs of ThangType.heroClasses when _.intersection(myHeroSlugs, heroSlugs).length
myHeroClasses
getAnnouncesActionAudioGroup: ->
return @announcesActionAudioGroup if @announcesActionAudioGroup
group = me.get('testGroupNumber') % 4
@announcesActionAudioGroup = switch group
when 0 then 'all-audio'
when 1 then 'no-audio'
when 2 then 'just-take-damage'
when 3 then 'without-take-damage'
@announcesActionAudioGroup = 'all-audio' if me.isAdmin()
application.tracker.identify announcesActionAudioGroup: @announcesActionAudioGroup unless me.isAdmin()
@announcesActionAudioGroup
getGemPromptGroup: ->
return @gemPromptGroup if @gemPromptGroup
group = me.get('testGroupNumber') % 8

View file

@ -270,6 +270,10 @@ module.exports = class HeroVictoryModal extends ModalView
levelLabel = xpEl.find('.level')
utils.replaceText levelLabel, currentLevel
if leveledUp and (not @displayedLevel or currentLevel > @displayedLevel)
@playSound 'level-up'
@displayedLevel = currentLevel
endSequentialAnimations: ->
clearInterval @sequentialAnimationInterval
@animationComplete = true