Plannable pickUpFlags support and fixes for playing Coinucopia.

This commit is contained in:
Nick Winter 2014-11-06 18:18:57 -08:00
parent 424c3a6d3e
commit 03852fb44f
8 changed files with 23 additions and 17 deletions

View file

@ -672,12 +672,12 @@ module.exports = Lank = class Lank extends CocoClass
# rather than an each-thang-that-shows-gold-per-team thing.
return unless @thang
return if @thang.gold is @lastGold
gold = Math.floor @thang.gold
gold = Math.floor @thang.gold ? 0
if @thang.world.age is 0
gold = @thang.world.initialTeamGold[@thang.team].gold
return if gold is @lastGold
@lastGold = gold
Backbone.Mediator.publish 'surface:gold-changed', {team: @thang.team, gold: gold, goldEarned: Math.floor(@thang.goldEarned)}
Backbone.Mediator.publish 'surface:gold-changed', {team: @thang.team, gold: gold, goldEarned: Math.floor(@thang.goldEarned ? 0)}
playSounds: (withDelay=true, volume=1.0) ->
for event in @thang.currentEvents ? []

View file

@ -353,7 +353,7 @@ module.exports = class LankBoss extends CocoClass
foundExactMatch = true
@pendingFlags.splice(i, 1)
@removeLank pendingFlag
e.sprite.sprite.cursor = if @flagCursorLank then 'crosshair' else 'pointer'
e.sprite.sprite?.cursor = if @flagCursorLank then 'crosshair' else 'pointer'
null
onRemoveSelectedFlag: (e) ->

View file

@ -101,7 +101,7 @@ module.exports = class World
if @realTime and not @countdownFinished
if @levelID in ['the-first-kithmaze', 'haunted-kithmaze', 'the-second-kithmaze', 'the-final-kithmaze', 'the-gauntlet', 'winding-trail', 'thornbush-farm']
@realTimeSpeedFactor = 5
else if @levelID in ['forgotten-gemsmith', 'descending-further', 'tactical-strike', 'kithgard-gates']
else if @levelID in ['forgetful-gemsmith', 'descending-further', 'tactical-strike', 'kithgard-gates']
@realTimeSpeedFactor = 3
else
@realTimeSpeedFactor = 1

View file

@ -108,6 +108,8 @@ module.exports = class Level extends CocoModel
# Take the ThangType default Programmable and merge level-specific Component config into it
copy = $.extend true, {}, placeholderConfig
levelThangComponent.config = _.merge copy, levelThangComponent.config
else if placeholderConfig.extraHUDProperties
levelThangComponent.config.extraHUDProperties = _.union(levelThangComponent.config.extraHUDProperties ? [], placeholderConfig.extraHUDProperties)
if isHero
if equips = _.find levelThang.components, {original: LevelComponent.EquipsID}

View file

@ -5,7 +5,8 @@
display: none
position: absolute
right: 46%
top: 42px
top: 62px
z-index: 6
@include transition(box-shadow .2s linear)
@include user-select(none)
padding: 4px
@ -17,7 +18,7 @@
box-shadow: 2px 2px 2px black
.team-gold
font-size: 16px
font-size: 18px
margin: 0
line-height: 20px
color: hsla(205,0%,51%,1)

View file

@ -507,6 +507,7 @@ requiredGearByLevel =
'winding-trail': {feet: 'leather-boots', 'right-hand': 'builders-hammer'}
'thornbush-farm': {feet: 'leather-boots', 'right-hand': 'builders-hammer', eyes: 'crude-glasses'}
'a-fiery-trap': {feet: 'leather-boots', 'right-hand': 'builders-hammer', eyes: 'crude-glasses'}
'coinucopia': {feet: 'leather-boots', flag: 'basic-flags'}
restrictedGearByLevel =
'dungeons-of-kithgard': {feet: 'leather-boots'}

View file

@ -87,6 +87,7 @@ module.exports = class WorldMapView extends RootView
window.levelUnlocksNotWorking = true if level.locked and level.id is @nextLevel # Temporary
level.locked = false if window.levelUnlocksNotWorking # Temporary; also possible in HeroVictoryModal
level.locked = false if @levelStatusMap[level.id] in ['started', 'complete']
level.disabled = false if @levelStatusMap[level.id] in ['started', 'complete']
level.color = 'rgb(255, 80, 60)'
if level.practice
level.color = 'rgb(80, 130, 200)' unless me.getBranchingGroup() is 'all-practice'
@ -988,15 +989,16 @@ forest = [
# x: 77.54
# y: 65.94
#}
#{
# name: ''
# type: 'hero'
# difficulty: 1
# id: ''
# description: ''
# x: 84.29
# y: 61.23
#}
{
name: 'Coinucopia'
type: 'hero'
difficulty: 1
id: 'coinucopia'
description: 'Start playing in real-time with input flags as you collect gold coins!'
x: 58.54
y: 66.73
disabled: true
}
{
name: 'Dueling Grounds'
type: 'hero-ladder'

View file

@ -189,7 +189,7 @@ module.exports = class PlayLevelView extends RootView
@world = @levelLoader.world
@level = @levelLoader.level
@$el.addClass 'hero' if @level.get('type', true) in ['hero', 'hero-ladder', 'hero-coop']
@$el.addClass 'flags' if @level.get('slug') is 'sky-span' or (@level.get('type', true) in ['hero-ladder', 'hero-coop']) # TODO: figure out when the player has flags.
@$el.addClass 'flags' if (@level.get('slug') in ['sky-span', 'coinucopia']) or (@level.get('type', true) in ['hero-ladder', 'hero-coop']) # TODO: figure out when the player has flags.
@otherSession = @levelLoader.opponentSession
@worldLoadFakeResources = [] # first element (0) is 1%, last (100) is 100%
for percent in [1 .. 100]
@ -243,7 +243,7 @@ module.exports = class PlayLevelView extends RootView
@insertSubView @tome = new TomeView levelID: @levelID, session: @session, otherSession: @otherSession, thangs: @world.thangs, supermodel: @supermodel, level: @level
@insertSubView new LevelPlaybackView session: @session, levelID: @levelID, level: @level
@insertSubView new GoalsView {}
@insertSubView new LevelFlagsView world: @world if @levelID is 'sky-span' or @level.get('type', true) in ['hero-ladder', 'hero-coop'] # TODO: figure out when flags are available
@insertSubView new LevelFlagsView world: @world if (@levelID in ['sky-span', 'coinucopia']) or @level.get('type', true) in ['hero-ladder', 'hero-coop'] # TODO: figure out when flags are available
@insertSubView new GoldView {}
@insertSubView new HUDView {level: @level}
@insertSubView new ChatView levelID: @levelID, sessionID: @session.id, session: @session