mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-03-31 07:12:49 -04:00
Preparing for some of these new levels.
This commit is contained in:
parent
b74ad24aa8
commit
14e8f6a653
5 changed files with 156 additions and 47 deletions
app
lib/world
models
views
|
@ -99,9 +99,9 @@ module.exports = class World
|
|||
continueLaterFn = =>
|
||||
@loadFrames(loadedCallback, errorCallback, loadProgressCallback, preloadedCallback, skipDeferredLoading, loadUntilFrame) unless @destroyed
|
||||
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']
|
||||
if @levelID in ['the-first-kithmaze', 'haunted-kithmaze', 'the-second-kithmaze', 'the-final-kithmaze', 'the-gauntlet', 'winding-trail', 'thornbush-farm', 'a-fiery-trap']
|
||||
@realTimeSpeedFactor = 5
|
||||
else if @levelID in ['forgetful-gemsmith', 'descending-further', 'tactical-strike', 'kithgard-gates']
|
||||
else if @levelID in ['forgetful-gemsmith', 'descending-further', 'tactical-strike', 'kithgard-gates', 'ogre-encampment', 'woodland-cleaver', 'shield-rush', 'peasant-protection', 'munchkin-swarm']
|
||||
@realTimeSpeedFactor = 3
|
||||
else
|
||||
@realTimeSpeedFactor = 1
|
||||
|
|
|
@ -100,6 +100,7 @@ module.exports = class Level extends CocoModel
|
|||
levelThangComponent.config.pos ?= {}
|
||||
levelThangComponent.config.pos.x = placeholderConfig.pos.x
|
||||
levelThangComponent.config.pos.y = placeholderConfig.pos.y
|
||||
levelThangComponent.config.rotation = placeholderConfig.rotation
|
||||
else if placeholderConfig.team # Pull in Allied team
|
||||
levelThangComponent.config.team = placeholderConfig.team
|
||||
else if placeholderConfig.significantProperty # For levels where we cheat on what counts as an enemy
|
||||
|
|
|
@ -359,7 +359,7 @@ module.exports = class InventoryModal extends ModalView
|
|||
console.log 'Unequipping restricted item', restrictedGear[slot], 'for', slot, 'before level', @options.levelID
|
||||
@unequipItemFromSlot @$el.find(".item-slot[data-slot='#{slot}']")
|
||||
for slot, item of necessaryGear
|
||||
continue if item is 'leather-tunic' and inWorldMap # Don't tell them they need it until they need it in the level
|
||||
continue if item is 'leather-tunic' and inWorldMap and @options.levelID is 'the-raised-sword' # Don't tell them they need it until they need it in the level
|
||||
equipped = equipment[slot]
|
||||
continue if equipped and not ((item is 'builders-hammer' and equipped is gear['simple-sword']) or (item is 'leather-boots' and equipped is gear['simple-boots']))
|
||||
availableSlotSelector = "#available-equipment li[data-item-id='#{gear[item]}']"
|
||||
|
@ -372,7 +372,7 @@ module.exports = class InventoryModal extends ModalView
|
|||
@highlightElement (if inWorldMap then '#play-level-button' else '.overlaid-close-button'), duration: 5000
|
||||
$('#play-level-button').prop('disabled', @remainingRequiredEquipment.length > 0)
|
||||
|
||||
# Restrict available items to those that would be available by this item.
|
||||
# Restrict available items to those that would be available by this level.
|
||||
@allowedItems = []
|
||||
for level, items of requiredGearByLevel
|
||||
for slot, item of items
|
||||
|
@ -479,6 +479,11 @@ gear =
|
|||
'programmaticon-i': '53e4108204c00d4607a89f78'
|
||||
'crude-glasses': '53e238df53457600003e3f0b'
|
||||
'builders-hammer': '53f4e6e3d822c23505b74f42'
|
||||
'long-sword': '544d7d1f8494308424f564a3'
|
||||
'sundial-wristwatch': '53e2396a53457600003e3f0f'
|
||||
'bronze-shield': '544c310ae0017993fce214bf'
|
||||
'wooden-glasses': '53e2167653457600003e3eb3'
|
||||
'basic-flags': '545bacb41e649a4495f887da'
|
||||
|
||||
requiredGearByLevel =
|
||||
'dungeons-of-kithgard': {feet: 'simple-boots'}
|
||||
|
@ -506,8 +511,18 @@ requiredGearByLevel =
|
|||
'defense-of-plainswood': {feet: 'simple-boots', 'right-hand': 'builders-hammer'}
|
||||
'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'}
|
||||
'a-fiery-trap': {feet: 'leather-boots', torso: 'leather-tunic', waist: 'leather-belt', 'programming-book': 'programmaticon-i', eyes: 'crude-glasses', 'right-hand': 'simple-sword', 'left-hand': 'wooden-shield'}
|
||||
'ogre-encampment': {torso: 'leather-tunic', waist: 'leather-belt', 'programming-book': 'programmaticon-i', eyes: 'crude-glasses', 'right-hand': 'simple-sword', 'left-hand': 'wooden-shield'}
|
||||
'woodland-cleaver': {torso: 'leather-tunic', waist: 'leather-belt', 'programming-book': 'programmaticon-i', eyes: 'crude-glasses', 'right-hand': 'long-sword', 'left-hand': 'wooden-shield', wrists: 'sundial-wristwatch', feet: 'leather-boots'}
|
||||
'shield-rush': {torso: 'leather-tunic', waist: 'leather-belt', 'programming-book': 'programmaticon-i', eyes: 'crude-glasses', 'right-hand': 'long-sword', 'left-hand': 'bronze-shield', wrists: 'sundial-wristwatch'}
|
||||
'peasant-protection': {torso: 'leather-tunic', waist: 'leather-belt', 'programming-book': 'programmaticon-i', eyes: 'wooden-glasses', 'right-hand': 'long-sword', 'left-hand': 'bronze-shield', wrists: 'sundial-wristwatch'}
|
||||
'munchkin-swarm': {torso: 'leather-tunic', waist: 'leather-belt', 'programming-book': 'programmaticon-i', eyes: 'wooden-glasses', 'right-hand': 'long-sword', 'left-hand': 'bronze-shield', wrists: 'sundial-wristwatch'}
|
||||
'coinucopia': {'programming-book': 'programmaticon-i', feet: 'leather-boots', flag: 'basic-flags'}
|
||||
'copper-meadows': {'programming-book': 'programmaticon-i', feet: 'leather-boots', flag: 'basic-flags', eyes: 'wooden-glasses'}
|
||||
'drop-the-flag': {'programming-book': 'programmaticon-i', feet: 'leather-boots', flag: 'basic-flags', eyes: 'wooden-glasses', 'right-hand': 'builders-hammer'}
|
||||
'rich-forager': {'programming-book': 'programmaticon-i', feet: 'leather-boots', flag: 'basic-flags', eyes: 'wooden-glasses', torso: 'leather-tunic', 'right-hand': 'longsword', 'left-hand': 'bronze-shield'}
|
||||
'deadly-pursuit': {'programming-book': 'programmaticon-i', feet: 'leather-boots', flag: 'basic-flags', eyes: 'wooden-glasses', 'right-hand': 'builders-hammer'}
|
||||
'multiplayer-treasure-grove': {'programming-book': 'programmaticon-i', feet: 'leather-boots', flag: 'basic-flags', eyes: 'wooden-glasses', torso: 'leather-tunic'}
|
||||
|
||||
restrictedGearByLevel =
|
||||
'dungeons-of-kithgard': {feet: 'leather-boots'}
|
||||
|
@ -530,3 +545,10 @@ restrictedGearByLevel =
|
|||
'winding-trail': {feet: 'simple-boots', 'right-hand': 'simple-sword'}
|
||||
'thornbush-farm': {feet: 'simple-boots', 'right-hand': 'simple-sword'}
|
||||
'a-fiery-trap': {feet: 'simple-boots', 'right-hand': 'builders-hammer'}
|
||||
'ogre-encampment': {feet: 'simple-boots', 'right-hand': 'builders-hammer'}
|
||||
'woodland-cleaver': {feet: 'simple-boots', 'right-hand': 'simple-sword'}
|
||||
'shield-rush': {'left-hand': 'wooden-shield'}
|
||||
'peasant-protection': {eyes: 'crude-glasses'}
|
||||
'drop-the-flag': {'right-hand': 'longsword'}
|
||||
'rich-forager': {'right-hand': 'builders-hammer'}
|
||||
'deadly-pursuit': {'right-hand': 'longsword'}
|
||||
|
|
|
@ -949,55 +949,141 @@ forest = [
|
|||
id: 'a-fiery-trap'
|
||||
original: '5448330517d7283e051f9b9e'
|
||||
description: 'Patrol the village entrances, but stay defensive.'
|
||||
disabled: true
|
||||
disabled: not me.isAdmin()
|
||||
nextLevels:
|
||||
continue: 'ogre-encampment'
|
||||
x: 40.14
|
||||
y: 63.96
|
||||
}
|
||||
#{
|
||||
# name: ''
|
||||
# type: 'hero'
|
||||
# difficulty: 1
|
||||
# id: ''
|
||||
# description: ''
|
||||
# x: 58.46
|
||||
# y: 66.38
|
||||
# }
|
||||
#{
|
||||
# name: ''
|
||||
# type: 'hero'
|
||||
# difficulty: 1
|
||||
# id: ''
|
||||
# description: ''
|
||||
# x: 63.11
|
||||
# y: 62.74
|
||||
# }
|
||||
#{
|
||||
# name: ''
|
||||
# type: 'hero'
|
||||
# difficulty: 1
|
||||
# id: ''
|
||||
# description: ''
|
||||
# x: 69.19
|
||||
# y: 60.61
|
||||
# }
|
||||
#{
|
||||
# name: ''
|
||||
# type: 'hero'
|
||||
# difficulty: 1
|
||||
# id: ''
|
||||
# description: ''
|
||||
# x: 77.54
|
||||
# y: 65.94
|
||||
#}
|
||||
{
|
||||
name: 'Ogre Encampment'
|
||||
type: 'hero'
|
||||
difficulty: 1
|
||||
id: 'ogre-encampment'
|
||||
description: 'Recover stolen treasure from an ogre encampment.'
|
||||
disabled: not me.isAdmin()
|
||||
nextLevels:
|
||||
continue: 'woodland-cleaver'
|
||||
x: 46.48
|
||||
y: 70.92
|
||||
}
|
||||
{
|
||||
name: 'Woodland Cleaver'
|
||||
type: 'hero'
|
||||
difficulty: 1
|
||||
id: 'woodland-cleaver'
|
||||
description: 'Use your new cleave ability to fend off munchkins.'
|
||||
disabled: not me.isAdmin()
|
||||
nextLevels:
|
||||
continue: 'shield-rush'
|
||||
x: 52.32
|
||||
y: 70.80
|
||||
}
|
||||
{
|
||||
name: 'Shield Rush'
|
||||
type: 'hero'
|
||||
difficulty: 1
|
||||
id: 'shield-rush'
|
||||
description: 'Combine cleave and shield to endure an ogre onslaught.'
|
||||
disabled: not me.isAdmin()
|
||||
nextLevels:
|
||||
continue: 'peasant-protection'
|
||||
x: 58.54
|
||||
y: 66.73
|
||||
}
|
||||
{
|
||||
name: 'Peasant Protection'
|
||||
type: 'hero'
|
||||
difficulty: 1
|
||||
id: 'peasant-protection'
|
||||
description: 'Stay close to Victor.'
|
||||
disabled: not me.isAdmin()
|
||||
nextLevels:
|
||||
continue: 'munchkin-swarm'
|
||||
x: 64.37
|
||||
y: 62.18
|
||||
}
|
||||
{
|
||||
name: 'Munchkin Swarm'
|
||||
type: 'hero'
|
||||
difficulty: 1
|
||||
id: 'munchkin-swarm'
|
||||
description: 'they eerywhere'
|
||||
disabled: not me.isAdmin()
|
||||
nextLevels:
|
||||
continue: 'coinucopia'
|
||||
x: 71.19
|
||||
y: 63.61
|
||||
}
|
||||
{
|
||||
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
|
||||
disabled: not me.isAdmin()
|
||||
nextLevels:
|
||||
continue: 'copper-meadows'
|
||||
x: 77.54
|
||||
y: 65.94
|
||||
}
|
||||
{
|
||||
name: 'Copper Meadows'
|
||||
type: 'hero'
|
||||
difficulty: 1
|
||||
id: 'copper-meadows'
|
||||
description: 'grab the coins'
|
||||
disabled: not me.isAdmin()
|
||||
nextLevels:
|
||||
continue: 'drop-the-flag'
|
||||
x: 77.54
|
||||
y: 55.94
|
||||
}
|
||||
{
|
||||
name: 'Drop the Flag'
|
||||
type: 'hero'
|
||||
difficulty: 1
|
||||
id: 'drop-the-flag'
|
||||
description: 'it is hot'
|
||||
disabled: not me.isAdmin()
|
||||
nextLevels:
|
||||
continue: 'rich-forager'
|
||||
x: 77.54
|
||||
y: 50.94
|
||||
}
|
||||
{
|
||||
name: 'Rich Forager'
|
||||
type: 'hero'
|
||||
difficulty: 1
|
||||
id: 'rich-forager'
|
||||
description: 'if i were a rich man'
|
||||
disabled: not me.isAdmin()
|
||||
nextLevels:
|
||||
continue: 'deadly-pursuit'
|
||||
x: 77.54
|
||||
y: 45.94
|
||||
}
|
||||
{
|
||||
name: 'Deadly Pursuit'
|
||||
type: 'hero'
|
||||
difficulty: 1
|
||||
id: 'deadly-pursuit'
|
||||
description: 'what is a dirt nap? it is death.'
|
||||
disabled: not me.isAdmin()
|
||||
nextLevels:
|
||||
continue: 'multiplayer-treasure-grove'
|
||||
x: 77.54
|
||||
y: 40.94
|
||||
}
|
||||
{
|
||||
name: 'Multiplayer Treasure Grove'
|
||||
type: 'hero'
|
||||
difficulty: 1
|
||||
id: 'multiplayer-treasure-grove'
|
||||
description: 'show em who is the professional boss'
|
||||
disabled: not me.isAdmin()
|
||||
x: 77.54
|
||||
y: 35.94
|
||||
}
|
||||
{
|
||||
name: 'Dueling Grounds'
|
||||
|
|
|
@ -272,7 +272,7 @@ module.exports = class HeroVictoryModal extends ModalView
|
|||
|
||||
getNextLevelMap: ->
|
||||
# TODO: dynamically figure out which world map to return to
|
||||
if @level.get('slug') in ['kithgard-gates', 'defense-of-plainswood', 'winding-trail', 'thornbush-farm', 'a-fiery-trap']
|
||||
if @level.get('slug') in ['kithgard-gates', 'defense-of-plainswood', 'winding-trail', 'thornbush-farm', 'a-fiery-trap', 'ogre-encampment', 'woodland-cleaver', 'shield-rush', 'peasant-protection', 'munchkin-swarm', 'coinucopia', 'copper-meadows', 'drop-the-flag', 'rich-forager', 'deadly-pursuit', 'multiplayer-treasure-grove']
|
||||
return 'forest'
|
||||
return 'dungeon'
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue