Merge branch 'master' into production

This commit is contained in:
Nick Winter 2014-12-24 11:03:01 -08:00
commit a7b39c981b
9 changed files with 51 additions and 39 deletions

View file

@ -327,41 +327,41 @@ module.exports = LevelOptions =
requiredGear: {}
restrictedGear: {}
'the-mighty-sand-yak':
#requiredGear: {neck: 'rough-sense-stone'} # Too many players probably won't have this, and we don't have a way to require players to buy it yet.
requiredGear: {neck: 'rough-sense-stone'}
restrictedGear: {flag: 'basic-flags'}
'oasis':
requiredGear: {}
requiredGear: {neck: 'rough-sense-stone'}
restrictedGear: {flag: 'basic-flags'}
'sarven-road':
requiredGear: {}
requiredGear: {neck: 'rough-sense-stone'}
restrictedGear: {flag: 'basic-flags'}
'sarven-gaps':
requiredGear: {'right-hand': 'crude-builders-hammer'}
requiredGear: {'right-hand': 'crude-builders-hammer', neck: 'rough-sense-stone'}
restrictedGear: {flag: 'basic-flags'}
'thunderhooves':
requiredGear: {'right-hand': 'crude-builders-hammer'}
requiredGear: {'right-hand': 'crude-builders-hammer', neck: 'rough-sense-stone'}
restrictedGear: {flag: 'basic-flags'}
'medical-attention':
requiredGear: {'right-hand': 'long-sword'}, #neck: 'polished-sense-stone'} # We don't have a way to require players to buy it yet.
restrictedGear: {'right-hand': 'crude-builders-hammer', flag: 'basic-flags'}
requiredGear: {'right-hand': 'long-sword', neck: 'polished-sense-stone'}
restrictedGear: {'right-hand': 'crude-builders-hammer', flag: 'basic-flags', neck: 'rough-sense-stone'}
'minesweeper':
requiredGear: {}
restrictedGear: {flag: 'basic-flags'}
requiredGear: {neck: 'polished-sense-stone'}
restrictedGear: {flag: 'basic-flags', neck: 'rough-sense-stone'}
'sarven-sentry':
requiredGear: {'right-hand': 'crude-builders-hammer', flag: 'basic-flags'}
requiredGear: {'right-hand': 'crude-builders-hammer', flag: 'basic-flags', neck: 'polished-sense-stone'}
restrictedGear: {}
'keeping-time':
requiredGear: {} # watch
restrictedGear: {}
requiredGear: {wrists: 'simple-wristwatch'}
restrictedGear: {wrists: 'sundial-wristwatch'}
'hoarding-gold':
requiredGear: {}
restrictedGear: {}
requiredGear: {neck: 'quartz-sense-stone'}
restrictedGear: {neck: 'polished-sense-stone'}
'decoy-drill':
requiredGear: {} # new builder's hammer
restrictedGear: {}
requiredGear: {'right-hand': 'wooden-builders-hammer', neck: 'quartz-sense-stone'}
restrictedGear: {neck: 'polished-sense-stone'}
'yakstraction':
requiredGear: {} # new builder's hammer
restrictedGear: {}
requiredGear: {'right-hand': 'wooden-builders-hammer', flag: 'basic-flags'}
restrictedGear: {'right-hand': 'crude-builders-hammer'}
'sarven-brawl':
requiredGear: {}
restrictedGear: {}

View file

@ -329,6 +329,7 @@
inventory:
choose_inventory: "Equip Items"
equipped_item: "Equipped"
required_purchase_title: "Required"
available_item: "Available"
restricted_title: "Restricted"
should_equip: "(double-click to equip)"

View file

@ -151,7 +151,7 @@
background-position: (-6 * $iconSize) 0px
&.prop-label-icon-maxSpeed
background-position: (-7 * $iconSize) 0px
&.prop-label-icon-gold, &.prop-label-icon-bountyGold
&.prop-label-icon-gold, &.prop-label-icon-bountyGold, &.prop-label-icon-value
background-position: (-8 * $iconSize) 0px
.prop[name="health"]

