Difference between revisions of "Template:Section"

From RimWorld Wiki
Jump to navigation Jump to search
(templatize some redundant sections like heat, light, and fuel)
 
m
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
 
<includeonly>
 
<includeonly>
{{#Switch: {{{1}}}
+
{{#Switch: {{{1|}}}
| Light = light section
+
| Light = {{Q|Torch lamp|Name}} produces light in a {{Q|Torch lamp|Light Radius}} tile radius.<br />50% light: {{Lit Radius|10|{{#expr:252+187+113}}|0.5}}<br />30% light: {{Lit Radius|10|{{#expr:252+187+113}}|0.3}}<br />0% light: {{Lit Radius|10|{{#expr:252+187+113}}|0.0}}<br />
 
| Heat = heat section
 
| Heat = heat section
 
| Fuelable = fuelable section
 
| Fuelable = fuelable section
 
| Mineable = mineable section
 
| Mineable = mineable section
 
| Default
 
| Default
}}
+
}}</includeonly>
</includeonly>
 
 
<noinclude>{{Documentation}}</noinclude>
 
<noinclude>{{Documentation}}</noinclude>

Latest revision as of 16:58, 23 August 2024

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

Overview[edit]

Used for objects to automate the content of sections like heat, light, and fuel.

{{#if: {{{glowradius|}}} |
  {{#if: {{#var:setProperty}} | {{#set:Glow Radius = {{{glowradius|}}} }} }}
}}
{{#if: {{{glowcolor|}}} |
  {{#if: {{#var:setProperty}} | {{#set:Glow Color = {{{glowcolor|}}} }} }}
  {{#vardefine:Red  | {{#replace:{{#explode:{{{glowcolor|}}}|,|0}}|(}} }}
  {{#vardefine:Green| {{#explode:{{{glowcolor|}}}|,|1}} }}
  {{#vardefine:Blue | {{#replace:{{#explode:{{{glowcolor|}}}|,|2}}|)}} }}
  {{#vardefine:LightRadius|{{Lit Radius|{{{glowradius|}}}|{{#expr:{{#var:Red}}+{{#var:Green}}+{{#var:Blue}} }} }} }}
  {{#if: {{#var:setProperty}} | {{#set:Light Radius = {{#var:LightRadius}} }} }}
;<abbr title="The furthest away a tile can be before it falls below 30% light">Light Radius</abbr>
:{{#expr:{{#var:LightRadius}} round 2}} <!--
Color Square: --><abbr title="RGB: {{{glowcolor|}}}"><span><div style="width:16px;height:16px;background-color:rgb({{#var:Red}},{{#var:Green}},{{#var:Blue}});display:inline-block;border:1px solid black;vertical-align:middle;"></div></span></abbr>
}}

Usage[edit]

{{Section|Light}}

Torch lamp produces light in a 7.175 tile radius.
50% light: 5.9307552253293
30% light: 7.1749373541663
0% light: 9.06579794414

{{Section|Heat}}

heat section

{{Section|Fuelable}}

fuelable section

{{Section|Mineable}}

mineable section