Order reward follows the quantity at the same price each
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
79740d9a86
commit
326437ddf9
1 changed files with 3 additions and 0 deletions
|
|
@ -1670,8 +1670,11 @@ document.addEventListener("change", (e) => {
|
|||
draft.reward = draft.item ? item(draft.item).value * (draft.kind === "craft" ? draft.qty : 1) : 0;
|
||||
if (!list[draft.item]) draft.item = "";
|
||||
} else {
|
||||
const before = draft.qty;
|
||||
draft[key] = Math.max(key === "qty" ? 1 : 0, Math.floor(Number(e.target.value) || 0));
|
||||
if (key === "qty") draft.qty = Math.min(draft.qty, C.order_max[draft.kind]);
|
||||
// A crafting order's reward is the total: it follows the quantity at the same price each.
|
||||
if (key === "qty" && draft.kind === "craft") draft.reward = Math.round(draft.reward / before * draft.qty);
|
||||
if (key === "qty" && draft.kind === "craft" && draft.item) {
|
||||
// Drop provided reagents the bank can no longer cover at the new quantity.
|
||||
const a = C.actions.find((x) => x.id === C.order_recipes[draft.item]), runs = Math.ceil(draft.qty / a.outputs[draft.item]);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue