feat: resource extractor drones #1068
@ -31,6 +31,7 @@
 | 
				
			|||||||
  "unlockExilusEverywhere": true,
 | 
					  "unlockExilusEverywhere": true,
 | 
				
			||||||
  "unlockArcanesEverywhere": true,
 | 
					  "unlockArcanesEverywhere": true,
 | 
				
			||||||
  "noDailyStandingLimits": true,
 | 
					  "noDailyStandingLimits": true,
 | 
				
			||||||
 | 
					  "instantResourceExtractorDrones": false,
 | 
				
			||||||
  "noDojoResearchCosts": true,
 | 
					  "noDojoResearchCosts": true,
 | 
				
			||||||
  "noDojoResearchTime": true,
 | 
					  "noDojoResearchTime": true,
 | 
				
			||||||
  "spoofMasteryRank": -1
 | 
					  "spoofMasteryRank": -1
 | 
				
			||||||
 | 
				
			|||||||
@ -1,4 +1,5 @@
 | 
				
			|||||||
import { toMongoDate, toOid } from "@/src/helpers/inventoryHelpers";
 | 
					import { toMongoDate, toOid } from "@/src/helpers/inventoryHelpers";
 | 
				
			||||||
 | 
					import { config } from "@/src/services/configService";
 | 
				
			||||||
import { addMiscItems, getInventory } from "@/src/services/inventoryService";
 | 
					import { addMiscItems, getInventory } from "@/src/services/inventoryService";
 | 
				
			||||||
import { getAccountIdForRequest } from "@/src/services/loginService";
 | 
					import { getAccountIdForRequest } from "@/src/services/loginService";
 | 
				
			||||||
import { getRandomElement, getRandomInt } from "@/src/services/rngService";
 | 
					import { getRandomElement, getRandomInt } from "@/src/services/rngService";
 | 
				
			||||||
