mirror of
https://git.srhtnin.garden/sarah/srhtnin.github.io.git
synced 2026-10-14 02:38:12 +02:00
Made styling more coherent, shortened CSS, and added some other little
sprinkles of neatness.
This commit is contained in:
1 parent
7b804feba8
commit
ab0d858fef
9 files changed
+389
-286
No files matched your search
@@ -117,13 +117,24 @@ function RenderMutationEncyclopedia() {
|
||||
)
|
||||
: [];
|
||||
|
||||
const HintLimit =
|
||||
GetMutationHintsDisplayLimit(
|
||||
MutationEncyclopediaSave
|
||||
);
|
||||
|
||||
const DisplayedHints =
|
||||
AvailableHints.slice(
|
||||
0,
|
||||
HintLimit
|
||||
);
|
||||
|
||||
const SearchQuery =
|
||||
MutationEncyclopediaSearchQuery
|
||||
.trim()
|
||||
.toLocaleLowerCase();
|
||||
|
||||
const VisibleHints =
|
||||
AvailableHints.filter(
|
||||
DisplayedHints.filter(
|
||||
Mutation =>
|
||||
DoesMutationHintMatchSearch(
|
||||
Mutation,
|
||||
@@ -145,13 +156,16 @@ function RenderMutationEncyclopedia() {
|
||||
);
|
||||
|
||||
|
||||
for (
|
||||
const Mutation
|
||||
of VisibleHints
|
||||
) {
|
||||
if (VisibleHints.length > 0) {
|
||||
List.appendChild(
|
||||
CreateMutationHintCard(
|
||||
Mutation.Hint
|
||||
VisibleHints.map(
|
||||
Mutation =>
|
||||
Mutation.Hint
|
||||
),
|
||||
GetMutationHintsLevel(
|
||||
MutationEncyclopediaSave
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
@@ -205,18 +219,6 @@ function RenderMutationEncyclopedia() {
|
||||
.toLocaleString() +
|
||||
" discovered mutations."
|
||||
);
|
||||
|
||||
if (AvailableHints.length > 0) {
|
||||
MessageParts.push(
|
||||
"Showing " +
|
||||
VisibleHints.length
|
||||
.toLocaleString() +
|
||||
" of " +
|
||||
AvailableHints.length
|
||||
.toLocaleString() +
|
||||
" available hints."
|
||||
);
|
||||
}
|
||||
} else {
|
||||
MessageParts.push(
|
||||
DiscoveredMutations.length === 1
|
||||
@@ -225,16 +227,20 @@ function RenderMutationEncyclopedia() {
|
||||
.toLocaleString() +
|
||||
" mutations discovered."
|
||||
);
|
||||
}
|
||||
|
||||
if (AvailableHints.length > 0) {
|
||||
MessageParts.push(
|
||||
AvailableHints.length === 1
|
||||
? "1 hint available."
|
||||
: AvailableHints.length
|
||||
.toLocaleString() +
|
||||
" hints available."
|
||||
);
|
||||
}
|
||||
if (AvailableHints.length > 0) {
|
||||
MessageParts.push(
|
||||
"Showing " +
|
||||
VisibleHints.length
|
||||
.toLocaleString() +
|
||||
" of " +
|
||||
AvailableHints.length
|
||||
.toLocaleString() +
|
||||
(AvailableHints.length === 1
|
||||
? " available hint."
|
||||
: " available hints.")
|
||||
);
|
||||
}
|
||||
|
||||
SetMutationEncyclopediaMessage(
|
||||
@@ -645,7 +651,8 @@ function DoesPlantMatchHintMatcher(
|
||||
|
||||
|
||||
function CreateMutationHintCard(
|
||||
Hint
|
||||
Hints,
|
||||
Level
|
||||
) {
|
||||
const Card =
|
||||
document.createElement(
|
||||
@@ -662,7 +669,7 @@ function CreateMutationHintCard(
|
||||
);
|
||||
|
||||
Header.className =
|
||||
"MutationEncyclopediaHeader";
|
||||
"PanelHeader MutationEncyclopediaHeader";
|
||||
|
||||
|
||||
const Name =
|
||||
@@ -671,7 +678,9 @@ function CreateMutationHintCard(
|
||||
);
|
||||
|
||||
Name.textContent =
|
||||
"Mutation hint";
|
||||
Level >= MutationHintsMaximumLevel
|
||||
? "Mutation hints"
|
||||
: "Mutation hint";
|
||||
|
||||
Header.appendChild(Name);
|
||||
|
||||
@@ -685,20 +694,53 @@ function CreateMutationHintCard(
|
||||
"MutationEncyclopediaBody";
|
||||
|
||||
|
||||
const HintText =
|
||||
document.createElement(
|
||||
"p"
|
||||
if (
|
||||
Level < MutationHintsMaximumLevel
|
||||
) {
|
||||
const HintText =
|
||||
document.createElement(
|
||||
"p"
|
||||
);
|
||||
|
||||
HintText.className =
|
||||
"MutationEncyclopediaDescription";
|
||||
|
||||
HintText.textContent =
|
||||
String(
|
||||
Hints[0] ?? ""
|
||||
).trim();
|
||||
|
||||
Body.appendChild(
|
||||
HintText
|
||||
);
|
||||
} else {
|
||||
const HintList =
|
||||
document.createElement(
|
||||
"ul"
|
||||
);
|
||||
|
||||
HintText.className =
|
||||
"MutationEncyclopediaDescription";
|
||||
HintList.className =
|
||||
"MutationHintList";
|
||||
|
||||
HintText.textContent =
|
||||
Hint.trim();
|
||||
for (const Hint of Hints) {
|
||||
const Item =
|
||||
document.createElement(
|
||||
"li"
|
||||
);
|
||||
|
||||
Body.appendChild(
|
||||
HintText
|
||||
);
|
||||
Item.textContent =
|
||||
"- " +
|
||||
String(Hint).trim();
|
||||
|
||||
HintList.appendChild(
|
||||
Item
|
||||
);
|
||||
}
|
||||
|
||||
Body.appendChild(
|
||||
HintList
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Card.append(
|
||||
@@ -733,7 +775,7 @@ function CreateMutationEncyclopediaCard(
|
||||
);
|
||||
|
||||
Header.className =
|
||||
"MutationEncyclopediaHeader";
|
||||
"PanelHeader MutationEncyclopediaHeader";
|
||||
|
||||
|
||||
const Number =
|
||||
|
||||
@@ -367,7 +367,7 @@ function CreatePlantEncyclopediaCard(
|
||||
);
|
||||
|
||||
Header.className =
|
||||
"PlantEncyclopediaHeader";
|
||||
"PanelHeader PlantEncyclopediaHeader";
|
||||
|
||||
|
||||
const Number =
|
||||
|
||||
+18
-3
@@ -392,7 +392,7 @@ function CreateNewSave() {
|
||||
|
||||
|
||||
return NormalizeSaveData({
|
||||
Version: 4,
|
||||
Version: 5,
|
||||
Revision: 0,
|
||||
LastSavedAt: Date.now(),
|
||||
|
||||
@@ -432,7 +432,8 @@ function CreateNewSave() {
|
||||
PlantInformation: false,
|
||||
GardenOverview: false,
|
||||
GardenEconomy: false,
|
||||
MutationHints: false
|
||||
MutationHints: false,
|
||||
MutationHintsLevel: 0
|
||||
},
|
||||
|
||||
Preferences: {
|
||||
@@ -469,7 +470,7 @@ function NormalizeSaveData(
|
||||
Number(
|
||||
SaveData.Version ?? 1
|
||||
),
|
||||
4
|
||||
5
|
||||
);
|
||||
|
||||
SaveData.Revision = Number(
|
||||
@@ -688,6 +689,20 @@ function NormalizeSaveData(
|
||||
SaveData.Upgrades.MutationHints ===
|
||||
true;
|
||||
|
||||
SaveData.Upgrades.MutationHintsLevel =
|
||||
Math.max(
|
||||
0,
|
||||
Math.min(
|
||||
1,
|
||||
Math.floor(
|
||||
Number(
|
||||
SaveData.Upgrades
|
||||
.MutationHintsLevel ?? 0
|
||||
) || 0
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
SaveData.Preferences ??= {};
|
||||
|
||||
|
||||
+114
-94
@@ -485,7 +485,7 @@ function CreateTrowelToolCard() {
|
||||
);
|
||||
|
||||
Header.className =
|
||||
"ShopItemHeader ShopItemHeaderOwned";
|
||||
"PanelHeader PanelHeaderInset ShopItemHeader ShopItemHeaderOwned";
|
||||
|
||||
|
||||
const Name =
|
||||
@@ -584,7 +584,7 @@ function CreateToolUnlockCard(
|
||||
);
|
||||
|
||||
Header.className =
|
||||
"ShopItemHeader" +
|
||||
"PanelHeader PanelHeaderInset ShopItemHeader" +
|
||||
(
|
||||
IsOwned
|
||||
? " ShopItemHeaderOwned"
|
||||
@@ -724,7 +724,7 @@ function CreateShovelToolCard() {
|
||||
);
|
||||
|
||||
Header.className =
|
||||
"ShopItemHeader" +
|
||||
"PanelHeader PanelHeaderInset ShopItemHeader" +
|
||||
(
|
||||
IsOwned
|
||||
? " ShopItemHeaderOwned"
|
||||
@@ -761,27 +761,22 @@ function CreateShovelToolCard() {
|
||||
|
||||
Details.append(
|
||||
CreateShopStat(
|
||||
"Status",
|
||||
"Current",
|
||||
IsOwned
|
||||
? "Unlocked"
|
||||
? GetShovelLevelDescription(
|
||||
Level
|
||||
)
|
||||
: "Locked"
|
||||
),
|
||||
CreateShopStat(
|
||||
IsOwned
|
||||
? "Current"
|
||||
: "On unlock",
|
||||
GetShovelLevelDescription(
|
||||
Level
|
||||
)
|
||||
),
|
||||
CreateShopStat(
|
||||
IsOwned
|
||||
? "Next"
|
||||
: "First upgrade",
|
||||
"Next",
|
||||
IsOwned &&
|
||||
Level >= ShovelMaximumLevel
|
||||
? "Maximum level"
|
||||
: GetShovelLevelDescription(
|
||||
Level + 1
|
||||
IsOwned
|
||||
? Level + 1
|
||||
: 0
|
||||
)
|
||||
)
|
||||
);
|
||||
@@ -860,18 +855,18 @@ function GetShovelLevelDescription(
|
||||
Level
|
||||
) {
|
||||
if (Level <= 0) {
|
||||
return "Level 0 - returns nothing";
|
||||
return "Returns nothing";
|
||||
}
|
||||
|
||||
if (Level === 1) {
|
||||
return "Level 1 - returns 33% of seed cost";
|
||||
return "Returns 33% of seed cost";
|
||||
}
|
||||
|
||||
if (Level === 2) {
|
||||
return "Level 2 - returns 66% of seed cost";
|
||||
return "Returns 66% of seed cost";
|
||||
}
|
||||
|
||||
return "Level 3 - returns the planted seed";
|
||||
return "Returns the planted seed";
|
||||
}
|
||||
|
||||
|
||||
@@ -910,7 +905,7 @@ function CreateFertilizerToolCard() {
|
||||
);
|
||||
|
||||
Header.className =
|
||||
"ShopItemHeader" +
|
||||
"PanelHeader PanelHeaderInset ShopItemHeader" +
|
||||
(
|
||||
IsOwned
|
||||
? " ShopItemHeaderOwned"
|
||||
@@ -946,12 +941,6 @@ function CreateFertilizerToolCard() {
|
||||
"ShopItemDetails";
|
||||
|
||||
Details.append(
|
||||
CreateShopStat(
|
||||
"Status",
|
||||
IsOwned
|
||||
? "Unlocked"
|
||||
: "Locked"
|
||||
),
|
||||
CreateShopStat(
|
||||
"Current uses",
|
||||
Number(
|
||||
@@ -960,30 +949,23 @@ function CreateFertilizerToolCard() {
|
||||
).toLocaleString()
|
||||
),
|
||||
CreateShopStat(
|
||||
"Current",
|
||||
IsOwned
|
||||
? "Current"
|
||||
: "On unlock",
|
||||
"Level " +
|
||||
Level +
|
||||
" - " +
|
||||
FertilizerGrowthMinutes[
|
||||
Level
|
||||
] +
|
||||
" minutes"
|
||||
? FertilizerGrowthMinutes[
|
||||
Level
|
||||
] + " minutes"
|
||||
: "Locked"
|
||||
),
|
||||
CreateShopStat(
|
||||
IsOwned
|
||||
? "Next"
|
||||
: "First upgrade",
|
||||
"Next",
|
||||
IsOwned &&
|
||||
Level >= FertilizerMaximumLevel
|
||||
? "Maximum level"
|
||||
: "Level " +
|
||||
(Level + 1) +
|
||||
" - " +
|
||||
FertilizerGrowthMinutes[
|
||||
Level + 1
|
||||
] +
|
||||
" minutes"
|
||||
: FertilizerGrowthMinutes[
|
||||
IsOwned
|
||||
? Level + 1
|
||||
: 0
|
||||
] + " minutes"
|
||||
)
|
||||
);
|
||||
|
||||
@@ -1184,7 +1166,7 @@ function CreateGardenExpansionCard(
|
||||
);
|
||||
|
||||
Header.className =
|
||||
"ShopItemHeader";
|
||||
"PanelHeader PanelHeaderInset ShopItemHeader";
|
||||
|
||||
|
||||
const Name =
|
||||
@@ -1311,7 +1293,7 @@ function CreateNewGardenCard() {
|
||||
);
|
||||
|
||||
Header.className =
|
||||
"ShopItemHeader";
|
||||
"PanelHeader PanelHeaderInset ShopItemHeader";
|
||||
|
||||
|
||||
const Name =
|
||||
@@ -1420,7 +1402,7 @@ function CreatePlantInformationUpgradeCard() {
|
||||
);
|
||||
|
||||
Header.className =
|
||||
"ShopItemHeader" +
|
||||
"PanelHeader PanelHeaderInset ShopItemHeader" +
|
||||
(
|
||||
IsOwned
|
||||
? " ShopItemHeaderOwned"
|
||||
@@ -1541,7 +1523,7 @@ function CreateGardenOverviewUpgradeCard() {
|
||||
);
|
||||
|
||||
Header.className =
|
||||
"ShopItemHeader" +
|
||||
"PanelHeader PanelHeaderInset ShopItemHeader" +
|
||||
(
|
||||
IsOwned
|
||||
? " ShopItemHeaderOwned"
|
||||
@@ -1662,7 +1644,7 @@ function CreateGardenEconomyUpgradeCard() {
|
||||
);
|
||||
|
||||
Header.className =
|
||||
"ShopItemHeader" +
|
||||
"PanelHeader PanelHeaderInset ShopItemHeader" +
|
||||
(
|
||||
IsOwned
|
||||
? " ShopItemHeaderOwned"
|
||||
@@ -1757,14 +1739,25 @@ function CreateGardenEconomyUpgradeCard() {
|
||||
|
||||
|
||||
function CreateMutationHintsUpgradeCard() {
|
||||
const Cost =
|
||||
GetMutationHintsUpgradeCost();
|
||||
|
||||
const IsOwned =
|
||||
const IsUnlocked =
|
||||
HasMutationHintsUpgrade(
|
||||
ShopSave
|
||||
);
|
||||
|
||||
const Level =
|
||||
GetMutationHintsLevel(
|
||||
ShopSave
|
||||
);
|
||||
|
||||
const Cost =
|
||||
GetMutationHintsUpgradeCost(
|
||||
ShopSave
|
||||
);
|
||||
|
||||
const IsMaximumLevel =
|
||||
IsUnlocked &&
|
||||
Level >= MutationHintsMaximumLevel;
|
||||
|
||||
|
||||
const Card =
|
||||
document.createElement(
|
||||
@@ -1781,9 +1774,9 @@ function CreateMutationHintsUpgradeCard() {
|
||||
);
|
||||
|
||||
Header.className =
|
||||
"ShopItemHeader" +
|
||||
"PanelHeader PanelHeaderInset ShopItemHeader" +
|
||||
(
|
||||
IsOwned
|
||||
IsMaximumLevel
|
||||
? " ShopItemHeaderOwned"
|
||||
: ""
|
||||
);
|
||||
@@ -1806,7 +1799,7 @@ function CreateMutationHintsUpgradeCard() {
|
||||
);
|
||||
|
||||
Description.textContent =
|
||||
"Show subtle hints for undiscovered mutations once you've discovered the plants needed to attempt them. Hints appear in the Mutation encyclopedia without revealing the recipe.";
|
||||
"Show subtle hints for undiscovered mutations once you've discovered the plants needed to attempt them. The first level shows one hint; the upgrade shows every available hint, up to 10.";
|
||||
|
||||
|
||||
const Details =
|
||||
@@ -1819,44 +1812,52 @@ function CreateMutationHintsUpgradeCard() {
|
||||
|
||||
Details.append(
|
||||
CreateShopStat(
|
||||
"Mutation hints",
|
||||
IsOwned
|
||||
? "Unlocked"
|
||||
: "Locked"
|
||||
"Current",
|
||||
!IsUnlocked
|
||||
? "Locked"
|
||||
: Level >= MutationHintsMaximumLevel
|
||||
? "All hints (max 10)"
|
||||
: "1 hint at a time"
|
||||
),
|
||||
CreateShopStat(
|
||||
"Requirements",
|
||||
"Required plants discovered"
|
||||
"Next",
|
||||
!IsUnlocked
|
||||
? "1 hint at a time"
|
||||
: IsMaximumLevel
|
||||
? "Maximum level"
|
||||
: "All hints (max 10)"
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
const BuyButton =
|
||||
const ActionButton =
|
||||
document.createElement(
|
||||
"button"
|
||||
);
|
||||
|
||||
BuyButton.className =
|
||||
ActionButton.className =
|
||||
"ActionButton ShopBuyButton";
|
||||
|
||||
BuyButton.type = "button";
|
||||
ActionButton.type = "button";
|
||||
|
||||
if (IsOwned) {
|
||||
BuyButton.textContent =
|
||||
"Purchased";
|
||||
if (Cost === null) {
|
||||
ActionButton.textContent =
|
||||
"Maximum level";
|
||||
|
||||
BuyButton.disabled = true;
|
||||
ActionButton.disabled = true;
|
||||
} else {
|
||||
BuyButton.textContent =
|
||||
"Buy - " +
|
||||
ActionButton.textContent =
|
||||
(IsUnlocked
|
||||
? "Upgrade - "
|
||||
: "Buy - ") +
|
||||
Cost.toLocaleString() +
|
||||
" Dew";
|
||||
|
||||
BuyButton.disabled =
|
||||
ActionButton.disabled =
|
||||
ShopSave.Currency.Dew < Cost ||
|
||||
ShopPurchasePending;
|
||||
|
||||
BuyButton.addEventListener(
|
||||
ActionButton.addEventListener(
|
||||
"click",
|
||||
BuyMutationHintsUpgrade
|
||||
);
|
||||
@@ -1867,7 +1868,7 @@ function CreateMutationHintsUpgradeCard() {
|
||||
Header,
|
||||
Description,
|
||||
Details,
|
||||
BuyButton
|
||||
ActionButton
|
||||
);
|
||||
|
||||
|
||||
@@ -1893,7 +1894,7 @@ function CreateShopSeedCard(
|
||||
);
|
||||
|
||||
Header.className =
|
||||
"ShopItemHeader";
|
||||
"PanelHeader PanelHeaderInset ShopItemHeader";
|
||||
|
||||
|
||||
const Name =
|
||||
@@ -3028,25 +3029,33 @@ async function BuyGardenEconomyUpgrade() {
|
||||
|
||||
|
||||
async function BuyMutationHintsUpgrade() {
|
||||
if (
|
||||
ShopPurchasePending ||
|
||||
HasMutationHintsUpgrade(
|
||||
ShopSave
|
||||
)
|
||||
) {
|
||||
if (ShopPurchasePending) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
const IsUnlocked =
|
||||
HasMutationHintsUpgrade(
|
||||
ShopSave
|
||||
);
|
||||
|
||||
const Cost =
|
||||
GetMutationHintsUpgradeCost();
|
||||
GetMutationHintsUpgradeCost(
|
||||
ShopSave
|
||||
);
|
||||
|
||||
if (Cost === null) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (
|
||||
ShopSave.Currency.Dew <
|
||||
Cost
|
||||
) {
|
||||
SetShopMessage(
|
||||
"You don't have enough Dew for Mutation hints."
|
||||
IsUnlocked
|
||||
? "You don't have enough Dew to upgrade Mutation hints."
|
||||
: "You don't have enough Dew for Mutation hints."
|
||||
);
|
||||
|
||||
return;
|
||||
@@ -3062,16 +3071,27 @@ async function BuyMutationHintsUpgrade() {
|
||||
ShopSave.Statistics.CurrencySpent.Dew +=
|
||||
Cost;
|
||||
|
||||
UnlockMutationHints(
|
||||
ShopSave
|
||||
);
|
||||
if (IsUnlocked) {
|
||||
UpgradeMutationHints(
|
||||
ShopSave
|
||||
);
|
||||
|
||||
SetShopMessage(
|
||||
"Upgraded Mutation hints for " +
|
||||
Cost.toLocaleString() +
|
||||
" Dew. Up to 10 eligible hints are now shown at once."
|
||||
);
|
||||
} else {
|
||||
UnlockMutationHints(
|
||||
ShopSave
|
||||
);
|
||||
|
||||
SetShopMessage(
|
||||
"Bought Mutation hints for " +
|
||||
Cost.toLocaleString() +
|
||||
" Dew. Eligible hints are now visible in the Mutation encyclopedia."
|
||||
);
|
||||
SetShopMessage(
|
||||
"Bought Mutation hints for " +
|
||||
Cost.toLocaleString() +
|
||||
" Dew. The lowest-ID eligible hint is now visible in the Mutation encyclopedia."
|
||||
);
|
||||
}
|
||||
|
||||
RenderShop();
|
||||
|
||||
|
||||
+102
-3
@@ -23,7 +23,10 @@ const GardenExpansionBaseCost = 1000;
|
||||
const PlantInformationUpgradeCost = 500;
|
||||
const GardenOverviewUpgradeCost = 1000;
|
||||
const GardenEconomyUpgradeCost = 1000;
|
||||
const MutationHintsUpgradeCost = 1500;
|
||||
const MutationHintsUnlockCost = 1500;
|
||||
const MutationHintsUpgradeCostMultiplier = 2;
|
||||
const MutationHintsMaximumLevel = 1;
|
||||
const MutationHintsMaximumVisible = 10;
|
||||
const NewGardenBaseCost = 4000;
|
||||
const NewGardenCostMultiplier = 1.5;
|
||||
|
||||
@@ -290,8 +293,73 @@ function HasMutationHintsUpgrade(
|
||||
}
|
||||
|
||||
|
||||
function GetMutationHintsUpgradeCost() {
|
||||
return MutationHintsUpgradeCost;
|
||||
function GetMutationHintsLevel(
|
||||
SaveData
|
||||
) {
|
||||
return Math.max(
|
||||
0,
|
||||
Math.min(
|
||||
MutationHintsMaximumLevel,
|
||||
Math.floor(
|
||||
Number(
|
||||
SaveData
|
||||
?.Upgrades
|
||||
?.MutationHintsLevel ?? 0
|
||||
) || 0
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
function GetMutationHintsDisplayLimit(
|
||||
SaveData
|
||||
) {
|
||||
if (
|
||||
!HasMutationHintsUpgrade(
|
||||
SaveData
|
||||
)
|
||||
) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return GetMutationHintsLevel(
|
||||
SaveData
|
||||
) >= MutationHintsMaximumLevel
|
||||
? MutationHintsMaximumVisible
|
||||
: 1;
|
||||
}
|
||||
|
||||
|
||||
function GetMutationHintsUpgradeCost(
|
||||
SaveData
|
||||
) {
|
||||
if (
|
||||
!HasMutationHintsUpgrade(
|
||||
SaveData
|
||||
)
|
||||
) {
|
||||
return MutationHintsUnlockCost;
|
||||
}
|
||||
|
||||
const Level =
|
||||
GetMutationHintsLevel(
|
||||
SaveData
|
||||
);
|
||||
|
||||
if (
|
||||
Level >= MutationHintsMaximumLevel
|
||||
) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return Math.round(
|
||||
MutationHintsUnlockCost *
|
||||
Math.pow(
|
||||
MutationHintsUpgradeCostMultiplier,
|
||||
Level + 1
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -301,6 +369,37 @@ function UnlockMutationHints(
|
||||
SaveData.Upgrades ??= {};
|
||||
SaveData.Upgrades.MutationHints =
|
||||
true;
|
||||
SaveData.Upgrades.MutationHintsLevel =
|
||||
0;
|
||||
}
|
||||
|
||||
|
||||
function UpgradeMutationHints(
|
||||
SaveData
|
||||
) {
|
||||
if (
|
||||
!HasMutationHintsUpgrade(
|
||||
SaveData
|
||||
)
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const Level =
|
||||
GetMutationHintsLevel(
|
||||
SaveData
|
||||
);
|
||||
|
||||
if (
|
||||
Level >= MutationHintsMaximumLevel
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
|
||||
SaveData.Upgrades.MutationHintsLevel =
|
||||
Level + 1;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user