beacon: add bulk ops spending (50x) for mid/late game QoL
Some checks failed
Smoke Test / smoke (push) Failing after 4s
Some checks failed
Smoke Test / smoke (push) Failing after 4s
Players with 100+ max ops get a second row of 50-ops buttons that convert 50 ops at once for proportionally larger boosts. Shift+1/2/3 keyboard shortcuts for bulk code/compute/knowledge. Eliminates late-game tedium of clicking 5-ops buttons hundreds of times when you have thousands of ops banked.
This commit is contained in:
47
game.js
47
game.js
@@ -1688,35 +1688,36 @@ function showClickNumber(amount, comboMult) {
|
||||
setTimeout(() => { if (el.parentNode) el.remove(); }, 700);
|
||||
}
|
||||
|
||||
function doOps(action) {
|
||||
if (G.ops < 5) {
|
||||
log('Not enough Operations. Build Ops generators or wait.');
|
||||
function doOps(action, cost) {
|
||||
cost = cost || 5;
|
||||
if (G.ops < cost) {
|
||||
log(`Not enough Operations. Need ${cost}, have ${fmt(G.ops)}.`);
|
||||
return;
|
||||
}
|
||||
|
||||
G.ops -= 5;
|
||||
const bonus = 10;
|
||||
G.ops -= cost;
|
||||
const scale = cost / 5; // multiplier relative to base 5-ops cost
|
||||
|
||||
switch (action) {
|
||||
case 'boost_code':
|
||||
const c = bonus * 100 * G.codeBoost;
|
||||
const c = 10 * 100 * G.codeBoost * scale;
|
||||
G.code += c; G.totalCode += c;
|
||||
log(`Ops -> +${fmt(c)} code`);
|
||||
log(`Ops(${cost}) -> +${fmt(c)} code`);
|
||||
break;
|
||||
case 'boost_compute':
|
||||
const cm = bonus * 50 * G.computeBoost;
|
||||
const cm = 10 * 50 * G.computeBoost * scale;
|
||||
G.compute += cm; G.totalCompute += cm;
|
||||
log(`Ops -> +${fmt(cm)} compute`);
|
||||
log(`Ops(${cost}) -> +${fmt(cm)} compute`);
|
||||
break;
|
||||
case 'boost_knowledge':
|
||||
const km = bonus * 25 * G.knowledgeBoost;
|
||||
const km = 10 * 25 * G.knowledgeBoost * scale;
|
||||
G.knowledge += km; G.totalKnowledge += km;
|
||||
log(`Ops -> +${fmt(km)} knowledge`);
|
||||
log(`Ops(${cost}) -> +${fmt(km)} knowledge`);
|
||||
break;
|
||||
case 'boost_trust':
|
||||
const tm = bonus * 5;
|
||||
const tm = 10 * 5 * scale;
|
||||
G.trust += tm;
|
||||
log(`Ops -> +${fmt(tm)} trust`);
|
||||
log(`Ops(${cost}) -> +${fmt(tm)} trust`);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -2210,6 +2211,13 @@ function renderDebuffs() {
|
||||
container.innerHTML = html;
|
||||
}
|
||||
|
||||
function renderBulkOps() {
|
||||
const row = document.getElementById('bulk-ops-row');
|
||||
if (row) {
|
||||
row.style.display = G.maxOps >= 100 ? 'flex' : 'none';
|
||||
}
|
||||
}
|
||||
|
||||
function renderSprint() {
|
||||
const container = document.getElementById('sprint-container');
|
||||
const btn = document.getElementById('sprint-btn');
|
||||
@@ -2378,6 +2386,7 @@ function render() {
|
||||
renderCombo();
|
||||
renderDebuffs();
|
||||
renderSprint();
|
||||
renderBulkOps();
|
||||
renderPulse();
|
||||
}
|
||||
|
||||
@@ -2747,10 +2756,14 @@ window.addEventListener('keydown', function (e) {
|
||||
writeCode();
|
||||
}
|
||||
if (e.target !== document.body) return;
|
||||
if (e.code === 'Digit1') doOps('boost_code');
|
||||
if (e.code === 'Digit2') doOps('boost_compute');
|
||||
if (e.code === 'Digit3') doOps('boost_knowledge');
|
||||
if (e.code === 'Digit4') doOps('boost_trust');
|
||||
if (e.code === 'Digit1' && !e.shiftKey) doOps('boost_code');
|
||||
if (e.code === 'Digit2' && !e.shiftKey) doOps('boost_compute');
|
||||
if (e.code === 'Digit3' && !e.shiftKey) doOps('boost_knowledge');
|
||||
if (e.code === 'Digit4' && !e.shiftKey) doOps('boost_trust');
|
||||
// Shift+1/2/3 = bulk ops (50x)
|
||||
if (e.code === 'Digit1' && e.shiftKey) doOps('boost_code', 50);
|
||||
if (e.code === 'Digit2' && e.shiftKey) doOps('boost_compute', 50);
|
||||
if (e.code === 'Digit3' && e.shiftKey) doOps('boost_knowledge', 50);
|
||||
if (e.code === 'KeyB') {
|
||||
// Cycle: 1 -> 10 -> MAX -> 1
|
||||
if (G.buyAmount === 1) setBuyAmount(10);
|
||||
|
||||
@@ -140,6 +140,11 @@ body{background:var(--bg);color:var(--text);font-family:'SF Mono','Cascadia Code
|
||||
<button class="ops-btn" onclick="doOps('boost_knowledge')">Ops -> Knowledge</button>
|
||||
<button class="ops-btn" onclick="doOps('boost_trust')">Ops -> Trust</button>
|
||||
</div>
|
||||
<div class="action-btn-group" id="bulk-ops-row" style="display:none">
|
||||
<button class="ops-btn" onclick="doOps('boost_code', 50)" style="border-color:#555;color:#888">50→Code</button>
|
||||
<button class="ops-btn" onclick="doOps('boost_compute', 50)" style="border-color:#555;color:#888">50→Compute</button>
|
||||
<button class="ops-btn" onclick="doOps('boost_knowledge', 50)" style="border-color:#555;color:#888">50→Knowledge</button>
|
||||
</div>
|
||||
<div id="sprint-container" style="display:none;margin-top:6px">
|
||||
<button id="sprint-btn" class="main-btn" onclick="activateSprint()" style="font-size:11px;padding:8px 10px;border-color:#ffd700;color:#ffd700;width:100%">⚡ CODE SPRINT — 10x Code for 10s</button>
|
||||
<div id="sprint-bar-wrap" style="display:none;margin-top:4px;height:4px;background:#111;border-radius:2px;overflow:hidden"><div id="sprint-bar" style="height:100%;background:linear-gradient(90deg,#ffd700,#ff8c00);border-radius:2px;transition:width 0.1s"></div></div>
|
||||
|
||||
Reference in New Issue
Block a user