feat: replace infiniteResources with infiniteCredits & infinitePlatinum #588
@ -16,7 +16,8 @@
 | 
				
			|||||||
  "unlockAllMissions": true,
 | 
					  "unlockAllMissions": true,
 | 
				
			||||||
  "unlockAllQuests": true,
 | 
					  "unlockAllQuests": true,
 | 
				
			||||||
  "completeAllQuests": false,
 | 
					  "completeAllQuests": false,
 | 
				
			||||||
  "infiniteResources": true,
 | 
					  "infiniteCredits": true,
 | 
				
			||||||
 | 
					  "infinitePlatinum": true,
 | 
				
			||||||
  "unlockAllShipFeatures": true,
 | 
					  "unlockAllShipFeatures": true,
 | 
				
			||||||
  "unlockAllShipDecorations": true,
 | 
					  "unlockAllShipDecorations": true,
 | 
				
			||||||
  "unlockAllFlavourItems": true,
 | 
					  "unlockAllFlavourItems": true,
 | 
				
			||||||
 | 
				
			|||||||
@ -13,21 +13,22 @@ export const getCreditsController: RequestHandler = async (req, res) => {
 | 
				
			|||||||
        return;
 | 
					        return;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (config.infiniteResources) {
 | 
					 | 
				
			||||||
        res.json({
 | 
					 | 
				
			||||||
            RegularCredits: 999999999,
 | 
					 | 
				
			||||||
            TradesRemaining: 999999999,
 | 
					 | 
				
			||||||
            PremiumCreditsFree: 999999999,
 | 
					 | 
				
			||||||
            PremiumCredits: 999999999
 | 
					 | 
				
			||||||
        });
 | 
					 | 
				
			||||||
        return;
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    const inventory = await getInventory(accountId);
 | 
					    const inventory = await getInventory(accountId);
 | 
				
			||||||
    res.json({
 | 
					
 | 
				
			||||||
 | 
					    const response = {
 | 
				
			||||||
        RegularCredits: inventory.RegularCredits,
 | 
					        RegularCredits: inventory.RegularCredits,
 | 
				
			||||||
        TradesRemaining: inventory.TradesRemaining,
 | 
					        TradesRemaining: inventory.TradesRemaining,
 | 
				
			||||||
        PremiumCreditsFree: inventory.PremiumCreditsFree,
 | 
					        PremiumCreditsFree: inventory.PremiumCreditsFree,
 | 
				
			||||||
        PremiumCredits: inventory.PremiumCredits
 | 
					        PremiumCredits: inventory.PremiumCredits
 | 
				
			||||||
    });
 | 
					    };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if (config.infiniteCredits) {
 | 
				
			||||||
 | 
					        response.RegularCredits = 999999999;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    if (config.infinitePlatinum) {
 | 
				
			||||||
 | 
					        response.PremiumCreditsFree = 999999999;
 | 
				
			||||||
 | 
					        response.PremiumCredits = 999999999;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    res.json(response);
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
				
			|||||||
@ -33,9 +33,10 @@ const inventoryController: RequestHandler = async (request, response) => {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    const inventoryResponse = toInventoryResponse(inventoryJSON);
 | 
					    const inventoryResponse = toInventoryResponse(inventoryJSON);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (config.infiniteResources) {
 | 
					    if (config.infiniteCredits) {
 | 
				
			||||||
        inventoryResponse.RegularCredits = 999999999;
 | 
					        inventoryResponse.RegularCredits = 999999999;
 | 
				
			||||||
        inventoryResponse.TradesRemaining = 999999999;
 | 
					    }
 | 
				
			||||||
 | 
					    if (config.infinitePlatinum) {
 | 
				
			||||||
        inventoryResponse.PremiumCreditsFree = 999999999;
 | 
					        inventoryResponse.PremiumCreditsFree = 999999999;
 | 
				
			||||||
        inventoryResponse.PremiumCredits = 999999999;
 | 
					        inventoryResponse.PremiumCredits = 999999999;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
				
			|||||||
@ -33,7 +33,8 @@ interface IConfig {
 | 
				
			|||||||
    unlockAllMissions?: boolean;
 | 
					    unlockAllMissions?: boolean;
 | 
				
			||||||
    unlockAllQuests?: boolean;
 | 
					    unlockAllQuests?: boolean;
 | 
				
			||||||
    completeAllQuests?: boolean;
 | 
					    completeAllQuests?: boolean;
 | 
				
			||||||
    infiniteResources?: boolean;
 | 
					    infiniteCredits?: boolean;
 | 
				
			||||||
 | 
					    infinitePlatinum?: boolean;
 | 
				
			||||||
    unlockAllShipFeatures?: boolean;
 | 
					    unlockAllShipFeatures?: boolean;
 | 
				
			||||||
    unlockAllShipDecorations?: boolean;
 | 
					    unlockAllShipDecorations?: boolean;
 | 
				
			||||||
    unlockAllFlavourItems?: boolean;
 | 
					    unlockAllFlavourItems?: boolean;
 | 
				
			||||||
 | 
				
			|||||||
@ -419,7 +419,7 @@ export const updateSlots = async (accountId: string, slotName: SlotNames, slotAm
 | 
				
			|||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export const updateCurrency = async (price: number, usePremium: boolean, accountId: string) => {
 | 
					export const updateCurrency = async (price: number, usePremium: boolean, accountId: string) => {
 | 
				
			||||||
    if (config.infiniteResources) {
 | 
					    if (usePremium ? config.infinitePlatinum : config.infiniteCredits) {
 | 
				
			||||||
        return {};
 | 
					        return {};
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -209,8 +209,12 @@
 | 
				
			|||||||
                                    <label class="form-check-label" for="completeAllQuests">Complete All Quests</label>
 | 
					                                    <label class="form-check-label" for="completeAllQuests">Complete All Quests</label>
 | 
				
			||||||
                                </div>
 | 
					                                </div>
 | 
				
			||||||
                                <div class="form-check">
 | 
					                                <div class="form-check">
 | 
				
			||||||
                                    <input class="form-check-input" type="checkbox" id="infiniteResources" />
 | 
					                                    <input class="form-check-input" type="checkbox" id="infiniteCredits" />
 | 
				
			||||||
                                    <label class="form-check-label" for="infiniteResources">Infinite Credits and Platinum</label>
 | 
					                                    <label class="form-check-label" for="infiniteCredits">Infinite Credits</label>
 | 
				
			||||||
 | 
					                                </div>
 | 
				
			||||||
 | 
					                                <div class="form-check">
 | 
				
			||||||
 | 
					                                    <input class="form-check-input" type="checkbox" id="infinitePlatinum" />
 | 
				
			||||||
 | 
					                                    <label class="form-check-label" for="infinitePlatinum">Infinite Platinum</label>
 | 
				
			||||||
                                </div>
 | 
					                                </div>
 | 
				
			||||||
                                <div class="form-check">
 | 
					                                <div class="form-check">
 | 
				
			||||||
                                    <input class="form-check-input" type="checkbox" id="unlockAllShipFeatures" />
 | 
					                                    <input class="form-check-input" type="checkbox" id="unlockAllShipFeatures" />
 | 
				
			||||||
 | 
				
			|||||||
@ -736,7 +736,8 @@ const uiConfigs = [
 | 
				
			|||||||
    "unlockAllMissions",
 | 
					    "unlockAllMissions",
 | 
				
			||||||
    "unlockAllQuests",
 | 
					    "unlockAllQuests",
 | 
				
			||||||
    "completeAllQuests",
 | 
					    "completeAllQuests",
 | 
				
			||||||
    "infiniteResources",
 | 
					    "infiniteCredits",
 | 
				
			||||||
 | 
					    "infinitePlatinum",
 | 
				
			||||||
    "unlockAllShipFeatures",
 | 
					    "unlockAllShipFeatures",
 | 
				
			||||||
    "unlockAllShipDecorations",
 | 
					    "unlockAllShipDecorations",
 | 
				
			||||||
    "unlockAllFlavourItems",
 | 
					    "unlockAllFlavourItems",
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user