Difference between revisions of "Template:Consumption Upto Adulthood"

From RimWorld Wiki
Jump to navigation Jump to search
(created template)
 
 
Line 3: Line 3:
 
For example, if used on [[Tortoise]]: <code><nowiki>{{Consumption Upto Adulthood}}</nowiki></code> -> {{Consumption Upto Adulthood|Tortoise}}
 
For example, if used on [[Tortoise]]: <code><nowiki>{{Consumption Upto Adulthood}}</nowiki></code> -> {{Consumption Upto Adulthood|Tortoise}}
  
Combine with <code>#expr round</code> to improve readability: <code><nowiki>{{#expr: {{Consumption Upto Adulthood}} round 2}}</nowiki></code> -> {{#expr: {{Consumption Upto Adulthood|Tortoise}} round 2}}</noinclude><includeonly>{{#vardefine:baby_consumption
+
Combine with <code>#expr round</code> to improve readability: <code><nowiki>{{#expr: {{Consumption Upto Adulthood}} round 2}}</nowiki></code> -> {{#expr: {{Consumption Upto Adulthood|Tortoise}} round 2}} [[Category: Math templates]]</noinclude><includeonly>{{#vardefine:baby_consumption
 
  | {{#expr:60*{{#show: {{{1|{{PAGENAME}}}}}|?Juvenile Age}}*{{#show: {{{1|{{PAGENAME}}}}}|?Base Hunger Rate}}*1.6*0.4}}
 
  | {{#expr:60*{{#show: {{{1|{{PAGENAME}}}}}|?Juvenile Age}}*{{#show: {{{1|{{PAGENAME}}}}}|?Base Hunger Rate}}*1.6*0.4}}
 
}}{{#vardefine:juvenile_consumption
 
}}{{#vardefine:juvenile_consumption
 
  | {{#expr:60*({{#show: {{{1|{{PAGENAME}}}}}|?Maturity Age}} - {{#show: {{{1|{{PAGENAME}}}}}|?Juvenile Age}})*{{#show: {{{1|{{PAGENAME}}}}}|?Base Hunger Rate}}*1.6*0.75}}
 
  | {{#expr:60*({{#show: {{{1|{{PAGENAME}}}}}|?Maturity Age}} - {{#show: {{{1|{{PAGENAME}}}}}|?Juvenile Age}})*{{#show: {{{1|{{PAGENAME}}}}}|?Base Hunger Rate}}*1.6*0.75}}
 
}}{{#expr: {{#var:baby_consumption}} + {{#var:juvenile_consumption}} }}</includeonly>
 
}}{{#expr: {{#var:baby_consumption}} + {{#var:juvenile_consumption}} }}</includeonly>

Latest revision as of 13:07, 26 March 2023

Returns the amount of nutrition consumed by a baby as it grows into an adult. Calculates the value of juvenile_age*baby_hunger + (adult_age - juvenile_age)*juvenile_hunger

For example, if used on Tortoise: {{Consumption Upto Adulthood}} -> 0.90288

Combine with #expr round to improve readability: {{#expr: {{Consumption Upto Adulthood}} round 2}} -> 0.9