diff --git a/migrations/20130326_migrate_pets.js b/migrations/20130326_migrate_pets.js new file mode 100644 index 0000000000..5ded28814a --- /dev/null +++ b/migrations/20130326_migrate_pets.js @@ -0,0 +1,92 @@ +/** + * Migrate old pets to new system + */ +// mongo habitrpg ./node_modules/underscore/underscore.js ./migrations/20130326_migrate_pets.js + +var mapping = { + bearcub: {name:'BearCub', modifier: 'Base'}, + cactus: {name:'Cactus', modifier:'Base'}, + dragon: {name:'Dragon', modifier:'Base'}, + flyingpig: {name:'FlyingPig', modifier:'Base'}, + fox: {name:'Fox', modifier:'Base'}, + lioncub: {name:'LionCub', modifier:'Base'}, + pandacub: {name:'PandaCub', modifier:'Base'}, + tigercub: {name:'TigerCub', modifier:'Base'}, + wolfBorder: {name:'Wolf', modifier:'Base'}, + wolfDesert: {name:'Wolf', modifier:'Desert'}, + wolfGolden: {name:'Wolf', modifier:'Golden'}, + wolfRed: {name:'Wolf', modifier:'Red'}, + wolfShade: {name:'Wolf', modifier:'Shade'}, + wolfSkeleton: {name:'Wolf', modifier:'Skeleton'}, + wolfVeteran: {name:'Wolf', modifier:'Veteran'}, + wolfWhite: {name:'Wolf', modifier:'White'}, + wolfZombie: {name:'Wolf', modifier:'Zombie'} +} + +/** + == Old Style == + pet: Object + icon: "Pet-Wolf-White.png" + index: 14 + name: "wolfWhite" + text: "White Wolf" + value: 3 + pets: Object + bearcub: true + cactus: true + + == New Style == + currentPet: Object + modifier: "Red" + name: "Wolf" + notes: "Find some Hatching Powder to sprinkle on this egg, and one day it will hatch into a loyal pet." + str: "Wolf-Red" + text: "Wolf" + value: 3 + pets: Array + 0: "PandaCub-Base" + 1: "Wolf-Base" + */ + + +db.users.find().forEach(function(user){ + if (!user.items || (!user.items.pets && !user.items.pet)) return; + + // migrate items.pet to items.currentPet + if (!!user.items.pet) { + var mapped = mapping[user.items.pet.name]; + delete user.items.pet; + user.items.currentPet = { + modifier: mapped.modifier, + name: mapped.name, + str: mapped.name + "-" + mapped.modifier, + text: '' // FIXME? + } + } + + // migrate items.pets + if (!!user.items.pets) { + var newPets = []; + _.each(user.items.pets, function(val, key){ + if (_.isNumber(key)) { + newPets.push(val) + //FIXME why is this happening? seems the user gets migrated already... + //throw "Error: User appears already migrated, this shouldn't be happening!" + } else { + newPets.push(mapping[key].name + "-" + mapping[key].modifier); + } + }); + user.items.pets = newPets; + } + + try { + db.users.update( + {_id:user._id}, + {$set: + { 'items' : user.items } + } + ); + } catch(e) { + print(e); + } +}) \ No newline at end of file diff --git a/migrations/20130327_apply_tokens.js b/migrations/20130327_apply_tokens.js new file mode 100644 index 0000000000..73b0d1b997 --- /dev/null +++ b/migrations/20130327_apply_tokens.js @@ -0,0 +1,109 @@ +/** + * Applies backer tokens & items (this file will be updated periodically + */ + +// mongo habitrpg ./node_modules/underscore/underscore.js migrations/20130327_apply_tokens.js + +var mapping = [ + { // $1 + tokens: 0, + users: [] + }, + { // $5 + tokens: 20, + users: ['9'] + }, + { // $10 + tokens: 50, + users: [] + }, + { // $15 + tokens: 100, + users: [] + }, + { // $30 + tokens: 150, + users: [] + }, + { // $45 + tokens: 170, + users: [] + }, + { // $60 + tokens: 200, + users: [] + }, + { // $70 + tokens: 240, + users: [] + }, + { // $80 + tokens: 240, + users: [] + }, + { // $90 + tokens: 280, + users: [] + }, + { // $300 + tokens: 500, + users: [] + }, + { // $800 + tokens: 500, + users: [] + } +]; + +db.users.find().forEach(function(user){ + + _.each(mapping, function(tier){ + if( + (!user.backer || !user.backer.tokensApplied) && + + ( + _.contains(tier.users, user._id) || + !!user.local && ( + _.contains(tier.users, user.local.username) || + _.contains(tier.users, user.local.email) + ) + ) + ) { + try { + db.users.update( + {_id:user._id}, + { + $set: { 'backer.tokensApplied': true, 'flags.ads': 'hide' }, + $inc: { balance: (tier.tokens/4) } + } + ); + } catch(e) { + print(e); + } + } + }) + +}) + +// This doesn't work, but shows the idea we're after better than the above +/* +_.each(mapping, function(tier){ + db.users.update( + { + $or: [ + { _id: { $in: tier.users } }, + { 'auth.local.username': { $in: tier.users } }, + { 'auth.local.email': { $in: tier.users } } + ], + 'backer.tokensApplied': { $exists: false } + }, + + { + $set: { 'backer.tokensApplied': true, 'flags.ads': 'hide' }, + $inc: { balance: (tier.tokens/4) } + }, + + { multi: true} + ) +}) +*/ diff --git a/public/img/hatching_powder.png b/public/img/hatching_powder.png new file mode 100644 index 0000000000..34db3dc933 Binary files /dev/null and b/public/img/hatching_powder.png differ diff --git a/public/img/sprites/Egg_Sprite_Sheet.png b/public/img/sprites/Egg_Sprite_Sheet.png index 2258af3255..c2834447bb 100644 Binary files a/public/img/sprites/Egg_Sprite_Sheet.png and b/public/img/sprites/Egg_Sprite_Sheet.png differ diff --git a/public/img/sprites/Mount-SpriteSheet.png b/public/img/sprites/Mount-SpriteSheet.png index 4b025ef899..36531b7b50 100644 Binary files a/public/img/sprites/Mount-SpriteSheet.png and b/public/img/sprites/Mount-SpriteSheet.png differ diff --git a/public/img/sprites/Mounts.css b/public/img/sprites/Mounts.css index 314d83f408..06ea775b2b 100644 --- a/public/img/sprites/Mounts.css +++ b/public/img/sprites/Mounts.css @@ -1,11 +1,13 @@ -Mount_Head_Lion, Mount_Body_Lion, Mount_Head_PolarBear, Mount_Body_PolarBear, Mount_Head_Panda, Mount_Body_Panda, Mount_Head_Tiger, Mount_Body_Tiger, Mount_Head_Bear, Mount_Body_Bear {background: url(Mount-SpriteSheet.png) no-repeat} -Mount_Head_Lion {background-position: 0 0; width: 105px; height: 123px} -Mount_Body_Lion {background-position: -105 0; width: 105px; height: 123px} -Mount_Head_PolarBear {background-position: -210 0; width: 105px; height: 123px} -Mount_Body_PolarBear {background-position: -315 0; width: 105px; height: 123px} -Mount_Head_Panda {background-position: -420 0; width: 105px; height: 123px} -Mount_Body_Panda {background-position: -525 0; width: 105px; height: 123px} -Mount_Head_Tiger {background-position: -630 0; width: 105px; height: 123px} -Mount_Body_Tiger {background-position: -735 0; width: 105px; height: 123px} -Mount_Head_Bear {background-position: -840 0; width: 105px; height: 123px} -Mount_Body_Bear {background-position: -945 0; width: 105px; height: 123px} \ No newline at end of file +.Mount_Head_Lion, .Mount_Body_Lion, .Mount_Head_PolarBear, .Mount_Body_PolarBear, .Mount_Head_Panda, .Mount_Body_Panda, .Mount_Head_Tiger, .Mount_Body_Tiger, .Mount_Head_Bear, .Mount_Body_Bear, .Mount_Head_EtherealLion, .Mount_Body_EtherealLion {background: url(Mount-SpriteSheet.png) no-repeat} +.Mount_Head_Lion {background-position: 0 0; width: 105px; height: 123px} +.Mount_Body_Lion {background-position: -105 0; width: 105px; height: 123px} +.Mount_Head_PolarBear {background-position: -210 0; width: 105px; height: 123px} +.Mount_Body_PolarBear {background-position: -315 0; width: 105px; height: 123px} +.Mount_Head_Panda {background-position: -420 0; width: 105px; height: 123px} +.Mount_Body_Panda {background-position: -525 0; width: 105px; height: 123px} +.Mount_Head_Tiger {background-position: -630 0; width: 105px; height: 123px} +.Mount_Body_Tiger {background-position: -735 0; width: 105px; height: 123px} +.Mount_Head_Bear {background-position: -840 0; width: 105px; height: 123px} +.Mount_Body_Bear {background-position: -945 0; width: 105px; height: 123px} +.Mount_Head_EtherealLion {background-position: -1050 0; width: 105px; height: 123px} +.Mount_Body_EtherealLion {background-position: -1155 0; width: 105px; height: 123px} diff --git a/public/img/sprites/Pet-BearCub-Base.png b/public/img/sprites/Pet-BearCub-Base.png deleted file mode 100644 index 8ea6388e60..0000000000 Binary files a/public/img/sprites/Pet-BearCub-Base.png and /dev/null differ diff --git a/public/img/sprites/Pet-BearCub-CottonCandyBlue.png b/public/img/sprites/Pet-BearCub-CottonCandyBlue.png deleted file mode 100644 index 6e84fe081c..0000000000 Binary files a/public/img/sprites/Pet-BearCub-CottonCandyBlue.png and /dev/null differ diff --git a/public/img/sprites/Pet-BearCub-CottonCandyPink.png b/public/img/sprites/Pet-BearCub-CottonCandyPink.png deleted file mode 100644 index 50d68cdfb6..0000000000 Binary files a/public/img/sprites/Pet-BearCub-CottonCandyPink.png and /dev/null differ diff --git a/public/img/sprites/Pet-BearCub-Desert.png b/public/img/sprites/Pet-BearCub-Desert.png deleted file mode 100644 index 31a713f900..0000000000 Binary files a/public/img/sprites/Pet-BearCub-Desert.png and /dev/null differ diff --git a/public/img/sprites/Pet-BearCub-Golden.png b/public/img/sprites/Pet-BearCub-Golden.png deleted file mode 100644 index af8a82aba2..0000000000 Binary files a/public/img/sprites/Pet-BearCub-Golden.png and /dev/null differ diff --git a/public/img/sprites/Pet-BearCub-Red.png b/public/img/sprites/Pet-BearCub-Red.png deleted file mode 100644 index a41271921c..0000000000 Binary files a/public/img/sprites/Pet-BearCub-Red.png and /dev/null differ diff --git a/public/img/sprites/Pet-BearCub-Shade.png b/public/img/sprites/Pet-BearCub-Shade.png deleted file mode 100644 index e2ab5d71bd..0000000000 Binary files a/public/img/sprites/Pet-BearCub-Shade.png and /dev/null differ diff --git a/public/img/sprites/Pet-BearCub-Skeleton.png b/public/img/sprites/Pet-BearCub-Skeleton.png deleted file mode 100644 index 204392a22e..0000000000 Binary files a/public/img/sprites/Pet-BearCub-Skeleton.png and /dev/null differ diff --git a/public/img/sprites/Pet-BearCub-White.png b/public/img/sprites/Pet-BearCub-White.png deleted file mode 100644 index d062f9e3f3..0000000000 Binary files a/public/img/sprites/Pet-BearCub-White.png and /dev/null differ diff --git a/public/img/sprites/Pet-BearCub-Zombie.png b/public/img/sprites/Pet-BearCub-Zombie.png deleted file mode 100644 index 0d009887ba..0000000000 Binary files a/public/img/sprites/Pet-BearCub-Zombie.png and /dev/null differ diff --git a/public/img/sprites/Pet-Cactus-Base.png b/public/img/sprites/Pet-Cactus-Base.png deleted file mode 100644 index 62e721b7a9..0000000000 Binary files a/public/img/sprites/Pet-Cactus-Base.png and /dev/null differ diff --git a/public/img/sprites/Pet-Cactus-Chocolate.png b/public/img/sprites/Pet-Cactus-Chocolate.png deleted file mode 100644 index 64e5d16122..0000000000 Binary files a/public/img/sprites/Pet-Cactus-Chocolate.png and /dev/null differ diff --git a/public/img/sprites/Pet-Cactus-CottonCandyBlue.png b/public/img/sprites/Pet-Cactus-CottonCandyBlue.png deleted file mode 100644 index 7bb7a228ec..0000000000 Binary files a/public/img/sprites/Pet-Cactus-CottonCandyBlue.png and /dev/null differ diff --git a/public/img/sprites/Pet-Cactus-CottonCandyPink.png b/public/img/sprites/Pet-Cactus-CottonCandyPink.png deleted file mode 100644 index 3479ecbe44..0000000000 Binary files a/public/img/sprites/Pet-Cactus-CottonCandyPink.png and /dev/null differ diff --git a/public/img/sprites/Pet-Cactus-Cream.png b/public/img/sprites/Pet-Cactus-Cream.png deleted file mode 100644 index cd5ab8a75a..0000000000 Binary files a/public/img/sprites/Pet-Cactus-Cream.png and /dev/null differ diff --git a/public/img/sprites/Pet-Cactus-Golden.png b/public/img/sprites/Pet-Cactus-Golden.png deleted file mode 100644 index 678b8afd36..0000000000 Binary files a/public/img/sprites/Pet-Cactus-Golden.png and /dev/null differ diff --git a/public/img/sprites/Pet-Cactus-Licorice.png b/public/img/sprites/Pet-Cactus-Licorice.png deleted file mode 100644 index c870cd98a8..0000000000 Binary files a/public/img/sprites/Pet-Cactus-Licorice.png and /dev/null differ diff --git a/public/img/sprites/Pet-Cactus-Rotten.png b/public/img/sprites/Pet-Cactus-Rotten.png deleted file mode 100644 index 404036c981..0000000000 Binary files a/public/img/sprites/Pet-Cactus-Rotten.png and /dev/null differ diff --git a/public/img/sprites/Pet-Cactus-Strawberry.png b/public/img/sprites/Pet-Cactus-Strawberry.png deleted file mode 100644 index 52c6a40c35..0000000000 Binary files a/public/img/sprites/Pet-Cactus-Strawberry.png and /dev/null differ diff --git a/public/img/sprites/Pet-Cactus-SugarCube.png b/public/img/sprites/Pet-Cactus-SugarCube.png deleted file mode 100644 index 35003eaa20..0000000000 Binary files a/public/img/sprites/Pet-Cactus-SugarCube.png and /dev/null differ diff --git a/public/img/sprites/Pet-Dragon-Base.png b/public/img/sprites/Pet-Dragon-Base.png deleted file mode 100644 index 3abd67e4e7..0000000000 Binary files a/public/img/sprites/Pet-Dragon-Base.png and /dev/null differ diff --git a/public/img/sprites/Pet-Dragon-CottonCandyBlue.png b/public/img/sprites/Pet-Dragon-CottonCandyBlue.png deleted file mode 100644 index 01ce0fa208..0000000000 Binary files a/public/img/sprites/Pet-Dragon-CottonCandyBlue.png and /dev/null differ diff --git a/public/img/sprites/Pet-Dragon-CottonCandyPink.png b/public/img/sprites/Pet-Dragon-CottonCandyPink.png deleted file mode 100644 index 3a7dc098c7..0000000000 Binary files a/public/img/sprites/Pet-Dragon-CottonCandyPink.png and /dev/null differ diff --git a/public/img/sprites/Pet-Dragon-Desert.png b/public/img/sprites/Pet-Dragon-Desert.png deleted file mode 100644 index 5b8d2e8437..0000000000 Binary files a/public/img/sprites/Pet-Dragon-Desert.png and /dev/null differ diff --git a/public/img/sprites/Pet-Dragon-Golden.png b/public/img/sprites/Pet-Dragon-Golden.png deleted file mode 100644 index 2ba6af05a2..0000000000 Binary files a/public/img/sprites/Pet-Dragon-Golden.png and /dev/null differ diff --git a/public/img/sprites/Pet-Dragon-Red.png b/public/img/sprites/Pet-Dragon-Red.png deleted file mode 100644 index 107ec77714..0000000000 Binary files a/public/img/sprites/Pet-Dragon-Red.png and /dev/null differ diff --git a/public/img/sprites/Pet-Dragon-Shade.png b/public/img/sprites/Pet-Dragon-Shade.png deleted file mode 100644 index 4d7177045d..0000000000 Binary files a/public/img/sprites/Pet-Dragon-Shade.png and /dev/null differ diff --git a/public/img/sprites/Pet-Dragon-Skeleton.png b/public/img/sprites/Pet-Dragon-Skeleton.png deleted file mode 100644 index 6970466f34..0000000000 Binary files a/public/img/sprites/Pet-Dragon-Skeleton.png and /dev/null differ diff --git a/public/img/sprites/Pet-Dragon-White.png b/public/img/sprites/Pet-Dragon-White.png deleted file mode 100644 index 130e89500c..0000000000 Binary files a/public/img/sprites/Pet-Dragon-White.png and /dev/null differ diff --git a/public/img/sprites/Pet-Dragon-Zombie.png b/public/img/sprites/Pet-Dragon-Zombie.png deleted file mode 100644 index a6f13078b8..0000000000 Binary files a/public/img/sprites/Pet-Dragon-Zombie.png and /dev/null differ diff --git a/public/img/sprites/Pet-FlyingPig-Base.png b/public/img/sprites/Pet-FlyingPig-Base.png deleted file mode 100644 index aa7549e11b..0000000000 Binary files a/public/img/sprites/Pet-FlyingPig-Base.png and /dev/null differ diff --git a/public/img/sprites/Pet-FlyingPig-CottonCandyBlue.png b/public/img/sprites/Pet-FlyingPig-CottonCandyBlue.png deleted file mode 100644 index 1660ca63b6..0000000000 Binary files a/public/img/sprites/Pet-FlyingPig-CottonCandyBlue.png and /dev/null differ diff --git a/public/img/sprites/Pet-FlyingPig-CottonCandyPink.png b/public/img/sprites/Pet-FlyingPig-CottonCandyPink.png deleted file mode 100644 index 33393e0f18..0000000000 Binary files a/public/img/sprites/Pet-FlyingPig-CottonCandyPink.png and /dev/null differ diff --git a/public/img/sprites/Pet-FlyingPig-Desert.png b/public/img/sprites/Pet-FlyingPig-Desert.png deleted file mode 100644 index ba69e561f1..0000000000 Binary files a/public/img/sprites/Pet-FlyingPig-Desert.png and /dev/null differ diff --git a/public/img/sprites/Pet-FlyingPig-Golden.png b/public/img/sprites/Pet-FlyingPig-Golden.png deleted file mode 100644 index 4e10454ca4..0000000000 Binary files a/public/img/sprites/Pet-FlyingPig-Golden.png and /dev/null differ diff --git a/public/img/sprites/Pet-FlyingPig-Red.png b/public/img/sprites/Pet-FlyingPig-Red.png deleted file mode 100644 index 0996625130..0000000000 Binary files a/public/img/sprites/Pet-FlyingPig-Red.png and /dev/null differ diff --git a/public/img/sprites/Pet-FlyingPig-Shade.png b/public/img/sprites/Pet-FlyingPig-Shade.png deleted file mode 100644 index dbc53bf557..0000000000 Binary files a/public/img/sprites/Pet-FlyingPig-Shade.png and /dev/null differ diff --git a/public/img/sprites/Pet-FlyingPig-Skeleton.png b/public/img/sprites/Pet-FlyingPig-Skeleton.png deleted file mode 100644 index 80d229dc65..0000000000 Binary files a/public/img/sprites/Pet-FlyingPig-Skeleton.png and /dev/null differ diff --git a/public/img/sprites/Pet-FlyingPig-White.png b/public/img/sprites/Pet-FlyingPig-White.png deleted file mode 100644 index f067e1f476..0000000000 Binary files a/public/img/sprites/Pet-FlyingPig-White.png and /dev/null differ diff --git a/public/img/sprites/Pet-FlyingPig-Zombie.png b/public/img/sprites/Pet-FlyingPig-Zombie.png deleted file mode 100644 index 09fc882d23..0000000000 Binary files a/public/img/sprites/Pet-FlyingPig-Zombie.png and /dev/null differ diff --git a/public/img/sprites/Pet-Fox-Base.png b/public/img/sprites/Pet-Fox-Base.png deleted file mode 100644 index e3e427f862..0000000000 Binary files a/public/img/sprites/Pet-Fox-Base.png and /dev/null differ diff --git a/public/img/sprites/Pet-Fox-CottonCandyBlue.png b/public/img/sprites/Pet-Fox-CottonCandyBlue.png deleted file mode 100644 index e83e857494..0000000000 Binary files a/public/img/sprites/Pet-Fox-CottonCandyBlue.png and /dev/null differ diff --git a/public/img/sprites/Pet-Fox-CottonCandyPink.png b/public/img/sprites/Pet-Fox-CottonCandyPink.png deleted file mode 100644 index 0bf2768165..0000000000 Binary files a/public/img/sprites/Pet-Fox-CottonCandyPink.png and /dev/null differ diff --git a/public/img/sprites/Pet-Fox-Desert.png b/public/img/sprites/Pet-Fox-Desert.png deleted file mode 100644 index e112a3b0d4..0000000000 Binary files a/public/img/sprites/Pet-Fox-Desert.png and /dev/null differ diff --git a/public/img/sprites/Pet-Fox-Golden.png b/public/img/sprites/Pet-Fox-Golden.png deleted file mode 100644 index 03749e8a70..0000000000 Binary files a/public/img/sprites/Pet-Fox-Golden.png and /dev/null differ diff --git a/public/img/sprites/Pet-Fox-Red.png b/public/img/sprites/Pet-Fox-Red.png deleted file mode 100644 index de9018d8f1..0000000000 Binary files a/public/img/sprites/Pet-Fox-Red.png and /dev/null differ diff --git a/public/img/sprites/Pet-Fox-Shade.png b/public/img/sprites/Pet-Fox-Shade.png deleted file mode 100644 index b109fc3717..0000000000 Binary files a/public/img/sprites/Pet-Fox-Shade.png and /dev/null differ diff --git a/public/img/sprites/Pet-Fox-Skeleton.png b/public/img/sprites/Pet-Fox-Skeleton.png deleted file mode 100644 index 780bb0c292..0000000000 Binary files a/public/img/sprites/Pet-Fox-Skeleton.png and /dev/null differ diff --git a/public/img/sprites/Pet-Fox-White.png b/public/img/sprites/Pet-Fox-White.png deleted file mode 100644 index bfb4bb2901..0000000000 Binary files a/public/img/sprites/Pet-Fox-White.png and /dev/null differ diff --git a/public/img/sprites/Pet-Fox-Zombie.png b/public/img/sprites/Pet-Fox-Zombie.png deleted file mode 100644 index d3957fe293..0000000000 Binary files a/public/img/sprites/Pet-Fox-Zombie.png and /dev/null differ diff --git a/public/img/sprites/Pet-LionCub-Base.png b/public/img/sprites/Pet-LionCub-Base.png deleted file mode 100644 index 13e00cdb49..0000000000 Binary files a/public/img/sprites/Pet-LionCub-Base.png and /dev/null differ diff --git a/public/img/sprites/Pet-LionCub-CottonCandyBlue.png b/public/img/sprites/Pet-LionCub-CottonCandyBlue.png deleted file mode 100644 index c3eccd4938..0000000000 Binary files a/public/img/sprites/Pet-LionCub-CottonCandyBlue.png and /dev/null differ diff --git a/public/img/sprites/Pet-LionCub-CottonCandyPink.png b/public/img/sprites/Pet-LionCub-CottonCandyPink.png deleted file mode 100644 index 00dfbf6b1e..0000000000 Binary files a/public/img/sprites/Pet-LionCub-CottonCandyPink.png and /dev/null differ diff --git a/public/img/sprites/Pet-LionCub-Desert.png b/public/img/sprites/Pet-LionCub-Desert.png deleted file mode 100644 index 42f8a64b58..0000000000 Binary files a/public/img/sprites/Pet-LionCub-Desert.png and /dev/null differ diff --git a/public/img/sprites/Pet-LionCub-Golden.png b/public/img/sprites/Pet-LionCub-Golden.png deleted file mode 100644 index da2c9ee25d..0000000000 Binary files a/public/img/sprites/Pet-LionCub-Golden.png and /dev/null differ diff --git a/public/img/sprites/Pet-LionCub-Red.png b/public/img/sprites/Pet-LionCub-Red.png deleted file mode 100644 index 297a20f81a..0000000000 Binary files a/public/img/sprites/Pet-LionCub-Red.png and /dev/null differ diff --git a/public/img/sprites/Pet-LionCub-Shade.png b/public/img/sprites/Pet-LionCub-Shade.png deleted file mode 100644 index 9314b2b9ce..0000000000 Binary files a/public/img/sprites/Pet-LionCub-Shade.png and /dev/null differ diff --git a/public/img/sprites/Pet-LionCub-Skeleton.png b/public/img/sprites/Pet-LionCub-Skeleton.png deleted file mode 100644 index e3f640d34a..0000000000 Binary files a/public/img/sprites/Pet-LionCub-Skeleton.png and /dev/null differ diff --git a/public/img/sprites/Pet-LionCub-White.png b/public/img/sprites/Pet-LionCub-White.png deleted file mode 100644 index e09a0aca09..0000000000 Binary files a/public/img/sprites/Pet-LionCub-White.png and /dev/null differ diff --git a/public/img/sprites/Pet-LionCub-Zombie.png b/public/img/sprites/Pet-LionCub-Zombie.png deleted file mode 100644 index b27425622d..0000000000 Binary files a/public/img/sprites/Pet-LionCub-Zombie.png and /dev/null differ diff --git a/public/img/sprites/Pet-PandaCub-Base.png b/public/img/sprites/Pet-PandaCub-Base.png deleted file mode 100644 index 7f162ef428..0000000000 Binary files a/public/img/sprites/Pet-PandaCub-Base.png and /dev/null differ diff --git a/public/img/sprites/Pet-PandaCub-CottonCandyBlue.png b/public/img/sprites/Pet-PandaCub-CottonCandyBlue.png deleted file mode 100644 index fcaa0d243d..0000000000 Binary files a/public/img/sprites/Pet-PandaCub-CottonCandyBlue.png and /dev/null differ diff --git a/public/img/sprites/Pet-PandaCub-CottonCandyPink.png b/public/img/sprites/Pet-PandaCub-CottonCandyPink.png deleted file mode 100644 index 530a58ed7d..0000000000 Binary files a/public/img/sprites/Pet-PandaCub-CottonCandyPink.png and /dev/null differ diff --git a/public/img/sprites/Pet-PandaCub-Desert.png b/public/img/sprites/Pet-PandaCub-Desert.png deleted file mode 100644 index 3a18a095dd..0000000000 Binary files a/public/img/sprites/Pet-PandaCub-Desert.png and /dev/null differ diff --git a/public/img/sprites/Pet-PandaCub-Golden.png b/public/img/sprites/Pet-PandaCub-Golden.png deleted file mode 100644 index 056da19e4a..0000000000 Binary files a/public/img/sprites/Pet-PandaCub-Golden.png and /dev/null differ diff --git a/public/img/sprites/Pet-PandaCub-Red.png b/public/img/sprites/Pet-PandaCub-Red.png deleted file mode 100644 index ac7aec96c7..0000000000 Binary files a/public/img/sprites/Pet-PandaCub-Red.png and /dev/null differ diff --git a/public/img/sprites/Pet-PandaCub-Shade.png b/public/img/sprites/Pet-PandaCub-Shade.png deleted file mode 100644 index 8c2492bee9..0000000000 Binary files a/public/img/sprites/Pet-PandaCub-Shade.png and /dev/null differ diff --git a/public/img/sprites/Pet-PandaCub-Skeleton.png b/public/img/sprites/Pet-PandaCub-Skeleton.png deleted file mode 100644 index 0735a345d0..0000000000 Binary files a/public/img/sprites/Pet-PandaCub-Skeleton.png and /dev/null differ diff --git a/public/img/sprites/Pet-PandaCub-White.png b/public/img/sprites/Pet-PandaCub-White.png deleted file mode 100644 index 8baf058db6..0000000000 Binary files a/public/img/sprites/Pet-PandaCub-White.png and /dev/null differ diff --git a/public/img/sprites/Pet-PandaCub-Zombie.png b/public/img/sprites/Pet-PandaCub-Zombie.png deleted file mode 100644 index fa83fd893c..0000000000 Binary files a/public/img/sprites/Pet-PandaCub-Zombie.png and /dev/null differ diff --git a/public/img/sprites/Pet-PolarBearCub-Base.png b/public/img/sprites/Pet-PolarBearCub-Base.png deleted file mode 100644 index 10a49bbb80..0000000000 Binary files a/public/img/sprites/Pet-PolarBearCub-Base.png and /dev/null differ diff --git a/public/img/sprites/Pet-TigerCub-Base.png b/public/img/sprites/Pet-TigerCub-Base.png deleted file mode 100644 index cfd066e381..0000000000 Binary files a/public/img/sprites/Pet-TigerCub-Base.png and /dev/null differ diff --git a/public/img/sprites/Pet-TigerCub-CottonCandyBlue.png b/public/img/sprites/Pet-TigerCub-CottonCandyBlue.png deleted file mode 100644 index 5e7f6e489d..0000000000 Binary files a/public/img/sprites/Pet-TigerCub-CottonCandyBlue.png and /dev/null differ diff --git a/public/img/sprites/Pet-TigerCub-CottonCandyPink.png b/public/img/sprites/Pet-TigerCub-CottonCandyPink.png deleted file mode 100644 index da07c91e01..0000000000 Binary files a/public/img/sprites/Pet-TigerCub-CottonCandyPink.png and /dev/null differ diff --git a/public/img/sprites/Pet-TigerCub-Desert.png b/public/img/sprites/Pet-TigerCub-Desert.png deleted file mode 100644 index b6e3e9c78b..0000000000 Binary files a/public/img/sprites/Pet-TigerCub-Desert.png and /dev/null differ diff --git a/public/img/sprites/Pet-TigerCub-Golden.png b/public/img/sprites/Pet-TigerCub-Golden.png deleted file mode 100644 index 2c8d4afa0f..0000000000 Binary files a/public/img/sprites/Pet-TigerCub-Golden.png and /dev/null differ diff --git a/public/img/sprites/Pet-TigerCub-Red.png b/public/img/sprites/Pet-TigerCub-Red.png deleted file mode 100644 index 1a381963c3..0000000000 Binary files a/public/img/sprites/Pet-TigerCub-Red.png and /dev/null differ diff --git a/public/img/sprites/Pet-TigerCub-Shade.png b/public/img/sprites/Pet-TigerCub-Shade.png deleted file mode 100644 index 6e29602b8e..0000000000 Binary files a/public/img/sprites/Pet-TigerCub-Shade.png and /dev/null differ diff --git a/public/img/sprites/Pet-TigerCub-Skeleton.png b/public/img/sprites/Pet-TigerCub-Skeleton.png deleted file mode 100644 index 4120915f8d..0000000000 Binary files a/public/img/sprites/Pet-TigerCub-Skeleton.png and /dev/null differ diff --git a/public/img/sprites/Pet-TigerCub-White.png b/public/img/sprites/Pet-TigerCub-White.png deleted file mode 100644 index 0e5a6dcf53..0000000000 Binary files a/public/img/sprites/Pet-TigerCub-White.png and /dev/null differ diff --git a/public/img/sprites/Pet-TigerCub-Zombie.png b/public/img/sprites/Pet-TigerCub-Zombie.png deleted file mode 100644 index a2329dbc19..0000000000 Binary files a/public/img/sprites/Pet-TigerCub-Zombie.png and /dev/null differ diff --git a/public/img/sprites/Pet-Wolf-CottonCandyBlue.png b/public/img/sprites/Pet-Wolf-CottonCandyBlue.png deleted file mode 100644 index 1447a765c3..0000000000 Binary files a/public/img/sprites/Pet-Wolf-CottonCandyBlue.png and /dev/null differ diff --git a/public/img/sprites/Pet-Wolf-CottonCandyPink.png b/public/img/sprites/Pet-Wolf-CottonCandyPink.png deleted file mode 100644 index 4942612982..0000000000 Binary files a/public/img/sprites/Pet-Wolf-CottonCandyPink.png and /dev/null differ diff --git a/public/img/sprites/Pet-Wolf-Desert.png b/public/img/sprites/Pet-Wolf-Desert.png deleted file mode 100644 index 2d18f7ac9a..0000000000 Binary files a/public/img/sprites/Pet-Wolf-Desert.png and /dev/null differ diff --git a/public/img/sprites/Pet-Wolf-Golden.png b/public/img/sprites/Pet-Wolf-Golden.png deleted file mode 100644 index 59e71564d7..0000000000 Binary files a/public/img/sprites/Pet-Wolf-Golden.png and /dev/null differ diff --git a/public/img/sprites/Pet-Wolf-Red.png b/public/img/sprites/Pet-Wolf-Red.png deleted file mode 100644 index d80b8f795b..0000000000 Binary files a/public/img/sprites/Pet-Wolf-Red.png and /dev/null differ diff --git a/public/img/sprites/Pet-Wolf-Shade.png b/public/img/sprites/Pet-Wolf-Shade.png deleted file mode 100644 index e1056dd3f9..0000000000 Binary files a/public/img/sprites/Pet-Wolf-Shade.png and /dev/null differ diff --git a/public/img/sprites/Pet-Wolf-Skeleton.png b/public/img/sprites/Pet-Wolf-Skeleton.png deleted file mode 100644 index 34ecdb8f66..0000000000 Binary files a/public/img/sprites/Pet-Wolf-Skeleton.png and /dev/null differ diff --git a/public/img/sprites/Pet-Wolf-Veteran.png b/public/img/sprites/Pet-Wolf-Veteran.png deleted file mode 100644 index 33439e60bf..0000000000 Binary files a/public/img/sprites/Pet-Wolf-Veteran.png and /dev/null differ diff --git a/public/img/sprites/Pet-Wolf-White.png b/public/img/sprites/Pet-Wolf-White.png deleted file mode 100644 index 396aa0ba32..0000000000 Binary files a/public/img/sprites/Pet-Wolf-White.png and /dev/null differ diff --git a/public/img/sprites/Pet-Wolf-Zombie.png b/public/img/sprites/Pet-Wolf-Zombie.png deleted file mode 100644 index d9fb098a48..0000000000 Binary files a/public/img/sprites/Pet-Wolf-Zombie.png and /dev/null differ diff --git a/public/img/sprites/PetEggs.css b/public/img/sprites/PetEggs.css index c81fa53424..bd70a03b65 100644 --- a/public/img/sprites/PetEggs.css +++ b/public/img/sprites/PetEggs.css @@ -1,10 +1,22 @@ -Pet_Egg_Wolf, Pet_Egg_Tiger, Pet_Egg_PolarBear, Pet_Egg_Panda, Pet_Egg_Lion, Pet_Egg_FlyingPig, Pet_Egg_Drake, Pet_Egg_Cactus, Pet_Egg_Bear {background: url(Egg_Sprite_Sheet.png) no-repeat} -Pet_Egg_Wolf {background-position: 0 0; width: 48px; height: 51px} -Pet_Egg_Tiger {background-position: 0 -51; width: 48px; height: 51px} -Pet_Egg_PolarBear{background-position: 0 -102; width: 48px; height: 51px} -Pet_Egg_Panda {background-position: 0 -153; width: 48px; height: 51px} -Pet_Egg_Lion {background-position: 0 -204; width: 48px; height: 51px} -Pet_Egg_FlyingPig {background-position: 0 -255; width: 48px; height: 51px} -Pet_Egg_Drake {background-position: 0 -306; width: 48px; height: 51px} -Pet_Egg_Cactus {background-position: 0 -357; width: 48px; height: 51px} -Pet_Egg_Bear {background-position: 0 -408; width: 48px; height: 51px} \ No newline at end of file +.Pet_Egg_Wolf, .Pet_Egg_TigerCub, .Pet_Egg_PolarBear, .Pet_Egg_PandaCub, .Pet_Egg_LionCub, .Pet_Egg_Fox, .Pet_Egg_FlyingPig, .Pet_Egg_Dragon, .Pet_Egg_Cactus, .Pet_Egg_BearCub, .Pet_HatchingPotion_Base, .Pet_HatchingPotion_White, .Pet_HatchingPotion_Desert, .Pet_HatchingPotion_Red, .Pet_HatchingPotion_Shade, .Pet_HatchingPotion_Skeleton, .Pet_HatchingPotion_Zombie, .Pet_HatchingPotion_CottonCandyPink, .Pet_HatchingPotion_CottonCandyBlue, .Pet_HatchingPotion_Golden {background: url("/img/sprites/Egg_Sprite_Sheet.png") no-repeat} +.Pet_Egg_Wolf {background-position: 0px 0px; width: 48px; height: 51px} +.Pet_Egg_TigerCub {background-position: 0px -51px; width: 48px; height: 51px} +.Pet_Egg_PolarBear {background-position: 0px -102px; width: 48px; height: 51px} +.Pet_Egg_PandaCub {background-position: 0px -153px; width: 48px; height: 51px} +.Pet_Egg_LionCub {background-position: 0px -204px; width: 48px; height: 51px} +.Pet_Egg_Fox {background-position: 0px -255px; width: 48px; height: 51px} +.Pet_Egg_FlyingPig {background-position: 0px -306px; width: 48px; height: 51px} +.Pet_Egg_Dragon {background-position: 0px -357px; width: 48px; height: 51px} +.Pet_Egg_Cactus {background-position: 0px -408px; width: 48px; height: 51px} +.Pet_Egg_BearCub {background-position: 0px -459px; width: 48px; height: 51px} + +.Pet_HatchingPotion_Base {background-position: -48px -0px; width: 48px; height: 51px} +.Pet_HatchingPotion_White {background-position: -48px -51px; width: 48px; height: 51px} +.Pet_HatchingPotion_Desert {background-position: -48px -102px; width: 48px; height: 51px} +.Pet_HatchingPotion_Red {background-position: -48px -153px; width: 48px; height: 51px} +.Pet_HatchingPotion_Shade {background-position: -48px -204px; width: 48px; height: 51px} +.Pet_HatchingPotion_Skeleton {background-position: -48px -255px; width: 48px; height: 51px} +.Pet_HatchingPotion_Zombie {background-position: -48px -306px; width: 48px; height: 51px} +.Pet_HatchingPotion_CottonCandyPink {background-position: -48px -357px; width: 48px; height: 51px} +.Pet_HatchingPotion_CottonCandyBlue {background-position: -48px -408px; width: 48px; height: 51px} +.Pet_HatchingPotion_Golden {background-position: -48px -459px; width: 48px; height: 54px} /* This sprite was a bit taller than everything else, will affect the math of anything inserted below it */ \ No newline at end of file diff --git a/public/img/sprites/armor0_f.png b/public/img/sprites/armor0_f.png deleted file mode 100644 index f2200b5db6..0000000000 Binary files a/public/img/sprites/armor0_f.png and /dev/null differ diff --git a/public/img/sprites/armor0_m.png b/public/img/sprites/armor0_m.png deleted file mode 100644 index 1840cafffa..0000000000 Binary files a/public/img/sprites/armor0_m.png and /dev/null differ diff --git a/public/img/sprites/armor1_f.png b/public/img/sprites/armor1_f.png deleted file mode 100644 index 769e23433b..0000000000 Binary files a/public/img/sprites/armor1_f.png and /dev/null differ diff --git a/public/img/sprites/armor1_m.png b/public/img/sprites/armor1_m.png deleted file mode 100644 index bf8287a17b..0000000000 Binary files a/public/img/sprites/armor1_m.png and /dev/null differ diff --git a/public/img/sprites/armor2_f_v1.png b/public/img/sprites/armor2_f_v1.png deleted file mode 100644 index eccf6dffbf..0000000000 Binary files a/public/img/sprites/armor2_f_v1.png and /dev/null differ diff --git a/public/img/sprites/armor2_f_v2.png b/public/img/sprites/armor2_f_v2.png deleted file mode 100644 index 35c163179a..0000000000 Binary files a/public/img/sprites/armor2_f_v2.png and /dev/null differ diff --git a/public/img/sprites/armor2_m.png b/public/img/sprites/armor2_m.png deleted file mode 100644 index 1e0bbc0483..0000000000 Binary files a/public/img/sprites/armor2_m.png and /dev/null differ diff --git a/public/img/sprites/armor3_f_v1.png b/public/img/sprites/armor3_f_v1.png deleted file mode 100644 index d2e011d5b6..0000000000 Binary files a/public/img/sprites/armor3_f_v1.png and /dev/null differ diff --git a/public/img/sprites/armor3_f_v2.png b/public/img/sprites/armor3_f_v2.png deleted file mode 100644 index 600327d6e6..0000000000 Binary files a/public/img/sprites/armor3_f_v2.png and /dev/null differ diff --git a/public/img/sprites/armor3_m.png b/public/img/sprites/armor3_m.png deleted file mode 100644 index 325be1e4e6..0000000000 Binary files a/public/img/sprites/armor3_m.png and /dev/null differ diff --git a/public/img/sprites/armor4_f_v1.png b/public/img/sprites/armor4_f_v1.png deleted file mode 100644 index cd04d48700..0000000000 Binary files a/public/img/sprites/armor4_f_v1.png and /dev/null differ diff --git a/public/img/sprites/armor4_f_v2.png b/public/img/sprites/armor4_f_v2.png deleted file mode 100644 index 1078b05b0f..0000000000 Binary files a/public/img/sprites/armor4_f_v2.png and /dev/null differ diff --git a/public/img/sprites/armor4_m.png b/public/img/sprites/armor4_m.png deleted file mode 100644 index de3f698563..0000000000 Binary files a/public/img/sprites/armor4_m.png and /dev/null differ diff --git a/public/img/sprites/armor5_f_v1.png b/public/img/sprites/armor5_f_v1.png deleted file mode 100644 index 888a2888d1..0000000000 Binary files a/public/img/sprites/armor5_f_v1.png and /dev/null differ diff --git a/public/img/sprites/armor5_f_v2.png b/public/img/sprites/armor5_f_v2.png deleted file mode 100644 index d8c889a96f..0000000000 Binary files a/public/img/sprites/armor5_f_v2.png and /dev/null differ diff --git a/public/img/sprites/armor5_m.png b/public/img/sprites/armor5_m.png deleted file mode 100644 index 6dcb9e3f7d..0000000000 Binary files a/public/img/sprites/armor5_m.png and /dev/null differ diff --git a/public/img/sprites/girl_v2.png b/public/img/sprites/girl_v2.png deleted file mode 100644 index 5e4cbf8dfa..0000000000 Binary files a/public/img/sprites/girl_v2.png and /dev/null differ diff --git a/public/img/sprites/item-axe.png b/public/img/sprites/item-axe.png deleted file mode 100644 index 823bad1c17..0000000000 Binary files a/public/img/sprites/item-axe.png and /dev/null differ diff --git a/public/img/sprites/item-bluesword.png b/public/img/sprites/item-bluesword.png deleted file mode 100644 index 53d9faf714..0000000000 Binary files a/public/img/sprites/item-bluesword.png and /dev/null differ diff --git a/public/img/sprites/item-clotharmor.png b/public/img/sprites/item-clotharmor.png deleted file mode 100644 index 88c8fc6506..0000000000 Binary files a/public/img/sprites/item-clotharmor.png and /dev/null differ diff --git a/public/img/sprites/item-flask.png b/public/img/sprites/item-flask.png deleted file mode 100644 index 5e1ac102e8..0000000000 Binary files a/public/img/sprites/item-flask.png and /dev/null differ diff --git a/public/img/sprites/item-goldenarmor.png b/public/img/sprites/item-goldenarmor.png deleted file mode 100644 index 0d3b9e77eb..0000000000 Binary files a/public/img/sprites/item-goldenarmor.png and /dev/null differ diff --git a/public/img/sprites/item-goldensword.png b/public/img/sprites/item-goldensword.png deleted file mode 100644 index 81d3fe83a2..0000000000 Binary files a/public/img/sprites/item-goldensword.png and /dev/null differ diff --git a/public/img/sprites/item-leatherarmor.png b/public/img/sprites/item-leatherarmor.png deleted file mode 100644 index bc27ab5354..0000000000 Binary files a/public/img/sprites/item-leatherarmor.png and /dev/null differ diff --git a/public/img/sprites/item-mailarmor.png b/public/img/sprites/item-mailarmor.png deleted file mode 100644 index 222ac2a50a..0000000000 Binary files a/public/img/sprites/item-mailarmor.png and /dev/null differ diff --git a/public/img/sprites/item-morningstar.png b/public/img/sprites/item-morningstar.png deleted file mode 100644 index 0051fb1f2a..0000000000 Binary files a/public/img/sprites/item-morningstar.png and /dev/null differ diff --git a/public/img/sprites/item-platearmor.png b/public/img/sprites/item-platearmor.png deleted file mode 100644 index a313038c71..0000000000 Binary files a/public/img/sprites/item-platearmor.png and /dev/null differ diff --git a/public/img/sprites/item-redarmor.png b/public/img/sprites/item-redarmor.png deleted file mode 100644 index 658047856f..0000000000 Binary files a/public/img/sprites/item-redarmor.png and /dev/null differ diff --git a/public/img/sprites/item-redsword.png b/public/img/sprites/item-redsword.png deleted file mode 100644 index d127e1611a..0000000000 Binary files a/public/img/sprites/item-redsword.png and /dev/null differ diff --git a/public/img/sprites/item-sword1.png b/public/img/sprites/item-sword1.png deleted file mode 100644 index f4c30d7e05..0000000000 Binary files a/public/img/sprites/item-sword1.png and /dev/null differ diff --git a/public/img/sprites/item-sword2.png b/public/img/sprites/item-sword2.png deleted file mode 100644 index 6b471faef7..0000000000 Binary files a/public/img/sprites/item-sword2.png and /dev/null differ diff --git a/public/img/sprites/pet_sprites.css b/public/img/sprites/pet_sprites.css new file mode 100644 index 0000000000..4bff991a0d --- /dev/null +++ b/public/img/sprites/pet_sprites.css @@ -0,0 +1,95 @@ +.Pet-Wolf-Zombie, .Pet-Wolf-White, .Pet-Wolf-Veteran, .Pet-Wolf-Skeleton, .Pet-Wolf-Shade, .Pet-Wolf-Red, .Pet-Wolf-Golden, .Pet-Wolf-Desert, .Pet-Wolf-CottonCandyPink, .Pet-Wolf-CottonCandyBlue, .Pet-TigerCub-Zombie, .Pet-TigerCub-White, .Pet-TigerCub-Skeleton, .Pet-TigerCub-Shade, .Pet-TigerCub-Red, .Pet-TigerCub-Golden, .Pet-TigerCub-Desert, .Pet-TigerCub-CottonCandyPink, .Pet-TigerCub-CottonCandyBlue, .Pet-TigerCub-Base, .Pet-PolarBearCub-Base, .Pet-PandaCub-Zombie, .Pet-PandaCub-White, .Pet-PandaCub-Skeleton, .Pet-PandaCub-Shade, .Pet-PandaCub-Red, .Pet-PandaCub-Golden, .Pet-PandaCub-Desert, .Pet-PandaCub-CottonCandyPink, .Pet-PandaCub-CottonCandyBlue, .Pet-PandaCub-Base, .Pet-LionCub-Zombie, .Pet-LionCub-White, .Pet-LionCub-Skeleton, .Pet-LionCub-Shade, .Pet-LionCub-Red, .Pet-LionCub-Golden, .Pet-LionCub-Desert, .Pet-LionCub-CottonCandyPink, .Pet-LionCub-CottonCandyBlue, .Pet-LionCub-Base, .Pet-Fox-Zombie, .Pet-Fox-White, .Pet-Fox-Skeleton, .Pet-Fox-Shade, .Pet-Fox-Red, .Pet-Fox-Golden, .Pet-Fox-Desert, .Pet-Fox-CottonCandyPink, .Pet-Fox-CottonCandyBlue, .Pet-Fox-Base, .Pet-FlyingPig-Zombie, .Pet-FlyingPig-White, .Pet-FlyingPig-Skeleton, .Pet-FlyingPig-Shade, .Pet-FlyingPig-Red, .Pet-FlyingPig-Golden, .Pet-FlyingPig-Desert, .Pet-FlyingPig-CottonCandyPink, .Pet-FlyingPig-CottonCandyBlue, .Pet-FlyingPig-Base, .Pet-Dragon-Zombie, .Pet-Dragon-White, .Pet-Dragon-Skeleton, .Pet-Dragon-Shade, .Pet-Dragon-Red, .Pet-Dragon-Golden, .Pet-Dragon-Desert, .Pet-Dragon-CottonCandyPink, .Pet-Dragon-CottonCandyBlue, .Pet-Dragon-Base, .Pet-Cactus-Skeleton, .Pet-Cactus-Red, .Pet-Cactus-Zombie, .Pet-Cactus-Shade, .Pet-Cactus-Golden, .Pet-Cactus-White, .Pet-Cactus-CottonCandyPink, .Pet-Cactus-CottonCandyBlue, .Pet-Cactus-Desert, .Pet-Cactus-Base, .Pet-BearCub-Zombie, .Pet-BearCub-White, .Pet-BearCub-Skeleton, .Pet-BearCub-Shade, .Pet-BearCub-Red, .Pet-BearCub-Golden, .Pet-BearCub-Desert, .Pet-BearCub-CottonCandyPink, .Pet-BearCub-CottonCandyBlue, .Pet-BearCub-Base, .Pet-Wolf-Base {background: url("/img/sprites/pet_sprites.png") no-repeat} + +.Pet-Wolf-Zombie {background-position: 0 0; width: 81px; height: 99px} +.Pet-Wolf-White {background-position: -81px 0; width: 81px; height: 99px} +.Pet-Wolf-Veteran {background-position: -162px 0; width: 81px; height: 99px} +.Pet-Wolf-Skeleton {background-position: -243px 0; width: 81px; height: 99px} +.Pet-Wolf-Shade {background-position: -324px 0; width: 81px; height: 99px} +.Pet-Wolf-Red {background-position: -405px 0; width: 81px; height: 99px} +.Pet-Wolf-Golden {background-position: -486px 0; width: 81px; height: 99px} +.Pet-Wolf-Desert {background-position: -567px 0; width: 81px; height: 99px} +.Pet-Wolf-CottonCandyPink {background-position: -648px 0; width: 81px; height: 99px} +.Pet-Wolf-CottonCandyBlue {background-position: -729px 0; width: 81px; height: 99px} +.Pet-TigerCub-Zombie {background-position: -810px 0; width: 81px; height: 99px} +.Pet-TigerCub-White {background-position: -891px 0; width: 81px; height: 99px} +.Pet-TigerCub-Skeleton {background-position: -972px 0; width: 81px; height: 99px} +.Pet-TigerCub-Shade {background-position: -1053px 0; width: 81px; height: 99px} +.Pet-TigerCub-Red {background-position: -1134px 0; width: 81px; height: 99px} +.Pet-TigerCub-Golden {background-position: -1215px 0; width: 81px; height: 99px} +.Pet-TigerCub-Desert {background-position: -1296px 0; width: 81px; height: 99px} +.Pet-TigerCub-CottonCandyPink {background-position: -1377px 0; width: 81px; height: 99px} +.Pet-TigerCub-CottonCandyBlue {background-position: -1458px 0; width: 81px; height: 99px} +.Pet-TigerCub-Base {background-position: -1539px 0; width: 81px; height: 99px} +.Pet-PolarBearCub-Base {background-position: -1620px 0; width: 81px; height: 99px} +.Pet-PandaCub-Zombie {background-position: -1701px 0; width: 81px; height: 99px} +.Pet-PandaCub-White {background-position: -1782px 0; width: 81px; height: 99px} +.Pet-PandaCub-Skeleton {background-position: -1863px 0; width: 81px; height: 99px} +.Pet-PandaCub-Shade {background-position: -1944px 0; width: 81px; height: 99px} +.Pet-PandaCub-Red {background-position: -2025px 0; width: 81px; height: 99px} +.Pet-PandaCub-Golden {background-position: -2106px 0; width: 81px; height: 99px} +.Pet-PandaCub-Desert {background-position: -2187px 0; width: 81px; height: 99px} +.Pet-PandaCub-CottonCandyPink {background-position: -2268px 0; width: 81px; height: 99px} +.Pet-PandaCub-CottonCandyBlue {background-position: -2349px 0; width: 81px; height: 99px} +.Pet-PandaCub-Base {background-position: -2430px 0; width: 81px; height: 99px} +.Pet-LionCub-Zombie {background-position: -2511px 0; width: 81px; height: 99px} +.Pet-LionCub-White {background-position: -2592px 0; width: 81px; height: 99px} +.Pet-LionCub-Skeleton {background-position: -2673px 0; width: 81px; height: 99px} +.Pet-LionCub-Shade {background-position: -2754px 0; width: 81px; height: 99px} +.Pet-LionCub-Red {background-position: -2835px 0; width: 81px; height: 99px} +.Pet-LionCub-Golden {background-position: -2916px 0; width: 81px; height: 99px} +.Pet-LionCub-Desert {background-position: -2997px 0; width: 81px; height: 99px} +.Pet-LionCub-CottonCandyPink {background-position: -3078px 0; width: 81px; height: 99px} +.Pet-LionCub-CottonCandyBlue {background-position: -3159px 0; width: 81px; height: 99px} +.Pet-LionCub-Base {background-position: -3240px 0; width: 81px; height: 99px} +.Pet-Fox-Zombie {background-position: -3321px 0; width: 81px; height: 99px} +.Pet-Fox-White {background-position: -3402px 0; width: 81px; height: 99px} +.Pet-Fox-Skeleton {background-position: -3483px 0; width: 81px; height: 99px} +.Pet-Fox-Shade {background-position: -3564px 0; width: 81px; height: 99px} +.Pet-Fox-Red {background-position: -3645px 0; width: 81px; height: 99px} +.Pet-Fox-Golden {background-position: -3726px 0; width: 81px; height: 99px} +.Pet-Fox-Desert {background-position: -3807px 0; width: 81px; height: 99px} +.Pet-Fox-CottonCandyPink {background-position: -3888px 0; width: 81px; height: 99px} +.Pet-Fox-CottonCandyBlue {background-position: -3969px 0; width: 81px; height: 99px} +.Pet-Fox-Base {background-position: -4050px 0; width: 81px; height: 99px} +.Pet-FlyingPig-Zombie {background-position: -4131px 0; width: 81px; height: 99px} +.Pet-FlyingPig-White {background-position: -4212px 0; width: 81px; height: 99px} +.Pet-FlyingPig-Skeleton {background-position: -4293px 0; width: 81px; height: 99px} +.Pet-FlyingPig-Shade {background-position: -4374px 0; width: 81px; height: 99px} +.Pet-FlyingPig-Red {background-position: -4455px 0; width: 81px; height: 99px} +.Pet-FlyingPig-Golden {background-position: -4536px 0; width: 81px; height: 99px} +.Pet-FlyingPig-Desert {background-position: -4617px 0; width: 81px; height: 99px} +.Pet-FlyingPig-CottonCandyPink {background-position: -4698px 0; width: 81px; height: 99px} +.Pet-FlyingPig-CottonCandyBlue {background-position: -4779px 0; width: 81px; height: 99px} +.Pet-FlyingPig-Base {background-position: -4860px 0; width: 81px; height: 99px} +.Pet-Dragon-Zombie {background-position: -4941px 0; width: 81px; height: 99px} +.Pet-Dragon-White {background-position: -5022px 0; width: 81px; height: 99px} +.Pet-Dragon-Skeleton {background-position: -5103px 0; width: 81px; height: 99px} +.Pet-Dragon-Shade {background-position: -5184px 0; width: 81px; height: 99px} +.Pet-Dragon-Red {background-position: -5265px 0; width: 81px; height: 99px} +.Pet-Dragon-Golden {background-position: -5346px 0; width: 81px; height: 99px} +.Pet-Dragon-Desert {background-position: -5427px 0; width: 81px; height: 99px} +.Pet-Dragon-CottonCandyPink {background-position: -5508px 0; width: 81px; height: 99px} +.Pet-Dragon-CottonCandyBlue {background-position: -5589px 0; width: 81px; height: 99px} +.Pet-Dragon-Base {background-position: -5670px 0; width: 81px; height: 99px} +.Pet-Cactus-Zombie {background-position: -5913px 0; width: 81px; height: 99px} +.Pet-Cactus-White {background-position: -6156px 0; width: 81px; height: 99px} +.Pet-Cactus-Skeleton {background-position: -5751px 0; width: 81px; height: 99px} +.Pet-Cactus-Red {background-position: -5832px 0; width: 81px; height: 99px} +.Pet-Cactus-Shade {background-position: -5994px 0; width: 81px; height: 99px} +.Pet-Cactus-Golden {background-position: -6075px 0; width: 81px; height: 99px} +.Pet-Cactus-Desert {background-position: -6399px 0; width: 81px; height: 99px} +.Pet-Cactus-CottonCandyPink {background-position: -6237px 0; width: 81px; height: 99px} +.Pet-Cactus-CottonCandyBlue {background-position: -6318px 0; width: 81px; height: 99px} +.Pet-Cactus-Base {background-position: -6480px 0; width: 81px; height: 99px} +.Pet-BearCub-Zombie {background-position: -6561px 0; width: 81px; height: 99px} +.Pet-BearCub-White {background-position: -6642px 0; width: 81px; height: 99px} +.Pet-BearCub-Skeleton {background-position: -6723px 0; width: 81px; height: 99px} +.Pet-BearCub-Shade {background-position: -6804px 0; width: 81px; height: 99px} +.Pet-BearCub-Red {background-position: -6885px 0; width: 81px; height: 99px} +.Pet-BearCub-Golden {background-position: -6966px 0; width: 81px; height: 99px} +.Pet-BearCub-Desert {background-position: -7047px 0; width: 81px; height: 99px} +.Pet-BearCub-CottonCandyPink {background-position: -7128px 0; width: 81px; height: 99px} +.Pet-BearCub-CottonCandyBlue {background-position: -7209px 0; width: 81px; height: 99px} +.Pet-BearCub-Base {background-position: -7290px 0; width: 81px; height: 99px} +.Pet-Wolf-Base {background-position: -7371px 0; width: 81px; height: 99px} +.Pet-Egg {background: url("/img/sprites/egg.png") no-repeat; width: 39px; height: 42px;} diff --git a/public/img/sprites/pet_sprites.png b/public/img/sprites/pet_sprites.png new file mode 100644 index 0000000000..85a52ebd30 Binary files /dev/null and b/public/img/sprites/pet_sprites.png differ diff --git a/public/img/sprites/player_sprites.css b/public/img/sprites/player_sprites.css new file mode 100644 index 0000000000..4a10fb6dfc --- /dev/null +++ b/public/img/sprites/player_sprites.css @@ -0,0 +1,77 @@ +.weapon_6, .weapon_5, .weapon_4, .weapon_3, .weapon_2, .weapon_1, .weapon_0, .skin_white, .skin_pale, .skin_orc, .skin_dead, .skin_black, .skin_asian, .shield_5_v1, .shield_5_v0, .shield_4_v0, .shield_3_v1, .shield_3_v0, .shield_2_v1, .shield_2_v0, .shield_1_v1, .shield_1_v0, _shield_4_v1, .nh_hair_white_v1, .nh_hair_white_v0, .nh_hair_brown_v1, .nh_hair_brown_v0, .nh_hair_blond_v1, .nh_hair_blond_v0, .nh_hair_black_v1, .nh_hair_black_v0, .head_5_v2, .head_5_v1, .head_5_v0, .head_4_v2, .head_4_v1, .head_4_v0, .head_3_v2, .head_3_v1, .head_3_v0, .head_2_v2, .head_2_v1, .head_2_v0, .head_1_v1, .head_1_v0, .head_0_v1, .head_0_v0, .hair_white_v1, .hair_white_v0, .hair_brown_v1, .hair_brown_v0, .hair_blond_v1, .hair_blond_v0, .hair_black_v1, .hair_black_v0, .armor_5_v1, .armor_5_v0, .armor_4_v1, .armor_4_v0, .armor_3_v1, .armor_3_v0, .armor_2_v0, .armor_1_v1, .armor_1_v0, .armor_0_v11, .armor_0_v10, .armor_0_v9, .armor_0_v8, .armor_0_v7, .armor_0_v6, .armor_0_v5, .armor_0_v4, .armor_0_v3, .armor_0_v2, .armor_0_v1, .armor_0_v0 {background: url(player_sprites.png) no-repeat} +.weapon_6 {background-position: 0 0; width: 90px; height: 90px} +.weapon_5 {background-position: -90px 0; width: 90px; height: 90px} +.weapon_4 {background-position: -180px 0; width: 90px; height: 90px} +.weapon_3 {background-position: -270px 0; width: 90px; height: 90px} +.weapon_2 {background-position: -360px 0; width: 90px; height: 90px} +.weapon_1 {background-position: -450px 0; width: 90px; height: 90px} +.weapon_0 {background-position: -540px 0; width: 90px; height: 90px} +.skin_white {background-position: -630px 0; width: 90px; height: 90px} +.skin_pale {background-position: -720px 0; width: 90px; height: 90px} +.skin_orc {background-position: -810px 0; width: 90px; height: 90px} +.skin_dead {background-position: -900px 0; width: 90px; height: 90px} +.skin_black {background-position: -990px 0; width: 90px; height: 90px} +.skin_asian {background-position: -1080px 0; width: 90px; height: 90px} +.shield_5_v1 {background-position: -1170px 0; width: 90px; height: 90px} +.shield_5_v0 {background-position: -1260px 0; width: 90px; height: 90px} +.shield_4_v0 {background-position: -1350px 0; width: 90px; height: 90px} +.shield_3_v1 {background-position: -1440px 0; width: 90px; height: 90px} +.shield_3_v0 {background-position: -1530px 0; width: 90px; height: 90px} +.shield_2_v1 {background-position: -1620px 0; width: 90px; height: 90px} +.shield_2_v0 {background-position: -1710px 0; width: 90px; height: 90px} +.shield_1_v1 {background-position: -1800px 0; width: 90px; height: 90px} +.shield_1_v0 {background-position: -1890px 0; width: 90px; height: 90px} +._shield_4_v1 {background-position: -1980px 0; width: 90px; height: 90px} +.nh_hair_white_v1 {background-position: -2070px 0; width: 90px; height: 90px} +.nh_hair_white_v0 {background-position: -2160px 0; width: 90px; height: 90px} +.nh_hair_brown_v1 {background-position: -2250px 0; width: 90px; height: 90px} +.nh_hair_brown_v0 {background-position: -2340px 0; width: 90px; height: 90px} +.nh_hair_blond_v1 {background-position: -2430px 0; width: 90px; height: 90px} +.nh_hair_blond_v0 {background-position: -2520px 0; width: 90px; height: 90px} +.nh_hair_black_v1 {background-position: -2610px 0; width: 90px; height: 90px} +.nh_hair_black_v0 {background-position: -2700px 0; width: 90px; height: 90px} +.head_5_v2 {background-position: -2790px 0; width: 90px; height: 90px} +.head_5_v1 {background-position: -2880px 0; width: 90px; height: 90px} +.head_5_v0 {background-position: -2970px 0; width: 90px; height: 90px} +.head_4_v2 {background-position: -3060px 0; width: 90px; height: 90px} +.head_4_v1 {background-position: -3150px 0; width: 90px; height: 90px} +.head_4_v0 {background-position: -3240px 0; width: 90px; height: 90px} +.head_3_v2 {background-position: -3330px 0; width: 90px; height: 90px} +.head_3_v1 {background-position: -3420px 0; width: 90px; height: 90px} +.head_3_v0 {background-position: -3510px 0; width: 90px; height: 90px} +.head_2_v2 {background-position: -3600px 0; width: 90px; height: 90px} +.head_2_v1 {background-position: -3690px 0; width: 90px; height: 90px} +.head_2_v0 {background-position: -3780px 0; width: 90px; height: 90px} +.head_1_v1 {background-position: -3870px 0; width: 90px; height: 90px} +.head_1_v0 {background-position: -3960px 0; width: 90px; height: 90px} +.head_0_v1 {background-position: -4050px 0; width: 90px; height: 90px} +.head_0_v0 {background-position: -4140px 0; width: 90px; height: 90px} +.hair_white_v1 {background-position: -4230px 0; width: 90px; height: 90px} +.hair_white_v0 {background-position: -4320px 0; width: 90px; height: 90px} +.hair_brown_v1 {background-position: -4410px 0; width: 90px; height: 90px} +.hair_brown_v0 {background-position: -4500px 0; width: 90px; height: 90px} +.hair_blond_v1 {background-position: -4590px 0; width: 90px; height: 90px} +.hair_blond_v0 {background-position: -4680px 0; width: 90px; height: 90px} +.hair_black_v1 {background-position: -4770px 0; width: 90px; height: 90px} +.hair_black_v0 {background-position: -4860px 0; width: 90px; height: 90px} +.armor_5_v1 {background-position: -4950px 0; width: 90px; height: 90px} +.armor_5_v0 {background-position: -5040px 0; width: 90px; height: 90px} +.armor_4_v1 {background-position: -5130px 0; width: 90px; height: 90px} +.armor_4_v0 {background-position: -5220px 0; width: 90px; height: 90px} +.armor_3_v1 {background-position: -5310px 0; width: 90px; height: 90px} +.armor_3_v0 {background-position: -5400px 0; width: 90px; height: 90px} +.armor_2_v0 {background-position: -5490px 0; width: 90px; height: 90px} +.armor_1_v1 {background-position: -5580px 0; width: 90px; height: 90px} +.armor_1_v0 {background-position: -5670px 0; width: 90px; height: 90px} +.armor_0_v11 {background-position: -5760px 0; width: 90px; height: 90px} +.armor_0_v10 {background-position: -5850px 0; width: 90px; height: 90px} +.armor_0_v9 {background-position: -5940px 0; width: 90px; height: 90px} +.armor_0_v8 {background-position: -6030px 0; width: 90px; height: 90px} +.armor_0_v7 {background-position: -6120px 0; width: 90px; height: 90px} +.armor_0_v6 {background-position: -6210px 0; width: 90px; height: 90px} +.armor_0_v5 {background-position: -6300px 0; width: 90px; height: 90px} +.armor_0_v4 {background-position: -6390px 0; width: 90px; height: 90px} +.armor_0_v3 {background-position: -6480px 0; width: 90px; height: 90px} +.armor_0_v2 {background-position: -6570px 0; width: 90px; height: 90px} +.armor_0_v1 {background-position: -6660px 0; width: 90px; height: 90px} +.armor_0_v0 {background-position: -6750px 0; width: 90px; height: 90px} diff --git a/public/img/sprites/player_sprites.png b/public/img/sprites/player_sprites.png new file mode 100644 index 0000000000..104ae3681b Binary files /dev/null and b/public/img/sprites/player_sprites.png differ diff --git a/public/img/sprites/weapon0.png b/public/img/sprites/weapon0.png deleted file mode 100644 index f4c30d7e05..0000000000 Binary files a/public/img/sprites/weapon0.png and /dev/null differ diff --git a/public/img/sprites/weapon1.png b/public/img/sprites/weapon1.png deleted file mode 100644 index 4ce8fb9407..0000000000 Binary files a/public/img/sprites/weapon1.png and /dev/null differ diff --git a/public/img/sprites/weapon2.png b/public/img/sprites/weapon2.png deleted file mode 100644 index 823bad1c17..0000000000 Binary files a/public/img/sprites/weapon2.png and /dev/null differ diff --git a/public/img/sprites/weapon3.png b/public/img/sprites/weapon3.png deleted file mode 100644 index 7151d9a5d3..0000000000 Binary files a/public/img/sprites/weapon3.png and /dev/null differ diff --git a/public/img/sprites/weapon4.png b/public/img/sprites/weapon4.png deleted file mode 100644 index 4c3f6e3996..0000000000 Binary files a/public/img/sprites/weapon4.png and /dev/null differ diff --git a/public/img/sprites/weapon5.png b/public/img/sprites/weapon5.png deleted file mode 100644 index 1fe8eb0e11..0000000000 Binary files a/public/img/sprites/weapon5.png and /dev/null differ diff --git a/public/img/sprites/weapon6.png b/public/img/sprites/weapon6.png deleted file mode 100644 index ad2f524fab..0000000000 Binary files a/public/img/sprites/weapon6.png and /dev/null differ diff --git a/public/img/sprites/wolf.png b/public/img/sprites/wolf.png deleted file mode 100644 index 595ece75a1..0000000000 Binary files a/public/img/sprites/wolf.png and /dev/null differ diff --git a/public/img/sprites/wolf_border.png b/public/img/sprites/wolf_border.png deleted file mode 100644 index 3f2db1c1a0..0000000000 Binary files a/public/img/sprites/wolf_border.png and /dev/null differ diff --git a/src/app/character.coffee b/src/app/character.coffee index 7b215fb746..ad76409346 100644 --- a/src/app/character.coffee +++ b/src/app/character.coffee @@ -104,7 +104,6 @@ module.exports.app = (appExports, model) -> content: html $('.main-herobox').popover 'show' - userSchema = # _id stats: { gp: 0, exp: 0, lvl: 1, hp: 50 } @@ -117,7 +116,7 @@ userSchema = rewardIds: [] apiToken: null # set in newUserObject below lastCron: 'new' #this will be replaced with `+new Date` on first run - balance: 1 + balance: 0 tasks: {} flags: partyEnabled: false diff --git a/src/app/helpers.coffee b/src/app/helpers.coffee index 88230466ce..900edcc610 100644 --- a/src/app/helpers.coffee +++ b/src/app/helpers.coffee @@ -2,19 +2,32 @@ moment = require 'moment' _ = require 'underscore' # Absolute diff between two dates -module.exports.daysBetween = (yesterday, now, dayStart) -> +daysBetween = (yesterday, now, dayStart) -> #sanity-check reset-time (is it 24h time?) dayStart = 0 unless (dayStart? and (dayStart = parseInt(dayStart)) and dayStart >= 0 and dayStart <= 24) Math.abs moment(yesterday).startOf('day').add('h', dayStart).diff(moment(now), 'days') - -module.exports.dayMapping = dayMapping = {0:'su',1:'m',2:'t',3:'w',4:'th',5:'f',6:'s',7:'su'} -module.exports.viewHelpers = (view) -> +dayMapping = dayMapping = {0:'su',1:'m',2:'t',3:'w',4:'th',5:'f',6:'s',7:'su'} +# http://stackoverflow.com/questions/2532218/pick-random-property-from-a-javascript-object +# obj: object +# returns random property (the value) +randomVal = (obj) -> + result = undefined + count = 0 + for key, val of obj + result = val if Math.random() < (1 / ++count) + result + +removeWhitespace = (str) -> + return '' unless str + str.replace /\s/g, '' + +viewHelpers = (view) -> view.fn "percent", (x, y) -> x=1 if x==0 Math.round(x/y*100) - + view.fn "round", (num) -> Math.round num @@ -23,11 +36,11 @@ module.exports.viewHelpers = (view) -> view.fn "ceil", (num) -> Math.ceil num - + view.fn "lt", (a, b) -> a < b view.fn 'gt', (a, b) -> a > b - + view.fn "tokens", (gp) -> return gp/0.25 @@ -38,10 +51,12 @@ module.exports.viewHelpers = (view) -> loc = window?.location.host or process.env.BASE_URL encodeURIComponent "http://#{loc}/v1/users/#{uid}/calendar.ics?apiToken=#{apiToken}" + view.fn 'removeWhitespace', removeWhitespace + view.fn "notEqual", (a, b) -> (a != b) view.fn "and", -> _.reduce arguments, (cumm, curr) -> cumm && curr view.fn "or", -> _.reduce arguments, (cumm, curr) -> cumm || curr - view.fn "truarr", (num) -> - return num-1 + view.fn "truarr", (num) -> num-1 +module.exports = { viewHelpers, removeWhitespace, randomVal, daysBetween, dayMapping } diff --git a/src/app/index.coffee b/src/app/index.coffee index 33f75bee36..5317003429 100644 --- a/src/app/index.coffee +++ b/src/app/index.coffee @@ -21,6 +21,7 @@ browser = require './browser' party = require './party' items = require './items' profile = require './profile' +pets = require './pets' helpers.viewHelpers view character.view view @@ -65,6 +66,7 @@ ready (model) -> items.app(exports, model) party.app(exports, model) profile.app(exports, model) + pets.app(exports, model) require('../server/private').app(exports, model) require('./debug').app(exports, model) if model.get('_view.nodeEnv') != 'production' browser.app(exports, model, app) diff --git a/src/app/items.coffee b/src/app/items.coffee index a635efd8b6..17a7c40e3b 100644 --- a/src/app/items.coffee +++ b/src/app/items.coffee @@ -38,29 +38,38 @@ items = module.exports.items = reroll: {type: 'reroll', text: "Re-Roll", classes: 'reroll', notes: "Resets your task values back to 0 (yellow). Useful when everything's red and it's hard to stay alive.", value:0 } pets: [ - {index: 0, text: 'Bear Cub', name: 'bearcub', icon: 'Pet-BearCub-Base.png', value: 3} - {index: 1, text: 'Cactus', name: 'cactus', icon: 'Pet-Cactus-Base.png', value: 3} - {index: 2, text: 'Drake', name: 'dragon', icon: 'Pet-Dragon-Base.png', value: 3} - {index: 3, text: 'Flying Pig', name: 'flyingpig', icon: 'Pet-FlyingPig-Base.png', value: 3} - {index: 4, text: 'Fox', name: 'fox', icon: 'Pet-Fox-Base.png', value: 3} - {index: 5, text: 'Lion Cub', name: 'lioncub', icon: 'Pet-LionCub-Base.png', value: 3} - {index: 6, text: 'Panda Cub', name: 'pandacub', icon: 'Pet-PandaCub-Base.png', value: 3} - {index: 7, text: 'Tiger Cub', name: 'tigercub', icon: 'Pet-TigerCub-Base.png', value: 3} - {index: 8, text: 'Desert Wolf', name: 'wolfDesert', icon: 'Pet-Wolf-Desert.png', value: 3} - {index: 9, text: 'Golden Wolf', name: 'wolfGolden', icon: 'Pet-Wolf-Golden.png', value: 3} - {index: 10, text: 'Red Wolf', name: 'wolfRed', icon: 'Pet-Wolf-Red.png', value: 3} - {index: 11, text: 'Shade Wolf', name: 'wolfShade', icon: 'Pet-Wolf-Shade.png', value: 3} - {index: 12, text: 'Skeleton Wolf', name: 'wolfSkeleton', icon: 'Pet-Wolf-Skeleton.png', value: 3} - {index: 13, text: 'Veteran Wolf', name: 'wolfVeteran', icon: 'Pet-Wolf-Veteran.png', value: 3} - {index: 14, text: 'White Wolf', name: 'wolfWhite', icon: 'Pet-Wolf-White.png', value: 3} - {index: 15, text: 'Zombie Wolf', name: 'wolfZombie', icon: 'Pet-Wolf-Zombie.png', value: 3} - {index: 16, text: 'Wolf', name: 'wolfBorder', icon: 'wolf_border.png', value: 3} + {text: 'Wolf', name: 'Wolf', value: 3} + {text: 'Tiger Cub', name: 'TigerCub', value: 3} + #{text: 'Polar Bear Cub', name: 'PolarBearCub', value: 3} #commented out because there are no polarbear modifiers yet, special drop? + {text: 'Panda Cub', name: 'PandaCub', value: 3} + {text: 'Lion Cub', name: 'LionCub', value: 3} + {text: 'Fox', name: 'Fox', value: 3} + {text: 'Flying Pig', name: 'FlyingPig', value: 3} + {text: 'Dragon', name: 'Dragon', value: 3} + {text: 'Cactus', name: 'Cactus', value: 3} + {text: 'Bear Cub', name: 'BearCub', value: 3} + ] + + hatchingPotions: [ + {text: 'Base', name: 'Base', notes: "Hatches your pet in it's base form.", value: 1} + {text: 'White', name: 'White', notes: 'Turns your animal into a White pet.', value: 2} + {text: 'Desert', name: 'Desert', notes: 'Turns your animal into a Desert pet.', value: 2} + {text: 'Red', name: 'Red', notes: 'Turns your animal into a Red pet.', value: 3} + {text: 'Shade', name: 'Shade', notes: 'Turns your animal into a Shade pet.', value: 3} + {text: 'Skeleton', name: 'Skeleton', notes: 'Turns your animal into a Skeleton.', value: 3} + {text: 'Zombie', name: 'Zombie', notes: 'Turns your animal into a Zombie.', value: 4} + {text: 'Cotton Candy Pink', name: 'CottonCandyPink', notes: 'Turns your animal into a Cotton Candy Pink pet.', value: 4} + {text: 'Cotton Candy Blue', name: 'CottonCandyBlue', notes: 'Turns your animal into a Cotton Candy Blue pet.', value: 4} + {text: 'Golden', name: 'Golden', notes: 'Turns your animal into a Golden pet.', value: 5} ] # add "type" to each item, so we can reference that as "weapon" or "armor" in the html _.each ['weapon', 'armor', 'head', 'shield'], (key) -> _.each items[key], (item) -> item.type = key +_.each items.pets, (pet) -> pet.notes = 'Find a hatching potion to pour on this egg, and one day it will hatch into a loyal pet.' +_.each items.hatchingPotions, (hatchingPotion) -> hatchingPotion.notes = "Pour this on an egg, and it will hatch as a #{hatchingPotion.text} pet." + ### view exports ### @@ -141,22 +150,6 @@ module.exports.app = (appExports, model) -> hp = 50 if hp > 50 user.set 'stats.hp', hp - appExports.selectPet = (e, el) -> - name = $(el).attr('data-pet') - pet = _.find items.pets, (p) -> p.name == name - debugger - if user.get "items.pets.#{name}" - user.set 'items.pet', pet - else - tokens = user.get('balance')*4 - if tokens > pet.value - r = confirm("Buy this pet with #{pet.value} of your #{tokens} tokens?"); - if r - user.set "items.pets.#{name}", true - user.set 'items.pet', pet - user.set 'balance', (tokens-pet.value)/4 - else - $('#more-tokens-modal').modal('show') appExports.activateRewardsTab = -> model.set '_view.activeTabRewards', true @@ -211,6 +204,7 @@ module.exports.updateStore = updateStore = (model) -> model.set '_view.items.potion', items.potion model.set '_view.items.reroll', items.reroll model.set '_view.items.pets', items.pets + model.set '_view.items.hatchingPotions', items.hatchingPotions diff --git a/src/app/pets.coffee b/src/app/pets.coffee new file mode 100644 index 0000000000..93d11d703e --- /dev/null +++ b/src/app/pets.coffee @@ -0,0 +1,86 @@ +_ = require 'underscore' +{ randomVal } = require './helpers' +{ pets, hatchingPotions } = require('./items').items + +### + app exports +### +module.exports.app = (appExports, model) -> + user = model.at '_user' + + user.on 'set', 'flags.dropsEnabled', (captures, args) -> + return unless captures == true + + egg = randomVal pets + + dontPersist = model._dontPersist + + model._dontPersist = false + user.push 'items.eggs', egg + model._dontPersist = dontPersist + + $('#drops-enabled-modal').modal 'show' + + appExports.chooseEgg = (e, el) -> + model.ref '_hatchEgg', e.at() + + appExports.hatchEgg = (e, el) -> + hatchingPotionName = $(el).children('select').val() + myHatchingPotion = user.get 'items.hatchingPotions' + egg = model.get '_hatchEgg' + eggs = user.get 'items.eggs' + myPets = user.get 'items.pets' + + hatchingPotionIdx = myHatchingPotion.indexOf hatchingPotionName + eggIdx = eggs.indexOf egg + + return alert "You don't own that hatching potion yet, complete more tasks!" if hatchingPotionIdx is -1 + return alert "You don't own that egg yet, complete more tasks!" if eggIdx is -1 + return alert "You already have that pet, hatch a different combo." if myPets and myPets.indexOf("#{egg.name}-#{hatchingPotionName}") != -1 + + user.push 'items.pets', egg.name + '-' + hatchingPotionName + + eggs.splice eggIdx, 1 + myHatchingPotion.splice hatchingPotionIdx, 1 + user.set 'items.eggs', eggs + user.set 'items.hatchingPotions', myHatchingPotion + + alert 'Your egg hatched! Visit your stable to equip your pet.' + + #FIXME Bug: this removes from the array properly in the browser, but on refresh is has removed all items from the arrays +# user.remove 'items.hatchingPotions', hatchingPotionIdx, 1 +# user.remove 'items.eggs', eggIdx, 1 + + appExports.choosePet = (e, el) -> + petStr = $(el).attr('data-pet') + [name, modifier] = petStr.split('-') + pet = _.findWhere pets, name: name + pet.modifier = modifier + pet.str = petStr + ownsThisPet = user.get('items.pets').indexOf petStr + if ownsThisPet != -1 + # If user's pet is already active, deselect it + pet = {} if user.get('items.currentPet.str') is petStr + user.set 'items.currentPet', pet + + appExports.buyHatchingPotion = (e, el) -> + name = $(el).attr 'data-hatchingPotion' + newHatchingPotion = _.findWhere hatchingPotions, name: name + tokens = user.get('balance') * 4 + if tokens > newHatchingPotion.value + if confirm "Buy this hatching potion with #{newHatchingPotion.value} of your #{tokens} tokens?" + user.push 'items.hatchingPotions', newHatchingPotion.name + user.set 'balance', (tokens - newHatchingPotion.value) / 4 + else + $('#more-tokens-modal').modal 'show' + + appExports.buyEgg = (e, el) -> + name = $(el).attr 'data-egg' + newEgg = _.findWhere pets, name: name + tokens = user.get('balance') * 4 + if tokens > newEgg.value + if confirm "Buy this egg with #{newEgg.value} of your #{tokens} tokens?" + user.push 'items.eggs', newEgg + user.set 'balance', (tokens - newEgg.value) / 4 + else + $('#more-tokens-modal').modal 'show' diff --git a/src/app/scoring.coffee b/src/app/scoring.coffee index 4a4882c02d..6c6d481893 100644 --- a/src/app/scoring.coffee +++ b/src/app/scoring.coffee @@ -1,14 +1,79 @@ async = require 'async' moment = require 'moment' _ = require 'underscore' -helpers = require './helpers' +{ randomVal } = helpers = require './helpers' browser = require './browser' character = require './character' items = require './items' +{ pets, hatchingPotions } = items.items algos = require './algos' MODIFIER = algos.MODIFIER # each new level, armor, weapon add 2% modifier (this mechanism will change) +### + Drop System +### +randomDrop = (model, delta) -> + user = model.at('_user') + + # limit drops to 2 / day + user.setNull 'items.lastDrop', + date: +moment().subtract('d',1) # trick - set it to yesterday on first run, that way they can get drops today + count: 0 + reachedDropLimit = (helpers.daysBetween(user.get('items.lastDrop.date'), +new Date) is 0) and user.get('items.lastDrop.count') >= 2 + return if reachedDropLimit and model.flags.nodeEnv != 'development' + + # % chance of getting a pet or meat + # debugging purpose - 50% chance during development, 3% chance on prod + chanceMultiplier = if (model.flags.nodeEnv is 'development') then 50 else 1 + chanceMultiplier *= Math.abs(delta) # multiply chance by reddness + if user.get('flags.dropsEnabled') and Math.random() < (.01 * chanceMultiplier) + # current breakdown - 3% (adjustable) chance on drop + # If they got a drop: 50% chance of egg, 50% Hatching Potion. If hatchingPotion, broken down further even further + rarity = Math.random() + + # Egg, 40% chance + if rarity > .6 + drop = randomVal(pets) + user.push 'items.eggs', drop + drop.type = 'Egg' + drop.dialog = "You've found a #{drop.text} Egg! #{drop.notes}" + + # Hatching Potion, 60% chance - break down by rarity even more. FIXME this may not be the best method, so revisit + else + acceptableDrops = [] + + # Tier 5 (Blue Moon Rare) + if rarity < .1 + acceptableDrops = ['Base', 'White', 'Desert', 'Red', 'Shade', 'Skeleton', 'Zombie', 'CottonCandyPink', 'CottonCandyBlue', 'Golden'] + + # Tier 4 (Very Rare) + else if rarity < .2 + acceptableDrops = ['Base', 'White', 'Desert', 'Red', 'Shade', 'Skeleton', 'Zombie', 'CottonCandyPink', 'CottonCandyBlue'] + + # Tier 3 (Rare) + else if rarity < .3 + acceptableDrops = ['Base', 'White', 'Desert', 'Red', 'Shade', 'Skeleton'] + + # Tier 2 (Scarce) + else if rarity < .4 + acceptableDrops = ['Base', 'White', 'Desert'] + # Tier 1 (Common) + else + acceptableDrops = ['Base'] + + acceptableDrops = _.filter(hatchingPotions, (hatchingPotion) -> hatchingPotion.name in acceptableDrops) + drop = randomVal acceptableDrops + user.push 'items.hatchingPotions', drop.name + drop.type = 'HatchingPotion' + drop.dialog = "You've found a #{drop.text} Hatching Potion! #{drop.notes}" + + model.set '_drop', drop + $('#item-dropped-modal').modal 'show' + + user.set 'items.lastDrop.date', +new Date + user.incr 'items.lastDrop.count' + # {taskId} task you want to score # {direction} 'up' or 'down' # {times} # times to call score on this task (1 unless cron, usually) @@ -104,7 +169,9 @@ score = (model, taskId, direction, times, batch, cron) -> taskObj.value = value batch.set "#{taskPath}.value", taskObj.value origStats = _.clone obj.stats - updateStats model, {hp: hp, exp: exp, gp: gp}, batch + updateStats model, { hp, exp, gp }, batch + + # Commit if commit # newStats / origStats is a glorious hack to trick Derby into seeing the change in model.on(*) newStats = _.clone batch.obj().stats @@ -112,6 +179,10 @@ score = (model, taskId, direction, times, batch, cron) -> batch.setStats(newStats) # batch.setStats() batch.commit() + + # Drop system + randomDrop(model, delta) if direction is 'up' + return delta ### @@ -159,7 +230,7 @@ updateStats = (model, newStats, batch) -> obj.stats.exp = newStats.exp #if silent #console.log("pushing silent :" + obj.stats.exp) - #user.pass(true).set('stats.exp', obj.stats.exp) + #user.pass(true).set('stats.exp', obj.stats.exp) # Set flags when they unlock features if !obj.flags.customizationsNotification and (obj.stats.exp > 10 or obj.stats.lvl > 1) @@ -167,14 +238,11 @@ updateStats = (model, newStats, batch) -> obj.flags.customizationsNotification = true if !obj.flags.itemsEnabled and obj.stats.lvl >= 2 # Set to object, then also send to browser right away to get model.on() subscription notification - batch.set 'flags.itemsEnabled', true - obj.flags.itemsEnabled = true + batch.set 'flags.itemsEnabled', obj.flags.itemsEnabled = true if !obj.flags.partyEnabled and obj.stats.lvl >= 3 - batch.set 'flags.partyEnabled', true - obj.flags.partyEnabled = true - if !obj.flags.petsEnabled and obj.stats.lvl >= 4 - batch.set 'flags.petsEnabled', true - obj.flags.petsEnabled = true + batch.set 'flags.partyEnabled', obj.flags.partyEnabled = true + if !obj.flags.dropsEnabled and obj.stats.lvl >= 4 + batch.set 'flags.dropsEnabled', obj.flags.dropsEnabled = true if newStats.gp? #FIXME what was I doing here? I can't remember, gp isn't defined diff --git a/src/server/private.coffee b/src/server/private.coffee index 3f7bc8e5cc..1606395bf5 100644 --- a/src/server/private.coffee +++ b/src/server/private.coffee @@ -20,12 +20,14 @@ module.exports.app = (appExports, model) -> .error (err) -> alert err.responseText + disableAds = if (model.get('_user.flags.ads') is 'hide') then '' else 'Disable Ads, ' + StripeCheckout.open key: model.get('_stripePubKey') address: false amount: 500 name: "Checkout" - description: "Purchase 20 Tokens." + description: "Buy 20 Tokens, #{disableAds}Support the Developers" panelLabel: "Checkout" token: token diff --git a/styles/app/avatar.styl b/styles/app/avatar.styl index 8d4bbba54a..8f43e95dcb 100644 --- a/styles/app/avatar.styl +++ b/styles/app/avatar.styl @@ -45,6 +45,13 @@ future re: pets and whatnot, this is just temporary. // make it a bit special background darken($better, 15%) +.character-sprites span + position: absolute + +#profileStable + .active + border 1px solid black + // vertically center avatar sprite // depending on if they have a pet .herobox[data-checkpet="hasPet"] diff --git a/styles/app/index.styl b/styles/app/index.styl index 008f8a3f29..7c9e6e86ab 100644 --- a/styles/app/index.styl +++ b/styles/app/index.styl @@ -6,7 +6,10 @@ @import "./avatar.styl"; @import "./customizer.styl"; @import "./items.styl"; +@import "./inventory.styl"; @import "./alerts.styl"; +@import "../../public/img/sprites/pet_sprites.css"; +@import "../../public/img/sprites/PetEggs.css"; @import "./helpers.styl"; @import "./responsive.styl"; @import "./header.styl"; diff --git a/styles/app/inventory.styl b/styles/app/inventory.styl new file mode 100644 index 0000000000..4ae647a728 --- /dev/null +++ b/styles/app/inventory.styl @@ -0,0 +1,50 @@ +.token-wallet + cursor: pointer + .tile + background-color: darken($neutral, 10%) + .add-token-btn + opacity: 0 + &:hover, &:focus + .add-token-btn + opacity: 1 + background-color: $good + .tile + opacity: 1 + + +// pets (this will all change when pet system is overhauled) +.pet-grid + padding-top: 1.5em + border-top: rgba(0,0,0,0.1) + table + width: 100% + td + padding: 0.5em + width: 25% + &.active-pet + background-color: $bad + outline: 1px solid rgba(0,0,0,0.1) + outline-offset: -1px + &:hover, &:focus + background-color: darken($better, 10%) + +.current-pet + left: 0px + bottom: 0px + +.item-drop-icon + float:left + padding-right:20px + padding-bottom:20px + +.Pet_Food_Base, .Pet_Food_Zombie, .Pet_Food_White, .Pet_Food_Veteran, .Pet_Food_Skeleton, .Pet_Food_Shade, .Pet_Food_Red, .Pet_Food_Golden, .Pet_Food_Desert, .Pet_Food_CottonCandyPink, .Pet_Food_CottonCandyBlue, .Pet_Food_Zombie, .Pet_Food_White, .Pet_Food_Skeleton, .Pet_Food_Shade, .Pet_Food_Red, .Pet_Food_Golden, .Pet_Food_Desert, .Pet_Food_CottonCandyPink, .Pet_Food_CottonCandyBlue, .Pet_Food_Base, .Pet_Food_Base, .Pet_Food_Zombie, .Pet_Food_White, .Pet_Food_Skeleton, .Pet_Food_Shade, .Pet_Food_Red, .Pet_Food_Golden, .Pet_Food_Desert, .Pet_Food_CottonCandyPink, .Pet_Food_CottonCandyBlue, .Pet_Food_Base, .Pet_Food_Zombie, .Pet_Food_White, .Pet_Food_Skeleton, .Pet_Food_Shade, .Pet_Food_Red, .Pet_Food_Golden, .Pet_Food_Desert, .Pet_Food_CottonCandyPink, .Pet_Food_CottonCandyBlue, .Pet_Food_Base, .Pet_Food_Zombie, .Pet_Food_White, .Pet_Food_Skeleton, .Pet_Food_Shade, .Pet_Food_Red, .Pet_Food_Golden, .Pet_Food_Desert, .Pet_Food_CottonCandyPink, .Pet_Food_CottonCandyBlue, .Pet_Food_Base, .Pet_Food_Zombie, .Pet_Food_White, .Pet_Food_Skeleton, .Pet_Food_Shade, .Pet_Food_Red, .Pet_Food_Golden, .Pet_Food_Desert, .Pet_Food_CottonCandyPink, .Pet_Food_CottonCandyBlue, .Pet_Food_Base, .Pet_Food_Zombie, .Pet_Food_White, .Pet_Food_Skeleton, .Pet_Food_Shade, .Pet_Food_Red, .Pet_Food_Golden, .Pet_Food_Desert, .Pet_Food_CottonCandyPink, .Pet_Food_CottonCandyBlue, .Pet_Food_Base, .Pet_Food_SugarCube, .Pet_Food_Strawberry, .Pet_Food_Rotten, .Pet_Food_Licorice, .Pet_Food_Golden, .Pet_Food_Cream, .Pet_Food_CottonCandyPink, .Pet_Food_CottonCandyBlue, .Pet_Food_Chocolate, .Pet_Food_Base, .Pet_Food_Zombie, .Pet_Food_White, .Pet_Food_Skeleton, .Pet_Food_Shade, .Pet_Food_Red, .Pet_Food_Golden, .Pet_Food_Desert, .Pet_Food_CottonCandyPink, .Pet_Food_CottonCandyBlue, .Pet_Food_Base + background: url("/img/hatching_powder.png") no-repeat + width:34px + height:34px + +.inventory-list li + clear:both +.pets-menu > div + float:left +.hatchingPotions-menu > div + float:left diff --git a/styles/app/items.styl b/styles/app/items.styl index 1c2edbb42c..d84f6a8544 100644 --- a/styles/app/items.styl +++ b/styles/app/items.styl @@ -59,34 +59,4 @@ margin-right: 0.5em // border: 1px solid rgba(0,0,0,0.1) border-top: 0 - border-bottom: 0 - -.token-wallet - cursor: pointer - .tile - background-color: darken($neutral, 10%) - .add-token-btn - opacity: 0 - &:hover, &:focus - .add-token-btn - opacity: 1 - background-color: $good - .tile - opacity: 1 - - -// pets (this will all change when pet system is overhauled) -.pet-grid - padding-top: 1.5em - border-top: rgba(0,0,0,0.1) - table - width: 100% - td - padding: 0.5em - width: 25% - &.active-pet - background-color: $bad - outline: 1px solid rgba(0,0,0,0.1) - outline-offset: -1px - &:hover, &:focus - background-color: darken($better, 10%) \ No newline at end of file + border-bottom: 0 \ No newline at end of file diff --git a/views/app/avatar.html b/views/app/avatar.html index c9917edf23..82a98b407a 100644 --- a/views/app/avatar.html +++ b/views/app/avatar.html @@ -1,18 +1,39 @@ {#if _profileActiveMain} - + {#with _user.preferences} + -
-
- +
+
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
- -
-
+ {/} {else} {/} @@ -41,18 +62,20 @@
">
- {#if and(@profile.items.pet, not(@minimal))}{/} {#with @profile.preferences as :p} - - - - {#if :p.showHelm} - - {else} - + + + + {#if :p.showHelm} + + {else} + + {/} + + {/} - - + {#if and(@profile.items.currentPet, not(@minimal))} + {/}
@@ -190,4 +213,63 @@ - Original User! \ No newline at end of file + Original User! + + + + + + + + +
+ + + + +

Welcome to the market!

+ Dying to get that particular pet you're after, but don't want to wait for it to drop? Buy it here! +

Eggs

+ {#with _view.items.pets as :egg} + + + {#with :egg[0]}{/} + {#with :egg[1]}{/} + {#with :egg[2]}{/} + {#with :egg[3]}{/} + + + {#with :egg[4]}{/} + {#with :egg[5]}{/} + {#with :egg[6]}{/} + {#with :egg[7]}{/} + + + {#with :egg[8]}{/} + +
+ {/} +

Hatching Potions

+ {#with _view.items.hatchingPotions as :hatchingPotion} + + + {#with :hatchingPotion[0]}{/} + {#with :hatchingPotion[1]}{/} + {#with :hatchingPotion[2]}{/} + {#with :hatchingPotion[3]}{/} + + + {#with :hatchingPotion[4]}{/} + {#with :hatchingPotion[5]}{/} + {#with :hatchingPotion[6]}{/} + {#with :hatchingPotion[7]}{/} + + + {#with :hatchingPotion[8]}{/} + {#with :hatchingPotion[9]}{/} + +
+ {/} +
+ + diff --git a/views/app/index.html b/views/app/index.html index 5fd2ec3382..a214bcfa77 100644 --- a/views/app/index.html +++ b/views/app/index.html @@ -7,6 +7,7 @@ + HabitRPG | Gamify Your Life @@ -46,7 +47,6 @@ - diff --git a/views/app/modals.html b/views/app/modals.html index aa6d010a1d..b435bcf479 100644 --- a/views/app/modals.html +++ b/views/app/modals.html @@ -3,6 +3,7 @@ +
@@ -31,12 +32,24 @@ -

You're out of tokens, which are used to buy pets and mounts.

+

Oops, out of tokens, which are used to buy special items! Habit is an open source project, and can use all the help it can get - buy more tokens to receive this pet, and consider it a donation to the contributors

<@footer> Buy More TokensNot enough tokens
+ +

+ Habit an open source project, and can use all the help it can get - consider this a donation to the contributors. You also get 20 tokens from the purchase, which you can use to buy special items. +

+

+ "Hey, I backed the Kickstarter!" - follow these instructions. +

+ <@footer> + + +
+ diff --git a/views/app/pets.html b/views/app/pets.html new file mode 100644 index 0000000000..8bd02bb78c --- /dev/null +++ b/views/app/pets.html @@ -0,0 +1,101 @@ + + + +

You've unlocked the Drop System! Now when you complete tasks, you have a small chance of finding an item. And guess what, you just found a {_user.items.eggs.0.text} egg! {_user.items.eggs.0.notes}

+ <@footer> + + +
+ + +

{_drop.dialog}

+ + + <@footer> + + +
+ + + + + + + + +
+ {.text}
{.value} tokens + + + + +
+ {.text}
{.value} tokens + + + +
+
+ +
  • + + {#if not(_user.items.eggs)} +

    You don't have any eggs yet.

    + {/if} + {#each _user.items.eggs as :egg} +
    + +

    {:egg.text}

    +
    + {/each} +
    +
  • +
  • + + {#if not(_user.items.hatchingPotions)} +

    You don't have any hatching potions yet.

    + {/if} + {#each _user.items.hatchingPotions as :hatchingPotion} +
    + +

    {:hatchingPotion}

    +
    + {/each} +
    +
  • +
    +
    + {#if _hatchEgg} +
    +

    Hatch Your Egg

    + {#if not(_user.items.hatchingPotions)} +

    You don't have any hatching potions yet.

    + {else} +

    Which hatching potion will you pour on your {_hatchEgg.text} egg?

    +
    + + +
    + {/if} +
    + {/if} +
    + + + {#if _user.items.pets} + +
  • + + {#each _user.items.pets as :pet} + + {/} + +
  • +
    + {else} +

    You don't have any pets yet.

    + {/} \ No newline at end of file diff --git a/views/app/rewards.html b/views/app/rewards.html index 37cfb2189c..a5c906adf0 100644 --- a/views/app/rewards.html +++ b/views/app/rewards.html @@ -2,113 +2,44 @@
    - - {#unless _view.activeTabPets} -
    - {gold(_user.stats.gp)} - -
    -
    - {silver(_user.stats.gp)} - -
    - - {else} - - {/} -
    -

    {{t("Rewards")}}

    - - - {#if equal(_user.flags.petsEnabled,true)} -
    -
    -
    - -
    - - -
    - {#with _view.items.pets as :pets} - - - {#with :pets[0]}{/} - {#with :pets[1]}{/} - {#with :pets[2]}{/} - {#with :pets[3]}{/} - - - {#with :pets[4]}{/} - {#with :pets[5]}{/} - {#with :pets[6]}{/} - {#with :pets[7]}{/} - - - {#with :pets[8]}{/} - {#with :pets[9]}{/} - {#with :pets[10]}{/} - {#with :pets[11]}{/} - - - {#with :pets[12]}{/} - {#with :pets[13]}{/} - {#with :pets[14]}{/} - {#with :pets[15]}{/} - - - {#with :pets[16]}{/} - -
    - {/} -
    - + +
    + {gold(_user.stats.gp)} +
    +
    + {silver(_user.stats.gp)} + +
    +
    -
    + {/} - - {else} - + + {#if _user.flags.itemsEnabled} +
      + {#with _view.items.weapon as :item}{/} + {#with _view.items.armor as :item}{/} + {#with _view.items.head as :item}{/} + {#with _view.items.shield as :item}{/} + {#with _view.items.potion as :item}{/} + {#with _view.items.reroll as :item}{/} +
    {/}
    - - - - - {#if _rewardList} -
      - {#each _rewardList as :task}{/} -
    - {/} - - - {#if _user.flags.itemsEnabled} -
      - {#with _view.items.weapon as :item}{/} - {#with _view.items.armor as :item}{/} - {#with _view.items.head as :item}{/} - {#with _view.items.shield as :item}{/} - {#with _view.items.potion as :item}{/} - {#with _view.items.reroll as :item}{/} -
    - {/} - - - - - - @@ -124,7 +55,7 @@
    - +
    {#if @reroll} @@ -139,4 +70,4 @@

    {:item.text}

    - \ No newline at end of file + diff --git a/views/app/tasks.html b/views/app/tasks.html index 3656df8ea0..61c9bd9059 100644 --- a/views/app/tasks.html +++ b/views/app/tasks.html @@ -1,3 +1,24 @@ + + {{#if and( _loggedIn, notEqual(_user.flags.ads,'hide') )}} + +

    + + + + + + {{/}} + @@ -6,7 +27,11 @@

    {{t("Habits")}}

    -
      {#each _habitList as :task}{/}
    +
      + {#each _habitList as :task}{/} +
    +
    +
    @@ -15,7 +40,11 @@

    {{t("Daily")}}

    -
      {#each _dailyList as :task}{/}
    +
      + {#each _dailyList as :task}{/} +
    +
    +
    @@ -42,6 +71,8 @@
      {#each _todoList as :task}{/}
    +
    +