diff --git a/app/lib/surface/Lank.coffee b/app/lib/surface/Lank.coffee index 82706f229..af43a2235 100644 --- a/app/lib/surface/Lank.coffee +++ b/app/lib/surface/Lank.coffee @@ -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' diff --git a/app/models/User.coffee b/app/models/User.coffee index e3bf5e798..51bae80a7 100644 --- a/app/models/User.coffee +++ b/app/models/User.coffee @@ -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 diff --git a/app/views/play/level/modal/HeroVictoryModal.coffee b/app/views/play/level/modal/HeroVictoryModal.coffee index d316a96ea..921d08c12 100644 --- a/app/views/play/level/modal/HeroVictoryModal.coffee +++ b/app/views/play/level/modal/HeroVictoryModal.coffee @@ -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