forked from OpenWF/SpaceNinjaServer
		
	feat(webui): add "Fully Level Up Helminth" (#717)
This commit is contained in:
		
							parent
							
								
									06bc0123ba
								
							
						
					
					
						commit
						8154f9bc36
					
				@ -223,6 +223,22 @@ export const infestedFoundryController: RequestHandler = async (req, res) => {
 | 
				
			|||||||
            break;
 | 
					            break;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        case "custom_unlockall": {
 | 
				
			||||||
 | 
					            const inventory = await getInventory(accountId);
 | 
				
			||||||
 | 
					            inventory.InfestedFoundry ??= {};
 | 
				
			||||||
 | 
					            inventory.InfestedFoundry.XP ??= 0;
 | 
				
			||||||
 | 
					            if (151875_00 > inventory.InfestedFoundry.XP) {
 | 
				
			||||||
 | 
					                const recipeChanges = addInfestedFoundryXP(
 | 
				
			||||||
 | 
					                    inventory.InfestedFoundry,
 | 
				
			||||||
 | 
					                    151875_00 - inventory.InfestedFoundry.XP
 | 
				
			||||||
 | 
					                );
 | 
				
			||||||
 | 
					                addRecipes(inventory, recipeChanges);
 | 
				
			||||||
 | 
					                await inventory.save();
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            res.end();
 | 
				
			||||||
 | 
					            break;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        default:
 | 
					        default:
 | 
				
			||||||
            throw new Error(`unhandled infestedFoundry mode: ${String(req.query.mode)}`);
 | 
					            throw new Error(`unhandled infestedFoundry mode: ${String(req.query.mode)}`);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
				
			|||||||
@ -278,7 +278,8 @@
 | 
				
			|||||||
                        <div class="card mb-4">
 | 
					                        <div class="card mb-4">
 | 
				
			||||||
                            <h5 class="card-header">Account</h5>
 | 
					                            <h5 class="card-header">Account</h5>
 | 
				
			||||||
                            <div class="card-body">
 | 
					                            <div class="card-body">
 | 
				
			||||||
                                <button class="btn btn-primary" onclick="doUnlockAllFocusSchools();">Unlock All Focus Schools</button>
 | 
					                                <p><button class="btn btn-primary" onclick="doUnlockAllFocusSchools();">Unlock All Focus Schools</button></p>
 | 
				
			||||||
 | 
					                                <button class="btn btn-primary" onclick="doHelminthUnlockAll();">Fully Level Up Helminth</button>
 | 
				
			||||||
                            </div>
 | 
					                            </div>
 | 
				
			||||||
                        </div>
 | 
					                        </div>
 | 
				
			||||||
                    </div>
 | 
					                    </div>
 | 
				
			||||||
 | 
				
			|||||||
@ -955,6 +955,12 @@ function unlockFocusSchool(upgradeType) {
 | 
				
			|||||||
    });
 | 
					    });
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function doHelminthUnlockAll() {
 | 
				
			||||||
 | 
					    revalidateAuthz(() => {
 | 
				
			||||||
 | 
					        $.post("/api/infestedFoundry.php?" + window.authz + "&mode=custom_unlockall");
 | 
				
			||||||
 | 
					    });
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Powersuit Route
 | 
					// Powersuit Route
 | 
				
			||||||
 | 
					
 | 
				
			||||||
single.getRoute("#powersuit-route").on("beforeload", function () {
 | 
					single.getRoute("#powersuit-route").on("beforeload", function () {
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user