Started A/B test for whether the AnnouncesAction and take-damage audio help.
This commit is contained in:
parent
346ace6ac3
commit
4a659903fe
3 changed files with 26 additions and 4 deletions
app
|
@ -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)}
|
Backbone.Mediator.publish 'surface:gold-changed', {team: @thang.team, gold: gold, goldEarned: Math.floor(@thang.goldEarned ? 0)}
|
||||||
|
|
||||||
shouldMuteMessage: (m) ->
|
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 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 ?= {}
|
@previouslySaidMessages ?= {}
|
||||||
t0 = @previouslySaidMessages[m] ? 0
|
t0 = @previouslySaidMessages[m] ? 0
|
||||||
t1 = new Date()
|
t1 = new Date()
|
||||||
|
@ -704,7 +707,10 @@ module.exports = Lank = class Lank extends CocoClass
|
||||||
|
|
||||||
playSounds: (withDelay=true, volume=1.0) ->
|
playSounds: (withDelay=true, volume=1.0) ->
|
||||||
for event in @thang.currentEvents ? []
|
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
|
if event is 'pay-bounty-gold' and @thang.bountyGold > 25 and @thang.team isnt me.team
|
||||||
AudioPlayer.playInterfaceSound 'coin_1', 0.25
|
AudioPlayer.playInterfaceSound 'coin_1', 0.25
|
||||||
if @thang.actionActivated and (action = @thang.getActionName()) isnt 'say'
|
if @thang.actionActivated and (action = @thang.getActionName()) isnt 'say'
|
||||||
|
|
|
@ -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.push heroClass for heroClass, heroSlugs of ThangType.heroClasses when _.intersection(myHeroSlugs, heroSlugs).length
|
||||||
myHeroClasses
|
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: ->
|
getGemPromptGroup: ->
|
||||||
return @gemPromptGroup if @gemPromptGroup
|
return @gemPromptGroup if @gemPromptGroup
|
||||||
group = me.get('testGroupNumber') % 8
|
group = me.get('testGroupNumber') % 8
|
||||||
|
|
|
@ -270,6 +270,10 @@ module.exports = class HeroVictoryModal extends ModalView
|
||||||
levelLabel = xpEl.find('.level')
|
levelLabel = xpEl.find('.level')
|
||||||
utils.replaceText levelLabel, currentLevel
|
utils.replaceText levelLabel, currentLevel
|
||||||
|
|
||||||
|
if leveledUp and (not @displayedLevel or currentLevel > @displayedLevel)
|
||||||
|
@playSound 'level-up'
|
||||||
|
@displayedLevel = currentLevel
|
||||||
|
|
||||||
endSequentialAnimations: ->
|
endSequentialAnimations: ->
|
||||||
clearInterval @sequentialAnimationInterval
|
clearInterval @sequentialAnimationInterval
|
||||||
@animationComplete = true
|
@animationComplete = true
|
||||||
|
|
Reference in a new issue