mirror of
https://git.srhtnin.garden/sarah/srhtnin.github.io.git
synced 2026-10-13 18:38:11 +02:00
Added net dew per hour
This commit is contained in:
1 parent
5a419c2f55
commit
dd89f3099d
3 files changed
+112
No files matched your search
@@ -617,3 +617,85 @@ function GetPlantHarvestReward(
|
|||||||
Cost * 1.5
|
Cost * 1.5
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function GetPlantDewPerHour(
|
||||||
|
SaveData,
|
||||||
|
PlantId
|
||||||
|
) {
|
||||||
|
const Plant =
|
||||||
|
GetPlantById(
|
||||||
|
PlantId
|
||||||
|
);
|
||||||
|
|
||||||
|
if (Plant === null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const GrowthTime = Number(
|
||||||
|
Plant.GrowthTime
|
||||||
|
);
|
||||||
|
|
||||||
|
if (
|
||||||
|
!Number.isFinite(
|
||||||
|
GrowthTime
|
||||||
|
) ||
|
||||||
|
GrowthTime <= 0
|
||||||
|
) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const Cost =
|
||||||
|
GetPlantShopCost(
|
||||||
|
SaveData,
|
||||||
|
PlantId
|
||||||
|
);
|
||||||
|
|
||||||
|
const Reward =
|
||||||
|
GetPlantHarvestReward(
|
||||||
|
SaveData,
|
||||||
|
PlantId
|
||||||
|
);
|
||||||
|
|
||||||
|
if (
|
||||||
|
Cost === null ||
|
||||||
|
Reward === null
|
||||||
|
) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const Profit =
|
||||||
|
Reward - Cost;
|
||||||
|
|
||||||
|
return (
|
||||||
|
Profit * 3600000 /
|
||||||
|
GrowthTime
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function FormatDewPerHour(
|
||||||
|
DewPerHour
|
||||||
|
) {
|
||||||
|
if (
|
||||||
|
DewPerHour === null ||
|
||||||
|
!Number.isFinite(
|
||||||
|
DewPerHour
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
return "Unavailable";
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
DewPerHour.toLocaleString(
|
||||||
|
undefined,
|
||||||
|
{
|
||||||
|
maximumFractionDigits: 2
|
||||||
|
}
|
||||||
|
) +
|
||||||
|
" Dew"
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -300,6 +300,12 @@ function CreatePlantEncyclopediaDetails(
|
|||||||
Plant.Id
|
Plant.Id
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const DewPerHour =
|
||||||
|
GetPlantDewPerHour(
|
||||||
|
PlantEncyclopediaSave,
|
||||||
|
Plant.Id
|
||||||
|
);
|
||||||
|
|
||||||
Details.appendChild(
|
Details.appendChild(
|
||||||
CreatePlantEncyclopediaStat(
|
CreatePlantEncyclopediaStat(
|
||||||
"Reward",
|
"Reward",
|
||||||
@@ -310,6 +316,15 @@ function CreatePlantEncyclopediaDetails(
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Details.appendChild(
|
||||||
|
CreatePlantEncyclopediaStat(
|
||||||
|
"Dew / hour",
|
||||||
|
FormatDewPerHour(
|
||||||
|
DewPerHour
|
||||||
|
)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
const RecipeProgress =
|
const RecipeProgress =
|
||||||
GetPlantRecipeProgress(
|
GetPlantRecipeProgress(
|
||||||
|
|||||||
@@ -206,6 +206,12 @@ function CreateShopSeedCard(
|
|||||||
Plant.Id
|
Plant.Id
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const DewPerHour =
|
||||||
|
GetPlantDewPerHour(
|
||||||
|
ShopSave,
|
||||||
|
Plant.Id
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
Details.appendChild(
|
Details.appendChild(
|
||||||
CreateShopStat(
|
CreateShopStat(
|
||||||
@@ -227,6 +233,15 @@ function CreateShopSeedCard(
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Details.appendChild(
|
||||||
|
CreateShopStat(
|
||||||
|
"Dew / hour",
|
||||||
|
FormatDewPerHour(
|
||||||
|
DewPerHour
|
||||||
|
)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
Details.appendChild(
|
Details.appendChild(
|
||||||
CreateShopStat(
|
CreateShopStat(
|
||||||
"Inventory",
|
"Inventory",
|
||||||
|
|||||||
Reference in new issue
Block a user