Skip to content

Commit e0762a9

Browse files
committed
v1.3
1 parent 97a1da1 commit e0762a9

9 files changed

Lines changed: 69 additions & 47 deletions

File tree

KTL/actionData.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -880,7 +880,7 @@ let actionData = {
880880
881881
I was terrified at the idea of trying to go against the lich, but I thought of how many lives had been sacrificed
882882
and ruined at the altar of this monstrosity's rampage. In what felt like such a short time, Overclock had grown far
883-
beyond what I had achieved to Get Safe, and I was ready I could bend fate in my favor to kill the lich.<br><br>
883+
beyond what I had achieved to Get Safe, and I was ready; I could bend fate in my favor to kill the lich.<br><br>
884884
885885
This time, however, I was going to go prepared; I knew Fate could only bend so far at a time. I had just received magic,
886886
and knew that all I needed was to show I had the power to help, and the War for Life would let me join.<br><br>
@@ -1160,7 +1160,7 @@ actionData = {
11601160
expAtts:[],
11611161
efficiencyAtts:[],
11621162
unlockMessage:{english:"On unlock, open Magic and +1 Legacy."},
1163-
onLevelText:{english:"Unlocks new actions with each level."}
1163+
onLevelText:{english:"Unlocks new actions with each level."},
11641164
},
11651165
talkWithScott: {
11661166
tier:1, plane:0, resourceName:"conversations",
@@ -1205,7 +1205,7 @@ actionData = {
12051205
tier:1, plane:0, resourceName:"conversations",
12061206
progressMaxBase:1000000, progressMaxIncrease:100,
12071207
expToLevelBase:1, expToLevelIncrease:1,
1208-
efficiencyBase:.3, maxLevel:20,
1208+
efficiencyBase:.3, maxLevel:10,
12091209
unlockCost:10, visible:false, unlocked:false, purchased: true,
12101210
onUnlock: function() {
12111211
unveilAction('chatWithMerchants')
@@ -3279,7 +3279,8 @@ actionData = {
32793279
},
32803280
onLevelAtts:[["wizardry", 10]],
32813281
expAtts:[["spellcraft", .1]],
3282-
efficiencyAtts:[["wizardry", .001]]
3282+
efficiencyAtts:[["wizardry", .001]],
3283+
extraInfo: {english:Raw.html`If an Overboost charge is available, the next Overcharge will be x10 effect.`}
32833284
},
32843285
overdrive: {
32853286
tier:0, plane:1, resourceName:"mana",

KTL/data/globalsAndInitial.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ data.options = {};
5353
data.options.updateRate = 20;
5454
data.options.autosaveRate = 10;
5555
data.options.bonusRate = 3;
56+
data.lastVisit = Date.now();
5657
let chartData = []; // Stores { time: number, value: number }
5758
let chartScale = 'linear'; // 'linear' or 'logarithmic'
5859

@@ -69,7 +70,7 @@ data.gameSettings = {
6970
viewRatio:false,
7071
viewAll0Buttons:false,
7172
viewTotalMomentum:false,
72-
numberType:"engineering",
73+
numberType:"numberSuffix",
7374
redeemedBonusCodes:{}
7475
};
7576

KTL/driver.js

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,13 @@ function setScreenSize() {
1313

1414
// --- Offline Time Calculation ---
1515
function checkOfflineProgress() {
16-
const lastVisit = localStorage.getItem('lastVisitTimestamp');
17-
if (lastVisit) {
18-
const offlineMilliseconds = Date.now() - parseInt(lastVisit, 10);
19-
if (offlineMilliseconds > 10000) { // 10-second threshold
16+
if (data.lastVisit) {
17+
const offlineMilliseconds = Date.now() - parseInt(data.lastVisit, 10);
18+
if (offlineMilliseconds > 5000) {
2019
data.currentGameState.bonusTime += offlineMilliseconds;
2120
console.log(`Welcome back! Gained ${(offlineMilliseconds / 1000).toFixed(1)}s of bonus time.`);
2221
}
2322
}
24-
window.addEventListener('beforeunload', () => {
25-
localStorage.setItem('lastVisitTimestamp', Date.now());
26-
});
2723
}
2824

2925
// --- Visual Rendering Loop ---
@@ -88,6 +84,7 @@ function secondPassed() {
8884

8985

9086
function gameTick() {
87+
data.lastVisit = Date.now();
9188
data.currentGameState.totalTicks++;
9289
data.gameSettings.ticksForSeconds++;
9390

@@ -273,8 +270,8 @@ function calculateTaken(actionVar, downstreamVar, actionObj, mult) {
273270

274271
let totalTakenMult = actionObj.tierMult() * (actionObj.efficiency / 100) * permFocusMult *
275272
(isAttentionLine(actionVar, downstreamVar) ? data.focusMult : 1);
276-
if (totalTakenMult > 0.1) {
277-
totalTakenMult = 0.1; // Cap at 10%/s
273+
if (totalTakenMult > 1) {
274+
totalTakenMult = 1; // Cap at 100%/s
278275
}
279276
let toReturn = actionObj.resource / data.gameSettings.ticksPerSecond * totalTakenMult * mult;
280277
return toReturn < .0000001 ? 0 : toReturn;

KTL/helpers/helpers.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -108,14 +108,13 @@ function formatEngineering(value) {
108108
const sign = value < 0 ? "-" : "";
109109

110110
if (absVal >= 1e5) {
111-
const exp = Math.floor(Math.log10(absVal) / 3) * 3; // exponent → multiple of 3
112-
const mantissa = absVal / Math.pow(10, exp); // scaled mantissa
113-
const mantStr = Number(mantissa.toFixed(2)).toString(); // round & strip trailing zeros
114-
return sign + mantStr + "e" + exp; // e.g. 5.19e6
111+
const exp = Math.floor(Math.log10(absVal) / 3) * 3;
112+
const mantissa = absVal / Math.pow(10, exp);
113+
const mantStr = Number(mantissa.toFixed(2)).toString();
114+
return sign + mantStr + "e" + exp;
115115
}
116116

117-
// Plain form for smaller numbers, still with ≤ 2 decimals
118-
return sign + Number(absVal.toFixed(2)).toString(); // e.g. 41894.69
117+
return sign + Number(absVal.toFixed(2)).toString();
119118
}
120119

121120

@@ -133,11 +132,12 @@ function intToString(value, amount, hideSmall) {
133132
value *= isNeg ? -1 : 1;
134133
if (value >= 10000) {
135134
value += .0000001; //anti floating point rounding issues
136-
if(data.gameSettings.numberType === "engineering") {
135+
if(data.gameSettings.numberType === "numberSuffix") {
137136
return (isNeg ? "-" : "") + nFormatter(value, 3);
138137
} else if(data.gameSettings.numberType === "scientific") {
138+
return (isNeg ? "-" : "") + Math.abs(value).toExponential(2).replace("+", "");
139+
} else if(data.gameSettings.numberType === "engineering") {
139140
return formatEngineering(value * (isNeg ? -1 : 1));
140-
141141
}
142142
}
143143
if (value >= 1000) { //1000 - 10000, should be 6,512 (.1) - 1 if base is > 2

KTL/index.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@
7171
View Amulet Upgrades!
7272
</span>
7373

74+
<span style="position:fixed;top:5px;right:5px;color:var(--text-muted)">v1.3</span>
75+
7476

7577
<div id="bonusDisplayShowButton" class="button" onclick="bonusMenuHideButton()"
7678
style="position:absolute;padding:8px 13px;left:10px;bottom:50px;font-size:14px;">

KTL/ktl.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ function initializeKTL() {
9191

9292
data.actions.overclockTargetingTheLich.resource = data.totalMomentum;
9393
data.actions.worry.resource = data.actions.hearAboutTheLich.resource;
94+
data.actions.overclockTargetingTheLich.updateMults();
9495

9596
views.updateVal("killTheLichMenu", "none", "style.display")
9697

KTL/menu.js

Lines changed: 37 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -262,27 +262,25 @@ function updatePreviousTipsMenu() {
262262
}
263263
function createOptionsMenu() {
264264
return Raw.html`
265-
<!--<div class='menuTitle'>Options</div>-->
266-
<!-- <div class='menuSeparator'></div>-->
267-
<!-- <div id='lightModeButton' onClick='changeDarkMode()' class='button' style='padding:10px;font-size:14px;width:200px;' >-->
268-
<!-- Change to Light Mode</div>-->
269-
<!-- <div id='numberTypeButton' onClick='changeNumberType()' class='button' style='padding:10px;font-size:14px;width:200px;' >-->
270-
<!-- Change numbers to scientific</div><br>-->
271-
265+
272266
<div style="max-width:680px;width:100%;box-sizing:border-box;padding:20px;display:flex;flex-direction:column;gap:20px;">
273267
274268
<div class="menuTitle" style="margin:0;font-size:20px;font-weight:bold;border-bottom:1px solid #aaa;padding-bottom:10px;">Options</div>
275269
276270
<div style="display:flex;flex-direction:column;gap:12px;">
271+
277272
<div style="display:flex;align-items:center;justify-content:space-between;">
278273
<span style="font-size:14px;">Number Notation</span>
279-
<div id="numberTypeSwitch" onclick="toggleNumberType()" style="position:relative;cursor:pointer;border:1px solid #aaa;border-radius:4px;padding:2px;width:200px;height:30px;">
280-
<div style="position:absolute;left:2px;top:2px;width:calc(50% - 2px);height:calc(100% - 4px);background:#ccc;border-radius:2px;z-index:1;"></div>
281-
<div style="position:relative;display:flex;z-index:2;height:100%;">
282-
<span style="flex:1;text-align:center;font-size:13px;font-weight:bold;line-height:26px;color:#000;">Engineering</span>
283-
<span style="flex:1;text-align:center;font-size:13px;font-weight:bold;line-height:26px;color:#000;">Scientific</span>
274+
275+
<div id="numberTypeSwitch" onclick="toggleNumberType()" style="position:relative;cursor:pointer;border:1px solid #aaa;border-radius:4px;padding:2px;width:300px;height:30px;">
276+
<div id="ntsSlider" style="position:absolute;left:0;top:2px;width:calc(33.333% - 2px);height:calc(100% - 4px);background:#ccc;border-radius:2px;z-index:1;"></div>
277+
<div style="position:relative;display:flex;z-index:2;height:100%;">
278+
<span style="flex:1;text-align:center;font-size:13px;font-weight:bold;line-height:26px;color:#000;">Engineering</span>
279+
<span style="flex:1;text-align:center;font-size:13px;font-weight:bold;line-height:26px;color:#000;">Scientific</span>
280+
<span style="flex:1;text-align:center;font-size:13px;font-weight:bold;line-height:26px;color:#000;">Suffix</span>
281+
</div>
284282
</div>
285-
</div>
283+
286284
</div>
287285
288286
<div style="display:flex;align-items:center;justify-content:space-between;">
@@ -379,26 +377,34 @@ function createOptionsMenu() {
379377

380378
function updateSliderDisplay(currentValue) {
381379
// recalcInterval(currentValue);
382-
data.gameSettings.ticksPerSecond = currentValue;
380+
data.gameSettings.ticksPerSecond = parseInt(currentValue);
383381
document.getElementById('sliderValue').textContent = currentValue;
384382
}
385383

386384
function changeNumberType() {
387-
if(data.gameSettings.numberType === "engineering") {
385+
if(data.gameSettings.numberType === "numberSuffix") {
388386
data.gameSettings.numberType = "scientific";
389387
} else if(data.gameSettings.numberType === "scientific") {
390-
data.gameSettings.numberType = "engineering";
388+
data.gameSettings.numberType = "numberSuffix";
391389
}
392390

393-
document.getElementById("numberTypeButton").textContent = "Change numbers to " + (data.gameSettings.numberType === "engineering"?"scientific":"engineering");
391+
document.getElementById("numberTypeButton").textContent = "Change numbers to " + (data.gameSettings.numberType === "numberSuffix"?"scientific":"numberSuffix");
394392
}
395393

396394
function toggleNumberType() {
397395
const el = document.getElementById('numberTypeSwitch');
398-
const slider = el.firstElementChild;
396+
const slider = document.getElementById('ntsSlider');
397+
398+
if (!window.data) { window.data = { gameSettings: { numberType: 'engineering' } }; }
399+
if (!data.gameSettings) { data.gameSettings = { numberType: 'engineering' }; }
400+
if (!data.gameSettings.numberType) { data.gameSettings.numberType = 'engineering'; }
401+
399402
if (data.gameSettings.numberType === 'engineering') {
400403
data.gameSettings.numberType = 'scientific';
401-
slider.style.left = '50%';
404+
slider.style.left = '33.333%';
405+
} else if (data.gameSettings.numberType === 'scientific') {
406+
data.gameSettings.numberType = 'numberSuffix';
407+
slider.style.left = '66.666%';
402408
} else {
403409
data.gameSettings.numberType = 'engineering';
404410
slider.style.left = '0';
@@ -569,7 +575,18 @@ function createChangelogMenu() {
569575
return Raw.html`
570576
<div class="menuTitle">Changelog</div>
571577
<div class="menuSeparator"></div><br>
572-
v1.2, 8/6 (current):<br>
578+
v1.3, 8/8 (current):<br>
579+
<ul>
580+
<li>When using amulet, the action menus will work immediately after</li>
581+
<li>Learn to Listen max level is 10 (will apply next amulet use)</li>
582+
<li>Offline time constantly saves instead of only when the page unloads</li>
583+
<li>Harvest Ghostly Field now saves properly</li>
584+
<li>Overclock Targeting the Lich now runs on first tick after KTL</li>
585+
<li>Sending resources caps at 100% now, not 10%. Removed info about it. This hopefully reduces confusion with the focus bars. TBD if this is too much</li>
586+
<li>FPS setting will save correclty</li>
587+
<li>Added version in top right</li>
588+
</ul><br>
589+
v1.2, 8/6:<br>
573590
<ul>
574591
<li>Removed the + in e for scientific notation</li>
575592
<li>Fixed filtering upgrades</li>

KTL/saving.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,9 @@ const patches = {
346346
},
347347
messenger: {
348348
preventReset: true,
349+
},
350+
harvestGhostlyField: {
351+
preventReset: true,
349352
}
350353

351354
},
@@ -453,7 +456,7 @@ function load() {
453456
data.maxFocusAllowed = toLoad.maxFocusAllowed ?? 3;
454457
data.focusMult = toLoad.focusMult ?? 2;
455458
data.focusLoopMax = toLoad.focusLoopMax ?? 2.5;
456-
data.gameSettings.ticksPerSecond = toLoad.ticksPerSecond ?? 20;
459+
data.lastVisit = toLoad.lastVisit ?? Date.now();
457460

458461
data.currentGameState = toLoad.currentGameState;
459462
// data.gameSettings = toLoad.gameSettings;

KTL/upgradeData.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -263,18 +263,18 @@ let upgradeData = {
263263
customInfo: function(num) {
264264
if(num === 0) {
265265
return Raw.html`Gain a rate of +1/hr to a Practice Mult on the flow you have Focused. The mult lasts until the amulet
266-
is used, and stacks with the Focus Mult. Maximum flow is still 10%/s. The Practice Mult will have a max of 2. `
266+
is used, and stacks with the Focus Mult. The Practice Mult will have a max of 2. `
267267
}
268268
if(num === 1) {
269269
return Raw.html`You have a rate of +1/hr to a Practice Mult on the flow you have Focused. This mult lasts until the amulet
270-
is used, and stacks with the Focus Mult. Maximum flow is still 10%/s. The Practice Mult currently has a max of 2. Gain +1.`
270+
is used, and stacks with the Focus Mult. The Practice Mult currently has a max of 2. Gain +1.`
271271
}
272272
if(num === 2) {
273273
return Raw.html`You have a rate of +1/hr to a Practice Mult on the flow you have Focused. This mult lasts until the amulet
274-
is used, and stacks with the Focus Mult. Maximum flow is still 10%/s. The Practice Mult currently has a max of 3. Gain +1.`
274+
is used, and stacks with the Focus Mult. The Practice Mult currently has a max of 3. Gain +1.`
275275
}
276276
return Raw.html`You have a rate of +1/hr to a Practice Mult on the flow you have Focused. This mult lasts until the amulet
277-
is used, and stacks with the Focus Mult. Maximum flow is still 10%/s. The Practice Mult currently has a max of 4.`
277+
is used, and stacks with the Focus Mult. The Practice Mult currently has a max of 4.`
278278
},
279279
onBuy: function(num) {
280280
data.focusLoopMax = 2 + num;

0 commit comments

Comments
 (0)