@ -37,10 +38,9 @@ export const dronesController: RequestHandler = async (req, res) => {
 | 
				
			|||||||
            ActiveDrones: activeDrones
 | 
					            ActiveDrones: activeDrones
 | 
				
			||||||
        });
 | 
					        });
 | 
				
			||||||
    } else if ("droneId" in req.query && "systemIndex" in req.query) {
 | 
					    } else if ("droneId" in req.query && "systemIndex" in req.query) {
 | 
				
			||||||
        const instantResourceDrones = true;
 | 
					 | 
				
			||||||
        const drone = inventory.Drones.id(req.query.droneId as string)!;
 | 
					        const drone = inventory.Drones.id(req.query.droneId as string)!;
 | 
				
			||||||
        const droneMeta = ExportDrones[drone.ItemType];
 | 
					        const droneMeta = ExportDrones[drone.ItemType];
 | 
				
			||||||
        drone.DeployTime = instantResourceDrones ? new Date(0) : new Date();
 | 
					        drone.DeployTime = config.instantResourceExtractorDrones ? new Date(0) : new Date();
 | 
				
			||||||
        if (drone.RepairStart) {
 | 
					        if (drone.RepairStart) {
 | 
				
			||||||
            const repairMinutes = (Date.now() - drone.RepairStart.getTime()) / 60_000;
 | 
					            const repairMinutes = (Date.now() - drone.RepairStart.getTime()) / 60_000;
 | 
				
			||||||
            const hpPerMinute = droneMeta.repairRate / 60;
 | 
					            const hpPerMinute = droneMeta.repairRate / 60;
 | 
				
			||||||
@ -50,7 +50,7 @@ export const dronesController: RequestHandler = async (req, res) => {
 | 
				
			|||||||
        drone.System = parseInt(req.query.systemIndex as string);
 | 
					        drone.System = parseInt(req.query.systemIndex as string);
 | 
				
			||||||
        const system = ExportSystems[drone.System - 1];
 | 
					        const system = ExportSystems[drone.System - 1];
 | 
				
			||||||
        if (Math.random() < system.damageChance) {
 | 
					        if (Math.random() < system.damageChance) {
 | 
				
			||||||
            drone.DamageTime = instantResourceDrones
 | 
					            drone.DamageTime = config.instantResourceExtractorDrones
 | 
				
			||||||
                ? new Date()
 | 
					                ? new Date()
 | 
				
			||||||
                : new Date(Date.now() + getRandomInt(3, 4) * 3600_000);
 | 
					                : new Date(Date.now() + getRandomInt(3, 4) * 3600_000);
 | 
				
			||||||
            drone.PendingDamage = getRandomInt(system.droneDamage.minValue, system.droneDamage.maxValue);
 | 
					            drone.PendingDamage = getRandomInt(system.droneDamage.minValue, system.droneDamage.maxValue);
 | 
				
			||||||
 | 
				
			|||||||
@ -57,6 +57,7 @@ interface IConfig {
 | 
				
			|||||||
    unlockExilusEverywhere?: boolean;
 | 
					    unlockExilusEverywhere?: boolean;
 | 
				
			||||||
    unlockArcanesEverywhere?: boolean;
 | 
					    unlockArcanesEverywhere?: boolean;
 | 
				
			||||||
    noDailyStandingLimits?: boolean;
 | 
					    noDailyStandingLimits?: boolean;
 | 
				
			||||||
 | 
					    instantResourceExtractorDrones?: boolean;
 | 
				
			||||||
    noDojoResearchCosts?: boolean;
 | 
					    noDojoResearchCosts?: boolean;
 | 
				
			||||||
    noDojoResearchTime?: boolean;
 | 
					    noDojoResearchTime?: boolean;
 | 
				
			||||||
    spoofMasteryRank?: number;
 | 
					    spoofMasteryRank?: number;
 | 
				
			||||||
 | 
				
			|||||||
@ -517,6 +517,10 @@
 | 
				
			|||||||
                                        <input class="form-check-input" type="checkbox" id="noDailyStandingLimits" />
 | 
					                                        <input class="form-check-input" type="checkbox" id="noDailyStandingLimits" />
 | 
				
			||||||
                                        <label class="form-check-label" for="noDailyStandingLimits" data-loc="cheats_noDailyStandingLimits"></label>
 | 
					                                        <label class="form-check-label" for="noDailyStandingLimits" data-loc="cheats_noDailyStandingLimits"></label>
 | 
				
			||||||
                                    </div>
 | 
					                                    </div>
 | 
				
			||||||
 | 
					                                    <div class="form-check">
 | 
				
			||||||
 | 
					                                        <input class="form-check-input" type="checkbox" id="instantResourceExtractorDrones" />
 | 
				
			||||||
 | 
					                                        <label class="form-check-label" for="instantResourceExtractorDrones" data-loc="cheats_instantResourceExtractorDrones"></label>
 | 
				
			||||||
 | 
					                                    </div>
 | 
				
			||||||
                                    <div class="form-check">
 | 
					                                    <div class="form-check">
 | 
				
			||||||
                                        <input class="form-check-input" type="checkbox" id="noDojoResearchCosts" />
 | 
					                                        <input class="form-check-input" type="checkbox" id="noDojoResearchCosts" />
 | 
				
			||||||
                                        <label class="form-check-label" for="noDojoResearchCosts" data-loc="cheats_noDojoResearchCosts"></label>
 | 
					                                        <label class="form-check-label" for="noDojoResearchCosts" data-loc="cheats_noDojoResearchCosts"></label>
 | 
				
			||||||
 | 
				
			|||||||
@ -111,6 +111,7 @@ dict = {
 | 
				
			|||||||
    cheats_unlockExilusEverywhere: `Exilus Adapters Everywhere`,
 | 
					    cheats_unlockExilusEverywhere: `Exilus Adapters Everywhere`,
 | 
				
			||||||
    cheats_unlockArcanesEverywhere: `Arcane Adapters Everywhere`,
 | 
					    cheats_unlockArcanesEverywhere: `Arcane Adapters Everywhere`,
 | 
				
			||||||
    cheats_noDailyStandingLimits: `No Daily Standing Limits`,
 | 
					    cheats_noDailyStandingLimits: `No Daily Standing Limits`,
 | 
				
			||||||
 | 
					    cheats_instantResourceExtractorDrones: `Instant Resource Extractor Drones`,
 | 
				
			||||||
    cheats_noDojoResearchCosts: `No Dojo Research Costs`,
 | 
					    cheats_noDojoResearchCosts: `No Dojo Research Costs`,
 | 
				
			||||||
    cheats_noDojoResearchTime: `No Dojo Research Time`,
 | 
					    cheats_noDojoResearchTime: `No Dojo Research Time`,
 | 
				
			||||||
    cheats_spoofMasteryRank: `Spoofed Mastery Rank (-1 to disable)`,
 | 
					    cheats_spoofMasteryRank: `Spoofed Mastery Rank (-1 to disable)`,
 | 
				
			||||||
 | 
				
			|||||||
@ -112,6 +112,7 @@ dict = {
 | 
				
			|||||||
    cheats_unlockExilusEverywhere: `Адаптеры Эксилус везде`,
 | 
					    cheats_unlockExilusEverywhere: `Адаптеры Эксилус везде`,
 | 
				
			||||||
    cheats_unlockArcanesEverywhere: `Адаптеры для мистификаторов везде`,
 | 
					    cheats_unlockArcanesEverywhere: `Адаптеры для мистификаторов везде`,
 | 
				
			||||||
    cheats_noDailyStandingLimits: `Без ежедневных ограничений репутации`,
 | 
					    cheats_noDailyStandingLimits: `Без ежедневных ограничений репутации`,
 | 
				
			||||||
 | 
					    cheats_instantResourceExtractorDrones: `[UNTRANSLATED] Instant Resource Extractor Drones`,
 | 
				
			||||||
    cheats_noDojoResearchCosts: `[UNTRANSLATED] No Dojo Research Costs`,
 | 
					    cheats_noDojoResearchCosts: `[UNTRANSLATED] No Dojo Research Costs`,
 | 
				
			||||||
    cheats_noDojoResearchTime: `[UNTRANSLATED] No Dojo Research Time`,
 | 
					    cheats_noDojoResearchTime: `[UNTRANSLATED] No Dojo Research Time`,
 | 
				
			||||||
    cheats_spoofMasteryRank: `Подделанный ранг мастерства (-1 для отключения)`,
 | 
					    cheats_spoofMasteryRank: `Подделанный ранг мастерства (-1 для отключения)`,
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user