Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bundle of small fixes #612

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
Open
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
5 changes: 2 additions & 3 deletions Synergism.css
Original file line number Diff line number Diff line change
Expand Up @@ -1832,9 +1832,8 @@ p#reincarnatehotkeys {

#researchToggles {
display: flex;
flex-direction: row;
flex-flow: row wrap;
justify-content: center;
flex-flow: wrap;
gap: 10px 15px;
margin: 15px 0;
}
Expand Down Expand Up @@ -2223,7 +2222,7 @@ p#reincarnatehotkeys {
display: flex;
flex-direction: column;
align-items: center;
width: 126%;
width: 130%;
}

.cubeToQuark {
Expand Down
7 changes: 3 additions & 4 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@

<div class="buttonRow">
<div>
<img id="particles1" alt="Proton" src="Pictures/Default/ParticlesTier1.png" loading="lazy">
<img id="particles1" alt="Proton" class="image" src="Pictures/Default/ParticlesTier1.png" loading="lazy">
<span id="reincarnationtext1" class="desc">Protons: 0 [+0]</span>
<button id="buyparticles1" class="buildingPurchaseBtn">Cost: 1 Particles</button>
<button class="auto autobuyerToggleButton" id="toggle22" toggleid="22"></button>
Expand Down Expand Up @@ -1189,7 +1189,7 @@
<div id="runes" style="display: none;">
<div id="runesToggle">
<button id="toggleautosacrifice" style="border: 2px solid orangered"></button>
<button id="toggleRuneSubTab1" style="border: 2px solid gold" i18n="tabs.runes.runes"></button>
<button id="toggleRuneSubTab1" style="border: 2px solid gold; background-color: crimson;" i18n="tabs.runes.runes"></button>
<button class="chal9" id="toggleRuneSubTab2" style="border: 2px solid silver" i18n="tabs.runes.talismans"></button>
<button class="chal9" id="toggleRuneSubTab3" style="border: 2px solid silver" i18n="tabs.runes.blessings"></button>
<button class="chal12" id="toggleRuneSubTab4" style="border: 2px solid silver" i18n="tabs.runes.spirits"></button>
Expand Down Expand Up @@ -2785,7 +2785,7 @@
<div id="traits" style="display: none;">
<div id="corruptionStatsLoadouts" class="flex column">
<span id="corrButtonRow" class="flex row center">
<button id="corrStatsBtn" i18n="corruptions.corrStatsBtn"></button>
<button id="corrStatsBtn" style="background-color: mediumblue;" i18n="corruptions.corrStatsBtn"></button>
<button id="corrLoadoutsBtn" i18n="corruptions.corrLoadoutsBtn"></button>
</span>
<div id="corruptionStats" class="corruptionContainer">
Expand Down Expand Up @@ -3506,7 +3506,6 @@ <h1>Artists</h1>
<p id="statOcM32" class="statPortion singularity"> <span id="sOcM32" class="statNumber">0</span></p>
<p id="statOcM33" class="statPortion singularity"> <span id="sOcM33" class="statNumber">0</span></p>
<p id="statOcM34" class="statPortion singularity"> <span id="sOcM34" class="statNumber">0</span></p>
<p id="statOcM35" class="statPortion singularity"> <span id="sOcM35" class="statNumber">0</span></p>
<p id="statOcMT" class="statPortion statTotal" style="color: orange">TOTAL OCTERACT MULTIPLIER: <span
id="sOcMT" class="statNumber statTotal">0</span></p>
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/Ants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ export const updateAntDescription = (i: number) => {
}

const getAntCost = (originalCost: Decimal, buyTo: number, index: number) => {
;--buyTo
buyTo--

// Determine how much the cost is for buyTo
const cost = originalCost
Expand All @@ -144,7 +144,7 @@ const getAntCost = (originalCost: Decimal, buyTo: number, index: number) => {
}

const getAntUpgradeCost = (originalCost: Decimal, buyTo: number, index: number) => {
;--buyTo
buyTo--

const cost = originalCost.times(Decimal.pow(G.antUpgradeCostIncreases[index - 1], buyTo))
return cost
Expand Down
18 changes: 9 additions & 9 deletions src/Buy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const getReductionValue = () => {
}

const getCostAccelerator = (buyingTo: number): Decimal => {
;--buyingTo
buyingTo--

const originalCost = 500
let cost = new Decimal(originalCost)
Expand Down Expand Up @@ -169,7 +169,7 @@ export const buyAccelerator = (autobuyer?: boolean) => {
}

const getCostMultiplier = (buyingTo: number): Decimal => {
;--buyingTo
buyingTo--

const originalCost = 1e4
let cost = new Decimal(originalCost)
Expand Down Expand Up @@ -378,7 +378,7 @@ const getCostInternal = (
r: number
): Decimal => {
// It's 0 indexed by mistake so you have to subtract 1 somewhere.
;--buyingTo
buyingTo--
const buymax = Math.pow(10, 15)
// Accounts for the multiplies by 1.25^num buyingTo times
const cost = new Decimal(originalCost)
Expand All @@ -392,15 +392,15 @@ const getCostInternal = (
let fr = Math.floor(r * 1000)
if (buyingTo >= r * 1000) {
// This code is such a mess at this point, just know that this is equivalent to what it was before
;++fastFactMultBuyTo
fastFactMultBuyTo++
cost.exponent -= factorialByExponent(fr)
cost.exponent += (-3 + Math.log10(1 + (num / 2))) * (buyingTo - fr)
}

fr = Math.floor(r * 5000)
if (buyingTo >= r * 5000) {
// This code is such a mess at this point, just know that this is equivalent to what it was before
;++fastFactMultBuyTo
fastFactMultBuyTo++
cost.exponent -= factorialByExponent(fr)
cost.exponent += ((known_log10s[10 + num * 10] + 1) * (buyingTo - fr - 1)) + 1
}
Expand Down Expand Up @@ -432,7 +432,7 @@ const getCostInternal = (
if ((player.currentChallenge.transcension === 4) && (type === 'Coin' || type === 'Diamonds')) {
// you would not fucking believe how long it took me to figure this out
// (100*costofcurrent + 10000)^n = (((100+buyingTo)!/100!)*100^buyingTo)^n
;++fastFactMultBuyTo100
fastFactMultBuyTo100++
if (buyingTo >= (1000 - (10 * player.challengecompletions[4]))) {
// and I changed this to be a summation of all the previous buys 1.25 to the sum from 1 to buyingTo
mlog10125 += buyingTo * (buyingTo + 1) / 2
Expand All @@ -441,7 +441,7 @@ const getCostInternal = (
if ((player.currentChallenge.reincarnation === 10) && (type === 'Coin' || type === 'Diamonds')) {
// you would not fucking believe how long it took me to figure this out
// (100*costofcurrent + 10000)^n = (((100+buyingTo)!/100!)*100^buyingTo)^n
;++fastFactMultBuyTo100
fastFactMultBuyTo100++
if (buyingTo >= (r * 25000)) {
// and I changed this to be a summation of all the previous buys 1.25 to the sum from 1 to buyingTo
mlog10125 += buyingTo * (buyingTo + 1) / 2
Expand Down Expand Up @@ -887,7 +887,7 @@ const getAcceleratorBoostCost = (level = 1): Decimal => {
}

const getParticleCost = (originalCost: DecimalSource, buyTo: number): Decimal => {
;--buyTo
buyTo--
originalCost = new Decimal(originalCost)
let cost = originalCost.times(Decimal.pow(2, buyTo))

Expand Down Expand Up @@ -972,7 +972,7 @@ export const buyParticleBuilding = (

if (!autobuyer) {
if (player.particlebuyamount + buyStart < buyTo) {
buyTo = buyStart + player.particlebuyamount + smallestInc(player[key] + player.particlebuyamount)
buyTo = buyStart + player.particlebuyamount - 1 + smallestInc(player[key] + player.particlebuyamount)
}
}

Expand Down
15 changes: 11 additions & 4 deletions src/Calculate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1350,6 +1350,17 @@ export const calculateOffline = async (forceTime = 0) => {
disableHotkeys()

G.timeWarp = true
const offlineDialog = player.offlinetick > 0

if (player.offlinetick === 0) {
const startTime = Date.now()
player.offlinetick = startTime
player.prestigecounter = startTime
player.transcendcounter = startTime
player.reincarnationcounter = startTime
player.ascensionCounter = startTime
player.singularityCounter = startTime
}

// Variable Declarations i guess
const maximumTimer = 86400 * 3
Expand All @@ -1373,10 +1384,6 @@ export const calculateOffline = async (forceTime = 0) => {
toggleTalismanBuy(player.buyTalismanShardPercent)
updateTalismanInventory()

const offlineDialog = player.offlinetick > 0

player.offlinetick = player.offlinetick < 1.5e12 ? Date.now() : player.offlinetick

G.timeMultiplier = calculateTimeAcceleration().mult
calculateObtainium()
const obtainiumGain = calculateAutomaticObtainium()
Expand Down
5 changes: 3 additions & 2 deletions src/Challenges.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ export const challengeDisplay = (i: number, changefocus = true) => {
}
case 2: {
current1 = current2 = format(5 * CalcECC('transcend', player.challengecompletions[2]))
current3 = format(0.25 * CalcECC('transcend', player.challengecompletions[2]), 2, true)
break
}
case 3: {
Expand Down Expand Up @@ -414,7 +415,7 @@ export const calculateChallengeRequirementMultiplier = (
switch (type) {
case 'transcend':
requirementMultiplier *= G.challenge15Rewards.transcendChallengeReduction
;(completions >= 75)
completions >= 75
? requirementMultiplier *= Math.pow(1 + completions, 12) / Math.pow(75, 8)
: requirementMultiplier *= Math.pow(1 + completions, 2)

Expand Down Expand Up @@ -485,7 +486,7 @@ export const calculateChallengeRequirementMultiplier = (
return requirementMultiplier
case 'ascension':
if (special !== 15) {
;(completions >= 10)
completions >= 10
? requirementMultiplier *= 2 * (1 + completions) - 10
: requirementMultiplier *= 1 + completions
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/Hepteracts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ export class HepteractCraft {
if ((player[item] as number) < 0) {
;(player[item] as number) = 0
} else if (player[item] instanceof Cube) {
;(player[item] as Cube).sub(
<Cube> player[item].sub(
amountToCraft * craftCostMulti * this.OTHER_CONVERSIONS[item]!
)
} else if (item === 'worlds') {
Expand Down
12 changes: 8 additions & 4 deletions src/Hotkeys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,11 @@ const eventHotkeys = (event: KeyboardEvent): void => {
keyPrefix += 'ALT+'
}

const key = keyPrefix + event.key.toUpperCase()
let actual = ''
if (event.key !== 'Control' && event.key !== 'Shift' && event.key !== 'Alt') {
actual = event.key.toUpperCase()
}
const key = keyPrefix + actual

// Disable the TAB key as it may allow unexpected operations
if (key === 'TAB') {
Expand All @@ -115,7 +119,7 @@ const eventHotkeys = (event: KeyboardEvent): void => {
event.preventDefault()
}

if (G.currentTab === Tabs.Settings && player.subtabNumber === 6) {
if (G.currentTab === Tabs.Settings && G.currentSubTab === 7) {
DOMCacheGetOrSet('lastHotkey').textContent = key
DOMCacheGetOrSet('lastHotkeyName').textContent = hotkeyName
}
Expand Down Expand Up @@ -259,7 +263,7 @@ export const pressedKeys = new Set<string>()
document.addEventListener('keydown', (event) => {
eventHotkeys(event)

pressedKeys.add(event.code)
pressedKeys.add(event.key)
})

document.addEventListener('keyup', (event) => pressedKeys.delete(event.code))
document.addEventListener('keyup', (event) => pressedKeys.delete(event.key))
5 changes: 3 additions & 2 deletions src/ImportExport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ const getRealTime = (type = 'default', use12 = false) => {
export const updateSaveString = (input: HTMLInputElement) => {
const value = input.value.slice(0, 100)
player.saveString = value === '' ? blankSave.saveString : cleanString(value)
;(DOMCacheGetOrSet('saveStringInput') as HTMLInputElement).value = player.saveString
getElementById<HTMLInputElement>('saveStringInput').value = player.saveString
}

export const getVer = () => /[\d?=.]+/.exec(version)?.[0] ?? version
Expand Down Expand Up @@ -1152,10 +1152,11 @@ const dailyCodeFormatFreeLevelMessage = (
upgradeKey: string,
freeLevelAmount: number
): string => {
const accuracy = Number.isInteger(freeLevelAmount) ? 0 : 2
const upgradeNiceName = upgradeKey in singularityData
? i18next.t(`singularity.data.${upgradeKey}.name`)
: i18next.t(`octeract.data.${upgradeKey}.name`)
return `\n+${format(freeLevelAmount, 0, true)} extra levels of '${upgradeNiceName}'`
return `\n+${format(freeLevelAmount, accuracy, true)} extra levels of '${upgradeNiceName}'`
}

const dailyCodeReward = () => {
Expand Down
10 changes: 5 additions & 5 deletions src/Plugins/Dashboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -209,14 +209,14 @@ const renderDashboardFast = () => {

const openDashboard = () => {
// compute blessings total amounts
const n = player.subtabNumber
const n = G.currentSubTab
G.currentTab = Tabs.WowCubes
;[0, 1, 2, 3].forEach((i) => {
player.subtabNumber = i
for (const i of [0, 1, 2, 3]) {
G.currentSubTab = i
visualUpdateCubes()
})
}
G.currentTab = Tabs.Settings
player.subtabNumber = n
G.currentSubTab = n
// render and display dashboard
renderDashboardFast()
renderDashboardSlow()
Expand Down
23 changes: 11 additions & 12 deletions src/Reset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export const resetdetails = (input: resetNames) => {
resetObtainiumText.textContent = ''
}

;(input === 'ascensionChallenge' || input === 'ascension' || input === 'singularity')
input === 'ascensionChallenge' || input === 'ascension' || input === 'singularity'
? offeringImage.style.display = offeringText.style.display = 'none'
: offeringImage.style.display = offeringText.style.display = 'block'

Expand Down Expand Up @@ -211,41 +211,41 @@ export const resetdetails = (input: resetNames) => {
export const updateAutoReset = (i: number) => {
let value = null
if (i === 1) {
value = Number.parseFloat((DOMCacheGetOrSet('prestigeamount') as HTMLInputElement).value) || 0
value = Number.parseFloat(getElementById<HTMLInputElement>('prestigeamount').value) || 0
player.prestigeamount = Math.max(value, 0)
} else if (i === 2) {
value = Number.parseFloat((DOMCacheGetOrSet('transcendamount') as HTMLInputElement).value) || 0
value = Number.parseFloat(getElementById<HTMLInputElement>('transcendamount').value) || 0
player.transcendamount = Math.max(value, 0)
} else if (i === 3) {
value = Number.parseFloat((DOMCacheGetOrSet('reincarnationamount') as HTMLInputElement).value) || 0
value = Number.parseFloat(getElementById<HTMLInputElement>('reincarnationamount').value) || 0
player.reincarnationamount = Math.max(value, 0)
} else if (i === 4) {
value = Math.floor(Number.parseFloat((DOMCacheGetOrSet('ascensionAmount') as HTMLInputElement).value)) || 1
value = Math.floor(Number.parseFloat(getElementById<HTMLInputElement>('ascensionAmount').value)) || 1
player.autoAscendThreshold = Math.max(value, 1)
} else if (i === 5) {
value = Number.parseFloat((DOMCacheGetOrSet('autoAntSacrificeAmount') as HTMLInputElement).value) || 0
value = Number.parseFloat(getElementById<HTMLInputElement>('autoAntSacrificeAmount').value) || 0
player.autoAntSacTimer = Math.max(value, 0)
}
}

export const updateTesseractAutoBuyAmount = () => {
const value = Math.floor(Number.parseFloat((DOMCacheGetOrSet('tesseractAmount') as HTMLInputElement).value)) || 0
const value = Math.floor(Number.parseFloat(getElementById<HTMLInputElement>('tesseractAmount').value)) || 0
player.tesseractAutoBuyerAmount = Math.max(value, 0)
}

export const updateAutoCubesOpens = (i: number) => {
let value = null
if (i === 1) {
value = Number((DOMCacheGetOrSet('cubeOpensInput') as HTMLInputElement).value) || 0
value = Number(getElementById<HTMLInputElement>('cubeOpensInput').value) || 0
player.openCubes = Math.max(Math.min(value, 100), 0)
} else if (i === 2) {
value = Number((DOMCacheGetOrSet('tesseractsOpensInput') as HTMLInputElement).value) || 0
value = Number(getElementById<HTMLInputElement>('tesseractsOpensInput').value) || 0
player.openTesseracts = Math.max(Math.min(value, 100), 0)
} else if (i === 3) {
value = Number((DOMCacheGetOrSet('hypercubesOpensInput') as HTMLInputElement).value) || 0
value = Number(getElementById<HTMLInputElement>('hypercubesOpensInput').value) || 0
player.openHypercubes = Math.max(Math.min(value, 100), 0)
} else if (i === 4) {
value = Number((DOMCacheGetOrSet('platonicCubeOpensInput') as HTMLInputElement).value) || 0
value = Number(getElementById<HTMLInputElement>('platonicCubeOpensInput').value) || 0
player.openPlatonicsCubes = Math.max(Math.min(value, 100), 0)
}
}
Expand Down Expand Up @@ -1235,7 +1235,6 @@ export const singularity = async (setSingNumber = -1): Promise<void> => {
hold.saveString = player.saveString
hold.corruptionLoadouts = player.corruptionLoadouts
hold.corruptionLoadoutNames = player.corruptionLoadoutNames
hold.corruptionShowStats = player.corruptionShowStats
hold.toggles = player.toggles
hold.retrychallenges = player.retrychallenges
hold.resettoggle1 = player.resettoggle1
Expand Down
Loading
Loading