// Recalculate global bonuses from unlocked egos function refreshGlobalBonuses() clickBase = 1; autoPerSecond = 0; critPercent = 0; discountPercent = 0;
<script> // ---------- EGO DATA ---------- const EGOS = [ id: "innocent", name: "Innocent", icon: "🍃", desc: "Beginner's luck", baseBonus: clickGain: 1 , cost: 25, unlocked: false , id: "seeker", name: "Seeker", icon: "🔍", desc: "Attuned to flow", baseBonus: autoGen: 0.8 , cost: 100, unlocked: false , id: "judge", name: "Judge", icon: "⚖️", desc: "Precision soul", baseBonus: critChance: 15 , cost: 400, unlocked: false , // crit chance percent id: "shadow", name: "Shadow", icon: "🌑", desc: "Essence discount", baseBonus: discountPercent: 20 , cost: 1200, unlocked: false ]; aka altar ego
// Update UI numbers on stats panel function updateStatsUI() document.getElementById("clickPowerStat").innerText = clickBase; document.getElementById("autoStat").innerText = autoPerSecond.toFixed(1); document.getElementById("critStat").innerText = critPercent + "%"; // Recalculate global bonuses from unlocked egos function
// Click handling with crit function handleClick() let gain = clickBase; let isCrit = false; if (critPercent > 0) const roll = Math.random() * 100; if (roll <= critPercent) gain = gain * 2; isCrit = true; essence += gain; updateEssenceUI(); if (isCrit) playFloatingText(`⚡ CRIT! +$gain essence`); // quick flash const flameDiv = document.getElementById("clickFlame"); flameDiv.style.boxShadow = "0 0 35px #ffaa55"; setTimeout(() => if(flameDiv) flameDiv.style.boxShadow = "0 0 20px #ff884d"; , 150); saveGame(); autoPerSecond = 0
// tiny floating effect (simple) function playFloatingText(msg) const flame = document.getElementById("clickFlame"); const span = document.createElement("div"); span.innerText = msg; span.style.position = "fixed"; span.style.left = "50%"; span.style.bottom = "40%"; span.style.transform = "translateX(-50%)"; span.style.background = "#000000aa"; span.style.color = "#ffd58c"; span.style.padding = "6px 16px"; span.style.borderRadius = "40px"; span.style.fontSize = "0.9rem"; span.style.backdropFilter = "blur(8px)"; span.style.zIndex = "999"; span.style.pointerEvents = "none"; span.style.transition = "opacity 1s ease, transform 0.8s"; document.body.appendChild(span); setTimeout(() => span.style.opacity = "0"; span.style.transform = "translateX(-50%) translateY(-40px)"; setTimeout(() => span.remove(), 1000); , 50);
function updateEssenceUI() const essenceElem = document.getElementById("essenceAmount"); if (essenceElem) essenceElem.innerText = Math.floor(essence);