mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 22:57:21 +01:00
WIP(shops): cShop reconciled to schedule backend
This commit is contained in:
@@ -5,7 +5,7 @@ export default prefill({
|
||||
baseHair1: { setPrice: 5, text: t('hairSet1') },
|
||||
baseHair2: { setPrice: 5, text: t('hairSet2') },
|
||||
baseHair3: { setPrice: 5, text: t('hairSet3') },
|
||||
facialHair: { setPrice: 5, text: t('bodyFacialHair') },
|
||||
facialHair: { setPrice: 5, text: t('titleFacialHair') },
|
||||
specialShirts: { setPrice: 5, text: t('specialShirts') },
|
||||
winterHairColors: { setPrice: 5 },
|
||||
pastelHairColors: { setPrice: 5 },
|
||||
|
||||
@@ -745,6 +745,19 @@ export const GALA_SCHEDULE = {
|
||||
},
|
||||
};
|
||||
|
||||
export const TYPE_SCHEDULE = {
|
||||
timeTravelers: FIRST_RELEASE_DAY,
|
||||
backgrounds: SECOND_RELEASE_DAY,
|
||||
petQuests: THIRD_RELEASE_DAY,
|
||||
hatchingPotionQuests: THIRD_RELEASE_DAY,
|
||||
bundles: THIRD_RELEASE_DAY,
|
||||
premiumHatchingPotions: FOURTH_RELEASE_DAY,
|
||||
seasonalGear: GALA_SWITCHOVER_DAY,
|
||||
seasonalSpells: GALA_SWITCHOVER_DAY,
|
||||
seasonalQuests: GALA_SWITCHOVER_DAY,
|
||||
customizations: GALA_SWITCHOVER_DAY,
|
||||
};
|
||||
|
||||
function getDay (date) {
|
||||
if (date === undefined) {
|
||||
return 0;
|
||||
@@ -804,6 +817,7 @@ let cacheDate = null;
|
||||
function makeMatcherClass () {
|
||||
return {
|
||||
matchers: [],
|
||||
end: new Date(),
|
||||
items: [],
|
||||
match (key) {
|
||||
if (this.matchers.length === 0) {
|
||||
@@ -818,9 +832,6 @@ function makeMatcherClass () {
|
||||
}
|
||||
return false;
|
||||
},
|
||||
getEndDate () {
|
||||
return new Date();
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
@@ -846,7 +857,12 @@ export function getScheduleMatchingGroup (type, date) {
|
||||
});
|
||||
}
|
||||
if (!cachedScheduleMatchers[type]) {
|
||||
let end = moment(checkedDate).date(TYPE_SCHEDULE[type]);
|
||||
if (end.date() <= checkedDate.date()) {
|
||||
end = moment(end).add(1, 'months');
|
||||
}
|
||||
return {
|
||||
end: end.toDate(),
|
||||
items: [],
|
||||
match () {
|
||||
return true;
|
||||
|
||||
@@ -773,6 +773,7 @@ const back = {
|
||||
text: t('backBearTailText'),
|
||||
notes: t('backBearTailNotes'),
|
||||
value: 20,
|
||||
canBuy: () => true,
|
||||
canOwn: ownsItem('back_special_bearTail'),
|
||||
},
|
||||
cactusTail: {
|
||||
@@ -780,6 +781,7 @@ const back = {
|
||||
text: t('backCactusTailText'),
|
||||
notes: t('backCactusTailNotes'),
|
||||
value: 20,
|
||||
canBuy: () => true,
|
||||
canOwn: ownsItem('back_special_cactusTail'),
|
||||
},
|
||||
foxTail: {
|
||||
@@ -787,6 +789,7 @@ const back = {
|
||||
text: t('backFoxTailText'),
|
||||
notes: t('backFoxTailNotes'),
|
||||
value: 20,
|
||||
canBuy: () => true,
|
||||
canOwn: ownsItem('back_special_foxTail'),
|
||||
},
|
||||
lionTail: {
|
||||
@@ -794,6 +797,7 @@ const back = {
|
||||
text: t('backLionTailText'),
|
||||
notes: t('backLionTailNotes'),
|
||||
value: 20,
|
||||
canBuy: () => true,
|
||||
canOwn: ownsItem('back_special_lionTail'),
|
||||
},
|
||||
pandaTail: {
|
||||
@@ -801,6 +805,7 @@ const back = {
|
||||
text: t('backPandaTailText'),
|
||||
notes: t('backPandaTailNotes'),
|
||||
value: 20,
|
||||
canBuy: () => true,
|
||||
canOwn: ownsItem('back_special_pandaTail'),
|
||||
},
|
||||
pigTail: {
|
||||
@@ -808,6 +813,7 @@ const back = {
|
||||
text: t('backPigTailText'),
|
||||
notes: t('backPigTailNotes'),
|
||||
value: 20,
|
||||
canBuy: () => true,
|
||||
canOwn: ownsItem('back_special_pigTail'),
|
||||
},
|
||||
tigerTail: {
|
||||
@@ -815,6 +821,7 @@ const back = {
|
||||
text: t('backTigerTailText'),
|
||||
notes: t('backTigerTailNotes'),
|
||||
value: 20,
|
||||
canBuy: () => true,
|
||||
canOwn: ownsItem('back_special_tigerTail'),
|
||||
},
|
||||
wolfTail: {
|
||||
@@ -822,6 +829,7 @@ const back = {
|
||||
text: t('backWolfTailText'),
|
||||
notes: t('backWolfTailNotes'),
|
||||
value: 20,
|
||||
canBuy: () => true,
|
||||
canOwn: ownsItem('back_special_wolfTail'),
|
||||
},
|
||||
turkeyTailGilded: {
|
||||
@@ -1868,6 +1876,7 @@ const headAccessory = {
|
||||
text: t('headAccessoryBearEarsText'),
|
||||
notes: t('headAccessoryBearEarsNotes'),
|
||||
value: 20,
|
||||
canBuy: () => true,
|
||||
canOwn: ownsItem('headAccessory_special_bearEars'),
|
||||
},
|
||||
cactusEars: {
|
||||
@@ -1875,6 +1884,7 @@ const headAccessory = {
|
||||
text: t('headAccessoryCactusEarsText'),
|
||||
notes: t('headAccessoryCactusEarsNotes'),
|
||||
value: 20,
|
||||
canBuy: () => true,
|
||||
canOwn: ownsItem('headAccessory_special_cactusEars'),
|
||||
},
|
||||
foxEars: {
|
||||
@@ -1882,6 +1892,7 @@ const headAccessory = {
|
||||
text: t('headAccessoryFoxEarsText'),
|
||||
notes: t('headAccessoryFoxEarsNotes'),
|
||||
value: 20,
|
||||
canBuy: () => true,
|
||||
canOwn: ownsItem('headAccessory_special_foxEars'),
|
||||
},
|
||||
lionEars: {
|
||||
@@ -1889,6 +1900,7 @@ const headAccessory = {
|
||||
text: t('headAccessoryLionEarsText'),
|
||||
notes: t('headAccessoryLionEarsNotes'),
|
||||
value: 20,
|
||||
canBuy: () => true,
|
||||
canOwn: ownsItem('headAccessory_special_lionEars'),
|
||||
},
|
||||
pandaEars: {
|
||||
@@ -1896,6 +1908,7 @@ const headAccessory = {
|
||||
text: t('headAccessoryPandaEarsText'),
|
||||
notes: t('headAccessoryPandaEarsNotes'),
|
||||
value: 20,
|
||||
canBuy: () => true,
|
||||
canOwn: ownsItem('headAccessory_special_pandaEars'),
|
||||
},
|
||||
pigEars: {
|
||||
@@ -1903,6 +1916,7 @@ const headAccessory = {
|
||||
text: t('headAccessoryPigEarsText'),
|
||||
notes: t('headAccessoryPigEarsNotes'),
|
||||
value: 20,
|
||||
canBuy: () => true,
|
||||
canOwn: ownsItem('headAccessory_special_pigEars'),
|
||||
},
|
||||
tigerEars: {
|
||||
@@ -1910,6 +1924,7 @@ const headAccessory = {
|
||||
text: t('headAccessoryTigerEarsText'),
|
||||
notes: t('headAccessoryTigerEarsNotes'),
|
||||
value: 20,
|
||||
canBuy: () => true,
|
||||
canOwn: ownsItem('headAccessory_special_tigerEars'),
|
||||
},
|
||||
wolfEars: {
|
||||
@@ -1917,6 +1932,7 @@ const headAccessory = {
|
||||
text: t('headAccessoryWolfEarsText'),
|
||||
notes: t('headAccessoryWolfEarsNotes'),
|
||||
value: 20,
|
||||
canBuy: () => true,
|
||||
canOwn: ownsItem('headAccessory_special_wolfEars'),
|
||||
},
|
||||
spring2016Rogue: {
|
||||
|
||||
Reference in New Issue
Block a user