feat(greeting-cards): Thank-You & Greets

This commit is contained in:
Sabe Jones 2015-08-13 16:58:31 -05:00
parent f57e3e69a1
commit 00a212660a
8 changed files with 45 additions and 28 deletions

View file

@ -122,13 +122,13 @@
"greeting3": "\"Hey you!\"",
"cheeryChum": "Cheery Chum",
"cheeryChumText": "Hey! Hi! Hello! Sent or received <%= cards %> greeting cards.",
"thankyouCard": "Thank You Card",
"thankyouCard": "Thank-You Card",
"thankyouCardExplanation": "You both receive the Greatly Grateful achievement!",
"thankyouCardNotes": "Send a thank you card to a party member.",
"thankyouCardNotes": "Send a Thank-You card to a party member.",
"thankyou0": "\"Thank you very much!\"",
"thankyou1": "\"Thank you, thank you, thank you!\"",
"thankyou2": "\"Sending you a thousand thanks.\"",
"thankyou3": "\"I'm very grateful - thank you!\"",
"greatlyGrateful": "Greatly Grateful",
"greatlyGratefulText": "Thanks for being thankful! Sent or received <%= cards %> thank you cards."
"greatlyGratefulText": "Thanks for being thankful! Sent or received <%= cards %> Thank-You cards."
}

View file

@ -928,6 +928,7 @@ api.spells =
if !target.items.special.nyeReceived
target.items.special.nyeReceived = []
target.items.special.nyeReceived.push user.profile.name
target.flags.cardReceived = true
target.markModified? 'items.special.nyeReceived'
user.stats.gp -= 10
@ -951,6 +952,7 @@ api.spells =
if !target.items.special.valentineReceived
target.items.special.valentineReceived = []
target.items.special.valentineReceived.push user.profile.name
target.flags.cardReceived = true
target.markModified? 'items.special.valentineReceived'
user.stats.gp -= 10
@ -974,6 +976,7 @@ api.spells =
if !target.items.special.greetingReceived
target.items.special.greetingReceived = []
target.items.special.greetingReceived.push user.profile.name
target.flags.cardReceived = true
target.markModified? 'items.special.greetingReceived'
user.stats.gp -= 10
@ -997,6 +1000,7 @@ api.spells =
if !target.items.special.thankyouReceived
target.items.special.thankyouReceived = []
target.items.special.thankyouReceived.push user.profile.name
target.flags.cardReceived = true
target.markModified? 'items.special.thankyouReceived'
user.stats.gp -= 10

View file

@ -1168,7 +1168,8 @@ api.wrap = (user, main=true) ->
user.stats.mp++ if stat is 'int' #increase their MP along with their max MP
cb? null, _.pick(user,$w 'stats')
readCard: (cardType, cb) ->
readCard: (req, cb) ->
{cardType} = req.params
user.items.special["#{cardType}Received"].shift()
user.markModified? "items.special.#{cardType}Received"
user.flags.cardReceived = false

View file

@ -31,10 +31,7 @@ angular.module('habitrpg')
}
$scope.clearMessages = Chat.seenMessage;
$scope.clearCards = function() {
$scope.user.flags.cardReceived = false;
};
$scope.clearCards = Chat.clearCards;
$scope.iconClasses = function() {
return selectNotificationValue(
@ -48,7 +45,7 @@ angular.module('habitrpg')
};
$scope.hasNoNotifications = function() {
return selectNotificationValue(false, false, false, false, true);
return selectNotificationValue(false, false, false, false, false, true);
}
}
]);

View file

@ -15,14 +15,19 @@ function($resource, $http, ApiUrl, User) {
var chatService = {
seenMessage: seenMessage,
clearCards: clearCards,
utils: utils
};
return chatService;
function clearCards() {
User.user.ops.update && User.set({'flags.cardReceived':false});
}
function seenMessage(gid) {
// On enter, set chat message to "seen"
$http.post(ApiUrl.get() + '/api/v2/groups/'+gid+'/chat/seen');
if (User.user.newMessages) delete User.user.newMessages[gid];
}
}])
}]);

View file

