mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-02-26 14:34:58 -05:00
Merge branch 'master' into production
This commit is contained in:
commit
d9fb5e9f6c
13 changed files with 50 additions and 22 deletions
BIN
app/assets/images/pages/play/level/modal/reward_plate_wide.png
Normal file
BIN
app/assets/images/pages/play/level/modal/reward_plate_wide.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.4 KiB |
Binary file not shown.
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 15 KiB |
Binary file not shown.
After Width: | Height: | Size: 13 KiB |
|
@ -170,29 +170,29 @@ module.exports = LevelOptions =
|
||||||
hidesSay: true
|
hidesSay: true
|
||||||
hidesCodeToolbar: true
|
hidesCodeToolbar: true
|
||||||
hidesRealTimePlayback: true
|
hidesRealTimePlayback: true
|
||||||
requiredGear: {feet: 'simple-boots', 'right-hand': 'builders-hammer', torso: 'leather-tunic'}
|
requiredGear: {feet: 'simple-boots', 'right-hand': 'crude-builders-hammer', torso: 'leather-tunic'}
|
||||||
restrictedGear: {'right-hand': 'simple-sword'}
|
restrictedGear: {'right-hand': 'simple-sword'}
|
||||||
'defense-of-plainswood':
|
'defense-of-plainswood':
|
||||||
hidesRealTimePlayback: true
|
hidesRealTimePlayback: true
|
||||||
hidesCodeToolbar: true
|
hidesCodeToolbar: true
|
||||||
requiredGear: {feet: 'simple-boots', 'right-hand': 'builders-hammer'}
|
requiredGear: {feet: 'simple-boots', 'right-hand': 'crude-builders-hammer'}
|
||||||
restrictedGear: {'right-hand': 'simple-sword'}
|
restrictedGear: {'right-hand': 'simple-sword'}
|
||||||
'winding-trail':
|
'winding-trail':
|
||||||
hidesRealTimePlayback: true
|
hidesRealTimePlayback: true
|
||||||
hidesCodeToolbar: true
|
hidesCodeToolbar: true
|
||||||
requiredGear: {feet: 'leather-boots', 'right-hand': 'builders-hammer'}
|
requiredGear: {feet: 'leather-boots', 'right-hand': 'crude-builders-hammer'}
|
||||||
restrictedGear: {feet: 'simple-boots', 'right-hand': 'simple-sword'}
|
restrictedGear: {feet: 'simple-boots', 'right-hand': 'simple-sword'}
|
||||||
'thornbush-farm':
|
'thornbush-farm':
|
||||||
requiredGear: {feet: 'leather-boots', 'right-hand': 'builders-hammer', eyes: 'crude-glasses'}
|
requiredGear: {feet: 'leather-boots', 'right-hand': 'crude-builders-hammer', eyes: 'crude-glasses'}
|
||||||
hidesCodeToolbar: true
|
hidesCodeToolbar: true
|
||||||
restrictedGear: {feet: 'simple-boots', 'right-hand': 'simple-sword'}
|
restrictedGear: {feet: 'simple-boots', 'right-hand': 'simple-sword'}
|
||||||
'back-to-back':
|
'back-to-back':
|
||||||
hidesCodeToolbar: true
|
hidesCodeToolbar: true
|
||||||
requiredGear: {feet: 'leather-boots', torso: 'leather-tunic', waist: 'leather-belt', 'programming-book': 'programmaticon-i', eyes: 'crude-glasses', 'right-hand': 'simple-sword', 'left-hand': 'wooden-shield'}
|
requiredGear: {feet: 'leather-boots', torso: 'leather-tunic', waist: 'leather-belt', 'programming-book': 'programmaticon-i', eyes: 'crude-glasses', 'right-hand': 'simple-sword', 'left-hand': 'wooden-shield'}
|
||||||
restrictedGear: {feet: 'simple-boots', 'right-hand': 'builders-hammer'}
|
restrictedGear: {feet: 'simple-boots', 'right-hand': 'crude-builders-hammer'}
|
||||||
'ogre-encampment':
|
'ogre-encampment':
|
||||||
requiredGear: {torso: 'leather-tunic', waist: 'leather-belt', 'programming-book': 'programmaticon-i', eyes: 'crude-glasses', 'right-hand': 'simple-sword', 'left-hand': 'wooden-shield'}
|
requiredGear: {torso: 'leather-tunic', waist: 'leather-belt', 'programming-book': 'programmaticon-i', eyes: 'crude-glasses', 'right-hand': 'simple-sword', 'left-hand': 'wooden-shield'}
|
||||||
restrictedGear: {feet: 'simple-boots', 'right-hand': 'builders-hammer'}
|
restrictedGear: {feet: 'simple-boots', 'right-hand': 'crude-builders-hammer'}
|
||||||
'woodland-cleaver':
|
'woodland-cleaver':
|
||||||
requiredGear: {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'}
|
requiredGear: {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'}
|
||||||
restrictedGear: {feet: 'simple-boots', 'right-hand': 'simple-sword'}
|
restrictedGear: {feet: 'simple-boots', 'right-hand': 'simple-sword'}
|
||||||
|
@ -212,14 +212,14 @@ module.exports = LevelOptions =
|
||||||
requiredGear: {'programming-book': 'programmaticon-i', feet: 'leather-boots', flag: 'basic-flags', eyes: 'wooden-glasses'}
|
requiredGear: {'programming-book': 'programmaticon-i', feet: 'leather-boots', flag: 'basic-flags', eyes: 'wooden-glasses'}
|
||||||
restrictedGear: {}
|
restrictedGear: {}
|
||||||
'drop-the-flag':
|
'drop-the-flag':
|
||||||
requiredGear: {'programming-book': 'programmaticon-i', feet: 'leather-boots', flag: 'basic-flags', eyes: 'wooden-glasses', 'right-hand': 'builders-hammer'}
|
requiredGear: {'programming-book': 'programmaticon-i', feet: 'leather-boots', flag: 'basic-flags', eyes: 'wooden-glasses', 'right-hand': 'crude-builders-hammer'}
|
||||||
restrictedGear: {'right-hand': 'longsword'}
|
restrictedGear: {'right-hand': 'longsword'}
|
||||||
'deadly-pursuit':
|
'deadly-pursuit':
|
||||||
requiredGear: {'programming-book': 'programmaticon-i', feet: 'leather-boots', flag: 'basic-flags', eyes: 'wooden-glasses', 'right-hand': 'builders-hammer'}
|
requiredGear: {'programming-book': 'programmaticon-i', feet: 'leather-boots', flag: 'basic-flags', eyes: 'wooden-glasses', 'right-hand': 'crude-builders-hammer'}
|
||||||
restrictedGear: {'right-hand': 'longsword'}
|
restrictedGear: {'right-hand': 'longsword'}
|
||||||
'rich-forager':
|
'rich-forager':
|
||||||
requiredGear: {'programming-book': 'programmaticon-i', feet: 'leather-boots', flag: 'basic-flags', eyes: 'wooden-glasses', torso: 'leather-tunic', 'right-hand': 'longsword', 'left-hand': 'bronze-shield'}
|
requiredGear: {'programming-book': 'programmaticon-i', feet: 'leather-boots', flag: 'basic-flags', eyes: 'wooden-glasses', torso: 'leather-tunic', 'right-hand': 'longsword', 'left-hand': 'bronze-shield'}
|
||||||
restrictedGear: {'right-hand': 'builders-hammer'}
|
restrictedGear: {'right-hand': 'crude-builders-hammer'}
|
||||||
'multiplayer-treasure-grove':
|
'multiplayer-treasure-grove':
|
||||||
requiredGear: {'programming-book': 'programmaticon-i', feet: 'leather-boots', flag: 'basic-flags', eyes: 'wooden-glasses', torso: 'leather-tunic'}
|
requiredGear: {'programming-book': 'programmaticon-i', feet: 'leather-boots', flag: 'basic-flags', eyes: 'wooden-glasses', torso: 'leather-tunic'}
|
||||||
restrictedGear: {}
|
restrictedGear: {}
|
||||||
|
|
|
@ -558,7 +558,7 @@ module.exports = Surface = class Surface extends CocoClass
|
||||||
@playing = false # Will start when countdown is done.
|
@playing = false # Will start when countdown is done.
|
||||||
if @heroLank
|
if @heroLank
|
||||||
@previousCameraZoom = @camera.zoom
|
@previousCameraZoom = @camera.zoom
|
||||||
@camera.zoomTo @heroLank.sprite, 2, 3000
|
#@camera.zoomTo @heroLank.sprite, 2, 3000 # This makes flag placement hard, now that we're only rarely using this as a coolcam.
|
||||||
|
|
||||||
onRealTimePlaybackEnded: (e) ->
|
onRealTimePlaybackEnded: (e) ->
|
||||||
return unless @realTime
|
return unless @realTime
|
||||||
|
|
|
@ -12,15 +12,25 @@
|
||||||
.background-wrapper
|
.background-wrapper
|
||||||
//background: url("/images/pages/play/level/modal/victory_modal_background.png")
|
//background: url("/images/pages/play/level/modal/victory_modal_background.png")
|
||||||
width: 550px
|
width: 550px
|
||||||
|
background-color: transparent
|
||||||
|
border: 0px solid transparent
|
||||||
border-width: 25px
|
border-width: 25px
|
||||||
border-image: url("/images/pages/play/level/modal/victory_modal_background.png") 25 fill round
|
border-image: url("/images/pages/play/level/modal/victory_modal_background.png") 25 fill round
|
||||||
border-radius: 10px
|
border-radius: 12px
|
||||||
|
|
||||||
|
#victory-banner
|
||||||
|
position: absolute
|
||||||
|
left: -30px
|
||||||
|
z-index: 0
|
||||||
|
|
||||||
#victory-header
|
#victory-header
|
||||||
|
position: absolute
|
||||||
|
left: 135px
|
||||||
display: block
|
display: block
|
||||||
margin: 15px auto 0
|
margin: 10px auto 0
|
||||||
// http://easings.net/#easeOutBack plus tweaked a bit: http://cubic-bezier.com/#.18,.68,.75,2
|
// http://easings.net/#easeOutBack plus tweaked a bit: http://cubic-bezier.com/#.18,.68,.75,2
|
||||||
@include transition(0.5s cubic-bezier(0.18, 0.68, 0.75, 2))
|
@include transition(0.5s cubic-bezier(0.18, 0.68, 0.75, 2))
|
||||||
|
z-index: 1
|
||||||
|
|
||||||
&.out
|
&.out
|
||||||
@include scale(0)
|
@include scale(0)
|
||||||
|
@ -92,6 +102,15 @@
|
||||||
z-index: 1
|
z-index: 1
|
||||||
@include transition(0.25s ease)
|
@include transition(0.25s ease)
|
||||||
|
|
||||||
|
&.hero, &.item
|
||||||
|
background: url("/images/pages/play/level/modal/reward_plate_wide.png")
|
||||||
|
width: 120px
|
||||||
|
height: 83px
|
||||||
|
margin-top: 1px
|
||||||
|
|
||||||
|
.reward-image-container
|
||||||
|
left: 33px
|
||||||
|
|
||||||
&.animating
|
&.animating
|
||||||
@include scale(1.5)
|
@include scale(1.5)
|
||||||
z-index: 2
|
z-index: 2
|
||||||
|
@ -216,10 +235,15 @@
|
||||||
html.no-borderimage
|
html.no-borderimage
|
||||||
#hero-victory-modal
|
#hero-victory-modal
|
||||||
.background-wrapper
|
.background-wrapper
|
||||||
|
border: 0
|
||||||
background: url("/images/pages/play/level/modal/victory_modal_background.png")
|
background: url("/images/pages/play/level/modal/victory_modal_background.png")
|
||||||
height: 650px
|
height: 650px
|
||||||
#victory-header
|
#victory-header
|
||||||
margin-top: 40px
|
margin-top: 40px
|
||||||
|
left: 160px
|
||||||
|
#victory-banner
|
||||||
|
left: 0px
|
||||||
|
top: 40px
|
||||||
.modal-header
|
.modal-header
|
||||||
height: 110px
|
height: 110px
|
||||||
.modal-content
|
.modal-content
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
extends /templates/modal/modal_base
|
extends /templates/modal/modal_base
|
||||||
block modal-header-content
|
block modal-header-content
|
||||||
|
img(src="/images/pages/play/level/modal/victory_modal_blue_banner.png")#victory-banner
|
||||||
img(src="/images/pages/play/level/modal/victory_word.png")#victory-header.out
|
img(src="/images/pages/play/level/modal/victory_word.png")#victory-header.out
|
||||||
|
|
||||||
block modal-body-content
|
block modal-body-content
|
||||||
|
|
|
@ -67,7 +67,7 @@ module.exports = class InventoryModal extends ModalView
|
||||||
@itemGroups.availableItems = new Backbone.Collection()
|
@itemGroups.availableItems = new Backbone.Collection()
|
||||||
@itemGroups.restrictedItems = new Backbone.Collection()
|
@itemGroups.restrictedItems = new Backbone.Collection()
|
||||||
@itemGroups.lockedItems = new Backbone.Collection()
|
@itemGroups.lockedItems = new Backbone.Collection()
|
||||||
itemGroup.comparator = 'gems' for itemGroup in _.values @itemGroups
|
itemGroup.comparator = ((m) -> m.get('gems') ? m.get('tier')) for itemGroup in _.values @itemGroups
|
||||||
|
|
||||||
equipped = _.values(@equipment)
|
equipped = _.values(@equipment)
|
||||||
@sortItem(item, equipped) for item in @items.models
|
@sortItem(item, equipped) for item in @items.models
|
||||||
|
@ -89,6 +89,7 @@ module.exports = class InventoryModal extends ModalView
|
||||||
@itemGroups.lockedItems.add(item)
|
@itemGroups.lockedItems.add(item)
|
||||||
item.classes.push 'locked'
|
item.classes.push 'locked'
|
||||||
item.classes.push 'silhouette' if item.isSilhouettedItem()
|
item.classes.push 'silhouette' if item.isSilhouettedItem()
|
||||||
|
item.classes.push 'hidden' unless item.get('gems')
|
||||||
else if item.get('slug') in _.values(LevelOptions[@options.levelID]?.restrictedGear ? {})
|
else if item.get('slug') in _.values(LevelOptions[@options.levelID]?.restrictedGear ? {})
|
||||||
@itemGroups.restrictedItems.add(item)
|
@itemGroups.restrictedItems.add(item)
|
||||||
item.classes.push 'restricted'
|
item.classes.push 'restricted'
|
||||||
|
@ -375,8 +376,8 @@ module.exports = class InventoryModal extends ModalView
|
||||||
#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 # ... when we make it so that you can buy it
|
#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 # ... when we make it so that you can buy it
|
||||||
equipped = equipment[slot]
|
equipped = equipment[slot]
|
||||||
continue if equipped and not (
|
continue if equipped and not (
|
||||||
(item is 'builders-hammer' and equipped in [gear['simple-sword'], gear['long-sword'], gear['sharpened-sword'], gear['roughedge']]) or
|
(item is 'crude-builders-hammer' and equipped in [gear['simple-sword'], gear['long-sword'], gear['sharpened-sword'], gear['roughedge']]) or
|
||||||
(item in ['simple-sword', 'long-sword', 'roughedge', 'sharpened-sword'] and equipped is gear['builders-hammer']) or
|
(item in ['simple-sword', 'long-sword', 'roughedge', 'sharpened-sword'] and equipped is gear['crude-builders-hammer']) or
|
||||||
(item is 'leather-boots' and equipped is gear['simple-boots']) or
|
(item is 'leather-boots' and equipped is gear['simple-boots']) or
|
||||||
(item is 'simple-boots' and equipped is gear['leather-boots'])
|
(item is 'simple-boots' and equipped is gear['leather-boots'])
|
||||||
)
|
)
|
||||||
|
@ -463,7 +464,7 @@ gear =
|
||||||
'leather-belt': '5437002a7beba4a82024a97d'
|
'leather-belt': '5437002a7beba4a82024a97d'
|
||||||
'programmaticon-i': '53e4108204c00d4607a89f78'
|
'programmaticon-i': '53e4108204c00d4607a89f78'
|
||||||
'crude-glasses': '53e238df53457600003e3f0b'
|
'crude-glasses': '53e238df53457600003e3f0b'
|
||||||
'builders-hammer': '53f4e6e3d822c23505b74f42'
|
'crude-builders-hammer': '53f4e6e3d822c23505b74f42'
|
||||||
'long-sword': '544d7d1f8494308424f564a3'
|
'long-sword': '544d7d1f8494308424f564a3'
|
||||||
'sundial-wristwatch': '53e2396a53457600003e3f0f'
|
'sundial-wristwatch': '53e2396a53457600003e3f0f'
|
||||||
'bronze-shield': '544c310ae0017993fce214bf'
|
'bronze-shield': '544c310ae0017993fce214bf'
|
||||||
|
|
|
@ -116,8 +116,8 @@ module.exports = class HeroVictoryModal extends ModalView
|
||||||
c.readyToRank = @level.get('type', true) is 'hero-ladder' and @session.readyToRank()
|
c.readyToRank = @level.get('type', true) is 'hero-ladder' and @session.readyToRank()
|
||||||
c.level = @level
|
c.level = @level
|
||||||
@continueLevelLink = @getNextLevelLink 'continue'
|
@continueLevelLink = @getNextLevelLink 'continue'
|
||||||
@morePracticeLevelLink = me.isAdmin() and @getNextLevelLink 'more_practice'
|
@morePracticeLevelLink = @getNextLevelLink 'more_practice'
|
||||||
@skipAheadLevelLink = me.isAdmin() and @getNextLevelLink 'skip_ahead'
|
@skipAheadLevelLink = @getNextLevelLink 'skip_ahead'
|
||||||
c.continueButtons = [
|
c.continueButtons = [
|
||||||
{key: 'skip_ahead', link: @skipAheadLevelLink, 'choice-explicit': 'skip', 'choice-implicit': 'too_easy'}
|
{key: 'skip_ahead', link: @skipAheadLevelLink, 'choice-explicit': 'skip', 'choice-implicit': 'too_easy'}
|
||||||
{key: 'continue', link: @continueLevelLink, 'choice-explicit': 'next_level', 'choice-implicit': 'just_right'}
|
{key: 'continue', link: @continueLevelLink, 'choice-explicit': 'next_level', 'choice-implicit': 'just_right'}
|
||||||
|
|
|
@ -161,7 +161,7 @@ module.exports = class TomeView extends CocoView
|
||||||
sessionState = @options.session.get('state') ? {}
|
sessionState = @options.session.get('state') ? {}
|
||||||
if realTime
|
if realTime
|
||||||
sessionState.submissionCount = (sessionState.submissionCount ? 0) + 1
|
sessionState.submissionCount = (sessionState.submissionCount ? 0) + 1
|
||||||
sessionState.flagHistory = _.filter sessionState.flagHistory ? [], (event) => event.team isnt @options.session.get('team')
|
sessionState.flagHistory = _.filter sessionState.flagHistory ? [], (event) => event.team isnt (@options.session.get('team') ? 'humans')
|
||||||
@options.session.set 'state', sessionState
|
@options.session.set 'state', sessionState
|
||||||
Backbone.Mediator.publish 'tome:cast-spells', spells: @spells, preload: preload, realTime: realTime, submissionCount: sessionState.submissionCount ? 0, flagHistory: sessionState.flagHistory ? []
|
Backbone.Mediator.publish 'tome:cast-spells', spells: @spells, preload: preload, realTime: realTime, submissionCount: sessionState.submissionCount ? 0, flagHistory: sessionState.flagHistory ? []
|
||||||
|
|
||||||
|
|
|
@ -83,7 +83,7 @@ module.exports = class PlayItemsModal extends ModalView
|
||||||
category = slotToCategory[model.getAllowedSlots()[0]] or 'misc'
|
category = slotToCategory[model.getAllowedSlots()[0]] or 'misc'
|
||||||
@itemCategoryCollections[category] ?= new Backbone.Collection()
|
@itemCategoryCollections[category] ?= new Backbone.Collection()
|
||||||
collection = @itemCategoryCollections[category]
|
collection = @itemCategoryCollections[category]
|
||||||
collection.comparator = 'gems'
|
collection.comparator = (m) -> m.get('gems') ? m.get('tier')
|
||||||
collection.add(model)
|
collection.add(model)
|
||||||
model.name = utils.i18n model.attributes, 'name'
|
model.name = utils.i18n model.attributes, 'name'
|
||||||
model.affordable = cost <= gemsOwned
|
model.affordable = cost <= gemsOwned
|
||||||
|
|
|
@ -23,12 +23,12 @@ class EarnedAchievementHandler extends Handler
|
||||||
ids = req.query.achievementIDs
|
ids = req.query.achievementIDs
|
||||||
if (not ids) or (ids.length is 0)
|
if (not ids) or (ids.length is 0)
|
||||||
return @sendBadInputError(res, 'For a get-by-achievement-ids request, need to provide ids.')
|
return @sendBadInputError(res, 'For a get-by-achievement-ids request, need to provide ids.')
|
||||||
|
|
||||||
ids = ids.split(',')
|
ids = ids.split(',')
|
||||||
for id in ids
|
for id in ids
|
||||||
if not Handler.isID(id)
|
if not Handler.isID(id)
|
||||||
return @sendBadInputError(res, "Not a MongoDB ObjectId: #{id}")
|
return @sendBadInputError(res, "Not a MongoDB ObjectId: #{id}")
|
||||||
|
|
||||||
query.achievement = {$in: ids}
|
query.achievement = {$in: ids}
|
||||||
EarnedAchievement.find query, (err, earnedAchievements) ->
|
EarnedAchievement.find query, (err, earnedAchievements) ->
|
||||||
return @sendDatabaseError(res, err) if err
|
return @sendDatabaseError(res, err) if err
|
||||||
|
@ -121,6 +121,7 @@ class EarnedAchievementHandler extends Handler
|
||||||
return doneWithAchievement new Error "Model with collection '#{achievement.get 'collection'}' doesn't exist." unless model?
|
return doneWithAchievement new Error "Model with collection '#{achievement.get 'collection'}' doesn't exist." unless model?
|
||||||
|
|
||||||
finalQuery = _.clone achievement.get 'query'
|
finalQuery = _.clone achievement.get 'query'
|
||||||
|
return doneWithAchievement() if _.isEmpty finalQuery
|
||||||
finalQuery.$or = [{}, {}] # Allow both ObjectIDs or hex string IDs
|
finalQuery.$or = [{}, {}] # Allow both ObjectIDs or hex string IDs
|
||||||
finalQuery.$or[0][achievement.userField] = userID
|
finalQuery.$or[0][achievement.userField] = userID
|
||||||
finalQuery.$or[1][achievement.userField] = mongoose.Types.ObjectId userID
|
finalQuery.$or[1][achievement.userField] = mongoose.Types.ObjectId userID
|
||||||
|
|
|
@ -36,6 +36,7 @@ AchievablePlugin = (schema, options) ->
|
||||||
for achievement in loadedAchievements[category]
|
for achievement in loadedAchievements[category]
|
||||||
do (achievement) ->
|
do (achievement) ->
|
||||||
query = achievement.get('query')
|
query = achievement.get('query')
|
||||||
|
return log.warn("Empty achievement query for #{achievement.get('name')}.") if _.isEmpty query
|
||||||
isRepeatable = achievement.get('proportionalTo')?
|
isRepeatable = achievement.get('proportionalTo')?
|
||||||
alreadyAchieved = if isNew then false else LocalMongo.matchesQuery originalDocObj, query
|
alreadyAchieved = if isNew then false else LocalMongo.matchesQuery originalDocObj, query
|
||||||
newlyAchieved = LocalMongo.matchesQuery(docObj, query)
|
newlyAchieved = LocalMongo.matchesQuery(docObj, query)
|
||||||
|
|
Loading…
Reference in a new issue