Difference between revisions of "Template:Item"

From Wurmpedia
Jump to navigation Jump to search
m (Fix skill section formatting)
(Added decoration and storage params, made switches case-insensitive, combined with Template:ItemM)
Line 1: Line 1:
<includeonly>{| style="float:right; margin:1em; width:250px;" cellpadding="3" cellspacing="0" border="1"
+
<includeonly>
 +
{| style="float:right; margin:1em; width:250px;" cellpadding="3" cellspacing="0" border="1"
 
|+ style="font-weight: bold" | {{{name|{{PAGENAME}}}}}
 
|+ style="font-weight: bold" | {{{name|{{PAGENAME}}}}}
 +
 
|-
 
|-
 
|
 
|
 
{{#ifexist: Image:{{{image|{{{name|{{PAGENAME}}}}}.jpg}}}
 
{{#ifexist: Image:{{{image|{{{name|{{PAGENAME}}}}}.jpg}}}
     | [[Image: {{{image|{{{name|{{PAGENAME}}}}}.jpg}}}|center|120x120px|A {{lcfirst:{{{name|{{PAGENAME}}}}}}}]]
+
     | [[Image: {{{image|{{{name|{{PAGENAME}}}}}.jpg}}}|center|120x120px|A {{{name|{{PAGENAME}}}}}]]
 
     | {{#ifexist: Image:{{{image|{{{name|{{PAGENAME}}}}}.png}}}
 
     | {{#ifexist: Image:{{{image|{{{name|{{PAGENAME}}}}}.png}}}
         | [[Image: {{{image|{{{name|{{PAGENAME}}}}}.png}}}|center|120x120px|A {{lcfirst:{{{name|{{PAGENAME}}}}}}}]]
+
         | [[Image: {{{image|{{{name|{{PAGENAME}}}}}.png}}}|center|120x120px|A {{{name|{{PAGENAME}}}}}]]
         | [[Image: {{{image|{{{name|{{PAGENAME}}}}}.jpg}}}|center|120x120px|A {{lcfirst:{{{name|{{PAGENAME}}}}}}}]]
+
         | [[Image: {{{image|{{{name|{{PAGENAME}}}}}.jpg}}}|center|120x120px|A {{{name|{{PAGENAME}}}}}]]
 
     }}
 
     }}
 
}}
 
}}
 +
 
|-
 
|-
 
! style="background-color:#3c5;" | Creation
 
! style="background-color:#3c5;" | Creation
 
|-
 
|-
 
|
 
|
 +
<!-- creation attribute overrides showing creation steps, displaying the text below instead -->
 
{{#if:{{{creation|}}}|
 
{{#if:{{{creation|}}}|
{{#switch: {{{creation}}}
+
    {{#switch: {{lc:{{{creation}}}}}
| no = This item can not be created.
+
    | no = This item can not be created.
| farm = Obtained through [[Farming|harvesting]].
+
    | farm = Obtained through [[Farming|harvesting]].
| forage = Obtained through [[forage|foraging]].
+
    | forage = Obtained through [[forage|foraging]].
| botanize = Obtained through [[botanize|botanizing]].
+
    | botanize = Obtained through [[botanize|botanizing]].
| fish = Obtained through [[fishing]].
+
    | fish = Obtained through [[fishing]].
| mine = Obtained through [[mining]].
+
    | mine = Obtained through [[mining]].
| wood = Obtained through [[woodcutting]].
+
    | wood = Obtained through [[woodcutting]].
| dig = Obtained through [[digging]].
+
    | dig = Obtained through [[digging]].
| butchering = Obtained through [[butchering]].
+
    | butchering = Obtained through [[butchering]].
| cooking = * Put {{#if:{{{materials|}}}|
+
    | cooking = * Put {{#if:{{{materials|}}}|{{{materials}}}|ingredients}} in a {{#if:{{{container|}}}|{{{container}}}|container}}.
{{{materials}}}
 
 
 
|ingredients}} in a {{#if:{{{container|}}}|{{{container}}}|container}}  
 
 
* Cook in a [[:Category:Fire_sources|fire place]].
 
* Cook in a [[:Category:Fire_sources|fire place]].
| #default = {{{creation}}}
+
    | #default = {{{creation}}}
}}
+
    }}
|
+
    |
 +
    <!-- if there is no creation attribute show steps for how to create -->
 
<ol>
 
<ol>
 
<li>[[Activate]] {{{active}}}</li>
 
<li>[[Activate]] {{{active}}}</li>
 
<li>Right-click {{{passive}}}</li>
 
<li>Right-click {{{passive}}}</li>
 
{{#if:{{{group|}}}|<li>Open submenu "Create > [[{{{group}}}]]"</li>}}
 
{{#if:{{{group|}}}|<li>Open submenu "Create > [[{{{group}}}]]"</li>}}
 +
{{#if:{{{groupM|}}}|<li>Open submenu > {{{groupM}}}</li>}}
 
{{#if:{{{assemble|}}}|<li>{{{assemble}}}</li>}}</ol>
 
{{#if:{{{assemble|}}}|<li>{{{assemble}}}</li>}}</ol>
 
{{#ifeq:{{{materials}}}|no||
 
{{#ifeq:{{{materials}}}|no||
Line 54: Line 57:
 
! style="background-color:#3c5;" | Skill and improvement
 
! style="background-color:#3c5;" | Skill and improvement
 
|-
 
|-
|{{#if:{{{skill|}}}|* Uses [[{{{skill}}}]]}}
+
|{{#if:{{{skill|}}}|* Uses [[{{{skill}}}]]
{{#if:{{{improve|}}}|* {{#ifeq:{{{improve}}}|no|Cannot be [[improve]]d|[[Improve]]s like [[{{{improve}}}]] items}}}}
+
}}{{#if:{{{improve|}}}|* {{#ifeq:{{{improve}}}|no|Cannot be [[improve]]d|[[Improve]]s like [[{{{improve}}}]] items}}
|-
+
}}{{#if:{{{improveItem|}}}|* {{#ifeq:{{{improveItem}}}|no|Cannot be [[improve]]d|[[Improve]] with [[{{{improveItem}}}]]}}}}
{{#ifeq:{{{combinable|no}}}|no||
+
<!--optional properties -->
 +
{{#if: {{{decoration|}}}|
 +
{{!}}-
 +
! style="background-color:#3c5;" {{!}} Properties
 +
{{!}}-
 +
{{!}}|
 +
{{#if: {{{storage|}}}|
 +
{{!}}-
 +
! style="background-color:#3c5;" {{!}} Properties
 +
{{!}}-
 +
{{!}}|
 +
{{#ifeq: {{{combinable|no}}}|no||
 
{{!}}-
 
{{!}}-
 
! style="background-color:#3c5;" {{!}} Properties
 
! style="background-color:#3c5;" {{!}} Properties
 
{{!}}-
 
{{!}}-
{{#ifeq:{{{combinable|no}}}|no||
+
{{!}}}}}}
{{!}}
+
}}{{#if: {{{decoration|}}}|
{{#switch: {{{combinable}}}
+
{{#switch: {{lc:{{{decoration}}}}}
  | hot = * Can be combined when glowing hot
+
| yes = * Appears as decoration.[[Category:Decoration]]
  | #default = * Can be combined
+
| no = * Appears as an item pile.
}}
+
}}}}{{#switch: {{lc:{{{storage}}}}}
}}
+
| fsb = * Can be stored in a [[Food storage bin]].[[Category:Food storage items]]
}}
+
| bsb = * Can be stored in a [[Bulk storage bin]].[[Category:Bulk storage items]]
 +
}}{{#if: {{{combinable|}}}|{{#switch: {{lc:{{{combinable}}}}}
 +
  | hot = * Can be combined when glowing hot.
 +
  | yes = * Can be combined.
 +
}}}}{{#if: {{{note|}}}|
 +
<!-- optional note -->
 +
{{!}}-
 +
! style="background-color:#3c5;" {{!}} Notes
 +
{{!}}-
 +
{{!}}{{#ifeq:{{{note}}}|no|None|{{{note}}}}}}}
 
|}
 
|}
 
{{#if:{{{skill|}}}|[[Category:{{{skill}}} items]]}}
 
{{#if:{{{skill|}}}|[[Category:{{{skill}}} items]]}}
Line 84: Line 107:
 
Usage examples:
 
Usage examples:
  
<pre>{{item
+
<pre>{{Item
 
|name=Hammer        *** defaults to {{PAGENAME}} ***
 
|name=Hammer        *** defaults to {{PAGENAME}} ***
 
|image=hammer.jpg    *** defaults to {{PAGENAME}}.jpg or {{PAGENAME}}.png ***
 
|image=hammer.jpg    *** defaults to {{PAGENAME}}.jpg or {{PAGENAME}}.png ***
 
|active=[[hammer head]] (0.4 kg)
 
|active=[[hammer head]] (0.4 kg)
 
|passive=[[shaft]] (1.0 kg)
 
|passive=[[shaft]] (1.0 kg)
|assemble=Any final assemble actions
+
|group=Tools         *** item is in this sub menu in the create list ***
|group=Tools
 
 
|materials=no
 
|materials=no
 
|result=1 '''hammer''' - 1.4 kg
 
|result=1 '''hammer''' - 1.4 kg
 
|skill=blacksmithing
 
|skill=blacksmithing
 
|improve=smithing
 
|improve=smithing
 +
|combinable=no        *** empty or no show nothing, other options are yes or hot ***
 +
|storage=            *** empty shows nothing, other options are bsb or fsb ***
 +
|decoration=no        *** empty shows nothing, yes says it's a decoration, no says it will be in an item pile ***
 
}}
 
}}
 
</pre>
 
</pre>
  
<pre>{{item
+
<pre>{{Item
 
|name=Huge shod club        *** defaults to {{PAGENAME}} ***
 
|name=Huge shod club        *** defaults to {{PAGENAME}} ***
 
|result=1 '''huge shod club''' (15.00 kg)
 
|result=1 '''huge shod club''' (15.00 kg)
|creation=Troll drop        *** 'no' will result in 'The item can not be created', other options include farm, fish, botanize, forage, mine, wood, dig, butchering ***
+
|creation=Troll drop        *** 'no' will result in 'The item can not be created', other options include farm, fish, botanize, forage, mine, wood, dig, butchering, cooking  ***
 
|improve=no
 
|improve=no
|combinable=yes              *** Item can be combined. Other options are hot and no. No is default ***
 
 
}}
 
}}
 
</pre>
 
</pre>
  
 +
<pre>
 +
{{Item
 +
|image=Iron fence.jpg
 +
|name=Iron fence
 +
|active=[[Mallet]] or [[Hammer]]
 +
|passive=[[Tile Border]]
 +
|groupM=Fence > Iron > Build iron fence  *** item is in this menu when you right click the passive item (for items like fences where there is no create menu) ***
 +
|materials=* 9x [[Stone brick]]s
 +
* 1x [[Iron fence bars]]
 +
|result=*'''Iron fence'''
 +
|skill=Masonry
 +
|improveItem=Stone bricks    *** for items like fences and walls, improves using and item and not a set of tools ***
 +
|note=*You must have at least one stone brick in your [[inventory]] to start building it.
 +
}}
 +
</pre>
  
  
 
[[Category:Template]]
 
[[Category:Template]]
 
</noinclude>
 
</noinclude>

Revision as of 14:10, 18 August 2013

General item template.

The template adds a box with an image of the item and the steps to create the item.

If the creation parameter is set the box will display its contents instead of the creation steps.

Usage examples:

{{Item
|name=Hammer         *** defaults to {{PAGENAME}} ***
|image=hammer.jpg    *** defaults to {{PAGENAME}}.jpg or {{PAGENAME}}.png ***
|active=[[hammer head]] (0.4 kg)
|passive=[[shaft]] (1.0 kg)
|group=Tools         *** item is in this sub menu in the create list ***
|materials=no
|result=1 '''hammer''' - 1.4 kg
|skill=blacksmithing
|improve=smithing
|combinable=no        *** empty or no show nothing, other options are yes or hot ***
|storage=             *** empty shows nothing, other options are bsb or fsb ***
|decoration=no        *** empty shows nothing, yes says it's a decoration, no says it will be in an item pile ***
}}
{{Item
|name=Huge shod club         *** defaults to {{PAGENAME}} ***
|result=1 '''huge shod club''' (15.00 kg)
|creation=Troll drop         *** 'no' will result in 'The item can not be created', other options include farm, fish, botanize, forage, mine, wood, dig, butchering, cooking  ***
|improve=no
}}
{{Item
|image=Iron fence.jpg
|name=Iron fence
|active=[[Mallet]] or [[Hammer]]
|passive=[[Tile Border]]
|groupM=Fence > Iron > Build iron fence   *** item is in this menu when you right click the passive item (for items like fences where there is no create menu) ***
|materials=* 9x [[Stone brick]]s
* 1x [[Iron fence bars]]
|result=*'''Iron fence'''
|skill=Masonry
|improveItem=Stone bricks    *** for items like fences and walls, improves using and item and not a set of tools ***
|note=*You must have at least one stone brick in your [[inventory]] to start building it.
}}