Prayer: bury on the spot, retuned costs
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
40e5274c4e
commit
a7ff97815f
5 changed files with 106 additions and 32 deletions
|
|
@ -1231,6 +1231,13 @@ function drawFlame(cv, id, n) {
|
|||
ctx.globalAlpha = 1;
|
||||
}
|
||||
|
||||
// Temple levels and its carved altar: +25% prayer points from bones each.
|
||||
function bonePercent() {
|
||||
const temple = S.city.buildings.temple;
|
||||
if (temple?.damaged) return 0;
|
||||
return 25 *((temple?.level || 0) + (temple?.fittings || []).includes("carved_altar"));
|
||||
}
|
||||
|
||||
function prayerPanel() {
|
||||
const me = S.me, city = S.city, level = me.levels.prayer;
|
||||
const cost = C.prayers.filter((p) => me.prayers.includes(p.id)).reduce((sum, p) => sum + p.cost, 0);
|
||||
|
|
@ -1244,16 +1251,19 @@ function prayerPanel() {
|
|||
<span class="small ${locked ? "why" : "muted"}">${locked ? `Lv ${p.level}` : `${p.cost} pt${p.cost > 1 ? "s" : ""}/fight`}</span>
|
||||
</button>`;
|
||||
}).join("");
|
||||
const temple = city.buildings.temple.level;
|
||||
const temple = city.buildings.temple.level, boost = bonePercent();
|
||||
const bury = me.bury !== false;
|
||||
return `<div class="cols">
|
||||
<div class="panel"><h2>Prayers · ${me.prayers.length} / ${C.max_prayers} active</h2>
|
||||
<div class="prayer-points">${skillOf("prayer").icon} <b>${fmt(me.pp)}</b> prayer points${cost ? ` · ${cost} per fight (~${fmt(me.pp / cost)} fights)` : ""}</div>
|
||||
<div class="prayers">${cards}</div>
|
||||
<p class="small muted">Prayers cost points each fight. Bury bones for more.</p>
|
||||
<div class="row"><button class="btn sm ${bury ? "gold" : ""}" data-bury="${bury ? "off" : "on"}"
|
||||
title="Fight bones turn into prayer points and ½ bury XP as they drop. Off: they go to the bank.">🦴 Bury on the spot: ${bury ? "on" : "off"}</button></div>
|
||||
<p class="small muted">Prayers cost points each fight; bones refill them.</p>
|
||||
</div>
|
||||
<div class="panel"><h2>Temple</h2>
|
||||
${temple ? `<p>Devotion <b>${fmt(city.devotion)}</b> · ward <b>+${city.ward}</b> defence (max +${15 * temple})</p>
|
||||
<p class="small muted">Offerings ward the next raid. +${temple} prayer point${temple > 1 ? "s" : ""} per bone buried.</p>`
|
||||
<p class="small muted">Offerings ward the next raid. +${boost}% prayer points from bones.</p>`
|
||||
: `<p class="muted">No temple yet.</p>`}
|
||||
</div></div>`;
|
||||
}
|
||||
|
|
@ -1724,7 +1734,7 @@ function actionCard(a) {
|
|||
if (a.special === "labour") {
|
||||
extra = `<div class="small makes">${skillOf("construction").icon} +${me.labour_per_action} labour per action</div>`;
|
||||
}
|
||||
if (a.special === "bury") extra = `<div class="small makes">${skillOf("prayer").icon} +${a.pp + temple} prayer points</div>`;
|
||||
if (a.special === "bury") extra = `<div class="small makes">${skillOf("prayer").icon} +${+(a.pp * (1 + bonePercent() / 100)).toFixed(2)} prayer points</div>`;
|
||||
if (a.special === "offer") extra = `<div class="small makes">${C.buildings.temple.icon} +${+(a.devotion * (1 + 0.25 * temple)).toFixed(1)} devotion</div>`;
|
||||
const gear = Object.keys(a.outputs).filter((id) => GEAR_SLOTS.includes(item(id).slot));
|
||||
const made = Object.keys(a.outputs).filter((id) => !gear.includes(id)).map(itemStats).filter(Boolean);
|
||||
|
|
@ -2925,6 +2935,7 @@ document.addEventListener("click", (e) => {
|
|||
return act("/api/prayers", { ids: on ? S.me.prayers.filter((x) => x !== d.pray) : [...S.me.prayers, d.pray] });
|
||||
}
|
||||
if (d.overflow) return act("/api/settings", { overflow: d.overflow });
|
||||
if (d.bury) return act("/api/settings", { bury: d.bury === "on" });
|
||||
if (d.class) { pickedClass = d.class; render(); return; }
|
||||
if ("repick" in d) return act("/api/class", { cls: pickedClass });
|
||||
if (d.tab) { tabs[d.tab] = d.group; remember(`tab.${d.tab}`, d.group); render(); return; }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue