diff --git a/migrations/20130327_apply_tokens.js b/migrations/20130327_apply_tokens.js
index 5f62f55ac3..73b0d1b997 100644
--- a/migrations/20130327_apply_tokens.js
+++ b/migrations/20130327_apply_tokens.js
@@ -55,10 +55,46 @@ var mapping = [
}
];
+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(
{
- _id: { $in: tier.users },
+ $or: [
+ { _id: { $in: tier.users } },
+ { 'auth.local.username': { $in: tier.users } },
+ { 'auth.local.email': { $in: tier.users } }
+ ],
'backer.tokensApplied': { $exists: false }
},
@@ -70,3 +106,4 @@ _.each(mapping, function(tier){
{ multi: true}
)
})
+*/
diff --git a/public/img/sprites/PetEggs.css b/public/img/sprites/PetEggs.css
index 3d42804a1a..bd70a03b65 100644
--- a/public/img/sprites/PetEggs.css
+++ b/public/img/sprites/PetEggs.css
@@ -19,21 +19,4 @@
.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 */
-
-/* Temporary until we get the other hatching potions */
-/* Commenting this out since it's no longer needed, feel free to completely remove -Shaners
-.Pet_HatchingPotion_Zombie, .Pet_HatchingPotion_CottonCandyPink, .Pet_HatchingPotion_CottonCandyBlue, .Pet_HatchingPotion_Golden {background-position: -48px -0px; width: 48px; height: 51px}
-.Pet_HatchingPotion_Zombie {
- -webkit-filter: invert(1);
-}
-.Pet_HatchingPotion_CottonCandyPink {
- -webkit-filter: hue-rotate(120deg);
-}
-.Pet_HatchingPotion_CottonCandyBlue {
- -webkit-filter: saturate(3);
-}
-.Pet_HatchingPotion_Golden {
- -webkit-filter: hue-rotate(220deg);
-}
-*/
\ No newline at end of file
+.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/src/app/items.coffee b/src/app/items.coffee
index 9f15bb3908..17a7c40e3b 100644
--- a/src/app/items.coffee
+++ b/src/app/items.coffee
@@ -51,7 +51,7 @@ items = module.exports.items =
]
hatchingPotions: [
- {text: 'Common', name: 'Base', notes: "Hatches your pet in it's base form.", value: 1}
+ {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}
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/views/app/modals.html b/views/app/modals.html
index 5ed072a657..b435bcf479 100644
--- a/views/app/modals.html
+++ b/views/app/modals.html
@@ -32,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
+ 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.
+