Update fertility levels, use BuildingBase.fertility Def attribute for fertility calculations

This commit is contained in:
2023-07-15 20:18:52 -05:00
parent 7541428635
commit 0546fb2e55
2 changed files with 4 additions and 3 deletions

View File

@@ -24,7 +24,6 @@
<Mass>80</Mass> <Mass>80</Mass>
</statBases> </statBases>
<size>(1,4)</size> <size>(1,4)</size>
<!-- this stat doesn't do anything for this mod -->
<fertility>2.8</fertility> <fertility>2.8</fertility>
<building> <building>
<defaultPlantToGrow>Plant_Rice</defaultPlantToGrow> <defaultPlantToGrow>Plant_Rice</defaultPlantToGrow>
@@ -88,6 +87,7 @@
<cornerBR>Damage/Corner</cornerBR> <cornerBR>Damage/Corner</cornerBR>
</damageData> </damageData>
</graphicData> </graphicData>
<fertility>3.0</fertility>
<constructionSkillPrerequisite>8</constructionSkillPrerequisite> <constructionSkillPrerequisite>8</constructionSkillPrerequisite>
<statBases> <statBases>
<WorkToBuild>5000</WorkToBuild> <WorkToBuild>5000</WorkToBuild>
@@ -133,6 +133,7 @@
<cornerBR>Damage/Corner</cornerBR> <cornerBR>Damage/Corner</cornerBR>
</damageData> </damageData>
</graphicData> </graphicData>
<fertility>3.15</fertility>
<constructionSkillPrerequisite>10</constructionSkillPrerequisite> <constructionSkillPrerequisite>10</constructionSkillPrerequisite>
<statBases> <statBases>
<WorkToBuild>7000</WorkToBuild> <WorkToBuild>7000</WorkToBuild>
@@ -177,6 +178,7 @@
<cornerBR>Damage/Corner</cornerBR> <cornerBR>Damage/Corner</cornerBR>
</damageData> </damageData>
</graphicData> </graphicData>
<fertility>3.4</fertility>
<constructionSkillPrerequisite>12</constructionSkillPrerequisite> <constructionSkillPrerequisite>12</constructionSkillPrerequisite>
<statBases> <statBases>
<WorkToBuild>9500</WorkToBuild> <WorkToBuild>9500</WorkToBuild>

View File

@@ -13,7 +13,6 @@ namespace HydroponicsExpanded {
public class BuildingDenseHydroponicsBasin : Building_PlantGrower, IThingHolder, IPlantToGrowSettable { public class BuildingDenseHydroponicsBasin : Building_PlantGrower, IThingHolder, IPlantToGrowSettable {
private ThingOwner _innerContainer; private ThingOwner _innerContainer;
private int _capacity = 4; private int _capacity = 4;
private float _fertility = 1.0f;
private float _highestGrowth = 0f; private float _highestGrowth = 0f;
private HydroponicsStage _stage = HydroponicsStage.Sowing; private HydroponicsStage _stage = HydroponicsStage.Sowing;
@@ -74,7 +73,7 @@ namespace HydroponicsExpanded {
// ReSharper disable once PossibleNullReferenceException // ReSharper disable once PossibleNullReferenceException
float growthAmount = 1f / (60_000f * growthTrackingPlant.def.plant.growDays) * 250f; float growthAmount = 1f / (60_000f * growthTrackingPlant.def.plant.growDays) * 250f;
growthTrackingPlant.Growth += _fertility * growthAmount; growthTrackingPlant.Growth += def.fertility * growthAmount;
_highestGrowth = growthTrackingPlant.Growth; _highestGrowth = growthTrackingPlant.Growth;
// When growth is complete, move to the harvesting stage. // When growth is complete, move to the harvesting stage.