From GamingWiki
Jump to: navigation, search
 
(7 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
{{Documentation}}
 
{{Documentation}}
  
<onlyinclude><!--
+
== Example skill modes ==
  
-->{{#vardefine: modeType | {{{mode type | {{{1 | }}} }}} }}<!--
+
<!--
  
-->{{#hashdefine: allModes <!--
+
--><onlyinclude><!--
 +
 
 +
-->{{#vardefine: modeType | {{{type | {{{1 | }}} }}} }}<!--
 +
-->{{#vardefine: campaign | {{{campaign | {{{2 | }}} }}} }}<!--
 +
 
 +
--><noinclude><!--
 +
  -->{{#vardefine: modeType | default }}<!--
 +
  -->{{#vardefine: campaign | Humans are the Worst }}<!--
 +
--></noinclude><!--
 +
 
 +
-->{{#arraydefine: allModesArray <!--
 
-->| {{#ask:
 
-->| {{#ask:
 
         [[is a::skill mode]]
 
         [[is a::skill mode]]
 
         {{#if: {{#var: modeType}} | [[mode type::{{#var: modeType}}]] }}
 
         {{#if: {{#var: modeType}} | [[mode type::{{#var: modeType}}]] }}
         {{#if: {{{campaign|}}} | [[campaign::{{{campaign}}}]] }}
+
         {{#if: {{#var: campaign}} | [[campaign::{{#var:campaign}}]] }}
       |?Name
+
       |?mode name
       |?Includes skill
+
       |?includes skill
 +
      |?includes stunt
 
       |format=array
 
       |format=array
 
       |mainlabel=-
 
       |mainlabel=-
 
       }} <!--
 
       }} <!--
-->| , | <PROP> }}<!--
+
-->| , }}<!--
 +
 
 +
-->{{#hashdefine: allModes}}<!--
 +
-->{{#arrayprint: allModesArray | | <line> | <!--
 +
  -->{{#arraydefine: modeLine  | <line> | <PROP>}}<!--
 +
  -->{{#vardefine:  modeName  | {{#arrayindex: modeLine | 0}} }}<!--
 +
  -->{{#arrayslice:  modeParts | modeLine | 1}}<!--
 +
  -->{{#hashinclude: allModes  | {{#var: modeName}} = {{#arrayprint: modeParts | <PROP> }} }}<!--
 +
  -->{{#arrayreset: modeLine | modeParts }}<!--
 +
-->}}<!--
 +
-->{{#arrayreset: allModesArray}}<!--
 +
 
 +
  Pick up just the hash keys:
 
-->{{#hashtoarray: | allModes | modeNames}}<!--
 
-->{{#hashtoarray: | allModes | modeNames}}<!--
 
-->{{#arraysort: modeNames | asc}}<!--
 
-->{{#arraysort: modeNames | asc}}<!--
Line 26: Line 49:
 
       --><nowiki/>
 
       --><nowiki/>
 
{| class="infobox" <!--
 
{| class="infobox" <!--
-->{{#hashprint: allModes | | <modename> | <modeskills> | <!--
+
-->{{#hashprint: allModes | | <modename> | <modeline> | <!--
  
 
   -->{{#hashinclude: headerHash | {{#var:modeCount}} = <modename> }}<!--
 
   -->{{#hashinclude: headerHash | {{#var:modeCount}} = <modename> }}<!--
   -->{{#arraydefine: skillsArray | <modeskills> | <MANY>}}<!--
+
   -->{{#arraydefine: skillsArray | {{#explode: <modeline> | <PROP> | 0}} | <MANY>}}<!--
 
   -->{{#hashinclude: skillsHash  | {{#var:modeCount}} = {{#arrayprint: skillsArray | <br/>}} }}<!--
 
   -->{{#hashinclude: skillsHash  | {{#var:modeCount}} = {{#arrayprint: skillsArray | <br/>}} }}<!--
 +
  -->{{#if:{{#vardefineecho: currentStunts|{{#explode: <modeline> | <PROP> | 1}}}} |<!--
 +
      -->{{#arraydefine: stuntsArray | {{#var: currentStunts}} | <MANY>}}<!--
 +
      -->{{#hashinclude: stuntsHash  | {{#var:modeCount}} = {{#arrayprint: stuntsArray | <br/> | <stunt> | Stunt: [[<stunt>]] }} }}<!--
 +
  -->}}<!--
  
 
   -->{{#vardefine: modeCount | {{#expr: {{#var: modeCount}} +1}} }}<!--
 
   -->{{#vardefine: modeCount | {{#expr: {{#var: modeCount}} +1}} }}<!--
  
 
   -->{{#ifexpr: {{#var: modeCount}} mod 3 = 0 or {{#var: modeCount}} >= {{#arraysize: modeNames}} | <!--  
 
   -->{{#ifexpr: {{#var: modeCount}} mod 3 = 0 or {{#var: modeCount}} >= {{#arraysize: modeNames}} | <!--  
       -->{{#hashprint: headerHash || <num> | <header> | <nowiki/>
+
       -->{{#vardefine: loopCount | {{#expr: (({{#var: modeCount}}-1) mod 3) + 1}} }}<!--
! <header> }}<nowiki/>
+
      -->{{#vardefine: loopFrom | {{#expr: {{#var: modeCount}} - {{#var: loopCount}} }} }}<!--
 +
      -->{{#loop: modeNum | {{#var: loopFrom}} | {{#var: loopCount}} |<nowiki/>
 +
! {{#hashvalue: headerHash | {{#var: modeNum}} | &nbsp; }} <!--
 +
      -->}}<nowiki/>
 +
{{!}}- <!--
 +
      -->{{#loop: modeNum | {{#var: loopFrom}} | {{#var: loopCount}} |<nowiki/>
 +
{{!}} {{#hashvalue: skillsHash | {{#var: modeNum}} | &nbsp; }} <!--
 +
      -->}}<nowiki/>
 +
{{!}}- <!--
 +
      -->{{#if: {{#hashsize: stuntsHash}} |<!--
 +
        -->{{#loop: modeNum | {{#var: loopFrom}} | {{#var: loopCount}} |<nowiki/>
 +
{{!}} {{#hashvalue: stuntsHash | {{#var: modeNum}} | &nbsp; }} <!--
 +
        -->}}<nowiki/>
 
{{!}}- <!--
 
{{!}}- <!--
       -->{{#hashprint: skillsHash || <num> | <skills> | <nowiki/>
+
       -->}}<!--
{{!}} <skills> }}<nowiki/>
+
       -->{{#arrayreset: skillsArray|stuntsArray}}<!--
{{!}}-<!--
+
       -->{{#hashreset:  headerHash|skillsHash|stuntsHash}}<!--
       -->{{#arrayreset: skillsArray}}<!--
 
       -->{{#hashreset:  headerHash|skillsHash}}<!--
 
 
   -->}}<!-- end ifexpr
 
   -->}}<!-- end ifexpr
  
 
-->| modeNames }}<!--
 
-->| modeNames }}<!--
 +
 +
-->{{#arrayreset: modeNames}}<!--
 +
-->{{#hashreset: allModes}}<!--
  
 
--><nowiki/>  
 
--><nowiki/>  
 
|}</onlyinclude>
 
|}</onlyinclude>

Latest revision as of 19:47, 4 July 2014

[create]
Error creating thumbnail: File missing
Template documentation

Example skill modes[edit]

Template:((#ask:
        is a::skill mode
        mode type::default
        campaign::Humans are the Worst
?mode name ?includes skill ?includes stunt format
array mainlabel=-
     Template:)) =