Skip to content

Commit

Permalink
add fake login support during testing
Browse files Browse the repository at this point in the history
  • Loading branch information
KhafraDev committed Nov 7, 2024
1 parent 99ba508 commit 90597d5
Show file tree
Hide file tree
Showing 23 changed files with 352 additions and 387 deletions.
10 changes: 10 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4805,6 +4805,16 @@ <h1>Artists</h1>

<div id="testing">
<p>Welcome to the exclusive testing realm!</p>

<label for="account-type-select">Select an Account Type:</label>

<select name="account-type-select" id="account-type-select">
<option value="booster">Booster</option>
<option value="donator1">Transcended Baller</option>
<option value="donator2">Reincarnated Baller</option>
<option value="donator3">ASCENDED Baller</option>
<option value="donator4">OMEGA Baller</option>
</select>
</div>
</body>
</html>
3 changes: 2 additions & 1 deletion src/Achievements.ts
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,8 @@ export const challengeachievementcheck = (i: number, auto?: boolean) => {
}

if (
player.challengecompletions[10] >= 50 && i === 11 && player.corruptions.used.getLevel('drought') >= 5 && player.achievements[247] < 1
player.challengecompletions[10] >= 50 && i === 11 && player.corruptions.used.getLevel('drought') >= 5
&& player.achievements[247] < 1
) {
achievementaward(247)
}
Expand Down
2 changes: 1 addition & 1 deletion src/BlueberryUpgrades.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import { getQuarkBonus } from './Quark'
import { format, player } from './Synergism'
import type { Player } from './types/Synergism'
import { Alert, Confirm, Prompt } from './UpdateHTML'
import { Globals as G } from './Variables'
import { visualUpdateAmbrosia } from './UpdateVisuals'
import { Globals as G } from './Variables'

export type blueberryUpgradeNames =
| 'ambrosiaTutorial'
Expand Down
4 changes: 2 additions & 2 deletions src/Calculate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import i18next from 'i18next'
import { achievementaward } from './Achievements'
import { DOMCacheGetOrSet } from './Cache/DOM'
import { CalcECC } from './Challenges'
import type { Corruptions } from './Corruptions'
import { BuffType, calculateEventSourceBuff } from './Event'
import { addTimers, automaticTools } from './Helper'
import { hepteractEffective } from './Hepteracts'
Expand All @@ -20,7 +21,6 @@ import type { resetNames } from './types/Synergism'
import { Alert, Prompt } from './UpdateHTML'
import { productContents, sumContents } from './Utility'
import { Globals as G } from './Variables'
import type { Corruptions } from './Corruptions'

const CASH_GRAB_ULTRA_QUARK = 0.08
const CASH_GRAB_ULTRA_CUBE = 1.2
Expand Down Expand Up @@ -2833,7 +2833,7 @@ export const calculateAscensionScore = () => {
+ 0.0025 * (player.platonicUpgrades[5] + player.platonicUpgrades[10]),
player.highestchallengecompletions[10]
)

corruptionMultiplier = player.corruptions.used.getTotalScore()
const bonusMultiplier = computeAscensionScoreBonusMultiplier()

Expand Down
213 changes: 103 additions & 110 deletions src/Campaign.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import i18next from "i18next"
import { CorruptionLoadout, type Corruptions } from "./Corruptions"
import { player } from "./Synergism"
import i18next from 'i18next'
import { CorruptionLoadout, type Corruptions } from './Corruptions'
import { player } from './Synergism'

export type AscensionModifiers = 'GlobalSpeed'

Expand All @@ -10,129 +10,122 @@ export type CampaignModifiers = Partial<Record<AscensionModifiers, number>>
export type CampaignKeys = 'test1' | 'test2' | 'test3'

export interface ICampaignManagerData {
currentCampaign: CampaignKeys | undefined
campaigns: Record<CampaignKeys, ICampaignData>
currentCampaign: CampaignKeys | undefined
campaigns: Record<CampaignKeys, ICampaignData>
}

export interface ICampaignData {
campaignLoadout: CampaignLoadout,
campaignModifiers: CampaignModifiers,
limit: number,
isMeta: boolean
c10Completions?: number
campaignLoadout: CampaignLoadout
campaignModifiers: CampaignModifiers
limit: number
isMeta: boolean
c10Completions?: number
}

