mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-24 08:08:15 -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
|
||||
# or have the LevelSession object listen for all these events itself.
|
||||
|
||||
setSpells: (spells) ->
|
||||
@onSpellCreated spell: spell for spellKey, spell of spells
|
||||
|
||||
onSpellChanged: (e) ->
|
||||
return unless @onPoint()
|
||||
code = @session.get('code')
|
||||
|
@ -102,6 +105,7 @@ module.exports = class LevelBus extends Bus
|
|||
onSpellCreated: (e) ->
|
||||
return unless @onPoint()
|
||||
spellTeam = e.spell.team
|
||||
@teamSpellMap ?= {}
|
||||
@teamSpellMap[spellTeam] ?= []
|
||||
|
||||
unless e.spell.spellKey in @teamSpellMap[spellTeam]
|
||||
|
@ -109,8 +113,7 @@ module.exports = class LevelBus extends Bus
|
|||
@changedSessionProperties.teamSpells = true
|
||||
@session.set({'teamSpells': @teamSpellMap})
|
||||
@saveSession()
|
||||
|
||||
|
||||
@onSpellChanged e # Save the new spell to the session, too.
|
||||
|
||||
onScriptStateChanged: (e) ->
|
||||
return unless @onPoint()
|
||||
|
@ -236,10 +239,3 @@ module.exports = class LevelBus extends Bus
|
|||
destroy: ->
|
||||
@session.off 'change:multiplayer', @onMultiplayerChanged, @
|
||||
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.pos = pos ? @defaultPos()
|
||||
thang.pos.z = thang.depth / 2
|
||||
thang.shape = 'ellipsoid'
|
||||
thang.rotation = 0
|
||||
thang.action = 'idle'
|
||||
thang.setAction = (action) -> thang.action = action
|
||||
|
|
|
@ -7,7 +7,7 @@ block content
|
|||
!{description}
|
||||
|
||||
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
|
||||
|
||||
|
|
|
@ -393,7 +393,7 @@ module.exports = class PlayLevelView extends View
|
|||
register: ->
|
||||
@bus = LevelBus.get(@levelID, @session.id)
|
||||
@bus.setSession(@session)
|
||||
@bus.setTeamSpellMap @tome.teamSpellMap
|
||||
@bus.setSpells @tome.spells
|
||||
@bus.connect() if @session.get('multiplayer')
|
||||
|
||||
onSessionWillSave: (e) ->
|
||||
|
|
|
@ -62,7 +62,6 @@
|
|||
"sendwithus": "2.0.x",
|
||||
"aws-sdk":"~2.0.0",
|
||||
"bayesian-battle":"0.0.x",
|
||||
"hiredis":"",
|
||||
"redis": ""
|
||||
},
|
||||
"devDependencies": {
|
||||
|
@ -70,7 +69,7 @@
|
|||
"javascript-brunch": "> 1.0 < 1.8",
|
||||
"coffee-script-brunch": "https://github.com/brunch/coffee-script-brunch/tarball/master",
|
||||
"coffeelint-brunch": "> 1.0 < 1.8",
|
||||
"sass-brunch": "1.7.0",
|
||||
"sass-brunch": "~1.8.0",
|
||||
"css-brunch": "> 1.0 < 1.8",
|
||||
"jade-brunch": "> 1.0 < 1.8",
|
||||
"uglify-js-brunch": "~1.7.4",
|
||||
|
|
Loading…
Reference in a new issue