Badge time.png   The Paragon Wiki Archive documents the state of City of Heroes/Villains as it existed on December 1, 2012.

Difference between revisions of "Template talk:TypeDefVal"

From Paragon Wiki Archive
Jump to: navigation, search
(New page: Trying to make sense of this template: <pre> Def'''(''' {{#ifeq:{{{1|0|}}} | 0 ||{{color|#333333;font-weight: bold|S {{#if: {{{s|}}} | {{color|red;font-weight: normal|-'''{{{1|0}}}'''}}...)
 
(The DefVal template call was making this page show up in Candidates for Deletion)
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
Trying to make sense of this template:
+
== Logic ==
 +
Trying to make sense of this template: -[[User:Konoko|Konoko]]
 
<pre>
 
<pre>
 
Def'''('''
 
Def'''('''
{{#ifeq:{{{1|0|}}} | 0 ||{{color|#333333;font-weight: bold|S
+
<!-- Test if parameter is zero -->
  {{#if: {{{s|}}} |
+
{{#ifeq:{{{1|0|}}} | 0  
  {{color|red;font-weight: normal|-'''{{{1|0}}}'''}}|{{{1|0}}}
+
|<!-- True: do nothing, display nothing -->
 +
|<!-- False: Set color of text to follow -->{{color|#333333;font-weight: bold|S<!--
 +
  +++ After letter for type of defense, test for negative value parameter -->
 +
  {{#if: {{{s|}}}
 +
  |<!-- True, parameter exists: set color for debuff -->{{color|red;font-weight: normal|-'''{{{1|0}}}'''}}
 +
  |<!-- False, parameter does not exist, do not change color, only display number entered -->{{{1|0<!-- zero is defined here... why?-->}}}
 
   }}
 
   }}
 
  }}
 
  }}
 
}}
 
}}
{{#ifeq:{{{2|0|}}} | 0 ||{{color|#999999;font-weight: bold|L
+
{{#ifeq:{{{2|0|}}} | 0  
{{#if: {{{l|}}} |
+
|
  {{color|red;font-weight: normal|-'''{{{2|0}}}'''}}|{{{2|0}}}
+
|{{color|#999999;font-weight: bold|L
 +
  {{#if: {{{l|}}}
 +
  |{{color|red;font-weight: normal|-'''{{{2|0}}}'''}}
 +
  |{{{2|0}}}
 
   }}
 
   }}
 
  }}
 
  }}
 
}}
 
}}
{{#ifeq:{{{3|0|}}} | 0 ||{{color|orange;font-weight: bold|F{{#if: {{{f|}}} |{{color|red;font-weight: normal|-'''{{{3|0}}}'''}}|{{{3|0}}}}}}}}} {{#ifeq:{{{4|0|}}} | 0 ||{{color|#25a9bc;font-weight: bold|C{{#if: {{{c|}}} |{{color|red;font-weight: normal|-'''{{{4|0}}}'''}}|{{{4|0}}}}}}}}} {{#ifeq:{{{5|0|}}} | 0 ||{{color|aqua;font-weight: bold|E{{#if: {{{e|}}} |{{color|red;font-weight: normal|-'''{{{5|0}}}'''}}|{{{5|0}}}}}}}}} {{#ifeq:{{{6|0|}}} | 0 ||{{color|#2f024e;font-weight: bold|N{{#if: {{{n|}}} |{{color|red;font-weight: normal|-'''{{{6|0}}}'''}}|{{{6|0}}}}}}}}} {{#ifeq:{{{7|0|}}} | 0 ||{{color|#ed7ce9;font-weight: bold|P{{#if: {{{p|}}} |{{color|red;font-weight: normal|-'''{{{7|0}}}'''}}|{{{7|0}}}}}}}}} ''')'''
+
<!-- snip -->
</pre><noinclude>
+
''')'''
 +
</pre>
 +
<pre>{{{1|0<!-- zero is defined here... why?-->}}}</pre>
 +
:Good point. Artifact from when 0's were displayed. I oughta remove those. -- [[User:Baalus Seth|Baalus Seth]] 01:06, 7 January 2009 (UTC)
 +
 
 +
<noinclude>
  
 
==Defense Template==
 
==Defense Template==
Line 23: Line 37:
 
==Use==
 
==Use==
 
<nowiki>{{DefVal|10|10|0|0|20|e=-}}</nowiki><br>
 
<nowiki>{{DefVal|10|10|0|0|20|e=-}}</nowiki><br>
{{DefVal|10|10|0|0|20|e=-}}
+
<!--{{DefVal|10|10|0|0|20|e=-}}-->
 
*List the defenses in order: Smashing, Lethal, Fire, Cold, Energy, Negative Energy, Psychic.
 
*List the defenses in order: Smashing, Lethal, Fire, Cold, Energy, Negative Energy, Psychic.
 
*Trailing 0s are unneccessary.
 
*Trailing 0s are unneccessary.
 
*e=- denotes the energy defense as a debuff. The first letter of the defense type is used.
 
*e=- denotes the energy defense as a debuff. The first letter of the defense type is used.
 
</noinclude>
 
</noinclude>

Latest revision as of 02:57, 4 February 2009

Logic

Trying to make sense of this template: -Konoko

Def'''('''
<!-- Test if parameter is zero -->
{{#ifeq:{{{1|0|}}} | 0 
 |<!-- True: do nothing, display nothing -->
 |<!-- False: Set color of text to follow -->{{color|#333333;font-weight: bold|S<!--
 +++ After letter for type of defense, test for negative value parameter -->
  {{#if: {{{s|}}}
   |<!-- True, parameter exists: set color for debuff -->{{color|red;font-weight: normal|-'''{{{1|0}}}'''}}
   |<!-- False, parameter does not exist, do not change color, only display number entered -->{{{1|0<!-- zero is defined here... why?-->}}}
  }}
 }}
}}
{{#ifeq:{{{2|0|}}} | 0 
 |
 |{{color|#999999;font-weight: bold|L
  {{#if: {{{l|}}}
   |{{color|red;font-weight: normal|-'''{{{2|0}}}'''}}
   |{{{2|0}}}
  }}
 }}
}}
<!-- snip -->
''')'''
{{{1|0<!-- zero is defined here... why?-->}}}
Good point. Artifact from when 0's were displayed. I oughta remove those. -- Baalus Seth 01:06, 7 January 2009 (UTC)


Defense Template

This template is meant to show the defense values of a power in a easily visible format.

Use

{{DefVal|10|10|0|0|20|e=-}}

  • List the defenses in order: Smashing, Lethal, Fire, Cold, Energy, Negative Energy, Psychic.
  • Trailing 0s are unneccessary.
  • e=- denotes the energy defense as a debuff. The first letter of the defense type is used.