Skip to content

Commit

Permalink
Merge branch 'master' into pixel-update
Browse files Browse the repository at this point in the history
  • Loading branch information
Pseudonian committed Jun 29, 2024
2 parents 78d07b4 + af9f0c9 commit 0e47c9c
Show file tree
Hide file tree
Showing 58 changed files with 2,738 additions and 2,471 deletions.
File renamed without changes
Binary file added Pictures/patreon-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions Sample_Saves/Synergism2.5 - (1) c10 completed.txt

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions Sample_Saves/Synergism2.5 - (10) Omega completed.txt

Large diffs are not rendered by default.

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions Sample_Saves/Synergism2.5 - (2) c11 completed.txt

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions Sample_Saves/Synergism2.5 - (3)c14 completed.txt

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions Sample_Saves/Synergism2.5 - (4) w5x10 completed.txt

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions Sample_Saves/Synergism2.5 - (5) Alpha completed.txt

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions Sample_Saves/Synergism2.5 - (6) p2x1 completed.txt

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions Sample_Saves/Synergism2.5 - (7) p3x1 completed.txt

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions Sample_Saves/Synergism2.5 - (8) Beta completed.txt

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions Sample_Saves/Synergism2.5 - (9) 1e15 c15 expo.txt

Large diffs are not rendered by default.

93 changes: 79 additions & 14 deletions Synergism.css
Original file line number Diff line number Diff line change
Expand Up @@ -1564,6 +1564,26 @@ p#transcendhotkeys {
padding: 0;
}

#challengesTabsToggle {
display: flex;
justify-content: center;
flex-flow: wrap;
margin-top: 15px;
margin-bottom: 10px;
gap: 10px 15px;
}

#challengesTabsToggle > button {
min-width: 100px;
text-align: center;
}

.singularityChallenges {
display: flex;
justify-content: center;
column-gap: 4px;
}

#challengesWrapper {
display: flex;
flex-direction: column;
Expand All @@ -1573,14 +1593,23 @@ p#transcendhotkeys {
#challengeIntroduction {
text-align: center;
font-size: 1.2em;
margin: 20px 0 0;
margin-top: 10px;
margin-bottom: 10px;
}

#ExaltIntroduction {
text-align: center;
font-size: 1.2em;
margin-top: 10px;
margin-bottom: 10px;
}

#challengesAutoToggles {
display: flex;
justify-content: center;
flex-flow: wrap;
gap: 10px 15px;
margin-bottom: 10px;
}

#challengesAutoToggles > button {
Expand Down Expand Up @@ -1641,10 +1670,11 @@ p#transcendhotkeys {
}

#challengeDetails {
display: flex;
display: grid;
grid-template-columns: repeat(2, auto);
justify-content: center;
max-width: 1200px;
align-self: center;
margin-top: 10px;
}

#challengeTimers {
Expand Down Expand Up @@ -3557,12 +3587,6 @@ header #obtainiumDisplay { color: pink; }
border: 2px solid blue;
}

.singularityChallenges {
display: flex;
justify-content: center;
column-gap: 4px;
}

.rainbowBorder {
width: 64px;
height: 64px;
Expand All @@ -3582,6 +3606,11 @@ header #obtainiumDisplay { color: pink; }
border-radius: 3px;
}

.rainbowBorder:hover {
cursor: pointer;
background-color: var(--hover-color);
}

.rainbowBorder::before {
position: absolute;
width: 150%; /* 96px */
Expand Down Expand Up @@ -3679,13 +3708,49 @@ img#singularityPerksIcon {
}

#singularityChallengeDetails {
width: 50%;
margin-left: 25%;
display: block;
}

#singularityChallengesMultiline {
#singularityChallengesInfo {
white-space: pre-line;
margin: 15px 0 0;
margin-top: 10px;
margin-bottom: 5px;
text-align: center;
}

#singularityChallengeAllRewards {
display: grid;
grid-template-rows: repeat(2, auto);
grid-template-columns: repeat(2, 375px);
justify-content: center;
grid-gap: 10px;
}

