Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 0 additions & 32 deletions assets/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -392,38 +392,6 @@ body.tab-wide main {
accent-color: var(--gold);
}

.boopsum-slider-wrap {
display: flex;
flex-direction: column;
gap: 0.35rem;
}

#quest-tuning {
width: 100%;
accent-color: var(--gold);
}

.boopsum-slider-labels {
display: flex;
justify-content: space-between;
gap: 0.5rem;
font-size: 0.78rem;
color: var(--parchment-muted);
}


.boopsum-precise-toggle {
display: inline-flex;
align-items: center;
gap: 0.45rem;
font-size: 0.9rem;
color: var(--parchment);
}

.boopsum-precise-toggle input[type="checkbox"] {
accent-color: var(--gold);
}

.field select {
appearance: none;
-webkit-appearance: none;
Expand Down
57 changes: 4 additions & 53 deletions assets/js/boopsum.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(function () {
var HalfProf = [0, 1, 1, 1, 1, 1.5, 1.5, 1.5, 1.5, 2, 2, 2, 2, 2.5, 2.5, 2.5, 2.5, 3, 3, 3, 3];
var DMod = [0.5, 0.75, 1];
var STANDARD_EFFORT_MOD = 0.75;
var GPMod = [0, 0.1, 0.1, 0.1, 0.1, 0.25, 0.25, 0.25, 0.25, 0.55, 0.55, 0.55, 0.55, 0.8, 0.8, 0.8, 0.8, 1.05, 1.05, 1.05, 1.05];

var MAX_IDX = HalfProf.length - 1;
Expand Down Expand Up @@ -33,8 +33,6 @@
var lootLogEl = document.getElementById("out-loot-log");
var itemLootWrapEl = document.getElementById("out-itemloot-wrap");
var lootNoteEl = document.getElementById("out-loot-note");
var questTuningEl = document.getElementById("quest-tuning");
var questTuningPreciseEl = document.getElementById("quest-tuning-precise");
var lastCalcState = null;
var PARTY_NAMES_KEY = "opencaw-boopsum-names-v1";
var nameCache = { pairs: {} };
Expand Down Expand Up @@ -101,12 +99,6 @@
nameCache = loadNameCache();
refreshDatalists();

var EFFORT_LEVELS = [
{ key: "quick", label: "Quick / low-interaction", mod: DMod[0] },
{ key: "standard", label: "Standard", mod: DMod[1] },
{ key: "lore", label: "Lore / high-interaction", mod: DMod[2] }
];

var QUEST_TYPES = {
graveyard: { label: "Graveyard", givesGold: false, givesItems: false },
hunt: { label: "Hunt", givesGold: true, givesItems: false },
Expand Down Expand Up @@ -281,7 +273,7 @@
return "35-50 or Milestone";
}

function lootLogMarkdown(qpEach, gpEachArr, party, questTypeLabel, effortLabel) {
function lootLogMarkdown(qpEach, gpEachArr, party) {
var characters = party.map(function (p) {
return p.character || "—";
});
Expand All @@ -297,48 +289,23 @@
return form.querySelector('input[name="questType"]:checked');
}

function getEffortState() {
var raw = Number(questTuningEl && questTuningEl.value);
if (!Number.isFinite(raw)) raw = 1;
var clamped = Math.min(Math.max(raw, 0), EFFORT_LEVELS.length - 1);
var preciseEnabled = !!(questTuningPreciseEl && questTuningPreciseEl.checked);
if (!preciseEnabled) {
var effortIdx = Math.min(Math.max(Math.floor(clamped), 0), EFFORT_LEVELS.length - 1);
return { label: EFFORT_LEVELS[effortIdx].label, mod: EFFORT_LEVELS[effortIdx].mod };
}

var lowIdx = Math.floor(clamped);
var highIdx = Math.min(lowIdx + 1, EFFORT_LEVELS.length - 1);
var ratio = clamped - lowIdx;
var low = EFFORT_LEVELS[lowIdx];
var high = EFFORT_LEVELS[highIdx];
var blended = low.mod + (high.mod - low.mod) * ratio;
var label = lowIdx === highIdx
? low.label + ' (Precise Tweaking)'
: low.label + ' → ' + high.label + ' (' + Math.round(ratio * 100) + '%)';

return { label: label, mod: blended };
}

function renderLootForState(state) {
if (!state) return;
var effort = getEffortState();
var questType = QUEST_TYPES[state.questTypeValue];
var gpByPlayer = state.partyLevels.map(function (x) {
return Math.floor((state.playerXp / HalfProf[x]) * effort.mod * GPMod[x]);
return Math.floor((state.playerXp / HalfProf[x]) * STANDARD_EFFORT_MOD * GPMod[x]);
});
var itemLoot = gpByPlayer.reduce(function (a, b) {
return a + b;
}, 0);

document.getElementById("out-effort-level").textContent = effort.label;
document.getElementById("out-gp-selected").textContent = questType.givesGold ? fmtList(gpByPlayer) : "0";
document.getElementById("out-itemloot").textContent = questType.givesItems ? String(itemLoot) : "0";
itemLootWrapEl.hidden = !questType.givesItems;
lootNoteEl.textContent = questType.givesGold
? (questType.givesItems ? "Gold and item loot are both awarded for this quest type." : "Gold is awarded; no item loot pool for this quest type.")
: "No gold or item loot is awarded for this quest type.";
lootLogEl.textContent = lootLogMarkdown(state.playerQP, questType.givesGold ? gpByPlayer : [0], state.party, questType.label, effort.label);
lootLogEl.textContent = lootLogMarkdown(state.playerQP, questType.givesGold ? gpByPlayer : [0], state.party);
}

calcBtn.addEventListener("click", function () {
Expand Down Expand Up @@ -394,20 +361,4 @@

resEl.hidden = false;
});

if (questTuningEl) {
questTuningEl.addEventListener("input", function () {
renderLootForState(lastCalcState);
});
}

if (questTuningPreciseEl && questTuningEl) {
questTuningPreciseEl.addEventListener("change", function () {
questTuningEl.step = questTuningPreciseEl.checked ? "0.01" : "1";
if (!questTuningPreciseEl.checked) {
questTuningEl.value = String(Math.round(Number(questTuningEl.value) || 1));
}
renderLootForState(lastCalcState);
});
}
})();
30 changes: 0 additions & 30 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -219,37 +219,7 @@ <h4>Quest Points</h4>
<p><strong>QP Each:</strong> <span id="out-xp-each"></span></p>

<h4>Loot</h4>
<label class="field">
<span>Quest tuning</span>
<div class="boopsum-slider-wrap">
<input
type="range"
name="questTuning"
id="quest-tuning"
min="0"
max="2"
step="1"
value="1"
list="quest-tuning-markers"
/>
<datalist id="quest-tuning-markers">
<option value="0" label="Quick"></option>
<option value="1" label="Standard"></option>
<option value="2" label="Lore"></option>
</datalist>
<div class="boopsum-slider-labels" aria-hidden="true">
<span>Quick / low-interaction</span>
<span>Standard</span>
<span>Lore / high-interaction</span>
</div>
<label class="boopsum-precise-toggle">
<input type="checkbox" id="quest-tuning-precise" />
<span>Precise Tweaking</span>
</label>
</div>
</label>
<p><strong>Quest type:</strong> <span id="out-quest-type"></span></p>
<p><strong>Tuning:</strong> <span id="out-effort-level"></span></p>
<p><strong>Gold each:</strong> <span id="out-gp-selected"></span></p>
<p id="out-itemloot-wrap"><strong>Item loot pool:</strong> <span id="out-itemloot"></span> <span class="muted">gp worth of items</span></p>
<p id="out-loot-note" class="fine-print"></p>
Expand Down
Loading