Difference between revisions of "Template:ShowSkillCaps"

From ChatWars Wiki
Jump to: navigation, search
(updated to stupid hardcoded structure (unfinished) because dynamic querying isn't possible in SMW)
Line 1: Line 1:
{{#vardefine: class | {{{class|none}}} }}{{#vardefine: lowerBound | {{{boundaryLow|20}}} }}{{#vardefine: upperBound | {{{boundaryUp|39}}} }}{{#vardefine: queryText | Level}}{{#vardefine: i | {{#var: lowerBound}} }}<includeonly><!--
+
{{#vardefine: class | {{{class|none}}} }}{{#vardefine: showSection | {{{showSection|0}}} }}{{#vardefine: lowerBound | 0}}} }}{{#vardefine: upperBound | 0}}} }}{{#vardefine: class | {{{Class|}}} }}{{#vardefine: i | 0 }}<includeonly><!--
 
-->{{#switch: {{#var: class}}
 
-->{{#switch: {{#var: class}}
 
   | Ranger = {{#vardefine: queryText | RnLevel }}
 
   | Ranger = {{#vardefine: queryText | RnLevel }}
Line 7: Line 7:
 
   | Blacksmith = {{#vardefine: queryText | BsLevel }}
 
   | Blacksmith = {{#vardefine: queryText | BsLevel }}
 
   | Collector = {{#vardefine: queryText | ClLevel }}
 
   | Collector = {{#vardefine: queryText | ClLevel }}
}}
+
}}<!--
{{#ifeq: {{{standalone|true}}} | false
+
-->{{#switch: {{#var: showSection}}
 +
  | 0 = {{#vardefine: lowerBound | 10}}{{#vardefine: upperBound | 19}}
 +
  | 1 = {{#vardefine: lowerBound | 20}}{{#vardefine: upperBound | 39}}
 +
  | 2 = {{#vardefine: lowerBound | 40}}{{#vardefine: upperBound | 59}}
 +
  | 3 = {{#vardefine: lowerBound | 60}}{{#vardefine: upperBound | 79}}
 +
  | 4 = {{#vardefine: lowerBound | 80}}{{#vardefine: upperBound | 99}}
 +
}}<!--
 +
 
 +
Generates the header that's needed in case the skill caps are to be displayed standalone (as in, not integrated in another table)
 +
-->{{#ifeq: {{{standalone|true}}} | false
 
   |
 
   |
 
   | {{{!}}class="wikitable" style="width: 90%; text-align: center"
 
   | {{{!}}class="wikitable" style="width: 90%; text-align: center"
{{!}}+ Skill caps for levels 20-39
+
{{!}}+ Skill caps for levels {{#var: lowerBound}}-{{#var: upperBound}}
 
{{!}}-
 
{{!}}-
 
!scope="col" style="width: 10%; text-align: left"{{!}}Skill / Level
 
!scope="col" style="width: 10%; text-align: left"{{!}}Skill / Level
Line 21: Line 30:
 
}}
 
}}
 
|-
 
|-
{{#ask: [[{{{source|{{PAGENAME}} }}}]]
+
{{#switch: {{#var: showSection}}
<!--|link=none-->
+
  | 0 = {{#ask: [[{{{source|{{PAGENAME}} }}}]]
|headers=hide
+
          |headers=hide
|format=template
+
          |format=template
|template=SkillRow
+
          |template=SkillRow
|?BoolSpecialSkill
+
          |?BoolSpecialSkill
|?Description#
+
          |?Description#
 +
 
 +
          |?Level10
 +
          |?Level11
 +
          |?Level12
 +
          |?Level13
 +
          |?Level14
 +
          |?Level15
 +
          |?Level16
 +
          |?Level17
 +
          |?Level18
 +
          |?Level19
 +
        }}
 +
  | 1 = {{#ask: [[{{{source|{{PAGENAME}} }}}]]
 +
          |headers=hide
 +
          |format=template
 +
          |template=SkillRow
 +
          |?BoolSpecialSkill
 +
          |?Description#
 +
 
 +
          |?Level20
 +
          |?Level21
 +
          |?Level22
 +
          |?Level23
 +
          |?Level24
 +
          |?Level25
 +
          |?Level26
 +
          |?Level27
 +
          |?Level28
 +
          |?Level29
 +
 
 +
          |?Level30
 +
          |?Level31
 +
          |?Level32
 +
          |?Level33
 +
          |?Level34
 +
          |?Level35
 +
          |?Level36
 +
          |?Level37
 +
          |?Level38
 +
          |?Level39
 +
        }}
 +
  | 1 = {{#ask: [[{{{source|{{PAGENAME}} }}}]]
 +
          |headers=hide
 +
          |format=template
 +
          |template=SkillRow
 +
          |?BoolSpecialSkill
 +
          |?Description#
 +
 
 +
          |?Level40
 +
          |?Level41
 +
          |?Level42
 +
          |?Level43
 +
          |?Level44
 +
          |?Level45
 +
          |?Level46
 +
          |?Level47
 +
          |?Level48
 +
          |?Level49
  
<!--|?{{#var: queryText}}{{#var:i}}#<br>-->
+
          |?Level50
{{#vardefine: i | {{#var: lowerBound}} }}{{#while:
+
          |?Level51
  | {{#ifexpr: {{#var: i}} < {{#expr: {{#var: upperBound}} + 1 }} | true }}
+
          |?Level52
  | {{#var: line}}?{{#var: queryText}}{{#var:i}}#<br>
+
          |?Level53
    {{#vardefine: i | {{#expr: {{#var: i}} + 1 }} }}
+
          |?Level54
}}
+
          |?Level55
 +
          |?Level56
 +
          |?Level57
 +
          |?Level58
 +
          |?Level59
 +
        }}
 
}}
 
}}
 
{{#ifeq: {{{standalone|true}}} | false
 
{{#ifeq: {{{standalone|true}}} | false

Revision as of 12:34, 4 February 2019

} }}} }}

This template shows the skill caps of a skill within certain boundaries If parameter "standalone" is set to true (default), it generates a table head to be used completely on its own, if set to false it only shows the name, description and skill caps without adding wikitable beginnings and ends