@ -200,7 +200,7 @@
p
| 20&nbsp;
span.shop_gold
div(ng-repeat='type in Content.cardTypes')
div(ng-repeat='type in Content.cardTypes', ng-show='type.yearRound')
button.customize-option(class='inventory_special_{{::type.key}}',
popover='{{::Content.spells.special[type.key].notes()}}',
popover-title='{{::Content.spells.special[type.key].text()}}',

View file

@ -9,4 +9,4 @@ script(id='modals/cards.html', type='text/ng-template')
markdown(text='{{::cardMessage}}')
.modal-footer
small.pull-left {{::env.t(cardType + 'CardExplanation')}}
button.btn.btn-default(ng-click='user.ops.readCard(cardType); $close()')=env.t('ok')
button.btn.btn-default(ng-click='user.ops.readCard({params: {cardType: cardType}}); $close()')=env.t('ok')

View file

@ -1,28 +1,38 @@
h5 8/4/2015 - NEW ITEMS IN THE ENCHANTED ARMOIRE AND AUGUST BACKGROUNDS
h5 8/13/2015 - GOLD-PURCHASABLE CARDS
hr
tr
td
.background_pyramids.pull-right
h5 August Backgrounds Revealed
p There are three new avatar backgrounds in the <a href='/#/options/profile/backgrounds'>Background Shop</a>! Now your avatar can admire the Pyramids, stalk across the Sunset Savannah, or dance under Twinkly Party Lights!
p.small.muted by (in order): minac1, Bambin, and rosiesully
tr
td
.promo_enchanted_armoire_201508.pull-right
h5 New Items in the Enchanted Armoire!
p There is new equipment in Enchanted Armoire, a 100 GP Reward in the Rewards Column which unlocks after you've attained Ultimate Gear!
.inventory_special_greeting.pull-right
.inventory_special_thankyou.pull-right
h5 Gold-Purchasable Cards
p There are two new types of Card available in the <a href='/#/options/inventory/drops'>Market</a> that you can send to the people in your Party: Greeting Cards and Thank-You Cards! Both cost 10 Gold, and will be available year-round. Sending or receiving these cards will give you some fun achievements!
br
p Click on the Enchanted Armoire for a random chance at special Equipment, including the Golden Toga Item Set and the Horned Iron Item Set.! It may also give you random XP or food items. We'll be adding new equipment to it during the first week of each month, but even when you've exhausted the current supply, you can keep clicking for a chance at food and XP.
br
p Now go spend all that accumulated Gold! May the Random Number Generator smile upon you...
br
p.small.muted by Lemoness and SabreCat
p.small.muted Art by Kiwibot, Starsystemic, Podcod, and UncommonCriminal
p Enjoy!
p.small.muted by PainterProphet, Teto Is Great, Lemoness, and SabreCat
hr
a(href='/static/old-news', target='_blank') Read older news
mixin oldNews
h5 8/4/2015 - NEW ITEMS IN THE ENCHANTED ARMOIRE AND AUGUST BACKGROUNDS
tr
td
.background_pyramids.pull-right
h5 August Backgrounds Revealed
p There are three new avatar backgrounds in the <a href='/#/options/profile/backgrounds'>Background Shop</a>! Now your avatar can admire the Pyramids, stalk across the Sunset Savannah, or dance under Twinkly Party Lights!
p.small.muted by (in order): minac1, Bambin, and rosiesully
tr
td
.promo_enchanted_armoire_201508.pull-right
h5 New Items in the Enchanted Armoire!
p There is new equipment in Enchanted Armoire, a 100 GP Reward in the Rewards Column which unlocks after you've attained Ultimate Gear!
br
p Click on the Enchanted Armoire for a random chance at special Equipment, including the Golden Toga Item Set and the Horned Iron Item Set.! It may also give you random XP or food items. We'll be adding new equipment to it during the first week of each month, but even when you've exhausted the current supply, you can keep clicking for a chance at food and XP.
br
p Now go spend all that accumulated Gold! May the Random Number Generator smile upon you...
br
p.small.muted by Lemoness and SabreCat
p.small.muted Art by Kiwibot, Starsystemic, Podcod, and UncommonCriminal
h5 8/2/2015 - AUGUST MYSTERY BOX!
tr
td