Delete your own board messages; drop chips name their item
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
70246f78ea
commit
2eed9b7ec4
4 changed files with 28 additions and 4 deletions
|
|
@ -471,7 +471,7 @@ function actionCard(a) {
|
|||
if (a.skill === "combat") {
|
||||
const chance = Math.min(0.97, Math.max(0.15, 0.5 + (me.power - a.difficulty) * 0.04));
|
||||
extra = `<div class="small">Win chance <b>${Math.round(chance * 100)}%</b> · about <b>${me.fight_damage[a.id]}</b> damage a fight${a.gold ? ` · ${a.gold} gold` : ""}</div>`;
|
||||
if (a.drops) io += a.drops.map(([id, q, odds]) => `<span class="item-chip" title="${Math.round(odds * 100)}% chance">${item(id).icon} ${q} <span class="have">${Math.round(odds * 100)}%</span></span>`).join("");
|
||||
if (a.drops) io += a.drops.map(([id, q, odds]) => `<span class="item-chip" title="${esc(item(id).name)}: ${Math.round(odds * 100)}% chance">${item(id).icon} ${q} <span class="have">${Math.round(odds * 100)}%</span></span>`).join("");
|
||||
if (a.special === "sabotage") extra += `<div class="small muted">Each win weakens the coming raid by 3%, up to 30%.</div>`;
|
||||
}
|
||||
if (a.special === "recon") extra = `<div class="small muted">+${a.recon} recon on the next event</div>`;
|
||||
|
|
@ -818,7 +818,9 @@ function raidPrep(ev) {
|
|||
// --- board & roster -------------------------------------------------------
|
||||
|
||||
function board() {
|
||||
const msgs = S.board.map((m) => `<div class="msg"><span class="who">${esc(playerName(m.who))}</span><span class="when">${ago(m.at)}</span><div class="text">${esc(m.text)}</div></div>`).join("");
|
||||
const msgs = S.board.map((m) => `<div class="msg"><span class="who">${esc(playerName(m.who))}</span><span class="when">${ago(m.at)}</span>
|
||||
${m.who === S.uid && m.id ? `<button class="msg-delete" data-unpost="${m.id}" title="Delete this message">✕</button>` : ""}
|
||||
<div class="text">${esc(m.text)}</div></div>`).join("");
|
||||
const ledger = [...S.ledger].reverse().map((l) => `<li>${esc(l.text)}<span class="when">${ago(l.at)}</span></li>`).join("");
|
||||
return `<div class="cols">
|
||||
<div class="panel"><h2>Town board</h2>
|
||||
|
|
@ -1000,6 +1002,10 @@ document.addEventListener("click", (e) => {
|
|||
if (d.favour) return act("/api/favour", { kind: d.favour });
|
||||
if (d.food) return act("/api/food", { item: d.food });
|
||||
if (d.potion) return act("/api/potion", { item: d.potion });
|
||||
if (d.unpost) {
|
||||
if (!confirm("Delete this message?")) return;
|
||||
return act("/api/board/delete", { id: Number(d.unpost) });
|
||||
}
|
||||
if (d.aid) return act("/api/aid", { kind: d.aid, item: d.item, source: d.source });
|
||||
if ("hire" in d) return act("/api/hire", {});
|
||||
if (d.devHappen) return act("/api/dev/happen", { track: d.devHappen });
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue