Skip to content

Commit

Permalink
Merge pull request #11 from lefnire/develop
Browse files Browse the repository at this point in the history
Update my develop branch
  • Loading branch information
Shaners committed Apr 6, 2013
2 parents 5fc9fdb + 9808b9a commit 70e75b6
Show file tree
Hide file tree
Showing 181 changed files with 1,509 additions and 544 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,8 @@
## 3/27/2013
* Drop system + pets overhaul
* http://www.kickstarter.com/projects/lefnire/habitrpg-mobile/posts/439433
* https://trello.com/card/pets/50e5d3684fe3a7266b0036d6/166

## 3/21/2013
* More design tweaks to header & avatars: https://github.com/lefnire/habitrpg/issues/585

Expand Down
119 changes: 112 additions & 7 deletions locales/en/app.json
@@ -1,10 +1,115 @@
{
"Habit": "Habit",
"Daily": "Daily",
"Todo": "Todo",
"Reward": "Reward",
"_commenttut": "TUTORIAL",

"_commenthead": "HEADER",
"Health": "Health",
"Experience": "Experience",
"History": "History",
"Settings": "Settings",
"Party": "Party",
"Logout": "Logout",

"_commentuser": "USER",
"Anonymous": "Anonymous",
"Avatar": "Avatar",
"Level": "Level",
"GP": "GP",
"Head": "Head",
"ShowHelm": "Show Helm",
"Hair": "Hair",
"Skin": "Skin",
"Profile": "Profile",
"Edit": "Edit",
"Save": "Save",
"PhotoUrl": "Photo Url",
"FullName": "Full Name",
"Blurb": "Blurb",
"Websites": "Add Website",
"Achievements": "Achievements",
"OriginalUser": "Original User!",
"Inventory": "Inventory",
"EggsTitle": "Eggs",
"EggsContent": "You don't have any eggs yet.",
"HatchingPotionsTitle": "Hatching Potions",
"HatchingPotionsContent": "You don't have any hatching potions yet.",
"Market": "Market",
"MarketTitle": "Welcome to the market!",
"MarketContent": "Dying to get that particular pet you're after, but don't want to wait for it to drop? Buy it here!",
"Stable": "Stable",
"Tokens": "Tokens",

"_commentitems": "DROPS, ITEMS & REWARDS",
"_comment": "PET EGGS",
"WolfEgg": "Wolf Cub",
"TigerEgg": "Tiger Cub",
"PandaEgg": "Wolf Cub",
"LionEgg": "Lion Cub",
"FoxEgg": "Fox",
"PigEgg": "Flying Pig",
"DragonEgg": "Dragon",
"CactusEgg": "Cactus",
"BearEgg": "Bear Cub",
"WolfEgg": "Wolf",
"_comment": "HATCHING POTIONS",
"BasePot": "Base",
"WhitePot": "White",
"DesertPot": "Desert",
"RedPot": "Red",
"ShadePot": "Shadepot",
"SkeletonPot": "Skeleton",
"ZombiePot": "Zombie",
"CottonPinkPot": "Cotton Candy Pink",
"CottonBluePot": "Cotton Candy Pot",
"GoldenPot": "Golden",
"_comment": "GOLD REWARDS",



"_commentmain": "MAIN WINDOW",
"Habits": "Habits",
"Dailies": "Dailies",
"NewHabit": "New Habit",
"Edit": "Edit",
"Text": "Text",
"ExtraNotes": "Extra Notes",
"Directions/Actions": "Directions/Actions",
"AdvancedOptions": "Advanced Options",
"Difficulty": "Difficulty",
"DifficultyHelpTitle": "How difficult is this task?",
"DifficultyHelpContent": "This multiplies its point value. Use sparingly, rely instead on our organic value-adjustment algorithms. But some tasks are grossly more valuable (Write Thesis vs Floss Teeth). Click for more info.",
"Easy": "Easy",
"Medium": "Medium",
"Hard": "Hard",
"Save&Close": "Save & Close",
"Delete": "Delete",
"Progress": "Progress",
"Score": "Score",
"Daily": "Dailys",
"NewDaily": "New Daily",
"Repeat": "Repeat",
"Su": "Su",
"M": "M",
"T": "T",
"We": "W",
"Th": "Th",
"F": "F",
"S": "S",
"Todos": "Todos",
"Rewards": "Rewards"
}
"NewTodo": "New Todo",
"DueDate": "Due Date",
"Remaining": "Remaining",
"Complete": "Complete",
"Rewards": "Rewards",
"Gold": "Gold",
"Silver": "Silver",
"NewReward": "New Reward",
"Price": "Price",

