Difference between revisions of "Template:Animals/Row"

From RimWorld Wiki
Jump to navigation Jump to search
(added nutrition efficiency columns)
m
 
(33 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<noinclude>This template pulls the data from each animal's individual page and formats it into a neat row summary. It is only intended for use on the [[List of animals]] page.
+
<includeonly>
 
+
<!-- Offspring per year calculation -->
Usage:  <code><nowiki>{{Animals/Row|*name*}}</nowiki></code>
+
{{#if:{{#vardefineecho:gestation|{{#show:{{{?Name}}}|?Egg Laying Interval }}}}
 
+
  |
The template takes a single parameter, the name of the animal being referenced, which must be the exact name of the animal's main page.  The parameter defaults to "Wild boar" if not given - used for testing/preview.
+
  | {{#vardefine:gestation|{{#show:{{{?Name}}}|?Gestation Period Days}}
 
 
Example:
 
{| {{STDT| sortable c_08 text-center}}
 
! Animal !! Type !! Wildness !! Min. Handling Skill  !! Guard !! Attack !! Rescue !! Haul !! Diet !! Hunger Rate<ref>Nutrition lost per day.</ref>!! Average DPS !! Move Speed !! Manhunter<br>(Hunt) !! Manhunter<br>(Tame) !! Filth Rate<ref>The average amount of filth produced on constructed floors per 1000 cells walked.</ref>!! Meat Yield<ref>Amounts given are at 100% butchery efficiency.</ref>!! Leather Yield<ref>Amounts given are at 100% butchery efficiency.</ref>!! Market Value !! Life Expectancy (Years) !! Maturity Age (Years) !! Gestation Period (Days)<ref>For egglayers, this is both the incubation period and the egg-laying interval.</ref> !! Nuzzle Interval (Hours)<ref>Mean time between nuzzles.</ref> !! Nutrition Efficiency (adult slaughter)<ref name=nutr_eff>Nutrition out from meat and milk for each nutrition in, calculated for a system of 9 adult females and 1 adult male, with the assumptions of constant pregnancy and immediate milking.</ref> !! Nutrition Efficiency (baby slaughter)<ref name=nutr_eff/>
 
|-{{Animals/Row|Yorkshire terrier}}
 
|}
 
</noinclude><includeonly>
 
<!--Nutrition efficiency calculation-->
 
{{#vardefine:default_animal|Horse}}{{#vardefine:females|9}}{{#vardefine:males|1}}{{#vardefine:baby_scale
 
| {{#switch: {{{1|{{#show:{{#var:default_animal}}|?Name}}}}}
 
  | Chicken|Duck|Turkey|Goose|Cassowary|Emu|Ostrich = 0.1
 
  | #default = 0.2
 
 
   }}
 
   }}
 
}}
 
}}
{{#vardefine:pre_curve_baby_meat
+
{{#if:{{#vardefineecho:litter_size|{{#show:{{{?Name}}}|?Eggs Per Clutch Average}}}}
| {{#expr:140*{{#show: {{{1|{{#var:default_animal}}}}}|?Body Size#}}*{{#var:baby_scale}}}}
+
  |  
}}
+
   | {{#if:{{#vardefineecho:litter_size|{{#show:{{{?Name}}}|?Average Offspring Per Birth}}}}
{{#vardefine:baby_meat
+
    |  
| {{#ifexpr: {{#var:pre_curve_baby_meat}} > 40
+
    | {{#if:{{#var:gestation}}|{{#vardefine:litter_size|1}}}}
  | {{#var:pre_curve_baby_meat}}
 
  | {{#ifexpr: {{#var:pre_curve_baby_meat}} > 5
 
    | {{#expr: (40-14)/(40-5)*{{#var:pre_curve_baby_meat}} + (40 - (40-14)/(40-5)*40)}}
 
    | {{#expr: 14/5*{{#var:pre_curve_baby_meat}}}}
 
    }}
 
   }}
 
}}
 
{{#vardefine:offspring_rate
 
| {{#switch: true
 
  | {{#if: {{#show: {{{1|{{#var:default_animal}}}}}|?Eggs Per Clutch Average#}}| true | false}} = {{#expr:{{#var:females}}*{{#show: {{{1|{{#var:default_animal}}}}}|?Eggs Per Clutch Average#}}/{{#show: {{{1|{{#var:default_animal}}}}}|?Egg Laying Interval#}}}}
 
  | {{#if: {{#show: {{{1|{{#var:default_animal}}}}}|?Average Offspring Per Birth#}}| true | false}} = {{#expr:{{#var:females}}*{{#if: {{#show: {{{1|{{#var:default_animal}}}}}|?Average Offspring Per Birth#}} | {{#show: {{{1|{{#var:default_animal}}}}}|?Average Offspring Per Birth#}} | 1}}/{{#show: {{{1|{{#var:default_animal}}}}}|?Gestation Period Days#}}}}
 
  | #default = 0
 
 
   }}
 
   }}
 
}}
 
}}
 +
<!-- Nutrition efficiency calculation -->
 +
{{#vardefine:females|4}}{{#vardefine:males|1}}
 
{{#vardefine:milk_nutrition_production
 
{{#vardefine:milk_nutrition_production
  | {{#if: {{#show: {{{1|{{#var:default_animal}}}}}|?Milk Amount#}}
+
  | {{#if: {{#show: {{{?Name}}}|?Milk Amount#}}
     | {{#expr:{{#var:females}}*{{#show: {{{1|{{#var:default_animal}}}}}|?Milk Amount#}}/{{#show: {{{1|{{#var:default_animal}}}}}|?Milking Interval Days#}}*0.05}}
+
     | {{#expr:{{#var:females}}*{{#show: {{{?Name}}}|?Milk Amount#}}/{{#show: {{{?Name}}}|?Milking Interval Days#}}*0.05}}
 
     | 0
 
     | 0
 
   }}
 
   }}
 
}}
 
}}
 
{{#vardefine:baby_slaughter_production
 
{{#vardefine:baby_slaughter_production
  | {{#expr:{{#var:offspring_rate}}*0.05*{{#var:baby_meat}} + {{#var:milk_nutrition_production}}}}
+
  | {{#expr:{{Meat Production| {{{?Name}}} | Baby | {{#var:females}} | {{#var:males}}}} + {{#var:milk_nutrition_production}}}}
 
}}{{#vardefine:baby_slaughter_consumption
 
}}{{#vardefine:baby_slaughter_consumption
  | {{#expr:(({{#var:females}} + {{#var:males}})*{{#show: {{{1|{{#var:default_animal}}}}}|?Base Hunger Rate#}}*1.6)}}
+
  | {{Nutrition Consumption| {{{?Name}}} | Baby | {{#var:females}} | {{#var:males}}}}
 
}}
 
}}
 
{{#vardefine:adult_slaughter_production
 
{{#vardefine:adult_slaughter_production
  | {{#expr:({{#var:offspring_rate}}*0.05*{{#show: {{{1|{{#var:default_animal}}}}}|?Meat Yield#}} + {{#var:milk_nutrition_production}})}}
+
  | {{#expr:{{Meat Production| {{{?Name}}} | Adult | {{#var:females}} | {{#var:males}}}} + {{#var:milk_nutrition_production}}}}
 
}}
 
}}
 
{{#vardefine:adult_slaughter_consumption
 
{{#vardefine:adult_slaughter_consumption
  | {{#expr:({{#var:females}} + {{#var:males}})*{{#show: {{{1|{{#var:default_animal}}}}}|?Base Hunger Rate#}}*1.6 + 60*{{#show: {{{1|{{#var:default_animal}}}}}|?Juvenile Age#}}*{{#var:offspring_rate}}*{{#show: {{{1|{{#var:default_animal}}}}}|?Base Hunger Rate#}}*1.6*0.4 + (60*({{#show: {{{1|{{#var:default_animal}}}}}|?Maturity Age#}} - {{#show: {{{1|{{#var:default_animal}}}}}|?Juvenile Age#}})*{{#var:offspring_rate}})*{{#show: {{{1|{{#var:default_animal}}}}}|?Base Hunger Rate#}}*1.6*0.75}}
+
  | {{Nutrition Consumption| {{{?Name}}} | Adult | {{#var:females}} | {{#var:males}}}}
 +
}}
 +
<!-- Actual row -->
 +
! {{Icon Small|{{{?Name}}}|32}}
 +
! style="text-align:left" | {{DLC Icons|{{{?Name}}} }}
 +
| {{#show: {{{?Name}}}|?Minimum Handling Skill#}}
 +
| {{#switch: {{#show: {{{?Name}}}|?Can Train Guard#}} | true=[[File:check.png|24px|link=]] | false=[[File:ex.png|24px|link=]]}}
 +
| {{#switch: {{#show: {{{?Name}}}|?Can Train Attack#}} | true=[[File:check.png|24px|link=]] | false=[[File:ex.png|24px|link=]]}}
 +
| {{#switch: {{#show: {{{?Name}}}|?Can Train Rescue#}} | true=[[File:check.png|24px|link=]] | false=[[File:ex.png|24px|link=]]}}
 +
| {{#switch: {{#show: {{{?Name}}}|?Can Train Haul#}}   | true=[[File:check.png|24px|link=]] | false=[[File:ex.png|24px|link=]]}}
 +
| {{#switch: {{#show: {{{?Name}}}|?Diet#}}
 +
  | herbivorous =                [[File:Potatoes.png|24px|Vegetables|link=Category:Vegetarian]]&nbsp;[[File:Potato plant.png|24px|Plants|link=]]
 +
  | dendrovorous =                [[File:Woodlog b.png|24px|Trees|link=Trees]]
 +
  | raw meat and corpses =        [[File:Meat big a.png|30px|Meat|link=Meat (disambiguation)]]&nbsp;[[File:DownedRefugee.png|24px|Corpses|link=Corpse]]
 +
  | carnivorous =                [[File:Meat big a.png|30px|Meat|link=Meat (disambiguation)]]
 +
  | omnivorous =                  [[File:Meat big a.png|30px|Meat|link=Meat (disambiguation)]]&nbsp;[[File:Potatoes.png|24px|Vegetables|link=Category:Vegetarian]]
 +
  | omnivorous grazer =          [[File:Meat big a.png|30px|Meat|link=Meat (disambiguation)]]&nbsp;[[File:Potato plant.png|24px|Plants|link=]]&nbsp;[[File:Potatoes.png|24px|Vegetables|link=Category:Vegetarian]]
 +
  | herbivorous, dendrovorous =  [[File:Potato plant.png|22px|Plants|link=]]&nbsp;[[File:Potatoes.png|24px|Vegetables|link=Category:Vegetarian]]&nbsp;[[File:Wood.png|24px|Trees|link=Trees]]
 +
  | carnivorous, ovivorous =      [[File:Meat big a.png|30px|Meat|link=Meat (disambiguation)]]&nbsp;[[File:Egg fertilized.png|28px|Eggs|link=Eggs]]
 +
  | omnivorous, animal products = [[File:Meat big a.png|30px|Meat|link=Meat (disambiguation)]]&nbsp;[[File:Milk.png|Animal products|24px|link=Category:Animal Products]]&nbsp;[[File:Potatoes.png|24px|Vegetables|link=Category:Vegetarian]]
 +
  | omnivorous, ovivorous =      [[File:Meat big a.png|30px|Meat|link=Meat (disambiguation)]]&nbsp;[[File:Egg fertilized.png|28px|Eggs|link=Eggs]]&nbsp;[[File:Potatoes.png|24px|Vegetables|link=Category:Vegetarian]]
 +
  | none = -
 
}}
 
}}
<!--Actual row-->
+
| {{#if:{{#show: {{{?Name}}}|?Roam Mtb Days}}|[[File:check.png|24px|link=]]|[[File:ex.png|24px|link=]]}}
![[{{{1|Wild boar}}}]]
+
| {{Q|{{{?Name}}}|Real Hunger Rate|-}}
| {{#show: {{{1|Wild boar}}}|?Type#}}
+
| {{#if:{{#var:gestation}}|{{#expr: {{#var:litter_size}}/{{#var:gestation}}*60 round 1}}|-}}
| {{#expr: {{#show: {{{1|Wild boar}}}|?Wildness#}} * 100}}%
+
| {{Q|{{{?Name}}}|Meat Yield|-}}
| {{#show: {{{1|Wild boar}}}|?Minimum Handling Skill#}}
+
| {{Q|{{{?Name}}}|Leather Yield|-}}
| {{#switch: {{#show: {{{1|Wild boar}}}|?Can Train Guard#}} | true=[[File:check.png|24px|link=]] | false=[[File:ex.png|24px|link=]]}}
+
| {{#show: {{{?Name}}}|?Mob Average DPS#}}
| {{#switch: {{#show: {{{1|Wild boar}}}|?Can Train Attack#}}  | true=[[File:check.png|24px|link=]] | false=[[File:ex.png|24px|link=]]}}
+
| {{#show: {{{?Name}}}|?Move Speed Base#}}
| {{#switch: {{#show: {{{1|Wild boar}}}|?Can Train Rescue#}}    | true=[[File:check.png|24px|link=]] | false=[[File:ex.png|24px|link=]]}}
+
| {{#show: {{{?Name}}}|?Health Scale#}}
| {{#switch: {{#show: {{{1|Wild boar}}}|?Can Train Haul#}}      | true=[[File:check.png|24px|link=]] | false=[[File:ex.png|24px|link=]]}}
+
| {{#expr: {{#show: {{{?Name}}}|?Turn Manhunter Chance When Attacked#}} *100}}%
| {{#switch: {{#show: {{{1|Wild boar}}}|?Diet#}}
+
| {{#if:{{#vardefineecho:tame_manhunt|{{#show: {{{?Name}}}|?Turn Manhunter Chance When Taming#}}}}|{{#expr:{{#var:tame_manhunt}}*100}}%|-}}
| herbivorous = [[File:Potato plant.png|22px|alt=Plants|link=]]
+
| {{#iferror: {{#expr:{{#var:baby_slaughter_production}}/{{#var:baby_slaughter_consumption}} round 2}} | -}}  
| dendrovorous = [[File:Wood.png|24px|alt=Wood|link=]]
+
| {{#iferror: {{#expr:{{#var:adult_slaughter_production}}/{{#var:adult_slaughter_consumption}} round 2}} | -}}
| carnivorous = [[File:MeatBig cropped.png|alt=Meat|link=]]
+
|-
| omnivorous = {{nowrap|[[File:MeatBig cropped.png|alt=Meat|link=]]&nbsp;[[File:Potato plant.png|22px|alt=Plants|link=]]}}
+
</includeonly><noinclude>{{Documentation}}</noinclude>
| herbivorous and dendrovorous = {{nowrap|[[File:Potato plant.png|22px|alt=Plants|link=]]&nbsp;[[File:Wood.png|24px|alt=Wood|link=]]}}
 
| carnivorous and ovivorous = {{nowrap|[[File:MeatBig cropped.png|alt=Meat|link=]]&nbsp;[[File:Eggs fertilized cropped.png|alt=Eggs|link=]]}}
 
| omnivorous and ovivorous = {{nowrap|[[File:MeatBig cropped.png|alt=Meat|link=]]&nbsp;[[File:Eggs fertilized cropped.png|alt=Eggs|link=]]&nbsp;[[File:Potato plant.png|22px|alt=Plants|link=]]}}
 
| raw meat and corpses = [[File:MeatBig cropped.png|alt=Meat|link=]]}}
 
| {{#expr: {{#show: {{{1|Wild boar}}}|?Base Hunger Rate#}} * 1.6 round2}}
 
| {{#show: {{{1|Wild boar}}}|?Mob Average DPS#}}
 
| {{#show: {{{1|Wild boar}}}|?Move Speed Base#}}
 
| {{#expr: {{#show: {{{1|Wild boar}}}|?Turn Manhunter Chance When Attacked#}} *100}}%
 
| {{#expr: {{#show: {{{1|Wild boar}}}|?Turn Manhunter Chance When Taming#}} *100}}%
 
| {{#show: {{{1|Wild boar}}}|?Animal Filth Rate#}}
 
| {{#show: {{{1|Wild boar}}}|?Meat Yield#}}
 
| {{#show: {{{1|Wild boar}}}|?Leather Yield#}}
 
| {{#show: {{{1|Wild boar}}}|?Market Value Base#}}
 
| {{#show: {{{1|Wild boar}}}|?Life Expectancy#}}
 
| {{#show: {{{1|Wild boar}}}|?Maturity Age#}}
 
| {{#show: {{{1|Wild boar}}}|?Gestation Period Days#}}
 
| {{#if: {{#show: {{{1|Wild boar}}}|?Nuzzle Mtb Hours#}}|{{#show: {{{1|Wild boar}}}|?Nuzzle Mtb Hours#}}|Never}}
 
| {{#iferror: {{#expr:{{#var:adult_slaughter_production}}/{{#var:adult_slaughter_consumption}} round 2}} | NA}}
 
| {{#iferror: {{#expr:{{#var:baby_slaughter_production}}/{{#var:baby_slaughter_consumption}} round 2}} | NA}}
 
</includeonly>
 
<noinclude>[[Category:Customized table templates]]</noinclude>
 

Latest revision as of 09:25, 5 April 2024

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

Summary[edit]

This template pulls the data from each animal's individual page and formats it into a neat row summary. It is only intended for use on the List of animals page.

Usage[edit]

{{Animals/Row|?Name=}}

The template takes a single parameter, the name of the animal being referenced, which must be the exact name of the animal's main page.

Example[edit]

{| {{STDT| sortable c_08 text-center}}
! colspan="2" | Animal
! Min. Handling Skill
! Guard
! Attack
! Rescue
! Haul
! Diet
! [[Pen animal|Pens]]
! data-sort-type=number | Hunger Rate<ref>Nutrition lost per day.</ref>
! data-sort-type=number | Offspring Per Year
! data-sort-type=number | Meat Yield
! data-sort-type=number | Leather Yield
! data-sort-type=number | Average DPS
! Move Speed
! data-sort-type=number | Health Scale
! <abbr title="Chance of revenge when harmed">[[Mental break#Manhunter|Manhunter]]<br/>(Hunt)</abbr>
! <abbr title="Chance of revenge on a failed tame attempt">Manhunter<br/>(Tame)</abbr>
! data-sort-type=number | <abbr title="Nutrition of meat and milk out for each nutrition in, when babies are slaughtered, for a ratio of 4:1 females:males, and assuming constant pregnancy and immediate milking>Nutrition Efficiency (Baby Slaughter)</abbr>
! data-sort-type=number | <abbr title="Nutrition of meat and milk out for each nutrition in, when adults are slaughtered, for a ratio of 4:1 females:males, and assuming constant pregnancy and immediate milking>Nutrition Efficiency (Adult Slaughter)</abbr>
|-
{{Animals/Row|?Name=Horse}}
|-
{{Animals/Row|?Name=Yorkshire terrier}}
|}
<references/>
Animal Min. Handling Skill Guard Attack Rescue Haul Diet Pens Hunger Rate[1] Offspring Per Year Meat Yield Leather Yield Average DPS Move Speed Health Scale Manhunter
(Hunt)
Manhunter
(Tame)
Nutrition Efficiency (Baby Slaughter) Nutrition Efficiency (Adult Slaughter)
Horse Horse 2 Ex.png Ex.png Ex.png Ex.png Vegetables Plants Check.png 0.68 9 336 96 2.06 5.8 1.75 0% 0% 0.59 1.37
Yorkshire terrier Yorkshire terrier 0 Check.png Check.png Ex.png Ex.png Meat Eggs Vegetables Ex.png 0.24 11.6 45 20 1.09 3.1 0.4 0% 0% 0.55 0.53
  1. Nutrition lost per day.