feat(cards): Good Luck card and achievement

This commit is contained in:
SabreCat
2017-07-19 18:24:10 +00:00
parent e4d006e5cd
commit 3af756a90d
12 changed files with 77 additions and 8 deletions

View File

@@ -122,7 +122,7 @@ describe('achievements', () => {
});
it('card achievements exist with counts', () => {
let cardTypes = ['greeting', 'thankyou', 'birthday', 'congrats', 'getwell'];
let cardTypes = ['greeting', 'thankyou', 'birthday', 'congrats', 'getwell', 'goodluck'];
cardTypes.forEach((card) => {
let cardAchiev = basicAchievs[`${card}Cards`];

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 416 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

View File

@@ -202,6 +202,14 @@
"getwell3": "Sorry you're not feeling your best!",
"getwellCardAchievementTitle": "Caring Confidant",
"getwellCardAchievementText": "Well-wishes are always appreciated. Sent or received <%= count %> get well cards.",
"goodluckCard": "Good Luck Card",
"goodluckCardExplanation": "You both receive the Lucky Letter achievement!",
"goodluckCardNotes": "Send a good luck card to a party member.",
"goodluck0": "May luck always follow you!",
"goodluck1": "Wishing you lots of luck!",
"goodluck2": "I hope luck is on your side today and always!!",
"goodluckCardAchievementTitle": "Lucky Letter",
"goodluckCardAchievementText": "Wishes for good luck are great encouragement! Sent or received <%= count %> good luck cards.",
"streakAchievement": "You earned a streak achievement!",
"firstStreakAchievement": "21-Day Streak",
"streakAchievementCount": "<%= streaks %> 21-Day Streaks",

View File

@@ -186,7 +186,7 @@ let ultimateGearAchievs = ['healer', 'rogue', 'warrior', 'mage'].reduce((achievs
}, {});
Object.assign(achievementsData, ultimateGearAchievs);
let cardAchievs = ['greeting', 'thankyou', 'nye', 'valentine', 'birthday', 'congrats', 'getwell'].reduce((achievs, type) => {
let cardAchievs = ['greeting', 'thankyou', 'nye', 'valentine', 'birthday', 'congrats', 'getwell', 'goodluck'].reduce((achievs, type) => {
achievs[`${type}Cards`] = {
icon: `achievement-${type}`,
titleKey: `${type}CardAchievementTitle`,

View File

@@ -169,6 +169,11 @@ api.cardTypes = {
messageOptions: 4,
yearRound: true,
},
goodluck: {
key: 'goodluck',
messageOptions: 3,
yearRound: true,
},
};
api.special = api.spells.special;

View File

@@ -567,6 +567,34 @@ spells.special = {
if (!target.flags) target.flags = {};
target.flags.cardReceived = true;
user.stats.gp -= 10;
},
},
goodluck: {
text: t('goodluckCard'),
mana: 0,
value: 10,
immediateUse: true,
silent: true,
target: 'user',
notes: t('goodluckCardNotes'),
cast (user, target) {
if (user === target) {
if (!user.achievements.goodluck) user.achievements.goodluck = 0;
user.achievements.goodluck++;
} else {
each([user, target], (u) => {
if (!u.achievements.goodluck) u.achievements.goodluck = 0;
u.achievements.goodluck++;
});
}
if (!target.items.special.goodluckReceived) target.items.special.goodluckReceived = [];
target.items.special.goodluckReceived.push(user.profile.name);
if (!target.flags) target.flags = {};
target.flags.cardReceived = true;
user.stats.gp -= 10;
},
},

View File

@@ -192,7 +192,7 @@ function _getBasicAchievements (user, language) {
_addUltimateGear(result, user, {path: 'warrior', language});
_addUltimateGear(result, user, {path: 'mage', altPath: 'wizard', language});
let cardAchievements = ['greeting', 'thankyou', 'birthday', 'congrats', 'getwell'];
let cardAchievements = ['greeting', 'thankyou', 'birthday', 'congrats', 'getwell', 'goodluck'];
cardAchievements.forEach(path => {
_addSimpleWithCount(result, user, {path, key: `${path}Cards`, language});
});

View File

@@ -113,6 +113,7 @@ let schema = new Schema({
partyOn: Boolean,
congrats: Number,
getwell: Number,
goodluck: Number,
royallyLoyal: Boolean,
joinedGuild: Boolean,
joinedChallenge: Boolean,
@@ -295,6 +296,8 @@ let schema = new Schema({
congratsReceived: Array,
getwell: {type: Number, default: 0},
getwellReceived: Array,
goodluck: {type: Number, default: 0},
goodluckReceived: Array,
},
// -------------- Animals -------------------

View File

@@ -1,17 +1,42 @@
h2 7/13/2017 - BEHIND THE SCENES: KING MANTA
h2 7/18/2017 - SAN DIEGO COMIC CON, GOOD LUCK CARDS, APP BUG FIXES, AND WIKI WEDNESDAY
hr
tr
td
.promo_king_manta.center-block
h3 Behind the Scenes Blog Post: King Manta!
p Have you ever wanted to know more about King Manta, the Mage Masterclasser? <a href='https://habitica.wordpress.com/2017/07/13/behind-the-scenes-spotlight-on-king-manta/' target='_blank'>Today's blog post</a> features a spotlight on the ruler of the undersea city of Dilatory! Check it out now to learn about how he learned his masterful magic skills, his friends and family, and his hobbies!
p.small.muted by Lemoness
.promo_unconventional_armor.pull-right
h3 Habiticans at Comic-Con!
p Lemoness, Beffymaroo, and Redphoenix will be representing Habitica at <a href='https://www.comic-con.org/cci' target='_blank'>San Diego Comic Con</a> this year. If you'd like to meet them, along with other fellow Habiticans, join us at the Habitica SDCC Meetup! We'll be giving away Habitica stickers and promo codes for the Unconventional Armor set.
br
p You can find us on Saturday, July 22, at the San Diego Bayfront Hilton from 4:00-5:00 PM! Look for the purple Gryphon banner. Can't wait to meet you :)
tr
td
h3 New Card: Good Luck!
.promo_good_luck.pull-left.slight-right-margin
p A new greeting card is available in the <a href='/#/options/inventory/drops'>Market</a>: the Good Luck card! For 10 Gold, you can wish the very best of luck to a Party mate who has a big task or momentous occasion coming up. Do so, and you and the recipient will earn the Lucky Letter achievement!
p.small.muted by OuttaMyMind and ChrisSpatzerl
tr
td
.scene_task_list.pull-right
h3 Bug Fixes for the Apps
p We've recently updated our <a href='https://play.google.com/store/apps/details?id=com.habitrpg.android.habitica&hl=en' target='_blank'>Android</a> and <a href='https://itunes.apple.com/us/app/habitica/id994882113?ls=1&mt=8' target='_blank'>iOS</a> apps with performance improvements and bug fixes! Be sure you've downloaded the latest version of the apps for the best Habitica experience.
p.small.muted by Viirus
tr
td
h3 Blog Post: The Library of Tasks and Challenges
p This month's <a href='https://habitica.wordpress.com/2017/07/19/the-library-of-tasks-and-challenges/' target='_blank'>featured Wiki article</a> is about the <a href='/#/options/groups/guilds/adcd6903-e3c6-4c27-a0e9-21f2e7515cd6'>Library of Tasks and Challenges Guild</a>! We hope that it will help you as continue to add to and adapt your Task list to fit your goals. Be sure to check it out, and let us know what you think by reaching out on <a href='https://twitter.com/habitica' target='_blank'>Twitter</a>, <a href='http://blog.habitrpg.com/' target='_blank'>Tumblr</a>, and <a href='https://www.facebook.com/Habitica' target='_blank'>Facebook</a>.
p.small.muted by Beffymaroo and the Wiki Wizards
if menuItem !== 'oldNews'
hr
a(href='/static/old-news', target='_blank') Read older news
mixin oldNews
h2 7/13/2017 - BEHIND THE SCENES: KING MANTA
tr
td
.promo_king_manta.center-block
h3 Behind the Scenes Blog Post: King Manta!
p Have you ever wanted to know more about King Manta, the Mage Masterclasser? <a href='https://habitica.wordpress.com/2017/07/13/behind-the-scenes-spotlight-on-king-manta/' target='_blank'>Today's blog post</a> features a spotlight on the ruler of the undersea city of Dilatory! Check it out now to learn about how he learned his masterful magic skills, his friends and family, and his hobbies!
p.small.muted by Lemoness
h2 7/11/2017 - NEW DISCOUNTED PET QUEST BUNDLE AND ORCAS FOR EVERYONE
.promo_bundle_splashy.pull-right
tr