RheingoldRiver (discussion | contributions) (debug) |
Aucun résumé des modifications |
||
(9 versions intermédiaires par 2 utilisateurs non affichées) | |||
Ligne 1 : | Ligne 1 : | ||
<includeonly><!-- |
<includeonly><!-- |
||
+ | ========================================================================================================================== |
||
− | //localization info is autoloaded from Template:Item infobox/l10n |
||
+ | =========================================== INITIALIZATION =========================================== |
||
+ | ========================================================================================================================== |
||
+ | |||
− | //ext l10n info: how to get english item name from {{BASEPAGENAME}}? |
||
+ | +++++++++++++ 1. Localization +++++++++++++ |
||
+ | |||
+ | // localization info is autoloaded from Template:Item infobox/l10n |
||
+ | |||
+ | // additional l10n: how to get english item name from {{BASEPAGENAME}}? |
||
-->{{#vardefine:itemnamefrompagename|{{pagename2en|{{#titleparts:{{ROOTPAGENAME}}}}}}}}<!-- |
-->{{#vardefine:itemnamefrompagename|{{pagename2en|{{#titleparts:{{ROOTPAGENAME}}}}}}}}<!-- |
||
− | === l10n end ========================================================================================================== |
||
− | + | +++++++++++++ 2. View-related options +++++++++++++ |
|
+ | |||
-->{{#vardefine:viewname|{{lc:{{{mode|{{{output|{{{view|{{#var:_item_infobox_flag_view|infobox}}}}}}}}}}}}}}}<!-- |
-->{{#vardefine:viewname|{{lc:{{{mode|{{{output|{{{view|{{#var:_item_infobox_flag_view|infobox}}}}}}}}}}}}}}}<!-- |
||
-->{{#switch:{{#var:viewname}}<!-- |
-->{{#switch:{{#var:viewname}}<!-- |
||
Ligne 25 : | Ligne 32 : | ||
-->{{#arraydefine:extargs|{{{extargs|{{item infobox/options|get|extargs}}}}}|/}}<!-- |
-->{{#arraydefine:extargs|{{{extargs|{{item infobox/options|get|extargs}}}}}|/}}<!-- |
||
-->}}<!-- |
-->}}<!-- |
||
− | -->{{#arrayprint:extargs||@@@@|{{#if:@@@@|{{#vardefine:ii:ext:@@@@|{{{@@@@|}}}}}}}}}<!--ext parameters for view |
+ | -->{{#arrayprint:extargs||@@@@|{{#if:@@@@|{{#vardefine:ii:ext:@@@@|{{{@@@@|}}}}}}}}}<!-- ext parameters for view |
-->{{#vardefine:imagemode|{{{imagemode|{{#ifeq:{{#var:viewname}}|infobox|full|{{item infobox/options|get|imagemode}}}}}}}}}<!-- image mode |
-->{{#vardefine:imagemode|{{{imagemode|{{#ifeq:{{#var:viewname}}|infobox|full|{{item infobox/options|get|imagemode}}}}}}}}}<!-- image mode |
||
− | ======== DATA MODEL ======== |
||
− | Note: All "#lst**" parser functions ([[gphelp:Extension:ParserPower/List handling functions]]) will trim whitespace and discard empty elements. |
||
+ | |||
− | //types: separated with "/". |
||
+ | ========================================================================================================================== |
||
− | -->{{#vardefine:ii:types|{{{type|}}}/{{{type2|}}}}}<!-- |
||
+ | ============================================= DATA MODEL ============================================= |
||
− | //listcats: separated with "/". |
||
+ | ========================================================================================================================== |
||
+ | |||
+ | Note: All "#lst*" parser functions ([[gphelp:Extension:ParserPower/List handling functions]]) will trim whitespace and discard empty elements. |
||
+ | |||
+ | |||
+ | +++++++++++++ 1. Set types, listcats, and tags from parameter input +++++++++++++ |
||
+ | |||
+ | // types: separated with "/". |
||
+ | -->{{#vardefine:ii:types|{{lcfirst:{{{type|}}}}}/{{lcfirst:{{{type2|}}}}}}}<!-- |
||
+ | // listcats: separated with "/". |
||
-->{{#vardefine:ii:listcats|{{{listcat|}}}/{{{listcat2|}}}/{{{listcat3|}}}/{{{listcat4|}}}/{{{listcat5|}}}}}<!-- |
-->{{#vardefine:ii:listcats|{{{listcat|}}}/{{{listcat2|}}}/{{{listcat3|}}}/{{{listcat4|}}}/{{{listcat5|}}}}}<!-- |
||
− | //tags: separated with "/". |
+ | // tags: separated with "/". |
-->{{#vardefine:ii:tags|{{{tags|{{{tag|}}}}}}}}<!-- |
-->{{#vardefine:ii:tags|{{{tags|{{{tag|}}}}}}}}<!-- |
||
− | //check for certain tags to add to listcats: |
+ | // check for certain tags to add to listcats: |
* tag "xxx" -> add listcat "xxx items" |
* tag "xxx" -> add listcat "xxx items" |
||
-->{{#vardefine:ii:listcats|{{#lstjoin:{{#var:ii:listcats}}|/|{{#lstmap:{{#lstfltr:drop/loot/plunder/fished/unobtainable/developer/furniture/storage/informational/light source/novelty/mechanism/bag loot|/|{{#var:ii:tags}}|/|/}}|/|@@@|@@@ items|/}}|/|/}}}}<!-- |
-->{{#vardefine:ii:listcats|{{#lstjoin:{{#var:ii:listcats}}|/|{{#lstmap:{{#lstfltr:drop/loot/plunder/fished/unobtainable/developer/furniture/storage/informational/light source/novelty/mechanism/bag loot|/|{{#var:ii:tags}}|/|/}}|/|@@@|@@@ items|/}}|/|/}}}}<!-- |
||
Ligne 47 : | Ligne 62 : | ||
-->{{#if:{{#lstind:treasure bag loot|{{#var:ii:tags}}|/}}|{{#vardefine:ii:listcats|{{#lstapp:{{#var:ii:listcats}}|/|Treasure Bag loot items}}}}}}<!-- |
-->{{#if:{{#lstind:treasure bag loot|{{#var:ii:tags}}|/}}|{{#vardefine:ii:listcats|{{#lstapp:{{#var:ii:listcats}}|/|Treasure Bag loot items}}}}}}<!-- |
||
− | //check for certain listcats: |
+ | // check for certain listcats: |
* listcat "Broadswords"/"Shortswords" -> add listcat "Swords" |
* listcat "Broadswords"/"Shortswords" -> add listcat "Swords" |
||
-->{{#if:{{#lstfltr:broadswords/shortswords|/|{{#var:ii:listcats}}|}}|{{#vardefine:ii:listcats|{{#lstapp:{{#var:ii:listcats}}|/|swords}}}}}}<!-- |
-->{{#if:{{#lstfltr:broadswords/shortswords|/|{{#var:ii:listcats}}|}}|{{#vardefine:ii:listcats|{{#lstapp:{{#var:ii:listcats}}|/|swords}}}}}}<!-- |
||
Ligne 53 : | Ligne 68 : | ||
-->{{#if:{{#lstind:explosives|{{#var:ii:listcats}}|/}}|{{#vardefine:ii:types|{{#lstapp:{{#var:ii:types}}|/|weapon}}}}}}<!-- |
-->{{#if:{{#lstind:explosives|{{#var:ii:listcats}}|/}}|{{#vardefine:ii:types|{{#lstapp:{{#var:ii:types}}|/|weapon}}}}}}<!-- |
||
− | //is armor/vanity set? |
+ | // is armor/vanity set? |
-->{{#vardefine:ii:isArmorSet|{{#lstind:set|{{#var:ii:types}}|/}}}}<!-- |
-->{{#vardefine:ii:isArmorSet|{{#lstind:set|{{#var:ii:types}}|/}}}}<!-- |
||
− | //summon weapons: |
+ | // summon weapons: |
-->{{#if:{{#var:ii:isArmorSet}}||<!-- exclude armor sets (e.g. Stardust armor) |
-->{{#if:{{#var:ii:isArmorSet}}||<!-- exclude armor sets (e.g. Stardust armor) |
||
-->{{#if:{{#lstfltr:minion/sentry|/|{{#var:ii:tags}}|/|/}}|<!-- |
-->{{#if:{{#lstfltr:minion/sentry|/|{{#var:ii:tags}}|/|/}}|<!-- |
||
Ligne 67 : | Ligne 82 : | ||
+ | +++++++++++++ 2. Fetch automatic data +++++++++++++ |
||
− | ////////// auto info as base //////////////// |
||
+ | |||
-->{{#invoke:Iteminfo|getInfo|prefix=ii:info:|id={{#vardefineecho:ii:auto_id|{{#if:{{{auto|}}}|<!-- |
-->{{#invoke:Iteminfo|getInfo|prefix=ii:info:|id={{#vardefineecho:ii:auto_id|{{#if:{{{auto|}}}|<!-- |
||
-->{{#iferror:{{#expr:1+{{{auto|}}}}}|<!-- if not is_number($auto) |
-->{{#iferror:{{#expr:1+{{{auto|}}}}}|<!-- if not is_number($auto) |
||
Ligne 78 : | Ligne 94 : | ||
-->}}}}}}<!-- fetch data or reset the data-filled vars. |
-->}}}}}}<!-- fetch data or reset the data-filled vars. |
||
+ | |||
− | ////////// post-process, manually override, and save into "standard" vars |
||
+ | +++++++++++++ 3. Process auto data, overriding with manual input if necessary +++++++++++++ |
||
+ | |||
+ | ---- id and name ---- |
||
-->{{#vardefine:ii:id|{{{id|{{#ifexpr:{{#dplvar:ii:info:type}}|{{#dplvar:ii:info:type}}}}}}}}}<!-- |
-->{{#vardefine:ii:id|{{{id|{{#ifexpr:{{#dplvar:ii:info:type}}|{{#dplvar:ii:info:type}}}}}}}}}<!-- |
||
-->{{#vardefine:ii:name|{{{name|{{#or:{{#dplvar:ii:info:name}}|{{#var:itemnamefrompagename}}}}}}}}}<!-- |
-->{{#vardefine:ii:name|{{{name|{{#or:{{#dplvar:ii:info:name}}|{{#var:itemnamefrompagename}}}}}}}}}<!-- |
||
Ligne 84 : | Ligne 103 : | ||
-->{{#vardefine:ii:lname|{{{lname|{{tr|{{#var:ii:name|}}}}}}}}}<!-- |
-->{{#vardefine:ii:lname|{{{lname|{{tr|{{#var:ii:name|}}}}}}}}}<!-- |
||
-->{{#vardefine:ii:internalName|{{#dplvar:ii:info:internalName}}}}<!-- |
-->{{#vardefine:ii:internalName|{{#dplvar:ii:info:internalName}}}}<!-- |
||
+ | -------- |
||
+ | ---- autoswing and stack ---- |
||
-->{{#vardefine:ii:autoswing|{{{autoswing|{{#dplvar:ii:info:autoReuse}}}}}}}<!-- |
-->{{#vardefine:ii:autoswing|{{{autoswing|{{#dplvar:ii:info:autoReuse}}}}}}}<!-- |
||
− | |||
-->{{#vardefine:ii:stack|<!-- |
-->{{#vardefine:ii:stack|<!-- |
||
-->{{#if:{{{stack|}}}<!-- |
-->{{#if:{{{stack|}}}<!-- |
||
Ligne 93 : | Ligne 113 : | ||
-->}}<!-- |
-->}}<!-- |
||
-->}}<!-- |
-->}}<!-- |
||
+ | -------- |
||
+ | ---- hammer, pick, axe power ---- |
||
-->{{#vardefine:ii:hammer|{{#ifexpr:{{#dplvar:ii:info:hammer}}|{{#dplvar:ii:info:hammer}}%}}}}<!-- |
-->{{#vardefine:ii:hammer|{{#ifexpr:{{#dplvar:ii:info:hammer}}|{{#dplvar:ii:info:hammer}}%}}}}<!-- |
||
-->{{#if:{{{hammer|}}}|<!-- |
-->{{#if:{{{hammer|}}}|<!-- |
||
Ligne 106 : | Ligne 128 : | ||
-->{{#vardefine:ii:axe|{{#rreplace:{{{axe|}}}|@@@@|{{#var:ii:axe}}}}}}<!-- |
-->{{#vardefine:ii:axe|{{#rreplace:{{{axe|}}}|@@@@|{{#var:ii:axe}}}}}}<!-- |
||
-->}}<!-- |
-->}}<!-- |
||
− | //add "tool" to types, and try to detect chainsaws/drills/hamaxes... |
+ | // add "tool" to types, and try to detect chainsaws/drills/hamaxes... |
-->{{#ifexpr:{{#dplvar:ii:info:axe}}{{#dplvar:ii:info:hammer}}{{#dplvar:ii:info:pick}}|<!-- if at least one of the three is non-zero |
-->{{#ifexpr:{{#dplvar:ii:info:axe}}{{#dplvar:ii:info:hammer}}{{#dplvar:ii:info:pick}}|<!-- if at least one of the three is non-zero |
||
-->{{#vardefine:ii:types|{{#lstapp:{{#var:ii:types}}|/|tool}}}}<!-- |
-->{{#vardefine:ii:types|{{#lstapp:{{#var:ii:types}}|/|tool}}}}<!-- |
||
+ | // hammers and hamaxes |
||
− | //hammer & hamaxe |
||
-->{{#ifexpr:{{#dplvar:ii:info:hammer}}|<!-- |
-->{{#ifexpr:{{#dplvar:ii:info:hammer}}|<!-- |
||
-->{{#ifexpr:{{#dplvar:ii:info:axe}}<!-- |
-->{{#ifexpr:{{#dplvar:ii:info:axe}}<!-- |
||
Ligne 116 : | Ligne 138 : | ||
-->}}<!-- |
-->}}<!-- |
||
-->}}<!-- |
-->}}<!-- |
||
− | // |
+ | // axes and chainsaws |
-->{{#ifexpr:{{#dplvar:ii:info:axe}}|<!-- |
-->{{#ifexpr:{{#dplvar:ii:info:axe}}|<!-- |
||
-->{{#ifexpr:{{#dplvar:ii:info:hammer}}||<!-- exclude hamaxes |
-->{{#ifexpr:{{#dplvar:ii:info:hammer}}||<!-- exclude hamaxes |
||
Ligne 125 : | Ligne 147 : | ||
-->}}<!-- |
-->}}<!-- |
||
-->}}<!-- |
-->}}<!-- |
||
− | // |
+ | // pickaxes and drills |
-->{{#ifexpr:{{#dplvar:ii:info:pick}}|<!-- |
-->{{#ifexpr:{{#dplvar:ii:info:pick}}|<!-- |
||
-->{{#ifexpr:{{#dplvar:ii:info:shoot}}<!-- |
-->{{#ifexpr:{{#dplvar:ii:info:shoot}}<!-- |
||
Ligne 133 : | Ligne 155 : | ||
-->}}<!-- |
-->}}<!-- |
||
-->}}<!-- |
-->}}<!-- |
||
+ | -------- |
||
+ | ---- pick-/hammerreq ---- |
||
-->{{#vardefine:ii:pickreq|{{{pickreq|}}}}}<!-- |
-->{{#vardefine:ii:pickreq|{{{pickreq|}}}}}<!-- |
||
-->{{#vardefine:ii:hammerreq|{{{hammerreq|}}}}}<!-- |
-->{{#vardefine:ii:hammerreq|{{{hammerreq|}}}}}<!-- |
||
+ | -------- |
||
+ | ---- ammo type ---- |
||
-->{{#vardefine:ii:ammo|{{#dplvar:ii:info:ammo}}}}<!-- |
-->{{#vardefine:ii:ammo|{{#dplvar:ii:info:ammo}}}}<!-- |
||
-->{{#ifexpr:{{#var:ii:ammo}}|<!-- Ammo type/cate |
-->{{#ifexpr:{{#var:ii:ammo}}|<!-- Ammo type/cate |
||
− | //add "Ammunition |
+ | // add "Ammunition" to type. |
− | -->{{#vardefine:ii:types|{{#lstapp:{{#var:ii:types}}|/|ammunition |
+ | -->{{#vardefine:ii:types|{{#lstapp:{{#var:ii:types}}|/|ammunition}}}}<!-- |
− | //add ammo type to listcat: (by AmmoID) |
+ | // add ammo type to listcat: (by AmmoID) |
-->{{#vardefine:ii:listcats|{{#lstapp:{{#var:ii:listcats}}|/|{{#switch:{{#var:ii:ammo}}<!-- |
-->{{#vardefine:ii:listcats|{{#lstapp:{{#var:ii:listcats}}|/|{{#switch:{{#var:ii:ammo}}<!-- |
||
-->|40=arrows<!-- |
-->|40=arrows<!-- |
||
Ligne 173 : | Ligne 199 : | ||
-->|3108=nailFriendly<!-- |
-->|3108=nailFriendly<!-- |
||
-->}}}}<!-- |
-->}}}}<!-- |
||
+ | -------- |
||
+ | ---- various types, listcats, and tags ---- |
||
-->{{#if:{{#dplvar:ii:info:accessory}}|<!-- accessory? |
-->{{#if:{{#dplvar:ii:info:accessory}}|<!-- accessory? |
||
-->{{#vardefine:ii:types|{{#lstapp:{{#var:ii:types}}|/|accessory}}}}<!-- |
-->{{#vardefine:ii:types|{{#lstapp:{{#var:ii:types}}|/|accessory}}}}<!-- |
||
Ligne 199 : | Ligne 227 : | ||
-->}}<!-- |
-->}}<!-- |
||
+ | ---- fishing power and bait ---- |
||
-->{{#vardefine:ii:fishing|{{{fishing|{{#dplvar:ii:info:fishingPole}}}}}}}<!-- |
-->{{#vardefine:ii:fishing|{{{fishing|{{#dplvar:ii:info:fishingPole}}}}}}}<!-- |
||
-->{{#vardefine:ii:bait|{{{bait|{{#dplvar:ii:info:bait}}}}}}}<!-- |
-->{{#vardefine:ii:bait|{{{bait|{{#dplvar:ii:info:bait}}}}}}}<!-- |
||
Ligne 205 : | Ligne 234 : | ||
-->}}<!-- |
-->}}<!-- |
||
− | + | ---- damage and damagetype ---- |
|
+ | // use damage if damage>0 or "weapon" in types |
||
-->{{#vardefine:ii:damage|{{#ifexpr:({{#dplvar:ii:info:damage}}>0) or {{#or:{{#lstind:weapon|{{#var:ii:types}}|/}}|0}}|{{#dplvar:ii:info:damage}}}}}}<!-- |
-->{{#vardefine:ii:damage|{{#ifexpr:({{#dplvar:ii:info:damage}}>0) or {{#or:{{#lstind:weapon|{{#var:ii:types}}|/}}|0}}|{{#dplvar:ii:info:damage}}}}}}<!-- |
||
-->{{#ifeq:{{{damage|-unset}}}|{{{damage|unset-}}}|<!-- allow "|damage=" to suppress damage display |
-->{{#ifeq:{{{damage|-unset}}}|{{{damage|unset-}}}|<!-- allow "|damage=" to suppress damage display |
||
Ligne 217 : | Ligne 247 : | ||
-->|{{#dplvar:ii:info:thrown}}=Throwing<!-- |
-->|{{#dplvar:ii:info:thrown}}=Throwing<!-- |
||
-->}}}}}}<!-- |
-->}}}}}}<!-- |
||
− | //other, non-weapon items with autodamage |
+ | // other, non-weapon items with autodamage |
-->{{#ifexpr:{{#dplvar:ii:info:damage}}>0|<!-- |
-->{{#ifexpr:{{#dplvar:ii:info:damage}}>0|<!-- |
||
-->{{#if:{{#lstind:tool|{{#var:ii:types}}|/}}|<!-- |
-->{{#if:{{#lstind:tool|{{#var:ii:types}}|/}}|<!-- |
||
Ligne 229 : | Ligne 259 : | ||
-->}}<!-- |
-->}}<!-- |
||
-->}}<!-- |
-->}}<!-- |
||
− | //add "<auto damagetype> weapons" to listcats |
+ | // add "<auto damagetype> weapons" to listcats |
-->{{#if:{{#var:ii:damagetype}}|<!-- |
-->{{#if:{{#var:ii:damagetype}}|<!-- |
||
-->{{#if:{{#lstind:weapon|{{#var:ii:types}}|/}}|<!-- |
-->{{#if:{{#lstind:weapon|{{#var:ii:types}}|/}}|<!-- |
||
Ligne 243 : | Ligne 273 : | ||
-->}}<!-- |
-->}}<!-- |
||
-->}}<!-- |
-->}}<!-- |
||
+ | -------- |
||
− | + | ---- research ---- |
|
-->{{#vardefine:ii:sacrifices|{{{research|{{#ifexpr:{{#dplvar:ii:info:sacrifices}}>0|{{#dplvar:ii:info:sacrifices}}}}}}}}}<!-- |
-->{{#vardefine:ii:sacrifices|{{{research|{{#ifexpr:{{#dplvar:ii:info:sacrifices}}>0|{{#dplvar:ii:info:sacrifices}}}}}}}}}<!-- |
||
+ | -------- |
||
+ | ---- knockback ---- |
||
− | -->{{#vardefine:ii:DD2Summon|<!-- |
||
− | -->{{#if:{{#lstind:dd2|{{#var:ii:tags}}|/}}|1|{{#dplvar:ii:info:DD2Summon}}}}<!-- |
||
− | -->}}<!-- |
||
− | |||
// use kb if autokb>0, always use kb for all axe/hammer/pick tools, always use kb for all weapons |
// use kb if autokb>0, always use kb for all axe/hammer/pick tools, always use kb for all weapons |
||
-->{{#vardefine:ii:knockback|<!-- |
-->{{#vardefine:ii:knockback|<!-- |
||
Ligne 258 : | Ligne 287 : | ||
-->{{#vardefine:ii:knockback|{{#rreplace:{{{knockback|}}}|@@@@|{{knockback|{{#var:ii:knockback}}|full=y}}}}}}<!-- |
-->{{#vardefine:ii:knockback|{{#rreplace:{{{knockback|}}}|@@@@|{{knockback|{{#var:ii:knockback}}|full=y}}}}}}<!-- |
||
-->}}<!-- |
-->}}<!-- |
||
+ | -------- |
||
+ | ---- defense ---- |
||
-->{{#vardefine:ii:defense|{{#ifexpr:{{#dplvar:ii:info:defense}}>0<!-- |
-->{{#vardefine:ii:defense|{{#ifexpr:{{#dplvar:ii:info:defense}}>0<!-- |
||
-->|{{#dplvar:ii:info:defense}}<!-- |
-->|{{#dplvar:ii:info:defense}}<!-- |
||
Ligne 268 : | Ligne 299 : | ||
-->{{#vardefine:ii:defense|{{#rreplace:{{{defense|}}}|@@@@|{{#var:ii:defense|0}}}}}}<!-- |
-->{{#vardefine:ii:defense|{{#rreplace:{{{defense|}}}|@@@@|{{#var:ii:defense|0}}}}}}<!-- |
||
-->}}<!-- |
-->}}<!-- |
||
+ | -------- |
||
+ | ---- tile (range) boost ---- |
||
-->{{#vardefine:ii:tileboost|{{{tileboost|{{#ifexpr:{{#dplvar:ii:info:tileBoost}}|{{#dplvar:ii:info:tileBoost}}}}}}}}}<!-- |
-->{{#vardefine:ii:tileboost|{{{tileboost|{{#ifexpr:{{#dplvar:ii:info:tileBoost}}|{{#dplvar:ii:info:tileBoost}}}}}}}}}<!-- |
||
+ | -------- |
||
+ | ---- mana cost and mana and health heal ---- |
||
-->{{#vardefine:ii:mana|{{#ifexpr:{{#dplvar:ii:info:mana}}>0|{{#dplvar:ii:info:mana}}}}}}<!-- |
-->{{#vardefine:ii:mana|{{#ifexpr:{{#dplvar:ii:info:mana}}>0|{{#dplvar:ii:info:mana}}}}}}<!-- |
||
-->{{#if:{{{mana|}}}|<!-- |
-->{{#if:{{{mana|}}}|<!-- |
||
Ligne 283 : | Ligne 318 : | ||
-->{{#vardefine:ii:hheal|{{#rreplace:{{{hheal|}}}|@@@@|{{#var:ii:healLife}}}}}}<!-- |
-->{{#vardefine:ii:hheal|{{#rreplace:{{{hheal|}}}|@@@@|{{#var:ii:healLife}}}}}}<!-- |
||
-->}}<!-- |
-->}}<!-- |
||
+ | -------- |
||
+ | ---- critical strike chance ---- |
||
-->{{#vardefine:ii:critical|<!-- |
-->{{#vardefine:ii:critical|<!-- |
||
-->{{#if:{{#var:ii:damage}}|<!-- if $damage |
-->{{#if:{{#var:ii:damage}}|<!-- if $damage |
||
Ligne 299 : | Ligne 336 : | ||
-->{{#vardefine:ii:critical|{{#rreplace:{{{critical|}}}|@@@@|{{#var:ii:critical}}%}}}}<!-- |
-->{{#vardefine:ii:critical|{{#rreplace:{{{critical|}}}|@@@@|{{#var:ii:critical}}%}}}}<!-- |
||
-->}}<!-- |
-->}}<!-- |
||
+ | -------- |
||
+ | ---- use time and tool speed ---- |
||
-->{{#vardefine:ii:use|{{#ifexpr:{{#dplvar:ii:info:useAnimation}}<100|{{#dplvar:ii:info:useAnimation}}}}}}<!-- |
-->{{#vardefine:ii:use|{{#ifexpr:{{#dplvar:ii:info:useAnimation}}<100|{{#dplvar:ii:info:useAnimation}}}}}}<!-- |
||
-->{{#if:{{{use|}}}|<!-- |
-->{{#if:{{{use|}}}|<!-- |
||
Ligne 312 : | Ligne 351 : | ||
-->{{#vardefine:ii:toolspeed|{{#rreplace:{{{toolspeed|}}}|@@@@|{{#var:ii:toolspeed}}}}}}<!-- |
-->{{#vardefine:ii:toolspeed|{{#rreplace:{{{toolspeed|}}}|@@@@|{{#var:ii:toolspeed}}}}}}<!-- |
||
-->}}<!-- |
-->}}<!-- |
||
+ | -------- |
||
+ | ---- buffs and debuffs ---- |
||
− | -->{{#vardefine:ii:idbuff|{{{idbuff|{{#ifexpr:{{#dplvar:ii:info:buffType}}>0|<!-- |
||
+ | -->{{#vardefine:ii:buffs|}}<!-- |
||
+ | -->{{#vardefine:ii:debuffs|}}<!-- |
||
+ | -->{{#vardefine:ii:buff-1:id|}}<!-- |
||
+ | -->{{#vardefine:ii:buff-1:duration|}}<!-- |
||
+ | -->{{#vardefine:ii:debuff-1:id|}}<!-- |
||
+ | -->{{#vardefine:ii:debuff-1:duration|}}<!-- |
||
+ | // auto buff info: |
||
+ | -->{{#vardefine:ii:autobuff:id|{{#ifexpr:{{#dplvar:ii:info:buffType}}>0|<!-- |
||
-->{{#dplvar:ii:info:buffType}}<!-- |
-->{{#dplvar:ii:info:buffType}}<!-- |
||
-->|<!-- |
-->|<!-- |
||
− | -->{{#ifexpr:{{#dplvar:ii:info:mountType}}>-1|{{ |
+ | -->{{#ifexpr:{{#dplvar:ii:info:mountType}}>-1|{{buffIdFromName|{{getMountInfo|{{#dplvar:ii:info:mountType}}|name}}}}}}<!-- |
− | --> |
+ | -->}}}}<!-- |
+ | -->{{#if:{{#var:ii:autobuff:id}}|<!-- |
||
− | -->{{#vardefine:ii:buffduration|{{#ifexpr:{{#dplvar:ii:info:buffTime}}>0|{{duration|{{#expr:{{#dplvar:ii:info:buffTime}}/60}}}}}}}}<!-- in seconds (autoduration is in millis) |
||
+ | -->{{#vardefine:ii:autobuff:type|{{lc:{{getBuffInfo|{{#var:ii:autobuff:id}}|type}}}}}}<!-- |
||
− | -->{{#ifeq:{{{duration|-unset}}}|{{{duration|unset-}}}|<!-- allow "|duration=" to suppress duration display |
||
− | -->{{#vardefine:ii: |
+ | -->{{#vardefine:ii:autobuff:duration|{{#ifexpr:{{#dplvar:ii:info:buffTime}}>0|{{duration|{{#expr:{{#dplvar:ii:info:buffTime}}/60}}}}}}}}<!-- in seconds (autoduration is in millis) |
+ | -->{{#vardefine:ii:{{#var:ii:autobuff:type}}-1:id|{{#var:ii:autobuff:id}}}}<!-- |
||
+ | -->{{#vardefine:ii:{{#var:ii:autobuff:type}}-1:duration|{{#var:ii:autobuff:duration}}}}<!-- |
||
+ | -->{{#vardefine:ii:{{#var:ii:autobuff:type}}s|-1}}<!-- |
||
-->}}<!-- |
-->}}<!-- |
||
+ | |||
− | //ext buffinfo |
||
+ | // loop: {{#var:bufftype}} is "buff" during first iteration and "debuff" during second iteration |
||
− | -->{{#vardefine:ii:buff|}}<!-- |
||
+ | // (buff and debuff handling is identical, only the names are different) |
||
− | -->{{#vardefine:ii:bufftype|}}<!-- |
||
− | -->{{#vardefine: |
+ | -->{{#loop:_i|0|2|{{#vardefine:bufftype|{{#ifexpr:{{#var:_i}}|de}}buff}}<!-- |
+ | // we have an ii:buffs and an ii:debuffs array ("ii:{{#var:bufftype}}s"), which hold the indices of all $de-/buff parameters |
||
− | -->{{#vardefine:ii:bufflink|}}<!-- |
||
+ | // the unindexed "|buff=" / "|debuff=" parameters are represented by "-1", which is always the first element of these arrays, if those parameters are set |
||
− | -->{{#vardefine:ii:bufftip|}}<!-- |
||
+ | // the "-1" is therefore also set if there is buff information in the autodata, since that auto information can be overwritten using the unindexed parameter |
||
− | -->{{#vardefine:ii:buffchance|}}<!-- |
||
− | -->{{#vardefine:ii: |
+ | -->{{#if:{{{ {{#var:bufftype}}|}}}|{{#vardefine:ii:{{#var:bufftype}}s|-1}}}}<!-- set first array element to -1 |
+ | -->{{#forargs:{{#var:bufftype}}|k|_|{{#if:{{#rmatch:{{#var:k}}|/^\d+$/|y}}|<!-- for all parameters: if parameter name is "{de-/buff}<integer>" |
||
− | -->{{#if:{{#var:ii:idbuff}}|<!-- |
||
− | + | -->{{#vardefine:ii:{{#var:bufftype}}s|{{#lstapp:{{#var:ii:{{#var:bufftype}}s}}|₪|{{#var:k}}}}}}<!-- then add buff index to de-/buffs array |
|
− | -->{{#vardefine:ii:bufftype|{{{bufftype|{{getBuffInfo|{{#var:ii:idbuff}}|type}}}}}}}<!-- |
||
− | -->{{#vardefine:ii:bufflink|{{{bufflink|{{getBuffInfo|{{#var:ii:idbuff}}|page}}}}}}}<!-- |
||
− | -->{{#vardefine:ii:bufftip|{{{bufftip|{{getBuffInfo|{{#var:ii:idbuff}}|tooltip}}}}}}}<!-- |
||
− | -->|<!-- no idbuff, see if there is $buff or $debuff |
||
− | -->{{#if:{{{debuff|}}}|<!-- |
||
− | -->{{#arraydefine:buffinfo|{{{debuff|}}}|/}}<!-- |
||
− | -->{{#vardefine:ii:bufftype|Debuff}}<!-- |
||
− | -->|{{#if:{{{buff|}}}|<!-- |
||
− | -->{{#arraydefine:buffinfo|{{{buff|}}}|/}}<!-- |
||
− | -->{{#vardefine:ii:bufftype|Buff}}<!-- |
||
-->}}}}<!-- |
-->}}}}<!-- |
||
− | -->{{# |
+ | -->{{#vardefine:ii:{{#var:bufftype}}s|{{#lstsrt:{{#var:ii:{{#var:bufftype}}s}}|₪|₪|numeric}}}}<!-- sort parameter indices |
+ | -->{{#loop:i|1|{{#lstcnt:{{#var:ii:{{#var:bufftype}}s}}|₪}}|<!-- iterate over parameter indices |
||
− | -->{{#vardefine:ii:idbuff|{{buffIdFromName|{{#arrayindex:buffinfo|0}}}}}}<!-- |
||
− | -->{{# |
+ | -->{{#vardefine:j|{{#lstelem:{{#var:ii:{{#var:bufftype}}s}}|₪|{{#var:i}}}}}}<!-- j is the parameter index |
− | + | -->{{#vardefine:k|{{#ifeq:{{#var:j}}|-1||{{#var:j}}}}}}<!-- k=j, unless j=-1, in which case k=(empty), since we use "${de-/buff}" instead of "${de-/buff}-1" |
|
− | + | -->{{#arraydefine:buffinfo|{{{ {{#var:bufftype}}{{#var:k}}|}}}|/}}<!-- |
|
+ | // we store the information that the view needs in variables with a "ii:<bufftype><parameter index>:<stat>" format |
||
+ | -->{{#vardefine:ii:{{#var:bufftype}}{{#var:j}}:mobile|}}<!-- |
||
+ | // buff id |
||
+ | -->{{#vardefine:ii:{{#var:bufftype}}{{#var:j}}:id|{{{id{{#var:bufftype}}{{#var:k}}|{{#or:<!-- |
||
+ | -->{{buffIdFromName|{{#arrayindex:buffinfo|0}}}}<!-- buffinfo[0] will always contain the de-/buff name, regardless of whether compact mode was used or not |
||
+ | -->|<!-- |
||
+ | -->{{#var:ii:{{#var:bufftype}}{{#var:j}}:id}}<!-- |
||
+ | -->}}}}}}}<!-- |
||
+ | -->{{#if:{{#var:ii:{{#var:bufftype}}{{#var:j}}:id}}|{{#ifeq:{{#sub:{{#var:ii:{{#var:bufftype}}{{#var:j}}:id}}|0|1}}|m|<!-- if is mobile id |
||
+ | -->{{#vardefine:ii:{{#var:bufftype}}{{#var:j}}:id|{{#sub:{{#var:ii:{{#var:bufftype}}{{#var:j}}:id}}|1}}}}<!-- |
||
+ | -->{{#vardefine:ii:{{#var:bufftype}}{{#var:j}}:mobile|m}}<!-- |
||
-->}}}}<!-- |
-->}}}}<!-- |
||
+ | // de-/buff name |
||
− | -->{{#vardefine:ii:buff|{{#if:{{#var:ii:idbuff}}|{{getBuffInfo|{{#var:ii:mobilebuff}}{{#var:ii:idbuff}}|ename}}|{{#arrayindex:buffinfo|0}}}}}}<!-- |
||
− | -->{{#vardefine:ii: |
+ | -->{{#vardefine:ii:{{#var:bufftype}}{{#var:j}}:name|<!-- |
− | -->{{# |
+ | -->{{#if:{{#var:ii:{{#var:bufftype}}{{#var:j}}:id}}|<!-- |
− | -->{{# |
+ | -->{{getBuffInfo|{{#var:ii:{{#var:bufftype}}{{#var:j}}:mobile}}{{#var:ii:{{#var:bufftype}}{{#var:j}}:id}}|ename}}<!-- |
+ | -->|<!-- |
||
− | -->{{#vardefine:ii:bufftip|{{{debufftip|{{getBuffInfo|{{#var:ii:mobilebuff}}{{#var:ii:idbuff}}|tooltip}}}}}}}<!-- |
||
+ | -->{{#arrayindex:buffinfo|0}}<!-- |
||
+ | -->}}<!-- |
||
+ | -->}}<!-- |
||
+ | // de-/buff duration, chance, tooltip, and link |
||
+ | -->{{#vardefine:ii:{{#var:bufftype}}{{#var:j}}:duration|{{#if:{{#var:k}}|<!-- in seconds |
||
+ | // for ${de/buff}<integer> |
||
+ | -->{{{ {{#var:bufftype}}duration{{#var:k}}|{{#arrayindex:buffinfo|1}}}}}<!-- |
||
+ | -->|<!-- |
||
+ | // for ${de-/buff} (potentially overriding auto data) |
||
+ | // $duration -> ${de-/buff}duration -> ${de-/buff} compact mode -> auto data |
||
+ | -->{{#rreplace:<!-- |
||
+ | -->{{#ifeq:{{{duration|-unset}}}|{{{duration|unset-}}}|<!-- allow "|duration=" to suppress duration display |
||
+ | -->{{{duration|}}}<!-- |
||
+ | -->|{{#ifeq:{{{ {{#var:bufftype}}duration|-unset}}}|{{{ {{#var:bufftype}}duration|unset-}}}|<!-- allow "|{de-/buff}duration=" to suppress duration display |
||
+ | -->{{{ {{#var:bufftype}}duration|}}}<!-- |
||
+ | -->|<!-- |
||
+ | -->{{#or:{{#arrayindex:buffinfo|1}}|@@@@}}<!-- |
||
+ | -->}}}}<!-- |
||
+ | -->|/@@@@/|{{#var:ii:{{#var:bufftype}}-1:duration}}}}<!-- |
||
+ | -->}}}}<!-- |
||
+ | -->{{#vardefine:ii:{{#var:bufftype}}{{#var:j}}:chance|{{{ {{#var:bufftype}}chance{{#var:k}}|{{#arrayindex:buffinfo|2}}}}}}}<!-- |
||
+ | -->{{#vardefine:ii:{{#var:bufftype}}{{#var:j}}:tooltip|{{{ {{#var:bufftype}}tip{{#var:k}}|{{getBuffInfo|{{#var:ii:{{#var:bufftype}}{{#var:j}}:mobile}}{{#var:ii:{{#var:bufftype}}{{#var:j}}:id}}|tooltip}}}}}}}<!-- |
||
+ | -->{{#vardefine:ii:{{#var:bufftype}}{{#var:j}}:link|{{{ {{#var:bufftype}}link{{#var:k}}|{{getBuffInfo|{{#var:ii:{{#var:bufftype}}{{#var:j}}:mobile}}{{#var:ii:{{#var:bufftype}}{{#var:j}}:id}}|page}}}}}}}<!-- |
||
+ | -->{{#ifeq:{{#var:ii:{{#var:bufftype}}{{#var:j}}:link}}|{{PAGENAME}}|<!-- if is self link (using PAGENAME instead of BASEPAGENAME/ROOTPAGENAME, to incorporate all languages) |
||
+ | // add "de-/buffs" to listcat |
||
+ | -->{{#vardefine:ii:listcats|{{#lstapp:{{#var:ii:listcats}}|/|{{#var:bufftype}}s}}}}<!-- |
||
+ | -->}}<!-- |
||
-->}}<!-- |
-->}}<!-- |
||
-->}}<!-- |
-->}}<!-- |
||
+ | -------- |
||
− | -->{{#ifeq:{{lc:{{#var:ii:bufftype}}}}|debuff|<!-- |
||
− | -->{{#vardefine:ii:debuffchance|{{{debuffchance|{{#var:ii:buffchance}}}}}}}<!-- |
||
− | -->{{#vardefine:ii:buffchance|}}<!-- infoboxView checks for this var and would print two chances, so it is necessary to unset it here |
||
− | -->}}<!-- |
||
− | -->{{#ifeq:{{#var:ii:bufflink}}|{{PAGENAME}}|<!-- if is self link (use PAGENAME instead of BASEPAGENAME/ROOTPAGENAME for all languages.) |
||
− | //add "buffs" to listcat |
||
− | -->{{#vardefine:ii:listcats|{{#lstapp:{{#var:ii:listcats}}|/|buffs}}}}<!-- |
||
− | -->}}<!-- |
||
+ | ---- rarity ---- |
||
− | -->{{#vardefine:ii:rare|{{#dplvar:ii:info:rare}}}}<!-- |
||
+ | -->{{#vardefine:ii:rawrare|{{#dplvar:ii:info:rare}}}}<!-- |
||
-->{{#if:{{#dplvar:ii:info:questItem}}<!-- quest |
-->{{#if:{{#dplvar:ii:info:questItem}}<!-- quest |
||
− | -->|{{#vardefine:ii: |
+ | -->|{{#vardefine:ii:rawrare|quest}}<!-- |
− | -->|{{#ifeq:{{#dplvar:ii:info:rare}}|-11|{{#vardefine:ii: |
+ | -->|{{#ifeq:{{#dplvar:ii:info:rare}}|-11|{{#vardefine:ii:rawrare|quest}}}}<!-- |
-->}}<!-- |
-->}}<!-- |
||
//auto rarity for armor/vanity sets |
//auto rarity for armor/vanity sets |
||
-->{{#if:{{#var:ii:isArmorSet}}|<!-- |
-->{{#if:{{#var:ii:isArmorSet}}|<!-- |
||
− | -->{{#vardefine:ii: |
+ | -->{{#vardefine:ii:rawrare|{{getSetInfo|{{#var:ii:name}}|rare|raw=y}}}}<!-- |
-->}}<!-- |
-->}}<!-- |
||
-->{{#vardefine:ii:rare|<!-- |
-->{{#vardefine:ii:rare|<!-- |
||
-->{{#ifeq:{{{rare|-unset}}}|{{{rare|unset-}}}<!-- allow "|rare=" to suppress rarity display |
-->{{#ifeq:{{{rare|-unset}}}|{{{rare|unset-}}}<!-- allow "|rare=" to suppress rarity display |
||
− | -->|{{#rreplace:{{{rare|}}}|@@@@|{{#if:{{#var:ii: |
+ | -->|{{#vardefineecho:ii:rawrare|{{#rreplace:{{{rare|}}}|@@@@|{{#if:{{#var:ii:rawrare}}|{{rare|{{#var:ii:rawrare}}}}}}}}}}<!-- |
− | -->|{{#if:{{#var:ii: |
+ | -->|{{#if:{{#var:ii:rawrare}}|{{rare|{{#var:ii:rawrare}}}}}}<!-- |
-->}}<!-- |
-->}}<!-- |
||
-->}}<!-- |
-->}}<!-- |
||
+ | -------- |
||
+ | ---- buy price and sell value ---- |
||
-->{{#vardefine:ii:shopCustomPrice|{{#dplvar:ii:info:shopCustomPrice}}}}<!-- defender medals (dm) |
-->{{#vardefine:ii:shopCustomPrice|{{#dplvar:ii:info:shopCustomPrice}}}}<!-- defender medals (dm) |
||
-->{{#vardefine:ii:value|{{{value|{{#ifexpr:{{#dplvar:ii:info:value}}>0|{{#dplvar:ii:info:value}}}}}}}}}<!-- |
-->{{#vardefine:ii:value|{{{value|{{#ifexpr:{{#dplvar:ii:info:value}}>0|{{#dplvar:ii:info:value}}}}}}}}}<!-- |
||
Ligne 415 : | Ligne 490 : | ||
-->}}<!-- |
-->}}<!-- |
||
-->}}<!-- |
-->}}<!-- |
||
+ | -------- |
||
+ | ---- ids ---- |
||
-->{{#vardefine:ii:idtile|{{{idtile|<!-- |
-->{{#vardefine:ii:idtile|{{{idtile|<!-- |
||
-->{{#ifexpr:{{#dplvar:ii:info:createTile}}>-1|{{#dplvar:ii:info:createTile}}}}<!-- |
-->{{#ifexpr:{{#dplvar:ii:info:createTile}}>-1|{{#dplvar:ii:info:createTile}}}}<!-- |
||
Ligne 465 : | Ligne 542 : | ||
-->}}<!-- |
-->}}<!-- |
||
-->}}}}}<!-- |
-->}}}}}<!-- |
||
+ | -->{{#vardefine:ii:idbuff|<!-- |
||
+ | -->{{#lstmap:{{#var:ii:buffs}}|₪|@@@@|<esc><!-- |
||
+ | -->{{#var:ii:buff@@@@:mobile}}₰{{#var:ii:buff@@@@:id}}₰{{#var:ii:ext:idbuffshow@@@@}}<!-- |
||
+ | --></esc>|₪}}<!-- |
||
+ | -->{{#listmap:intro=₪|list={{#var:ii:debuffs}}|insep=₪|token=@@@@|pattern=<esc><!-- |
||
+ | -->{{#var:ii:debuff@@@@:mobile}}₰{{#var:ii:debuff@@@@:id}}₰{{#var:ii:ext:iddebuffshow@@@@}}<!-- |
||
+ | --></esc>|outsep=₪}}<!-- |
||
+ | -->}}<!-- |
||
-->{{#vardefine:ii:idprojectile|{{{idprojectile|{{{shoot|{{#if:{{#var:ii:useammo}}||<!-- don't show default projectile id for items which use ammo. |
-->{{#vardefine:ii:idprojectile|{{{idprojectile|{{{shoot|{{#if:{{#var:ii:useammo}}||<!-- don't show default projectile id for items which use ammo. |
||
-->{{#ifexpr:{{#dplvar:ii:info:shoot}}>0|{{#dplvar:ii:info:shoot}}}}<!-- |
-->{{#ifexpr:{{#dplvar:ii:info:shoot}}>0|{{#dplvar:ii:info:shoot}}}}<!-- |
||
-->}}}}}}}}}}<!-- |
-->}}}}}}}}}}<!-- |
||
+ | -------- |
||
+ | ---- velocity ---- |
||
//velocity & extraUpdate fix |
//velocity & extraUpdate fix |
||
-->{{#vardefine:ii:velocity|<!-- |
-->{{#vardefine:ii:velocity|<!-- |
||
Ligne 488 : | Ligne 575 : | ||
-->{{#vardefine:ii:velocity|{{#rreplace:{{{velocity|{{{sspeed|}}}}}}|@@@@|{{#var:ii:velocity}}}}}}<!-- |
-->{{#vardefine:ii:velocity|{{#rreplace:{{{velocity|{{{sspeed|}}}}}}|@@@@|{{#var:ii:velocity}}}}}}<!-- |
||
-->}}<!-- |
-->}}<!-- |
||
+ | -------- |
||
+ | ---- tooltip ---- |
||
-->{{#vardefine:ii:tooltip|{{#if:{{#var:ii:auto_id}}|{{itemTooltip|{{#var:ii:auto_id}}|right={{l10n|item_infobox|rightclick}}}}}}}}<!-- |
-->{{#vardefine:ii:tooltip|{{#if:{{#var:ii:auto_id}}|{{itemTooltip|{{#var:ii:auto_id}}|right={{l10n|item_infobox|rightclick}}}}}}}}<!-- |
||
-->{{#ifeq:{{{tooltip|-unset}}}|{{{tooltip|unset-}}}|<!-- allow "|tooltip=" to suppress tooltip display |
-->{{#ifeq:{{{tooltip|-unset}}}|{{{tooltip|unset-}}}|<!-- allow "|tooltip=" to suppress tooltip display |
||
-->{{#vardefine:ii:tooltip|{{#rreplace:{{{tooltip|}}}|@@@@|{{#var:ii:tooltip}}}}}}<!-- |
-->{{#vardefine:ii:tooltip|{{#rreplace:{{{tooltip|}}}|@@@@|{{#var:ii:tooltip}}}}}}<!-- |
||
-->}}<!-- |
-->}}<!-- |
||
+ | -------- |
||
+ | ---- consumable and placeable ---- |
||
-->{{#vardefine:ii:consumable|{{{consumable|{{#dplvar:ii:info:consumable}}}}}}}<!-- |
-->{{#vardefine:ii:consumable|{{{consumable|{{#dplvar:ii:info:consumable}}}}}}}<!-- |
||
-->{{#vardefine:ii:placeable|{{{placeable|{{#if:{{#var:ii:idtile}}{{#var:ii:idwall}}|y}}}}}}}<!-- |
-->{{#vardefine:ii:placeable|{{{placeable|{{#if:{{#var:ii:idtile}}{{#var:ii:idwall}}|y}}}}}}}<!-- |
||
− | |||
-->{{#if:{{#lstfltr:block/brick|/|{{#var:ii:types}}|/}}<!-- |
-->{{#if:{{#lstfltr:block/brick|/|{{#var:ii:types}}|/}}<!-- |
||
-->|{{#vardefine:ii:width|{{{width|1}}}}}{{#vardefine:ii:height|{{{height|1}}}}}<!-- default to 1×1 for blocks |
-->|{{#vardefine:ii:width|{{{width|1}}}}}{{#vardefine:ii:height|{{{height|1}}}}}<!-- default to 1×1 for blocks |
||
Ligne 502 : | Ligne 592 : | ||
-->}}<!-- |
-->}}<!-- |
||
+ | ---- sounds ---- |
||
+ | // sounds array (ii:sounds): "name1:sound1_1.wav,sound1_2.wav;name2:sound2_1.wav,sound2_2.wav; ..." |
||
+ | -->{{#vardefine:ii:sounds|<!-- |
||
+ | -->{{#vardefine:_tile_sound_mode|}}<!-- |
||
+ | -->{{#ifexpr:{{#dplvar:ii:info:createWall}}>-1|<!-- |
||
+ | -->{{#vardefine:_tile_sound_mode|wall}}<!-- |
||
+ | -->}}<!-- |
||
+ | |||
+ | // put all usesounds in the first element of the ii:sounds array |
||
+ | -->{{#if:{{{sounduse|{{#dplvar:ii:info:UseSound}}}}}|<!-- |
||
+ | -->{{l10n|item_infobox|th:use}}:{{{sounduse|{{#lstmap:{{#dplvar:ii:info:UseSound}}|,|@@|@@.wav|,}}}}};<!-- |
||
+ | -->}}<!-- |
||
+ | -->{{#if:{{{soundplaced|{{#var:_tile_sound_mode}}}}}|<!-- |
||
+ | -->{{l10n|item_infobox|th:placed}}:{{{soundplaced|{{getWallInfo|{{#dplvar:ii:info:createWall}}|soundplaced}}}}};<!-- |
||
+ | -->}}<!-- |
||
+ | -->{{#if:{{{soundbreak|{{#var:_tile_sound_mode}}}}}|<!-- |
||
+ | -->{{l10n|item_infobox|th:broken}}:{{{soundbreak|{{getWallInfo|{{#dplvar:ii:info:createWall}}|soundbreak}}}}};<!-- |
||
+ | -->}}<!-- |
||
+ | -->}}<!-- |
||
+ | -->{{#forargs:sound|k|v|<!-- |
||
+ | -->{{#if:{{{soundcaption{{#var:k}}|}}}|<!-- |
||
+ | -->{{#vardefine:ii:sounds|{{#lstapp:{{#var:ii:sounds}}|;|<!-- |
||
+ | array element: "<caption n>:soundn_1.wav,soundn_2.wav, ..." |
||
+ | -->{{{soundcaption{{#var:k}}|}}}:{{#var:v}}<!-- |
||
+ | -->}}}}<!-- |
||
+ | -->}}<!-- |
||
+ | -->}}<!-- |
||
+ | -------- |
||
+ | |||
+ | ---- crafting type and listcat ---- |
||
-->{{#vardefine:ii:material|{{#dplvar:ii:info:material}}}}<!-- |
-->{{#vardefine:ii:material|{{#dplvar:ii:info:material}}}}<!-- |
||
-->{{#vardefine:ii:craftable|{{#dplvar:ii:info:craftable}}}}<!-- |
-->{{#vardefine:ii:craftable|{{#dplvar:ii:info:craftable}}}}<!-- |
||
Ligne 515 : | Ligne 635 : | ||
-->}}<!-- |
-->}}<!-- |
||
-->}}<!-- |
-->}}<!-- |
||
+ | -------- |
||
+ | ---- dd2 sentry weapon ---- |
||
+ | -->{{#vardefine:ii:DD2Summon|<!-- |
||
+ | -->{{#if:{{#lstind:dd2|{{#var:ii:tags}}|/}}|1|{{#dplvar:ii:info:DD2Summon}}}}<!-- |
||
+ | -->}}<!-- |
||
+ | -------- |
||
+ | |||
+ | |||
+ | +++++++++++++ 4. Process additional parameter input, unrelated to auto data +++++++++++++ |
||
+ | |||
+ | ---- bonus and set bonus ---- |
||
-->{{#vardefine:ii:bonus|{{{bonus|}}}}}<!-- |
-->{{#vardefine:ii:bonus|{{{bonus|}}}}}<!-- |
||
-->{{#vardefine:ii:setbonus|{{#if:{{#var:ii:isArmorSet}}|{{#if:{{#lstind:vanity|{{#var:ii:types}}|/}}||<!-- for armor sets: |
-->{{#vardefine:ii:setbonus|{{#if:{{#var:ii:isArmorSet}}|{{#if:{{#lstind:vanity|{{#var:ii:types}}|/}}||<!-- for armor sets: |
||
Ligne 523 : | Ligne 654 : | ||
-->{{#vardefine:ii:setbonus|{{#rreplace:{{{setbonus|}}}|@@@@|{{#var:ii:setbonus}}}}}}<!-- |
-->{{#vardefine:ii:setbonus|{{#rreplace:{{{setbonus|}}}|@@@@|{{#var:ii:setbonus}}}}}}<!-- |
||
-->}}<!-- |
-->}}<!-- |
||
+ | -------- |
||
+ | ---- hardmode and allversions ---- |
||
-->{{#vardefine:ii:hardmodeonly|{{{hardmode|{{#if:{{#lstfltr:hardmodeonly/hardmode|/|{{#var:ii:tags}}|/}}|y}}}}}}}<!-- |
-->{{#vardefine:ii:hardmodeonly|{{{hardmode|{{#if:{{#lstfltr:hardmodeonly/hardmode|/|{{#var:ii:tags}}|/}}|y}}}}}}}<!-- |
||
-->{{#vardefine:ii:allversions|{{#switch:{{lc:{{{allversions|}}}}}<!-- allversions? |
-->{{#vardefine:ii:allversions|{{#switch:{{lc:{{{allversions|}}}}}<!-- allversions? |
||
Ligne 532 : | Ligne 665 : | ||
-->|{{#if:{{#var:ii:id}}|{{#if:{{eversions|{{#var:ii:name}}|raw=y}}|<!--not all versions-->|y}}}}}}<!-- id and eversions |
-->|{{#if:{{#var:ii:id}}|{{#if:{{eversions|{{#var:ii:name}}|raw=y}}|<!--not all versions-->|y}}}}}}<!-- id and eversions |
||
-->}}}}<!-- |
-->}}}}<!-- |
||
+ | -------- |
||
+ | ---- images ---- |
||
− | |||
− | //sounds array (ii:sounds): "name1:sound1_1.wav,sound1_2.wav;name2:sound2_1.wav,sound2_2.wav; ..." |
||
− | //put all usesounds in the first element of the ii:sounds array |
||
− | -->{{#if:{{{sounduse|{{#dplvar:ii:info:UseSound}}}}}|<!-- |
||
− | array element: "Use:usesound_1.wav,usesound_2.wav, ..." |
||
− | -->{{#vardefine:ii:sounds|{{l10n|item_infobox|th:use}}:{{{sounduse|{{#lstmap:{{#dplvar:ii:info:UseSound}}|,|@@|@@.wav|,}}}}}}}<!-- |
||
− | -->}}<!-- |
||
− | -->{{#forargs:sound|k|v|<!-- |
||
− | -->{{#if:{{{soundcaption{{#var:k}}|}}}|<!-- |
||
− | -->{{#vardefine:ii:sounds|{{#lstapp:{{#var:ii:sounds}}|;|<!-- |
||
− | array element: "<caption n>:soundn_1.wav,soundn_2.wav, ..." |
||
− | -->{{{soundcaption{{#var:k}}|}}}:{{#var:v}}<!-- |
||
− | -->}}}}<!-- |
||
− | -->}}<!-- |
||
− | -->}}<!-- |
||
− | |||
− | //images: |
||
-->{{#vardefine:ii:imagealt|}}<!-- full image code for image area |
-->{{#vardefine:ii:imagealt|}}<!-- full image code for image area |
||
-->{{#vardefine:ii:imagefile|}}<!-- main image file |
-->{{#vardefine:ii:imagefile|}}<!-- main image file |
||
Ligne 558 : | Ligne 676 : | ||
-->{{#vardefine:ii:imageequipped|}}<!-- |
-->{{#vardefine:ii:imageequipped|}}<!-- |
||
-->{{#vardefine:ii:imageext|}}<!-- custom extra images. full image code. |
-->{{#vardefine:ii:imageext|}}<!-- custom extra images. full image code. |
||
− | //images: There are some expensive calls in image auto detection, so run detection based on view mode. |
+ | // images: There are some expensive calls in image auto detection, so run detection based on view mode. |
-->{{#vardefine:ii:imagealt|{{{imagealt|}}}}}<!-- custom full image code. |
-->{{#vardefine:ii:imagealt|{{{imagealt|}}}}}<!-- custom full image code. |
||
-->{{#if:{{#var:ii:imagealt}}||<!-- |
-->{{#if:{{#var:ii:imagealt}}||<!-- |
||
-->{{#ifeq:{{#var:imagemode}}|full|<!-- full mode |
-->{{#ifeq:{{#var:imagemode}}|full|<!-- full mode |
||
− | //female image check first (used in equipped image) |
+ | // female image check first (used in equipped image) |
-->{{#vardefine:ii:imagefemale|<!-- |
-->{{#vardefine:ii:imagefemale|<!-- |
||
-->{{#if:{{{imagefemale|}}}|<!-- |
-->{{#if:{{{imagefemale|}}}|<!-- |
||
Ligne 574 : | Ligne 692 : | ||
-->}}}}<!-- |
-->}}}}<!-- |
||
-->{{#vardefine:_male_image_suffix|{{#if:{{#var:ii:imagefemale}}|y|}}}}<!-- |
-->{{#vardefine:_male_image_suffix|{{#if:{{#var:ii:imagefemale}}|y|}}}}<!-- |
||
− | //main image |
+ | // main image |
-->{{#vardefine:ii:image|<!-- |
-->{{#vardefine:ii:image|<!-- |
||
-->{{#vardefine:alttext|<!-- |
-->{{#vardefine:alttext|<!-- |
||
Ligne 600 : | Ligne 718 : | ||
-->}}<!-- |
-->}}<!-- |
||
-->|<!-- else simple mode |
-->|<!-- else simple mode |
||
− | //main image |
+ | // main image |
-->{{#vardefine:ii:image|<!-- |
-->{{#vardefine:ii:image|<!-- |
||
-->{{#if:{{{image|}}}|<!-- |
-->{{#if:{{{image|}}}|<!-- |
||
Ligne 615 : | Ligne 733 : | ||
-->}}<!-- |
-->}}<!-- |
||
-->}}<!-- |
-->}}<!-- |
||
− | //fallback if {{image}} failed (red link) |
+ | // fallback if {{image}} failed (red link) |
-->{{#if:{{#var:ii:image}}||<!-- |
-->{{#if:{{#var:ii:image}}||<!-- |
||
-->{{#vardefine:ii:image|[[File:{{#var:ii:name}}.png|{{l10n|item_infobox|imagealt:missing}}|link=]]}}<!-- |
-->{{#vardefine:ii:image|[[File:{{#var:ii:name}}.png|{{l10n|item_infobox|imagealt:missing}}|link=]]}}<!-- |
||
-->}}<!-- |
-->}}<!-- |
||
− | //old, placed, and equipped images: always fetch if using full mode, else only if respective mode is set |
+ | // old, placed, and equipped images: always fetch if using full mode, else only if respective mode is set |
− | //old image |
+ | // old image |
-->{{#if:{{#ifeq:{{#var:imagemode}}|full|y}}{{#pos:{{#var:imagemode}}|old}}|<!-- |
-->{{#if:{{#ifeq:{{#var:imagemode}}|full|y}}{{#pos:{{#var:imagemode}}|old}}|<!-- |
||
-->{{#vardefine:ii:imageold|{{{imageoldalt|<!-- |
-->{{#vardefine:ii:imageold|{{{imageoldalt|<!-- |
||
Ligne 630 : | Ligne 748 : | ||
-->}}}}}<!-- |
-->}}}}}<!-- |
||
-->}}<!-- |
-->}}<!-- |
||
− | //placed image |
+ | // placed image |
-->{{#if:{{#ifeq:{{#var:imagemode}}|full|y}}{{#pos:{{#var:imagemode}}|placed}}|<!-- |
-->{{#if:{{#ifeq:{{#var:imagemode}}|full|y}}{{#pos:{{#var:imagemode}}|placed}}|<!-- |
||
-->{{#vardefine:ii:imageplaced|{{{imageplacedalt|<!-- |
-->{{#vardefine:ii:imageplaced|{{{imageplacedalt|<!-- |
||
Ligne 640 : | Ligne 758 : | ||
-->}}}}}<!-- |
-->}}}}}<!-- |
||
-->}}<!-- |
-->}}<!-- |
||
− | //equipped image |
+ | // equipped image |
-->{{#if:{{#ifeq:{{#var:imagemode}}|full|y}}{{#pos:{{#var:imagemode}}|equipped}}|<!-- |
-->{{#if:{{#ifeq:{{#var:imagemode}}|full|y}}{{#pos:{{#var:imagemode}}|equipped}}|<!-- |
||
-->{{#vardefine:ii:imageequipped|{{{imageequippedalt|<!-- |
-->{{#vardefine:ii:imageequipped|{{{imageequippedalt|<!-- |
||
Ligne 651 : | Ligne 769 : | ||
-->}}<!-- |
-->}}<!-- |
||
-->}}<!-- |
-->}}<!-- |
||
+ | -------- |
||
+ | |||
− | ===== cate and cargo ====== |
||
+ | +++++++++++++ 5. Categorize and store to cargo +++++++++++++ |
||
+ | |||
+ | ---- determine validity of categorization ---- |
||
-->{{#vardefine:cate|}}<!-- |
-->{{#vardefine:cate|}}<!-- |
||
-->{{#switch:{{{cate|}}}<!-- |
-->{{#switch:{{{cate|}}}<!-- |
||
− | -->|yes|force={{#vardefine:cate|y}}<!-- |
+ | -->|1|y|yes|true|force={{#vardefine:cate|y}}<!-- |
− | -->|no={{#vardefine:cate|}}<!-- |
+ | -->|0|n|no|false={{#vardefine:cate|}}<!-- |
-->|#default={{#ifeq:{{NAMESPACE}}|{{ns:0}}|<!-- only in main ns |
-->|#default={{#ifeq:{{NAMESPACE}}|{{ns:0}}|<!-- only in main ns |
||
-->{{#switch:{{#var:viewname}}<!-- |
-->{{#switch:{{#var:viewname}}<!-- |
||
Ligne 663 : | Ligne 785 : | ||
-->}}<!-- |
-->}}<!-- |
||
-->}}<!-- |
-->}}<!-- |
||
+ | -------- |
||
+ | |||
+ | ---- categorize ---- |
||
-->{{#vardefine:ii:types|{{#lstuniq:{{#var:ii:types}}|/|/}}}}<!-- |
-->{{#vardefine:ii:types|{{#lstuniq:{{#var:ii:types}}|/|/}}}}<!-- |
||
-->{{#if:{{#var:cate}}|<!-- |
-->{{#if:{{#var:cate}}|<!-- |
||
+ | -->{{#lstmap:{{#var:ii:types}}|/|@@@@|<esc>[[Category:{{#or:{{l10n|item_infobox|typecate:@@@@}}|{{tr|{{ucfirst:@@@@}} items|link=y}}}}]]</esc>|}}<!-- |
||
− | == cates == |
||
+ | -->{{#lstmap:{{#var:ii:listcats}}|/|@@@@|<esc>[[Category:{{#or:{{l10n|item_infobox|listcat:@@@@}}|{{tr|{{ucfirst:@@@@}}|link=y}}}}]]</esc>|}}<!-- |
||
− | -->{{#ifeq:{{{cate|}}}|no|<!-- nothing -->|{{#ifeq:{{{listexclude|no}}}|yes|<!-- nothing -->|<!-- only if $cate != no |
||
+ | -->{{#if:{{#var:ii:isArmorSet}}|<!-- |
||
− | //cate |
||
− | -->{{# |
+ | -->{{#if:{{#lstind:vanity|{{#var:ii:types}}|/}}|[[Category:{{l10n|item_infobox|cate:vanitysets}}]]}}<!-- |
+ | -->{{#if:{{#lstind:armor|{{#var:ii:types}}|/}}|<!-- |
||
− | -->{{#lstmap:{{#var:ii:listcats}}|/|@@@@|<esc>[[Category:{{#or:{{l10n|item_infobox|listcat:@@@@}}|{{tr|{{ucfirst:@@@@}}|link=y}}}}]]</esc>|}}<!-- |
||
− | --> |
+ | -->[[Category:{{l10n|item_infobox|cate:armorsets}}]]<!-- |
− | -->{{#if: |
+ | -->{{#if:{{#var:ii:setbonus}}||[[Category:{{l10n|item_infobox|cate:nosetbonus}}]]}}<!-- |
− | -->{{#if:{{#lstind:armor|{{#var:ii:types}}|/}}|<!-- |
||
− | -->[[Category:{{l10n|item_infobox|cate:armorsets}}]]<!-- |
||
− | -->{{#if:{{#var:ii:setbonus}}||[[Category:{{l10n|item_infobox|cate:nosetbonus}}]]}}<!-- |
||
− | -->}}<!-- |
||
-->}}<!-- |
-->}}<!-- |
||
+ | -->}}<!-- |
||
− | -->{{#if:{{#var:ii:consumable}}|[[Category:{{l10n|item_infobox|cate:consumableitem}}]]}}<!-- |
||
− | + | -->{{#if:{{#var:ii:consumable}}|[[Category:{{l10n|item_infobox|cate:consumableitem}}]]}}<!-- |
|
− | + | -->{{#if:{{#var:ii:buy}}|[[Category:{{l10n|item_infobox|cate:vendoritem}}]]}}<!-- |
|
− | + | -->{{#if:{{#var:ii:hardmodeonly}}|[[Category:{{l10n|item_infobox|cate:hardmodeonlyitem}}]]}}<!-- |
|
− | + | -->{{#if:{{#var:ii:autoswing}}|<!-- |
|
− | + | -->{{#if:{{#lstind:furniture|{{#var:ii:types}}|/}}||<!-- don't categorize placeable weapons as autoswing |
|
+ | -->{{#if:{{#lstfltr:weapon/tool|/|{{#var:ii:types}}|/}}|[[Category:{{l10n|item_infobox|cate:autoswingitem}}]]}}<!-- |
||
− | -->}}<!-- |
||
− | -->}}<!-- |
+ | -->}}<!-- |
+ | -->}}<!-- |
||
− | -->{{#if:{{#var:ii:allversions}}|{{all versions}}}}<!-- |
||
− | -->}}}}<!-- |
+ | -->{{#if:{{#var:ii:allversions}}|{{all versions}}}}<!-- |
-->}}<!-- |
-->}}<!-- |
||
+ | -------- |
||
+ | ---- determine validity of cargo storage ---- |
||
-->{{#vardefine:cargo|}}<!-- |
-->{{#vardefine:cargo|}}<!-- |
||
− | -->{{#ifeq:{{NAMESPACE}}|{{ns:0}}|{{#ifeq:{{PAGENAME}}|{{ROOTPAGENAME}}|{{#vardefine:cargo|y}}}}}}<!-- default: only main ns, only root pages ( |
+ | -->{{#ifeq:{{NAMESPACE}}|{{ns:0}}|{{#ifeq:{{PAGENAME}}|{{ROOTPAGENAME}}|{{#vardefine:cargo|y}}}}}}<!-- default: only main ns, only root pages (e.g. no translation subpages) |
+ | -->{{#if:{{{cargo|}}}|<!-- |
||
− | -->{{#if:{{{cargo|}}}|{{#ifeq:{{{cargo|}}}|force|{{#vardefine:cargo|y}}|{{#vardefine:cargo|}}}}}}<!-- "|cargo=force" forces cargo storage, "|cargo=<anything else>" prohibits cargo storage |
||
+ | -->{{#switch:{{{cargo|}}}<!-- |
||
− | -->{{#if:{{langList|isOnWiki|{{lang}}}}|{{#vardefine:cargo|}}}}<!-- don't store for non-english languages on mainwiki |
||
+ | -->|1|y|yes|true|force|on={{#vardefine:cargo|y}}<!-- on |
||
+ | -->|0|n|no|false|off={{#vardefine:cargo|}}<!-- off |
||
+ | -->|#default=<!-- keep it unchanged. |
||
+ | -->}}<!-- |
||
+ | -->}}<!-- |
||
+ | -->{{#if:{{langList|isOnWiki|{{lang}}}}|{{#vardefine:cargo|}}}}<!-- never store for non-english languages on mainwiki |
||
+ | -------- |
||
+ | |||
+ | ---- store to cargo ---- |
||
-->{{#if:{{#var:cargo}}|<!-- |
-->{{#if:{{#var:cargo}}|<!-- |
||
+ | -->{{#cargo_store:_table=Items<!-- |
||
− | == cargo store == |
||
− | //new table: |
||
− | -->{{#cargo_store:_table=Items <!-- |
||
-->|itemid={{#var:ii:id}}<!-- |
-->|itemid={{#var:ii:id}}<!-- |
||
-->|name={{#var:ii:name}}<!-- |
-->|name={{#var:ii:name}}<!-- |
||
Ligne 715 : | Ligne 845 : | ||
-->|velocity={{#var:ii:velocity}}<!-- |
-->|velocity={{#var:ii:velocity}}<!-- |
||
-->|knockback={{#var:ii:knockback}}<!-- |
-->|knockback={{#var:ii:knockback}}<!-- |
||
− | -->|rare={{#var:ii: |
+ | -->|rare={{#var:ii:rawrare}}<!-- |
-->|sell={{#var:ii:sell}}<!-- |
-->|sell={{#var:ii:sell}}<!-- |
||
-->|axe={{#var:ii:axe}}<!-- |
-->|axe={{#var:ii:axe}}<!-- |
||
Ligne 737 : | Ligne 867 : | ||
-->|bodyslot={{#var:ii:bodyslot}}<!-- |
-->|bodyslot={{#var:ii:bodyslot}}<!-- |
||
-->|toolspeed={{#var:ii:toolspeed}}<!-- |
-->|toolspeed={{#var:ii:toolspeed}}<!-- |
||
− | -->| |
+ | -->|buffs={{#lstmap:{{#var:ii:buffs}}|₪|@|{\{#var:ii:buff@:name}\}|^}}<!-- |
− | -->| |
+ | -->|debuffs={{#lstmap:{{#var:ii:debuffs}}|₪|@|{\{#var:ii:debuff@:name}\}|^}}<!-- |
-->}}<!-- |
-->}}<!-- |
||
− | //CARGO END |
||
-->}}<!-- |
-->}}<!-- |
||
− | end===== cate and cargo ====== |
||
+ | |||
− | ===== OUTPUT VIEW ====== |
||
+ | |||
− | select view base on viewname. e.g. mode=table means {{item infobox/tableView}}, default is {{item infobox/infoboxView}} |
||
+ | ========================================================================================================================== |
||
+ | ============================================= DATA VIEW ============================================== |
||
+ | ========================================================================================================================== |
||
+ | |||
+ | |||
+ | // select view based on viewname, e.g. "|mode=table" means {{item infobox/tableView}}, default is {{item infobox/infoboxView}} |
||
-->{{item infobox/{{#var:viewname}}View}}<!-- |
-->{{item infobox/{{#var:viewname}}View}}<!-- |
||
Ligne 754 : | Ligne 888 : | ||
-->{{#cargo_declare:_table=Items |
-->{{#cargo_declare:_table=Items |
||
| itemid = Integer |
| itemid = Integer |
||
+ | | name = String |
||
− | |||
+ | | internalname = String |
||
+ | | image = Wikitext |
||
+ | | imagefile = String |
||
+ | | autoswing = Boolean |
||
+ | | stack = Wikitext (size=500) |
||
+ | | consumable = Boolean |
||
+ | | hardmode = Boolean |
||
+ | | type = List (^) of String |
||
+ | | listcat = List (^) of String |
||
+ | | tag = List (^) of String |
||
+ | | damage = Wikitext |
||
+ | | damagetype = String |
||
+ | | defense = Wikitext (size=1000) |
||
+ | | velocity = Wikitext |
||
+ | | knockback = Wikitext |
||
+ | | rare = Wikitext |
||
+ | | buy = Wikitext |
||
+ | | sell = Wikitext |
||
+ | | axe = Wikitext (size=1000) |
||
+ | | pick = Wikitext (size=1000) |
||
+ | | hammer = Wikitext (size=1000) |
||
+ | | fishing = Integer |
||
+ | | bait = Integer |
||
+ | | bonus = Wikitext |
||
+ | | toolspeed = Wikitext |
||
+ | | usetime = Wikitext |
||
+ | | unobtainable = Boolean |
||
+ | | autoswing = Boolean |
||
+ | | critical = Wikitext (size=1000) |
||
+ | | tooltip = Wikitext |
||
+ | | placeable = Boolean |
||
+ | | placedwidth = Integer |
||
+ | | placedheight = Integer |
||
+ | | mana = Wikitext |
||
+ | | hheal = Wikitext |
||
+ | | mheal = Wikitext |
||
+ | | bodyslot = String |
||
+ | | buffs = List (^) of String |
||
+ | | debuffs = List (^) of String |
||
}}<!-- |
}}<!-- |
||
Version du 27 octobre 2020 à 07:55
Ce modèle définit la table « Items ». Afficher la table.
This template is used for displaying the infobox for an item. It is one of the most important and most powerful infobox templates.
Usage
While the template is extremely versatile, its main functionality is to display the standard infobox.
The data which is to be displayed can be manually entered when calling the template, but thanks to {{iteminfo}}, the vast majority of data is generated automatically. To enable automatic data, use the parameter
and set it to the ID of the item (alternatively: auto
auto=yes
and either id=<item ID>
, name=<item name>
, or nothing else – the latter two methods will cause the template to automatically generate the ID using {{itemNameFromId}}, with the last method using the page title for name reference). This way, all relevant item parameters are set automatically. See the table below for affected parameters. However, they can still be overridden and manually entered parameters always take precedence over the automatic ones.
Basic parameters
- Notes:
- The dollar sign (
) is used to signify that the word after it is the name of a template parameter.$
- All parameters which have a default value listed can usually be omitted. Note that this does not mean that parameters which do not have a default value listed should always be filled in.
Parameter | Description | Auto | Example | Default value (if omitted) |
Note |
---|---|---|---|---|---|
{{item infobox
| |||||
Box-related parameters | |||||
| boxwidth |
Width of the infobox | 27em |
21em |
Number with unit. Default is or stretching to image width
| |
| float |
Position of the infobox | left |
right |
||
| css or | style |
CSS style affecting the entire infobox | Any or properties defined here will override the template's and parameters, respectively.
| |||
| auto |
Enables automatic data | 465 |
Can also be (see text above).
| ||
| id |
ID of the item | ✔️ | 465 |
The automatic data gathering for is based on this.
| |
| name |
Name of the item | ✔️ | Wood |
Page name |
Will be displayed as heading of the infobox. |
| lname |
Localized name of the item | ✔️ | Legno (Italian for "Wood") |
{{tr|$name}} |
Will be displayed as heading of the infobox; only to be used if is not existent in the {{tr}} database of the specific language.
|
| showenglishname |
Display of English name of this item | yes no |
Defaults to for languages that have an in-game translation ( , (allemand), (espagnol), (français), (italien), (polonais), (portugais), (russe), (chinois)), and to for all other languages.
| ||
| namesub |
Name sub-heading | Additional information directly underneath the title of the infobox; rarely useful for item infoboxes. | |||
Image-related parameters | |||||
| imagealt |
Complete custom control over the entire image display | [[File:Wood.png]] |
Overrides all image parameters in this parameter category (except for ).
If intending to manually reproduce the gray border that the infobox places automatically between | ||
| ext |
File extension of
|
gif |
png |
||
| image |
Main image of the inventory icon or equipped item/set | Wood.png |
$name.$ext |
||
| imageold |
Variant image of the older versions | Compass (old).png |
$name (old) |
Default value: First checks for the and then for the . Due to the way the automatic image detection is handled internally, it will likely fail on items whose name contains a dot (e.g. S.D.M.G.). It is necessary to explicitly specify the image in that case. (This applies to all image-related parameters.)
| |
| imageplaced |
Image of the placed item | Wood (placed).png |
$name (placed)
| ||
| imageequipped |
Image of the equipped item/set | Shackle (equipped).png |
$name (equipped)
| ||
| imagefemale |
Image of the female equipped item/set | Robe (equipped) female.png |
$name female.$ext |
||
| imageoldalt |
Complete custom control over the "old" image display | [[File:Compass (old).png]] |
|||
| imageplacedalt |
Complete custom control over the "placed" image display | [[File:Wood (placed).png]] |
|||
| imageequippedalt |
Complete custom control over the "equipped" image display | [[File:Shackle (equipped).png]] |
|||
| imagebreak |
Arranges multiple images in rows rather than in columns | yes |
Causes the main/"old", "placed", "equipped", and "female" images to all take up a separate row, with small horizontal bars in between (example: Book). Note that the main and "old" images will always be displayed in the same row. Also note that this effect is enabled regardless of what is set to (i.e, setting it to will also enable it – so refrain from doing that).
| ||
| imagemode |
Controls image selection | placed/equipped |
full |
If set to (which will only be the default for the ), the template will attempt to display all different types of images mentioned above. If not set to , it will only attempt to display the main image (which will be the case for other s by default, e.g. ), for performance reasons. It is possible, however, to enable (attempted) display of certain image types even if the mode is not : Set the parameter to , , , or any combination of these three to cause the template to fetch these images as well.
| |
| imageinfo |
Prevents the internal usage of {{image}} |
no |
Setting it to will cause the template to use the standard syntax instead of {{image}} . {{image}} will increase the expensive function count, so if there are many item infoboxes on one page, the expensive function count limit may be exceeded. Using imageinfo=no can reduce the count to avoid exceeding it. In the vast majority of cases, this is not necessary.
| ||
Statistics-related parameters | |||||
| autoswing |
Auto-use capability | ✔️ | yes |
Displays in the top-right corner of the infobox. Hover text is determined by ("Autoswing" for melee, "Autofire" for ranged and magic, and "Auto-use" for anything else).
| |
| stack |
Maximum possible stack size | ✔️[1] | 99 |
1 |
Maximum quantity of this item that can be stacked in a single inventory slot. |
| pick |
Pickaxe power | ✔️[1] | 100 |
Without percentage sign ( ), unless more complex wikitext is used. If any of the three parameters is used, all three symbols will always be displayed:
| |
| hammer |
Hammer power | ✔️[1] | 75 |
||
| axe |
Axe power | ✔️[1] | 50 |
||
| pickreq |
Required pickaxe power for destroying | ❌ | 150 |
Without percentage sign ( )!
| |
| hammerreq |
Required hammer power for destroying | ❌ | 80 |
Without percentage sign ( )! Prints the following behind it: "(seulement en Hardmode)"
| |
| type (deprecated: | type2 ) |
Classification and categorization | ✔️ | Weapon/Tool |
Broad classifications like "Weapon", "Tool", "Furniture", etc. Separate multiple values with a slash ( ). Many types, such as "Crafting material", will be added automatically.
| |
| fishing |
Fishing power | ✔️[1] | Without percentage sign ( )!
| ||
| bait |
Bait power | ✔️ | Without percentage sign ( )!
| ||
| damage |
Damage | ✔️[1] | |||
| damagetype |
Damage type | ✔️[1] | Possible values: , , , , and . The infobox will automatically categorize the page in the appropriate weapon type category, but only for the automatically generated damage type. For any additional, manually added damage type, a |listcat=<damage type> weapons will be necessary.
| ||
| knockback |
Knockback | ✔️[1] | @@@@ / {{kb|5}} |
If more than one value is needed, wrap the individual values with {{kb}} in order to ensure correct styling. The string does not need {{}}.
| |
| defense |
Defense | ✔️[1] | |||
| tileboost |
Tile range boost | ✔️ | |||
| bonus |
Miscellaneous bonuses | ❌ | |||
| setbonus |
Set bonus | ✔️[1] | For armor sets, where contains . Note that because this parameter is only sensible for set item infoboxes – which don't use since it doesn't work with sets – its data will always be generated automatically (instead of only when is set). Set this parameter to an empty value to hide the automatically generated set bonus.
| ||
| placeable |
Placeable | ✔️ | yes |
no |
|
| width |
Width when placed | ❌ | In tiles. Defaults to for blocks.
| ||
| height |
Height when placed | ❌ | |||
| consumable |
Consumable | ✔️ | True if the item leaves the player's inventory with ⚒ Utiliser / Attaquer; includes placeable items. It is found in the game's source code. | ||
| mana |
Mana cost | ✔️[1] | |||
| mheal |
Mana restoration | ✔️[1] | |||
| hheal |
Health restoration | ✔️[1] | |||
| critical |
Critical strike chance | ✔️[1] | 11 |
Without percentage sign ( ), unless more complex wikitext is used. If no value is entered and the main is , a default value of will be used.
| |
| body slot |
Body slot | ✔️ | |||
| use |
Use time | ✔️[1] | @@@@ / {{ut|30}} |
If more than one value is needed, wrap the individual values with {{ut}} in order to ensure correct styling. The string does not need {{}}.
| |
| velocity (deprecated: | sspeed ) |
Velocity | ✔️[1] | |||
| toolspeed |
Tool speed | ✔️[1] | |||
| tooltip |
Tooltip | ✔️[1] | |||
| rare |
Rarity | ✔️[1] | @@@@ / {{rare|0}} |
Use the {{rare}} template. | |
| research |
Research required | ✔️ | 5 |
||
| buy |
Buy value | ✔️[1] | Enter the value using the coin template ({{coin}}). If using , use buy=y/yes/true/show to enable display of automatic buy price (disabled by default, since many items that can be sold cannot be bought). Alternatively, add , , or to .
| ||
| sell |
Sell value | ✔️[1] | Also enter the value using the coin template. | ||
| value |
Value | ✔️ | Mostly used internally. Will not be displayed directly, but serves as the base for and . It can be used to suppress buy and sell value display entirely by setting it to a blank value (|value= ).
| ||
Buff- & debuff-related parameters | |||||
| buff |
Buff provided | ✔️ | Name of the buff. As a shortcut for and , they can be appended to this value, separated with a slash: | buff = <name> / <duration> / <chance> . Chance may also be omitted.
| ||
| idbuff |
Buff ID | ✔️ | |||
| bufflink |
Buff link target | ✔️ | |||
| bufftip |
Buff tooltip | ✔️ | |||
| buffchance |
Buff chance | ✔️ | |||
| buffduration |
Buff duration | ✔️[1] | Enter the value using the {{duration}} template. | ||
| buff<n> |
Additional buff provided | ❌ | Can be continued nearly infinitely, e.g. buff2 , buff3 , etc.
| ||
| idbuff<n> |
Buff ID | ❌ | |||
| bufflink<n> |
Buff link target | ❌ | |||
| bufftip<n> |
Buff tooltip | ❌ | |||
| buffchance<n> |
Buff chance | ❌ | |||
| buffduration<n> |
Buff duration | ❌ | |||
| debuff |
Debuff inflicted | ✔️ | Name of the debuff. As a shortcut for and , they can be appended to this value, separated with a slash: | debuff = <name> / <duration> / <chance> . Chance may also be omitted.
| ||
| iddebuff |
Debuff ID | ✔️ | |||
| debufflink |
Debuff link target | ✔️ | |||
| debufftip |
Debuff tooltip | ✔️ | |||
| debuffchance |
Debuff chance | ✔️ | |||
| debuffduration |
Debuff duration | ✔️[1] | Enter the value using the {{duration}} template. | ||
| debuff<n> |
Additional debuff provided | ❌ | Can be continued nearly infinitely, e.g. debuff2 , debuff3 , etc.
| ||
| iddebuff<n> |
Debuff ID | ❌ | |||
| debufflink<n> |
Debuff link target | ❌ | |||
| debufftip<n> |
Debuff tooltip | ❌ | |||
| debuffchance<n> |
Debuff chance | ❌ | |||
| debuffduration<n> |
Debuff duration | ❌ | |||
Sound-related parameters | |||||
| sounduse |
Use sound effect | ✔️ | Item_1.wav |
Can be a comma-separated list for multiple sounds. Caption is "Utilisation". | |
| sound1 |
Custom additional sound effect | Can be a comma-separated list for multiple sounds. | |||
| soundcaption1 |
Caption for the sound effect | ||||
| sound2 |
Custom additional sound effect | Can be a comma-separated list for multiple sounds. | |||
| soundcaption2 |
Caption for the sound effect | ||||
| sound<n> |
Custom additional sound effect | Can be continued nearly infinitely. Sounds will only be displayed if there is a sound<n> parameter with a corresponding soundcaption<n> parameter.
| |||
| soundcaption<n> |
Caption for the sound effect | ||||
Mount-related parameter | |||||
| idmount |
Mount ID | ✔️ | |||
Projectile-related parameters | |||||
| idprojectile (deprecated: | shoot ) |
Projectile ID | ✔️ | Can be a comma-separated list for multiple IDs. | ||
| projectilename |
Projectile name | ✔️ | |||
| projectileimage |
Projectile image | ✔️ | |||
| projectileblock |
Projectile images arrangement | ❌ | Operates similarly to .
| ||
ID-related parameters | |||||
| showids |
Display of ID section | ❌ | no |
ID section is not hidden by default. | |
| idshow |
Vanity item ID | ❌ | |||
| idtile |
Tile ID | ✔️ | |||
| idtileshow |
Vanity tile ID | ❌ | |||
| idtilesub |
Tile sub-ID | ✔️ | Internally known as in Terraria.
| ||
| idwall |
Wall ID | ✔️ | |||
| idarmor |
Armor ID | ✔️ | |||
| idbuffshow |
Vanity buff ID | ❌ | 170–172 |
The values of these parameters require to be escaped, i.e., wikitext like templates or parser functions will need to be wrapped with <esc> and </esc> .
| |
| idbuffshow<n> |
Vanity buff ID | ❌ | 1007 <esc>{{3DS}}</esc> |
||
| iddebuffshow |
Vanity debuff ID | ❌ | |||
| iddebuffshow<n> |
Vanity debuff ID | ❌ | |||
Back-end-related parameters | |||||
| cate |
Toggles categorization | ❌ | no |
Set to to force categorization when it is disabled by default (on non-mainspace pages). Set to to disable categorization.
| |
| listexclude |
Toggles categorization | ❌ | yes |
no |
Set to to disable categorization. Overrides cate=yes , but not cate=no .
|
| cargo |
Toggles cargo data storage | ❌ | no |
Set to to force cargo data storage when it is disabled by default (on non-mainspace pages). Set to to disable cargo data storage. Note that setting it to anything else (e.g. ) also disables cargo data storage, so please stick to the unambiguous .
| |
| listcat |
Categorization | ✔️ | Supplemental category names to include the current item in a DPL list, e.g. causes the item to display at the Arrows page. Separate multiple categories with a slash character ( ). The following categories will be added automatically:
| ||
| tag or | tags |
Categorization | ✔️ | Supplemental category names to appropriately categorize the item. Can contain any of the following (separate multiple with a slash character ( ):
All other values will have no effect. All tags will be stored to cargo for querying. | ||
| allversions |
Platform version availability | ✔️ | Set to to assert that the item is available on all platforms of Terraria. This is only to be used if no {{exclusive}} banner is on the page. If omitted and if does not contain , it will be detected automatically based on the result of {{eversions|<item name>}} (even though might not be set!). Categorizes the page in all five version content categories (with the exception of Japanese console content), if is determined.
| ||
| hardmode |
Hardmode-exclusivity | ✔️ | yes |
Set to to assert that the item is not available in pre-Hardmode, but only becomes available in Hardmode. Categorizes the page in Category:Objets obtenables uniquement en Hardmode.
|
By default, an item infobox is displayed in the standard infobox style, a boxed, table-like listing of stats on the right of the article text. It is possible to change the display format (called "view"), however – there are four other views available:
, custom
, item
, and table
(additionally void
). They can be selected via the test
(aliases: $view
, $mode
) parameter. Each view has an own subpage which contains the code for the respective output.
$output
View | Description | Subpage |
---|---|---|
|
Completely custom output. | /customView |
(default) |
Standard infobox-style output. | /infoboxView |
|
Displays the item as formatted by {{item}} .
|
/itemView |
|
Displays an entire table row (including the row separator, |- ).
|
/tableView |
|
Does not display anything. This is useful when it is necessary to store item information to the Cargo database, but an own infobox for the item is unwanted (e.g. on group pages, where there is a main infobox for all items of the group). | /voidView |
Some views enable additional, view-exclusive parameters:
Parameter | Description | Example | Default value (if omitted) |
Note |
---|---|---|---|---|
{{item infobox
| ||||
Custom viewCustom view | ||||
| template |
Name of the formatting template | This parameter is required when using the custom view. It is to be set to the name of the template that contains the custom code for the output. (For instance, |view=custom|template=item infobox/infoboxView could also be used for a standard infobox style, because {{item infobox/infoboxView}} contains the code for the output.)
| ||
| extargs |
Additional custom parameters | Enable additional, custom parameters for the {{}} call that are handled by the formatting template. Separate multiple parameter names with a slash character ( ). This parameter should only be used if the parameters specified in it are used in the {{}} call.
| ||
Item viewItem view | ||||
(all {{item}} parameters) |
The following additional {{item}} parameters will be processed as if the template itself was called:
See | |||
Table viewTable view | ||||
| cols |
Columns to display | item2cells/sell |
This parameter defines which columns/cells are to be displayed in the resulting table row. The content and formatting of those cells is handled by the respective subpage of Template:Item infobox/tableView, by default. The following values are predefined:
However, it is also possible to include another page name, e.g. Moss/Placed on bricks (via In addition, it is possible to include columns for which the content is set in the same | |
| colsep |
Separator for
|
\ |
/ |
Specify the character that separates the column names in . This is useful when using column names that include slashes, since the default separator is a slash and would thus treat that column name as two different columns.
|
| extargs |
Additional custom parameters | Enable additional, custom parameters for the {{}} call that are handled by the column formatting page. Separate multiple parameter names with a slash character ( ). For instance, the item2cells column formatting page is able to process three exclusive parameters, , , and . These parameters can be specified in the {{}} call to influence the formatting carried out by , but they will have no effect unless explicitly specified via |extargs=anchor/nolink/rowspan . This parameter should only be used if the parameters specified in it are used in the {{}} call.
|
Options
This template supports options through {{options}} template. All valid options are listed below, see {{options}} for usage and other infomation.
See Template:item infobox/initOptions for the initial options setting of this template.
Name | Alias | Initial Value | Value Mapping[1] | Note |
---|---|---|---|---|
view | output mode | infobox | ||
cols | (empty) | |||
colsep | (empty) | |||
extargs | (empty) | |||
imagemode | (empty) | |||
imageinfo | (empty) | y → (empty) yes → (empty) on → (empty) no → n off → n | ||
autoimageold | (empty) | y → (empty) yes → (empty) on → (empty) no → n off → n | ||
autoimageplaced | (empty) | y → (empty) yes → (empty) on → (empty) no → n off → n | ||
autoimageequipped | (empty) | y → (empty) yes → (empty) on → (empty) no → n off → n | ||
extold | (empty) | |||
extplaced | (empty) | |||
extequipped | (empty) | |||
item2cell:anchor | (empty) | yes → y on → y n → (empty) no → (empty) off → (empty) | ||
item2cell:nolink | (empty) | yes → y on → y n → (empty) no → (empty) off → (empty) |
- ↑ Values with mapping will be stored and loaded as mapped value. Other values without mapping will be stored and loaded as-is.
Subpages
There are numerous supplemental subpages which are mainly used for formatting certain data:
- Modèle:Item infobox/customView
- Modèle:Item infobox/damagetype
- Modèle:Item infobox/infoboxView
- Modèle:Item infobox/initOptions
- Modèle:Item infobox/itemView
- Modèle:Item infobox/l10n
- Modèle:Item infobox/options
- Modèle:Item infobox/rangebonus
- Modèle:Item infobox/tableView
- Modèle:Item infobox/tableView/baitpower
- Modèle:Item infobox/tableView/buff
- Modèle:Item infobox/tableView/buffduration
- Modèle:Item infobox/tableView/bufftip
- Modèle:Item infobox/tableView/buy
- Modèle:Item infobox/tableView/damage
- Modèle:Item infobox/tableView/dimensions
- Modèle:Item infobox/tableView/fishing
- Modèle:Item infobox/tableView/idtile
- Modèle:Item infobox/tableView/idtile-sortbysubid
- Modèle:Item infobox/tableView/idwall
- Modèle:Item infobox/tableView/imagebuff
- Modèle:Item infobox/tableView/imageequipped
- Modèle:Item infobox/tableView/imageplaced
- Modèle:Item infobox/tableView/item
- Modèle:Item infobox/tableView/item2cells
- Modèle:Item infobox/tableView/item2cells-anchor
- Modèle:Item infobox/tableView/item2cells-anchor-nolink
- Modèle:Item infobox/tableView/item2cells-nolink
- Modèle:Item infobox/tableView/makenpcid
- Modèle:Item infobox/tableView/mount
- Modèle:Item infobox/tableView/projectile
- Modèle:Item infobox/tableView/projectile2cells
- Modèle:Item infobox/tableView/rarity
- Modèle:Item infobox/tableView/sacrifices
- Modèle:Item infobox/tableView/sell
- Modèle:Item infobox/tableView/sell-alignright
- Modèle:Item infobox/tableView/size-compact
- Modèle:Item infobox/tableView/source
- Modèle:Item infobox/tableView/tooltip
- Modèle:Item infobox/tableView/usetime
- Modèle:Item infobox/tableView/velocity
- Modèle:Item infobox/voidView
See also
- {{npc infobox}}