mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-28 18:15:52 -05:00
Merge branch 'master' into production
This commit is contained in:
commit
ad4a9d908d
6 changed files with 159 additions and 5 deletions
|
@ -6,8 +6,10 @@ CampaignList = require('views/play/WorldMapView').campaigns
|
||||||
options =
|
options =
|
||||||
'default':
|
'default':
|
||||||
autocompleteFontSizePx: 16
|
autocompleteFontSizePx: 16
|
||||||
|
backspaceThrottle: false
|
||||||
'dungeon':
|
'dungeon':
|
||||||
autocompleteFontSizePx: 20
|
autocompleteFontSizePx: 20
|
||||||
|
backspaceThrottle: true
|
||||||
|
|
||||||
module.exports = CampaignOptions =
|
module.exports = CampaignOptions =
|
||||||
getCampaignForSlug: (slug) ->
|
getCampaignForSlug: (slug) ->
|
||||||
|
|
|
@ -231,12 +231,37 @@ module.exports = LevelOptions =
|
||||||
'shield-rush':
|
'shield-rush':
|
||||||
requiredGear: {torso: 'tarnished-bronze-breastplate', waist: 'leather-belt', 'programming-book': 'programmaticon-ii', eyes: 'crude-glasses', 'right-hand': 'long-sword', 'left-hand': 'bronze-shield', wrists: 'sundial-wristwatch'}
|
requiredGear: {torso: 'tarnished-bronze-breastplate', waist: 'leather-belt', 'programming-book': 'programmaticon-ii', eyes: 'crude-glasses', 'right-hand': 'long-sword', 'left-hand': 'bronze-shield', wrists: 'sundial-wristwatch'}
|
||||||
restrictedGear: {'left-hand': 'wooden-shield'}
|
restrictedGear: {'left-hand': 'wooden-shield'}
|
||||||
|
|
||||||
|
# Warrior branch
|
||||||
'peasant-protection':
|
'peasant-protection':
|
||||||
requiredGear: {torso: 'tarnished-bronze-breastplate', waist: 'leather-belt', 'programming-book': 'programmaticon-ii', eyes: 'wooden-glasses', 'right-hand': 'long-sword', 'left-hand': 'bronze-shield', wrists: 'sundial-wristwatch'}
|
requiredGear: {torso: 'tarnished-bronze-breastplate', waist: 'leather-belt', 'programming-book': 'programmaticon-ii', eyes: 'wooden-glasses', 'right-hand': 'long-sword', 'left-hand': 'bronze-shield', wrists: 'sundial-wristwatch'}
|
||||||
restrictedGear: {eyes: 'crude-glasses'}
|
restrictedGear: {eyes: 'crude-glasses'}
|
||||||
'munchkin-swarm':
|
'munchkin-swarm':
|
||||||
requiredGear: {torso: 'tarnished-bronze-breastplate', waist: 'leather-belt', 'programming-book': 'programmaticon-ii', eyes: 'wooden-glasses', 'right-hand': 'long-sword', 'left-hand': 'bronze-shield', wrists: 'sundial-wristwatch'}
|
requiredGear: {torso: 'tarnished-bronze-breastplate', waist: 'leather-belt', 'programming-book': 'programmaticon-ii', eyes: 'wooden-glasses', 'right-hand': 'long-sword', 'left-hand': 'bronze-shield', wrists: 'sundial-wristwatch'}
|
||||||
restrictedGear: {}
|
restrictedGear: {}
|
||||||
|
|
||||||
|
# Ranger branch
|
||||||
|
'munchkin-harvest':
|
||||||
|
requiredGear: {torso: 'tarnished-bronze-breastplate', waist: 'leather-belt', 'programming-book': 'programmaticon-ii', eyes: 'wooden-glasses', 'right-hand': 'long-sword', 'left-hand': 'bronze-shield', wrists: 'sundial-wristwatch'}
|
||||||
|
restrictedGear: {}
|
||||||
|
'swift-dagger':
|
||||||
|
requiredGear: {waist: 'leather-belt', 'programming-book': 'programmaticon-ii', eyes: 'wooden-glasses', 'right-hand': 'crude-crossbow', 'left-hand': 'crude-dagger', wrists: 'sundial-wristwatch'}
|
||||||
|
restrictedGear: {eyes: 'crude-glasses'}
|
||||||
|
'shrapnel':
|
||||||
|
requiredGear: {waist: 'leather-belt', 'programming-book': 'programmaticon-ii', eyes: 'wooden-glasses', 'right-hand': 'crude-crossbow', 'left-hand': 'weak-charge', wrists: 'sundial-wristwatch'}
|
||||||
|
restrictedGear: {eyes: 'crude-glasses', 'left-hand': 'crude-dagger'}
|
||||||
|
|
||||||
|
# Wizard branch
|
||||||
|
'arcane-ally':
|
||||||
|
requiredGear: {torso: 'tarnished-bronze-breastplate', waist: 'leather-belt', 'programming-book': 'programmaticon-ii', eyes: 'wooden-glasses', 'right-hand': 'long-sword', 'left-hand': 'bronze-shield', wrists: 'sundial-wristwatch'}
|
||||||
|
restrictedGear: {eyes: 'crude-glasses'}
|
||||||
|
'touch-of-death':
|
||||||
|
requiredGear: {waist: 'leather-belt', 'programming-book': 'programmaticon-ii', eyes: 'wooden-glasses', 'right-hand': 'enchanted-stick', 'left-hand': 'unholy-tome-i', wrists: 'sundial-wristwatch'}
|
||||||
|
restrictedGear: {}
|
||||||
|
'bonemender':
|
||||||
|
requiredGear: {waist: 'leather-belt', 'programming-book': 'programmaticon-ii', eyes: 'wooden-glasses', 'right-hand': 'enchanted-stick', 'left-hand': 'book-of-life-i', wrists: 'sundial-wristwatch'}
|
||||||
|
restrictedGear: {'left-hand': 'unholy-tome-i'}
|
||||||
|
|
||||||
'coinucopia':
|
'coinucopia':
|
||||||
requiredGear: {'programming-book': 'programmaticon-i', feet: 'leather-boots', 'programming-book': 'programmaticon-ii', flag: 'basic-flags'}
|
requiredGear: {'programming-book': 'programmaticon-i', feet: 'leather-boots', 'programming-book': 'programmaticon-ii', flag: 'basic-flags'}
|
||||||
restrictedGear: {}
|
restrictedGear: {}
|
||||||
|
@ -255,3 +280,6 @@ module.exports = LevelOptions =
|
||||||
'multiplayer-treasure-grove':
|
'multiplayer-treasure-grove':
|
||||||
requiredGear: {'programming-book': 'programmaticon-i', feet: 'leather-boots', 'programming-book': 'programmaticon-ii', flag: 'basic-flags', eyes: 'wooden-glasses', torso: 'tarnished-bronze-breastplate'}
|
requiredGear: {'programming-book': 'programmaticon-i', feet: 'leather-boots', 'programming-book': 'programmaticon-ii', flag: 'basic-flags', eyes: 'wooden-glasses', torso: 'tarnished-bronze-breastplate'}
|
||||||
restrictedGear: {}
|
restrictedGear: {}
|
||||||
|
'siege-of-stonehold':
|
||||||
|
requiredGear: {}
|
||||||
|
restrictedGear: {}
|
||||||
|
|
|
@ -289,5 +289,4 @@ module.exports.ItemThangTypeNode = ItemThangTypeNode = class ItemThangTypeNode e
|
||||||
|
|
||||||
processThangType: (thangType) ->
|
processThangType: (thangType) ->
|
||||||
return unless itemComponent = _.find thangType.get('components'), {original: LevelComponent.ItemID}
|
return unless itemComponent = _.find thangType.get('components'), {original: LevelComponent.ItemID}
|
||||||
return unless itemComponent.config?.slots?.length
|
@constructor.thangTypes.push name: thangType.get('name'), original: thangType.get('original'), slots: itemComponent.config?.slots ? ['right-hand']
|
||||||
@constructor.thangTypes.push name: thangType.get('name'), original: thangType.get('original'), slots: itemComponent.config.slots
|
|
||||||
|
|
|
@ -84,7 +84,7 @@ module.exports = class InventoryModal extends ModalView
|
||||||
|
|
||||||
# sort into one of the four groups
|
# sort into one of the four groups
|
||||||
locked = not (item.get('original') in me.items())
|
locked = not (item.get('original') in me.items())
|
||||||
locked = false if me.get('slug') is 'nick'
|
#locked = false if me.get('slug') is 'nick'
|
||||||
|
|
||||||
if not item.getFrontFacingStats().props.length and not _.size(item.getFrontFacingStats().stats) and not locked # Temp: while there are placeholder items
|
if not item.getFrontFacingStats().props.length and not _.size(item.getFrontFacingStats().stats) and not locked # Temp: while there are placeholder items
|
||||||
null # Don't put into a collection
|
null # Don't put into a collection
|
||||||
|
@ -387,7 +387,9 @@ module.exports = class InventoryModal extends ModalView
|
||||||
console.log 'Unequipping restricted item', restrictedGear[slot], 'for', slot, 'before level', @options.levelID
|
console.log 'Unequipping restricted item', restrictedGear[slot], 'for', slot, 'before level', @options.levelID
|
||||||
@unequipItemFromSlot @$el.find(".item-slot[data-slot='#{slot}']")
|
@unequipItemFromSlot @$el.find(".item-slot[data-slot='#{slot}']")
|
||||||
delete equipment[slot]
|
delete equipment[slot]
|
||||||
if heroClass is 'Warrior'
|
if (heroClass is 'Warrior' or
|
||||||
|
(heroClass is 'Ranger' and @options.levelID in ['swift-dagger', 'shrapnel']) or
|
||||||
|
(heroClass is 'Wizard' and @options.levelID in ['touch-of-death', 'bonemender']))
|
||||||
# After they switch to a ranger or wizard, we stop being so finicky about gear.
|
# After they switch to a ranger or wizard, we stop being so finicky about gear.
|
||||||
for slot, item of requiredGear
|
for slot, item of requiredGear
|
||||||
continue if item is 'tarnished-bronze-breastplate' and inWorldMap and @options.levelID is 'the-raised-sword' # Don't tell them they need it until they need it in the level
|
continue if item is 'tarnished-bronze-breastplate' and inWorldMap and @options.levelID is 'the-raised-sword' # Don't tell them they need it until they need it in the level
|
||||||
|
@ -479,6 +481,7 @@ gear =
|
||||||
'leather-boots': '53e2384453457600003e3f07'
|
'leather-boots': '53e2384453457600003e3f07'
|
||||||
'leather-belt': '5437002a7beba4a82024a97d'
|
'leather-belt': '5437002a7beba4a82024a97d'
|
||||||
'programmaticon-i': '53e4108204c00d4607a89f78'
|
'programmaticon-i': '53e4108204c00d4607a89f78'
|
||||||
|
'programmaticon-ii': '546e25d99df4a17d0d449be1'
|
||||||
'crude-glasses': '53e238df53457600003e3f0b'
|
'crude-glasses': '53e238df53457600003e3f0b'
|
||||||
'crude-builders-hammer': '53f4e6e3d822c23505b74f42'
|
'crude-builders-hammer': '53f4e6e3d822c23505b74f42'
|
||||||
'long-sword': '544d7d1f8494308424f564a3'
|
'long-sword': '544d7d1f8494308424f564a3'
|
||||||
|
@ -488,3 +491,9 @@ gear =
|
||||||
'basic-flags': '545bacb41e649a4495f887da'
|
'basic-flags': '545bacb41e649a4495f887da'
|
||||||
'roughedge': '544d7d918494308424f564a7'
|
'roughedge': '544d7d918494308424f564a7'
|
||||||
'sharpened-sword': '544d7deb8494308424f564ab'
|
'sharpened-sword': '544d7deb8494308424f564ab'
|
||||||
|
'crude-crossbow': '544d7ffd8494308424f564c3'
|
||||||
|
'crude-dagger': '544d952b8494308424f56517'
|
||||||
|
'weak-charge': '544d957d8494308424f5651f'
|
||||||
|
'enchanted-stick': '544d87188494308424f564f1'
|
||||||
|
'unholy-tome-i': '546374bc3839c6e02811d308'
|
||||||
|
'book-of-life-i': '546375653839c6e02811d30b'
|
||||||
|
|
|
@ -110,6 +110,7 @@ module.exports = class WorldMapView extends RootView
|
||||||
window.levelUnlocksNotWorking = true if level.locked and level.id is @nextLevel # Temporary
|
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 window.levelUnlocksNotWorking # Temporary; also possible in HeroVictoryModal
|
||||||
level.locked = false if @levelStatusMap[level.id] in ['started', 'complete']
|
level.locked = false if @levelStatusMap[level.id] in ['started', 'complete']
|
||||||
|
level.locked = false if me.get('slug') is 'nick'
|
||||||
level.disabled = false if @levelStatusMap[level.id] in ['started', 'complete']
|
level.disabled = false if @levelStatusMap[level.id] in ['started', 'complete']
|
||||||
level.color = 'rgb(255, 80, 60)'
|
level.color = 'rgb(255, 80, 60)'
|
||||||
if level.practice
|
if level.practice
|
||||||
|
@ -689,7 +690,9 @@ forest = [
|
||||||
continue: 'peasant-protection'
|
continue: 'peasant-protection'
|
||||||
x: 58.54
|
x: 58.54
|
||||||
y: 66.73
|
y: 66.73
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Warrior branch
|
||||||
{
|
{
|
||||||
name: 'Peasant Protection'
|
name: 'Peasant Protection'
|
||||||
type: 'hero'
|
type: 'hero'
|
||||||
|
@ -710,6 +713,77 @@ forest = [
|
||||||
x: 71.19
|
x: 71.19
|
||||||
y: 63.61
|
y: 63.61
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Ranger branch
|
||||||
|
{
|
||||||
|
name: 'Munchkin Harvest'
|
||||||
|
type: 'hero'
|
||||||
|
id: 'munchkin-harvest'
|
||||||
|
description: 'Join forces with a new hero: Amara Arrowhead.'
|
||||||
|
nextLevels:
|
||||||
|
continue: 'swift-dagger'
|
||||||
|
disabled: not me.isAdmin()
|
||||||
|
x: 64.37
|
||||||
|
y: 69.18
|
||||||
|
}
|
||||||
|
{
|
||||||
|
name: 'Swift Dagger'
|
||||||
|
type: 'hero'
|
||||||
|
id: 'swift-dagger'
|
||||||
|
description: 'Deal damage from a distance with your new hero.'
|
||||||
|
nextLevels:
|
||||||
|
continue: 'shrapnel'
|
||||||
|
disabled: not me.isAdmin()
|
||||||
|
x: 66
|
||||||
|
y: 75.61
|
||||||
|
}
|
||||||
|
{
|
||||||
|
name: 'Shrapnel'
|
||||||
|
type: 'hero'
|
||||||
|
id: 'shrapnel'
|
||||||
|
description: 'Explore the explosive arts.'
|
||||||
|
nextLevels:
|
||||||
|
continue: 'coinucopia'
|
||||||
|
disabled: not me.isAdmin()
|
||||||
|
x: 67
|
||||||
|
y: 81
|
||||||
|
}
|
||||||
|
|
||||||
|
# Wizard branch
|
||||||
|
{
|
||||||
|
name: 'Arcane Ally'
|
||||||
|
type: 'hero'
|
||||||
|
id: 'arcane-ally'
|
||||||
|
description: 'Stand your ground against large ogres with a new hero: Ms. Hushbaum.'
|
||||||
|
nextLevels:
|
||||||
|
continue: 'touch-of-death'
|
||||||
|
disabled: not me.isAdmin()
|
||||||
|
x: 64.37
|
||||||
|
y: 55.18
|
||||||
|
}
|
||||||
|
{
|
||||||
|
name: 'Touch of Death'
|
||||||
|
type: 'hero'
|
||||||
|
id: 'touch-of-death'
|
||||||
|
description: 'Learn your first spell to siphon life from your foes.'
|
||||||
|
nextLevels:
|
||||||
|
continue: 'bonemender'
|
||||||
|
disabled: not me.isAdmin()
|
||||||
|
x: 65
|
||||||
|
y: 48
|
||||||
|
}
|
||||||
|
{
|
||||||
|
name: 'Bonemender'
|
||||||
|
type: 'hero'
|
||||||
|
id: 'bonemender'
|
||||||
|
description: 'Cast regeneration on allied soldiers to withstand a siege.'
|
||||||
|
nextLevels:
|
||||||
|
continue: 'coinucopia'
|
||||||
|
disabled: not me.isAdmin()
|
||||||
|
x: 66
|
||||||
|
y: 40
|
||||||
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
name: 'Coinucopia'
|
name: 'Coinucopia'
|
||||||
type: 'hero'
|
type: 'hero'
|
||||||
|
@ -760,6 +834,17 @@ forest = [
|
||||||
x: 77.54
|
x: 77.54
|
||||||
y: 25.94
|
y: 25.94
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
name: 'Siege of Stonehold'
|
||||||
|
type: 'hero'
|
||||||
|
id: 'siege-of-stonehold'
|
||||||
|
description: 'Unlock the desert world, if you are strong enough to win this epic battle!'
|
||||||
|
#nextLevels:
|
||||||
|
# continue: ''
|
||||||
|
disabled: not me.isAdmin()
|
||||||
|
x: 77.54
|
||||||
|
y: 25.94
|
||||||
|
}
|
||||||
{
|
{
|
||||||
name: 'Multiplayer Treasure Grove'
|
name: 'Multiplayer Treasure Grove'
|
||||||
type: 'hero-ladder'
|
type: 'hero-ladder'
|
||||||
|
|
|
@ -216,6 +216,37 @@ module.exports = class SpellView extends CocoView
|
||||||
name: 'disable-spaces'
|
name: 'disable-spaces'
|
||||||
bindKey: 'Space'
|
bindKey: 'Space'
|
||||||
exec: => @ace.execCommand 'insertstring', ' ' unless LevelOptions[@options.level.get('slug')]?.disableSpaces
|
exec: => @ace.execCommand 'insertstring', ' ' unless LevelOptions[@options.level.get('slug')]?.disableSpaces
|
||||||
|
addCommand
|
||||||
|
name: 'throttle-backspaces'
|
||||||
|
bindKey: 'Backspace'
|
||||||
|
exec: =>
|
||||||
|
# Throttle the backspace speed
|
||||||
|
# Slow to 500ms when whitespace at beginning of line is first encountered
|
||||||
|
# Slow to 100ms for remaining whitespace at beginning of line
|
||||||
|
# Rough testing showed backspaces happen at 150ms when tapping.
|
||||||
|
# Backspace speed varies by system when holding, 30ms on fastest Macbook setting.
|
||||||
|
unless CampaignOptions?.getOption?(@options?.level?.get?('slug'), 'backspaceThrottle')
|
||||||
|
@ace.remove "left"
|
||||||
|
return
|
||||||
|
|
||||||
|
nowDate = Date.now()
|
||||||
|
if @aceSession.selection.isEmpty()
|
||||||
|
cursor = @ace.getCursorPosition()
|
||||||
|
line = @aceDoc.getLine(cursor.row)
|
||||||
|
if /^\s*$/.test line.substring(0, cursor.column)
|
||||||
|
@backspaceThrottleMs ?= 500
|
||||||
|
# console.log "SpellView @backspaceThrottleMs=#{@backspaceThrottleMs}"
|
||||||
|
# console.log 'SpellView lastBackspace diff', nowDate - @lastBackspace if @lastBackspace?
|
||||||
|
if not @lastBackspace? or nowDate - @lastBackspace > @backspaceThrottleMs
|
||||||
|
@backspaceThrottleMs = 100
|
||||||
|
@lastBackspace = nowDate
|
||||||
|
@ace.remove "left"
|
||||||
|
return
|
||||||
|
@backspaceThrottleMs = null
|
||||||
|
@lastBackspace = nowDate
|
||||||
|
@ace.remove "left"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
fillACE: ->
|
fillACE: ->
|
||||||
@ace.setValue @spell.source
|
@ace.setValue @spell.source
|
||||||
|
|
Loading…
Reference in a new issue