Template:Infobox Card: Difference between revisions

Jump to navigation Jump to search
Add support for familiar cards to template
(Add support for automatic name generation for starting gear)
(Add support for familiar cards to template)
Line 18: Line 18:
   #vardefine: imagename | {{#if: {{{image|}}} | {{{image}}} |
   #vardefine: imagename | {{#if: {{{image|}}} | {{{image}}} |
     {{#switch: {{#var: cardtype}}
     {{#switch: {{#var: cardtype}}
      |Familiar      = Familiar - {{#var: cardname}}.png
       |Item          = {{#if: {{#var: heroclass}} | {{#var: heroclass}} - {{#var: cardname}}.png | Act_{{#var: act}}_Item - {{#var: cardname}}.png}}
       |Item          = {{#if: {{#var: heroclass}} | {{#var: heroclass}} - {{#var: cardname}}.png | Act_{{#var: act}}_Item - {{#var: cardname}}.png}}
       |Skill          = {{#var: heroclass}} - {{#var: cardname}}.png
       |Skill          = {{#var: heroclass}} - {{#var: cardname}}.png
Line 53: Line 54:
             {{!}}align=center style="border:0px transparent" {{!}}[[{{#var: heroclass}}]]
             {{!}}align=center style="border:0px transparent" {{!}}[[{{#var: heroclass}}]]
           |
           |
             {{!}}colspan= 2 align=center style="border:0px transparent"{{!}}[[Template:ValidateHeroClass|Invalid heroclass. Read the template documentation for valid hero classes]]
             {{#if:{{{character|}}}|
              {{!}}align=center width=50% style="border:0px transparent"{{!}}Character:
              {{!}}align=center style="border:0px transparent" {{!}}[[{{{character|}}}]]
            |
              {{!}}colspan= 2 align=center style="border:0px transparent"{{!}}[[Template:ValidateHeroClass|Invalid heroclass. Read the template documentation for valid hero classes]]
            }}
           }}
           }}
       }}
       }}
Line 109: Line 115:
     {{!}} align=center width=50% style="border:0px transparent"{{!}}Dice:
     {{!}} align=center width=50% style="border:0px transparent"{{!}}Dice:
     {{!}} align=center style="border:0px transparent"{{!}}{{{dice|}}}
     {{!}} align=center style="border:0px transparent"{{!}}{{{dice|}}}
  |}}
  {{!}}-
  {{#if:{{{health|}}}|
    {{#switch:{{{health|}}}
      |1
      |2
      |3
      |4
      |5
      |6 =
        {{!}} align=center width=50% style="border:0px transparent"{{!}}Health:
        {{!}} align=center style="border:0px transparent"{{!}}{{{health|}}}
      |#default =
        {{!}}colspan= 2 align=center style="border:0px transparent"{{!}}Invalid health. Valid values are in the range 1-6
    }}
   |}}
   |}}
   {{!}}-
   {{!}}-
Line 117: Line 138:
     |
     |
       {{!}}colspan= 2 align=center style="border:0px transparent"{{!}}[[Template:ValidateRange|Invalid range. Read the template documentation for valid ranges]]
       {{!}}colspan= 2 align=center style="border:0px transparent"{{!}}[[Template:ValidateRange|Invalid range. Read the template documentation for valid ranges]]
    }}
  |}}
  {{!}}-
  {{#if:{{{speed|}}}|
    {{#switch:{{{speed|}}}
      |1
      |2
      |3
      |4
      |5 =
        {{!}} align=center width=50% style="border:0px transparent"{{!}}Speed:
        {{!}} align=center style="border:0px transparent"{{!}}{{{speed|}}}
      |#default =
        {{!}}colspan= 2 align=center style="border:0px transparent"{{!}}Invalid speed. Valid values are in the range 1-5
     }}
     }}
   |}}
   |}}
Line 203: Line 238:
     {{#if:{{#var: heroclass}}|
     {{#if:{{#var: heroclass}}|
       {{#switch:{{#var: cardtype}}
       {{#switch:{{#var: cardtype}}
         |Item =  
        |Familiar =
          {{!}} colspan=2 align=center style="border:0px transparent"{{!}}[[{{#var: heroclass}}]] familiar
         |Item =
           {{!}} colspan=2 align=center style="border:0px transparent"{{!}}[[{{#var: heroclass}}]] starting card
           {{!}} colspan=2 align=center style="border:0px transparent"{{!}}[[{{#var: heroclass}}]] starting card
           {{!}}-
           {{!}}-
           {{!}} align=center width=50% style="border:0px transparent"{{!}}Sell:
           {{!}} align=center width=50% style="border:0px transparent"{{!}}Sell:
           {{!}} align=center style="border:0px transparent"{{!}} 25 Gold
           {{!}} align=center style="border:0px transparent"{{!}} 25 Gold
        |#default =
      }}
    |}}
    {{#if:{{{character|}}}|
      {{#switch:{{#var: cardtype}}
        |Familiar =
          {{!}} colspan=2 align=center style="border:0px transparent"{{!}}[[{{{character|}}}]] familiar
         |#default =
         |#default =
       }}
       }}
Line 266: Line 310:
   {{#if:{{#var: cardtype}}|
   {{#if:{{#var: cardtype}}|
     {{#switch:{{#var: cardtype}}
     {{#switch:{{#var: cardtype}}
      |Familiar = [[Category:Familiars]]
       |Hero Relic
       |Hero Relic
       |Item = [[Category:Items]]
       |Item = [[Category:Items]]

Navigation menu