Difference between revisions of "Template:Nutrition Consumption"

From RimWorld Wiki
Jump to navigation Jump to search
m
(Desensitizing second input to capitalization (i.e. "Baby" and "baby" both work))
Line 25: Line 25:
 
If the babies are slaughtered, only the parent's consumption is counted, but if the offspring live to adulthood, their consumption as babies and juveniles is also counted.
 
If the babies are slaughtered, only the parent's consumption is counted, but if the offspring live to adulthood, their consumption as babies and juveniles is also counted.
 
-->
 
-->
{{#ifeq: {{#var:slaughter_age}} | Baby | {{#var:parent_consumption}} | {{#expr:{{#var:parent_consumption}} + {{#var:baby_consumption}} + {{#var:juvenile_consumption}}}}}}  
+
{{#ifeq: {{lc:{{#var:slaughter_age}}}} | baby | {{#var:parent_consumption}} | {{#expr:{{#var:parent_consumption}} + {{#var:baby_consumption}} + {{#var:juvenile_consumption}}}}}}  
 
</includeonly><noinclude>
 
</includeonly><noinclude>
 
{{documentation}}
 
{{documentation}}
 
</noinclude>
 
</noinclude>

Revision as of 11:55, 24 September 2021

Documentation icon Template documentation[view] [edit] [history] [purge]

Returns the nutrition consumed per day for a set number of breeding adults. This calculation assumes that there is no time between pregnancies.

Usage

  • The first parameter, if present, will specify which animal to generate the template for. If absent, {{PAGENAME}} will be used.
  • The second parameter determines whether the offspring continue to consume up until adulthood, or whether they are slaughtered immediately upon birth. Baby for baby slaughter, Adult for adult slaughter. Defaults to Baby.
  • The third parameter is the number of females in the system. Defaults to 1.
  • The fourth parameter is the number of males in the system. Defaults to 0.

Examples

Single inexplicably pregnant mare

{{Nutrition Consumption| Horse | Adult}}

result: 1.6753423423423

5 mares, 5 stallions

{{Nutrition Consumption| Horse | Adult | 5 | 5 }}

result: 11.776711711712

Chick slaughter

{{Nutrition Consumption| Chicken | Baby}}

result: 0.22

Chicken slaughter

{{Nutrition Consumption| Chicken | Adult}}

result: 1.6456


See also: Template:Meat Production