Template:ConditionChange: Difference between revisions

From PZwiki
No edit summary
No edit summary
Line 1: Line 1:
<includeonly>{{#ifexpr:{{{MoodletChange|}}}>0|'''{{{MoodletName}}}:''' <font style="color:red">{{{MoodletChange}}}<BR /></font>|}}{{#ifexpr:{{{MoodletChange|}}}|'''{{{MoodletName}}}:''' <font style="color:green">{{{MoodletChange}}}</font><BR />|}}{{#ifexpr:{{{DangerousUncooked|0}}}=1|<font style="color:red">This food is dangerous uncooked and may make you [[Moodles#Sick|sick]].</font><BR />|}}{{#ifexpr:{{{WillMakeSick|0}}}=1|<font style="color:red">Consuming this will make you [[Moodles#Sick|sick]].</font><BR />|}}</includeonly>
<includeonly>{{#ifexpr:{{{MoodletChange}}}>0|'''{{{MoodletName}}}:''' <font style="color:red">{{{MoodletChange}}}<BR /></font>|}}{{#ifexpr:{{{MoodletChange}}}|'''{{{MoodletName}}}:''' <font style="color:green">{{{MoodletChange}}}</font><BR />|}}{{#ifexpr:{{{DangerousUncooked|0}}}=1|<font style="color:red">This food is dangerous uncooked and may make you [[Moodles#Sick|sick]].</font><BR />|}}{{#ifexpr:{{{WillMakeSick|0}}}=1|<font style="color:red">Consuming this will make you [[Moodles#Sick|sick]].</font><BR />|}}</includeonly>
<noinclude>{{documentation}}[[category:templates]]</noinclude>
<noinclude>{{documentation}}[[category:templates]]</noinclude>

Revision as of 03:31, 10 December 2013

[view] [edit] [history] [purge] Template 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.

It takes the following input variables:

  • 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 moodlet changes

Syntax Produces

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

Thirst: +15
Thirst: +15

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

OopsIMadeATypo: -15


Status moodlet warnings

Syntax Produces

{{ConditionChange|DangerousUncooked=1}}

Expression error: Unrecognized punctuation character "{".Expression error: Unrecognized punctuation character "{".This food is dangerous uncooked and may make you sick.

{{ConditionChange|WillMakeSick=1}}

Expression error: Unrecognized punctuation character "{".Expression error: Unrecognized punctuation character "{".Consuming this will make you sick.
Documentation transcluded from Template:ConditionChange/doc.
Editors can experiment in this template's sandbox (create)