export class CampaignManager {

totalCampaignTokens: number
currentCampaign: Campaign | undefined
campaigns!: Record<CampaignKeys, Campaign>

constructor(campaignManagerData: ICampaignManagerData) {

for (const campaignKey of Object.keys(campaignManagerData.campaigns)) {
const key = campaignKey as keyof typeof campaignManagerData.campaigns
this.campaigns[key] = new Campaign(campaignDatas[key], key)
}

const currentKey = campaignManagerData.currentCampaign

if (currentKey !== undefined) {
this.currentCampaign = this.campaigns[currentKey]
player.corruptions.used = this.currentCampaign.createUsableLoadout()
}
else {
this.currentCampaign = undefined
}


this.totalCampaignTokens = this.computeTotalCampaignTokens()
totalCampaignTokens: number
currentCampaign: Campaign | undefined
campaigns!: Record<CampaignKeys, Campaign>

constructor (campaignManagerData: ICampaignManagerData) {
for (const campaignKey of Object.keys(campaignManagerData.campaigns)) {
const key = campaignKey as keyof typeof campaignManagerData.campaigns
this.campaigns[key] = new Campaign(campaignDatas[key], key)
}

computeTotalCampaignTokens = () => {
let sum = 0
for (const campaign in this.campaigns) {
const key = campaign as keyof typeof this.campaigns
sum += this.campaigns[key].computeTokenValue()
}
return sum
}

}

export class Campaign {
const currentKey = campaignManagerData.currentCampaign

// Stored as variable out of scope
name: string
description: string
campaignLoadout: CampaignLoadout
campaignModifiers: CampaignModifiers
limit: number
isMeta: boolean

// Saved as a variable
_c10Completions = 0

constructor(campaignData: ICampaignData, key: string) {
this.name = i18next.t(`campaigns.data.${key}.name`)
this.description = i18next.t(`campaigns.data.${key}.description`)
this.campaignLoadout = campaignData.campaignLoadout
this.campaignModifiers = campaignData.campaignModifiers
this.limit = campaignData.limit
this.isMeta = campaignData.isMeta
this._c10Completions = campaignData.c10Completions ?? 0
if (currentKey !== undefined) {
this.currentCampaign = this.campaigns[currentKey]
player.corruptions.used = this.currentCampaign.createUsableLoadout()
} else {
this.currentCampaign = undefined
}

public computeTokenValue = () => {
const metaMultiplier = this.isMeta ? 2: 1
return metaMultiplier * Math.min(this.c10Completions, this.limit)
}
this.totalCampaignTokens = this.computeTotalCampaignTokens()
}

public createUsableLoadout = (): CorruptionLoadout => {
return new CorruptionLoadout(this.campaignLoadout)
}

public set c10Completions(value: number) {
this._c10Completions = Math.min(value, this.limit)
}
public get c10Completions() {
return this._c10Completions
computeTotalCampaignTokens = () => {
let sum = 0
for (const campaign in this.campaigns) {
const key = campaign as keyof typeof this.campaigns
sum += this.campaigns[key].computeTokenValue()
}
return sum
}
}

export class Campaign {
// Stored as variable out of scope
name: string
description: string
campaignLoadout: CampaignLoadout
campaignModifiers: CampaignModifiers
limit: number
isMeta: boolean

// Saved as a variable
_c10Completions = 0

constructor (campaignData: ICampaignData, key: string) {
this.name = i18next.t(`campaigns.data.${key}.name`)
this.description = i18next.t(`campaigns.data.${key}.description`)
this.campaignLoadout = campaignData.campaignLoadout
this.campaignModifiers = campaignData.campaignModifiers
this.limit = campaignData.limit
this.isMeta = campaignData.isMeta
this._c10Completions = campaignData.c10Completions ?? 0
}

public computeTokenValue = () => {
const metaMultiplier = this.isMeta ? 2 : 1
return metaMultiplier * Math.min(this.c10Completions, this.limit)
}

public createUsableLoadout = (): CorruptionLoadout => {
return new CorruptionLoadout(this.campaignLoadout)
}

public set c10Completions (value: number) {
this._c10Completions = Math.min(value, this.limit)
}
public get c10Completions () {
return this._c10Completions
}
}

export const campaignDatas: Record<CampaignKeys, ICampaignData> = {
test1: {
campaignLoadout: {
'viscosity': 1
},
campaignModifiers: {
'GlobalSpeed': 1
},
isMeta: true,
limit: 10,
test1: {
campaignLoadout: {
viscosity: 1
},
test2: {
campaignLoadout: {
'viscosity': 1,
'deflation': 1
},
campaignModifiers: {
'GlobalSpeed': 1
},
isMeta: true,
limit: 15,
campaignModifiers: {
GlobalSpeed: 1
},
test3: {
campaignLoadout: {
'viscosity': 1,
'deflation': 1,
'dilation': 1,
},
campaignModifiers: {
'GlobalSpeed': 1
},
isMeta: true,
limit: 20,
}
}
isMeta: true,
limit: 10
},
test2: {
campaignLoadout: {
viscosity: 1,
deflation: 1
},
campaignModifiers: {
GlobalSpeed: 1
},
isMeta: true,
limit: 15
},
test3: {
campaignLoadout: {
viscosity: 1,
deflation: 1,
dilation: 1
},
campaignModifiers: {
GlobalSpeed: 1
},
isMeta: true,
limit: 20
}
}
6 changes: 3 additions & 3 deletions src/Challenges.ts
Original file line number Diff line number Diff line change
Expand Up @@ -403,9 +403,9 @@ export const calculateChallengeRequirementMultiplier = (
completions: number,
special = 0
) => {
let requirementMultiplier = (type === 'ascension') ?
1:
player.corruptions.used.corruptionEffects('hyperchallenge')
let requirementMultiplier = (type === 'ascension')
? 1
: player.corruptions.used.corruptionEffects('hyperchallenge')
switch (type) {
case 'transcend':
requirementMultiplier *= G.challenge15Rewards.transcendChallengeReduction
Expand Down
Loading

0 comments on commit 90597d5

Please sign in to comment.