"_commentfooter": "FOOTER",

"_commentmisc": "MISC",
"RemoveAds": "Remove Ads",
"WhyAds": "Why Ads?",
"WhyAdsContent1": "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.",
"WhyAdsContent2": "'Hey, I backed the Kickstarter!' - follow ",
"WhyAdsContent3": "these instructions."
}
8 changes: 6 additions & 2 deletions migrations/20130212_preen_cron.js
Expand Up @@ -44,9 +44,13 @@ db.users.find(un_registered).forEach(function(user) {
});


db.sessions.find().forEach(function(sess){
/**
* Don't remove missing user auths anymore. This was previously necessary due to data corruption,
* revisit if needs be
*/
/*db.sessions.find().forEach(function(sess){
var uid = JSON.parse(sess.session).userId;
if (!uid || db.users.count({_id:uid}) === 0) {
db.sessions.remove({_id:sess._id});
}
});
});*/
92 changes: 92 additions & 0 deletions 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);
}
})
109 changes: 109 additions & 0 deletions 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}
)
})
*/
4 changes: 2 additions & 2 deletions package.json
@@ -1,7 +1,7 @@
{
"name": "habitrpg",
"description": "A habit tracker app which treats your goals like a Role Playing Game.",
"version": "0.0.0-150",
"version": "0.0.0-151",
"main": "./server.js",
"dependencies": {
"derby": "git://github.com/Unroll-Me/derby#master",
Expand All @@ -17,7 +17,7 @@
"moment": "*",
"stripe": "*",
"async": "*",
"lodash": "*",
"lodash": "1.0.x",
"coffee-script": "1.4.x",
"underscore": "*",
"mongoskin": "*",
Expand Down
Binary file added public/img/hatching_powder.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/img/sprites/Egg_Sprite_Sheet.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/img/sprites/Mount-SpriteSheet.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 13 additions & 11 deletions 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}
.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}
Binary file removed public/img/sprites/Pet-BearCub-Base.png
Binary file not shown.
Binary file removed public/img/sprites/Pet-BearCub-CottonCandyBlue.png
Binary file not shown.
Binary file removed public/img/sprites/Pet-BearCub-CottonCandyPink.png
Binary file not shown.
Binary file removed public/img/sprites/Pet-BearCub-Desert.png
Binary file not shown.
Binary file removed public/img/sprites/Pet-BearCub-Golden.png
Binary file not shown.
Binary file removed public/img/sprites/Pet-BearCub-Red.png
Binary file not shown.
Binary file removed public/img/sprites/Pet-BearCub-Shade.png
Binary file not shown.
Binary file removed public/img/sprites/Pet-BearCub-Skeleton.png
Binary file not shown.
Binary file removed public/img/sprites/Pet-BearCub-White.png
Binary file not shown.
Binary file removed public/img/sprites/Pet-BearCub-Zombie.png
Binary file not shown.
Binary file removed public/img/sprites/Pet-Cactus-Base.png
Binary file not shown.
Binary file removed public/img/sprites/Pet-Cactus-Chocolate.png
Binary file not shown.
Binary file removed public/img/sprites/Pet-Cactus-CottonCandyBlue.png
Binary file not shown.
Binary file removed public/img/sprites/Pet-Cactus-CottonCandyPink.png
Binary file not shown.
Binary file removed public/img/sprites/Pet-Cactus-Cream.png
Binary file not shown.
Binary file removed public/img/sprites/Pet-Cactus-Golden.png
Binary file not shown.
Binary file removed public/img/sprites/Pet-Cactus-Licorice.png
Binary file not shown.
Binary file removed public/img/sprites/Pet-Cactus-Rotten.png
Binary file not shown.
Binary file removed public/img/sprites/Pet-Cactus-Strawberry.png
Binary file not shown.
Binary file removed public/img/sprites/Pet-Cactus-SugarCube.png
Binary file not shown.
Binary file removed public/img/sprites/Pet-Dragon-Base.png
Binary file not shown.
Binary file removed public/img/sprites/Pet-Dragon-CottonCandyBlue.png
Binary file not shown.
Binary file removed public/img/sprites/Pet-Dragon-CottonCandyPink.png
Diff not rendered.
Binary file removed public/img/sprites/Pet-Dragon-Desert.png
Diff not rendered.
Binary file removed public/img/sprites/Pet-Dragon-Golden.png
Diff not rendered.
Binary file removed public/img/sprites/Pet-Dragon-Red.png
Diff not rendered.
Binary file removed public/img/sprites/Pet-Dragon-Shade.png
Diff not rendered.
Binary file removed public/img/sprites/Pet-Dragon-Skeleton.png
Diff not rendered.
Binary file removed public/img/sprites/Pet-Dragon-White.png
Diff not rendered.
Binary file removed public/img/sprites/Pet-Dragon-Zombie.png
Diff not rendered.
Binary file removed public/img/sprites/Pet-FlyingPig-Base.png
Diff not rendered.
Binary file removed public/img/sprites/Pet-FlyingPig-CottonCandyBlue.png
Diff not rendered.
Binary file removed public/img/sprites/Pet-FlyingPig-CottonCandyPink.png
Diff not rendered.
Binary file removed public/img/sprites/Pet-FlyingPig-Desert.png
Diff not rendered.
Binary file removed public/img/sprites/Pet-FlyingPig-Golden.png
Diff not rendered.
Binary file removed public/img/sprites/Pet-FlyingPig-Red.png
Diff not rendered.
Binary file removed public/img/sprites/Pet-FlyingPig-Shade.png
Diff not rendered.
Binary file removed public/img/sprites/Pet-FlyingPig-Skeleton.png
Diff not rendered.
Binary file removed public/img/sprites/Pet-FlyingPig-White.png
Diff not rendered.
Binary file removed public/img/sprites/Pet-FlyingPig-Zombie.png
Diff not rendered.
Binary file removed public/img/sprites/Pet-Fox-Base.png
Diff not rendered.
Binary file removed public/img/sprites/Pet-Fox-CottonCandyBlue.png
Diff not rendered.
Binary file removed public/img/sprites/Pet-Fox-CottonCandyPink.png
Diff not rendered.
Binary file removed public/img/sprites/Pet-Fox-Desert.png
Diff not rendered.
Binary file removed public/img/sprites/Pet-Fox-Golden.png
Diff not rendered.
Binary file removed public/img/sprites/Pet-Fox-Red.png
Diff not rendered.
Binary file removed public/img/sprites/Pet-Fox-Shade.png
Diff not rendered.
Binary file removed public/img/sprites/Pet-Fox-Skeleton.png
Diff not rendered.
Binary file removed public/img/sprites/Pet-Fox-White.png
Diff not rendered.
Binary file removed public/img/sprites/Pet-Fox-Zombie.png
Diff not rendered.
Binary file removed public/img/sprites/Pet-LionCub-Base.png
Diff not rendered.
Binary file removed public/img/sprites/Pet-LionCub-CottonCandyBlue.png
Diff not rendered.
Binary file removed public/img/sprites/Pet-LionCub-CottonCandyPink.png
Diff not rendered.
Binary file removed public/img/sprites/Pet-LionCub-Desert.png
Diff not rendered.
Binary file removed public/img/sprites/Pet-LionCub-Golden.png
Diff not rendered.
Binary file removed public/img/sprites/Pet-LionCub-Red.png
Diff not rendered.
Binary file removed public/img/sprites/Pet-LionCub-Shade.png
Diff not rendered.
Binary file removed public/img/sprites/Pet-LionCub-Skeleton.png
Diff not rendered.
Binary file removed public/img/sprites/Pet-LionCub-White.png
Diff not rendered.
Binary file removed public/img/sprites/Pet-LionCub-Zombie.png
Diff not rendered.
Binary file removed public/img/sprites/Pet-PandaCub-Base.png
Diff not rendered.
Binary file removed public/img/sprites/Pet-PandaCub-CottonCandyBlue.png
Diff not rendered.
Binary file removed public/img/sprites/Pet-PandaCub-CottonCandyPink.png
Diff not rendered.
Binary file removed public/img/sprites/Pet-PandaCub-Desert.png
Diff not rendered.
Binary file removed public/img/sprites/Pet-PandaCub-Golden.png
Diff not rendered.
Binary file removed public/img/sprites/Pet-PandaCub-Red.png
Diff not rendered.
Binary file removed public/img/sprites/Pet-PandaCub-Shade.png
Diff not rendered.
Binary file removed public/img/sprites/Pet-PandaCub-Skeleton.png
Diff not rendered.
Binary file removed public/img/sprites/Pet-PandaCub-White.png
Diff not rendered.
Binary file removed public/img/sprites/Pet-PandaCub-Zombie.png
Diff not rendered.
Binary file removed public/img/sprites/Pet-PolarBearCub-Base.png
Diff not rendered.
Binary file removed public/img/sprites/Pet-TigerCub-Base.png
Diff not rendered.
Binary file removed public/img/sprites/Pet-TigerCub-CottonCandyBlue.png
Diff not rendered.
Binary file removed public/img/sprites/Pet-TigerCub-CottonCandyPink.png
Diff not rendered.
Binary file removed public/img/sprites/Pet-TigerCub-Desert.png
Diff not rendered.
Binary file removed public/img/sprites/Pet-TigerCub-Golden.png
Diff not rendered.
Binary file removed public/img/sprites/Pet-TigerCub-Red.png
Diff not rendered.
Binary file removed public/img/sprites/Pet-TigerCub-Shade.png
Diff not rendered.
Binary file removed public/img/sprites/Pet-TigerCub-Skeleton.png
Diff not rendered.
Binary file removed public/img/sprites/Pet-TigerCub-White.png
Diff not rendered.
Binary file removed public/img/sprites/Pet-TigerCub-Zombie.png
Diff not rendered.
Binary file removed public/img/sprites/Pet-Wolf-CottonCandyBlue.png
Diff not rendered.
Binary file removed public/img/sprites/Pet-Wolf-CottonCandyPink.png
Diff not rendered.
Binary file removed public/img/sprites/Pet-Wolf-Desert.png
Diff not rendered.
Binary file removed public/img/sprites/Pet-Wolf-Golden.png
Diff not rendered.
Binary file removed public/img/sprites/Pet-Wolf-Red.png
Diff not rendered.
Binary file removed public/img/sprites/Pet-Wolf-Shade.png
Diff not rendered.
Binary file removed public/img/sprites/Pet-Wolf-Skeleton.png
Diff not rendered.
Binary file removed public/img/sprites/Pet-Wolf-Veteran.png
Diff not rendered.
Binary file removed public/img/sprites/Pet-Wolf-White.png
Diff not rendered.
Binary file removed public/img/sprites/Pet-Wolf-Zombie.png
Diff not rendered.

0 comments on commit 70e75b6

Please sign in to comment.