View file

@ -28,6 +28,14 @@
.nano
.nano-content
if itemGroups
if itemGroups.requiredPurchaseItems.models.length
h4#required-purchase-description(data-i18n="inventory.required_purchase_title")
for item in itemGroups.requiredPurchaseItems.models
if selectedHeroClass && item.classes.indexOf(selectedHeroClass) > -1
.item(class=item.classes, data-item-id=item.id)
img(draggable="false")
.clearfix
if itemGroups.availableItems.models.length
h4#available-description(data-i18n="inventory.available_item")
for item in itemGroups.availableItems.models

View file

@ -998,7 +998,6 @@ desert = [
continue: 'sarven-gaps'
x: 28.36
y: 24.59
adventurer: true
requiresSubscription: false
}
{
@ -1011,7 +1010,6 @@ desert = [
continue: 'thunderhooves'
x: 21.13
y: 9.29
adventurer: true
requiresSubscription: true
}
{
@ -1024,7 +1022,6 @@ desert = [
continue: 'medical-attention'
x: 35.08
y: 20.48
adventurer: true
requiresSubscription: false
}
{
@ -1037,7 +1034,6 @@ desert = [
continue: 'minesweeper'
x: 42.84
y: 21.82
adventurer: true
requiresSubscription: false
}
{
@ -1050,7 +1046,6 @@ desert = [
continue: 'sarven-sentry'
x: 47.64
y: 12.40
adventurer: true
requiresSubscription: true
}
{
@ -1058,63 +1053,59 @@ desert = [
type: 'hero'
id: 'sarven-sentry'
original: '548cef7f0ffdc235e80ef0cc'
description: 'Coming Soon'
description: 'Work with your scouts to corral yaks and trap ogres.'
nextLevels:
continue: 'keeping-time'
x: 51.48
y: 26.09
adventurer: true
requiresSubscription: false
disabled: not me.isAdmin()
}
{
name: 'Keeping Time'
type: 'hero'
id: 'keeping-time'
original: '548cf1a90ffdc235e80ef0d1'
description: 'Coming Soon'
description: 'Raise funds to support your allies in time to fight off the ogre horde!'
nextLevels:
continue: 'hoarding-gold'
x: 58.42
y: 34.14
adventurer: true
requiresSubscription: false
disabled: not me.isAdmin()
}
{
name: 'Hoarding Gold'
type: 'hero'
id: 'hoarding-gold'
original: ''
description: 'Coming Soon'
original: '549875268e52573b10d3bcd7'
description: 'You can get lost forever in the desert if you let the mirage of greed lead you.'
nextLevels:
continue: 'decoy-drill'
x: 61.73
y: 29.51
adventurer: true
requiresSubscription: false
disabled: not me.isAdmin()
}
{
name: 'Decoy Drill'
type: 'hero'
id: 'decoy-drill'
original: ''
description: 'Coming Soon'
original: '549875428e52573b10d3bcd9'
description: 'Gather gold to field test a new buildable unit: the decoy.'
nextLevels:
continue: 'yakstraction'
x: 62.05
y: 40.44
adventurer: true
requiresSubscription: false
disabled: not me.isAdmin()
}
{
name: 'Yakstraction'
type: 'hero'
id: 'yakstraction'
original: ''
description: 'Coming Soon'
original: '5498cf468e52573b10d3bd15'
description: 'Thirsty yaks are stampeding towards a vulnerable peasant sunning herself at an oasis, but you\'ve got decoys to distract the yaks out of the way.'
nextLevels:
continue: 'sarven-brawl'
x: 66.46

View file

@ -130,7 +130,7 @@ module.exports = class LevelHUDView extends CocoView
return null # included in the bar
context =
prop: prop
hasIcon: prop in ['health', 'pos', 'target', 'collectedThangIDs', 'gold', 'bountyGold', 'visualRange', 'attackDamage', 'attackRange', 'maxSpeed', 'attackNearbyEnemyRange']
hasIcon: prop in ['health', 'pos', 'target', 'collectedThangIDs', 'gold', 'bountyGold', 'value', 'visualRange', 'attackDamage', 'attackRange', 'maxSpeed', 'attackNearbyEnemyRange']
hasBar: prop in ['health']
$(prop_template(context))

View file

@ -72,6 +72,7 @@ module.exports = class InventoryModal extends ModalView
@equipment = $.extend true, {}, @equipment
@requireLevelEquipment()
@itemGroups = {}
@itemGroups.requiredPurchaseItems = new Backbone.Collection()
@itemGroups.availableItems = new Backbone.Collection()
@itemGroups.restrictedItems = new Backbone.Collection()
@itemGroups.lockedItems = new Backbone.Collection()
@ -95,6 +96,9 @@ module.exports = class InventoryModal extends ModalView
if not item.getFrontFacingStats().props.length and not _.size(item.getFrontFacingStats().stats) and locked # Temp: while there are placeholder items
null # Don't put into a collection
if locked and item.get('slug') in _.values(LevelOptions[@options.levelID]?.requiredGear ? {})
item.classes.push 'locked'
@itemGroups.requiredPurchaseItems.add item
else if locked and item.get('slug') isnt 'simple-boots'
item.classes.push 'locked'
if item.isSilhouettedItem() or not item.get('gems')
@ -309,6 +313,8 @@ module.exports = class InventoryModal extends ModalView
itemIDToUnequip = itemEl.data('item-id')
return unless itemIDToUnequip
itemEl.remove()
item = @items.get itemIDToUnequip
item.classes = _.without item.classes, 'equipped'
@$el.find("#unequipped .item[data-item-id=#{itemIDToUnequip}]").removeClass('equipped')
deselectAllSlots: ->
@ -382,7 +388,7 @@ module.exports = class InventoryModal extends ModalView
for slot, item of requiredGear
if (slot in ['right-hand', 'left-hand', 'head', 'torso']) and not (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'])) and item isnt 'crude-builders-hammer'
(heroClass is 'Wizard' and @options.levelID in ['touch-of-death', 'bonemender'])) and not (item in ['crude-builders-hammer', 'wooden-builders-hammer'])
# After they switch to a ranger or wizard, we stop being so finicky about class-specific gear.
continue
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
@ -488,6 +494,7 @@ module.exports = class InventoryModal extends ModalView
#- ...then rerender key bits
@itemGroups.lockedItems.remove(item)
@itemGroups.requiredPurchaseItems.remove(item)
# Redo all item sorting to make sure that we don't clobber state changes since last render.
equipped = _.values @getCurrentEquipmentConfig()
@sortItem(otherItem, equipped) for otherItem in @items.models
@ -629,3 +636,6 @@ gear =
'book-of-life-i': '546375653839c6e02811d30b'
'rough-sense-stone': '54693140a2b1f53ce79443bc'
'polished-sense-stone': '53e215a253457600003e3eaf'
'quartz-sense-stone': '54693240a2b1f53ce79443c5'
'wooden-builders-hammer': '54694ba3a2b1f53ce794444d'
'simple-wristwatch': '54693797a2b1f53ce79443e9'

View file

@ -154,6 +154,7 @@ module.exports.getTwoGames = (req, res) ->
.aggregate()
.match(queryParams)
.project(selection)
.limit(5000)
.sort({'submitDate': -1})
.skip(humanSkipCount)
.limit(1)
@ -168,6 +169,7 @@ module.exports.getTwoGames = (req, res) ->
.aggregate()
.match(queryParams)
.project(selection)
.limit(5000)
.sort({'submitDate': -1})
.skip(ogresSkipCount)
.limit(1)

View file

@ -43,7 +43,7 @@ createMailContext = (req, done) ->
reply_to: sender or user.get('email')
name: user.get('name')
email_data:
subject: "[CodeCombat] #{subject ? ('Feedback - ' + sender or user.get('email'))}"
subject: "[CodeCombat] #{subject ? ('Feedback - ' + (sender or user.get('email')))}"
content: content
if recipientID and (user.isAdmin() or ('employer' in (user.get('permissions') ? [])))