Siegeworks: city accepts them, Give on raid readiness
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
1bac06cb28
commit
6697545ba0
3 changed files with 18 additions and 3 deletions
|
|
@ -1205,7 +1205,7 @@ function cityNeed(id) {
|
|||
for (const r of rows) {
|
||||
const short = r.want - r.have;
|
||||
const counts = r.any === "food" ? it.food : r.any === "fuel" ? id === "kindling" || C.firewood.includes(id)
|
||||
: r.any ? (it.slot || it.kit) === r.any : id === r.item;
|
||||
: r.any ? (it.slot || it.kit || it.siege) === r.any : id === r.item;
|
||||
if (short <= 0 || !counts) continue;
|
||||
qty += r.any === "food" ? Math.ceil(short / it.food) : short;
|
||||
why.push(`${source}: ${r.label} · ${fmt(r.have)} / ${fmt(r.want)}`);
|
||||
|
|
@ -2613,11 +2613,13 @@ function favourSpends() {
|
|||
|
||||
// A have / need row with its bar, and a Give button when you hold the item.
|
||||
function reqRow(r) {
|
||||
const mine = !r.kinds && S.me.bank[r.item] || 0;
|
||||
// A Siegeworks row takes the best trap or engine you hold.
|
||||
const siege = Object.keys(S.me.bank).filter((id) => r.any && item(id).siege === r.any).sort((a, b) => item(b).siege_power - item(a).siege_power)[0];
|
||||
const give = siege || r.item, mine = !r.kinds && S.me.bank[give] || 0;
|
||||
// "Any" rows and kinds of food open the skill as you left it; a named item opens its own recipe.
|
||||
const link = goto(r.item, Boolean(r.any || r.kinds)), tip = link ? ` title="${esc(gotoTip(r.item).trim())}"` : "";
|
||||
return `<div class="req ${r.next ? "dim" : ""}"><span${link}${tip}>${item(r.item).icon}</span><span><span${link}${tip}>${esc(r.label)}</span> <span class="muted small">${fmt(r.have)} / ${fmt(r.want)}</span></span>
|
||||
${mine ? `<button class="btn sm gold" data-donate="${r.item}" data-qty="all">Give ${fmt(mine)}</button>` : "<span></span>"}
|
||||
${mine ? `<button class="btn sm gold" data-donate="${give}" data-qty="all"${siege ? ` title="${esc(item(siege).name)}"` : ""}>Give ${fmt(mine)}${siege ? ` ${item(siege).icon}` : ""}</button>` : "<span></span>"}
|
||||
${r.foods ? foodKinds(r) : `<div class="bar"><span style="width:${r.want ? Math.min(100, r.have / r.want * 100) : 100}%"></span></div>`}</div>`;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue