mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 22:57:21 +01:00
feat(event): Pi Day
This commit is contained in:
@@ -3,7 +3,7 @@ import { v4 as uuid } from 'uuid';
|
|||||||
|
|
||||||
import { model as User } from '../../website/server/models/user';
|
import { model as User } from '../../website/server/models/user';
|
||||||
|
|
||||||
const MIGRATION_NAME = '20220314_pi_day';
|
const MIGRATION_NAME = '20230314_pi_day';
|
||||||
|
|
||||||
const progressCount = 1000;
|
const progressCount = 1000;
|
||||||
let count = 0;
|
let count = 0;
|
||||||
@@ -54,7 +54,7 @@ async function updateUser (user) {
|
|||||||
export default async function processUsers () {
|
export default async function processUsers () {
|
||||||
const query = {
|
const query = {
|
||||||
migration: { $ne: MIGRATION_NAME },
|
migration: { $ne: MIGRATION_NAME },
|
||||||
'auth.timestamps.loggedin': { $gt: new Date('2022-02-15') },
|
'auth.timestamps.loggedin': { $gt: new Date('2023-02-15') },
|
||||||
};
|
};
|
||||||
|
|
||||||
const fields = {
|
const fields = {
|
||||||
|
|||||||
@@ -203,7 +203,7 @@ api.specialMounts = stable.specialMounts;
|
|||||||
api.mountInfo = stable.mountInfo;
|
api.mountInfo = stable.mountInfo;
|
||||||
|
|
||||||
// For seasonal events, change this constant:
|
// For seasonal events, change this constant:
|
||||||
const FOOD_SEASON = moment().isBefore('2022-02-02T20:00-05:00') ? 'Cake' : 'Normal';
|
const FOOD_SEASON = moment().isBefore('2023-03-15T12:00-05:00') ? 'Pie' : 'Normal';
|
||||||
|
|
||||||
api.food = {
|
api.food = {
|
||||||
Meat: {
|
Meat: {
|
||||||
|
|||||||
@@ -150,10 +150,22 @@ function _setUpNewUser (user) {
|
|||||||
user.items.quests.dustbunnies = 1;
|
user.items.quests.dustbunnies = 1;
|
||||||
user.purchased.background.violet = true;
|
user.purchased.background.violet = true;
|
||||||
user.preferences.background = 'violet';
|
user.preferences.background = 'violet';
|
||||||
if (moment().isBetween('2022-12-27T08:00-05:00', '2023-01-02T20:00-05:00')) {
|
if (moment().isBefore('2023-03-15T12:00-05:00')) {
|
||||||
user.migration = '20221227_nye';
|
user.migration = '20230314_pi_day';
|
||||||
user.items.gear.owned.head_special_nye = true;
|
user.items.gear.owned.head_special_piDay = true;
|
||||||
user.items.gear.equipped.head = 'head_special_nye';
|
user.items.gear.equipped.head = 'head_special_piDay';
|
||||||
|
user.items.gear.owned.shield_special_piDay = true;
|
||||||
|
user.items.gear.equipped.shield = 'shield_special_piDay';
|
||||||
|
user.items.food.Pie_Skeleton = 1;
|
||||||
|
user.items.food.Pie_Base = 1;
|
||||||
|
user.items.food.Pie_CottonCandyBlue = 1;
|
||||||
|
user.items.food.Pie_CottonCandyPink = 1;
|
||||||
|
user.items.food.Pie_Shade = 1;
|
||||||
|
user.items.food.Pie_White = 1;
|
||||||
|
user.items.food.Pie_Golden = 1;
|
||||||
|
user.items.food.Pie_Zombie = 1;
|
||||||
|
user.items.food.Pie_Desert = 1;
|
||||||
|
user.items.food.Pie_Red = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
user.markModified('items achievements');
|
user.markModified('items achievements');
|
||||||
|
|||||||
Reference in New Issue
Block a user