mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-19 07:37:25 +01:00
feat(content): Pi Day 2020
This commit is contained in:
@@ -3,7 +3,7 @@ import { v4 as uuid } from 'uuid';
|
||||
|
||||
import { model as User } from '../../website/server/models/user';
|
||||
|
||||
const MIGRATION_NAME = '20190314_pi_day';
|
||||
const MIGRATION_NAME = '20200314_pi_day';
|
||||
|
||||
const progressCount = 1000;
|
||||
let count = 0;
|
||||
@@ -24,27 +24,37 @@ async function updateUser (user) {
|
||||
'items.food.Pie_Red': 1,
|
||||
};
|
||||
const set = {};
|
||||
let push;
|
||||
|
||||
set.migration = MIGRATION_NAME;
|
||||
|
||||
set['items.gear.owned.head_special_piDay'] = false;
|
||||
set['items.gear.owned.shield_special_piDay'] = false;
|
||||
const push = [
|
||||
{ type: 'marketGear', path: 'gear.flat.head_special_piDay', _id: uuid() },
|
||||
{ type: 'marketGear', path: 'gear.flat.shield_special_piDay', _id: uuid() },
|
||||
];
|
||||
if (typeof user.items.gear.owned.head_special_piDay !== 'undefined') {
|
||||
push = false;
|
||||
} else {
|
||||
set['items.gear.owned.head_special_piDay'] = false;
|
||||
set['items.gear.owned.shield_special_piDay'] = false;
|
||||
push = [
|
||||
{ type: 'marketGear', path: 'gear.flat.head_special_piDay', _id: uuid() },
|
||||
{ type: 'marketGear', path: 'gear.flat.shield_special_piDay', _id: uuid() },
|
||||
];
|
||||
}
|
||||
|
||||
if (count % progressCount === 0) console.warn(`${count} ${user._id}`);
|
||||
|
||||
if (push) {
|
||||
return User
|
||||
.update({ _id: user._id }, { $inc: inc, $set: set, $push: { pinnedItems: { $each: push } } })
|
||||
.exec();
|
||||
}
|
||||
return User
|
||||
.update({ _id: user._id }, { $inc: inc, $set: set, $push: { pinnedItems: { $each: push } } })
|
||||
.update({ _id: user._id }, { $inc: inc, $set: set })
|
||||
.exec();
|
||||
}
|
||||
|
||||
export default async function processUsers () {
|
||||
const query = {
|
||||
migration: { $ne: MIGRATION_NAME },
|
||||
'auth.timestamps.loggedin': { $gt: new Date('2019-02-15') },
|
||||
'auth.timestamps.loggedin': { $gt: new Date('2020-02-15') },
|
||||
};
|
||||
|
||||
const fields = {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
.promo_achievement_CottonCandyPink {
|
||||
background-image: url('~@/assets/images/sprites/spritesmith-largeSprites-0.png');
|
||||
background-position: -668px -296px;
|
||||
background-position: -668px -444px;
|
||||
width: 204px;
|
||||
height: 102px;
|
||||
}
|
||||
@@ -22,9 +22,15 @@
|
||||
width: 282px;
|
||||
height: 147px;
|
||||
}
|
||||
.promo_pi_day {
|
||||
background-image: url('~@/assets/images/sprites/spritesmith-largeSprites-0.png');
|
||||
background-position: -668px -296px;
|
||||
width: 273px;
|
||||
height: 147px;
|
||||
}
|
||||
.promo_take_this {
|
||||
background-image: url('~@/assets/images/sprites/spritesmith-largeSprites-0.png');
|
||||
background-position: -668px -399px;
|
||||
background-position: -424px -277px;
|
||||
width: 96px;
|
||||
height: 69px;
|
||||
}
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 46 KiB After Width: | Height: | Size: 50 KiB |
@@ -195,7 +195,7 @@ api.mountInfo = stable.mountInfo;
|
||||
|
||||
// For seasonal events, change this constant:
|
||||
|
||||
const FOOD_SEASON = 'Normal';
|
||||
const FOOD_SEASON = 'Pie';
|
||||
|
||||
api.food = {
|
||||
Meat: {
|
||||
|
||||
BIN
website/raw_sprites/spritesmith_large/promo_pi_day.png
Normal file
BIN
website/raw_sprites/spritesmith_large/promo_pi_day.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 7.9 KiB |
@@ -4,7 +4,7 @@ const api = {};
|
||||
|
||||
// @TODO export this const, cannot export it from here because only routes are exported from
|
||||
// controllers
|
||||
const LAST_ANNOUNCEMENT_TITLE = 'DISCOUNTED QUEST BUNDLE: HUG A BUG!';
|
||||
const LAST_ANNOUNCEMENT_TITLE = 'CELEBRATE PI DAY WITH HABITICA!';
|
||||
const worldDmg = { // @TODO
|
||||
bailey: false,
|
||||
};
|
||||
@@ -31,29 +31,21 @@ api.getNews = {
|
||||
<div class="mr-3 ${baileyClass}"></div>
|
||||
<div class="media-body">
|
||||
<h1 class="align-self-center">${res.t('newStuff')}</h1>
|
||||
<h2>3/10/2020 - ${LAST_ANNOUNCEMENT_TITLE}</h2>
|
||||
<h2>3/14/2020 - ${LAST_ANNOUNCEMENT_TITLE}</h2>
|
||||
</div>
|
||||
</div>
|
||||
<hr/>
|
||||
<div class="promo_hugabug_bundle center-block"></div>
|
||||
<div class="promo_pi_day center-block"></div>
|
||||
<p>
|
||||
If you're looking to add some insect friends to your Habitica stable, you're in luck!
|
||||
From now until March 31, you can purchase the Hug a Bug Pet Quest Bundle and receive the
|
||||
Snail, Beetle, and Butterfly quests, all for only 7 Gems! That's a discount of 5 Gems
|
||||
from the price of purchasing them separately. Check it out in the <a
|
||||
href='/shops/quests'>Quest Shop</a> today!
|
||||
Hello Habiticans! In celebration of Pi Day on March 14, we've gifted everyone delicious
|
||||
slices of pie for you all to feed to your pets.
|
||||
</p>
|
||||
<p>
|
||||
If you’d prefer not to see bugs in Habitica due to a phobia, check out the <a
|
||||
href='http://habitica.wikia.com/wiki/Phobia_Protection_Extension' target='_blank'>Phobia
|
||||
Protection Extension</a> and enable the option for hiding "Beetles"!
|
||||
If you weren't with us for last year's Pi Day, we've also given you a festive Pi Hat and
|
||||
Shield so you can celebrate in style. Enjoy them, and thanks for being a part of our
|
||||
community!
|
||||
</p>
|
||||
<div class="small">By Lemoness, SabreCat, and Beffymaroo</div>
|
||||
<div class="small">
|
||||
Art by Pfeffernusse, Megan, Pocketmole, overomega, Misceo, UncommonCriminal, Zorella,
|
||||
Anna Glassman, Leephon, Lilith of Alfheim, Ac, starsystemic, and Karithina
|
||||
</div>
|
||||
<div class="small mb-3">Writing by arachnidstardis, emiausti, and AnnDeLune</div>
|
||||
<div class="small mb-3">by Beffymaroo and SabreCat</div>
|
||||
</div>
|
||||
`,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user