Skip to content

Commit

Permalink
Merge pull request #590 from Pseudo-Corp/april18Patch
Browse files Browse the repository at this point in the history
April 18 Patch - event code, balance and new EXALT bonus!
  • Loading branch information
Pseudonian authored Apr 18, 2024
2 parents dbc97fe + 06eb760 commit f5830c5
Show file tree
Hide file tree
Showing 14 changed files with 67 additions and 35 deletions.
6 changes: 4 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3115,8 +3115,9 @@ <h1>Artists</h1>
<p id="statOff30" class="statPortion">Cube Upgrade Cx4: <span id="sOff30" class="statNumber">0</span></p>
<p id="statOff31" class="statPortion">Offering Electrolosis [OC]: <span id="sOff31" class="statNumber">0</span></p>
<p id="statOff32" class="statPortion">RNG-Based Offering Multiplier: <span id="sOff32" class="statNumber">0</span></p>
<p id="statOff33" class="statPortion">Shop EX ULTIMATE: <span id="sOff33" class="statNumber">0</span></p>
<p id="statOff34" class="statPortion">Event: <span id="sOff34" class="statNumber">0</span></p>
<p id="statOff33" class="statPortion">20 Ascensions X20 [EXALT ONLY]: <span id="sOff33" class="statNumber">0</span></p>
<p id="statOff34" class="statPortion">Shop EX ULTIMATE: <span id="sOff34" class="statNumber">0</span></p>
<p id="statOff35" class="statPortion">Event: <span id="sOff35" class="statNumber">0</span></p>
<p id="statOffT" class="statPortion statTotal" style="color: gold">TOTAL OFFERING MULTIPLIER: <span id="sOffT" class="statNumber statTotal">0</span></p>
</div>
<div id="globalSpeedMultiplierStats" class="statContainer" style="display: none;">
Expand Down Expand Up @@ -3251,6 +3252,7 @@ <h1>Artists</h1>
<p id="statGCM31" class="statPortion">-<span id="sGCM31" class="statNumber">-</span></p>
<p id="statGCM32" class="statPortion">-<span id="sGCM32" class="statNumber">-</span></p>
<p id="statGCM33" class="statPortion">-<span id="sGCM33" class="statNumber">-</span></p>
<p id="statGCM34" class="statPortion">-<span id="sGCM34" class="statNumber">-</span></p>
<p id="statGCMT" class="statPortion statTotal" style="color: orange">TOTAL GLOBAL CUBE MULTIPLIER: <span
id="sGCMT" class="statNumber statTotal">0</span></p>
</div>
Expand Down
22 changes: 18 additions & 4 deletions src/Calculate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ import { Alert, Prompt } from './UpdateHTML'
import { productContents, sumContents } from './Utility'
import { Globals as G } from './Variables'

const CASH_GRAB_ULTRA_QUARK = 0.12
const CASH_GRAB_ULTRA_CUBE = 0.8
const CASH_GRAB_ULTRA_BLUEBERRY = 0.2
const CASH_GRAB_ULTRA_QUARK = 0.08
const CASH_GRAB_ULTRA_CUBE = 1.2
const CASH_GRAB_ULTRA_BLUEBERRY = 0.15

