mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-16 06:07:21 +01:00
fix(event): filter out past seasonal sets in Market
also block purchase of special spells outside their events also remove hardcoded dates from seasonal shop intro text used on mobile
This commit is contained in:
@@ -28,10 +28,10 @@
|
||||
"seasonalShopClosedTitle": "<%= linkStart %>Leslie<%= linkEnd %>",
|
||||
"seasonalShopTitle": "<%= linkStart %>Seasonal Sorceress<%= linkEnd %>",
|
||||
"seasonalShopClosedText": "The Seasonal Shop is currently closed!! It’s only open during Habitica’s four Grand Galas.",
|
||||
"seasonalShopSummerText": "Happy Summer Splash!! Would you like to buy some rare items? They’ll only be available until July 31st!",
|
||||
"seasonalShopFallText": "Happy Fall Festival!! Would you like to buy some rare items? They’ll only be available until October 31st!",
|
||||
"seasonalShopWinterText": "Happy Winter Wonderland!! Would you like to buy some rare items? They’ll only be available until January 31st!",
|
||||
"seasonalShopSpringText": "Happy Spring Fling!! Would you like to buy some rare items? They’ll only be available until April 30th!",
|
||||
"seasonalShopSummerText": "Happy Summer Splash!! Would you like to buy some rare items? They’ll only be available during the Gala!",
|
||||
"seasonalShopFallText": "Happy Fall Festival!! Would you like to buy some rare items? They’ll only be available during the Gala!",
|
||||
"seasonalShopWinterText": "Happy Winter Wonderland!! Would you like to buy some rare items? They’ll only be available during the Gala!",
|
||||
"seasonalShopSpringText": "Happy Spring Fling!! Would you like to buy some rare items? They’ll only be available during the Gala!",
|
||||
"seasonalShopFallTextBroken": "Oh.... Welcome to the Seasonal Shop... We're stocking autumn Seasonal Edition goodies, or something... Everything here will be available to purchase during the Fall Festival event each year, but we're only open until October 31... I guess you should to stock up now, or you'll have to wait... and wait... and wait... <strong>*sigh*</strong>",
|
||||
"seasonalShopBrokenText": "My pavilion!!!!!!! My decorations!!!! Oh, the Dysheartener's destroyed everything :( Please help defeat it in the Tavern so I can rebuild!",
|
||||
"seasonalShopRebirth": "If you bought any of this equipment in the past but don't currently own it, you can repurchase it in the Rewards Column. Initially, you'll only be able to purchase the items for your current class (Warrior by default), but fear not, the other class-specific items will become available if you switch to that class.",
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import each from 'lodash/each';
|
||||
import moment from 'moment';
|
||||
import t from './translation';
|
||||
import { NotAuthorized, BadRequest } from '../libs/errors';
|
||||
import statsComputed from '../libs/statsComputed'; // eslint-disable-line import/no-cycle
|
||||
@@ -287,6 +288,9 @@ spells.special = {
|
||||
previousPurchase: true,
|
||||
target: 'user',
|
||||
notes: t('spellSpecialSnowballAuraNotes'),
|
||||
canOwn () {
|
||||
return false;
|
||||
},
|
||||
cast (user, target, req) {
|
||||
if (!user.items.special.snowball) throw new NotAuthorized(t('spellNotOwned')(req.language));
|
||||
target.stats.buffs.snowball = true;
|
||||
@@ -320,6 +324,9 @@ spells.special = {
|
||||
previousPurchase: true,
|
||||
target: 'user',
|
||||
notes: t('spellSpecialSpookySparklesNotes'),
|
||||
canOwn () {
|
||||
return false;
|
||||
},
|
||||
cast (user, target, req) {
|
||||
if (!user.items.special.spookySparkles) throw new NotAuthorized(t('spellNotOwned')(req.language));
|
||||
target.stats.buffs.snowball = false;
|
||||
@@ -354,6 +361,9 @@ spells.special = {
|
||||
target: 'user',
|
||||
notes: t('spellSpecialShinySeedNotes'),
|
||||
event: EVENTS.spring2021,
|
||||
canOwn () {
|
||||
return moment().isBetween('2021-04-06T08:00-05:00', EVENTS.spring2021.end);
|
||||
},
|
||||
cast (user, target, req) {
|
||||
if (!user.items.special.shinySeed) throw new NotAuthorized(t('spellNotOwned')(req.language));
|
||||
target.stats.buffs.snowball = false;
|
||||
@@ -387,6 +397,9 @@ spells.special = {
|
||||
previousPurchase: true,
|
||||
target: 'user',
|
||||
notes: t('spellSpecialSeafoamNotes'),
|
||||
canOwn () {
|
||||
return false;
|
||||
},
|
||||
cast (user, target, req) {
|
||||
if (!user.items.special.seafoam) throw new NotAuthorized(t('spellNotOwned')(req.language));
|
||||
target.stats.buffs.snowball = false;
|
||||
@@ -421,6 +434,9 @@ spells.special = {
|
||||
silent: true,
|
||||
target: 'user',
|
||||
notes: t('nyeCardNotes'),
|
||||
canOwn () {
|
||||
return false;
|
||||
},
|
||||
cast (user, target) {
|
||||
if (user === target) {
|
||||
if (!user.achievements.nye) user.achievements.nye = 0;
|
||||
@@ -458,6 +474,9 @@ spells.special = {
|
||||
silent: true,
|
||||
target: 'user',
|
||||
notes: t('valentineCardNotes'),
|
||||
canOwn () {
|
||||
return false;
|
||||
},
|
||||
cast (user, target) {
|
||||
if (user === target) {
|
||||
if (!user.achievements.valentine) user.achievements.valentine = 0;
|
||||
|
||||
@@ -157,6 +157,7 @@ shops.getMarketGearCategories = function getMarketGear (user, language) {
|
||||
if (
|
||||
gearItem.specialClass === classType
|
||||
&& user.items.gear.owned[gearItem.key] !== false
|
||||
&& gearItem.set === seasonalShopConfig.pinnedSets[gearItem.specialClass]
|
||||
) return gearItem.canOwn(classShift);
|
||||
return false;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user