From GamingWiki
Line 3: | Line 3: | ||
{| class="infobox" | {| class="infobox" | ||
<onlyinclude><!-- | <onlyinclude><!-- | ||
+ | |||
+ | -->{{#vardefine: defaultskillclass | skill }}<!-- | ||
+ | -->{{#vardefine: defaultskillranks | Average (+1) :: Decent (+2) :: Good (+3) :: Great (+4) :: Superb (+5) }}<!-- | ||
+ | -->{{#vardefine: defaultskilltypes | combat track }}<!-- | ||
+ | -->{{#vardefine: defaultskillmarks | }}<!-- | ||
+ | |||
+ | Parse a list of skills and their attributes | ||
+ | -->{{#if: {{{skilllist|}}} |<!-- | ||
+ | -->{{#hashdefine: skilllisthash }}<!-- | ||
+ | -->{{#arraydefine: skillgroupsarray | {{{skilllist}}} | ;; }}<!-- | ||
+ | -->{{#arrayprint: skillgroupsarray | | $skilllistline$ | <!-- | ||
+ | -->{{#arraydefine: skillgrouparray | $skilllistline$ | :: }}<!-- | ||
+ | -->{{#vardefine: skillgroupname | {{#arrayindex: skillgrouparray | 0}} }}<!-- | ||
+ | -->{{#arrayslice: skillgrouparray | skillgrouparray | 1 }}<!-- | ||
+ | -->{{#arrayprint: skillgrouparray | | $skillstring$ | <!-- | ||
+ | -->{{#vardefine: skillname | {{#explode: $skillstring$ | // | 0 }} }}<!-- | ||
+ | -->{{#vardefine: skillattr | {{#explode: $skillstring$ | // | 1 }} }}<!-- | ||
+ | -->{{#hashinclude: skilllisthash | {{$var:skillname}} = 0 }}<!-- | ||
+ | -->{{#hashinclude: skillhash-{{#var:skillname}} | ||
+ | | group = {{#var:skillgroupname}} | ||
+ | | attributes = {{#var:skillgroupattr}} | ||
+ | }}<!-- | ||
+ | -->}}<!-- | ||
+ | -->}}<!-- | ||
+ | -->}}<!-- | ||
-->{{#vardefine: cols | {{{columns|6}}} }}<!-- | -->{{#vardefine: cols | {{{columns|6}}} }}<!-- | ||
Define the types of skills available. These each have their own class, too. | Define the types of skills available. These each have their own class, too. | ||
− | -->{{#vardefine: skillClass | {{{skillclass}}} }}<!-- | + | -->{{#vardefine: skillClass | {{{skillclass |{{#var:defaultskillclass}} }}} }}<!-- |
− | -->{{#arraydefine: skilltypearray | {{{skilltypes}}} | /\s+/ }}<!-- | + | -->{{#arraydefine: skilltypearray | {{{skilltypes |{{#var:defaultskilltypes}} }}} | /\s+/ }}<!-- |
-->{{#arraytohash: classhash | skilltypearray | skilltypearray }}<!-- | -->{{#arraytohash: classhash | skilltypearray | skilltypearray }}<!-- | ||
We may have custom skill ranks. | We may have custom skill ranks. | ||
− | -->{{#arraydefine: skilllevelarray | {{{skillranks}}} | :: }}<!-- | + | -->{{#arraydefine: skilllevelarray | {{{skillranks |{{#var:defaultskillranks}} }}} | :: }}<!-- |
-->{{#arraymerge: skilllevelsreverse | skilllevelarray }}<!-- | -->{{#arraymerge: skilllevelsreverse | skilllevelarray }}<!-- | ||
-->{{#arraysort: skilllevelsreverse | reverse }}<!-- | -->{{#arraysort: skilllevelsreverse | reverse }}<!-- | ||
Line 18: | Line 43: | ||
There are various skill markers that may be defined -- these go into a hash. | There are various skill markers that may be defined -- these go into a hash. | ||
− | -->{{#hashdefine: skillmarkerhash | {{{skillmarkers}}} | :: | /\/\// }}<!-- | + | -->{{#hashdefine: skillmarkerhash | {{{skillmarkers|{{#var:defaultskillmarks}} }}} | :: | /\/\// }}<!-- |
Use a hash to store and then print the skills | Use a hash to store and then print the skills | ||
Line 68: | Line 93: | ||
-->{{#arraydefine: skillpartkeys | name, marker}}<!-- | -->{{#arraydefine: skillpartkeys | name, marker}}<!-- | ||
− | -->{{#hashprint: skillhash || $ | + | -->{{#hashprint: skillhash || $skillrank$ | $skline$ | <!-- |
-->{{#arraydefine: skilllineary | $skline$ | :: }}<!-- | -->{{#arraydefine: skilllineary | $skline$ | :: }}<!-- | ||
-->{{#if: $skline$ |<!-- | -->{{#if: $skline$ |<!-- | ||
Line 74: | Line 99: | ||
-->| labelclass1 = label <!-- | -->| labelclass1 = label <!-- | ||
-->| dataclass1 = {{#var: skillClass }} <!-- | -->| dataclass1 = {{#var: skillClass }} <!-- | ||
− | -->| label1 = {{#arrayindex: skilllevelarray | {{#expr: $ | + | -->| label1 = {{#arrayindex: skilllevelarray | {{#expr: $skillrank$ -1}} }}<!-- |
-->| data1 = <!-- | -->| data1 = <!-- | ||
-->{{#arrayprint: skilllineary | , | $theskill$ | <!-- | -->{{#arrayprint: skilllineary | , | $theskill$ | <!-- | ||
-->{{#arraydefine: theskillarray | $theskill$ | /\/\// }}<!-- | -->{{#arraydefine: theskillarray | $theskill$ | /\/\// }}<!-- | ||
-->{{#arraytohash: theskillhash | theskillarray | skillpartkeys }}<!-- | -->{{#arraytohash: theskillhash | theskillarray | skillpartkeys }}<!-- | ||
− | -->{{#vardefine: theskilltag | {{lc:{{#replace:{{# | + | -->{{#vardefine: theskillname | {{#hashvalue: theskillhash | name}} }}<!-- |
+ | -->{{#vardefine: theskilltag | {{lc:{{#replace:{{#var: theskillname}}||-}}}}}}<!-- | ||
+ | |||
--><span class="{{#var:skillClass}} skill-{{#var:theskilltag}}"><!-- | --><span class="{{#var:skillClass}} skill-{{#var:theskilltag}}"><!-- | ||
− | -->{{# | + | -->{{#var: theskillname }}<!-- |
--></span> <!-- | --></span> <!-- | ||
-->{{#hashvalue: skillmarkerhash | {{#hashvalue: theskillhash | marker}} }}<!-- | -->{{#hashvalue: skillmarkerhash | {{#hashvalue: theskillhash | marker}} }}<!-- | ||
+ | Add SMW property | ||
+ | -->{{#if:{{#var:theskillname}}|{{#set: skill/{{#var:theskillname}}=$skillrank$ }}}}<!-- | ||
+ | |||
-->{{#arrayreset: theskillarray}}<!-- | -->{{#arrayreset: theskillarray}}<!-- | ||
-->{{#hashreset: theskillhash}}<!-- | -->{{#hashreset: theskillhash}}<!-- |
Revision as of 21:24, 11 April 2011
[create]
Error creating thumbnail: File missing
Template documentation Editors can experiment in this template's sandbox (create) and testcases (create) pages. Please add categories and interwikis to the /doc subpage. Subpages of this template. |
Skills |