diff --git a/public/img/BrowserQuest/achievements.png b/public/img/BrowserQuest/achievements.png new file mode 100644 index 0000000000..1dccc7dde5 Binary files /dev/null and b/public/img/BrowserQuest/achievements.png differ diff --git a/public/img/BrowserQuest/agent.png b/public/img/BrowserQuest/agent.png new file mode 100644 index 0000000000..99240b7f4f Binary files /dev/null and b/public/img/BrowserQuest/agent.png differ diff --git a/public/img/BrowserQuest/axe.png b/public/img/BrowserQuest/axe.png new file mode 100644 index 0000000000..e0cd012ff3 Binary files /dev/null and b/public/img/BrowserQuest/axe.png differ diff --git a/public/img/BrowserQuest/barsheet.png b/public/img/BrowserQuest/barsheet.png new file mode 100644 index 0000000000..d7f88de1cf Binary files /dev/null and b/public/img/BrowserQuest/barsheet.png differ diff --git a/public/img/BrowserQuest/bat.png b/public/img/BrowserQuest/bat.png new file mode 100644 index 0000000000..8c61404684 Binary files /dev/null and b/public/img/BrowserQuest/bat.png differ diff --git a/public/img/BrowserQuest/beachnpc.png b/public/img/BrowserQuest/beachnpc.png new file mode 100644 index 0000000000..92c1f6969b Binary files /dev/null and b/public/img/BrowserQuest/beachnpc.png differ diff --git a/public/img/BrowserQuest/bluesword.png b/public/img/BrowserQuest/bluesword.png new file mode 100644 index 0000000000..2b04024a47 Binary files /dev/null and b/public/img/BrowserQuest/bluesword.png differ diff --git a/public/img/BrowserQuest/border.png b/public/img/BrowserQuest/border.png new file mode 100644 index 0000000000..f4ddd1dd35 Binary files /dev/null and b/public/img/BrowserQuest/border.png differ diff --git a/public/img/BrowserQuest/boss.png b/public/img/BrowserQuest/boss.png new file mode 100644 index 0000000000..f7099d589e Binary files /dev/null and b/public/img/BrowserQuest/boss.png differ diff --git a/public/img/BrowserQuest/chest.png b/public/img/BrowserQuest/chest.png new file mode 100644 index 0000000000..8067b019bf Binary files /dev/null and b/public/img/BrowserQuest/chest.png differ diff --git a/public/img/BrowserQuest/clotharmor.png b/public/img/BrowserQuest/clotharmor.png new file mode 100644 index 0000000000..a9467fefc9 Binary files /dev/null and b/public/img/BrowserQuest/clotharmor.png differ diff --git a/public/img/BrowserQuest/coder.png b/public/img/BrowserQuest/coder.png new file mode 100644 index 0000000000..b6f8b9c6be Binary files /dev/null and b/public/img/BrowserQuest/coder.png differ diff --git a/public/img/BrowserQuest/crab.png b/public/img/BrowserQuest/crab.png new file mode 100644 index 0000000000..448d57312c Binary files /dev/null and b/public/img/BrowserQuest/crab.png differ diff --git a/public/img/BrowserQuest/death.png b/public/img/BrowserQuest/death.png new file mode 100644 index 0000000000..b578239152 Binary files /dev/null and b/public/img/BrowserQuest/death.png differ diff --git a/public/img/BrowserQuest/deathknight.png b/public/img/BrowserQuest/deathknight.png new file mode 100644 index 0000000000..3d8a109731 Binary files /dev/null and b/public/img/BrowserQuest/deathknight.png differ diff --git a/public/img/BrowserQuest/desertnpc.png b/public/img/BrowserQuest/desertnpc.png new file mode 100644 index 0000000000..60ef8c0b5b Binary files /dev/null and b/public/img/BrowserQuest/desertnpc.png differ diff --git a/public/img/BrowserQuest/eye.png b/public/img/BrowserQuest/eye.png new file mode 100644 index 0000000000..ee66ca27a8 Binary files /dev/null and b/public/img/BrowserQuest/eye.png differ diff --git a/public/img/BrowserQuest/favicon.png b/public/img/BrowserQuest/favicon.png new file mode 100644 index 0000000000..a1783aac99 Binary files /dev/null and b/public/img/BrowserQuest/favicon.png differ diff --git a/public/img/BrowserQuest/firefox.png b/public/img/BrowserQuest/firefox.png new file mode 100644 index 0000000000..6c18770e5c Binary files /dev/null and b/public/img/BrowserQuest/firefox.png differ diff --git a/public/img/BrowserQuest/forestnpc.png b/public/img/BrowserQuest/forestnpc.png new file mode 100644 index 0000000000..656289ce66 Binary files /dev/null and b/public/img/BrowserQuest/forestnpc.png differ diff --git a/public/img/BrowserQuest/goblin.png b/public/img/BrowserQuest/goblin.png new file mode 100644 index 0000000000..c6988e4578 Binary files /dev/null and b/public/img/BrowserQuest/goblin.png differ diff --git a/public/img/BrowserQuest/goldenarmor.png b/public/img/BrowserQuest/goldenarmor.png new file mode 100644 index 0000000000..9749bd7bf6 Binary files /dev/null and b/public/img/BrowserQuest/goldenarmor.png differ diff --git a/public/img/BrowserQuest/goldensword.png b/public/img/BrowserQuest/goldensword.png new file mode 100644 index 0000000000..3ca4993f92 Binary files /dev/null and b/public/img/BrowserQuest/goldensword.png differ diff --git a/public/img/BrowserQuest/guard.png b/public/img/BrowserQuest/guard.png new file mode 100644 index 0000000000..c817c65d42 Binary files /dev/null and b/public/img/BrowserQuest/guard.png differ diff --git a/public/img/avatar/dead.png b/public/img/BrowserQuest/habitrpg_mods/armor0.png similarity index 60% rename from public/img/avatar/dead.png rename to public/img/BrowserQuest/habitrpg_mods/armor0.png index 4a5e41621e..1840cafffa 100644 Binary files a/public/img/avatar/dead.png and b/public/img/BrowserQuest/habitrpg_mods/armor0.png differ diff --git a/public/img/avatar/2.png b/public/img/BrowserQuest/habitrpg_mods/armor1.png similarity index 54% rename from public/img/avatar/2.png rename to public/img/BrowserQuest/habitrpg_mods/armor1.png index d1017c137c..bf8287a17b 100644 Binary files a/public/img/avatar/2.png and b/public/img/BrowserQuest/habitrpg_mods/armor1.png differ diff --git a/public/img/BrowserQuest/habitrpg_mods/armor2.png b/public/img/BrowserQuest/habitrpg_mods/armor2.png new file mode 100644 index 0000000000..1e0bbc0483 Binary files /dev/null and b/public/img/BrowserQuest/habitrpg_mods/armor2.png differ diff --git a/public/img/BrowserQuest/habitrpg_mods/armor3.png b/public/img/BrowserQuest/habitrpg_mods/armor3.png new file mode 100644 index 0000000000..325be1e4e6 Binary files /dev/null and b/public/img/BrowserQuest/habitrpg_mods/armor3.png differ diff --git a/public/img/BrowserQuest/habitrpg_mods/armor4.png b/public/img/BrowserQuest/habitrpg_mods/armor4.png new file mode 100644 index 0000000000..de3f698563 Binary files /dev/null and b/public/img/BrowserQuest/habitrpg_mods/armor4.png differ diff --git a/public/img/BrowserQuest/habitrpg_mods/armor5.png b/public/img/BrowserQuest/habitrpg_mods/armor5.png new file mode 100644 index 0000000000..6dcb9e3f7d Binary files /dev/null and b/public/img/BrowserQuest/habitrpg_mods/armor5.png differ diff --git a/public/img/BrowserQuest/habitrpg_mods/favicon.png b/public/img/BrowserQuest/habitrpg_mods/favicon.png new file mode 100644 index 0000000000..a1783aac99 Binary files /dev/null and b/public/img/BrowserQuest/habitrpg_mods/favicon.png differ diff --git a/public/img/BrowserQuest/habitrpg_mods/weapon0.png b/public/img/BrowserQuest/habitrpg_mods/weapon0.png new file mode 100644 index 0000000000..f4c30d7e05 Binary files /dev/null and b/public/img/BrowserQuest/habitrpg_mods/weapon0.png differ diff --git a/public/img/BrowserQuest/habitrpg_mods/weapon1.png b/public/img/BrowserQuest/habitrpg_mods/weapon1.png new file mode 100644 index 0000000000..4ce8fb9407 Binary files /dev/null and b/public/img/BrowserQuest/habitrpg_mods/weapon1.png differ diff --git a/public/img/BrowserQuest/habitrpg_mods/weapon2.png b/public/img/BrowserQuest/habitrpg_mods/weapon2.png new file mode 100644 index 0000000000..823bad1c17 Binary files /dev/null and b/public/img/BrowserQuest/habitrpg_mods/weapon2.png differ diff --git a/public/img/BrowserQuest/habitrpg_mods/weapon3.png b/public/img/BrowserQuest/habitrpg_mods/weapon3.png new file mode 100644 index 0000000000..7151d9a5d3 Binary files /dev/null and b/public/img/BrowserQuest/habitrpg_mods/weapon3.png differ diff --git a/public/img/BrowserQuest/habitrpg_mods/weapon4.png b/public/img/BrowserQuest/habitrpg_mods/weapon4.png new file mode 100644 index 0000000000..4c3f6e3996 Binary files /dev/null and b/public/img/BrowserQuest/habitrpg_mods/weapon4.png differ diff --git a/public/img/BrowserQuest/habitrpg_mods/weapon5.png b/public/img/BrowserQuest/habitrpg_mods/weapon5.png new file mode 100644 index 0000000000..1fe8eb0e11 Binary files /dev/null and b/public/img/BrowserQuest/habitrpg_mods/weapon5.png differ diff --git a/public/img/BrowserQuest/habitrpg_mods/weapon6.png b/public/img/BrowserQuest/habitrpg_mods/weapon6.png new file mode 100644 index 0000000000..ad2f524fab Binary files /dev/null and b/public/img/BrowserQuest/habitrpg_mods/weapon6.png differ diff --git a/public/img/BrowserQuest/hand.png b/public/img/BrowserQuest/hand.png new file mode 100644 index 0000000000..01122fbc1b Binary files /dev/null and b/public/img/BrowserQuest/hand.png differ diff --git a/public/img/BrowserQuest/item-axe.png b/public/img/BrowserQuest/item-axe.png new file mode 100644 index 0000000000..823bad1c17 Binary files /dev/null and b/public/img/BrowserQuest/item-axe.png differ diff --git a/public/img/BrowserQuest/item-bluesword.png b/public/img/BrowserQuest/item-bluesword.png new file mode 100644 index 0000000000..53d9faf714 Binary files /dev/null and b/public/img/BrowserQuest/item-bluesword.png differ diff --git a/public/img/BrowserQuest/item-burger.png b/public/img/BrowserQuest/item-burger.png new file mode 100644 index 0000000000..f4cbe6d436 Binary files /dev/null and b/public/img/BrowserQuest/item-burger.png differ diff --git a/public/img/BrowserQuest/item-cake.png b/public/img/BrowserQuest/item-cake.png new file mode 100644 index 0000000000..67c78c6944 Binary files /dev/null and b/public/img/BrowserQuest/item-cake.png differ diff --git a/public/img/avatar/1.png b/public/img/BrowserQuest/item-clotharmor.png similarity index 56% rename from public/img/avatar/1.png rename to public/img/BrowserQuest/item-clotharmor.png index 512e173f10..88c8fc6506 100644 Binary files a/public/img/avatar/1.png and b/public/img/BrowserQuest/item-clotharmor.png differ diff --git a/public/img/BrowserQuest/item-firepotion.png b/public/img/BrowserQuest/item-firepotion.png new file mode 100644 index 0000000000..5b7474eff3 Binary files /dev/null and b/public/img/BrowserQuest/item-firepotion.png differ diff --git a/public/img/avatar/8.png b/public/img/BrowserQuest/item-flask.png similarity index 55% rename from public/img/avatar/8.png rename to public/img/BrowserQuest/item-flask.png index 9a6d645402..5e1ac102e8 100644 Binary files a/public/img/avatar/8.png and b/public/img/BrowserQuest/item-flask.png differ diff --git a/public/img/BrowserQuest/item-goldenarmor.png b/public/img/BrowserQuest/item-goldenarmor.png new file mode 100644 index 0000000000..0d3b9e77eb Binary files /dev/null and b/public/img/BrowserQuest/item-goldenarmor.png differ diff --git a/public/img/BrowserQuest/item-goldensword.png b/public/img/BrowserQuest/item-goldensword.png new file mode 100644 index 0000000000..81d3fe83a2 Binary files /dev/null and b/public/img/BrowserQuest/item-goldensword.png differ diff --git a/public/img/BrowserQuest/item-leatherarmor.png b/public/img/BrowserQuest/item-leatherarmor.png new file mode 100644 index 0000000000..bc27ab5354 Binary files /dev/null and b/public/img/BrowserQuest/item-leatherarmor.png differ diff --git a/public/img/BrowserQuest/item-mailarmor.png b/public/img/BrowserQuest/item-mailarmor.png new file mode 100644 index 0000000000..222ac2a50a Binary files /dev/null and b/public/img/BrowserQuest/item-mailarmor.png differ diff --git a/public/img/BrowserQuest/item-morningstar.png b/public/img/BrowserQuest/item-morningstar.png new file mode 100644 index 0000000000..0051fb1f2a Binary files /dev/null and b/public/img/BrowserQuest/item-morningstar.png differ diff --git a/public/img/BrowserQuest/item-platearmor.png b/public/img/BrowserQuest/item-platearmor.png new file mode 100644 index 0000000000..a313038c71 Binary files /dev/null and b/public/img/BrowserQuest/item-platearmor.png differ diff --git a/public/img/BrowserQuest/item-redarmor.png b/public/img/BrowserQuest/item-redarmor.png new file mode 100644 index 0000000000..658047856f Binary files /dev/null and b/public/img/BrowserQuest/item-redarmor.png differ diff --git a/public/img/BrowserQuest/item-redsword.png b/public/img/BrowserQuest/item-redsword.png new file mode 100644 index 0000000000..d127e1611a Binary files /dev/null and b/public/img/BrowserQuest/item-redsword.png differ diff --git a/public/img/BrowserQuest/item-sword1.png b/public/img/BrowserQuest/item-sword1.png new file mode 100644 index 0000000000..f4c30d7e05 Binary files /dev/null and b/public/img/BrowserQuest/item-sword1.png differ diff --git a/public/img/BrowserQuest/item-sword2.png b/public/img/BrowserQuest/item-sword2.png new file mode 100644 index 0000000000..6b471faef7 Binary files /dev/null and b/public/img/BrowserQuest/item-sword2.png differ diff --git a/public/img/BrowserQuest/king.png b/public/img/BrowserQuest/king.png new file mode 100644 index 0000000000..1f29c0e088 Binary files /dev/null and b/public/img/BrowserQuest/king.png differ diff --git a/public/img/BrowserQuest/lavanpc.png b/public/img/BrowserQuest/lavanpc.png new file mode 100644 index 0000000000..e08b526d0a Binary files /dev/null and b/public/img/BrowserQuest/lavanpc.png differ diff --git a/public/img/BrowserQuest/leatherarmor.png b/public/img/BrowserQuest/leatherarmor.png new file mode 100644 index 0000000000..f86ef8b2df Binary files /dev/null and b/public/img/BrowserQuest/leatherarmor.png differ diff --git a/public/img/BrowserQuest/loot.png b/public/img/BrowserQuest/loot.png new file mode 100644 index 0000000000..17eca43e36 Binary files /dev/null and b/public/img/BrowserQuest/loot.png differ diff --git a/public/img/BrowserQuest/mailarmor.png b/public/img/BrowserQuest/mailarmor.png new file mode 100644 index 0000000000..db926d58f2 Binary files /dev/null and b/public/img/BrowserQuest/mailarmor.png differ diff --git a/public/img/BrowserQuest/morningstar.png b/public/img/BrowserQuest/morningstar.png new file mode 100644 index 0000000000..77f6b9404e Binary files /dev/null and b/public/img/BrowserQuest/morningstar.png differ diff --git a/public/img/BrowserQuest/nyan.png b/public/img/BrowserQuest/nyan.png new file mode 100644 index 0000000000..6e501f3b5a Binary files /dev/null and b/public/img/BrowserQuest/nyan.png differ diff --git a/public/img/BrowserQuest/octocat.png b/public/img/BrowserQuest/octocat.png new file mode 100644 index 0000000000..16f8a9505d Binary files /dev/null and b/public/img/BrowserQuest/octocat.png differ diff --git a/public/img/BrowserQuest/ogre.png b/public/img/BrowserQuest/ogre.png new file mode 100644 index 0000000000..9296df06eb Binary files /dev/null and b/public/img/BrowserQuest/ogre.png differ diff --git a/public/img/BrowserQuest/platearmor.png b/public/img/BrowserQuest/platearmor.png new file mode 100644 index 0000000000..c8b21f3410 Binary files /dev/null and b/public/img/BrowserQuest/platearmor.png differ diff --git a/public/img/BrowserQuest/priest.png b/public/img/BrowserQuest/priest.png new file mode 100644 index 0000000000..a84f729f01 Binary files /dev/null and b/public/img/BrowserQuest/priest.png differ diff --git a/public/img/BrowserQuest/rat.png b/public/img/BrowserQuest/rat.png new file mode 100644 index 0000000000..083d224903 Binary files /dev/null and b/public/img/BrowserQuest/rat.png differ diff --git a/public/img/BrowserQuest/redarmor.png b/public/img/BrowserQuest/redarmor.png new file mode 100644 index 0000000000..88e0b55adc Binary files /dev/null and b/public/img/BrowserQuest/redarmor.png differ diff --git a/public/img/BrowserQuest/redsword.png b/public/img/BrowserQuest/redsword.png new file mode 100644 index 0000000000..8307668aa9 Binary files /dev/null and b/public/img/BrowserQuest/redsword.png differ diff --git a/public/img/BrowserQuest/rick.png b/public/img/BrowserQuest/rick.png new file mode 100644 index 0000000000..55be26c3ab Binary files /dev/null and b/public/img/BrowserQuest/rick.png differ diff --git a/public/img/BrowserQuest/scientist.png b/public/img/BrowserQuest/scientist.png new file mode 100644 index 0000000000..080d36892f Binary files /dev/null and b/public/img/BrowserQuest/scientist.png differ diff --git a/public/img/BrowserQuest/shadow16.png b/public/img/BrowserQuest/shadow16.png new file mode 100644 index 0000000000..8059a838cf Binary files /dev/null and b/public/img/BrowserQuest/shadow16.png differ diff --git a/public/img/BrowserQuest/skeleton.png b/public/img/BrowserQuest/skeleton.png new file mode 100644 index 0000000000..44faf36332 Binary files /dev/null and b/public/img/BrowserQuest/skeleton.png differ diff --git a/public/img/BrowserQuest/skeleton2.png b/public/img/BrowserQuest/skeleton2.png new file mode 100644 index 0000000000..22a232fb3e Binary files /dev/null and b/public/img/BrowserQuest/skeleton2.png differ diff --git a/public/img/BrowserQuest/snake.png b/public/img/BrowserQuest/snake.png new file mode 100644 index 0000000000..5f2ee774a8 Binary files /dev/null and b/public/img/BrowserQuest/snake.png differ diff --git a/public/img/BrowserQuest/sorcerer.png b/public/img/BrowserQuest/sorcerer.png new file mode 100644 index 0000000000..6871f84435 Binary files /dev/null and b/public/img/BrowserQuest/sorcerer.png differ diff --git a/public/img/BrowserQuest/sparks.png b/public/img/BrowserQuest/sparks.png new file mode 100644 index 0000000000..cd4a4a6381 Binary files /dev/null and b/public/img/BrowserQuest/sparks.png differ diff --git a/public/img/BrowserQuest/spectre.png b/public/img/BrowserQuest/spectre.png new file mode 100644 index 0000000000..a624a35a73 Binary files /dev/null and b/public/img/BrowserQuest/spectre.png differ diff --git a/public/img/BrowserQuest/spritesheet.png b/public/img/BrowserQuest/spritesheet.png new file mode 100644 index 0000000000..7e73ddb90c Binary files /dev/null and b/public/img/BrowserQuest/spritesheet.png differ diff --git a/public/img/BrowserQuest/sword.png b/public/img/BrowserQuest/sword.png new file mode 100644 index 0000000000..563abddbae Binary files /dev/null and b/public/img/BrowserQuest/sword.png differ diff --git a/public/img/BrowserQuest/sword1.png b/public/img/BrowserQuest/sword1.png new file mode 100644 index 0000000000..0c5600627c Binary files /dev/null and b/public/img/BrowserQuest/sword1.png differ diff --git a/public/img/BrowserQuest/sword2.png b/public/img/BrowserQuest/sword2.png new file mode 100644 index 0000000000..6819c33bc5 Binary files /dev/null and b/public/img/BrowserQuest/sword2.png differ diff --git a/public/img/BrowserQuest/talk.png b/public/img/BrowserQuest/talk.png new file mode 100644 index 0000000000..12079682b9 Binary files /dev/null and b/public/img/BrowserQuest/talk.png differ diff --git a/public/img/BrowserQuest/target.png b/public/img/BrowserQuest/target.png new file mode 100644 index 0000000000..533d7ac286 Binary files /dev/null and b/public/img/BrowserQuest/target.png differ diff --git a/public/img/BrowserQuest/tilesheet.png b/public/img/BrowserQuest/tilesheet.png new file mode 100644 index 0000000000..1e95f823ed Binary files /dev/null and b/public/img/BrowserQuest/tilesheet.png differ diff --git a/public/img/BrowserQuest/villagegirl.png b/public/img/BrowserQuest/villagegirl.png new file mode 100644 index 0000000000..849a937098 Binary files /dev/null and b/public/img/BrowserQuest/villagegirl.png differ diff --git a/public/img/BrowserQuest/villager.png b/public/img/BrowserQuest/villager.png new file mode 100644 index 0000000000..656289ce66 Binary files /dev/null and b/public/img/BrowserQuest/villager.png differ diff --git a/public/img/BrowserQuest/wizard.png b/public/img/BrowserQuest/wizard.png new file mode 100644 index 0000000000..18cf1a5c63 Binary files /dev/null and b/public/img/BrowserQuest/wizard.png differ diff --git a/public/img/BrowserQuest/wood.png b/public/img/BrowserQuest/wood.png new file mode 100644 index 0000000000..2e8621b199 Binary files /dev/null and b/public/img/BrowserQuest/wood.png differ diff --git a/public/img/BrowserQuest/wood2.png b/public/img/BrowserQuest/wood2.png new file mode 100644 index 0000000000..86ae133ae8 Binary files /dev/null and b/public/img/BrowserQuest/wood2.png differ diff --git a/public/img/BrowserQuest/wood3.png b/public/img/BrowserQuest/wood3.png new file mode 100644 index 0000000000..e08cb9da3e Binary files /dev/null and b/public/img/BrowserQuest/wood3.png differ diff --git a/public/img/avatar/3.png b/public/img/avatar/3.png deleted file mode 100644 index d72e359cba..0000000000 Binary files a/public/img/avatar/3.png and /dev/null differ diff --git a/public/img/avatar/4.png b/public/img/avatar/4.png deleted file mode 100644 index 66b0200ce0..0000000000 Binary files a/public/img/avatar/4.png and /dev/null differ diff --git a/public/img/avatar/5.png b/public/img/avatar/5.png deleted file mode 100644 index 2afe04cfad..0000000000 Binary files a/public/img/avatar/5.png and /dev/null differ diff --git a/public/img/avatar/6.png b/public/img/avatar/6.png deleted file mode 100644 index 86c2204463..0000000000 Binary files a/public/img/avatar/6.png and /dev/null differ diff --git a/public/img/avatar/7.png b/public/img/avatar/7.png deleted file mode 100644 index 90e780e35a..0000000000 Binary files a/public/img/avatar/7.png and /dev/null differ diff --git a/public/img/avatar/9.png b/public/img/avatar/9.png deleted file mode 100644 index 126ca47a2d..0000000000 Binary files a/public/img/avatar/9.png and /dev/null differ diff --git a/src/app/content.coffee b/src/app/content.coffee index 51e20a11e5..e001b82d8f 100644 --- a/src/app/content.coffee +++ b/src/app/content.coffee @@ -113,4 +113,31 @@ module.exports = { placement: "right" } ] + + items: { + unlockedMessage: + title: "Item Store Unlocked" + content: "Congradulations, you have unlocked the Item Store! You can now buy weapons, armor, potions, etc. Read each item's comment for more information." + #TODO: figure out how to calculate index & type without having to store it in the JSON + weapon: [ + {type: 'weapon', index: 0, text: "Sword 1", icon: "item-sword1", notes:'', value:0} + {type: 'weapon', index: 1, text: "Sword 2", icon:'item-sword2', notes:'', value:100} + {type: 'weapon', index: 2, text: "Axe", icon:'item-axe', notes:'', value:200} + {type: 'weapon', index: 3, text: "Morningstar", icon:'item-morningstar', notes:'', value:300} + {type: 'weapon', index: 4, text: "Blue Sword", icon:'item-bluesword', notes:'', value:400} + {type: 'weapon', index: 5, text: "Red Sword", icon:'item-redsword', notes:'', value:500} + {type: 'weapon', index: 6, text: "Golden Sword", icon:'item-goldensword', notes:'', value:600} + ] + armor: [ + {type: 'armor', index: 0, text: "Cloth Armor", icon: 'item-clotharmor', notes:'', value:0} + {type: 'armor', index: 1, text: "Leather Armor", icon: 'item-leatherarmor', notes:'', value:100} + {type: 'armor', index: 2, text: "Chain Mail", icon: 'item-mailarmor', notes:'', value:200} + {type: 'armor', index: 3, text: "Plate Mail", icon: 'item-platearmor', notes:'', value:300} + {type: 'armor', index: 4, text: "Red Armor", icon: 'item-redarmor', notes:'', value:400} + {type: 'armor', index: 5, text: "Golden Armor", icon: 'item-goldenarmor', notes:'', value:500} + ] + potion: {type: 'potion', text: "Potion", notes: "Recover 15 HP", value: 100, icon: 'item-flask'} + reroll: {type: 'reroll', text: "Re-Roll", icon: 'favicon', notes: "Reset your task values to 0. Do this only if you're floundering.", value:0} + } + } diff --git a/src/app/index.coffee b/src/app/index.coffee index 5b9a1929a5..327fdc1bff 100644 --- a/src/app/index.coffee +++ b/src/app/index.coffee @@ -4,43 +4,6 @@ derby.use require('derby-ui-boot') derby.use(require('../../ui')) content = require('./content') -## ROUTES ## - -get '/', (page, model) -> - # Render page if a userId is already stored in session data - if userId = model.get '_session.userId' - return getRoom page, model, userId - - # Otherwise, select a new userId and initialize user - model.async.incr 'configs.1.nextUserId', (err, userId) -> - model.set '_session.userId', userId - model.set "users.#{userId}", - name: 'User ' + userId - money: 0 - exp: 0 - lvl: 1 - hp: 50 - getRoom page, model, userId - -getRoom = (page, model, userId) -> - - model.subscribe "users.#{userId}", (err, user) -> - model.ref '_user', user - model.refList "_habitList", "_user.tasks", "_user.habitIds" - model.refList "_dailyList", "_user.tasks", "_user.dailyIds" - model.refList "_todoList", "_user.tasks", "_user.todoIds" - model.refList "_rewardList", "_user.tasks", "_user.rewardIds" - unless model.get('_user.tasks') - model.push '_habitList', task for task in content.defaultTasks.habits - model.push '_dailyList', task for task in content.defaultTasks.dailys - model.push '_todoList', task for task in content.defaultTasks.todos - model.push '_rewardList', task for task in content.defaultTasks.rewards - - # http://tibia.wikia.com/wiki/Formula - model.fn '_tnl', '_user.lvl', (lvl) -> 50 * Math.pow(lvl, 2) - 150 * lvl + 200 - - page.render() - ## VIEW HELPERS ## view.fn 'taskClasses', (type, completed, value, hideCompleted) -> #TODO figure out how to just pass in the task model, so i can access all these properties from one object @@ -67,15 +30,105 @@ view.fn "round", (num) -> Math.round num view.fn "gold", (num) -> - num.toFixed(1).split('.')[0] if num + if num + return num.toFixed(1).split('.')[0] + else + return "0" view.fn "silver", (num) -> - num.toFixed(1).split('.')[1] if num + if num + num.toFixed(1).split('.')[1] + else + return "0" + +## ROUTES ## + +get '/', (page, model) -> + # Render page if a userId is already stored in session data + if userId = model.get '_session.userId' + return getRoom page, model, userId + + # Otherwise, select a new userId and initialize user + model.async.incr 'configs.1.nextUserId', (err, userId) -> + model.set '_session.userId', userId + model.set "users.#{userId}", + name: 'User ' + userId + getRoom page, model, userId + +getRoom = (page, model, userId) -> + + model.subscribe "users.#{userId}", (err, user) -> + model.ref '_user', user + + ### Set User Defaults ### + + # Default Items & Stats + user.setNull 'stats', { money: 0, exp: 0, lvl: 1, hp: 50 } + user.setNull 'items', { itemsEnabled: false, armor: 0, weapon: 0 } + model.set '_items' + armor: content.items.armor[parseInt(user.get('items.armor')) + 1] + weapon: content.items.weapon[parseInt(user.get('items.weapon')) + 1] + potion: content.items.potion + reroll: content.items.reroll + + # http://tibia.wikia.com/wiki/Formula + model.fn '_tnl', '_user.stats.lvl', (lvl) -> 50 * Math.pow(lvl, 2) - 150 * lvl + 200 + + # Default Tasks + model.refList "_habitList", "_user.tasks", "_user.habitIds" + model.refList "_dailyList", "_user.tasks", "_user.dailyIds" + model.refList "_todoList", "_user.tasks", "_user.todoIds" + model.refList "_rewardList", "_user.tasks", "_user.rewardIds" + unless model.get('_user.tasks') + model.push '_habitList', task for task in content.defaultTasks.habits + model.push '_dailyList', task for task in content.defaultTasks.dailys + model.push '_todoList', task for task in content.defaultTasks.todos + model.push '_rewardList', task for task in content.defaultTasks.rewards + + page.render() ## CONTROLLER FUNCTIONS ## ready (model) -> + + # Setter for user.stats: handles death, leveling up, etc + exports.updateStats = updateStats = (user, stats) -> + if stats.hp? + # game over + if stats.hp < 0 + user.set 'stats', {hp: 50, lvl: 1, exp: 0, money: 0} + user.set 'items.armor', 0 + user.set 'items.weapon', 0 + model.set '_items.armor', content.items.armor[1] + model.set '_items.weapon', content.items.weapon[1] + else + user.set 'stats.hp', stats.hp + + if stats.exp? + # level up & carry-over exp + tnl = model.get '_tnl' + if stats.exp >= tnl + stats.exp -= tnl + user.set 'stats.lvl', user.get('stats.lvl') + 1 + if !user.get('items.itemsEnabled') and stats.exp >=50 + user.set 'items.itemsEnabled', true + $('ul.items').popover + title: content.items.unlockedMessage.title + placement: 'left' + trigger: 'manual' + html: true + content: "
\ + \ + #{content.items.unlockedMessage.content} [Close]\ +
" + $('ul.items').popover 'show' + user.set 'stats.exp', stats.exp + + if stats.money? + money = 0.0 if (!money? or money<0) + user.set 'stats.money', stats.money + # Note: Set 12am daily cron for this # At end of day, add value to all incomplete Daily & Todo tasks (further incentive) # For incomplete Dailys, deduct experience @@ -95,10 +148,8 @@ ready (model) -> # Deduct experience for missed Daily tasks, # but not for Todos (just increase todo's value) if (type == 'daily') - user.set('hp', user.get('hp') + value) - if user.get('hp') < 0 - #TODO this is implemented in exports.vote also, make it a user.on or something - user.set('hp',50);user.set('lvl',1);user.set('exp',0) + hp = user.get('stats.hp') + value + updateStats user, { hp: hp } if type == 'daily' task.push "history", { date: new Date(), value: value } else @@ -108,9 +159,9 @@ ready (model) -> model.push '_user.history.todos', { date: new Date(), value: todoTally } # tally experience - expTally = user.get 'exp' + expTally = user.get 'stats.exp' lvl = 0 #iterator - _(user.get('lvl')-1).times -> + _(user.get('stats.lvl')-1).times -> lvl++ expTally += 50 * Math.pow(lvl, 2) - 150 * lvl + 200 model.push '_user.history.exp', { date: new Date(), value: expTally } @@ -217,8 +268,8 @@ ready (model) -> task = model.at(e.target) #TODO bug where I have to delete from _users.tasks AND _{type}List, # fix when query subscriptions implemented properly - console.log model.del('_user.tasks.'+task.get('id')) - console.log task.remove() + model.del('_user.tasks.'+task.get('id')) + task.remove() exports.toggleTaskEdit = (e, el) -> task = model.at $(el).parents('li')[0] @@ -248,6 +299,31 @@ ready (model) -> chart = new google.visualization.LineChart(document.getElementById( chartSelector )) chart.draw(data, options) + exports.buyItem = (e, el, next) -> + user = model.at '_user' + #TODO: this should be working but it's not. so instead, i'm passing all needed values as data-attrs + # item = model.at(e.target) + + money = user.get 'stats.money' + [type, value, index] = [ $(el).attr('data-type'), $(el).attr('data-value'), $(el).attr('data-index') ] + + return if money < value + user.set 'stats.money', money - value + if type == 'armor' + user.set 'items.armor', index + model.set '_items.armor', content.items.armor[parseInt(index) + 1] + else if type == 'weapon' + user.set 'items.weapon', index + model.set '_items.weapon', content.items.weapon[parseInt(index) + 1] + else if type == 'potion' + hp = user.get 'stats.hp' + hp += 15 + hp = 50 if hp > 50 + user.set 'stats.hp', hp + else if type == 'reroll' + console.log 'reroll' + + exports.vote = (e, el, next) -> direction = $(el).attr('data-direction') direction = 'up' if direction == 'true/' @@ -285,7 +361,7 @@ ready (model) -> task.set('completed', completed) # Update the user's status - [money, hp, exp, lvl] = [user.get('money'), user.get('hp'), user.get('exp'), user.get('lvl')] + [money, hp, exp, lvl] = [user.get('stats.money'), user.get('stats.hp'), user.get('stats.exp'), user.get('stats.lvl')] if task.get('type') == 'reward' # purchase item @@ -303,22 +379,8 @@ ready (model) -> # Deduct from health (rewards case handled above) else if task.get('type') != 'reward' hp += delta - - tnl = model.get '_tnl' - # level up & carry-over exp - if exp >= tnl - exp -= tnl - lvl += 1 - - # game over - if hp < 0 - [hp, lvl, exp] = [50, 1, 0] - - user.set('money', money) - user.set('hp', hp) - user.set('exp', exp) - user.set('lvl', lvl) - #[user.money, user.hp, user.exp, user.lvl] = [money, hp, exp, lvl] + + updateStats(user, {hp: hp, exp: exp, money: money}) ## SHORTCUTS ## diff --git a/styles/app/index.styl b/styles/app/index.styl index c4b463638d..dca5ab378b 100644 --- a/styles/app/index.styl +++ b/styles/app/index.styl @@ -75,22 +75,38 @@ li:hover .task-meta-controls .hover-show .vote-up, .vote-down text-decoration:none; - .buy-link - background-color: #DEE5F2 + .buy-link, .item-buy-link + background-color: #ccffcc padding: 2px margin-right: 10px border-radius: 5px img height:20px - + + .item-buy-link + background-color: #DEE5F2 + #character - img - width: 60px td#avatar vertical-align: top text-align: center + + .avatar-sprites + position: relative + + .weapon + position: absolute + z-index: 200 + left: -13px + bottom: 7px + .weapon-0 + left: -7px + .weapon-5 + left: -16px + .weapon-6 + left:-20px td#bars padding: 10px 0 0 10px @@ -110,4 +126,11 @@ footer.footer position: absolute bottom: 10px right: 10px - \ No newline at end of file + +/* ----- Items, Weapons, Armor -----*/ +.item-store-popover img + float:left + padding-right:7px; + +.item .task-text img + max-height: 16px diff --git a/views/app/index.html b/views/app/index.html index fa65796848..e6b4d0c778 100644 --- a/views/app/index.html +++ b/views/app/index.html @@ -11,22 +11,26 @@ @@ -98,8 +102,20 @@ -
{gold(_user.money)} {silver(_user.money)}
- +
{gold(_user.stats.money)} {silver(_user.stats.money)}
+ + + {#if _user.items.itemsEnabled} + + {/} +
@@ -126,8 +142,8 @@ {{{content}}} - - + +
  • @@ -200,6 +216,22 @@
       
       
       
    +
    +  
  • +
    +      
    + +
    +
    + {{{#unless disabled}}} + {:item.value} + {{{/}}} +
    +
    {:item.text}
    +
    +
  • + + Fork me on GitHub
  • -
    -
    Lvl: {_user.lvl}
    +
    + + +
    +
    Lvl: {_user.stats.lvl}
    - HP: {round(_user.hp)} / 50 -
    + HP: {round(_user.stats.hp)} / 50 +
    - {#if _user.history.exp} - - Exp: {round(_user.exp)} / {_tnl} - - {/} -
    + + {#if _user.history.exp} +   + {/} + Exp: {round(_user.stats.exp)} / {_tnl} + +