Template:ItemDrop/entry: Difference between revisions

From CrossCode Wiki
Jump to navigation Jump to search
(Add class (linkgroup for item entry))
 
(13 intermediate revisions by 4 users not shown)
Line 1: Line 1:
<noinclude>
<onlyinclude><includeonly>
{| class="wikitable sortable"
|-
|-
! Item
| data-sort-value="{{{name}}}" |{{ItemLink | {{{name}}}}} {{#if: {{{quantity|}}} | {{#ifeq:{{{quantity|}}}|1||x {{{quantity}}}}}}}
! Chance
|| {{#if: {{{chance|}}} | {{{chance}}}{{#ifeq:{{{chance}}}|{{#expr:{{{chance}}} }}|%|}} | ???% }} || data-sort-value="{{#switch: {{{rank}}}
! Rank
| S = 1
|-
| A = 2
{{ItemDrop/entry|name=Metal Needles|class=Trade|sprite=File:Trade-bronze.png|chance=12%|rank=D}}
| B = 3
|-
| C = 4
{{ItemDrop/entry|name=Sandwich|class=Consumables|sprite=File:Item-consumable-white.png|chance=8%|rank=B}}
| D = 5
|}
| H = 6
 
| 7
This template is for the [[Template:ItemDrop|ItemDrop]] Template. Here's how you can use it:
}}" | {{#switch: {{{rank}}}
<pre>
| S = [[File:Rank-S-icon.png|right]]
{{ItemDrop/entry|name=Metal Needles|class=Trade|sprite=File:Trade-bronze.png|chance=12%|rank=D}}
| A = [[File:Rank-A-icon.png|right]]
</pre>
| B = [[File:Rank-B-icon.png|right]]
</noinclude>
| C = [[File:Rank-C-icon.png|right]]
<includeonly>
|-
| data-sort-value="{{{name}}}" | {{#if: {{{sprite|}}} | [[{{{sprite}}}]] | }} {{#if: {{{class|}}} | [[Items/{{{class}}}#{{{name}}}|{{{name}}}]] | {{{name}}} }} || {{#if: {{{chance|}}} | {{{chance}}} | ???% }} || data-sort-value="{{#switch: {{{rank}}}
| D = D
| C = C
| B = B
| A = A
| S = S
| E
}}" |
{{#switch: {{{rank}}}
| D = [[File:Rank-D-icon.png|right]]
| D = [[File:Rank-D-icon.png|right]]
| C = [[File:Rank-C-icon.png|right]]
| H = HP<80%
| B = [[File:Rank-B-icon.png|right]]
| [[File:Rank-D-icon.png|right]]
| A = [[File:Rank-A-icon.png|right]]
| S = [[File:Rank-S-icon.png|right]]
| [[File:Rank-Blank-icon.png|right]]
}}
}}
</includeonly>
|-
<noinclude>
</includeonly></onlyinclude>
[[Category:Infobox templates]]
{{Doc}}
</noinclude>

Latest revision as of 07:53, 17 April 2021

File:Template-info.svg Template Documentation

About

Creates an Item Drop entry.

Parameters

Do not use named parameter for 1 ... x. The first Parameter will be automatically marked as 1, the second as 2 and so on.

Parameter Description Type Status
Name name

Item name

Default:
NULL
Example:
Metal Needles
String Required
Chance chance

Percentage change of drop. Percent sign is optional.

Default:
?
Example:
20%
Number + ("%") Recommended
Rank rank

Drop rank

Default:
Example:
S: , A: , H: HP<80%
["S" | "A" | "B" | "C" | "D" | "H" ] Recommended
Quantity quantity

Drop quantity

Default:
1
Example:
2, 1-2
[ 1 {NonzeroNumber} + ( "-" + {NonzeroNumber} ) ] Optional

See Template:TemplateData and Template:TemplateData/entry for more information about the parameter list and DDNCode for more information about types and the DDN Notation

Test of raw TemplateData output:

No description.

Template parameters

ParameterDescriptionTypeStatus
Namename

Item name

Example
<code>Metal Needles</code>
Stringrequired
Chancechance

Percentage change of drop. Percent sign is optional.

Default
?
Example
<code>20%</code>
Contentsuggested
Rankrank

Drop rank

Default
[[File:Rank-D-icon.png]]
Example
S: [[File:Rank-S-icon.png]], A: [[File:Rank-A-icon.png]], H: HP<80%
Contentsuggested
Quantityquantity

Drop quantity

Default
1
Example
<code>2</code>, <code>1-2</code>
Contentoptional

Examples

Item Chance Rank
{{ItemDrop/entry|name=Metal Needles|chance=12%|rank=D}}
Metal Needles 12%
{{ItemDrop/entry|name=Sandwich|chance=8%|rank=B|quantity=2}}
Sandwich x 2 8%
{{ItemDrop/entry|name=Hi-Sandwich|chance=8%|rank=B|quantity=1}}
Hi-Sandwich 8%
{{ItemDrop/entry|name=Health Pickup|chance=20%|rank=H}}
Health Pickup 20% HP<80%