Skip to content

Commit

Permalink
Woah Progression Bar (V0)
Browse files Browse the repository at this point in the history
  • Loading branch information
Pseudonian committed Apr 30, 2024
1 parent e64b05d commit 7ca4503
Show file tree
Hide file tree
Showing 7 changed files with 99 additions and 17 deletions.
60 changes: 60 additions & 0 deletions Synergism.css
Original file line number Diff line number Diff line change
Expand Up @@ -3808,6 +3808,66 @@ img#singularityPerksIcon {
image-rendering: auto;
}

#pixelProgressBar {
width: 25%;
height: 30px;
background-color: black;
border: solid white;
border-radius: 5px;
box-shadow: 0 1px 3px rgb(0 0 0 / 20%);
position: relative;
}

#pixelProgress {
height: 100%;
background: linear-gradient(to right, maroon, red);
border-radius: 5px;
transition: width 0.4s ease;
}

#pixelProgressText {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
display: flex;
align-items: center; /* Center the text vertically */
justify-content: center; /* Center the text horizontally */
color: white;
font-weight: bold;
}

#ambrosiaProgressBar {
width: 25%;
height: 30px;
background-color: black;
border: solid white;
border-radius: 5px;
box-shadow: 0 1px 3px rgb(0 0 0 / 20%);
position: relative;
}

#ambrosiaProgress {
height: 100%;
background: linear-gradient(to right, navy, darkturquoise);
border-radius: 5px;
transition: width 0.4s ease;
}

#ambrosiaProgressText {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
display: flex;
align-items: center; /* Center the text vertically */
justify-content: center; /* Center the text horizontally */
color: white;
font-weight: bold;
}

