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

SpaceNinjaServer

A simple server for a small space ninja game

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

XFEstudio/SpaceNinjaServer

feat(webui): add "Fully Level Up Helminth" (#717)

8154f9bc
Sainan <sainan@calamity.inc>
提交于

代码差异

3 个文件 +24 -1
Modified src/controllers/api/infestedFoundryController.ts +16 -0
@@ -223,6 +223,22 @@ export const infestedFoundryController: RequestHandler = async (req, res) => {
223 223 break;
224 224 }
225 225
226 case "custom_unlockall": {
227 const inventory = await getInventory(accountId);
228 inventory.InfestedFoundry ??= {};
229 inventory.InfestedFoundry.XP ??= 0;
230 if (151875_00 > inventory.InfestedFoundry.XP) {
231 const recipeChanges = addInfestedFoundryXP(
232 inventory.InfestedFoundry,
233 151875_00 - inventory.InfestedFoundry.XP
234 );
235 addRecipes(inventory, recipeChanges);
236 await inventory.save();
237 }
238 res.end();
239 break;
240 }
241
226 242 default:
227 243 throw new Error(`unhandled infestedFoundry mode: ${String(req.query.mode)}`);
228 244 }
Modified static/webui/index.html +2 -1
@@ -278,7 +278,8 @@
278 278 <div class="card mb-4">
279 279 <h5 class="card-header">Account</h5>
280 280 <div class="card-body">
281 <button class="btn btn-primary" onclick="doUnlockAllFocusSchools();">Unlock All Focus Schools</button>
281 <p><button class="btn btn-primary" onclick="doUnlockAllFocusSchools();">Unlock All Focus Schools</button></p>
282 <button class="btn btn-primary" onclick="doHelminthUnlockAll();">Fully Level Up Helminth</button>
282 283 </div>
283 284 </div>
284 285 </div>
Modified static/webui/script.js +6 -0
@@ -955,6 +955,12 @@ function unlockFocusSchool(upgradeType) {
955 955 });
956 956 }
957 957
958 function doHelminthUnlockAll() {
959 revalidateAuthz(() => {
960 $.post("/api/infestedFoundry.php?" + window.authz + "&mode=custom_unlockall");
961 });
962 }
963
958 964 // Powersuit Route
959 965
960 966 single.getRoute("#powersuit-route").on("beforeload", function () {