mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-28 10:06:08 -05:00
Merge branch 'master' of https://github.com/codecombat/codecombat
This commit is contained in:
commit
f4084ba5cc
5 changed files with 9 additions and 13 deletions
|
@ -87,6 +87,9 @@ module.exports = class LevelBus extends Bus
|
||||||
# LevelSession object. Either break this off into a separate class
|
# LevelSession object. Either break this off into a separate class
|
||||||
# or have the LevelSession object listen for all these events itself.
|
# or have the LevelSession object listen for all these events itself.
|
||||||
|
|
||||||
|
setSpells: (spells) ->
|
||||||
|
@onSpellCreated spell: spell for spellKey, spell of spells
|
||||||
|
|
||||||
onSpellChanged: (e) ->
|
onSpellChanged: (e) ->
|
||||||
return unless @onPoint()
|
return unless @onPoint()
|
||||||
code = @session.get('code')
|
code = @session.get('code')
|
||||||
|
@ -102,6 +105,7 @@ module.exports = class LevelBus extends Bus
|
||||||
onSpellCreated: (e) ->
|
onSpellCreated: (e) ->
|
||||||
return unless @onPoint()
|
return unless @onPoint()
|
||||||
spellTeam = e.spell.team
|
spellTeam = e.spell.team
|
||||||
|
@teamSpellMap ?= {}
|
||||||
@teamSpellMap[spellTeam] ?= []
|
@teamSpellMap[spellTeam] ?= []
|
||||||
|
|
||||||
unless e.spell.spellKey in @teamSpellMap[spellTeam]
|
unless e.spell.spellKey in @teamSpellMap[spellTeam]
|
||||||
|
@ -109,8 +113,7 @@ module.exports = class LevelBus extends Bus
|
||||||
@changedSessionProperties.teamSpells = true
|
@changedSessionProperties.teamSpells = true
|
||||||
@session.set({'teamSpells': @teamSpellMap})
|
@session.set({'teamSpells': @teamSpellMap})
|
||||||
@saveSession()
|
@saveSession()
|
||||||
|
@onSpellChanged e # Save the new spell to the session, too.
|
||||||
|
|
||||||
|
|
||||||
onScriptStateChanged: (e) ->
|
onScriptStateChanged: (e) ->
|
||||||
return unless @onPoint()
|
return unless @onPoint()
|
||||||
|
@ -236,10 +239,3 @@ module.exports = class LevelBus extends Bus
|
||||||
destroy: ->
|
destroy: ->
|
||||||
@session.off 'change:multiplayer', @onMultiplayerChanged, @
|
@session.off 'change:multiplayer', @onMultiplayerChanged, @
|
||||||
super()
|
super()
|
||||||
|
|
||||||
setTeamSpellMap: (spellMap) ->
|
|
||||||
@teamSpellMap = spellMap
|
|
||||||
console.log @teamSpellMap
|
|
||||||
@changedSessionProperties.teamSpells = true
|
|
||||||
@session.set({'teamSpells': @teamSpellMap})
|
|
||||||
@saveSession()
|
|
||||||
|
|
|
@ -22,6 +22,7 @@ module.exports = IndieSprite = class IndieSprite extends CocoSprite
|
||||||
thang.width = thang.height = thang.depth = 4
|
thang.width = thang.height = thang.depth = 4
|
||||||
thang.pos = pos ? @defaultPos()
|
thang.pos = pos ? @defaultPos()
|
||||||
thang.pos.z = thang.depth / 2
|
thang.pos.z = thang.depth / 2
|
||||||
|
thang.shape = 'ellipsoid'
|
||||||
thang.rotation = 0
|
thang.rotation = 0
|
||||||
thang.action = 'idle'
|
thang.action = 'idle'
|
||||||
thang.setAction = (action) -> thang.action = action
|
thang.setAction = (action) -> thang.action = action
|
||||||
|
|
|
@ -7,7 +7,7 @@ block content
|
||||||
!{description}
|
!{description}
|
||||||
|
|
||||||
if !me.get('anonymous')
|
if !me.get('anonymous')
|
||||||
a(href="http://www.youtube.com/watch?v=IFvfZiJGDsw&list=HL1392928835&feature=mh_lolz").intro-button.btn.btn-primary.btn-lg Watch the Video
|
//a(href="http://www.youtube.com/watch?v=IFvfZiJGDsw&list=HL1392928835&feature=mh_lolz").intro-button.btn.btn-primary.btn-lg Watch the Video
|
||||||
|
|
||||||
a(href="/play/level/ladder-tutorial").intro-button.btn.btn-primary.btn-lg Play the Tutorial
|
a(href="/play/level/ladder-tutorial").intro-button.btn.btn-primary.btn-lg Play the Tutorial
|
||||||
|
|
||||||
|
|
|
@ -393,7 +393,7 @@ module.exports = class PlayLevelView extends View
|
||||||
register: ->
|
register: ->
|
||||||
@bus = LevelBus.get(@levelID, @session.id)
|
@bus = LevelBus.get(@levelID, @session.id)
|
||||||
@bus.setSession(@session)
|
@bus.setSession(@session)
|
||||||
@bus.setTeamSpellMap @tome.teamSpellMap
|
@bus.setSpells @tome.spells
|
||||||
@bus.connect() if @session.get('multiplayer')
|
@bus.connect() if @session.get('multiplayer')
|
||||||
|
|
||||||
onSessionWillSave: (e) ->
|
onSessionWillSave: (e) ->
|
||||||
|
|
|
@ -62,7 +62,6 @@
|
||||||
"sendwithus": "2.0.x",
|
"sendwithus": "2.0.x",
|
||||||
"aws-sdk":"~2.0.0",
|
"aws-sdk":"~2.0.0",
|
||||||
"bayesian-battle":"0.0.x",
|
"bayesian-battle":"0.0.x",
|
||||||
"hiredis":"",
|
|
||||||
"redis": ""
|
"redis": ""
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
@ -70,7 +69,7 @@
|
||||||
"javascript-brunch": "> 1.0 < 1.8",
|
"javascript-brunch": "> 1.0 < 1.8",
|
||||||
"coffee-script-brunch": "https://github.com/brunch/coffee-script-brunch/tarball/master",
|
"coffee-script-brunch": "https://github.com/brunch/coffee-script-brunch/tarball/master",
|
||||||
"coffeelint-brunch": "> 1.0 < 1.8",
|
"coffeelint-brunch": "> 1.0 < 1.8",
|
||||||
"sass-brunch": "1.7.0",
|
"sass-brunch": "~1.8.0",
|
||||||
"css-brunch": "> 1.0 < 1.8",
|
"css-brunch": "> 1.0 < 1.8",
|
||||||
"jade-brunch": "> 1.0 < 1.8",
|
"jade-brunch": "> 1.0 < 1.8",
|
||||||
"uglify-js-brunch": "~1.7.4",
|
"uglify-js-brunch": "~1.7.4",
|
||||||
|
|
Loading…
Reference in a new issue