forked from OpenWF/SpaceNinjaServer
		
	feat(webui): max rank all intrinsics (#1230)
Reviewed-on: OpenWF/SpaceNinjaServer#1230
This commit is contained in:
		
							parent
							
								
									3986dac8ef
								
							
						
					
					
						commit
						2334e76453
					
				@ -6,7 +6,7 @@ import { RequestHandler } from "express";
 | 
			
		||||
 | 
			
		||||
export const playerSkillsController: RequestHandler = async (req, res) => {
 | 
			
		||||
    const accountId = await getAccountIdForRequest(req);
 | 
			
		||||
    const inventory = await getInventory(accountId);
 | 
			
		||||
    const inventory = await getInventory(accountId, "PlayerSkills");
 | 
			
		||||
    const request = getJSONfromString<IPlayerSkillsRequest>(String(req.body));
 | 
			
		||||
 | 
			
		||||
    const oldRank: number = inventory.PlayerSkills[request.Skill as keyof IPlayerSkills];
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										19
									
								
								src/controllers/custom/unlockAllIntrinsicsController.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										19
									
								
								src/controllers/custom/unlockAllIntrinsicsController.ts
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,19 @@
 | 
			
		||||
import { getInventory } from "@/src/services/inventoryService";
 | 
			
		||||
import { getAccountIdForRequest } from "@/src/services/loginService";
 | 
			
		||||
import { RequestHandler } from "express";
 | 
			
		||||
 | 
			
		||||
export const unlockAllIntrinsicsController: RequestHandler = async (req, res) => {
 | 
			
		||||
    const accountId = await getAccountIdForRequest(req);
 | 
			
		||||
    const inventory = await getInventory(accountId, "PlayerSkills");
 | 
			
		||||
    inventory.PlayerSkills.LPS_PILOTING = 10;
 | 
			
		||||
    inventory.PlayerSkills.LPS_GUNNERY = 10;
 | 
			
		||||
    inventory.PlayerSkills.LPS_TACTICAL = 10;
 | 
			
		||||
    inventory.PlayerSkills.LPS_ENGINEERING = 10;
 | 
			
		||||
    inventory.PlayerSkills.LPS_COMMAND = 10;
 | 
			
		||||
    inventory.PlayerSkills.LPS_DRIFT_COMBAT = 10;
 | 
			
		||||
    inventory.PlayerSkills.LPS_DRIFT_RIDING = 10;
 | 
			
		||||
    inventory.PlayerSkills.LPS_DRIFT_OPPORTUNITY = 10;
 | 
			
		||||
    inventory.PlayerSkills.LPS_DRIFT_ENDURANCE = 10;
 | 
			
		||||
    await inventory.save();
 | 
			
		||||
    res.end();
 | 
			
		||||
};
 | 
			
		||||
@ -8,6 +8,7 @@ import { deleteAccountController } from "@/src/controllers/custom/deleteAccountC
 | 
			
		||||
import { getNameController } from "@/src/controllers/custom/getNameController";
 | 
			
		||||
import { renameAccountController } from "@/src/controllers/custom/renameAccountController";
 | 
			
		||||
import { ircDroppedController } from "@/src/controllers/custom/ircDroppedController";
 | 
			
		||||
import { unlockAllIntrinsicsController } from "@/src/controllers/custom/unlockAllIntrinsicsController";
 | 
			
		||||
 | 
			
		||||
import { createAccountController } from "@/src/controllers/custom/createAccountController";
 | 
			
		||||
import { createMessageController } from "@/src/controllers/custom/createMessageController";
 | 
			
		||||
@ -30,6 +31,7 @@ customRouter.get("/deleteAccount", deleteAccountController);
 | 
			
		||||
customRouter.get("/getName", getNameController);
 | 
			
		||||
customRouter.get("/renameAccount", renameAccountController);
 | 
			
		||||
customRouter.get("/ircDropped", ircDroppedController);
 | 
			
		||||
customRouter.get("/unlockAllIntrinsics", unlockAllIntrinsicsController);
 | 
			
		||||
 | 
			
		||||
customRouter.post("/createAccount", createAccountController);
 | 
			
		||||
customRouter.post("/createMessage", createMessageController);
 | 
			
		||||
 | 
			
		||||
@ -562,8 +562,11 @@
 | 
			
		||||
                        <div class="card mb-3">
 | 
			
		||||
                            <h5 class="card-header" data-loc="cheats_account"></h5>
 | 
			
		||||
                            <div class="card-body">
 | 
			
		||||
                                <p><button class="btn btn-primary" onclick="doUnlockAllFocusSchools();" data-loc="cheats_unlockAllFocusSchools"></button></p>
 | 
			
		||||
                                <button class="btn btn-primary" onclick="doHelminthUnlockAll();" data-loc="cheats_helminthUnlockAll"></button>
 | 
			
		||||
                                <div class="mb-2 d-flex flex-wrap gap-2">
 | 
			
		||||
                                    <button class="btn btn-primary" onclick="doUnlockAllFocusSchools();" data-loc="cheats_unlockAllFocusSchools"></button>
 | 
			
		||||
                                    <button class="btn btn-primary" onclick="doHelminthUnlockAll();" data-loc="cheats_helminthUnlockAll"></button>
 | 
			
		||||
                                    <button class="btn btn-primary" onclick="doIntrinsicsUnlockAll();" data-loc="cheats_intrinsicsUnlockAll"></button>
 | 
			
		||||
                                </div>
 | 
			
		||||
                                <form class="mt-2" onsubmit="doChangeSupportedSyndicate(); return false;">
 | 
			
		||||
                                    <label class="form-label" for="changeSyndicate" data-loc="cheats_changeSupportedSyndicate"></label>
 | 
			
		||||
                                    <div class="input-group">
 | 
			
		||||
@ -578,7 +581,6 @@
 | 
			
		||||
                                    <button class="btn btn-primary" onclick="doQuestUpdate('completeAllUnlocked');" data-loc="cheats_quests_completeAllUnlocked"></button>
 | 
			
		||||
                                    <button class="btn btn-primary" onclick="doQuestUpdate('ResetAll');" data-loc="cheats_quests_resetAll"></button>
 | 
			
		||||
                                    <button class="btn btn-primary" onclick="doQuestUpdate('giveAll');" data-loc="cheats_quests_giveAll"></button>
 | 
			
		||||
 | 
			
		||||
                                </div>
 | 
			
		||||
                            </div>
 | 
			
		||||
                        </div>
 | 
			
		||||
 | 
			
		||||
@ -1053,6 +1053,12 @@ function doHelminthUnlockAll() {
 | 
			
		||||
    });
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function doIntrinsicsUnlockAll() {
 | 
			
		||||
    revalidateAuthz(() => {
 | 
			
		||||
        $.get("/custom/unlockAllIntrinsics?" + window.authz);
 | 
			
		||||
    });
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function doAddAllMods() {
 | 
			
		||||
    let modsAll = new Set();
 | 
			
		||||
    for (const child of document.getElementById("datalist-mods").children) {
 | 
			
		||||
 | 
			
		||||
@ -123,6 +123,7 @@ dict = {
 | 
			
		||||
    cheats_account: `Account`,
 | 
			
		||||
    cheats_unlockAllFocusSchools: `Alle Fokus-Schulen freischalten`,
 | 
			
		||||
    cheats_helminthUnlockAll: `Helminth vollständig aufleveln`,
 | 
			
		||||
    cheats_intrinsicsUnlockAll: `[UNTRANSLATED] Max Rank All Intrinsics`,
 | 
			
		||||
    cheats_changeSupportedSyndicate: `Unterstütztes Syndikat`,
 | 
			
		||||
    cheats_changeButton: `Ändern`,
 | 
			
		||||
    cheats_none: `Keines`,
 | 
			
		||||
 | 
			
		||||
@ -122,6 +122,7 @@ dict = {
 | 
			
		||||
    cheats_account: `Account`,
 | 
			
		||||
    cheats_unlockAllFocusSchools: `Unlock All Focus Schools`,
 | 
			
		||||
    cheats_helminthUnlockAll: `Fully Level Up Helminth`,
 | 
			
		||||
    cheats_intrinsicsUnlockAll: `Max Rank All Intrinsics`,
 | 
			
		||||
    cheats_changeSupportedSyndicate: `Supported syndicate`,
 | 
			
		||||
    cheats_changeButton: `Change`,
 | 
			
		||||
    cheats_none: `None`,
 | 
			
		||||
 | 
			
		||||
@ -123,6 +123,7 @@ dict = {
 | 
			
		||||
    cheats_account: `Compte`,
 | 
			
		||||
    cheats_unlockAllFocusSchools: `Débloquer toutes les écoles de focus`,
 | 
			
		||||
    cheats_helminthUnlockAll: `Helminth niveau max`,
 | 
			
		||||
    cheats_intrinsicsUnlockAll: `[UNTRANSLATED] Max Rank All Intrinsics`,
 | 
			
		||||
    cheats_changeSupportedSyndicate: `Allégeance`,
 | 
			
		||||
    cheats_changeButton: `Changer`,
 | 
			
		||||
    cheats_none: `Aucun`,
 | 
			
		||||
 | 
			
		||||
@ -123,6 +123,7 @@ dict = {
 | 
			
		||||
    cheats_account: `Аккаунт`,
 | 
			
		||||
    cheats_unlockAllFocusSchools: `Разблокировать все школы фокуса`,
 | 
			
		||||
    cheats_helminthUnlockAll: `Полностью улучшить Гельминта`,
 | 
			
		||||
    cheats_intrinsicsUnlockAll: `[UNTRANSLATED] Max Rank All Intrinsics`,
 | 
			
		||||
    cheats_changeSupportedSyndicate: `Поддерживаемый синдикат`,
 | 
			
		||||
    cheats_changeButton: `Изменить`,
 | 
			
		||||
    cheats_none: `Отсутствует`,
 | 
			
		||||
 | 
			
		||||
@ -123,6 +123,7 @@ dict = {
 | 
			
		||||
    cheats_account: `账户`,
 | 
			
		||||
    cheats_unlockAllFocusSchools: `解锁所有专精学派`,
 | 
			
		||||
    cheats_helminthUnlockAll: `完全升级Helminth`,
 | 
			
		||||
    cheats_intrinsicsUnlockAll: `[UNTRANSLATED] Max Rank All Intrinsics`,
 | 
			
		||||
    cheats_changeSupportedSyndicate: `支持的集团`,
 | 
			
		||||
    cheats_changeButton: `更改`,
 | 
			
		||||
    cheats_none: `无`,
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user