Template:ConditionChange: Difference between revisions

From PZwiki
No edit summary
m (Automated Formatting)
 
(14 intermediate revisions by 4 users not shown)
Line 1: Line 1:
<includeonly>
{{#ifexpr:{{{MoodletChange}}}>0|'''{{{MoodletName}}}:''' <font style="color:red">{{{MoodletChange}}}<BR /></font>|}}
{{#ifexpr:{{{MoodletChange}}}<0|'''{{{MoodletName}}}:''' <font style="color:green">{{{MoodletChange}}}</font><BR />|}}
{{#ifexpr:1{{{DangerousUncooked}}}=11|<font style="color:red">This food is dangerous uncooked and may make you [[Moodles#Sick|sick]].</font><BR />|}}
{{#ifexpr:1{{{WillMakeSick}}}=11|<font style="color:red">Consuming this will make you [[Moodles#Sick|sick]].</font><BR />|}}</includeonly>
<noinclude>
<noinclude>
{{documentation}}
{{Documentation/sandbox|doc=
[[category:templates]]
This template is a sub-template for use by other templates like the items and consumables template.
</noinclude>
 
== Description ==
It currently has three functions:
# It is designed to evaluate the value of changes to status moodlets and color the value red or green as appropriate.
# It will display warning text if a food is dangerous to eat.
# It will display warning text if a food is dangerous to eat only when uncooked.
 
===Parameters===
 
;<code>MoodletName</code>
:An arbitrary text string which will be repeated back verbatim as italicized text.
;<code>MoodletChange</code>
:A signed integer value that is evaluated and colored green if a negative number, and red if a positive integer.
;<code>DangerousUncooked</code>
:A binary true/false value that if true will display warning text.
;<code>WillMakeSick</code>
:A binary true/false value that if true will display warning text.
 
==Examples==
 
===Status moodle changes===
{{tll|ConditionChange|MoodletName{{=}}Thirst|MoodletChange{{=}}+15}}
;Produces
{{ConditionChange|MoodletName=Thirst|MoodletChange=+15}}
 
{{tll|ConditionChange|MoodletName{{=}}OopsIMadeATypo|MoodletChange{{=}}-15}}
;Produces
{{ConditionChange|MoodletName=OopsIMadeATypo|MoodletChange=-15}}
 
 
===Status moodle warnings===
{{tll|ConditionChange|DangerousUncooked{{=}}1}}
;Produces
{{ConditionChange|DangerousUncooked=1}}
 
{{tll|ConditionChange|WillMakeSick{{=}}1}}
;Produces
{{ConditionChange|WillMakeSick=1}}
 
}}
{{ll|Category:Templates}}
</noinclude><includeonly>{{#ifexpr:{{{MoodletChange|0}}}>0
  |'''{{{MoodletName|0}}}:''' <font style="color:#B65535">'''{{{MoodletChange|0}}}'''</font>
}}{{#ifexpr:{{{MoodletChange|0}}}<0
  |'''{{{MoodletName|0}}}:''' <font style="color:#4AD031">'''{{{MoodletChange|0}}}'''</font>
}}{{#ifexpr:{{{DangerousUncooked|0}}}=1
  |<font style="color:#DB2A20">'''Dangerous uncooked, may cause [[Moodles#Sick|sickness]]'''.</font>
}}{{#ifexpr:{{{WillMakeSick|0}}}=1
  |<font style="color:#DB2A20">'''Dangerous, will cause [[Moodles#Sick|sickness]]'''.</font>
}}</includeonly>

Latest revision as of 13:49, 14 April 2024

Notebook.pngTemplate Documentation

This template is a sub-template for use by other templates like the items and consumables template.

Description

It currently has three functions:

  1. It is designed to evaluate the value of changes to status moodlets and color the value red or green as appropriate.
  2. It will display warning text if a food is dangerous to eat.
  3. It will display warning text if a food is dangerous to eat only when uncooked.

Parameters

MoodletName
An arbitrary text string which will be repeated back verbatim as italicized text.
MoodletChange
A signed integer value that is evaluated and colored green if a negative number, and red if a positive integer.
DangerousUncooked
A binary true/false value that if true will display warning text.
WillMakeSick
A binary true/false value that if true will display warning text.

Examples

Status moodle changes

{{ConditionChange|MoodletName=Thirst|MoodletChange=+15}}

Produces

Thirst: +15

{{ConditionChange|MoodletName=OopsIMadeATypo|MoodletChange=-15}}

Produces

OopsIMadeATypo: -15


Status moodle warnings

{{ConditionChange|DangerousUncooked=1}}

Produces

Dangerous uncooked, may cause sickness.

{{ConditionChange|WillMakeSick=1}}

Produces

Dangerous, will cause sickness.

Editors can experiment in this template's sandbox.