XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet

XFESpaceNinjaServer

A simple server for a small space ninja game

公开
关注 0 Fork 0 Star 0
返回提交历史

XFEstudio/XFESpaceNinjaServer

feat: add config options for event boosters (#1184)

Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/1184

db20369e
Sainan <sainan@calamity.inc>
提交于

代码差异

3 个文件 +56 -0
Modified config.json.example +3 -0
@@ -38,6 +38,9 @@
38 38 "fastClanAscension": false,
39 39 "spoofMasteryRank": -1,
40 40 "events": {
41 "creditBoost": false,
42 "affinityBoost": false,
43 "resourceBoost": false,
41 44 "starDays": true
42 45 }
43 46 }
Modified src/controllers/dynamic/worldStateController.ts +50 -0
@@ -17,6 +17,7 @@ export const worldStateController: RequestHandler = (req, res) => {
17 17 : buildConfig.buildLabel,
18 18 Time: Math.round(Date.now() / 1000),
19 19 Goals: [],
20 GlobalUpgrades: [],
20 21 EndlessXpChoices: [],
21 22 ...staticWorldState
22 23 };
@@ -76,6 +77,43 @@ export const worldStateController: RequestHandler = (req, res) => {
76 77 Nodes: []
77 78 };
78 79
80 if (config.events?.creditBoost) {
81 worldState.GlobalUpgrades.push({
82 _id: { $oid: "5b23106f283a555109666672" },
83 Activation: { $date: { $numberLong: "1740164400000" } },
84 ExpiryDate: { $date: { $numberLong: "2000000000000" } },
85 UpgradeType: "GAMEPLAY_MONEY_REWARD_AMOUNT",
86 OperationType: "MULTIPLY",
87 Value: 2,
88 LocalizeTag: "",
89 LocalizeDescTag: ""
90 });
91 }
92 if (config.events?.affinityBoost) {
93 worldState.GlobalUpgrades.push({
94 _id: { $oid: "5b23106f283a555109666673" },
95 Activation: { $date: { $numberLong: "1740164400000" } },
96 ExpiryDate: { $date: { $numberLong: "2000000000000" } },
97 UpgradeType: "GAMEPLAY_KILL_XP_AMOUNT",
98 OperationType: "MULTIPLY",
99 Value: 2,
100 LocalizeTag: "",
101 LocalizeDescTag: ""
102 });
103 }
104 if (config.events?.resourceBoost) {
105 worldState.GlobalUpgrades.push({
106 _id: { $oid: "5b23106f283a555109666674" },
107 Activation: { $date: { $numberLong: "1740164400000" } },
108 ExpiryDate: { $date: { $numberLong: "2000000000000" } },
109 UpgradeType: "GAMEPLAY_PICKUP_AMOUNT",
110 OperationType: "MULTIPLY",
111 Value: 2,
112 LocalizeTag: "",
113 LocalizeDescTag: ""
114 });
115 }
116
79 117 // Circuit choices cycling every week
80 118 worldState.EndlessXpChoices.push({
81 119 Category: "EXC_NORMAL",
@@ -158,6 +196,7 @@ interface IWorldState {
158 196 Time: number;
159 197 Goals: IGoal[];
160 198 SyndicateMissions: ISyndicateMission[];
199 GlobalUpgrades: IGlobalUpgrade[];
161 200 NodeOverrides: INodeOverride[];
162 201 EndlessXpChoices: IEndlessXpChoice[];
163 202 KnownCalendarSeasons: ICalendarSeason[];
@@ -188,6 +227,17 @@ interface ISyndicateMission {
188 227 Nodes: string[];
189 228 }
190 229
230 interface IGlobalUpgrade {
231 _id: IOid;
232 Activation: IMongoDate;
233 ExpiryDate: IMongoDate;
234 UpgradeType: string;
235 OperationType: string;
236 Value: number;
237 LocalizeTag: string;
238 LocalizeDescTag: string;
239 }
240
191 241 interface INodeOverride {
192 242 _id: IOid;
193 243 Activation?: IMongoDate;
Modified src/services/configService.ts +3 -0
@@ -64,6 +64,9 @@ interface IConfig {
64 64 fastClanAscension?: boolean;
65 65 spoofMasteryRank?: number;
66 66 events?: {
67 creditBoost?: boolean;
68 affinityBoost?: boolean;
69 resourceBoost?: boolean;
67 70 starDays?: boolean;
68 71 };
69 72 }