Decay

Decay is the process through which certain Items slowly degrade over time. 
==Preventing Decay==
Decay can be stopped completely in one of the following situationsXiaWorld.ItemThing.OnStep: 
*Placed on a 
*Being equipped or stored in a Character's Inventory
*Currently being moved to a different location by a Character or 
*Turned into a Sentient Spirit
*Placed in the (also restores any damage from decay or other sources)
==Process==
Decay only applies to certain types of Items which have the Rot property defined in their item information and have a nonzero base decay rate RotSpeed. It follows this process when decay is not stopped with one of the above listed methodsSettings\ThingDef\Item:
* If either of the two following conditions are true, the decay value is set to 0.001
** Qi is above the greater of 500 or the item's maximum decay Qi
** Temperature is below the lower of 0 or the item's minimum decay temperature
* Otherwise, 
** If the Temperature of the item's location is above the minimum decay temperature TempMin, temperature decay multiplier is equal to the number of degrees Celsius difference.
** If the Qi of the item's location is below the maximum decay Qi LingMax, Qi decay multiplier is equal to the difference divided by 10.
** If the greater of the two values of Temperature or Qi decay multipliers is 0 or lower, decay value is set to 0.001
** Otherwise, decay value is equal to the base decay rate multiplied by (1+0.01* the greater of the two decay multipliers)
* Tribulation IX modifier "Air of Decay" further multiplies the decay value by 2.
* If the item's RotStartDay counter has not reached zero, decrement that counter until the number of days has elapsed and the counter reaches zero. Otherwise, the item's health value is reduced by the decay value per second.
When an item completes the Decay process through its hitpoints reaching zero, it turns into , with the exception of , , or , which disappear from the map and increase the Fertility of the tile by 0.2XiaWorld.ItemThing.OnDeath.
== Examples ==
 has a RotSpeed of 1.2, TempMin of 0, and LingMax of 200.
* With Temperature of 10 and Qi of 300, its decay rate is 1.32
* With Temperature of -10 and Qi of 0, its decay rate is 0.001
* With Temperature of 100 and Qi of 500, its decay rate is 0.001
 has a RotSpeed of 0.5, TempMin of -80, and LingMax of 800.
* With Temperature of 10 and Qi of 300, its decay rate is 0.95
* With Temperature of -10 and Qi of 0, its decay rate is 0.9
* With Temperature of 100 and Qi of 500, its decay rate is 1.4
* With Temperature of 100 and Qi of 1000, its decay rate is 0.001
==References==
Category:Game Mechanics