mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-25 08:38:09 -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 =
|
||||
'default':
|
||||
autocompleteFontSizePx: 16
|
||||
backspaceThrottle: false
|
||||
'dungeon':
|
||||
autocompleteFontSizePx: 20
|
||||
backspaceThrottle: true
|
||||
|
||||
module.exports = CampaignOptions =
|
||||
getCampaignForSlug: (slug) ->
|
||||
|
|
|
@ -231,12 +231,37 @@ module.exports = LevelOptions =
|
|||
'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'}
|
||||
restrictedGear: {'left-hand': 'wooden-shield'}
|
||||
|
||||
# Warrior branch
|
||||
'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'}
|
||||
restrictedGear: {eyes: 'crude-glasses'}
|
||||
'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'}
|
||||
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':
|
||||
requiredGear: {'programming-book': 'programmaticon-i', feet: 'leather-boots', 'programming-book': 'programmaticon-ii', flag: 'basic-flags'}
|
||||
restrictedGear: {}
|
||||
|
@ -255,3 +280,6 @@ module.exports = LevelOptions =
|
|||
'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'}
|
||||
restrictedGear: {}
|
||||
'siege-of-stonehold':
|
||||
requiredGear: {}
|
||||
restrictedGear: {}
|
||||
|
|
|
@ -289,5 +289,4 @@ module.exports.ItemThangTypeNode = ItemThangTypeNode = class ItemThangTypeNode e
|
|||
|
||||
processThangType: (thangType) ->
|
||||
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
|
||||
@constructor.thangTypes.push name: thangType.get('name'), original: thangType.get('original'), slots: itemComponent.config?.slots ? ['right-hand']
|
||||
|
|
|
@ -84,7 +84,7 @@ module.exports = class InventoryModal extends ModalView
|
|||
|
||||
# sort into one of the four groups
|
||||
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
|
||||
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
|
||||
@unequipItemFromSlot @$el.find(".item-slot[data-slot='#{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.
|
||||
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
|
||||
|
@ -479,6 +481,7 @@ gear =
|
|||
'leather-boots': '53e2384453457600003e3f07'
|
||||
'leather-belt': '5437002a7beba4a82024a97d'
|
||||
'programmaticon-i': '53e4108204c00d4607a89f78'
|
||||
'programmaticon-ii': '546e25d99df4a17d0d449be1'
|
||||
'crude-glasses': '53e238df53457600003e3f0b'
|
||||
'crude-builders-hammer': '53f4e6e3d822c23505b74f42'
|
||||
'long-sword': '544d7d1f8494308424f564a3'
|
||||
|
@ -488,3 +491,9 @@ gear =
|
|||
'basic-flags': '545bacb41e649a4495f887da'
|
||||
'roughedge': '544d7d918494308424f564a7'
|
||||
'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
|
||||
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 me.get('slug') is 'nick'
|
||||
level.disabled = false if @levelStatusMap[level.id] in ['started', 'complete']
|
||||
level.color = 'rgb(255, 80, 60)'
|
||||
if level.practice
|
||||
|
@ -689,7 +690,9 @@ forest = [
|
|||
continue: 'peasant-protection'
|
||||
x: 58.54
|
||||
y: 66.73
|
||||
}
|
||||
}
|
||||
|
||||
# Warrior branch
|
||||
{
|
||||
name: 'Peasant Protection'
|
||||
type: 'hero'
|
||||
|
@ -710,6 +713,77 @@ forest = [
|
|||
x: 71.19
|
||||
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'
|
||||
type: 'hero'
|
||||
|
@ -760,6 +834,17 @@ forest = [
|
|||
x: 77.54
|
||||
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'
|
||||
type: 'hero-ladder'
|
||||
|
|
|
@ -216,6 +216,37 @@ module.exports = class SpellView extends CocoView
|
|||
name: 'disable-spaces'
|
||||
bindKey: 'Space'
|
||||
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: ->
|
||||
@ace.setValue @spell.source
|
||||
|
|
Loading…
Reference in a new issue