mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-02-17 08:50:58 -05:00
Mark mirror match multiplayer levels complete on success
This commit is contained in:
parent
01c9948b5b
commit
9b990ba452
2 changed files with 7 additions and 0 deletions
|
@ -20,6 +20,7 @@ module.exports = class LevelBus extends Bus
|
|||
'tome:spell-changed': 'onSpellChanged'
|
||||
'tome:spell-created': 'onSpellCreated'
|
||||
'tome:cast-spells': 'onCastSpells'
|
||||
'tome:winnability-updated': 'onWinnabilityUpdated'
|
||||
'application:idle-changed': 'onIdleChanged'
|
||||
'goal-manager:new-goal-states': 'onNewGoalStates'
|
||||
'god:new-world-created': 'onNewWorldCreated'
|
||||
|
@ -119,6 +120,11 @@ module.exports = class LevelBus extends Bus
|
|||
@changedSessionProperties.state = true
|
||||
@saveSession()
|
||||
|
||||
onWinnabilityUpdated: (e) ->
|
||||
return unless @onPoint() and e.winnable
|
||||
return unless e.level.get('slug') in ['ace-of-coders'] # Mirror matches don't otherwise show victory, so we win here.
|
||||
@onVictory()
|
||||
|
||||
onNewWorldCreated: (e) ->
|
||||
return unless @onPoint()
|
||||
# Record the flag history.
|
||||
|
|
|
@ -136,6 +136,7 @@ module.exports =
|
|||
|
||||
'tome:winnability-updated': c.object {title: 'Winnability Updated', description: 'When we think we can now win (or can no longer win), we may want to emphasize the submit button versus the run button (or vice versa), so this fires when we get new goal states (even preloaded goal states) suggesting success or failure change.', required: ['winnable']},
|
||||
winnable: {type: 'boolean'}
|
||||
level: {type: 'object'}
|
||||
|
||||
# Problem Alert
|
||||
'tome:show-problem-alert': c.object {title: 'Show Problem Alert', description: 'A problem alert needs to be shown.', required: ['problem']},
|
||||
|
|
Loading…
Reference in a new issue