Combat page: show health potion

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
rope 2026-10-25 19:22:03 +00:00
parent cf91cbce3c
commit 089f3d59b7
2 changed files with 10 additions and 1 deletions

View file

@ -5999,6 +5999,7 @@ PATCH_NOTES = [
("new", "Fishing 50 also earns a second title: Master baiter."), ("new", "Fishing 50 also earns a second title: Master baiter."),
("balance", "Boiling hide glue now uses the kitchen fire: while it's lit, glue costs no logs."), ("balance", "Boiling hide glue now uses the kitchen fire: while it's lit, glue costs no logs."),
("fix", "Dungeons wait for the leader to press Start, so groups of 3 and 4 can form. No one can join once it starts."), ("fix", "Dungeons wait for the leader to press Start, so groups of 3 and 4 can form. No one can join once it starts."),
("fix", "Combat page shows your health potion: drunk on its own, no need to equip. The other card now reads \"No combat potion\"."),
]}, ]},
{"date": "2026-10-24", "title": "Dungeon loot", "notes": [ {"date": "2026-10-24", "title": "Dungeon loot", "notes": [
("new", "Masterwork patterns: every dungeon boss can drop one of 7 (15% from a mini-boss, 35% from the last boss, " ("new", "Masterwork patterns: every dungeon boss can drop one of 7 (15% from a mini-boss, 35% from the last boss, "

View file

@ -618,6 +618,14 @@ function plotsPanel() {
// A skill's potion and tool side by side, each a slot with what you could switch to beside it. // A skill's potion and tool side by side, each a slot with what you could switch to beside it.
function skillGear(skill) { function skillGear(skill) {
const me = S.me, cards = []; const me = S.me, cards = [];
// Health potions aren't drunk ahead: a fight takes the best one in the bank by itself.
if (skill === "combat") {
const hp = me.health_potion, it = hp && item(hp);
cards.push(`<div class="panel gear-card">
<span class="doll-slot ${it ? "" : "empty"}" title="${esc(it ? `${it.name}: +${it.drink} HP, drunk once a fight under ${Math.round(C.potion_below * 100)}%` : "No health potion")}">${item(hp || "health_potion_1").icon}</span>
<div class="gear-text">${it ? `<b>${esc(it.name)}</b><span class="muted small">+${it.drink} HP under ${Math.round(C.potion_below * 100)}% · ${fmt(me.bank[hp])} in bank · auto</span>`
: `<span class="muted">No health potion</span>`}</div></div>`);
}
const kinds = Object.entries(C.items).filter(([, it]) => it.potion?.skill === skill); const kinds = Object.entries(C.items).filter(([, it]) => it.potion?.skill === skill);
if (kinds.length) { if (kinds.length) {
const active = me.potions[skill], it = active && item(active.item); const active = me.potions[skill], it = active && item(active.item);
@ -626,7 +634,7 @@ function skillGear(skill) {
cards.push(`<div class="panel gear-card"> cards.push(`<div class="panel gear-card">
<span class="doll-slot ${it ? "" : "empty"}" title="${esc(it ? `${it.name}: ${it.potion.text}` : "No potion")}">${it ? it.icon : glyph("round-bottom-flask", "#98a1b4")}</span> <span class="doll-slot ${it ? "" : "empty"}" title="${esc(it ? `${it.name}: ${it.potion.text}` : "No potion")}">${it ? it.icon : glyph("round-bottom-flask", "#98a1b4")}</span>
<div class="gear-text">${it ? `<b>${esc(it.name)}</b><span class="muted small">${esc(it.potion.text)} · ${fmt(active.charges)} uses</span>` <div class="gear-text">${it ? `<b>${esc(it.name)}</b><span class="muted small">${esc(it.potion.text)} · ${fmt(active.charges)} uses</span>`
: `<span class="muted">No potion</span>`}</div> : `<span class="muted">${skill === "combat" ? "No combat potion" : "No potion"}</span>`}</div>
${others ? `<div class="swap-grid">${others}</div>` : ""}</div>`); ${others ? `<div class="swap-grid">${others}</div>` : ""}</div>`);
} }
for (const [kind, none] of [["tool", "No tool"], ["station", "No station"]]) { for (const [kind, none] of [["tool", "No tool"], ["station", "No station"]]) {