Added callout to become an Adventurer on disabled levels.

This commit is contained in:
Nick Winter 2014-11-09 21:27:03 -08:00
parent 111b9febac
commit 85471badaa
4 changed files with 27 additions and 387 deletions

View file

@ -68,6 +68,9 @@
anonymous: "Anonymous Player"
level_difficulty: "Difficulty: "
campaign_beginner: "Beginner Campaign"
awaiting_levels_adventurer_prefix: "We release five levels per week."
awaiting_levels_adventurer: "Sign up as an Adventurer"
awaiting_levels_adventurer_suffix: "to be the first to play new levels."
choose_your_level: "Choose Your Level" # The rest of this section is the old play view at /play-old and isn't very important.
adventurer_prefix: "You can jump to any level below, or discuss the levels on "
adventurer_forum: "the Adventurer forum"

View file

@ -18,9 +18,13 @@
div(class="level-info " + (levelStatusMap[level.id] || ""))
h3= level.name + (level.disabled ? " (Coming soon!)" : (level.locked ? " (Locked)" : ""))
.level-description= level.description
span(data-i18n="play.level_difficulty") Difficulty:
each i in Array(level.difficulty)
i.icon-star
if level.disabled
p
span.spr(data-i18n="play.awaiting_levels_adventurer_prefix") We release five levels per week.
a.spr(href="/contribute/adventurer")
strong(data-i18n="play.awaiting_levels_adventurer") Sign up as an Adventurer
span.spl(data-i18n="play.awaiting_levels_adventurer_suffix") to be the first to play new levels.
- var playCount = levelPlayCountMap[level.id]
if playCount && playCount.sessions > 20
div
@ -29,7 +33,7 @@
span.spr , #{Math.round(playCount.playtime / 3600)}
span(data-i18n="play.hours_played") hours played
.campaign-label(style="color: #{campaign.color}")= campaign.name
if isIPadApp
if isIPadApp && !level.disabled && !level.locked
button.btn.btn-success.btn-lg.start-level(data-i18n="common.play") Play
.game-controls.header-font

View file

@ -58,6 +58,7 @@ module.exports = class RootView extends CocoView
@openModalView new AuthModal {}
onClickAnchor: (e) ->
return if @destroyed
anchorText = e?.currentTarget?.text
window.tracker?.trackEvent 'Homepage', Action: anchorText if @id is 'home-view' and anchorText
@toggleModal e
@ -110,7 +111,7 @@ module.exports = class RootView extends CocoView
@addLanguagesToSelect($select, preferred)
$select.fancySelect().parent().find('.trigger').addClass('header-font')
$('body').attr('lang', preferred)
addLanguagesToSelect: ($select, initialVal) ->
initialVal ?= me.get('preferredLanguage', true)
codes = _.keys(locale)

View file

@ -135,20 +135,27 @@ module.exports = class WorldMapView extends RootView
e.preventDefault()
e.stopPropagation()
@$levelInfo?.hide()
return if $(e.target).attr('disabled') or $(e.target).parent().hasClass 'locked'
if application.isIPadApp
levelID = $(e.target).parents('.level').data('level-id')
@$levelInfo = @$el.find(".level-info-container[data-level-id=#{levelID}]").show()
@adjustLevelInfoPosition e
@endHighlight()
else
levelElement = $(e.target).parents('.level')
levelID = levelElement.data('level-id')
@startLevel levelElement
window.tracker?.trackEvent 'World Map', Action: 'Play Level', levelID: levelID
if $(e.target).attr('disabled')
Backbone.Mediator.publish 'router:navigate', route: '/contribute/adventurer'
return
else if $(e.target).parent().hasClass 'locked'
return
else
levelElement = $(e.target).parents('.level')
levelID = levelElement.data('level-id')
@startLevel levelElement
window.tracker?.trackEvent 'World Map', Action: 'Play Level', levelID: levelID
onClickStartLevel: (e) ->
@startLevel $(e.target).parents('.level-info-container')
levelElement = $(e.target).parents('.level-info-container')
@startLevel levelElement
window.tracker?.trackEvent 'World Map', Action: 'Play Level', levelID: levelElement.data('level-id')
startLevel: (levelElement) ->
@setupManager?.destroy()
@ -274,347 +281,10 @@ module.exports = class WorldMapView extends RootView
@updateVolume volumes[newI]
tutorials = [
{
name: 'Rescue Mission'
difficulty: 1
id: 'rescue-mission'
image: '/file/db/level/52740644904ac0411700067c/rescue_mission_icon.png'
description: 'Tharin has been captured! Start here.'
x: 17.23
y: 36.94
}
{
name: 'Grab the Mushroom'
difficulty: 1
id: 'grab-the-mushroom'
image: '/file/db/level/529662dfe0df8f0000000007/grab_the_mushroom_icon.png'
description: 'Grab a powerup and smash a big ogre.'
x: 22.6
y: 35.1
}
{
name: 'Drink Me'
difficulty: 1
id: 'drink-me'
image: '/file/db/level/525dc5589a0765e496000006/drink_me_icon.png'
description: 'Drink up and slay two munchkins.'
x: 27.74
y: 35.17
}
{
name: 'Taunt the Guards'
difficulty: 1
id: 'taunt-the-guards'
image: '/file/db/level/5276c9bdcf83207a2801ff8f/taunt_icon.png'
description: 'Tharin, if clever, can escape with Phoebe.'
x: 32.7
y: 36.7
}
{
name: 'It\'s a Trap'
difficulty: 1
id: 'its-a-trap'
image: '/file/db/level/528aea2d7f37fc4e0700016b/its_a_trap_icon.png'
description: 'Organize a dungeon ambush with archers.'
x: 37.6
y: 40.0
}
{
name: 'Break the Prison'
difficulty: 1
id: 'break-the-prison'
image: '/file/db/level/5275272c69abdcb12401216e/break_the_prison_icon.png'
description: 'More comrades are imprisoned!'
x: 44.1
y: 39.5
}
{
name: 'Taunt'
difficulty: 1
id: 'taunt'
image: '/file/db/level/525f150306e1ab0962000018/taunt_icon.png'
description: 'Taunt the ogre to claim victory.'
x: 38.5
y: 44.1
}
{
name: 'Cowardly Taunt'
difficulty: 1
id: 'cowardly-taunt'
image: '/file/db/level/525abfd9b12777d78e000009/cowardly_taunt_icon.png'
description: 'Lure infuriated ogres to their doom.'
x: 39.2
y: 50.1
}
{
name: 'Commanding Followers'
difficulty: 1
id: 'commanding-followers'
image: '/file/db/level/525ef8ef06e1ab0962000003/commanding_followers_icon.png'
description: 'Lead allied soldiers into battle.'
x: 39.1
y: 54.7
}
{
name: 'Mobile Artillery'
difficulty: 1
id: 'mobile-artillery'
image: '/file/db/level/525085419851b83f4b000001/mobile_artillery_icon.png'
description: 'Blow ogres up!'
x: 39.5
y: 60.2
}
]
experienced = [
{
name: 'Hunter Triplets'
difficulty: 2
id: 'hunter-triplets'
image: '/file/db/level/526711d9add4f8965f000002/hunter_triplets_icon.png'
description: 'Three soldiers go ogre hunting.'
x: 51.76
y: 35.5
}
{
name: 'Emphasis on Aim'
difficulty: 2
id: 'emphasis-on-aim'
image: '/file/db/level/525f384d96cd77000000000f/munchkin_masher_icon.png'
description: 'Choose your targets carefully.'
x: 61.47
y: 33.46
}
{
name: 'Zone of Danger'
difficulty: 3
id: 'zone-of-danger'
image: '/file/db/level/526ae95c1e5cd30000000008/zone_of_danger_icon.png'
description: 'Target the ogres swarming into arrow range.'
x: 65.72
y: 26.72
}
{
name: 'Molotov Medic'
difficulty: 2
id: 'molotov-medic'
image: '/file/db/level/52602ecb026e8481e7000001/generic_1.png'
description: 'Tharin must play support in this dungeon battle.'
x: 70.95
y: 18.64
}
{
name: 'Gridmancer'
difficulty: 5
id: 'gridmancer'
image: '/file/db/level/52ae2460ef42c52f13000008/gridmancer_icon.png'
description: 'Super algorithm challenge level!'
x: 61.41
y: 17.22
}
]
arenas = [
{
name: 'Criss-Cross'
difficulty: 5
id: 'criss-cross'
image: '/file/db/level/528aea2d7f37fc4e0700016b/its_a_trap_icon.png'
description: 'Participate in a bidding war with opponents to reach the other side!'
levelPath: 'ladder'
x: 49.43
y: 21.48
}
{
name: 'Greed'
difficulty: 4
id: 'greed'
image: '/file/db/level/526fd3043c637ece50001bb2/the_herd_icon.png'
description: 'Liked Dungeon Arena and Gold Rush? Put them together in this economic arena!'
levelPath: 'ladder'
x: 45.00
y: 23.34
}
{
name: 'Dungeon Arena'
difficulty: 3
id: 'dungeon-arena'
image: '/file/db/level/526ae95c1e5cd30000000008/zone_of_danger_icon.png'
description: 'Play head-to-head against fellow Wizards in a dungeon melee!'
levelPath: 'ladder'
x: 36.82
y: 23.17
}
{
name: 'Gold Rush'
difficulty: 3
id: 'gold-rush'
image: '/file/db/level/52602ecb026e8481e7000001/generic_1.png'
description: 'Prove you are better at collecting gold than your opponent!'
levelPath: 'ladder'
x: 30.8
y: 16.87
}
{
name: 'Brawlwood'
difficulty: 4
id: 'brawlwood'
image: '/file/db/level/525ef8ef06e1ab0962000003/commanding_followers_icon.png'
description: 'Combat the armies of other Wizards in a strategic forest arena! (Fast computer required.)'
levelPath: 'ladder'
x: 41.93
y: 12.79
}
{
name: 'Sky Span (Testing)'
difficulty: 3
id: 'sky-span'
image: '/file/db/level/526ae95c1e5cd30000000008/zone_of_danger_icon.png'
description: 'Preview version of an upgraded Dungeon Arena. Help us with hero balance before release!'
levelPath: 'ladder'
x: 53.12
y: 11.37
}
]
classicAlgorithms = [
{
name: 'Bubble Sort Bootcamp Battle'
difficulty: 3
id: 'bubble-sort-bootcamp-battle'
image: '/file/db/level/525ef8ef06e1ab0962000003/commanding_followers_icon.png'
description: 'Write a bubble sort to organize your soldiers. - by Alexandru Caciulescu'
x: 26.37
y: 93.02
}
{
name: 'Ogres of Hanoi'
difficulty: 3
id: 'ogres-of-hanoi'
image: '/file/db/level/526fd3043c637ece50001bb2/the_herd_icon.png'
description: 'Transfer a stack of ogres while preserving their honor. - by Alexandru Caciulescu'
x: 32.39
y: 92.67
}
{
name: 'Danger! Minefield'
difficulty: 3
id: 'danger-minefield'
image: '/file/db/level/526bda3fe79aefde2a003e36/mobile_artillery_icon.png'
description: 'Learn how to find prime numbers while defusing mines! - by Alexandru Caciulescu'
x: 38.07
y: 92.76
}
{
name: 'K-means++ Cluster Wars'
difficulty: 4
id: 'k-means-cluster-wars'
image: '/file/db/level/525ef8ef06e1ab0962000003/commanding_followers_icon.png'
description: 'Learn cluster analysis while leading armies into battle! - by Alexandru Caciulescu'
x: 43.75
y: 90.36
}
{
name: 'Quicksort the Spiral'
difficulty: 3
id: 'quicksort-the-spiral'
image: '/file/db/level/525ef8ef06e1ab0962000003/commanding_followers_icon.png'
description: 'Learn Quicksort while sorting a spiral of ogres! - by Alexandru Caciulescu'
x: 48.97
y: 87.08
}
{
name: 'Minimax Tic-Tac-Toe'
difficulty: 4
id: 'minimax-tic-tac-toe'
image: '/file/db/level/525ef8ef06e1ab0962000003/commanding_followers_icon.png'
description: 'Learn how to make a game AI with the Minimax algorithm. - by Alexandru Caciulescu'
x: 55.96
y: 82.73
}
]
playerCreated = [
{
name: 'Extra Extrapolation'
difficulty: 2
id: 'extra-extrapolation'
image: '/file/db/level/526bda3fe79aefde2a003e36/mobile_artillery_icon.png'
description: 'Predict your target\'s position for deadly aim. - by Sootn'
x: 42.67
y: 67.98
}
{
name: 'The Right Route'
difficulty: 1
id: 'the-right-route'
image: '/file/db/level/526fd3043c637ece50001bb2/the_herd_icon.png'
description: 'Strike at the weak point in an array of enemies. - by Aftermath'
x: 47.38
y: 70.55
}
{
name: 'Sword Loop'
difficulty: 2
id: 'sword-loop'
image: '/file/db/level/525dc5589a0765e496000006/drink_me_icon.png'
description: 'Kill the ogres and save the peasants with for-loops. - by Prabh Simran Singh Baweja'
x: 52.66
y: 69.66
}
{
name: 'Coin Mania'
difficulty: 2
id: 'coin-mania'
image: '/file/db/level/529662dfe0df8f0000000007/grab_the_mushroom_icon.png'
description: 'Learn while-loops to grab coins and potions. - by Prabh Simran Singh Baweja'
x: 58.46
y: 66.38
}
{
name: 'Find the Spy'
difficulty: 2
id: 'find-the-spy'
image: '/file/db/level/526ae95c1e5cd30000000008/zone_of_danger_icon.png'
description: 'Identify the spies hidden among your soldiers - by Nathan Gossett'
x: 63.11
y: 62.74
}
{
name: 'Harvest Time'
difficulty: 2
id: 'harvest-time'
image: '/file/db/level/529662dfe0df8f0000000007/grab_the_mushroom_icon.png'
description: 'Collect a hundred mushrooms in just five lines of code - by Nathan Gossett'
x: 69.19
y: 60.61
}
{
name: 'Guide Everyone Home'
difficulty: 2
id: 'guide-everyone-home'
image: '/file/db/level/52740644904ac0411700067c/rescue_mission_icon.png'
description: 'Fetch the wizards teleporting into the area - by Nathan Gossett'
x: 77.54
y: 65.94
}
{
name: "Let's go Fly a Kite"
difficulty: 3
id: 'lets-go-fly-a-kite'
image: '/file/db/level/526711d9add4f8965f000002/hunter_triplets_icon.png'
description: 'There is a horde of ogres marching on your village. Stay out of reach and use your bow to take them out! - by Danny Whittaker'
x: 84.29
y: 61.23
}
]
dungeon = [
{
name: 'Dungeons of Kithgard'
type: 'hero'
difficulty: 1
id: 'dungeons-of-kithgard'
original: '528110f30268d018e3000001'
description: 'Grab the gem, but touch nothing else. Start here.'
@ -627,7 +297,6 @@ dungeon = [
{
name: 'Gems in the Deep'
type: 'hero'
difficulty: 1
id: 'gems-in-the-deep'
original: '54173c90844506ae0195a0b4'
description: 'Quickly collect the gems; you will need them.'
@ -640,7 +309,6 @@ dungeon = [
{
name: 'Shadow Guard'
type: 'hero'
difficulty: 1
id: 'shadow-guard'
original: '54174347844506ae0195a0b8'
description: 'Evade the Kithgard minion.'
@ -653,7 +321,6 @@ dungeon = [
{
name: 'Kounter Kithwise'
type: 'hero'
difficulty: 1
id: 'kounter-kithwise'
original: '54527a6257e83800009730c7'
description: 'Practice your evasion skills with more guards.'
@ -667,8 +334,7 @@ dungeon = [
#{
# name: 'Crawlways of Kithgard'
# type: 'hero'
# difficulty: 1
# id: 'crawlways-of-kithgard'
# # id: 'crawlways-of-kithgard'
# original: '545287ef57e83800009730d5'
# description: 'Dart in and grab the gemat the right moment.'
# x: 57
@ -680,7 +346,6 @@ dungeon = [
{
name: 'Forgetful Gemsmith'
type: 'hero'
difficulty: 1
id: 'forgetful-gemsmith'
original: '544a98f62d002f0000fe331a'
description: 'Grab even more gems as you practice moving.'
@ -692,7 +357,6 @@ dungeon = [
{
name: 'True Names'
type: 'hero'
difficulty: 1
id: 'true-names'
original: '541875da4c16460000ab990f'
description: 'Learn an enemy\'s true name to defeat it.'
@ -705,7 +369,6 @@ dungeon = [
{
name: 'Favorable Odds'
type: 'hero'
difficulty: 1
id: 'favorable-odds'
original: '5452972f57e83800009730de'
description: 'Test out your battle skills by defeating more munchkins.'
@ -718,7 +381,6 @@ dungeon = [
{
name: 'The Raised Sword'
type: 'hero'
difficulty: 1
id: 'the-raised-sword'
original: '5418aec24c16460000ab9aa6'
description: 'Learn to equip yourself for combat.'
@ -730,7 +392,6 @@ dungeon = [
{
name: 'The First Kithmaze'
type: 'hero'
difficulty: 1
id: 'the-first-kithmaze'
original: '5418b9d64c16460000ab9ab4'
description: 'The builders of Kithgard constructed many mazes to confuse travelers.'
@ -744,7 +405,6 @@ dungeon = [
{
name: 'Haunted Kithmaze'
type: 'hero'
difficulty: 1
id: 'haunted-kithmaze'
original: '545a5914d820eb0000f6dc0a'
description: 'The builders of Kithgard constructed many mazes to confuse travelers.'
@ -758,7 +418,6 @@ dungeon = [
{
name: 'Descending Further'
type: 'hero'
difficulty: 1
id: 'descending-further'
original: '5452a84d57e83800009730e4'
description: 'Another day, another maze.'
@ -771,7 +430,6 @@ dungeon = [
{
name: 'The Second Kithmaze'
type: 'hero'
difficulty: 1
id: 'the-second-kithmaze'
original: '5418cf256bae62f707c7e1c3'
description: 'Many have tried, few have found their way through this maze.'
@ -783,7 +441,6 @@ dungeon = [
{
name: 'Dread Door'
type: 'hero'
difficulty: 1
id: 'dread-door'
original: '5418d40f4c16460000ab9ac2'
description: 'Behind a dread door lies a chest full of riches.'
@ -795,7 +452,6 @@ dungeon = [
{
name: 'Known Enemy'
type: 'hero'
difficulty: 1
id: 'known-enemy'
original: '5452adea57e83800009730ee'
description: 'Begin to use variables in your battles.'
@ -807,7 +463,6 @@ dungeon = [
{
name: 'Master of Names'
type: 'hero'
difficulty: 1
id: 'master-of-names'
original: '5452c3ce57e83800009730f7'
description: 'Use your glasses to defend yourself from the Kithmen.'
@ -820,7 +475,6 @@ dungeon = [
{
name: 'Lowly Kithmen'
type: 'hero'
difficulty: 1
id: 'lowly-kithmen'
original: '541b24511ccc8eaae19f3c1f'
description: 'Now that you can see them, they\'re everywhere!'
@ -833,7 +487,6 @@ dungeon = [
{
name: 'Closing the Distance'
type: 'hero'
difficulty: 1
id: 'closing-the-distance'
original: '541b288e1ccc8eaae19f3c25'
description: 'Kithmen are not the only ones to stand in your way.'
@ -846,7 +499,6 @@ dungeon = [
{
name: 'Tactical Strike'
type: 'hero'
difficulty: 1
id: 'tactical-strike'
original: '5452cfa706a59e000067e4f5'
description: 'They\'re, uh, coming right for us! Sneak up behind them.'
@ -859,7 +511,6 @@ dungeon = [
{
name: 'The Final Kithmaze'
type: 'hero'
difficulty: 1
id: 'the-final-kithmaze'
original: '541b434e1ccc8eaae19f3c33'
description: 'To escape you must find your way through an Elder Kithman\'s maze.'
@ -872,7 +523,6 @@ dungeon = [
{
name: 'The Gauntlet'
type: 'hero'
difficulty: 1
id: 'the-gauntlet'
original: '5452d8b906a59e000067e4fa'
description: 'Rush for the stairs, battling foes at every turn.'
@ -885,7 +535,6 @@ dungeon = [
{
name: 'Kithgard Gates'
type: 'hero'
difficulty: 1
id: 'kithgard-gates'
original: '541c9a30c6362edfb0f34479'
description: 'Escape the Kithgard dungeons and don\'t let the guardians get you.'
@ -897,7 +546,6 @@ dungeon = [
{
name: 'Cavern Survival'
type: 'hero-ladder'
difficulty: 1
id: 'cavern-survival'
original: '544437e0645c0c0000c3291d'
description: 'Stay alive longer than your opponent amidst hordes of ogres!'
@ -911,7 +559,6 @@ forest = [
{
name: 'Defense of Plainswood'
type: 'hero'
difficulty: 1
id: 'defense-of-plainswood'
original: '541b67f71ccc8eaae19f3c62'
description: 'Protect the peasants from the pursuing ogres.'
@ -923,7 +570,6 @@ forest = [
{
name: 'Winding Trail'
type: 'hero'
difficulty: 1
id: 'winding-trail'
original: '5446cb40ce01c23e05ecf027'
description: 'Stay alive and navigate through the forest.'
@ -935,7 +581,6 @@ forest = [
{
name: 'Thornbush Farm'
type: 'hero'
difficulty: 1
id: 'thornbush-farm'
original: '5447030525cce60000745e2a'
description: 'Determine refugee peasant from ogre when defending the farm.'
@ -947,7 +592,6 @@ forest = [
{
name: 'A Fiery Trap'
type: 'hero'
difficulty: 1
id: 'a-fiery-trap'
original: '5448330517d7283e051f9b9e'
description: 'Patrol the village entrances, but stay defensive.'
@ -959,7 +603,6 @@ forest = [
{
name: 'Ogre Encampment'
type: 'hero'
difficulty: 1
id: 'ogre-encampment'
description: 'Recover stolen treasure from an ogre encampment.'
nextLevels:
@ -970,7 +613,6 @@ forest = [
{
name: 'Woodland Cleaver'
type: 'hero'
difficulty: 1
id: 'woodland-cleaver'
description: 'Use your new cleave ability to fend off munchkins.'
nextLevels:
@ -981,7 +623,6 @@ forest = [
{
name: 'Shield Rush'
type: 'hero'
difficulty: 1
id: 'shield-rush'
description: 'Combine cleave and shield to endure an ogre onslaught.'
nextLevels:
@ -992,7 +633,6 @@ forest = [
{
name: 'Peasant Protection'
type: 'hero'
difficulty: 1
id: 'peasant-protection'
description: 'Stay close to Victor.'
nextLevels:
@ -1003,7 +643,6 @@ forest = [
{
name: 'Munchkin Swarm'
type: 'hero'
difficulty: 1
id: 'munchkin-swarm'
description: 'Loot a gigantic chest while surrounded by a swarm of ogre munchkins.'
nextLevels:
@ -1014,7 +653,6 @@ forest = [
{
name: 'Coinucopia'
type: 'hero'
difficulty: 1
id: 'coinucopia'
description: 'Start playing in real-time with input flags as you collect gold coins!'
disabled: not me.isAdmin()
@ -1026,7 +664,6 @@ forest = [
{
name: 'Copper Meadows'
type: 'hero'
difficulty: 1
id: 'copper-meadows'
description: 'grab the coins'
disabled: not me.isAdmin()
@ -1038,7 +675,6 @@ forest = [
{
name: 'Drop the Flag'
type: 'hero'
difficulty: 1
id: 'drop-the-flag'
description: 'it is hot'
disabled: not me.isAdmin()
@ -1050,7 +686,6 @@ forest = [
{
name: 'Rich Forager'
type: 'hero'
difficulty: 1
id: 'rich-forager'
description: 'if i were a rich man'
disabled: not me.isAdmin()
@ -1062,7 +697,6 @@ forest = [
{
name: 'Deadly Pursuit'
type: 'hero'
difficulty: 1
id: 'deadly-pursuit'
description: 'what is a dirt nap? it is death.'
disabled: not me.isAdmin()
@ -1074,7 +708,6 @@ forest = [
{
name: 'Multiplayer Treasure Grove'
type: 'hero'
difficulty: 1
id: 'multiplayer-treasure-grove'
description: 'show em who is the professional boss'
disabled: not me.isAdmin()
@ -1084,7 +717,6 @@ forest = [
{
name: 'Dueling Grounds'
type: 'hero-ladder'
difficulty: 1
id: 'dueling-grounds'
original: '5442ba0e1e835500007eb1c7'
description: 'Battle head-to-head against another hero in this basic beginner combat arena.'