form input:hover {
background-color: var(--hover-color);
cursor: pointer;
Expand Down
13 changes: 10 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4384,13 +4384,20 @@ <h1>Artists</h1>
<p id="ambrosiaAmount" class="amberText"></p>
</div>
<div id="ambrosiaTexts">
<p id="ambrosiaChance" class="lightYellowText"></p>
<!-- <p id="ambrosiaChance" class="lightYellowText"></p> -->
<p id="ambrosiaAmountPerGeneration" class="lightYellowText"></p>
<p id="ambrosiaRNG" class="lightYellowText"></p>
<!-- <p id="ambrosiaRNG" class="lightYellowText"></p> -->
<p id="ambrosiaRewards" class="lightYellowText"></p>
<p id="ambrosiaBlueberries" class="lightYellowText"></p>
</div>

<div id="ambrosiaProgressBar">
<div id="ambrosiaProgress" style="width: 70%;"></div>
<span id="ambrosiaProgressText">EVAL 492942 + 4294256!</span>
</div>
<div id="pixelProgressBar">
<div id="pixelProgress" style="width: 70%;"></div>
<span id="pixelProgressText">EVAL 492942 + 4294256!</span>
</div>
<div class="blueberryBoxColor" id="blueberryUpgradeContainer">
<div class="blueberryUpgradeTier">
<div class="blueberryUpgrade">
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.1: April 18: Rise of the Ambrosium'
export const version = '3.0.0 pt 5.2: April 29: Progress Bar!!'

/**
* PSEUDO DO NOT CHANGE THIS LINE
Expand Down
13 changes: 10 additions & 3 deletions src/Helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,13 +188,15 @@ export const addTimers = (input: TimerInput, time = 0) => {

G.ambrosiaTimer += time * timeMultiplier

if (G.ambrosiaTimer < 1) {
if (G.ambrosiaTimer < 0.125) {
break
}

const ambrosiaLuck = player.caches.ambrosiaLuck.usedTotal
player.blueberryTime += Math.floor(G.ambrosiaTimer) * player.caches.ambrosiaGeneration.totalVal
G.ambrosiaTimer %= 1
const baseBlueberryTime = player.caches.ambrosiaGeneration.totalVal
player.blueberryTime += Math.floor(8 * G.ambrosiaTimer) / 8 * baseBlueberryTime
player.ultimateProgress += Math.floor(8 * G.ambrosiaTimer) / 8 * Math.min(baseBlueberryTime, Math.pow(1000 * baseBlueberryTime, 1/2)) * 0.02
G.ambrosiaTimer %= 0.125

let timeToAmbrosia = calculateRequiredBlueberryTime()

Expand All @@ -213,6 +215,11 @@ export const addTimers = (input: TimerInput, time = 0) => {
timeToAmbrosia = calculateRequiredBlueberryTime()
}

if (player.ultimateProgress > 1e6) {
player.ultimatePixels += Math.floor(player.ultimateProgress / 1e6)
player.ultimateProgress -= 1e6 * Math.floor(player.ultimateProgress / 1e6)
}

visualUpdateAmbrosia()
}
}
Expand Down
20 changes: 14 additions & 6 deletions src/UpdateVisuals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1564,7 +1564,15 @@ export const visualUpdateAmbrosia = () => {
const cubePercent = 100 * (calculateAmbrosiaCubeMult() - 1)
const quarkPercent = 100 * (calculateAmbrosiaQuarkMult() - 1)
const availableBlueberries = player.caches.blueberryInventory.totalVal - player.spentBlueberries

const totalTimePerSecond = player.caches.ambrosiaGeneration.totalVal
const progressTimePerSecond = Math.min(totalTimePerSecond, Math.pow(1000 * totalTimePerSecond, 1/2))
const barWidth = 100 * Math.min(1, player.blueberryTime / requiredTime)
const pixelBarWidth = 100 * Math.min(1, player.ultimateProgress / 1e6)
DOMCacheGetOrSet('ambrosiaProgress').style.width = `${barWidth}%`
DOMCacheGetOrSet('ambrosiaProgressText').textContent = `${format(player.blueberryTime, 0, true)} / ${format(requiredTime, 0, true)} [+${format(totalTimePerSecond, 0, true)}/s]`

DOMCacheGetOrSet('pixelProgress').style.width = `${pixelBarWidth}%`
DOMCacheGetOrSet('pixelProgressText').textContent = `${format(player.ultimateProgress, 0, true)} / ${format(1000000, 0, true)} [+${format(progressTimePerSecond * 0.02, 2, true)}/s]`
const extraLuckHTML = luckBonusPercent > 0.01
? `[<span style='color: var(--amber-text-color)'>☘${
format(
Expand All @@ -1579,12 +1587,12 @@ export const visualUpdateAmbrosia = () => {
ambrosia: format(player.ambrosia, 0, true),
lifetimeAmbrosia: format(player.lifetimeAmbrosia, 0, true)
})
DOMCacheGetOrSet('ambrosiaChance').innerHTML = i18next.t(
/*DOMCacheGetOrSet('ambrosiaChance').innerHTML = i18next.t(
'ambrosia.blueberryGeneration',
{
chance: format(player.caches.ambrosiaGeneration.totalVal, 2, true)
chance: format(totalTimePerSecond, 2, true)
}
)
)*/
DOMCacheGetOrSet('ambrosiaAmountPerGeneration').innerHTML = i18next.t(
'ambrosia.perGen',
{
Expand All @@ -1594,13 +1602,13 @@ export const visualUpdateAmbrosia = () => {
extra: extraLuckHTML
}
)
DOMCacheGetOrSet('ambrosiaRNG').innerHTML = i18next.t(
/* DOMCacheGetOrSet('ambrosiaRNG').innerHTML = i18next.t(
'ambrosia.blueberrySecond',
{
blueberrySecond: format(player.blueberryTime, 0, true),
thresholdTimer: format(requiredTime, 0, true)
}
)
)*/
DOMCacheGetOrSet('ambrosiaRewards').innerHTML = i18next.t(
'ambrosia.bonuses',
{
Expand Down
4 changes: 2 additions & 2 deletions translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@
"ambrosia": "Ambrosia",
"amount": "You have <<var(--lightgoldenrodyellow-text-color)|{{ambrosia}}>> Ambrosia! [Lifetime: <<white|{{lifetimeAmbrosia}}>>]",
"blueberryGeneration": "Each second, gain <<var(--amber-text-color)|{{chance}}>> seconds of Blueberry Time.",
"perGen": "Currently gaining <<var(--amber-text-color)|{{guaranteed}}>> with a <<var(--amber-text-color)|{{extraChance}}%>> chance of another. [<<var(--lime-text-color)|Luck: ☘ {{ambrosiaLuck}}>>] {{extra}}",
"perGen": "Currently gaining <<var(--amber-text-color)|{{guaranteed}}>> Ambrosia with a <<var(--amber-text-color)|{{extraChance}}%>> chance of another. [<<var(--lime-text-color)|Luck: ☘ {{ambrosiaLuck}}>>] {{extra}}",
"blueberrySecond": "You currently have <<var(--amber-text-color)|{{blueberrySecond}}>> accumulated Blueberry Seconds! Generating Ambrosia when <<blue|{{thresholdTimer}}>> is accumulated.",
"bonuses": "Your ambrosia is giving <<var(--amber-text-color)|+{{cube}}%>> ALL cubes and <<cyan|+{{quark}}%>> Quarks!",
"prerequisite": "Prerequisites:",
"prereqNotMet": " (Not Met!)",
"blueberryCost": "Blueberries (To Activate):",
"prereqNotMetAlert": "You do not have the necessary prerequisites to purchase this upgrade.",
"notEnoughBlueberries": "You do not have enough Blueberries to activate this module.",
"availableBlueberries": "You have <<blue|{{availableBlueberries}}>> unspent Blueberries. Unlock higher tier modules below using them!",
"availableBlueberries": "You have <<lightblue|{{availableBlueberries}}>> unspent Blueberries. Unlock higher tier modules below using them!",
"ambrosiaBuyPrompt": "How many Ambrosia would you like to spend? You have {{amount}} Ambrosia. Type -1 to use max!",
"refund": "You have refunded all spent Blueberries and Ambrosia.",
"refundWord": "Refund",
Expand Down
4 changes: 2 additions & 2 deletions translations/source.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@
"ambrosia": "Ambrosia",
"amount": "You have <<var(--lightgoldenrodyellow-text-color)|{{ambrosia}}>> Ambrosia!",
"blueberryGeneration": "Each second, gain <<var(--amber-text-color)|{{chance}}>> seconds of Blueberry Time.",
"perGen": "Currently gaining <<var(--amber-text-color)|{{guaranteed}}>> with a <<var(--amber-text-color)|{{extraChance}}%>> chance of another. [<<var(--lime-text-color)|Luck: ☘ {{ambrosiaLuck}}>>]",
"perGen": "Currently gaining <<var(--amber-text-color)|{{guaranteed}}>> Ambrosia with a <<var(--amber-text-color)|{{extraChance}}%>> chance of another. [<<var(--lime-text-color)|Luck: ☘ {{ambrosiaLuck}}>>]",
"blueberrySecond": "You currently have <<var(--amber-text-color)|{{blueberrySecond}}>> accumulated Blueberry Seconds! Generating Ambrosia when <<blue|{{thresholdTimer}}>> is accumulated.",
"bonuses": "Your ambrosia is giving <<var(--amber-text-color)|+{{cube}}%>> ALL cubes and <<cyan|+{{quark}}%>> Quarks!",
"prerequisite": "Prerequisites:",
"prereqNotMet": " (Not Met!)",
"blueberryCost": "Blueberries (To Activate):",
"prereqNotMetAlert": "You do not have the necessary prerequisites to purchase this upgrade.",
"notEnoughBlueberries": "You do not have enough Blueberries to activate this module.",
"availableBlueberries": "You have <<blue|{{availableBlueberries}}>> unspent Blueberries. Unlock higher tier modules below using them!",
"availableBlueberries": "You have <<lightblue|{{availableBlueberries}}>> unspent Blueberries. Unlock higher tier modules below using them!",
"ambrosiaBuyPrompt": "How many Ambrosia would you like to spend? You have {{amount}} Ambrosia. Type -1 to use max!",
"refund": "You have refunded all spent Blueberries and Ambrosia.",
"refundWord": "Refund",
Expand Down

0 comments on commit 7ca4503

Please sign in to comment.