Plant

Plant is a type of Object. It includes plants grown from seeds (Spirit Roots), those grown in a Field or Herb Garden, and ones that only grow naturally (Huge Ginkgo Tree, Huge Pine Tree).
== Plant Types ==
Plants that can grow are subdivided into two types, HighPlant and LowPlant. 
=== High ===
HighPlants consist of Trees, Bamboo, and other tall plants. When harvested, the original plant does not die, and will regrow a new crop after completing a new Maturing phase. 
=== Low ===
LowPlants consist of most Herb Garden and Field plants. When harvested, the original plant dies and will have to be cleared and replanted. The new plant will have to go through the Growth and Maturing phases again before a new crop is produced. 
== Produce ==
Most Plants produce a harvestable crop. When a Plant's Growth reaches 100%, it then enters a Maturing phase, where it continues to grow. When the Maturing phase completes, the Plant can then be harvested by an Outer Disciple. If the Plant is being grown from a Field or Herb Garden, harvest commands will be automatically queued after completing Maturing phase. Otherwise, harvest commands need to manually issued by the Player. 
The amount of items produced is fixed for the plant type, however it can be improved by items or Skills that improve Harvest Yield, such as Farming or Talisman of Fertility. The Harvest Yield is capped at 120%, and increasing it beyond that level has no additional effect.
== Growth Speed ==
The speed for a plant's growth depends on the following factorsXiaWorld.PlantThing.CalcStepInfo. The initial growth speed is 100%, and a plant starts with 5% growth.
* Survival Difficulty (set at game initialization, default "Low")
**Very Low: 1
**Low: 0.75
**Ordinary: 0.5
*TemperatureXiaWorld.PlantThing.CheckTemperatureOffset
** If within the plant's Tolerance ranges, no change
** If outside the plant's Tolerance range, reduce growth speed by 33.3% per degree Celsius outside of range.
** If more than 3°C outside of range:
*** if a Plant growth Miracle is cast on the plant, set growth speed to 30%.
*** Otherwise, start withering and set growth speed to 0%.
* FertilityXiaWorld.PlantThing.CheckFertilityOffset
** If above the plant's Minimum Fertility, multiply growth speed by the Fertility. Maximum Fertility is not used in growth speed calculations.
** If below the plant's Minimum Fertility:
*** if a Plant growth Miracle is cast on the plant, set growth speed to 30%.
*** Otherwise, start withering and set growth speed to 0%.
* Qi on tile (if applicable)XiaWorld.PlantThing.CheckLingOffset
** If above the plant's Minimum Qi, multiply growth speed by 80 * \frac{Qi - MinQi}{Max Qi-MinQi} %, for a max of 80%.
** If below the plant's Minimum Qi:
*** if a Plant growth Miracle is cast on the plant, set growth speed to 30%.
*** Otherwise, start withering and set growth speed to 0%.
* Light (if applicable)XiaWorld.PlantThing.CheckLightOffset
** At plant's Minimum Light or below, no change to growth speed
** Above plant's Minimum Light, multiplies growth speed by20 * \frac{Light - MinLight}{MaxLight-MinLight} %, for a max of 20%.
* Spirit roots specific factors:
** Element CompositionXiaWorld.PlantThing.CheckElementPowerOffset
*** At Element Composition of 1, multiply growth speed by 1, at Element Composition of 2, multiply growth speed by 3.
*** If Element Strength < 1:
**** if a Plant growth Miracle is cast on the plant, set growth speed to 30%.
**** Otherwise, start withering and set growth speed to 0% if Element Strength < 1.
**Bless / Curse: multiply growth speed by 0.4 - BlessCurse*0.002 where BlessCurse is -100 for a 100% cursed plant so 0.6, and +100 for a 100% blessed one, so 0.2.
**Digestion: if the plant is being nurtured:
***if fed a corpse, multiply growth speed by (1 - 0.05 * Cultivation Level) of the corpse (set to 1 if not a cultivator)
***otherwise, multiply growth speed by (1 - 0.05 * Tier) of the item.
*Rest Time (if applicable)XiaWorld.PlantThing.CheckRestTime()
**Most low plants have a rest time, which by default ranges from 19:00 (7PM) to 4:00Settings/ThingDef/Plant/Plant_Base.xml [LowPlant]. During that time, no growth will occur even if the game displays a positive growth rate.
**Rest time is cancelled if a Plant growth Miracle is cast on the plant, for the duration of the effect.
*Seasonal wither (if applicable)XiaWorld.PlantThing.CheckSessonOffset()
**If the plant can wither (governed by WitherAble, 1 = can wither), and is deciduous (governed by DeciduousLeafInAutumn, 0 = not deciduous), its growth rate will be stopped a bit after a fourth of autumn has elapsed, which on the standard Biome happens on its 7th day.
**if the plant either can't wither or isn't deciduous, it isn't affected.
The speed is then further modified by the following:
* Bonus Fertility from Weathers and certain Miracles that improve plant growth speed (GrowAddP)
Multipliers are all separate. The Qi and Light values of your tiles are normally hidden, but you can use the mod MoreGridInfo to see them.
If Growth Speed is set to 30% and plant can Wither, set Growth Speed to 0%.
Every day, the plant's Growth progresses by (Growth Speed / Days required for growth), except if the plant has rest time, in which case the previous progress is multiplied by the fraction of the day the plant isn't resting (by default 15/24 = 0.625).
=== Example ===
The growth speed of a Wheat (Plant):
* playing with the difficulty set at Low 
* with no current event or miracle affecting it
on a tile with
* a temperature of 4°C, 0-40°C being the acceptable range,
* a fertility of 1.9
* 130 Qi, 0-500 being the min-max range
* a light value of 50, 40-140 being the min-max range
would have a Growth speed of:
 0.75 [difficulty] * 1 [weather/miracle event] * 1.9 [fertility] * [1 + 0.8 * (130 [Qi tile] - 0 [Qi min] )/(500 [Qi max] - 0 [Qi min] )] * [1 + 0.2 * (50 [light tile] - 40 [light min] ) / (140 [light max] - 40 [light min)] = 1.755828 = 175.6%.
== Plant Reproduction ==
Provided you wait long enough, plants can produce additional copies of themselves on the map.
== Code ==
* The game engine includes some objects not normally classified as plants, such as:
** Boxes around the mapSettings\ThingDef\Plant\Plant_Box.xml
** MineralsSettings\ThingDef\Rock\RockBase.xml
== References ==
Category:Plants