feat: archon shard removal
This commit is contained in:
		
							parent
							
								
									8154f9bc36
								
							
						
					
					
						commit
						e34f687935
					
				@ -40,6 +40,25 @@ export const infestedFoundryController: RequestHandler = async (req, res) => {
 | 
				
			|||||||
            break;
 | 
					            break;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        case "x": {
 | 
				
			||||||
 | 
					            // shard removal
 | 
				
			||||||
 | 
					            const request = getJSONfromString(String(req.body)) as IShardUninstallRequest;
 | 
				
			||||||
 | 
					            const inventory = await getInventory(accountId);
 | 
				
			||||||
 | 
					            const suit = inventory.Suits.find(suit => suit._id.toString() == request.SuitId.$oid)!;
 | 
				
			||||||
 | 
					            suit.ArchonCrystalUpgrades![request.Slot] = {};
 | 
				
			||||||
 | 
					            const bile = inventory.InfestedFoundry!.Resources!.find(
 | 
				
			||||||
 | 
					                x => x.ItemType == "/Lotus/Types/Items/InfestedFoundry/HelminthBile"
 | 
				
			||||||
 | 
					            )!;
 | 
				
			||||||
 | 
					            bile.Count -= 300;
 | 
				
			||||||
 | 
					            await inventory.save();
 | 
				
			||||||
 | 
					            res.json({
 | 
				
			||||||
 | 
					                InventoryChanges: {
 | 
				
			||||||
 | 
					                    InfestedFoundry: inventory.toJSON().InfestedFoundry
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					            });
 | 
				
			||||||
 | 
					            break;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        case "n": {
 | 
					        case "n": {
 | 
				
			||||||
            // name the beast
 | 
					            // name the beast
 | 
				
			||||||
            const request = getJSONfromString(String(req.body)) as IHelminthNameRequest;
 | 
					            const request = getJSONfromString(String(req.body)) as IHelminthNameRequest;
 | 
				
			||||||
@ -251,6 +270,11 @@ interface IShardInstallRequest {
 | 
				
			|||||||
    Color: string;
 | 
					    Color: string;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					interface IShardUninstallRequest {
 | 
				
			||||||
 | 
					    SuitId: IOid;
 | 
				
			||||||
 | 
					    Slot: number;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
interface IHelminthNameRequest {
 | 
					interface IHelminthNameRequest {
 | 
				
			||||||
    newName: string;
 | 
					    newName: string;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user