#singularityChallengeScalingHeader {
font-weight: bold;
font-size: 1.2em;
text-align: center;
margin: 0;
}

#singularityChallengeUniqueHeader {
font-weight: bold;
font-size: 1.2em;
text-align: center;
margin: 0;
}

#singularityChallengesScalingRewards {
display: block;
white-space: pre-line;
margin: 0;
text-align: center;
}

#singularityChallengesUniqueRewards {
display: block;
white-space: pre-line;
margin: 0;
}

.newPerk {
Expand Down Expand Up @@ -3813,7 +3878,7 @@ img#singularityPerksIcon {
padding-top: 10px;
}

#accountSubTab > div.scrollbarX > img#discord-logo {
#accountSubTab > div.scrollbarX > img {
/* A 1.3 width x height ratio */
width: 96px;
height: 72px;
Expand Down
293 changes: 183 additions & 110 deletions index.html

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,14 @@
"eventemitter3": "^4.0.7",
"i18next": "^22.4.9",
"localforage": "^1.10.0",
"lodash.clonedeepwith": "^4.5.0",
"lz-string": "^1.4.4",
"worker-timers": "^7.0.53"
"worker-timers": "^7.0.53",
"zod": "^3.23.8"
},
"devDependencies": {
"@biomejs/biome": "^1.4.1",
"@types/lodash.clonedeepwith": "^4.5.9",
"@types/lz-string": "^1.3.34",
"deep-object-diff": "^1.1.9",
"dprint": "^0.45.0",
Expand Down
43 changes: 27 additions & 16 deletions src/BlueberryUpgrades.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import i18next from 'i18next'
import { DOMCacheGetOrSet } from './Cache/DOM'
import { calculateAmbrosiaGenerationSpeed, calculateAmbrosiaLuck } from './Calculate'
import { DynamicUpgrade } from './DynamicUpgrade'
import type { IUpgradeData } from './DynamicUpgrade'
import { exportData, saveFilename } from './ImportExport'
import { format, player } from './Synergism'
import type { Player } from './types/Synergism'
import { Alert, Confirm, Prompt } from './UpdateHTML'
import { visualUpdateAmbrosia, visualUpdateProgressPixels } from './UpdateVisuals'
import { visualUpdateAmbrosia } from './UpdateVisuals'
import { Globals as G } from './Variables'

export type blueberryUpgradeNames =
| 'ambrosiaTutorial'
Expand Down Expand Up @@ -123,7 +125,7 @@ export class BlueberryUpgrade extends DynamicUpgrade {
break
} else {
if (this.level === 0) {
const availableBlueberries = player.caches.blueberryInventory.totalVal - player.spentBlueberries
const availableBlueberries = G.ambrosiaCurrStats.ambrosiaBlueberries - player.spentBlueberries
if (availableBlueberries < this.blueberryCost) {
return Alert(i18next.t('ambrosia.notEnoughBlueberries'))
} else {
Expand Down Expand Up @@ -286,7 +288,7 @@ export class BlueberryUpgrade extends DynamicUpgrade {
}

public get rewardDesc (): string {
const effectiveLevel = (player.singularityChallenges.noAmbrosiaUpgrades.enabled) ? 0: this.level
const effectiveLevel = (player.singularityChallenges.noAmbrosiaUpgrades.enabled) ? 0 : this.level
if ('desc' in this.rewards(0)) {
return String(this.rewards(effectiveLevel).desc)
} else {
Expand All @@ -295,7 +297,7 @@ export class BlueberryUpgrade extends DynamicUpgrade {
}

public get bonus () {
const effectiveLevel = (player.singularityChallenges.noAmbrosiaUpgrades.enabled) ? 0: this.level
const effectiveLevel = (player.singularityChallenges.noAmbrosiaUpgrades.enabled) ? 0 : this.level
return this.rewards(effectiveLevel)
}
}
Expand Down Expand Up @@ -392,8 +394,9 @@ export const blueberryUpgradeData: Record<
ambrosiaTutorial: 10
},
cacheUpdates: [
() => player.caches.ambrosiaLuck.updateVal('BlueberryUpgrade1'),
() => player.caches.ambrosiaLuck.updateVal('BlueberryUpgrade2')
() => {
G.ambrosiaCurrStats.ambrosiaLuck = calculateAmbrosiaLuck().value
}
]
},
ambrosiaQuarkCube1: {
Expand Down Expand Up @@ -431,7 +434,7 @@ export const blueberryUpgradeData: Record<
},
rewards: (n: number) => {
const baseVal = 0.0002 * n
const val = 1 + baseVal * player.caches.ambrosiaLuck.usedTotal
const val = 1 + baseVal * G.ambrosiaCurrStats.ambrosiaLuck
return {
cubes: val,
desc: String(
Expand Down Expand Up @@ -488,9 +491,9 @@ export const blueberryUpgradeData: Record<
rewards: (n: number) => {
const baseVal = 0.0001 * n
const effectiveLuck = Math.min(
player.caches.ambrosiaLuck.usedTotal,
G.ambrosiaCurrStats.ambrosiaLuck,
Math.pow(1000, 0.5)
* Math.pow(player.caches.ambrosiaLuck.usedTotal, 0.5)
* Math.pow(G.ambrosiaCurrStats.ambrosiaLuck, 0.5)
)
const val = 1 + baseVal * effectiveLuck
return {
Expand Down Expand Up @@ -538,7 +541,9 @@ export const blueberryUpgradeData: Record<
ambrosiaCubes1: 20
},
cacheUpdates: [
() => player.caches.ambrosiaLuck.updateVal('BlueberryCubeLuck1')
() => {
G.ambrosiaCurrStats.ambrosiaLuck = calculateAmbrosiaLuck().value
}
]
},
ambrosiaQuarkLuck1: {
Expand Down Expand Up @@ -566,7 +571,9 @@ export const blueberryUpgradeData: Record<
ambrosiaQuarks1: 20
},
cacheUpdates: [
() => player.caches.ambrosiaLuck.updateVal('BlueberryQuarkLuck1')
() => {
G.ambrosiaCurrStats.ambrosiaLuck = calculateAmbrosiaLuck().value
}
]
},
ambrosiaQuarks2: {
Expand Down Expand Up @@ -648,7 +655,9 @@ export const blueberryUpgradeData: Record<
ambrosiaLuck1: 40
},
cacheUpdates: [
() => player.caches.ambrosiaLuck.updateVal('BlueberryUpgrade2')
() => {
G.ambrosiaCurrStats.ambrosiaLuck = calculateAmbrosiaLuck().value
}
]
},
ambrosiaPatreon: {
Expand All @@ -670,7 +679,9 @@ export const blueberryUpgradeData: Record<
}
},
cacheUpdates: [
() => player.caches.ambrosiaGeneration.updateVal('BlueberryPatreon')
() => {
G.ambrosiaCurrStats.ambrosiaGenerationSpeed = calculateAmbrosiaGenerationSpeed().value
}
]
},
ambrosiaObtainium1: {
Expand All @@ -681,7 +692,7 @@ export const blueberryUpgradeData: Record<
return baseCost * Math.pow(25, level)
},
rewards: (n: number) => {
const luck = player.caches.ambrosiaLuck.usedTotal
const luck = G.ambrosiaCurrStats.ambrosiaLuck
return {
luckMult: n,
obtainiumMult: n * luck,
Expand All @@ -701,7 +712,7 @@ export const blueberryUpgradeData: Record<
return baseCost * Math.pow(25, level)
},
rewards: (n: number) => {
const luck = player.caches.ambrosiaLuck.usedTotal
const luck = G.ambrosiaCurrStats.ambrosiaLuck
return {
luckMult: n,
offeringMult: n * luck,
Expand Down Expand Up @@ -831,7 +842,7 @@ export const validateBlueberryTree = (modules: BlueberryOpt) => {
}

const ambrosiaBudget = player.lifetimeAmbrosia
const blueberryBudget = player.caches.blueberryInventory.totalVal
const blueberryBudget = G.ambrosiaCurrStats.ambrosiaBlueberries

let spentAmbrosia = 0
let spentBlueberries = 0
Expand Down
Loading

0 comments on commit 0e47c9c

Please sign in to comment.