feat: infusing abilities #676
@ -43,7 +43,8 @@ export const upgradesController: RequestHandler = async (req, res) => {
|
||||
|
||||
const recipe = getRecipeByResult(operation.UpgradeRequirement)!;
|
||||
for (const ingredient of recipe.ingredients) {
|
||||
inventory.InfestedFoundry!.Resources!.find(x => x.ItemType == ingredient.ItemType)!.Count -= ingredient.ItemCount;
|
||||
inventory.InfestedFoundry!.Resources!.find(x => x.ItemType == ingredient.ItemType)!.Count -=
|
||||
ingredient.ItemCount;
|
||||
}
|
||||
}
|
||||
|
||||
@ -51,7 +52,8 @@ export const upgradesController: RequestHandler = async (req, res) => {
|
||||
suit.Configs[entry.Slot] ??= {};
|
||||
suit.Configs[entry.Slot].AbilityOverride = newAbilityOverride;
|
||||
}
|
||||
} else switch (operation.UpgradeRequirement) {
|
||||
} else
|
||||
switch (operation.UpgradeRequirement) {
|
||||
case "/Lotus/Types/Items/MiscItems/OrokinReactor":
|
||||
case "/Lotus/Types/Items/MiscItems/OrokinCatalyst":
|
||||
for (const item of inventory[payload.ItemCategory]) {
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user
🛠️ Refactor suggestion
Check for potential absent
suit
or mismatched category.console.assert()
will not throw errors in production mode by default. Ifsuit
is not found orpayload.ItemCategory !== "Suits"
, the code might continue in an unexpected state without raising an error. Consider throwing an exception or returning early when these conditions fail.