also reset modifiers when week rolls over
All checks were successful
Build / build (20) (push) Successful in 1m14s
Build / build (18) (push) Successful in 40s
Build / build (22) (push) Successful in 1m7s
Build / build (18) (pull_request) Successful in 40s
Build / build (22) (pull_request) Successful in 1m11s
Build / build (20) (pull_request) Successful in 1m6s
All checks were successful
Build / build (20) (push) Successful in 1m14s
Build / build (18) (push) Successful in 40s
Build / build (22) (push) Successful in 1m7s
Build / build (18) (pull_request) Successful in 40s
Build / build (22) (pull_request) Successful in 1m11s
Build / build (20) (pull_request) Successful in 1m6s
This commit is contained in:
parent
18062b5d91
commit
a082331632
@ -11,7 +11,6 @@ export const entratiLabConquestModeController: RequestHandler = async (req, res)
|
||||
"EntratiVaultCountResetDate EntratiVaultCountLastPeriod EntratiLabConquestUnlocked EchoesHexConquestUnlocked EchoesHexConquestActiveFrameVariants EchoesHexConquestActiveStickers EntratiLabConquestActiveFrameVariants EntratiLabConquestCacheScoreMission EchoesHexConquestCacheScoreMission"
|
||||
);
|
||||
const body = getJSONfromString<IEntratiLabConquestModeRequest>(String(req.body));
|
||||
if (body.BuyMode) {
|
||||
if (!inventory.EntratiVaultCountResetDate || Date.now() >= inventory.EntratiVaultCountResetDate.getTime()) {
|
||||
const EPOCH = 1734307200 * 1000; // Mondays, amirite?
|
||||
const day = Math.trunc((Date.now() - EPOCH) / 86400000);
|
||||
@ -20,13 +19,17 @@ export const entratiLabConquestModeController: RequestHandler = async (req, res)
|
||||
const weekEnd = weekStart + 604800000;
|
||||
inventory.EntratiVaultCountLastPeriod = 0;
|
||||
inventory.EntratiVaultCountResetDate = new Date(weekEnd);
|
||||
if (inventory.EntratiLabConquestUnlocked) {
|
||||
if ("EntratiLabConquestUnlocked" in inventory) {
|
||||
inventory.EntratiLabConquestUnlocked = 0;
|
||||
inventory.EntratiLabConquestActiveFrameVariants = [];
|
||||
}
|
||||
if (inventory.EchoesHexConquestUnlocked) {
|
||||
if ("EchoesHexConquestUnlocked" in inventory) {
|
||||
inventory.EchoesHexConquestUnlocked = 0;
|
||||
inventory.EchoesHexConquestActiveFrameVariants = [];
|
||||
inventory.EchoesHexConquestActiveStickers = [];
|
||||
}
|
||||
}
|
||||
if (body.BuyMode) {
|
||||
inventory.EntratiVaultCountLastPeriod! += 2;
|
||||
if (body.IsEchoesDeepArchemedea) {
|
||||
inventory.EchoesHexConquestUnlocked = 1;
|
||||
@ -42,9 +45,7 @@ export const entratiLabConquestModeController: RequestHandler = async (req, res)
|
||||
}
|
||||
await inventory.save();
|
||||
res.json({
|
||||
EntratiVaultCountResetDate: inventory.EntratiVaultCountResetDate
|
||||
? toMongoDate(inventory.EntratiVaultCountResetDate)
|
||||
: undefined,
|
||||
EntratiVaultCountResetDate: toMongoDate(inventory.EntratiVaultCountResetDate),
|
||||
EntratiVaultCountLastPeriod: inventory.EntratiVaultCountLastPeriod,
|
||||
EntratiLabConquestUnlocked: inventory.EntratiLabConquestUnlocked,
|
||||
EntratiLabConquestCacheScoreMission: inventory.EntratiLabConquestCacheScoreMission,
|
||||
|
Loading…
x
Reference in New Issue
Block a user