Template:Section

From RimWorld Wiki
Revision as of 04:27, 23 August 2024 by JuliaCat (talk | contribs)
Jump to navigation Jump to search
Documentation icon Template documentation[view] [edit] [history] [purge]

Overview

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

{{Section|Light}}

light section

{{Section|Heat}}

heat section

{{Section|Fuelable}}

fuelable section

{{Section|Mineable}}

mineable section