From GamingWiki
Jump to: navigation, search
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
{{Documentation}}<!--
 
{{Documentation}}<!--
 +
 +
-->{{#if: {{#vardefineecho: debug | }} | debug mode enabled <br />}}<!--
  
 
-->{{#vardefine: cols | {{{columns|6}}} }}<!--
 
-->{{#vardefine: cols | {{{columns|6}}} }}<!--
  
-->{{#if: {{#vardefineecho: debug |  }} | debug mode enabled}}
+
-->
 
 
{| class="infobox"
 
 
<onlyinclude><!--
 
<onlyinclude><!--
  
Line 31: Line 31:
 
   * Level: skill level, i.e, untrained, trained, focused or specialized
 
   * Level: skill level, i.e, untrained, trained, focused or specialized
  
-->{{#vardefine:modeGood|{{{mode good|Banter}}}}}<!--
+
-->{{#vardefine:modeGood|{{{skill mode good|Banter}}}}}<!--
-->{{#vardefine:modeFair|{{{mode fair|Space}}}}}<!--
+
-->{{#vardefine:modeFair|{{{skill mode fair|Space}}}}}<!--
-->{{#vardefine:modeAverage|{{{mode average|Action}}}}}<!--
+
-->{{#vardefine:modeAverage|{{{skill mode average|Action}}}}}<!--
 +
 
 +
--><includeonly><!--
 +
  -->{{#set:
 +
      | has good skill mode = {{#var:modeGood}}
 +
      | has fair skill mode = {{#var:modeFair}}
 +
      | has average skill mode = {{#var:modeAverage}}
 +
      }}<!--
 +
--></includeonly><!--
 +
 
 +
-->{{#if: {{#var: debug}} |
 +
'''debug''' Setting modes to:
 +
* good = {{#vardefineecho:modeGood|Banter}}
 +
* fair = {{#vardefineecho:modeFair|Space}}
 +
* average = {{#vardefineecho:modeAverage|Action}}
 +
}}<!--
  
 
   Some initial arrays and hashes:
 
   Some initial arrays and hashes:
Line 52: Line 67:
 
   -->{{#hashinclude: modeHash  | <mode> = {{#arrayprint: levelSubArray | <LEVELSEP> | <level> | <level><LEVELVAL>}} }}<!--
 
   -->{{#hashinclude: modeHash  | <mode> = {{#arrayprint: levelSubArray | <LEVELSEP> | <level> | <level><LEVELVAL>}} }}<!--
 
-->}}<!--
 
-->}}<!--
 +
 +
-->{{#if: {{#var: debug}} |<nowiki />
 +
{{#ask: [[is a::skill mode]] [[campaign::Humans are the Worst]] [[mode name :: {{#arrayprint: modeArray | {{!}}{{!}} }}]]
 +
        |?mode name
 +
        |?Includes skill
 +
      }}
 +
}}<!--
  
 
   Query all skills found belonging to our three modes.
 
   Query all skills found belonging to our three modes.
--><!--{{#arraydefine:skillArray |
 
      {{#ask: [[is a :: skill]] [[skill in mode :: {{#arrayprint: modeArray | {{!}}{{!}} }}]]
 
      |?Name
 
      |?Skill in mode=Mode
 
      | format=array
 
      }}
 
  }}--><!--
 
 
-->{{#hashdefine:skillModeHash |
 
-->{{#hashdefine:skillModeHash |
 
       {{#ask: [[is a::skill mode]] [[campaign::Humans are the Worst]] [[name :: {{#arrayprint: modeArray | {{!}}{{!}} }}]]
 
       {{#ask: [[is a::skill mode]] [[campaign::Humans are the Worst]] [[name :: {{#arrayprint: modeArray | {{!}}{{!}} }}]]
         |?Name
+
         |?Mode name
 
         |?Includes skill
 
         |?Includes skill
 
         |format=array
 
         |format=array
Line 71: Line 86:
 
       | <PROP>
 
       | <PROP>
 
   }}<!--
 
   }}<!--
 +
 +
-->{{#if: {{#var: debug}} |<nowiki />
 +
 +
  '''debug''' query result (skillModeHash): {{#hashprint: skillModeHash | | <modename> | <modeskills> | <modename>=<modeskills><br/>}}
 +
}}<!--
 +
 +
  Now that we have all the skill mode details, we put them into a hashTable
 +
  that maps each skill to the modes it is found in:
  
 
-->{{#hashdefine: skillHash}}<!--
 
-->{{#hashdefine: skillHash}}<!--
Line 80: Line 103:
 
   -->}}<!--
 
   -->}}<!--
 
-->}}<!--
 
-->}}<!--
-->{{#arraydefine: skillArray | {{#hashprint: skillHash |,| <skillname> | <skillmodes> | <skillname><PROP><skillmodes><PROP>}} }}<!--
 
  
-->{{#if: {{#var: debug}} |<!--
+
-->{{#if: {{#var: debug}} |<nowiki />
  -->query result (skillModeHash): {{#hashprint: skillModeHash | | <modename> | <modeskills> | <modename>=<modeskills><br/>}}<!--
+
 
   -->skillHash: {{#hashprint: skillHash | | <skillname> | <skillmodes> | <skillname>=<skillmodes><br/>}}<!--
+
  '''debug''' skillHash: {{#hashprint: skillHash | | <skillname> | <skillmodes> | <skillname>=<skillmodes><br/>}}
  -->skillArray: {{#arrayprint: skillArray | <br/> }}<br/><!--
+
}}<!--
 +
 
 +
 
 +
   Apply skill point bumps
 +
  @todo: The next step is to apply spent skill points. We'll do some error-checking here.
 +
 
 +
-->{{#vardefine:skillPointsUsed|0}}<!--
 +
-->{{#vardefine:pointBuy|point buy}}<!--
 +
 
 +
-->{{#vardefine: skillBumps | {{{skill bump|}}} }}<!--
 +
 
 +
--></onlyinclude><!--
 +
-->{{#vardefine: skillBumps | Gunnery, Gunnery, Will, Notice, Fight, Notice }}<!--
 +
--><onlyinclude><!--
 +
 
 +
-->{{#arraydefine: skillBumpArray | {{#var:skillBumps}} }}<!--
 +
-->{{#arrayprint: skillBumpArray ||<skill>|<!--
 +
      -->{{#hashinclude: skillHash | <skill> = {{#hashvalue: skillHash | <skill>}}<MANY>{{#var:pointBuy}} }}<!--
 
-->}}<!--
 
-->}}<!--
 +
 +
-->{{#arraydefine: skillArray | {{#hashprint: skillHash |,| <skillname> | <skillmodes> | <skillname><PROP><skillmodes>}} }}<!--
 +
 +
-->{{#if: {{#var: debug}} |<nowiki />
 +
 +
  '''debug''' skillArray: {{#arrayprint: skillArray | <br/> }}
 +
}}<!--
  
 
   Now iterate over all the skills returned from our query
 
   Now iterate over all the skills returned from our query
 +
 
-->{{#hashprint: skillHash | | <skillname> | <skillmodes> | <!--
 
-->{{#hashprint: skillHash | | <skillname> | <skillmodes> | <!--
  
Line 94: Line 141:
  
 
   -->{{#vardefine: currentSkillName        | <skillname> }}<!--
 
   -->{{#vardefine: currentSkillName        | <skillname> }}<!--
 +
 +
-->{{#if: {{#var: debug}} |<nowiki />
 +
 +
  '''debug''' currentSkillName: {{#var: currentSkillName }}
 +
}}<!--
  
 
       First we create an array containing all the modes the current skill  
 
       First we create an array containing all the modes the current skill  
Line 102: Line 154:
 
   -->{{#arraydefine: currentSkillAllModes  | <skillmodes> | <MANY> }}<!--
 
   -->{{#arraydefine: currentSkillAllModes  | <skillmodes> | <MANY> }}<!--
 
   -->{{#arraysearcharray: currentSkillModes | modeArray | /^{{#arrayprint: currentSkillAllModes | {{!}} }}$/ }}<!--
 
   -->{{#arraysearcharray: currentSkillModes | modeArray | /^{{#arrayprint: currentSkillAllModes | {{!}} }}$/ }}<!--
 +
 +
-->{{#if: {{#var: debug}} |<nowiki />
 +
  '''debug''' currentSkillAllModes: {{#arrayprint: currentSkillAllModes | , }}
 +
  '''debug''' currentSkillModes: {{#arrayprint: currentSkillModes | , }}
 +
}}<!--
  
 
       Now the number of entries in currentSkillModes is the number of the  
 
       Now the number of entries in currentSkillModes is the number of the  
Line 109: Line 166:
 
       highest-ranked mode for this skill.
 
       highest-ranked mode for this skill.
 
   -->{{#vardefine: currentSkillPrimaryMode | {{#arrayindex: currentSkillModes | -1 }} }}<!--
 
   -->{{#vardefine: currentSkillPrimaryMode | {{#arrayindex: currentSkillModes | -1 }} }}<!--
   -->{{#vardefine: currentSkillLevel      | {{#arrayindex: levelArray | {{#arraysize: currentSkillModes}} }} }}<!--
+
  -->{{#vardefine: synergySkillLevel      | {{#arraysize: currentSkillModes}} }}<!--
 +
  -->{{#vardefine: totalSkillLevel        | {{#arraysize: currentSkillAllModes}} }}<!--
 +
  -->{{#ifexpr: {{#var: totalSkillLevel}} > 3 | {{#vardefine: totalSkillLevel | 3}} }}<!--
 +
  -->{{#vardefine: pointBuyBumps          | {{#expr: {{#var:totalSkillLevel}} - {{#var:synergySkillLevel}} }} }}<!--
 +
  -->{{#vardefine: pointsSpent            | {{#expr: {{#var:synergySkillLevel}} * {{#var:pointBuyBumps}} + {{#var:pointBuyBumps}} * ( {{#var:pointBuyBumps}} - 1 ) / 2 }} }}<!--
 +
  -->{{#vardefine: skillPointsUsed        | {{#expr: {{#var:skillPointsUsed}} + {{#var:pointsSpent}} }} }}<!--
 +
   -->{{#vardefine: currentSkillLevel      | {{#arrayindex: levelArray | {{#var: totalSkillLevel}} }} }}<!--
  
 
       Hash of all the levels of the primary mode, keyed by level name. We're  
 
       Hash of all the levels of the primary mode, keyed by level name. We're  
 
       going to append the current skill to it and then put it back in modeHash.
 
       going to append the current skill to it and then put it back in modeHash.
 
   -->{{#hashdefine:  levelsOfPrimaryMode | {{#hashvalue: modeHash | {{#var: currentSkillPrimaryMode}} }} | <LEVELSEP> | <LEVELVAL> }}<!--
 
   -->{{#hashdefine:  levelsOfPrimaryMode | {{#hashvalue: modeHash | {{#var: currentSkillPrimaryMode}} }} | <LEVELSEP> | <LEVELVAL> }}<!--
-->{{#if: {{#var: debug}} |<!--
+
 
  -->levelsOfPrimaryMode ({{#var: currentSkillPrimaryMode}}): {{#hashprint: levelsOfPrimaryMode | <br/> | <level> | <skills> | <level> = <skills> }}<br/><!--
+
-->{{#if: {{#var: debug}} |<nowiki />
-->}}<!--
+
  '''debug''' currentSkillPrimaryMode: {{#var: currentSkillPrimaryMode }}
 +
  '''debug''' synergySkillLevel: {{#var: synergySkillLevel }}
 +
  '''debug''' totalSkillLevel: {{#var: totalSkillLevel }}
 +
  '''debug''' pointBuyBumps: {{#var: pointBuyBumps }}
 +
  '''debug''' pointsSpent: {{#var: pointsSpent }}
 +
  '''debug''' skillPointsUsed: {{#var: skillPointsUsed }}
 +
  '''debug''' currentSkillLevel: {{#var: currentSkillLevel }}
 +
  '''debug''' levelsOfPrimaryMode: {{#hashprint: levelsOfPrimaryMode | <br/> | <level> | <skills> | <level> = <skills> }}
 +
}}<!--
 +
 
 
       Array of the skills defined for the primary mode, at this level. Here we  
 
       Array of the skills defined for the primary mode, at this level. Here we  
 
       append the current skill along with a separator. The first time we do  
 
       append the current skill along with a separator. The first time we do  
Line 139: Line 211:
 
   Once the above loop is done modeHash should have the desired structure.
 
   Once the above loop is done modeHash should have the desired structure.
  
-->{{#if: {{#var: debug}} |<!--
+
-->{{#if: {{#var: debug}} |<nowiki />
-->modeHash: {{#hashprint: modeHash | <br/> | <modename> | <levels> | <modename> = <levels> }}<br/><!--
 
-->}}<!--
 
  
 +
  modeHash: {{#hashprint: modeHash | | <modename> | <levels> | <br/> <modename> = <levels> }}
 +
}}<!--
  
  @todo: The next step is to apply spent skill points. We'll do some error-checking here.
 
  
  
   Process all three modes:
+
   Process and print all three modes:
  
 
   Each element of modeLoopArray is composed of a rank name, the prefix of the  
 
   Each element of modeLoopArray is composed of a rank name, the prefix of the  
Line 188: Line 259:
 
       -->{{#hashinclude: sectionParams | {{#var: fieldName}} = &nbsp; | {{#var: fieldClass}} = shaded }}<!--
 
       -->{{#hashinclude: sectionParams | {{#var: fieldName}} = &nbsp; | {{#var: fieldClass}} = shaded }}<!--
 
       -->{{#if: {{#var: currentLevel}} |<!--
 
       -->{{#if: {{#var: currentLevel}} |<!--
 +
 +
-->{{#if: {{#var: debug}} |<nowiki />
 +
 +
  currentModeName: {{#var: currentModeName}}
 +
  currentLevel: {{#var: currentLevel }}
 +
}}<!--
 +
 
             Here the current loop index corresponds to a level. We set the  
 
             Here the current loop index corresponds to a level. We set the  
 
             appropriate CSS class and look for skills at this level.
 
             appropriate CSS class and look for skills at this level.
 +
 
         -->{{#hashinclude: sectionParams | {{#var: fieldClass}} = {{#var: currentLevel}} skill }}<!--
 
         -->{{#hashinclude: sectionParams | {{#var: fieldClass}} = {{#var: currentLevel}} skill }}<!--
 +
 
             Now look for skills and print them, if any
 
             Now look for skills and print them, if any
 +
 
         -->{{#arraydefine: levelSkills | {{#hashvalue: currentModeHash | {{#var: currentLevel}} }} | <LEVELSKILL> }}<!--
 
         -->{{#arraydefine: levelSkills | {{#hashvalue: currentModeHash | {{#var: currentLevel}} }} | <LEVELSKILL> }}<!--
         -->{{#if: {{#vardefineecho: levelSkillList | {{#arrayprint: levelSkills}} }} |<!--
+
         -->{{#if: {{#arrayprint: levelSkills}} | <!--
 +
 
 +
-->{{#if: {{#var: debug}} |<nowiki />
 +
  '''debug''' levelSkills: {{#arrayprint: levelSkills}}
 +
}}<!--
 +
 
 +
              If a skill belongs to more than one mode, we note it with an <abbr> tag:
 +
 
 +
            -->{{#arraydefine: levelSkillsPrintable | <!--
 +
              -->{{#arrayprint: levelSkills | , | <skillname> | <!--
 +
                  -->{{#arraydefine: currentSkillAllModes | {{#hashvalue: skillHash | <skillname> }} | <MANY> | unique }}<!--
 +
                  -->{{#ifeq: {{#arraysize: currentSkillAllModes}} | 1 <!--
 +
                    -->| <skillname> <!--
 +
                    -->| <abbr title="{{#arrayprint:currentSkillAllModes}}"><skillname></abbr> <!--
 +
                  -->}}<!--
 +
                  --><includeonly><!--
 +
                    -->{{#set: has {{#var: currentLevel }} skill = <skillname> }}<!--
 +
                  --></includeonly><!--
 +
              -->}}<!--
 +
            -->}}<!--
 +
 
 +
-->{{#if: {{#var: debug}} |<nowiki />
 +
  '''debug''' levelSkillsPrintable: {{#arrayprint: levelSkillsPrintable}}
 +
}}<!--
 +
 
 
               There are skills at this level. Save them to the param hash.
 
               There are skills at this level. Save them to the param hash.
             -->{{#hashinclude: sectionParams | {{#var: fieldName}} = {{#var: levelSkillList}} }}<!--
+
 
 +
             -->{{#hashinclude: sectionParams | {{#var: fieldName}} = {{#arrayprint: levelSkillsPrintable}} }}<!--
 +
 
 
         -->}}<!--
 
         -->}}<!--
 
       -->}}<!--
 
       -->}}<!--
Line 204: Line 311:
 
-->}}<!-- end arrayprint
 
-->}}<!-- end arrayprint
  
 +
 +
-->{{#if: {{#var: debug}} |<nowiki />
 +
 +
  '''debug''' sectionParams: {{#hashprint: sectionParams | | <key> | <value> | <br/> <key> = <value> }}
 +
}}<!--
 +
 +
--></onlyinclude><nowiki />
 +
{| class="infobox"
 +
<onlyinclude><!--
 +
 
 +
  Now print the table section
  
 
-->{{#hashtotemplate:  Character sheet/section | sectionParams }}<!--
 
-->{{#hashtotemplate:  Character sheet/section | sectionParams }}<!--
Line 210: Line 328:
 
   Print the section footer. This contains a summary of advancement points available and spent.
 
   Print the section footer. This contains a summary of advancement points available and spent.
  
-->{{#vardefine:skillsused|0}}<!--
+
-->{{#vardefine:skillsAllowed|7}}<!--
-->{{#vardefine:skillsallowed|7}}<!--
 
 
-->{{Character sheet/section  
 
-->{{Character sheet/section  
 
| columns  = {{#var:cols}}
 
| columns  = {{#var:cols}}
| llabel1  = Points used  | ldata1    = {{#var:skillsused}}
+
| llabel1  = bonus points  | ldata1    = {{#var:skillsAllowed}}
| label1    = remaining    | data1    = {{#expr: {{#var:skillsallowed}} - {{#var:skillsused}} }}
+
| label1    = used          | data1    = {{#var:skillPointsUsed}}
| rlabel1  = total        | rdata1    = {{#var:skillsallowed}}
+
| rlabel1  = remaining    | rdata1    = {{#expr: {{#var:skillsAllowed}} - {{#var:skillPointsUsed}} }}
 
}}<!-- end section  
 
}}<!-- end section  
 
-->}}<!-- end if
 
-->}}<!-- end if
 +
 +
--></onlyinclude><nowiki />
 +
|}
 +
<onlyinclude><!--
  
  
 
--></onlyinclude>
 
--></onlyinclude>
|}
 

Latest revision as of 02:36, 29 July 2014

[create]
Error creating thumbnail: File missing
Template documentation

Skill modes
  Banter Space Action
Superb (+5) Gunnery, Notice    
Great (+4) Fight, Will    
Good (+3)      
Fair (+2)      
Average (+1)      
bonus points 7 used -4 remaining 11