const EX_ULTRA_OFFERING = 0.125
const EX_ULTRA_OBTAINIUM = 0.125
Expand Down Expand Up @@ -496,6 +496,7 @@ export function calculateOfferings (
1 + player.cubeUpgrades[54] / 100, // Cube upgrade 6x4 (Cx4)
+player.octeractUpgrades.octeractOfferings1.getEffect().bonus, // Offering Electrolosis OC Upgrade
1 + 0.001 * +player.blueberryUpgrades.ambrosiaOffering1.bonus.offeringMult, // Ambrosia!!
calculateEXALTBonusMult(), // 20 Ascensions X20 Bonus [EXALT ONLY]
calculateEXUltraOfferingBonus(), // EX Ultra Shop Upgrade
1 + calculateEventBuff(BuffType.Offering) // Event
]
Expand Down Expand Up @@ -675,6 +676,7 @@ export const calculateObtainium = () => {
+ 0.001 * +player.blueberryUpgrades.ambrosiaObtainium1.bonus.obtainiumMult

G.obtainiumGain *= calculateEXUltraObtainiumBonus()
G.obtainiumGain *= calculateEXALTBonusMult()

if (!isFinite(G.obtainiumGain)) {
G.obtainiumGain = 1e300
Expand Down Expand Up @@ -1770,11 +1772,13 @@ export const calculateAllCubeMultiplier = () => {
+player.blueberryUpgrades.ambrosiaCubes2.bonus.cubes,
// Module - Hyperflux
+player.blueberryUpgrades.ambrosiaHyperflux.bonus.hyperFlux,
// 20 Ascension Challenge - X20 Bonus
+calculateEXALTBonusMult(),
// Cash Grab Ultra
+calculateCashGrabCubeBonus(),
// EX Ultra
+calculateEXUltraCubeBonus(),
// Total Global Cube Multipliers: 32
// Total Global Cube Multipliers: 33
]

const extraMult = G.isEvent && G.eventClicked ? 1.05 : 1
Expand Down Expand Up @@ -3252,6 +3256,16 @@ export const calculateEXUltraCubeBonus = () => {
return calculateEXUltraBonus(EX_ULTRA_CUBES)
}

export const calculateEXALTBonusMult = () => {
if (!player.singularityChallenges.limitedAscensions.rewards.exaltBonus)
return 1

if (G.currentSingChallenge !== undefined) {
return Math.pow(1.04, player.singularityChallenges[G.currentSingChallenge].completions)
}
return 1
}

export const calculateDilatedFiveLeafBonus = () => {
const singThresholds = [100, 200, 250, 260, 266]
for (let i = 0; i < singThresholds.length; i++) {
Expand Down
6 changes: 6 additions & 0 deletions src/CheckVariables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import type { LegacyShopUpgrades, PlayerSave } from './types/LegacySynergism'
import type { Player } from './types/Synergism'
import { Alert } from './UpdateHTML'
import { padArray } from './Utility'
import { Globals } from './Variables'

/**
* Given player data, it checks, on load if variables are undefined
Expand Down Expand Up @@ -1431,6 +1432,11 @@ export const checkVariablesOnLoad = (data: PlayerSave) => {
effect: singularityChallengeData[k].effect,
cacheUpdates: singularityChallengeData[k].cacheUpdates
}

if (enabled) {
Globals.currentSingChallenge = singularityChallengeData[k].HTMLTag
}

player.singularityChallenges[k] = new SingularityChallenge(
updatedData,
k.toString()
Expand Down
2 changes: 1 addition & 1 deletion src/Config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const version = '3.0.0 pt 5: April 16: Rise of the Ambrosium'
export const version = '3.0.0 pt 5.1: April 18: Rise of the Ambrosium'

/**
* PSEUDO DO NOT CHANGE THIS LINE
Expand Down
24 changes: 11 additions & 13 deletions src/ImportExport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { achievementaward } from './Achievements'
import { DOMCacheGetOrSet } from './Cache/DOM'
import { octeractGainPerSecond } from './Calculate'
import { testing, version } from './Config'
import { getEvent } from './Event'
import { Synergism } from './Events'
import { addTimers } from './Helper'
import { quarkHandler } from './Quark'
Expand Down Expand Up @@ -430,21 +429,20 @@ export const promocodes = async (input: string | null, amount?: number) => {
return Alert(i18next.t('importexport.comeBackSoon'))
}
if (
input === 'synergism2023'
&& !player.codes.get(46)
input === '23andme'
&& !player.codes.get(48)
&& G.isEvent
&& getEvent()?.name === 'Synergism 3: More Synergies'
) {
if (!player.dailyCodeUsed) {
return Alert(
'This event code gives you another usage of code \'daily\'. Please use that code and try this event code again.'
)
}

player.codes.set(46, true)
player.codes.set(48, true)
player.quarkstimer = quarkHandler().maxTime
player.goldenQuarksTimer = 3600 * 24
addTimers('ascension', 4 * 3600)
addTimers('ascension', 8 * 3600)
player.dailyCodeUsed = false

if (
Expand All @@ -458,20 +456,20 @@ export const promocodes = async (input: string | null, amount?: number) => {
)
}
if (player.highestSingularityCount > 0) {
player.singularityUpgrades.goldenQuarks1.freeLevels += 1 + Math.floor(player.highestSingularityCount / 25)
player.singularityUpgrades.goldenQuarks2.freeLevels += 1 + Math.floor(player.highestSingularityCount / 25)
player.singularityUpgrades.goldenQuarks3.freeLevels += 1 + Math.floor(player.highestSingularityCount / 25)
player.singularityUpgrades.goldenQuarks1.freeLevels += 1 + Math.floor(player.highestSingularityCount / 10)
player.singularityUpgrades.goldenQuarks2.freeLevels += 1 + Math.floor(player.highestSingularityCount / 10)
player.singularityUpgrades.goldenQuarks3.freeLevels += 1 + Math.floor(player.highestSingularityCount / 10)
if (player.singularityUpgrades.octeractUnlock.getEffect().bonus) {
player.octeractUpgrades.octeractAscensionsOcteractGain.freeLevels += 0.2
player.octeractUpgrades.octeractImprovedQuarkHept.freeLevels += 0.05
}
}

return Alert(
`Happy 3rd anniversary of Synergism!!!! Your Quark timer(s) have been replenished and you have been given 4 real life hours of Ascension progress! Your daily code has also been reset for you.
`Not sponsored by the company! Your Quark timer(s) have been replenished and you have been given 8 real life hours of Ascension progress! Your daily code has also been reset for you.
${
player.challenge15Exponent >= 1e15
|| player.highestSingularityCount > 0
? 'Derpsmith also hacked your save to expand Quark Hepteract for free, and (to a limit) automatically filled the extra amount! What a generous, handsome fella.'
? 'Derpsmith also hacked your save to expand Quark Hepteract for free, and (to a limit) automatically filled the extra amount! What a generous, handsome gigachad.'
: ''
}
${
Expand All @@ -482,7 +480,7 @@ export const promocodes = async (input: string | null, amount?: number) => {
${
player.singularityUpgrades.octeractUnlock.getEffect()
.bonus
? 'Finally, you were given free levels of Octeract Accumulator!'
? 'Finally, you were given a tiny amount of free Octeract Quark Hepteract Improver upgrade!'
: ''
}`
)
Expand Down
2 changes: 2 additions & 0 deletions src/Reset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1341,6 +1341,7 @@ export const singularity = async (setSingNumber = -1): Promise<void> => {
const saveCode45 = player.codes.get(45) ?? false
const saveCode46 = player.codes.get(46) ?? false
const saveCode47 = player.codes.get(47) ?? false
const saveCode48 = player.codes.get(48) ?? false

// Import Game

Expand All @@ -1363,6 +1364,7 @@ export const singularity = async (setSingNumber = -1): Promise<void> => {
player.codes.set(45, saveCode45)
player.codes.set(46, saveCode46)
player.codes.set(47, saveCode47)
player.codes.set(48, saveCode48)
updateSingularityMilestoneAwards()

player.rngCode = Date.now()
Expand Down
4 changes: 2 additions & 2 deletions src/Shop.ts
Original file line number Diff line number Diff line change
Expand Up @@ -664,8 +664,8 @@ export const shopData: Record<keyof Player['shopUpgrades'], IShopData> = {
shopCashGrabUltra: {
tier: 'Exalt1x30',
price: 1,
priceIncrease: 1.5e22,
maxLevel: 3,
priceIncrease: 2e22,
maxLevel: 5,
type: shopUpgradeTypes.UPGRADE,
refundable: false,
refundMinimumLevel: 0,
Expand Down
8 changes: 6 additions & 2 deletions src/SingularityChallenges.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@ import { player } from './Synergism'
import type { Player } from './types/Synergism'
import { Alert, Confirm } from './UpdateHTML'
import { toOrdinal } from './Utility'
import { Globals as G } from './Variables'

export interface ISingularityChallengeData {
baseReq: number
maxCompletions: number
unlockSingularity: number
HTMLTag: string
HTMLTag: keyof Player['singularityChallenges']
singularityRequirement: (baseReq: number, completions: number) => number
effect: (n: number) => Record<string, number | boolean>
completions?: number
Expand Down Expand Up @@ -109,6 +110,7 @@ export class SingularityChallenge {
const goldenQuarkGain = calculateGoldenQuarkGain()
const currentGQ = player.goldenQuarks
this.enabled = true
G.currentSingChallenge = this.HTMLTag
player.insideSingularityChallenge = true
await singularity(setSingularity)
player.singularityCounter = holdSingTimer
Expand Down Expand Up @@ -149,6 +151,7 @@ export class SingularityChallenge {
}

this.enabled = false
G.currentSingChallenge = undefined
player.insideSingularityChallenge = false
const highestSingularityHold = player.highestSingularityCount
const holdSingTimer = player.singularityCounter
Expand Down Expand Up @@ -236,7 +239,7 @@ export class SingularityChallenge {

public updateIconHTML (): void {
const color = this.enabled ? 'orchid' : ''
DOMCacheGetOrSet(`${this.HTMLTag}`).style.backgroundColor = color
DOMCacheGetOrSet(`${String(this.HTMLTag)}`).style.backgroundColor = color
}

public get rewards () {
Expand Down Expand Up @@ -319,6 +322,7 @@ export const singularityChallengeData: Record<
ultimateProgressBarUnlock: (n > 0),
ascensionSpeedMult: (0.1 * n) / 100,
hepteractCap: n > 0,
exaltBonus: n >= 20,
shopUpgrade: n >= 25
}
}
Expand Down
10 changes: 6 additions & 4 deletions src/Statistics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -732,8 +732,9 @@ export const loadStatisticsCubeMultipliers = () => {
29: { acc: 2, desc: 'Module- Quark-Cube 1' },
30: { acc: 2, desc: 'Module- Cubes 2' },
31: { acc: 2, desc: 'Module- Hyperflux' },
32: { acc: 2, desc: 'Cash Grab ULTIMATE'},
33: { acc: 2, desc: 'Shop EX ULTIMATE'}
32: { acc: 2, desc: '20 Ascensions X20 Bonus [EXALT ONLY]'},
33: { acc: 2, desc: 'Cash Grab ULTIMATE'},
34: { acc: 2, desc: 'Shop EX ULTIMATE'},
}
for (let i = 0; i < arr0.length; i++) {
const statGCMi = DOMCacheGetOrSet(`statGCM${i + 1}`)
Expand Down Expand Up @@ -1010,8 +1011,9 @@ export const loadStatisticsOfferingMultipliers = () => {
30: { acc: 3, desc: 'Cube Upgrade Cx4:' },
31: { acc: 3, desc: 'Offering Electrolosis [OC]:' },
32: { acc: 3, desc: 'RNG-based Offering Booster:' },
33: { acc: 3, desc: 'Shop EX ULTIMATE' },
34: { acc: 3, desc: 'Event:' }
33: { acc: 3, desc: '20 Ascensions X20 [EXALT ONLY]' },
34: { acc: 3, desc: 'Shop EX ULTIMATE' },
35: { acc: 3, desc: 'Event:' }
}
for (let i = 0; i < arr.length; i++) {
const statOffi = DOMCacheGetOrSet(`statOff${i + 1}`)
Expand Down
4 changes: 2 additions & 2 deletions src/Synergism.ts
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ export const player: Player = {
subtabNumber: 0,

// create a Map with keys defaulting to false
codes: new Map(Array.from({ length: 47 }, (_, i) => [i + 1, false])),
codes: new Map(Array.from({ length: 48 }, (_, i) => [i + 1, false])),

loaded1009: true,
loaded1009hotfix1: true,
Expand Down Expand Up @@ -1497,7 +1497,7 @@ export const player: Player = {
}

export const blankSave = Object.assign({}, player, {
codes: new Map(Array.from({ length: 44 }, (_, i) => [i + 1, false]))
codes: new Map(Array.from({ length: 48 }, (_, i) => [i + 1, false]))
})

// The main cause of the double singularity bug was caused by a race condition
Expand Down
4 changes: 3 additions & 1 deletion src/Variables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,9 @@ export const Globals: GlobalVariables = {
eventClicked: false,

ambrosiaTimer: 0,
TIME_PER_AMBROSIA: 600
TIME_PER_AMBROSIA: 600,

currentSingChallenge: undefined
}

export const blankGlobals = { ...Globals }
2 changes: 2 additions & 0 deletions src/types/Synergism.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -994,6 +994,8 @@ export interface GlobalVariables {

ambrosiaTimer: number
TIME_PER_AMBROSIA: number

currentSingChallenge: keyof Player['singularityChallenges'] | undefined
}

export interface SynergismEvents {
Expand Down
4 changes: 2 additions & 2 deletions translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -1438,7 +1438,7 @@
"consume": "CONSUME",
"buyYerPotions": "Buy Yer' Potions!",
"header": "Welcome to the Quark Shop. You can't believe what's in stock!",
"youHaveQuarks": "You have {{x}} Unsmiths!",
"youHaveQuarks": "You have {{x}} Quarks!",
"cannotRefund": "This item CANNOT be refunded! Take caution.",
"resetPermShop": "Reset Perm Shop [Cost: 15 Quarks]",
"shopConfirmationOn": "Shop Confirmations: ON",
Expand Down Expand Up @@ -3090,7 +3090,7 @@
"limitedAscensions": {
"name": "Twenty Ascensions Challenge",
"description": "Derpsmith put an embargo on Ascensions. Only (20 - completions) are allowed throughout the entire Singularity, before Ascensions trigger massive debuffs! Ascension Count Multiplier is hardcapped at 1. Oh and Delta is disabled. Ha.",
"rewardDescription": "Each completion grants 0.1% Ascension Speed per completion per digit in your Ascension count. First completion doubles the cap of all hepteract, plus a new feature ;) Final completion adds another calculator in the shop!"
"rewardDescription": "Each completion grants 0.1% Ascension Speed per completion per digit in your Ascension count. First completion doubles the cap of all hepteract, plus a new feature ;) [WIP]. 20th completion adds a bonus to Cubes, Obtainium and Offerings in EXALTs based on total completed for that EXALT! Final completion adds another calculator in the shop!"
},
"noAmbrosiaUpgrades": {
"name": "No Ambrosia Upgrades",
Expand Down
4 changes: 2 additions & 2 deletions translations/source.json
Original file line number Diff line number Diff line change
Expand Up @@ -1428,7 +1428,7 @@
"shopAmbrosiaLuck4": "You get a slightly 'better' four leaf clover, what ever that means, giving +0.6 ☘ Ambrosia luck per level, stacking additively.",
"shopAmbrosiaLuckMultiplier4": "Gain ☘ +1% Ambrosia Luck per level! Simple as that.",
"shopOcteractAmbrosiaLuck": "Gain ☘ +1 Ambrosia Luck per digit in your Wow! Octeract inventory per level. Simple as that.",
"shopCashGrabUltra": "For a nominal price, gain up to +20% Blueberry Speed, +80% Cubes and +12% Quarks per level based on Ambrosia, scaling nonlinearly until 10,000,000 lifetime earned.",
"shopCashGrabUltra": "For a nominal price, gain up to +15% Blueberry Speed, +120% Cubes and +8% Quarks per level based on Ambrosia, scaling nonlinearly until 10,000,000 lifetime earned.",
"shopAmbrosiaAccelerator": "Each level of this 'accelerator' provides <<cyan|+0.2>> real-life seconds of Blueberry Generation for every <<orange|1>> Ambrosia gained, from any source!",
"shopEXUltra": "With this EX Upgrade, every 1,000 owned Ambrosia adds +0.1% <<orchid|Obtainium>>, <<orange|Offerings>> and <<white|Cubes>>! This effect caps at 125,000 * (level of shop upgrade)!"
},
Expand Down Expand Up @@ -3090,7 +3090,7 @@
"limitedAscensions": {
"name": "Twenty Ascensions Challenge",
"description": "Derpsmith put an embargo on Ascensions. Only (20 - completions) are allowed throughout the entire Singularity, before Ascensions trigger massive debuffs! Ascension Count Multiplier is hardcapped at 1. Oh and Delta is disabled. Ha.",
"rewardDescription": "Each completion grants 0.1% Ascension Speed per completion per digit in your Ascension count! First completion doubles the cap of all hepteract. Final completion adds another calculator in the shop!"
"rewardDescription": "Each completion grants 0.1% Ascension Speed per completion per digit in your Ascension count! First completion doubles the cap of all hepteract, plus a new feature ;) [WIP]. 20th completion adds a bonus to Cubes, Obtainium and Offerings in EXALTs based on total completed for that EXALT! Final completion adds another calculator in the shop!"
},
"noAmbrosiaUpgrades": {
"name": "No Ambrosia Upgrades",
Expand Down

0 comments on commit f5830c5

Please sign in to comment.