Upcoming ladder level Zero Sum equalizes all players' heroes and equipment.

This commit is contained in:
Nick Winter 2015-03-14 09:39:43 -07:00
parent 8b75da0040
commit 57e77a0cd7
4 changed files with 9 additions and 6 deletions

View file

@ -9,7 +9,6 @@ ThangType = require 'models/ThangType'
lastHeroesEarned = me.get('earned')?.heroes ? []
lastHeroesPurchased = me.get('purchased')?.heroes ? []
module.exports = class LevelSetupManager extends CocoClass
constructor: (@options) ->
@ -55,6 +54,10 @@ module.exports = class LevelSetupManager extends CocoClass
loadModals: ->
# build modals and prevent them from disappearing.
if @level.get('slug') is 'zero-sum'
@session.set 'heroConfig', {"thangType":"52fd1524c7e6cf99160e7bc9","inventory":{"misc-0":"53e2396a53457600003e3f0f","programming-book":"546e266e9df4a17d0d449be5","minion":"54eb5dbc49fa2d5c905ddf56","feet":"53e214f153457600003e3eab","right-hand":"544d88478494308424f56505","left-hand":"546375a43839c6e02811d311","wrists":"54693797a2b1f53ce79443e9","gloves":"5469425ca2b1f53ce7944421","torso":"546d4a549df4a17d0d449a97","neck":"54693274a2b1f53ce79443c9","eyes":"546941fda2b1f53ce794441d","head":"546d4ca19df4a17d0d449abf"}}
@onInventoryModalPlayClicked()
return
@heroesModal = new PlayHeroesModal({supermodel: @supermodel, session: @session, confirmButtonI18N: 'play.next', level: @level, hadEverChosenHero: @options.hadEverChosenHero})
@inventoryModal = new InventoryModal({supermodel: @supermodel, session: @session, level: @level})
@heroesModalDestroy = @heroesModal.destroy
@ -86,7 +89,6 @@ module.exports = class LevelSetupManager extends CocoClass
# @inventoryModal.onShown() # replace?
@playSound 'game-menu-open'
#- Modal events
onceHeroLoaded: (e) ->

View file

@ -432,8 +432,7 @@
subscription_required_to_play: "You'll need a subscription to play this level."
unlock_help_videos: "Subscribe to unlock all video tutorials."
# Accounts Subscription View
personal_sub: "Personal Subscription"
personal_sub: "Personal Subscription" # Accounts Subscription View below
loading_info: "Loading subscription information..."
managed_by: "Managed by"
will_be_cancelled: "Will be cancelled on"

View file

@ -270,7 +270,9 @@ module.exports = class PlayLevelView extends RootView
onSessionLoaded: (e) ->
Backbone.Mediator.publish "ipad:language-chosen", language: e.session.get('codeLanguage') ? "python"
# Just the level and session have been loaded by the level loader
if e.level.get('type', true) in ['hero', 'hero-ladder', 'hero-coop'] and not _.size e.session.get('heroConfig')?.inventory ? {}
if e.level.get('slug') is 'zero-sum'
e.session.set 'heroConfig', {"thangType":"52fd1524c7e6cf99160e7bc9","inventory":{"misc-0":"53e2396a53457600003e3f0f","programming-book":"546e266e9df4a17d0d449be5","minion":"54eb5dbc49fa2d5c905ddf56","feet":"53e214f153457600003e3eab","right-hand":"544d88478494308424f56505","left-hand":"546375a43839c6e02811d311","wrists":"54693797a2b1f53ce79443e9","gloves":"5469425ca2b1f53ce7944421","torso":"546d4a549df4a17d0d449a97","neck":"54693274a2b1f53ce79443c9","eyes":"546941fda2b1f53ce794441d","head":"546d4ca19df4a17d0d449abf"}}
else if e.level.get('type', true) in ['hero', 'hero-ladder', 'hero-coop'] and not _.size e.session.get('heroConfig')?.inventory ? {}
@setupManager?.destroy()
@setupManager = new LevelSetupManager({supermodel: @supermodel, levelID: @levelID, parent: @, session: @session})
@setupManager.open()

View file

@ -139,7 +139,7 @@ module.exports.getTwoGames = (req, res) ->
ogresGameID = req.body.ogresGameID
return if simulatorIsTooOld req, res
#ladderGameIDs = ['greed', 'criss-cross', 'brawlwood', 'dungeon-arena', 'gold-rush', 'sky-span'] # Let's not give any extra simulations to old ladders.
ladderGameIDs = ['dueling-grounds', 'cavern-survival', 'multiplayer-treasure-grove', 'harrowland']
ladderGameIDs = ['dueling-grounds', 'cavern-survival', 'multiplayer-treasure-grove', 'harrowland'] #, 'zero-sum']
levelID = _.sample ladderGameIDs
unless ogresGameID and humansGameID
async.map [{levelID: levelID, team: 'humans'}, {levelID: levelID, team: 'ogres'}], findRandomSession, (err, sessions) ->