diff --git a/config.json.example b/config.json.example index f1c29035..85054641 100644 --- a/config.json.example +++ b/config.json.example @@ -38,6 +38,9 @@ "fastClanAscension": false, "spoofMasteryRank": -1, "events": { + "creditBoost": false, + "affinityBoost": false, + "resourceBoost": false, "starDays": true } } diff --git a/src/controllers/dynamic/worldStateController.ts b/src/controllers/dynamic/worldStateController.ts index 3341992e..d995f5e8 100644 --- a/src/controllers/dynamic/worldStateController.ts +++ b/src/controllers/dynamic/worldStateController.ts @@ -17,6 +17,7 @@ export const worldStateController: RequestHandler = (req, res) => { : buildConfig.buildLabel, Time: Math.round(Date.now() / 1000), Goals: [], + GlobalUpgrades: [], EndlessXpChoices: [], ...staticWorldState }; @@ -76,6 +77,43 @@ export const worldStateController: RequestHandler = (req, res) => { Nodes: [] }; + if (config.events?.creditBoost) { + worldState.GlobalUpgrades.push({ + _id: { $oid: "5b23106f283a555109666672" }, + Activation: { $date: { $numberLong: "1740164400000" } }, + ExpiryDate: { $date: { $numberLong: "2000000000000" } }, + UpgradeType: "GAMEPLAY_MONEY_REWARD_AMOUNT", + OperationType: "MULTIPLY", + Value: 2, + LocalizeTag: "", + LocalizeDescTag: "" + }); + } + if (config.events?.affinityBoost) { + worldState.GlobalUpgrades.push({ + _id: { $oid: "5b23106f283a555109666673" }, + Activation: { $date: { $numberLong: "1740164400000" } }, + ExpiryDate: { $date: { $numberLong: "2000000000000" } }, + UpgradeType: "GAMEPLAY_KILL_XP_AMOUNT", + OperationType: "MULTIPLY", + Value: 2, + LocalizeTag: "", + LocalizeDescTag: "" + }); + } + if (config.events?.resourceBoost) { + worldState.GlobalUpgrades.push({ + _id: { $oid: "5b23106f283a555109666674" }, + Activation: { $date: { $numberLong: "1740164400000" } }, + ExpiryDate: { $date: { $numberLong: "2000000000000" } }, + UpgradeType: "GAMEPLAY_PICKUP_AMOUNT", + OperationType: "MULTIPLY", + Value: 2, + LocalizeTag: "", + LocalizeDescTag: "" + }); + } + // Circuit choices cycling every week worldState.EndlessXpChoices.push({ Category: "EXC_NORMAL", @@ -158,6 +196,7 @@ interface IWorldState { Time: number; Goals: IGoal[]; SyndicateMissions: ISyndicateMission[]; + GlobalUpgrades: IGlobalUpgrade[]; NodeOverrides: INodeOverride[]; EndlessXpChoices: IEndlessXpChoice[]; KnownCalendarSeasons: ICalendarSeason[]; @@ -188,6 +227,17 @@ interface ISyndicateMission { Nodes: string[]; } +interface IGlobalUpgrade { + _id: IOid; + Activation: IMongoDate; + ExpiryDate: IMongoDate; + UpgradeType: string; + OperationType: string; + Value: number; + LocalizeTag: string; + LocalizeDescTag: string; +} + interface INodeOverride { _id: IOid; Activation?: IMongoDate; diff --git a/src/services/configService.ts b/src/services/configService.ts index 717dae35..b19ac57e 100644 --- a/src/services/configService.ts +++ b/src/services/configService.ts @@ -64,6 +64,9 @@ interface IConfig { fastClanAscension?: boolean; spoofMasteryRank?: number; events?: { + creditBoost?: boolean; + affinityBoost?: boolean; + resourceBoost?: boolean; starDays?: boolean; }; }