Press enter to start level, esc to skip real-time playback. Reduced likelihood of repetetive aural say messages. Updated required code for Bonemender.

This commit is contained in:
Nick Winter 2014-11-23 15:24:59 -08:00
parent e7a5cadfb0
commit 1cd781233c
4 changed files with 19 additions and 0 deletions

View file

@ -263,6 +263,7 @@ module.exports = LevelOptions =
'bonemender':
requiredGear: {waist: 'leather-belt', 'programming-book': 'programmaticon-ii', eyes: 'wooden-glasses', 'right-hand': 'enchanted-stick', 'left-hand': 'book-of-life-i', wrists: 'sundial-wristwatch'}
restrictedGear: {'left-hand': 'unholy-tome-i'}
requiredCode: ['canCast']
'coinucopia':
requiredGear: {'programming-book': 'programmaticon-i', feet: 'leather-boots', 'programming-book': 'programmaticon-ii', flag: 'basic-flags'}

View file

@ -692,6 +692,11 @@ module.exports = Lank = class Lank extends CocoClass
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()
@previouslySaidMessages[m] = t1
return true if t1 - t0 < 5 * 1000
false
playSounds: (withDelay=true, volume=1.0) ->

View file

@ -13,6 +13,9 @@ module.exports = class LevelLoadingView extends CocoView
subscriptions:
'level:loaded': 'onLevelLoaded' # If Level loads after level loading view.
shortcuts:
'enter': 'onEnterPressed'
afterRender: ->
super()
@$el.find('.tip.rare').remove() if _.random(1, 10) < 9
@ -76,6 +79,11 @@ module.exports = class LevelLoadingView extends CocoView
return if @destroyed
@unveil()
onEnterPressed: (e) ->
return unless @shownReady and not @$el.hasClass 'unveiled'
@startUnveiling()
@onClickStartLevel()
unveil: ->
return if @$el.hasClass 'unveiled'
@$el.addClass 'unveiled'

View file

@ -88,6 +88,7 @@ module.exports = class PlayLevelView extends RootView
shortcuts:
'ctrl+s': 'onCtrlS'
'esc': 'onEscapePressed'
# Initial Setup #############################################################
@ -389,6 +390,10 @@ module.exports = class PlayLevelView extends RootView
onCtrlS: (e) ->
e.preventDefault()
onEscapePressed: (e) ->
return unless @$el.hasClass 'real-time'
Backbone.Mediator.publish 'playback:stop-real-time-playback', {}
onLevelReloadFromData: (e) ->
isReload = Boolean @world
@setLevel e.level, e.supermodel