K (Moved some {{tr}}s. $namesub and $namenote are in German throughout the entire process.) |
Ryebot (Diskussion | Beiträge) (sync :: en revid:1175034::) |
||
Zeile 1: | Zeile 1: | ||
<includeonly><!-- |
<includeonly><!-- |
||
+ | Note: The "tabs" functionality of this template requires JavaScript in MediaWiki:Common.js and/or MediaWiki:Mobile.js |
||
− | NOTE: This template needs javascript in mediawiki:common.js and/or mediawiki:mobile.js |
||
+ | ========================================================================================================================== |
||
+ | =========================================== INITIALIZATION =========================================== |
||
+ | ========================================================================================================================== |
||
− | //localization info in [[template:npc_infobox/l10n]].(autoload) |
||
+ | +++++++++++++ 1. Localization +++++++++++++ |
||
− | //ext l10n info: how to get english npc name from {{BASEPAGENAME}}? |
||
− | -->{{#vardefine:npcnamefrompagename|{{pagename2en|{{#titleparts:{{ROOTPAGENAME}}}}}}}}<!-- |
||
+ | // localization info is autoloaded from Template:Npc infobox/l10n |
||
− | //don't forget template:npc_infobox/cate |
||
+ | // additional l10n: how to get the English NPC name from {{BASEPAGENAME}}? |
||
− | === l10n end ========================================================================================================== |
||
+ | -->{{#vardefine:npcnamefrompagename|{{pagename2en|{{#titleparts:{{ROOTPAGENAME}}}}}}}}<!-- |
||
− | // cargo: (defining this up here because we already need it in the drop section) |
||
− | -->{{#vardefine:cargo|}}<!-- |
||
− | -->{{#ifeq:{{NAMESPACE}}|{{ns:0}}|{{#ifeq:{{PAGENAME}}|{{ROOTPAGENAME}}|{{#vardefine:cargo|y}}}}}}<!-- mainspace rootpages |
||
− | -->{{#switch:{{{cargo|}}}<!-- |
||
− | -->|force|yes|y={{#vardefine:cargo|y}}<!-- |
||
− | -->|no|n={{#vardefine:cargo|}}<!-- |
||
− | -->}}<!-- |
||
− | -->{{#if:{{langList|isOnWiki|{{lang}}}}|{{#vardefine:cargo|}}}}<!-- don't store for non-english languages on mainwiki |
||
+ | +++++++++++++ 2. View-related options +++++++++++++ |
||
− | //view name: |
||
+ | |||
− | -->{{#vardefine:ni:viewmodename|{{lc:{{{mode|{{{output|{{{view|{{#var:_npc_infobox_flag_view|infobox}}}}}}}}}}}}}}}<!-- |
||
+ | -->{{#vardefine:ni:viewmodename|{{lc:{{{mode|{{{output|{{{view|{{options/get|npc infobox|view}}}}}}}}}}}}}}}<!-- |
||
-->{{#switch:{{#var:ni:viewmodename}}<!-- |
-->{{#switch:{{#var:ni:viewmodename}}<!-- |
||
− | -->|infobox=<!-- |
+ | -->|infobox=<!-- |
− | -->{{#arraydefine:extargs|float/css/style/boxwidth/shownpcid/{{{extargs|{{npc infobox |
+ | -->{{#arraydefine:extargs|float/css/style/boxwidth/shownpcid/{{{extargs|{{options/get|npc infobox|extargs}}}}}|/}}<!-- |
− | -->{{#arrayprint:extargs||@@@@|{{#if:@@@@|{{#vardefine:ni:ext:@@@@|{{{@@@@|}}}}}}}}}<!-- ext parameters for view |
||
− | -->{{#vardefine:imagemode|{{{imagemode|full}}}}}<!-- |
||
-->|table=<!-- |
-->|table=<!-- |
||
− | -->{{#arraydefine:extargs|cols/{{{extargs|{{npc infobox |
+ | -->{{#arraydefine:extargs|cols/{{{extargs|{{options/get|npc infobox|extargs}}}}}|/}}<!-- |
+ | -->{{#arraydefine:ni:table:cols|{{{cols|{{options/get|npc infobox|cols}}}}}|{{{colsep|{{#or:{{options/get|npc infobox|colsep}}|/}}}}}}}<!-- default cols value from options |
||
− | -->{{#arrayprint:extargs||@@@@|{{#if:@@@@|{{#vardefine:ni:ext:@@@@|{{{@@@@|}}}}}}}}}<!-- ext parameters for view |
||
+ | // and pass all custom col values |
||
− | -->{{#vardefine:colsep|{{npc infobox/options|get|colsep}}}}<!-- |
||
− | -->{{#vardefine:cells|{{{cells|{{npc infobox/options|get|cells}}}}}}}<!-- |
||
− | -->{{#arraydefine:ni:table:cols|{{#var:ni:ext:cols|{{#var:_npc_infobox_flag_cols}}}}|{{{colsep|{{#var:colsep|/}}}}}}}<!-- default cols value from options |
||
− | // and pass all custom col values. |
||
-->{{#arrayprint:ni:table:cols||@@@@|{{#if:{{#rmatch:@@@@|/^col:/|y}}|{{#vardefine:ni:@@@@|{{{@@@@|}}} }}}}}}<!-- |
-->{{#arrayprint:ni:table:cols||@@@@|{{#if:{{#rmatch:@@@@|/^col:/|y}}|{{#vardefine:ni:@@@@|{{{@@@@|}}} }}}}}}<!-- |
||
+ | -->|custom=<!-- |
||
− | -->{{#vardefine:imagemode|{{{imagemode|{{npc infobox/options|get|imagemode}}}}}}}<!-- |
||
+ | -->{{#arraydefine:extargs|template/{{{extargs|{{options/get|npc infobox|extargs}}}}}|/}}<!-- |
||
-->|#default=<!-- |
-->|#default=<!-- |
||
− | -->{{#arraydefine:extargs|{{{extargs|{{npc infobox |
+ | -->{{#arraydefine:extargs|{{{extargs|{{options/get|npc infobox|extargs}}}}}|/}}<!-- |
− | -->{{#arrayprint:extargs||@@@@|{{#if:@@@@|{{#vardefine:ni:ext:@@@@|{{{@@@@|}}}}}}}}}<!-- |
||
− | -->{{#vardefine:imagemode|{{{imagemode|{{npc infobox/options|get|imagemode}}}}}}}<!-- |
||
-->}}<!-- |
-->}}<!-- |
||
+ | -->{{#arrayprint:extargs||@@@@|{{#if:@@@@|{{#vardefine:ni:ext:@@@@|{{{@@@@|}}}}}}}}}<!-- ext parameters for view |
||
+ | -->{{#vardefine:imagemode|{{{imagemode|{{#ifeq:{{#var:ni:viewmodename}}|infobox|full|{{options/get|npc infobox|imagemode}}}}}}}}}<!-- image mode |
||
− | ======== DATA MODEL ======== |
||
− | //reset all npcinfo fields |
||
− | -->{{#invoke:npcinfo|clear|prefix=_npc_infobox:info:}}<!-- |
||
+ | |||
− | //fetch data from npcinfo database if needed. |
||
+ | ========================================================================================================================== |
||
− | -->{{#vardefine:_npc_auto_id|}}<!-- |
||
+ | ============================================= DATA MODEL ============================================= |
||
− | -->{{#if:{{{auto|}}}|<!-- |
||
+ | ========================================================================================================================== |
||
− | -->{{#vardefine:_npc_auto_id|{{#if:{{#dplreplace:{{#trim:{{{auto|}}}}}|/^-?[0-9]+$/|}}|{{{id|}}}|{{#trim:{{{auto|}}}}}}}}}<!-- |
||
+ | |||
− | -->{{#invoke:npcinfo|getInfo|id={{#var:_npc_auto_id}}|prefix=_npc_infobox:info:}}<!-- |
||
+ | Note: All "#lst*" parser functions ([[gphelp:Extension:ParserPower/List handling functions]]) will trim whitespace and discard empty elements. |
||
+ | |||
+ | +++++++++++++ 1. Set cargo flags +++++++++++++ |
||
+ | |||
+ | // (defining this up here because we already need it in the drop section) |
||
+ | -->{{#vardefine:cargo|}}<!-- |
||
+ | -->{{#ifeq:{{NAMESPACE}}|{{ns:0}}|{{#ifeq:{{PAGENAME}}|{{ROOTPAGENAME}}|{{#vardefine:cargo|y}}}}}}<!-- default: only main ns, only root pages (e.g. no translation subpages) |
||
+ | -->{{#if:{{{cargo|}}}|<!-- |
||
+ | -->{{#switch:{{{cargo|}}}<!-- |
||
+ | -->|1|y|yes|true|force|on={{#vardefine:cargo|y}}<!-- on |
||
+ | -->|0|n|no|false|off={{#vardefine:cargo|}}<!-- off |
||
+ | -->|#default=<!-- invalid parameter value, so keep the variable unchanged |
||
+ | -->}}<!-- |
||
-->}}<!-- |
-->}}<!-- |
||
+ | -->{{#if:{{langList|isOnWiki|{{lang}}}}|{{#vardefine:cargo|}}}}<!-- never store for non-english languages on mainwiki |
||
− | //npc id (only for display) |
||
− | -->{{#vardefine:ni:npcid|{{{id|{{#var:_npc_auto_id}}}}}}}<!-- |
||
+ | -->{{#vardefine:nidrop:cargo|{{#var:cargo}}}}<!-- store drops to cargo? by default, only do that if other data is also stored to cargo |
||
− | //all data: |
||
+ | -->{{#if:{{{cargodrops|}}}|<!-- |
||
+ | -->{{#switch:{{{cargodrops|}}}<!-- |
||
+ | -->|1|y|yes|true|force|on={{#vardefine:nidrop:cargo|y}}<!-- on |
||
+ | -->|0|n|no|false|off={{#vardefine:nidrop:cargo|}}<!-- off |
||
+ | -->|auto={{#ifeq:{{NAMESPACE}}|{{ns:0}}|{{#ifeq:{{PAGENAME}}|{{ROOTPAGENAME}}|{{#vardefine:nidrop:cargo|y}}}}}}<!-- only main ns, only root pages(useful when set |cargo=y/n) |
||
+ | -->|#default=<!-- invalid parameter value, so keep the variable unchanged |
||
+ | -->}}<!-- |
||
+ | -->}}<!-- |
||
+ | -->{{#if:{{langList|isOnWiki|{{lang}}}}|{{#vardefine:nidrop:cargo|}}}}<!-- never store for non-english languages on mainwiki |
||
− | type |
||
− | -->{{#vardefine:ni:type|{{{type|Enemy}}}}}<!-- |
||
− | -->{{#vardefine:ni:type2|{{{type2|}}}}}<!-- |
||
− | -->{{#vardefine:ni:type3|{{{type3|}}}}}<!-- |
||
+ | +++++++++++++ 2. Set types, listcats, environments, mode exclusivity, variant flag, and notabs flag from parameter input +++++++++++++ |
||
− | //tabs? |
||
− | -->{{#vardefine:ni:notab|{{{notabs|{{{notab|{{{variant|{{#switch:{{{tabs|{{{tab|}}}}}}|n|no=y}}}}}}}}}}}}}<!-- |
||
− | -->{{#switch:{{pagename2en|{{lc:{{#var:ni:type}}}}}}|npc|critter|gold critter|furniture={{#vardefine:ni:notab|{{#if:{{{tabs|{{{tab|}}}}}}||y}}}}}}<!-- tabs=y force it appear. |
||
+ | // types: separated with "/". |
||
− | environment |
||
− | -->{{#vardefine:ni: |
+ | -->{{#vardefine:ni:types|{{lcfirst:{{{type|Enemy}}}}}/{{lcfirst:{{{type2|}}}}}/{{lcfirst:{{{type3|}}}}}}}<!-- |
− | -->{{#vardefine:ni:environment|{{#dplreplace:{{#var:ni:environment}}|/\/\/+/|/}}}}<!-- |
||
− | -->{{#vardefine:ni:environment|{{#dplreplace:{{#var:ni:environment}}|/^\//|}}}}<!-- |
||
− | -->{{#vardefine:ni:environment|{{#dplreplace:{{#var:ni:environment}}|/\/$/|}}}}<!-- |
||
+ | // listcats: separated with "/". |
||
− | name/namesub/namenote, and default image file name |
||
+ | -->{{#vardefine:ni:listcats|{{#lstsep:{{{listcat|}}}/{{{listcat2|}}}/{{{listcat3|}}}|/|/}}}}<!-- #lstsep to remove empty elements |
||
− | -->{{#if:{{#dplvar:_npc_infobox:info:netID}}|<!-- |
||
+ | |||
− | -->{{#vardefine:ni:name|{{{name|<!-- |
||
+ | // environment |
||
− | -->{{npc infobox/namedb}}<!-- loading npc name database (it's English) |
||
+ | -->{{#vardefine:ni:environment|{{#lstsep:{{{environment|}}}/{{{environment2|}}}/{{{environment3|}}}|/|/}}}}<!-- #lstsep to remove empty elements |
||
− | -->{{#dplvar:_npc_infobox:info:name}}<!-- |
||
+ | |||
− | -->}}}}}<!-- |
||
+ | // mode exclusivity |
||
− | -->{{#vardefine:_|{{npc infobox/namedb-{{lang}}}}}}<!-- loading db for local lang |
||
− | + | -->{{#vardefine:ni:hardmodeonly|{{bool|{{{hardmode|}}}}}}}<!-- |
|
− | + | -->{{#vardefine:ni:expertonly|{{bool|{{{expertonly|}}}}}}}<!-- |
|
− | + | -->{{#vardefine:ni:masteronly|{{bool|{{{masteronly|}}}}}}}<!-- |
|
+ | |||
− | -->{{npc infobox/namedb-en}}<!-- loading db for en |
||
+ | // variant flag |
||
− | -->{{#if:{{#dplvar:_npc_infobox:en:npcnamesub:{{#dplvar:_npc_infobox:info:netID}}}}|<!-- |
||
+ | -->{{#vardefine:ni:variant|{{bool|{{{variant|}}}}}}}<!-- |
||
− | -->{{#dplvar:_npc_infobox:en:npcnamesub:{{#dplvar:_npc_infobox:info:netID}}}}<!-- |
||
+ | |||
− | -->|<!-- |
||
+ | // notabs flag |
||
− | -->{{#var:ni:name}}<!-- |
||
+ | * reset |
||
− | -->}}<!-- |
||
− | + | -->{{#vardefine:ni:notab|}}<!-- |
|
+ | * default: set flag if the types contain certain strings |
||
+ | -->{{#if:{{#lstfltr:npc/critter/gold critter/furniture|/|{{lc:{{#var:ni:types}}}}|/}}|{{#vardefine:ni:notab|y}}}}<!-- |
||
+ | * $tabs=y: force flag to false |
||
+ | -->{{#if:{{bool|{{{tabs|{{{tab|}}}}}}}}|{{#vardefine:ni:notab|}}}}<!-- |
||
+ | * $variant / $notabs=y / $tabs=n: force flag to true ($variant because Expert Mode is post-1.3) |
||
+ | -->{{#if:{{bool|{{{notabs|{{{notab|}}}}}}}}{{#var:ni:variant}}{{#switch:{{{tabs|{{{tab|}}}}}}|n|no|0|false=y}}|{{#vardefine:ni:notab|y}}}}<!-- |
||
+ | |||
+ | |||
+ | +++++++++++++ 3. Fetch automatic data +++++++++++++ |
||
+ | |||
+ | -->{{#vardefine:ni:auto_id|{{#if:{{{auto|}}}|<!-- |
||
+ | -->{{#if:{{isNumber|{{{auto|}}}}}|<!-- |
||
+ | -->{{{auto|}}}<!-- $auto is number, use it as-is |
||
+ | -->|<!-- |
||
+ | -->{{{id|{{NpcIdFromName|{{{name|{{#var:npcnamefrompagename}}}}}}}}}}<!-- $id -> idFromName |
||
-->}}<!-- |
-->}}<!-- |
||
+ | -->}}}}<!-- |
||
+ | -->{{#if:{{#var:ni:auto_id}}|<!-- |
||
+ | -->{{#invoke:Npcinfo|getInfo|id={{#var:ni:auto_id}}|prefix=ni:info:}}<!-- fetch data |
||
+ | -->|<!-- |
||
+ | -->{{#invoke:Npcinfo|clear|prefix=ni:info:}}<!-- reset the data-filled vars |
||
+ | -->}}<!-- |
||
+ | |||
+ | |||
+ | +++++++++++++ 4. Process auto data, overriding with manual input if necessary +++++++++++++ |
||
+ | |||
+ | ---- id, name, and default imagename ---- |
||
+ | -->{{#vardefine:ni:npcid|{{{id|{{#var:ni:auto_id}}}}}}}<!-- npc id (only for display) |
||
+ | -->{{#vardefine:ni:namesub|{{tr|{{{namesub|}}}}}}}<!-- |
||
+ | -->{{#vardefine:ni:namenote|{{tr|{{{namenote|}}}}}}}<!-- |
||
+ | -->{{#if:{{#dplvar:ni:info:netID}}|<!-- |
||
+ | -->{{#vardefine:ni:name|{{{name|{{#dplvar:ni:info:name}}}}}}}<!-- |
||
+ | -->{{#vardefine:_|{{npc infobox/namedb-{{lang|}}}}}}<!-- load db for local lang (in a dummy #vardefine to prevent redlink if db doesn't exist) |
||
+ | -->{{#vardefine:ni:namesub|{{tr|{{#var:ni:namesub|{{{namesub|{{#dplvar:_npc_infobox:{{lang|}}:npcnamesub:{{#dplvar:ni:info:netID}}}}}}}}}}}}}<!-- by doing this we can use |namesub=<blank> to suppress auto value. |
||
+ | -->{{#vardefine:ni:namenote|{{#var:ni:namenote|{{{namenote|{{#dplvar:_npc_infobox:{{lang|}}:npcnamenote:{{#dplvar:ni:info:netID}}}}}}}}}}}<!-- |
||
+ | -->{{#vardefine:ni:imagename|{{{name|<!-- |
||
+ | -->{{npc infobox/namedb-en}}<!-- load db for en |
||
+ | -->{{#if:{{#dplvar:_npc_infobox:en:npcnamesub:{{#dplvar:ni:info:netID}}}}|<!-- |
||
+ | -->{{#dplvar:_npc_infobox:en:npcnamesub:{{#dplvar:ni:info:netID}}}}<!-- |
||
+ | -->|<!-- |
||
+ | -->{{#var:ni:name}}<!-- |
||
+ | -->}}<!-- |
||
+ | -->}}}}}<!-- |
||
-->|<!-- |
-->|<!-- |
||
-->{{#vardefine:ni:name|{{{name|{{#var:npcnamefrompagename}}}}}{{{name2|}}}}}<!-- |
-->{{#vardefine:ni:name|{{{name|{{#var:npcnamefrompagename}}}}}{{{name2|}}}}}<!-- |
||
− | -->{{#vardefine:ni:namesub|{{tr|{{{namesub|}}}}}}}<!-- |
||
− | -->{{#vardefine:ni:namenote|{{tr|{{{namenote|}}}}}}}<!-- |
||
-->{{#vardefine:ni:imagename|{{{name|{{#var:npcnamefrompagename}}}}}}}<!-- |
-->{{#vardefine:ni:imagename|{{{name|{{#var:npcnamefrompagename}}}}}}}<!-- |
||
-->}}<!-- |
-->}}<!-- |
||
-->{{#vardefine:ni:name2|{{{name2|}}}}}<!-- |
-->{{#vardefine:ni:name2|{{{name2|}}}}}<!-- |
||
-->{{#vardefine:ni:namesub2|{{{namesub2|}}}}}<!-- |
-->{{#vardefine:ni:namesub2|{{{namesub2|}}}}}<!-- |
||
+ | -------- |
||
− | -->{{#vardefine:ni:hardmodeonly|{{{hardmode|}}}}}<!-- |
||
− | -->{{#vardefine:ni:expertonly|{{{expertonly|}}}}}<!-- |
||
− | -->{{#vardefine:ni:masteronly|{{{masteronly|}}}}}<!-- |
||
+ | ---- ai ---- |
||
− | //version info |
||
+ | -->{{#vardefine:ni:ai|{{#if:{{{ai|{{#dplvar:ni:info:aiStyle}}}}}|{{{ai|{{npc infobox/AI|{{#dplvar:ni:info:aiStyle}}}}}}}}}}}<!-- |
||
− | -->{{#vardefine:ni:variant|}}<!-- reset |
||
+ | -------- |
||
− | -->{{#if:{{{version|{{{variant|}}}}}}|<!-- |
||
− | -->{{#if:{{#pos:{{lc:{{{version|}}}}}|desktop}}||<!-- |
||
− | -->{{#if:{{{version|}}}|<!-- |
||
− | -->{{#vardefine:ni:variant|<!-- |
||
− | -->{{#if:{{#pos:{{lc:{{{version}}}}}|desktop}}|desktop/}}<!-- |
||
− | -->{{#if:{{#pos:{{lc:{{{version}}}}}|console}}|console/}}<!-- |
||
− | -->{{#if:{{#pos:{{lc:{{{version}}}}}|oldgen}}|old-gen/}}<!-- |
||
− | -->{{#if:{{#pos:{{lc:{{{version}}}}}|mobile}}|mobile/}}<!-- |
||
− | -->{{#if:{{#pos:{{lc:{{{version}}}}}|3ds}}|3ds}}<!-- |
||
− | -->}}<!-- |
||
− | -->|<!--else |
||
− | -->{{#vardefine:ni:variant|old-gen/3ds}}<!-- |
||
− | -->}}<!-- |
||
− | -->}}<!-- |
||
− | -->}}<!-- |
||
+ | ---- damage ---- |
||
− | //all images: (default auto main image filename is in {{#var:ni:imagename}} ) |
||
+ | -->{{#vardefine:ni:damage|{{{damage|{{#if:{{#dplvar:ni:info:damage}}|<!-- |
||
− | image 1 |
||
− | -->{{# |
+ | -->{{#invoke:Npcstat|format|lang={{lang|}}|hardmodeonly={{#var:ni:hardmodeonly}}|expertonly={{#var:ni:expertonly}}<!-- |
+ | -->|{{#dplvar:ni:info:damage}}<!-- |
||
− | -->{{#if:{{#var:ni:image1}}||{{#vardefine:ni:image1|[[File:{{{image|{{#var:ni:imagename}}.png}}}|link=]]}}}}<!-- fallback if {{image}} failed. |
||
+ | -->|{{#dplvar:ni:info:damage_e}}|{{#dplvar:ni:info:damage_e_hm}}|{{#dplvar:ni:info:damage_e_pp}}<!-- |
||
− | -->{{#vardefine:ni:image1text|}}<!-- |
||
+ | -->|{{#dplvar:ni:info:damage_m}}|{{#dplvar:ni:info:damage_m_hm}}|{{#dplvar:ni:info:damage_m_pp}}<!-- |
||
− | image expert |
||
− | -->{{#vardefine:imageexpert|{{{imageexpert|}}}}}<!-- |
||
− | init image 2/3 |
||
− | -->{{#vardefine:ni:image2|{{{image2|}}}}}<!-- |
||
− | -->{{#vardefine:ni:image2text|}}<!-- |
||
− | -->{{#vardefine:ni:image3|{{{image3|}}}}}<!-- |
||
− | -->{{#vardefine:ni:image3text|}}<!-- |
||
− | parse image 2/3 |
||
− | init all vars |
||
− | -->{{#dplvar:set<!-- |
||
− | -->|d|t1|c|t1|o|t1|m|t1|3|t1<!-- |
||
− | -->|t1||t2||t3|<!-- |
||
− | -->}}<!-- |
||
− | try to auto discover: _(old).png, _(old).gif if needed. only for full mode |
||
− | -->{{#ifeq:{{#var:imagemode}}|full|<!-- |
||
− | if($image2 === null) |
||
− | -->{{#if:{{{image2|}}}||{{#if:{{{image2|null}}}|<!-- |
||
− | -->{{#vardefine:old|{{#if:{{{image|}}}|{{#explode:{{{image}}}|.|0}}|{{#var:ni:imagename}}}}_(old)}}<!-- |
||
− | -->{{#vardefine:ni:image2|<!-- |
||
− | -->{{#ifexist:Media:{{#var:old}}.png|<!-- |
||
− | -->{{#var:old}}.png<!-- |
||
− | -->|<!-- |
||
− | -->{{#ifexist:Media:{{#var:old}}.gif|{{#var:old}}.gif}}<!-- |
||
− | -->}}<!-- |
||
− | -->}}<!-- |
||
− | -->}}}}<!-- |
||
− | -->}}<!-- |
||
− | versions for images2 |
||
− | -->{{#if:{{#var:ni:image2}}|<!-- |
||
− | imageversion2 examples: old,Console,Console-Mobile, any platform-platform-platform |
||
− | -->{{#if:{{{imageversion2|}}}|<!-- |
||
− | -->{{#dplvar:set|imageversion|{{lc:{{{imageversion2}}}}}}}<!-- |
||
− | -->{{#if:{{#pos:{{#dplvar:imageversion}}|desktop}}|{{#dplvar:set|d|t2}}}}<!-- |
||
− | -->{{#if:{{#pos:{{#dplvar:imageversion}}|console}}|{{#dplvar:set|c|t2}}}}<!-- |
||
− | -->{{#if:{{#pos:{{#dplvar:imageversion}}|old-gen}}|{{#dplvar:set|o|t2}}}}<!-- |
||
− | -->{{#if:{{#pos:{{#dplvar:imageversion}}|mobile}}|{{#dplvar:set|m|t2}}}}<!-- |
||
− | -->{{#if:{{#pos:{{#dplvar:imageversion}}|3ds}}|{{#dplvar:set|3|t2}}}}<!-- |
||
− | -->|<!-- |
||
− | -->{{#dplvar:set|o|t2|3|t2}}<!-- default old versions |
||
-->}}<!-- |
-->}}<!-- |
||
− | -->}}<!-- |
||
− | versions for images3 |
||
− | -->{{#if:{{#var:ni:image3}}|<!-- |
||
− | imageversion3 examples: Console,Console-Mobile, any platform-platform-platform |
||
− | -->{{#if:{{{imageversion3|}}}|<!-- platforms specified |
||
− | -->{{#dplvar:set|imageversion|{{lc:{{{imageversion3|}}}}}}}<!-- |
||
− | -->{{#if:{{#pos:{{#dplvar:imageversion}}|desktop}}|{{#dplvar:set|d|t3}}}}<!-- |
||
− | -->{{#if:{{#pos:{{#dplvar:imageversion}}|console}}|{{#dplvar:set|c|t3}}}}<!-- |
||
− | -->{{#if:{{#pos:{{#dplvar:imageversion}}|old-gen}}|{{#dplvar:set|o|t3}}}}<!-- |
||
− | -->{{#if:{{#pos:{{#dplvar:imageversion}}|mobile}}|{{#dplvar:set|m|t3}}}}<!-- |
||
− | -->{{#if:{{#pos:{{#dplvar:imageversion}}|3ds}}|{{#dplvar:set|3|t3}}}}<!-- |
||
− | -->}}<!-- |
||
− | -->}}<!-- |
||
− | tooltips, if needed |
||
− | -->{{#if:{{#var:ni:image2}}{{#var:ni:image3}}|<!-- |
||
− | // now dplvars d/c/o/m/3 will be t1/t2/t3. |
||
− | //append versions to t1/t2/t3: |
||
− | -->{{#dplvar:set|{{#dplvar:d}}|{{#dplvar:{{#dplvar:d}}}}/desktop}}<!-- |
||
− | -->{{#dplvar:set|{{#dplvar:c}}|{{#dplvar:{{#dplvar:c}}}}/console}}<!-- |
||
− | -->{{#dplvar:set|{{#dplvar:o}}|{{#dplvar:{{#dplvar:o}}}}/old-gen}}<!-- |
||
− | -->{{#dplvar:set|{{#dplvar:m}}|{{#dplvar:{{#dplvar:m}}}}/mobile}}<!-- |
||
− | -->{{#dplvar:set|{{#dplvar:3}}|{{#dplvar:{{#dplvar:3}}}}/3ds}}<!-- |
||
− | //alt text for t1/t2/t3 |
||
− | -->{{#if:{{#dplvar:t1}}|{{#vardefine:ni:image1text|{{versions|{{#dplvar:t1}}|mode=text|nl=yes}}}}}}<!-- |
||
− | -->{{#if:{{#dplvar:t2}}|{{#vardefine:ni:image2text|{{versions|{{#dplvar:t2}}|mode=text|nl=yes}}}}}}<!-- |
||
− | -->{{#if:{{#dplvar:t3}}|{{#vardefine:ni:image3text|{{versions|{{#dplvar:t3}}|mode=text|nl=yes}}}}}}<!-- |
||
− | -->}}<!-- |
||
− | |||
− | AI |
||
− | -->{{#vardefine:ni:ai|{{#if:{{{ai|{{#dplvar:_npc_infobox:info:aiStyle}}}}}|{{{ai|{{npc infobox/AI|{{#dplvar:_npc_infobox:info:aiStyle}}}}}}}}}}}<!-- |
||
− | damage |
||
− | -->{{#vardefine:ni:damage|{{{damage|{{#if:{{#dplvar:_npc_infobox:info:damage}}|<!-- |
||
− | -->{{#invoke:npcstat|format|lang={{lang}}|hardmodeonly={{{hardmode|}}}|expertonly={{{expertonly|}}}<!-- |
||
− | -->|{{#dplvar:_npc_infobox:info:damage}}<!-- |
||
− | -->|{{#dplvar:_npc_infobox:info:damage_e}}|{{#dplvar:_npc_infobox:info:damage_e_hm}}|{{#dplvar:_npc_infobox:info:damage_e_pp}}<!-- |
||
− | -->|{{#dplvar:_npc_infobox:info:damage_m}}|{{#dplvar:_npc_infobox:info:damage_m_hm}}|{{#dplvar:_npc_infobox:info:damage_m_pp}}<!-- |
||
− | -->}}<!-- |
||
-->}}}}}{{{damage2|}}}}}<!-- |
-->}}}}}{{{damage2|}}}}}<!-- |
||
-->{{#vardefine:ni:damage1|{{{damage|}}}}}<!-- |
-->{{#vardefine:ni:damage1|{{{damage|}}}}}<!-- |
||
-->{{#vardefine:ni:damage2|{{{damage2|}}}}}<!-- |
-->{{#vardefine:ni:damage2|{{{damage2|}}}}}<!-- |
||
− | -->{{#vardefine:ni:auto_damage|{{#dplvar: |
+ | -->{{#vardefine:ni:auto_damage|{{#dplvar:ni:info:damage}}}}<!-- |
− | -->{{#vardefine:ni:auto_damage_e|{{#dplvar: |
+ | -->{{#vardefine:ni:auto_damage_e|{{#dplvar:ni:info:damage_e}}}}<!-- |
− | -->{{#vardefine:ni:auto_damage_e_hm|{{#dplvar: |
+ | -->{{#vardefine:ni:auto_damage_e_hm|{{#dplvar:ni:info:damage_e_hm}}}}<!-- |
− | -->{{#vardefine:ni:auto_damage_e_pp|{{#dplvar: |
+ | -->{{#vardefine:ni:auto_damage_e_pp|{{#dplvar:ni:info:damage_e_pp}}}}<!-- |
− | -->{{#vardefine:ni:auto_damage_m|{{#dplvar: |
+ | -->{{#vardefine:ni:auto_damage_m|{{#dplvar:ni:info:damage_m}}}}<!-- |
− | -->{{#vardefine:ni:auto_damage_m_hm|{{#dplvar: |
+ | -->{{#vardefine:ni:auto_damage_m_hm|{{#dplvar:ni:info:damage_m_hm}}}}<!-- |
− | -->{{#vardefine:ni:auto_damage_m_pp|{{#dplvar: |
+ | -->{{#vardefine:ni:auto_damage_m_pp|{{#dplvar:ni:info:damage_m_pp}}}}<!-- |
+ | -------- |
||
− | max life |
||
+ | |||
− | -->{{#vardefine:ni:lifemax|{{{life|{{#if:{{#dplvar:_npc_infobox:info:lifeMax}}|<!-- |
||
+ | ---- max life ---- |
||
− | -->{{#invoke:npcstat|format|lang={{lang}}|hardmodeonly={{{hardmode|}}}|expertonly={{{expertonly|}}}<!-- |
||
− | + | -->{{#vardefine:ni:lifemax|{{{life|{{#if:{{#dplvar:ni:info:lifeMax}}|<!-- |
|
+ | -->{{#invoke:Npcstat|format|lang={{lang|}}|hardmodeonly={{#var:ni:hardmodeonly}}|expertonly={{#var:ni:expertonly}}<!-- |
||
− | -->|{{#dplvar:_npc_infobox:info:lifeMax_e}}|{{#dplvar:_npc_infobox:info:lifeMax_e_hm}}|{{#dplvar:_npc_infobox:info:lifeMax_e_pp}}<!-- |
||
− | + | -->|{{#dplvar:ni:info:lifeMax}}<!-- |
|
+ | -->|{{#dplvar:ni:info:lifeMax_e}}|{{#dplvar:ni:info:lifeMax_e_hm}}|{{#dplvar:ni:info:lifeMax_e_pp}}<!-- |
||
− | -->}}<!-- |
||
+ | -->|{{#dplvar:ni:info:lifeMax_m}}|{{#dplvar:ni:info:lifeMax_m_hm}}|{{#dplvar:ni:info:lifeMax_m_pp}}<!-- |
||
+ | -->}}<!-- |
||
-->}}}}}{{{life2|}}}}}<!-- |
-->}}}}}{{{life2|}}}}}<!-- |
||
-->{{#vardefine:ni:lifemax1|{{{life|}}}}}<!-- |
-->{{#vardefine:ni:lifemax1|{{{life|}}}}}<!-- |
||
-->{{#vardefine:ni:lifemax2|{{{life2|}}}}}<!-- |
-->{{#vardefine:ni:lifemax2|{{{life2|}}}}}<!-- |
||
− | -->{{#vardefine:ni:auto_lifemax|{{#dplvar: |
+ | -->{{#vardefine:ni:auto_lifemax|{{#dplvar:ni:info:lifeMax}}}}<!-- |
− | -->{{#vardefine:ni:auto_lifemax_e|{{#dplvar: |
+ | -->{{#vardefine:ni:auto_lifemax_e|{{#dplvar:ni:info:lifeMax_e}}}}<!-- |
− | -->{{#vardefine:ni:auto_lifemax_e_hm|{{#dplvar: |
+ | -->{{#vardefine:ni:auto_lifemax_e_hm|{{#dplvar:ni:info:lifeMax_e_hm}}}}<!-- |
− | -->{{#vardefine:ni:auto_lifemax_e_pp|{{#dplvar: |
+ | -->{{#vardefine:ni:auto_lifemax_e_pp|{{#dplvar:ni:info:lifeMax_e_pp}}}}<!-- |
− | -->{{#vardefine:ni:auto_lifemax_m|{{#dplvar: |
+ | -->{{#vardefine:ni:auto_lifemax_m|{{#dplvar:ni:info:lifeMax_m}}}}<!-- |
− | -->{{#vardefine:ni:auto_lifemax_m_hm|{{#dplvar: |
+ | -->{{#vardefine:ni:auto_lifemax_m_hm|{{#dplvar:ni:info:lifeMax_m_hm}}}}<!-- |
− | -->{{#vardefine:ni:auto_lifemax_m_pp|{{#dplvar: |
+ | -->{{#vardefine:ni:auto_lifemax_m_pp|{{#dplvar:ni:info:lifeMax_m_pp}}}}<!-- |
+ | -------- |
||
− | defense |
||
+ | |||
− | -->{{#vardefine:ni:defense|{{{defense|{{#if:{{#dplvar:_npc_infobox:info:defense}}|<!-- |
||
+ | ---- defense ---- |
||
− | -->{{#invoke:npcstat|format|lang={{lang}}|hardmodeonly={{{hardmode|}}}|expertonly={{{expertonly|}}}<!-- |
||
− | + | -->{{#vardefine:ni:defense|{{{defense|{{#if:{{#dplvar:ni:info:defense}}|<!-- |
|
+ | -->{{#invoke:Npcstat|format|lang={{lang|}}|hardmodeonly={{#var:ni:hardmodeonly}}|expertonly={{#var:ni:expertonly}}<!-- |
||
− | -->|{{#dplvar:_npc_infobox:info:defense_e}}|{{#dplvar:_npc_infobox:info:defense_e_hm}}|{{#dplvar:_npc_infobox:info:defense_e_pp}}<!-- |
||
− | + | -->|{{#dplvar:ni:info:defense}}<!-- |
|
+ | -->|{{#dplvar:ni:info:defense_e}}|{{#dplvar:ni:info:defense_e_hm}}|{{#dplvar:ni:info:defense_e_pp}}<!-- |
||
− | -->}}<!-- |
||
+ | -->|{{#dplvar:ni:info:defense_m}}|{{#dplvar:ni:info:defense_m_hm}}|{{#dplvar:ni:info:defense_m_pp}}<!-- |
||
+ | -->}}<!-- |
||
-->}}}}}{{{defense2|}}}}}<!-- |
-->}}}}}{{{defense2|}}}}}<!-- |
||
-->{{#vardefine:ni:defense1|{{{defense|}}}}}<!-- |
-->{{#vardefine:ni:defense1|{{{defense|}}}}}<!-- |
||
-->{{#vardefine:ni:defense2|{{{defense2|}}}}}<!-- |
-->{{#vardefine:ni:defense2|{{{defense2|}}}}}<!-- |
||
− | -->{{#vardefine:ni:auto_defense|{{#dplvar: |
+ | -->{{#vardefine:ni:auto_defense|{{#dplvar:ni:info:defense}}}}<!-- |
− | -->{{#vardefine:ni:auto_defense_e|{{#dplvar: |
+ | -->{{#vardefine:ni:auto_defense_e|{{#dplvar:ni:info:defense_e}}}}<!-- |
− | -->{{#vardefine:ni:auto_defense_e_hm|{{#dplvar: |
+ | -->{{#vardefine:ni:auto_defense_e_hm|{{#dplvar:ni:info:defense_e_hm}}}}<!-- |
− | -->{{#vardefine:ni:auto_defense_e_pp|{{#dplvar: |
+ | -->{{#vardefine:ni:auto_defense_e_pp|{{#dplvar:ni:info:defense_e_pp}}}}<!-- |
− | -->{{#vardefine:ni:auto_defense_m|{{#dplvar: |
+ | -->{{#vardefine:ni:auto_defense_m|{{#dplvar:ni:info:defense_m}}}}<!-- |
− | -->{{#vardefine:ni:auto_defense_m_hm|{{#dplvar: |
+ | -->{{#vardefine:ni:auto_defense_m_hm|{{#dplvar:ni:info:defense_m_hm}}}}<!-- |
− | -->{{#vardefine:ni:auto_defense_m_pp|{{#dplvar: |
+ | -->{{#vardefine:ni:auto_defense_m_pp|{{#dplvar:ni:info:defense_m_pp}}}}<!-- |
+ | -------- |
||
− | knockback |
+ | ---- knockback ---- |
-->{{#vardefine:ni:knockback1|{{{knockback|}}}}}<!-- |
-->{{#vardefine:ni:knockback1|{{{knockback|}}}}}<!-- |
||
-->{{#vardefine:ni:knockback2|{{{knockback2|}}}}}<!-- |
-->{{#vardefine:ni:knockback2|{{{knockback2|}}}}}<!-- |
||
− | -->{{#vardefine:ni:auto_knockback|{{npc infobox/knockback|{{#dplvar: |
+ | -->{{#vardefine:ni:auto_knockback|{{npc infobox/knockback|{{#dplvar:ni:info:knockBackResist}}}}}}<!-- |
− | -->{{#vardefine:ni:auto_knockback_e|{{npc infobox/knockback|{{#dplvar: |
+ | -->{{#vardefine:ni:auto_knockback_e|{{npc infobox/knockback|{{#dplvar:ni:info:knockBackResist_e}}}}}}<!-- |
− | -->{{#vardefine:ni:auto_knockback_e_hm|{{npc infobox/knockback|{{#dplvar: |
+ | -->{{#vardefine:ni:auto_knockback_e_hm|{{npc infobox/knockback|{{#dplvar:ni:info:knockBackResist_e_hm}}}}}}<!-- |
− | -->{{#vardefine:ni:auto_knockback_e_pp|{{npc infobox/knockback|{{#dplvar: |
+ | -->{{#vardefine:ni:auto_knockback_e_pp|{{npc infobox/knockback|{{#dplvar:ni:info:knockBackResist_e_pp}}}}}}<!-- |
− | -->{{#vardefine:ni:auto_knockback_m|{{npc infobox/knockback|{{#dplvar: |
+ | -->{{#vardefine:ni:auto_knockback_m|{{npc infobox/knockback|{{#dplvar:ni:info:knockBackResist_m}}}}}}<!-- |
− | -->{{#vardefine:ni:auto_knockback_m_hm|{{npc infobox/knockback|{{#dplvar: |
+ | -->{{#vardefine:ni:auto_knockback_m_hm|{{npc infobox/knockback|{{#dplvar:ni:info:knockBackResist_m_hm}}}}}}<!-- |
− | -->{{#vardefine:ni:auto_knockback_m_pp|{{npc infobox/knockback|{{#dplvar: |
+ | -->{{#vardefine:ni:auto_knockback_m_pp|{{npc infobox/knockback|{{#dplvar:ni:info:knockBackResist_m_pp}}}}}}<!-- |
− | -->{{#vardefine:ni:knockback|{{{knockback|{{#if:{{#dplvar: |
+ | -->{{#vardefine:ni:knockback|{{{knockback|{{#if:{{#dplvar:ni:info:knockBackResist}}|<!-- |
− | -->{{#invoke: |
+ | -->{{#invoke:Npcstat|format|lang={{lang|}}|hardmodeonly={{#var:ni:hardmodeonly}}|expertonly={{#var:ni:expertonly}}<!-- |
-->|{{#var:ni:auto_knockback}}<!-- |
-->|{{#var:ni:auto_knockback}}<!-- |
||
− | -->|{{#var:ni:auto_knockback_e}}<!-- |
+ | -->|{{#var:ni:auto_knockback_e}}|{{#var:ni:auto_knockback_e_hm}}|{{#var:ni:auto_knockback_e_pp}}<!-- |
− | -->|{{#var:ni: |
+ | -->|{{#var:ni:auto_knockback_m}}|{{#var:ni:auto_knockback_m_hm}}|{{#var:ni:auto_knockback_m_pp}}<!-- |
− | -->|{{#var:ni:auto_knockback_e_pp}}<!-- |
||
− | -->|{{#var:ni:auto_knockback_m}}<!-- |
||
− | -->|{{#var:ni:auto_knockback_m_hm}}<!-- |
||
− | -->|{{#var:ni:auto_knockback_m_pp}}<!-- |
||
-->}}<!-- |
-->}}<!-- |
||
-->}}}}}{{{knockback2|}}}}}<!-- |
-->}}}}}{{{knockback2|}}}}}<!-- |
||
+ | -------- |
||
− | buff info |
||
− | -->{{#vardefine:ni:buffid|{{#if:{{{buffid|{{{buff|}}}}}}|<!-- |
||
− | -->{{{buffid|<!-- |
||
− | -->{{#if:{{#dplreplace:{{trim|{{{buff|}}}}}|/^[0-9]+$/|}}|<!-- |
||
− | -->{{buffIdFromName|{{{buff|}}}}}<!-- |
||
− | -->|<!-- |
||
− | -->{{{buff|}}}<!-- |
||
− | -->}}<!-- |
||
− | -->}}}<!-- |
||
− | -->}}}}<!-- |
||
− | -->{{#if:{{#var:ni:buffid}}|<!-- |
||
− | -->{{#vardefine:ni:buffduration|{{{buffduration|}}}}}<!-- |
||
− | -->{{#vardefine:ni:bufftip|{{{bufftip|{{tr|{{getBuffInfo|{{#var:ni:buffid}}|tooltip}}}}}}}}}<!-- |
||
− | -->}}<!-- |
||
+ | ---- immunities ---- |
||
− | debuff info: |
||
− | -->{{#vardefine:ni:debuffid|{{#if:{{{debuff|}}}|<!-- |
||
− | -->{{#if:{{#dplreplace:{{trim|{{{debuff|}}}}}|/^[0-9]+$/|}}|<!-- |
||
− | -->{{buffIdFromName|{{{debuff|}}}}}<!-- |
||
− | -->|<!-- |
||
− | -->{{{debuff|}}}<!-- |
||
− | -->}}<!-- |
||
− | -->}}}}<!-- |
||
− | -->{{#if:{{#var:ni:debuffid}}|<!-- |
||
− | -->{{#vardefine:ni:debuffchance|{{#if:{{{debuffchance|}}}|<!-- |
||
− | // this part is a relic of the old npc infobox, it is only kept for backwards compatibility |
||
− | -->{{#ifeq:{{#sub:{{{debuffchance|}}}|-2}}|##|<!-- |
||
− | -->{{#sub:{{{debuffchance|}}}|0|-2}}<!-- if end with ## then use it as-is |
||
− | -->|<!-- |
||
− | -->{{{debuffchance|}}}<!-- else use it as-is |
||
− | -->}}<!-- |
||
− | -->}}}}<!-- |
||
− | -->{{#vardefine:ni:debuffchancenote|{{{debuffchancenote|}}}}}<!-- |
||
− | -->{{#vardefine:ni:debuffduration|{{{duration|{{{debuffduration|}}}}}}}}<!-- |
||
− | -->{{#vardefine:ni:debufftip|{{{debufftip|{{tr|{{getBuffInfo|{{#var:ni:debuffid}}|tooltip}}}}}}}}}<!-- |
||
− | -->{{#vardefine:ni:debuffmode|{{{debuffmode|}}}}}<!-- |
||
− | -->}}<!-- END debuff |
||
− | -->{{#vardefine:ni:debuffid2|{{#if:{{{debuff2|}}}|<!-- |
||
− | -->{{#if:{{#dplreplace:{{trim|{{{debuff2|}}}}}|/^[0-9]+$/|}}|<!-- |
||
− | -->{{buffIdFromName|{{{debuff2|}}}}}<!-- |
||
− | -->|<!-- |
||
− | -->{{{debuff2|}}}<!-- |
||
− | -->}}<!-- |
||
− | -->}}}}<!-- |
||
− | -->{{#if:{{#var:ni:debuffid2}}|<!-- |
||
− | -->{{#vardefine:ni:debuffchance2|{{#if:{{{debuffchance2|}}}|<!-- |
||
− | // this part is a relic of the old npc infobox, it is only kept for backwards compatibility |
||
− | -->{{#ifeq:{{#sub:{{{debuffchance2|}}}|-2}}|##|<!-- |
||
− | -->{{#sub:{{{debuffchance2|}}}|0|-2}}<!-- if end with ## then use it as-is |
||
− | -->|<!-- |
||
− | -->{{{debuffchance2|}}}<!-- else use it as-is |
||
− | -->}}<!-- |
||
− | -->}}}}<!-- |
||
− | -->{{#vardefine:ni:debuffchancenote2|{{{debuffchancenote2|}}}}}<!-- |
||
− | -->{{#vardefine:ni:debuffduration2|{{{duration2|{{{debuffduration2|}}}}}}}}<!-- |
||
− | -->{{#vardefine:ni:debufftip2|{{{debufftip2|{{tr|{{getBuffInfo|{{#var:ni:debuffid2}}|tooltip}}}}}}}}}<!-- |
||
− | -->{{#vardefine:ni:debuffmode2|{{{debuffmode2|}}}}}<!-- |
||
− | -->}}<!-- END debuff2 |
||
− | |||
− | Immune |
||
-->{{#vardefine:ni:immunities|}}<!-- |
-->{{#vardefine:ni:immunities|}}<!-- |
||
-->{{#vardefine:ni:immunenote|{{{immuneallnote|{{{immunenote|}}}}}}}}<!-- |
-->{{#vardefine:ni:immunenote|{{{immuneallnote|{{{immunenote|}}}}}}}}<!-- |
||
-->{{#vardefine:ni:cargo:immunities|}}<!-- |
-->{{#vardefine:ni:cargo:immunities|}}<!-- |
||
− | -->{{# |
+ | -->{{#vardefine:_ignore_immunities|{{#dplvar:ni:info:friendly}}{{#lstfltr:projectile/invincible/critter/gold Critter|/|{{lc:{{#var:ni:types}}}}|/}}}}<!-- |
+ | -->{{#if:{{#var:_ignore_immunities}}||<!-- |
||
− | -->{{#arraydefine:skip_types|Projectile/Invincible/Critter|/}}<!-- skip types: Projectile|Invincible|Critter |
||
− | -->{{#if:{{ |
+ | -->{{#if:{{bool|{{{immuneall|{{#dplvar:ni:info:buffImmuneAll}}}}}}}|<!-- immune to all debuffs |
+ | -->{{#vardefine:ni:immunities|ALL}}<!-- |
||
− | -->{{#if:{{{immuneall|{{#dplvar:_npc_infobox:info:buffImmuneAll}}}}}|<!-- immune all |
||
− | + | -->{{#vardefine:ni:cargo:immunities|ALL}}<!-- |
|
+ | -->|{{#if:{{bool|{{{immuneallnotwhips|{{#dplvar:ni:info:buffImmuneAllNotWhips}}}}}}}|<!-- immune to all debuffs but not whip debuffs |
||
− | -->{{#vardefine:ni:cargo:immunities|ALL}}<!-- |
||
+ | -->{{#vardefine:ni:immunities|NOTWHIPS}}<!-- |
||
− | -->|{{#if:{{{immuneallnotwhips|{{#dplvar:_npc_infobox:info:buffImmuneAllNotWhips}}}}}|<!-- immune all but not whips. |
||
− | + | -->{{#vardefine:ni:cargo:immunities|NOTWHIPS}}<!-- |
|
+ | -->|<!-- only immune to certain debuffs, or none at all |
||
− | -->{{#vardefine:ni:cargo:immunities|NOTWHIPS}}<!-- |
||
+ | -->{{#vardefine:ni:immunities_input|{{#forargs:immune|paramkey|paramvalue|/<!-- iterate over all parameters starting with "immune" |
||
− | -->|<!-- |
||
+ | -->{{#if:{{#var:paramkey}}|<!-- |
||
− | -->{{#if:{{#dplvar:_npc_infobox:info:buffImmune}}{{{immune1|}}}{{{immune2|}}}{{{immune3|}}}{{{immune4|}}}{{{immune5|}}}{{{immune6|}}}{{{immune7|}}}{{{immune8|}}}{{{immune9|}}}{{{immune10|}}}|<!-- |
||
+ | -->{{#if:{{isNumber|{{#var:paramkey}}}}|{{#var:paramvalue}}}}<!-- if the paramkey is a number, then we take its value (e.g. $immune2) |
||
− | -->{{#arraydefine:__buffs|{{#dplvar:_npc_infobox:info:buffImmune}},{{buffIdFromName|{{{immune1|}}}}},{{buffIdFromName|{{{immune2|}}}}},{{buffIdFromName|{{{immune3|}}}}},{{buffIdFromName|{{{immune4|}}}}},{{buffIdFromName|{{{immune5|}}}}},{{buffIdFromName|{{{immune6|}}}}},{{buffIdFromName|{{{immune7|}}}}},{{buffIdFromName|{{{immune8|}}}}},{{buffIdFromName|{{{immune9|}}}}},{{buffIdFromName|{{{immune10|}}}}}|,|unique}}<!-- //"unique" will also drop empty values. |
||
+ | -->|<!-- |
||
− | -->{{#vardefine:ni:immunities|{{ #arrayprint:__buffs|,}}}}<!-- concat with "," |
||
+ | -->{{#var:paramvalue}}<!-- if the paramkey doesn't exist, then the parameter is $immune, so we take its value |
||
− | -->{{#vardefine:ni:cargo:immunities|{{#arrayprint:__buffs|^|@@@@|{{getBuffInfo|@@@@|name}}}}}}<!-- |
||
− | -->}}<!-- |
+ | -->}}<!-- |
− | -->}}}}<!-- |
+ | -->}}}}<!-- |
+ | -->{{#if:{{#dplvar:ni:info:buffImmune}}{{#var:ni:immunities_input}}|<!-- if there are auto or manual immunities |
||
− | -->}}<!-- |
||
+ | // convert manual immunities to buff IDs (auto immunities are already IDs) |
||
+ | -->{{#vardefine:ni:immunities_input|{{#lstmap:{{#var:ni:immunities_input}}|/|@@@@|<esc>{{buffIdFromName|@@@@}}</esc>|,}}}}<!-- |
||
+ | // list of buff IDs for the views, separator "," |
||
+ | -->{{#vardefine:ni:immunities|{{#lstuniq:{{#dplvar:ni:info:buffImmune}},{{#var:ni:immunities_input}}|,|,}}}}<!-- |
||
+ | // list of buff names for cargo, separator "^" |
||
+ | -->{{#vardefine:ni:cargo:immunities|{{#lstmap:{{#var:ni:immunities}}|,|@@@@|<esc>{{getBuffInfo|@@@@|name}}</esc>|^}}}}<!-- |
||
+ | -->}}<!-- |
||
+ | -->}}}}<!-- |
||
-->}}<!-- |
-->}}<!-- |
||
+ | -------- |
||
− | banner |
+ | ---- banner ---- |
− | -->{{#vardefine:ni:banner|}}<!-- banner name |
+ | -->{{#vardefine:ni:banner|}}<!-- banner item name |
− | -->{{#vardefine:__banner_id|}}<!-- banner id for cargo |
+ | -->{{#vardefine:__banner_id|}}<!-- banner item id for cargo |
+ | -->{{#if:{{{banner|}}}|<!-- |
||
− | |||
+ | // $banner can either be "y"/"yes"/... or the name of the banner |
||
− | -->{{#if: {{{banner|}}}|<!-- |
||
− | -->{{#vardefine:__banner_name| |
+ | -->{{#vardefine:__banner_name|<!-- |
+ | -->{{#if:{{bool|{{{banner|}}}}}|{{{bannername|}}}|{{{banner|}}}}}<!-- |
||
+ | -->}}<!-- |
||
-->{{#vardefine:ni:banner|{{#var:__banner_name|{{#var:ni:name}} Banner}}}}<!-- |
-->{{#vardefine:ni:banner|{{#var:__banner_name|{{#var:ni:name}} Banner}}}}<!-- |
||
-->|<!-- |
-->|<!-- |
||
-->{{#if:{{{auto|}}}|<!-- |
-->{{#if:{{{auto|}}}|<!-- |
||
− | -->{{#if:{{#vardefineecho:__banner_id|{{#dplvar: |
+ | -->{{#if:{{#vardefineecho:__banner_id|{{#dplvar:ni:info:banner}}}}|<!-- |
-->{{#vardefine:ni:banner|{{ItemNameFromId|lang=en|{{#var:__banner_id}}}}}}<!-- |
-->{{#vardefine:ni:banner|{{ItemNameFromId|lang=en|{{#var:__banner_id}}}}}}<!-- |
||
-->}}<!-- |
-->}}<!-- |
||
-->}}<!-- |
-->}}<!-- |
||
-->}}<!-- |
-->}}<!-- |
||
+ | -------- |
||
− | money |
+ | ---- money ---- |
− | -->{{#ifeq:{{#dplvar: |
+ | -->{{#ifeq:{{#dplvar:ni:info:value}}|0|<!-- |
-->{{#vardefine:ni:auto_money_value|}}<!-- |
-->{{#vardefine:ni:auto_money_value|}}<!-- |
||
-->{{#vardefine:ni:auto_money_value_e|}}<!-- |
-->{{#vardefine:ni:auto_money_value_e|}}<!-- |
||
Zeile 377: | Zeile 282: | ||
-->{{#vardefine:ni:auto_money_value_m_pp|}}<!-- |
-->{{#vardefine:ni:auto_money_value_m_pp|}}<!-- |
||
-->|<!-- |
-->|<!-- |
||
− | -->{{#vardefine:ni:auto_money_value|{{#dplvar: |
+ | -->{{#vardefine:ni:auto_money_value|{{#dplvar:ni:info:value}}}}<!-- |
− | -->{{#vardefine:ni:auto_money_value_e|{{#dplvar: |
+ | -->{{#vardefine:ni:auto_money_value_e|{{#dplvar:ni:info:value_e}}}}<!-- |
− | -->{{#vardefine:ni:auto_money_value_e_hm|{{#dplvar: |
+ | -->{{#vardefine:ni:auto_money_value_e_hm|{{#dplvar:ni:info:value_e_hm}}}}<!-- |
− | -->{{#vardefine:ni:auto_money_value_e_pp|{{#dplvar: |
+ | -->{{#vardefine:ni:auto_money_value_e_pp|{{#dplvar:ni:info:value_e_pp}}}}<!-- |
− | -->{{#vardefine:ni:auto_money_value_m|{{#dplvar: |
+ | -->{{#vardefine:ni:auto_money_value_m|{{#dplvar:ni:info:value_m}}}}<!-- |
− | -->{{#vardefine:ni:auto_money_value_m_hm|{{#dplvar: |
+ | -->{{#vardefine:ni:auto_money_value_m_hm|{{#dplvar:ni:info:value_m_hm}}}}<!-- |
− | -->{{#vardefine:ni:auto_money_value_m_pp|{{#dplvar: |
+ | -->{{#vardefine:ni:auto_money_value_m_pp|{{#dplvar:ni:info:value_m_pp}}}}<!-- |
-->}}<!-- |
-->}}<!-- |
||
− | -->{{#vardefine:ni:money|{{{money|{{#if:{{#var:ni:auto_money_value|}}|<span class="money">{{#uesc: |
+ | -->{{#vardefine:ni:money|{{{money|{{#if:{{#var:ni:auto_money_value|}}|<span class="money">{{#uesc:<!-- |
+ | -->{{#invoke:Npcstat|format|prefix=y|lang={{lang|}}|hardmodeonly={{#var:ni:hardmodeonly}}|expertonly={{#var:ni:expertonly}}<!-- |
||
− | -->|<esc>{{coin|</esc>{{#var:ni:auto_money_value|}}<esc>}}</esc><!-- |
||
− | + | -->|<esc>{{coin|</esc>{{#var:ni:auto_money_value|}}<esc>}}</esc><!-- |
|
− | + | -->|<esc>{{coin|</esc>{{#var:ni:auto_money_value_e|}}<esc>}}</esc><!-- |
|
− | + | -->|<esc>{{coin|</esc>{{#var:ni:auto_money_value_e_hm|}}<esc>}}</esc><!-- |
|
− | + | -->|<esc>{{coin|</esc>{{#var:ni:auto_money_value_e_pp|}}<esc>}}</esc><!-- |
|
− | + | -->|<esc>{{coin|</esc>{{#var:ni:auto_money_value_m|}}<esc>}}</esc><!-- |
|
− | + | -->|<esc>{{coin|</esc>{{#var:ni:auto_money_value_m_hm|}}<esc>}}</esc><!-- |
|
+ | -->|<esc>{{coin|</esc>{{#var:ni:auto_money_value_m_pp|}}<esc>}}</esc><!-- |
||
− | -->}}}}</span>}}}}}}}<!-- |
||
+ | -->}}<!-- |
||
+ | -->}}</span>}}}}}}}<!-- |
||
-->{{#vardefine:ni:money1|{{{money1|}}}}}<!-- |
-->{{#vardefine:ni:money1|{{{money1|}}}}}<!-- |
||
-->{{#vardefine:ni:money2|{{{money2|}}}}}<!-- |
-->{{#vardefine:ni:money2|{{{money2|}}}}}<!-- |
||
-->{{#vardefine:ni:cargo:money|{{#var:ni:money|}}{{#var:ni:money2}}}}<!-- |
-->{{#vardefine:ni:cargo:money|{{#var:ni:money|}}{{#var:ni:money2}}}}<!-- |
||
+ | -------- |
||
+ | |||
+ | ---- sounds ---- |
||
+ | -->{{#arraydefine:ni:sounds|<!-- |
||
+ | -->{{#if:{{{soundhurt|{{#dplvar:ni:info:HitSound}}}}}|<!-- |
||
+ | -->normal@@{{l10n|npc_infobox|th_hurt}}@@{{{soundhurt|<!-- |
||
+ | -->{{#lstmap:{{#dplvar:ni:info:HitSound}}|,|$$$|$$$.wav|,}}<!-- |
||
+ | -->}}}<!-- |
||
+ | -->}}<!-- |
||
+ | -->{{#if:{{{soundkilled|{{#dplvar:ni:info:DeathSound}}}}}|<!-- |
||
+ | -->@@@@normal@@{{l10n|npc_infobox|th_killed}}@@{{{soundkilled|<!-- |
||
+ | -->{{#lstmap:{{#dplvar:ni:info:DeathSound}}|,|$$$|$$$.wav|,}}<!-- |
||
+ | -->}}}<!-- |
||
+ | -->}}<!-- |
||
+ | // l10n for very common and standard soundcaptions: |
||
+ | -->{{#vardefine:_soundcaption_Idle|{{l10n|npc_infobox|th_idle}}}}<!-- |
||
+ | -->{{#vardefine:_soundcaption_Attack|{{l10n|npc_infobox|th_attack}}}}<!-- |
||
+ | -->{{#vardefine:_soundcaption_Teleport|{{l10n|npc_infobox|th_teleport}}}}<!-- |
||
+ | -->{{#forargs:sound|k|v|<!-- |
||
+ | "@@" is the delimiter between mode, caption, and sound(s); "@@@@" the delimiter between array elements |
||
+ | -->{{#if:{{{soundcaption{{#var:k}}|}}}|<!-- |
||
+ | -->@@@@{{{soundmode{{#var:k}}|normal}}}<!-- |
||
+ | -->@@{{#var:_soundcaption_{{{soundcaption{{#var:k}}|}}}|{{{soundcaption{{#var:k}}|}}}}}<!-- |
||
+ | -->@@{{#var:v}}<!-- |
||
+ | -->}}<!-- |
||
+ | -->}}<!-- |
||
+ | -->|@@@@<!-- |
||
+ | -->}}<!-- |
||
+ | -->{{#arrayunique:ni:sounds}}<!-- removing empty and duplicate elements |
||
+ | -------- |
||
+ | |||
+ | |||
+ | +++++++++++++ 5. Process additional parameter input, unrelated to auto data +++++++++++++ |
||
+ | |||
+ | ---- images ---- |
||
+ | // all images: default auto main image filename is in {{#var:ni:imagename}} |
||
+ | // image 1 |
||
+ | -->{{#vardefine:ni:image1|{{{imagealt|<!-- |
||
+ | -->{{image|{{{image|{{#var:ni:imagename}}.png}}}|link=|size={{{imagesize|}}}}}<!-- |
||
+ | -->}}}}}<!-- |
||
+ | -->{{#if:{{#var:ni:image1}}||<!-- |
||
+ | // if there is no #var:ni:image1, then {{image}} failed, so use [[File:]] syntax as fallback |
||
+ | -->{{#vardefine:ni:image1|[[File:{{{image|{{#var:ni:imagename}}.png}}}|link=]]}}<!-- |
||
+ | -->}}<!-- |
||
+ | -->{{#vardefine:ni:image1text|}}<!-- |
||
+ | // image expert |
||
+ | -->{{#vardefine:imageexpert|{{{imageexpert|}}}}}<!-- |
||
+ | // init images 2 and 3 |
||
+ | -->{{#vardefine:ni:image2|{{{image2|}}}}}<!-- |
||
+ | -->{{#vardefine:ni:image2text|}}<!-- |
||
+ | -->{{#vardefine:ni:image3|{{{image3|}}}}}<!-- |
||
+ | -->{{#vardefine:ni:image3text|}}<!-- |
||
+ | // try to auto discover: _(old).png, _(old).gif if needed, but only in full mode |
||
+ | -->{{#ifeq:{{#var:imagemode}}|full|{{#ifeq:{{{image2|-unset}}}|{{{image2|unset-}}}||<!-- if $image2 is not set (excluding "|image2=<blank>") |
||
+ | -->{{#vardefine:_ni:imagenameold|<!-- set the name of the old image |
||
+ | -->{{#if:{{{image|}}}|<!-- |
||
+ | // remove the file extension, i.e. everything after the last period |
||
+ | // #rpos returns -1 if no period is found, so the length parameter for #sub should be 0 in that case |
||
+ | // (which causes the string to remain unchanged) |
||
+ | -->{{#sub:{{{image|}}}||{{max|{{#rpos:{{{image|}}}|.}}|0}}}}<!-- |
||
+ | -->|<!-- |
||
+ | -->{{#var:ni:imagename}}<!-- |
||
+ | -->}}<!-- |
||
+ | -->_(old)<!-- |
||
+ | -->}}<!-- |
||
+ | -->{{#vardefine:ni:image2|<!-- |
||
+ | // check .png |
||
+ | -->{{#ifexist:Media:{{#var:_ni:imagenameold}}.png|<!-- |
||
+ | -->{{#var:_ni:imagenameold}}.png<!-- |
||
+ | -->|<!-- |
||
+ | // if .png not found, check .gif |
||
+ | -->{{#ifexist:Media:{{#var:_ni:imagenameold}}.gif|{{#var:_ni:imagenameold}}.gif}}<!-- |
||
+ | -->}}<!-- |
||
+ | -->}}<!-- |
||
+ | -->}}}}<!-- |
||
+ | // init all variables |
||
+ | -->{{#dplvar:set<!-- |
||
+ | -->|d|t1|c|t1|o|t1|m|t1|3|t1<!-- set all versions to "t1" |
||
+ | -->|t1||t2||t3|<!-- set all tooltips to empty string |
||
+ | -->}}<!-- |
||
+ | // versions for image2 |
||
+ | -->{{#if:{{#var:ni:image2}}|<!-- |
||
+ | // $imageversion2 examples: "old,Console,Console-Mobile", any "platform-platform-platform" |
||
+ | -->{{#if:{{{imageversion2|}}}|<!-- |
||
+ | -->{{#dplvar:set|imageversion|{{lc:{{{imageversion2}}}}}}}<!-- |
||
+ | -->{{#if:{{#pos:{{#dplvar:imageversion}}|desktop}}|{{#dplvar:set|d|t2}}}}<!-- |
||
+ | -->{{#if:{{#pos:{{#dplvar:imageversion}}|console}}|{{#dplvar:set|c|t2}}}}<!-- |
||
+ | -->{{#if:{{#pos:{{#dplvar:imageversion}}|old-gen}}|{{#dplvar:set|o|t2}}}}<!-- |
||
+ | -->{{#if:{{#pos:{{#dplvar:imageversion}}|mobile}}|{{#dplvar:set|m|t2}}}}<!-- |
||
+ | -->{{#if:{{#pos:{{#dplvar:imageversion}}|3ds}}|{{#dplvar:set|3|t2}}}}<!-- |
||
+ | -->|<!-- |
||
+ | -->{{#dplvar:set|o|t2|3|t2}}<!-- no $imageversion2 specified, default to old versions |
||
+ | -->}}<!-- |
||
+ | -->}}<!-- |
||
+ | // versions for image3 |
||
+ | -->{{#if:{{#var:ni:image3}}|<!-- |
||
+ | // $imageversion3 examples: "old,Console,Console-Mobile", any "platform-platform-platform" |
||
+ | -->{{#if:{{{imageversion3|}}}|<!-- |
||
+ | -->{{#dplvar:set|imageversion|{{lc:{{{imageversion3|}}}}}}}<!-- |
||
+ | -->{{#if:{{#pos:{{#dplvar:imageversion}}|desktop}}|{{#dplvar:set|d|t3}}}}<!-- |
||
+ | -->{{#if:{{#pos:{{#dplvar:imageversion}}|console}}|{{#dplvar:set|c|t3}}}}<!-- |
||
+ | -->{{#if:{{#pos:{{#dplvar:imageversion}}|old-gen}}|{{#dplvar:set|o|t3}}}}<!-- |
||
+ | -->{{#if:{{#pos:{{#dplvar:imageversion}}|mobile}}|{{#dplvar:set|m|t3}}}}<!-- |
||
+ | -->{{#if:{{#pos:{{#dplvar:imageversion}}|3ds}}|{{#dplvar:set|3|t3}}}}<!-- |
||
+ | -->}}<!-- |
||
+ | -->}}<!-- |
||
+ | // image hovertexts (tooltips) |
||
+ | -->{{#if:{{#var:ni:image2}}{{#var:ni:image3}}|<!-- |
||
+ | // each version's dplvar now has an associated tooltip, so we now need to gather the versions of each tooltip |
||
+ | // example situation to demonstrate the following part: #dplvar:d="t1", #dplvar:c="t2", #dplvar:o="t2", #dplvar:m="t1", #dplvar:3="t2" |
||
+ | -->{{#dplvar:set|{{#dplvar:d}}|{{#dplvar:{{#dplvar:d}}}}/desktop}}<!-- e.g.: #dplvar:t1 := #dplvar:t1 + "/desktop" -> "/desktop" |
||
+ | -->{{#dplvar:set|{{#dplvar:c}}|{{#dplvar:{{#dplvar:c}}}}/console}}<!-- e.g.: #dplvar:t2 := #dplvar:t2 + "/console" -> "/console" |
||
+ | -->{{#dplvar:set|{{#dplvar:o}}|{{#dplvar:{{#dplvar:o}}}}/old-gen}}<!-- e.g.: #dplvar:t2 := #dplvar:t2 + "/old-gen" -> "/console/old-gen" |
||
+ | -->{{#dplvar:set|{{#dplvar:m}}|{{#dplvar:{{#dplvar:m}}}}/mobile}}<!-- e.g.: #dplvar:t1 := #dplvar:t1 + "/mobile" -> "/desktop/mobile" |
||
+ | -->{{#dplvar:set|{{#dplvar:3}}|{{#dplvar:{{#dplvar:3}}}}/3ds}}<!-- e.g.: #dplvar:t2 := #dplvar:t2 + "/3ds" -> "/console/old-gen/3ds" |
||
+ | // now each tooltip's dplvar has a defined set of versions which can easily be fed into {{versions}} |
||
+ | -->{{#if:{{#dplvar:t1}}|{{#vardefine:ni:image1text|{{versions|{{#dplvar:t1}}|mode=text|nl=yes}}}}}}<!-- |
||
+ | -->{{#if:{{#dplvar:t2}}|{{#vardefine:ni:image2text|{{versions|{{#dplvar:t2}}|mode=text|nl=yes}}}}}}<!-- |
||
+ | -->{{#if:{{#dplvar:t3}}|{{#vardefine:ni:image3text|{{versions|{{#dplvar:t3}}|mode=text|nl=yes}}}}}}<!-- |
||
+ | -->}}<!-- |
||
+ | // image other |
||
+ | -->{{#vardefine:ni:imageother|{{{imageother|}}}}}<!-- |
||
+ | // l10n for very common and standard imageothercaptions: |
||
+ | -->{{#vardefine:_imageothercaption_map icon|{{l10n|npc_infobox|map_icon}}}}<!-- |
||
+ | -->{{#vardefine:ni:imageothercaption|{{#var:_imageothercaption_{{lc:{{{imageothercaption|}}}}}|{{{imageothercaption|}}}}}}}<!-- |
||
+ | -------- |
||
+ | |||
+ | ---- buffs and debuffs ---- |
||
+ | -->{{#vardefine:ni:buffs|}}<!-- |
||
+ | -->{{#vardefine:ni:debuffs|}}<!-- |
||
+ | |||
+ | // loop: {{#var:bufftype}} is "buff" during first iteration and "debuff" during second iteration |
||
+ | // (buff and debuff handling is identical, only the names are different) |
||
+ | -->{{#loop:_i|0|2|{{#vardefine:bufftype|{{#ifexpr:{{#var:_i}}|de}}buff}}<!-- |
||
+ | // we have an ni:buffs and an ni:debuffs array ("ni:{{#var:bufftype}}s"), which hold the indices of all $de-/buff parameters |
||
+ | // the unindexed "|buff=" / "|debuff=" parameters are represented by "-1", which is always the first element of these arrays, if those parameters are set |
||
+ | -->{{#if:{{{ {{#var:bufftype}}|}}}|{{#vardefine:ni:{{#var:bufftype}}s|-1}}}}<!-- set first array element to -1 |
||
+ | -->{{#forargs:{{#var:bufftype}}|k|_|{{#if:{{isNumber|onlypositive=y|{{#var:k}}}}|<!-- for all parameters: if parameter name is "{de-/buff}<integer>" |
||
+ | -->{{#vardefine:ni:{{#var:bufftype}}s|{{#lstapp:{{#var:ni:{{#var:bufftype}}s}}|₪|{{#var:k}}}}}}<!-- then add buff index to de-/buffs array |
||
+ | -->}}}}<!-- |
||
+ | -->{{#vardefine:ni:{{#var:bufftype}}s|{{#lstsrt:{{#var:ni:{{#var:bufftype}}s}}|₪|₪|numeric}}}}<!-- sort parameter indices |
||
+ | -->{{#loop:i|1|{{#lstcnt:{{#var:ni:{{#var:bufftype}}s}}|₪}}|<!-- iterate over parameter indices |
||
+ | -->{{#vardefine:j|{{#lstelem:{{#var:ni:{{#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" |
||
+ | // we store the information that the view needs in variables with a "ni:<bufftype><parameter index>:<stat>" format |
||
+ | -->{{#vardefine:data_for_buffinfo_array|{{{ {{#var:bufftype}}{{#var:k}}|}}}}}<!-- |
||
+ | -->{{#vardefine:ni:{{#var:bufftype}}{{#var:j}}:mode|{{lc:{{#sub:{{#var:data_for_buffinfo_array}}|-7}}}}}}<!-- |
||
+ | -->{{#switch:{{#var:ni:{{#var:bufftype}}{{#var:j}}:mode}}<!-- |
||
+ | -->|#normal|#expert|#master|@normal|@expert|@master=<!-- |
||
+ | // if the last 7 characters of the ${de-/buff} parameter are one of the valid mode identifiers, |
||
+ | // then strip them from the data that will be used for the buffinfo array |
||
+ | -->{{#vardefine:data_for_buffinfo_array|{{#sub:{{#var:data_for_buffinfo_array}}|0|-7}}}}<!-- |
||
+ | -->|#default=<!-- |
||
+ | // if they aren't, then they do not hold valid mode information, so the variable must be reset |
||
+ | -->{{#vardefine:ni:{{#var:bufftype}}{{#var:j}}:mode|}}<!-- |
||
+ | // (and also don't strip them, but use the whole parameter value for the buffinfo array) |
||
+ | -->}}<!-- |
||
+ | -->{{#arraydefine:buffinfo|{{#var:data_for_buffinfo_array}}|/}}<!-- |
||
+ | -->{{#vardefine:ni:{{#var:bufftype}}{{#var:j}}:mobile|}}<!-- |
||
+ | // buff id |
||
+ | -->{{#vardefine:ni:{{#var:bufftype}}{{#var:j}}:id|{{{id{{#var:bufftype}}{{#var:k}}|<!-- |
||
+ | -->{{buffIdFromName|{{#arrayindex:buffinfo|0}}}}<!-- buffinfo[0] will always contain the de-/buff name, regardless of whether compact mode was used or not |
||
+ | -->}}}}}<!-- |
||
+ | -->{{#if:{{#var:ni:{{#var:bufftype}}{{#var:j}}:id}}|{{#ifeq:{{#sub:{{#var:ni:{{#var:bufftype}}{{#var:j}}:id}}|0|1}}|m|<!-- if is mobile id |
||
+ | -->{{#vardefine:ni:{{#var:bufftype}}{{#var:j}}:id|{{#sub:{{#var:ni:{{#var:bufftype}}{{#var:j}}:id}}|1}}}}<!-- |
||
+ | -->{{#vardefine:ni:{{#var:bufftype}}{{#var:j}}:mobile|m}}<!-- |
||
+ | -->}}}}<!-- |
||
+ | // de-/buff name |
||
+ | -->{{#vardefine:ni:{{#var:bufftype}}{{#var:j}}:name|<!-- |
||
+ | -->{{#if:{{#var:ni:{{#var:bufftype}}{{#var:j}}:id}}|<!-- |
||
+ | -->{{getBuffInfo|{{#var:ni:{{#var:bufftype}}{{#var:j}}:mobile}}{{#var:ni:{{#var:bufftype}}{{#var:j}}:id}}|ename}}<!-- |
||
+ | -->|<!-- |
||
+ | -->{{#arrayindex:buffinfo|0}}<!-- |
||
+ | -->}}<!-- |
||
+ | -->}}<!-- |
||
+ | // de-/buff duration and chance |
||
+ | -->{{#vardefine:ni:{{#var:bufftype}}{{#var:j}}:duration|{{{ {{#var:bufftype}}duration{{#var:k}}|{{#arrayindex:buffinfo|1}}}}}}}<!-- |
||
+ | -->{{#vardefine:ni:{{#var:bufftype}}{{#var:j}}:chance|{{{ {{#var:bufftype}}chance{{#var:k}}|{{#arrayindex:buffinfo|2}}}}}}}<!-- |
||
+ | // de-/buff tooltip |
||
+ | -->{{#vardefine:ni:{{#var:bufftype}}{{#var:j}}:tooltip|{{{ {{#var:bufftype}}tip{{#var:k}}|<!-- |
||
+ | -->{{getBuffInfo|{{#var:ni:{{#var:bufftype}}{{#var:j}}:mobile}}{{#var:ni:{{#var:bufftype}}{{#var:j}}:id}}|tooltip}}<!-- |
||
+ | -->}}}}}<!-- |
||
+ | // de-/buff link |
||
+ | -->{{#vardefine:ni:{{#var:bufftype}}{{#var:j}}:link|{{{ {{#var:bufftype}}link{{#var:k}}|<!-- |
||
+ | -->{{getBuffInfo|{{#var:ni:{{#var:bufftype}}{{#var:j}}:mobile}}{{#var:ni:{{#var:bufftype}}{{#var:j}}:id}}|page}}<!-- |
||
+ | -->}}}}}<!-- |
||
+ | // de-/buff vanity id |
||
+ | -->{{#vardefine:ni:{{#var:bufftype}}{{#var:j}}:idshow|{{{id{{#var:bufftype}}show{{#var:k}}|}}}}}<!-- |
||
+ | // de-/buff mode |
||
+ | // normalization: the mode var contains the "#expert"/"@master"/... syntax from the ${de-/buff} parameter, |
||
+ | // but the ${de-/buff}mode parameter contains the "expert"/"master"/"expertonly" syntax, |
||
+ | // so we transform the latter to the former |
||
+ | -->{{#vardefine:ni:{{#var:bufftype}}{{#var:j}}:mode|{{#switch:{{{ {{#var:bufftype}}mode{{#var:k}}|}}}<!-- |
||
+ | -->|expert=#expert|master=#master|expertonly=@expert<!-- |
||
+ | -->|#default={{{ {{#var:bufftype}}mode{{#var:k}}|{{#var:ni:{{#var:bufftype}}{{#var:j}}:mode}}}}}<!-- |
||
+ | -->}}}}<!-- |
||
+ | -->}}<!-- |
||
+ | -->}}<!-- |
||
+ | -------- |
||
− | drops |
+ | ---- drops ---- |
-->{{#vardefine:ni:drops|<!-- |
-->{{#vardefine:ni:drops|<!-- |
||
-->{{#vardefine:_item_small_snap|{{options|item|small}}}}{{options/set|item|small=y}}<!-- |
-->{{#vardefine:_item_small_snap|{{options|item|small}}}}{{options/set|item|small=y}}<!-- |
||
-->{{#vardefine:_eicons_small_snap|{{options|eicons|small}}}}{{options/set|eicons|small=y}}<!-- |
-->{{#vardefine:_eicons_small_snap|{{options|eicons|small}}}}{{options/set|eicons|small=y}}<!-- |
||
+ | |||
-->{{#vardefine:dropclass|}}<!-- |
-->{{#vardefine:dropclass|}}<!-- |
||
-->{{#dplvar:set<!-- |
-->{{#dplvar:set<!-- |
||
-->|_npc_infobox:trsbg|<!-- |
-->|_npc_infobox:trsbg|<!-- |
||
-->|_npc_infobox:group|0<!-- |
-->|_npc_infobox:group|0<!-- |
||
+ | -->|_npc_infobox:in_group|<!-- |
||
− | //every 3 unnamed arguments form a group. |
||
+ | // every 3 unnamed arguments form a group |
||
-->|_npc_infobox:group_arg_1|<!-- |
-->|_npc_infobox:group_arg_1|<!-- |
||
− | -->|_npc_infobox:group_arg_2|<!-- |
+ | -->|_npc_infobox:group_arg_2|<!-- |
+ | used in npc_infobox/drop, init |
||
+ | -->|_npc_infobox:in_loot|<!-- |
||
+ | -->|_npc_infobox:loot_source|<!-- |
||
-->}}<!-- |
-->}}<!-- |
||
− | //used in npc_infobox/drop, defined here for better performance |
+ | // used in npc_infobox/drop, defined here for better performance |
-->{{#vardefine:nidrop:nameraw|{{#var:ni:name}}}}<!-- |
-->{{#vardefine:nidrop:nameraw|{{#var:ni:name}}}}<!-- |
||
-->{{#vardefine:nidrop:name|<!-- |
-->{{#vardefine:nidrop:name|<!-- |
||
− | -->{{eil |
+ | -->{{eil|{{ROOTPAGENAME}}|{{tr|{{#var:ni:name}}}}|epage={{#var:npcnamefrompagename}}}}<!-- |
-->{{#if:{{#var:ni:namesub}}|{{note|block=y|paren=y|{{#var:ni:namesub}}}}}}<!-- |
-->{{#if:{{#var:ni:namesub}}|{{note|block=y|paren=y|{{#var:ni:namesub}}}}}}<!-- |
||
-->{{#if:{{#var:ni:namenote}}|{{note|block=y|paren=y|small=y|{{#var:ni:namenote}}}}}}<!-- |
-->{{#if:{{#var:ni:namenote}}|{{note|block=y|paren=y|small=y|{{#var:ni:namenote}}}}}}<!-- |
||
-->}}<!-- |
-->}}<!-- |
||
+ | // iterate over all unnamed parameters |
||
− | -->{{#vardefine:nidrop:cargo|{{{cargodrops|{{#var:cargo}}}}}}}<!-- |
||
− | |||
-->{{#fornumargs:i|v|<!-- |
-->{{#fornumargs:i|v|<!-- |
||
-->{{#ifexpr:{{#vardefineecho:_mod|{{#expr:{{#var:i}} mod 3}}}}|<!-- |
-->{{#ifexpr:{{#vardefineecho:_mod|{{#expr:{{#var:i}} mod 3}}}}|<!-- |
||
-->{{#dplvar:set|_npc_infobox:group_arg_{{#var:_mod}}|{{#var:v}}}}<!-- |
-->{{#dplvar:set|_npc_infobox:group_arg_{{#var:_mod}}|{{#var:v}}}}<!-- |
||
+ | -->|<!-- every three unnamed parameters, go into {{npc infobox/drop}} |
||
− | -->|<!-- |
||
− | -->{{npc infobox/drop<!-- |
+ | -->{{npc infobox/drop<!-- the values of named parameters ($A instead of $1) will be auto trimmed, which is more convenient |
-->|A={{#dplvar:_npc_infobox:group_arg_1}}<!-- |
-->|A={{#dplvar:_npc_infobox:group_arg_1}}<!-- |
||
-->|B={{#dplvar:_npc_infobox:group_arg_2}}<!-- |
-->|B={{#dplvar:_npc_infobox:group_arg_2}}<!-- |
||
Zeile 433: | Zeile 543: | ||
-->{{options/set|eicons|small={{#var:_eicons_small_snap}}}}<!-- |
-->{{options/set|eicons|small={{#var:_eicons_small_snap}}}}<!-- |
||
-->}}<!-- |
-->}}<!-- |
||
+ | -------- |
||
− | imageother: |
||
− | -->{{#vardefine:ni:imageother|{{{imageother|}}}}}<!-- |
||
− | -->{{#vardefine:ni:imageothercaption|{{#ifeq:{{{imageothercaption|}}}|Map Icon|{{l10n|npc_infobox|map_icon}}|{{{imageothercaption|}}}}}}}<!-- |
||
+ | +++++++++++++ 5. Categorize and store to cargo +++++++++++++ |
||
− | sounds: |
||
− | -->{{#arraydefine:ni:sounds|<!-- |
||
− | -->{{#if:{{{soundhurt|{{#dplvar:_npc_infobox:info:HitSound}}}}}|<!-- |
||
− | -->normal@@{{l10n|npc_infobox|th_hurt}}@@{{{soundhurt|<!-- |
||
− | -->{{#lstmap:{{#dplvar:_npc_infobox:info:HitSound}}|,|$$$|$$$.wav|,}}<!-- |
||
− | -->}}}<!-- |
||
− | -->}}<!-- |
||
− | -->{{#if:{{{soundkilled|{{#dplvar:_npc_infobox:info:DeathSound}}}}}|<!-- |
||
− | -->@@@@normal@@{{l10n|npc_infobox|th_killed}}@@{{{soundkilled|<!-- |
||
− | -->{{#lstmap:{{#dplvar:_npc_infobox:info:DeathSound}}|,|$$$|$$$.wav|,}}<!-- |
||
− | -->}}}<!-- |
||
− | -->}}<!-- |
||
+ | ---- determine validity of categorization ---- |
||
− | l10n for very common and standard soundcaptions: |
||
− | + | -->{{#vardefine:cate|}}<!-- |
|
− | + | -->{{#switch:{{{cate|}}}<!-- |
|
− | -->{{#vardefine: |
+ | -->|1|y|yes|true|force={{#vardefine:cate|y}}<!-- |
− | -->{{# |
+ | -->|0|n|no|false={{#vardefine:cate|}}<!-- |
+ | -->|#default=<!-- |
||
− | "@@" is the delimiter between mode, caption, and sound(s); "@@@@" the delimiter between array elements |
||
− | -->{{# |
+ | -->{{#ifeq:{{NAMESPACE}}|{{ns:0}}|<!-- only in main ns |
+ | -->{{#switch:{{#var:ni:viewmodename}}|infobox|table={{#vardefine:cate|y}}}}<!-- only cate for infobox/table view, no cate for void/item view |
||
− | -->@@@@{{{soundmode{{#var:k}}|normal}}}<!-- |
||
+ | -->}}<!-- |
||
− | -->@@{{#var:_soundcaption_{{{soundcaption{{#var:k}}|}}}|{{{soundcaption{{#var:k}}|}}}}}<!-- |
||
− | -->@@{{#var:v}}<!-- |
||
− | -->}}<!-- |
||
− | -->}}<!-- |
||
− | -->|@@@@<!-- |
||
-->}}<!-- |
-->}}<!-- |
||
+ | -------- |
||
− | -->{{#arrayunique:ni:sounds}}<!-- removing empty and duplicate elements |
||
− | ===== DATA END ====== |
||
+ | ---- categorize ---- |
||
− | ===== CATE & CARGO ====== |
||
+ | // note: printing the same category more than once is unnecessarily expensive, so we cache a category in its "cateset" variable |
||
− | |||
− | -->{{# |
+ | -->{{#if:{{#var:cate}}|<!-- |
+ | // allversions |
||
− | -->|y|yes|force=y<!-- |
||
+ | -->{{#if:{{#switch:{{lc:{{{allversions|}}}}}|y|yes|1|true=y|n|no|0|false=|#default=<!-- |
||
− | -->|n|no=<!--nothing |
||
− | -->|#default={{#ifeq:{{NAMESPACE}}|{{ns:0}}|<!-- only in main ns |
||
− | -->{{#switch:{{#var:ni:viewmodename}}|infobox|table=y}}<!-- only cate for infobox/table view, no cate for void/item view |
||
− | -->}}<!-- |
||
− | -->}}}}<!-- |
||
− | -->{{#if:{{#var:cate}}|<!-- cate note: printing the same category two or more times is unnecessarily expensive, so we cache a category in its "cateset" var |
||
− | -->{{#if:{{#switch:{{lc:{{{allversions|}}}}}|y|yes|true=y|n|no|false=|#default=<!-- |
||
-->{{#if:{{#var:ni:npcid}}|{{#if:{{eversions|{{#var:ni:name}}|raw=y}}|<!--not all versions-->|y}}}}<!-- auto detect: id exists and eversions is null |
-->{{#if:{{#var:ni:npcid}}|{{#if:{{eversions|{{#var:ni:name}}|raw=y}}|<!--not all versions-->|y}}}}<!-- auto detect: id exists and eversions is null |
||
− | -->}}|<!-- |
+ | -->}}|<!-- |
− | -->{{#if:{{#var:ni:cateset: |
+ | -->{{#if:{{#var:ni:cateset:allversions}}||<!-- |
− | -->{{#vardefine:ni:cateset: |
+ | -->{{#vardefine:ni:cateset:allversions|y}}<!-- |
+ | -->{{all versions}}<!-- |
||
-->}}<!-- |
-->}}<!-- |
||
-->}}<!-- |
-->}}<!-- |
||
+ | // environments |
||
− | -->{{#if:{{#var:ni:environment}}|<!-- |
||
− | + | -->{{#if:{{#var:ni:environment}}|{{#uesc:<!-- |
|
− | + | -->{{#lstmap:{{#var:ni:environment}}|/|$$$|<esc><!-- |
|
+ | -->{{#lstmap:$$$|+|@@@@|<!-- |
||
− | -->{{#lstmap:$$$|+|@@@@|{\{#if:{\{#var:ni:cateset:env:@@@@}\}\!\!{\{#vardefine:ni:cateset:env:@@@@\!y}\}{\{l10n\!npc_infobox\!cate_environment\!$env$=@@@@}\}\}\}|<!--no sep-->}}<!-- |
||
− | --> |
+ | -->{\{#if:{\{#var:ni:cateset:env:@@@@}\}\!\!<!-- |
− | -->}}<!-- |
+ | -->{\{#vardefine:ni:cateset:env:@@@@\!y}\}<!-- |
+ | -->{\{l10n\!npc_infobox\!cate_environment\!$env$=@@@@}\}<!-- |
||
− | -->}}<!-- |
||
+ | -->\}\}<!-- |
||
− | -->{{#if:{{#var:ni:type}}|{{#if:{{#var:ni:cateset:type:{{#var:ni:type}}}}||<!-- |
||
+ | -->|<!--no sep-->}}<!-- |
||
− | -->{{#vardefine:ni:cateset:type:{{#var:ni:type}}|y}}{{l10n|npc_infobox|cate_type|$type$={{#var:ni:type}}}}<!-- |
||
− | + | --></esc>|<!--no sep-->}}<!-- |
|
− | -->{{#if:{{#var:ni:type2}}|{{#if:{{#var:ni:cateset:type:{{#var:ni:type2}}}}||<!-- |
||
− | -->{{#vardefine:ni:cateset:type:{{#var:ni:type2}}|y}}{{l10n|npc_infobox|cate_type|$type$={{#var:ni:type2}}}}<!-- |
||
− | -->}}}}<!-- |
||
− | -->{{#if:{{#var:ni:type3}}|{{#if:{{#var:ni:cateset:type:{{#var:ni:type3}}}}||<!-- |
||
− | -->{{#vardefine:ni:cateset:type:{{#var:ni:type3}}|y}}{{l10n|npc_infobox|cate_type|$type$={{#var:ni:type3}}}}<!-- |
||
-->}}}}<!-- |
-->}}}}<!-- |
||
+ | // types |
||
+ | -->{{#if:{{#var:ni:types}}|<!-- |
||
+ | -->{{#lstmap:{{#var:ni:types}}|/|@@@@|<esc><!-- |
||
+ | -->{{#if:{{#var:ni:cateset:type:@@@@}}||<!-- |
||
+ | -->{{#vardefine:ni:cateset:type:@@@@|y}}<!-- |
||
+ | -->{{l10n|npc_infobox|cate_type|$type$=@@@@}}<!-- |
||
+ | -->}}<!-- |
||
+ | --></esc>|}}<!-- |
||
+ | -->}}<!-- |
||
+ | // ai |
||
-->{{#if:{{#var:ni:ai}}|{{#if:{{#var:ni:cateset:ai:{{#var:ni:ai}}}}||<!-- |
-->{{#if:{{#var:ni:ai}}|{{#if:{{#var:ni:cateset:ai:{{#var:ni:ai}}}}||<!-- |
||
− | -->{{#vardefine:ni:cateset:ai:{{#var:ni:ai}}|y |
+ | -->{{#vardefine:ni:cateset:ai:{{#var:ni:ai}}|y}}<!-- |
+ | -->{{l10n|npc_infobox|cate_ai|$ai$={{#var:ni:ai}}}}<!-- |
||
-->}}}}<!-- |
-->}}}}<!-- |
||
+ | // listcats |
||
− | -->{{#if:{{#var:ni:listcat}}|{{#if:{{#var:ni:cateset:listcat:{{#var:ni:listcat}}}}||<!-- |
||
+ | -->{{#if:{{#var:ni:listcats}}|<!-- |
||
− | -->{{#vardefine:ni:cateset:listcat:{{#var:ni:listcat}}|y}}{{l10n|npc_infobox|cate_listcat|$listcat$={{#var:ni:listcat}}}}<!-- |
||
+ | -->{{#lstmap:{{#var:ni:listcats}}|/|@@@@|<esc><!-- |
||
− | -->}}}}<!-- |
||
− | + | -->{{#if:{{#var:ni:cateset:listcat:@@@@}}||<!-- |
|
− | -->{{#vardefine:ni:cateset:listcat: |
+ | -->{{#vardefine:ni:cateset:listcat:@@@@|y}}<!-- |
+ | -->{{l10n|npc_infobox|cate_listcat|$listcat$=@@@@}}<!-- |
||
− | -->}}}}<!-- |
||
+ | -->}}<!-- |
||
− | -->{{#if:{{#var:ni:listcat3}}|{{#if:{{#var:ni:cateset:listcat:{{#var:ni:listcat3}}}}||<!-- |
||
+ | --></esc>|}}<!-- |
||
− | -->{{#vardefine:ni:cateset:listcat:{{#var:ni:listcat3}}|y}}{{l10n|npc_infobox|cate_listcat|$listcat$={{#var:ni:listcat3}}}}<!-- |
||
− | --> |
+ | -->}}<!-- |
+ | // hardmode and expert mode |
||
− | -->{{#if:{{{hardmode|}}}|{{#if:{{#var:ni:cateset:hardmode}}||<!-- |
||
− | + | -->{{#if:{{#var:ni:hardmodeonly}}|{{#if:{{#var:ni:cateset:hardmode}}||<!-- |
|
+ | -->{{#vardefine:ni:cateset:hardmode|y}}<!-- |
||
+ | -->{{l10n|npc_infobox|cate_hardmode|$type$={{#lstelem:{{#var:ni:types}}|/|1}}}}<!-- |
||
-->}}}}<!-- |
-->}}}}<!-- |
||
− | -->{{#if:{{ |
+ | -->{{#if:{{#var:ni:expertonly}}|{{#if:{{#var:ni:cateset:expertonly}}||<!-- |
− | -->{{#vardefine:ni:cateset:expertonly|y |
+ | -->{{#vardefine:ni:cateset:expertonly|y}}<!-- |
+ | -->{{l10n|npc_infobox|cate_expertonly|$type$={{#lstelem:{{#var:ni:types}}|/|1}}}}<!-- |
||
-->}}}}<!-- |
-->}}}}<!-- |
||
-->}}<!-- |
-->}}<!-- |
||
+ | -------- |
||
− | + | ---- store to cargo ---- |
|
-->{{#if:{{#var:cargo}}|<!-- |
-->{{#if:{{#var:cargo}}|<!-- |
||
− | -->{{#lstmap:{{{idcargo|{{#var: |
+ | -->{{#lstmap:{{{idcargo|{{#var:ni:auto_id|{{{id|}}}}}}}}|,|@@@@|<!-- |
− | --> |
+ | -->\{\{#cargo_store:_table=NPCs<!-- |
− | --> |
+ | -->\!name=<!-- |
− | + | -->{{eil|{{ROOTPAGENAME}}|{{tr|{{#var:ni:name}}}}|epage={{#var:npcnamefrompagename}}}}<!-- |
|
− | + | -->{{#if:{{#var:ni:namesub}}|{{note|block=y|paren=y|{{#var:ni:namesub}}}}}}<!-- |
|
− | -->| |
+ | -->{{#if:{{#var:ni:namenote}}|{{note|block=y|paren=y|small=y|{{#var:ni:namenote}}}}}}<!-- |
+ | -->\!nameraw={{#var:ni:name}}<!-- |
||
− | -->|image=</esc><span class="npcimg">{{{imagecargo|{{{imagealt|[[File:{{{image|{{#var:ni:imagename}}.png}}}|link=]]}}}}}}</span><esc><!-- |
||
− | --> |
+ | -->\!image=<span class="npcimg">{{{imagecargo|{{{imagealt|[[File:{{{image|{{#var:ni:imagename}}.png}}}|link=]]}}}}}}</span><!-- |
− | --> |
+ | -->\!environment={{#var:ni:environment}}<!-- |
− | --> |
+ | -->\!ai={{#var:ni:ai}}<!-- |
− | --> |
+ | -->\!damage={{npc infobox/strip|{{#var:ni:damage}}}}<!-- |
− | --> |
+ | -->\!life={{npc infobox/strip|{{#var:ni:lifemax}}}}<!-- |
− | --> |
+ | -->\!defense={{npc infobox/strip|{{#var:ni:defense}}}}<!-- |
− | --> |
+ | -->\!knockback={{npc infobox/strip|{{#var:ni:knockback}}}}<!-- |
− | --> |
+ | -->\!bannername={{#var:ni:banner}}<!-- |
− | --> |
+ | -->\!banner={{#if:{{#var:ni:banner}}|{{item|{{#var:ni:banner}}|wrap=y}}}}<!-- |
− | --> |
+ | -->\!money={{#var:ni:cargo:money}}<!-- |
+ | -->\!npcid=@@@@<!-- |
||
− | -->|immunities=</esc>{{#var:ni:cargo:immunities}}<esc><!-- |
||
− | -->}} |
+ | -->\!immunities={{#var:ni:cargo:immunities}}<!-- |
+ | -->\}\}<!-- |
||
-->}}<!-- |
-->}}<!-- |
||
− | //since enemy banners |
+ | // since the enemy banners are too many, we can't store them all in the "Banners (enemy)" page, so we store them here |
-->{{#if:{{#var:__banner_id}}|{{#if:{{#var:ni:_banner_id_is_stored:{{#var:__banner_id}}}}||<!-- |
-->{{#if:{{#var:__banner_id}}|{{#if:{{#var:ni:_banner_id_is_stored:{{#var:__banner_id}}}}||<!-- |
||
− | -->{{#vardefine:ni:_banner_id_is_stored:{{#var:__banner_id}}|y}}<!-- |
+ | -->{{#vardefine:ni:_banner_id_is_stored:{{#var:__banner_id}}|y}}<!-- store the same banner only once per page |
-->{{item infobox| view=void | auto = {{#var:__banner_id}}<!-- |
-->{{item infobox| view=void | auto = {{#var:__banner_id}}<!-- |
||
− | -->| buffid = {{#ifexpr:(({{#var:__banner_id}} > 3836) AND ({{#var:__banner_id}} <3847))||147}}<!-- |
+ | -->| buffid = {{#ifexpr:(({{#var:__banner_id}} > 3836) AND ({{#var:__banner_id}} < 3847))||147}}<!-- |
− | -->| type = Furniture | width = 1 | height = 3 | tags = drop / enemy banner | hardmode = {{ |
+ | -->| type = Furniture | width = 1 | height = 3 | tags = drop / enemy banner | hardmode = {{#var:ni:hardmodeonly}}<!-- |
-->}}<!-- |
-->}}<!-- |
||
-->}}}}<!-- |
-->}}}}<!-- |
||
− | |||
-->}}<!-- |
-->}}<!-- |
||
+ | |||
− | ===== OUTPUT VIEW ====== |
||
+ | |||
− | select view base on viewmodename. e.g. mode=table means {{npc infobox/tableView}}, default is {{ infobox/infoboxView}} |
||
+ | ========================================================================================================================== |
||
+ | ============================================= DATA VIEW ============================================== |
||
+ | ========================================================================================================================== |
||
+ | |||
+ | |||
+ | // select view based on viewname, e.g. "|mode=table" means {{npc infobox/tableView}}, default is {{npc infobox/infoboxView}} |
||
-->{{npc infobox/{{#var:ni:viewmodename}}View}}<!-- |
-->{{npc infobox/{{#var:ni:viewmodename}}View}}<!-- |
||
--></includeonly><!-- |
--></includeonly><!-- |
||
− | --><noinclude> |
+ | --><noinclude><!-- |
+ | |||
+ | --> |
||
* {{#cargo_declare:_table=NPCs |
* {{#cargo_declare:_table=NPCs |
||
− | |name=Wikitext (size=1000) |
+ | | name = Wikitext (size=1000) |
− | |nameraw=String |
+ | | nameraw = String |
− | |image=Wikitext |
+ | | image = Wikitext |
− | |environment=String |
+ | | environment = String |
− | |ai=String |
+ | | ai = String |
− | |damage=Wikitext (size=2500) |
+ | | damage = Wikitext (size=2500) |
− | |life=Wikitext (size=2000) |
+ | | life = Wikitext (size=2000) |
− | |defense=Wikitext (size=1000) |
+ | | defense = Wikitext (size=1000) |
− | |knockback=Wikitext (size=1000) |
+ | | knockback = Wikitext (size=1000) |
− | |banner=Wikitext (size=1000) |
+ | | banner = Wikitext (size=1000) |
− | |bannername=String |
+ | | bannername = String |
− | |money=Wikitext (size=1000) |
+ | | money = Wikitext (size=1000) |
− | |npcid=Integer |
+ | | npcid = Integer |
− | |immunities=List (^) of String |
+ | | immunities = List (^) of String |
}} |
}} |
||
− | * {{#cargo_attach:_table=Items}}<!-- for enemy banners |
+ | * {{#cargo_attach:_table=Items}}<!-- for enemy banners --> |
− | {{i18n-ready}}{{doc}} |
+ | {{i18n-ready}}{{lua|Npcinfo}}{{doc}} |
+ | {{category|Npc infobox| }} |
||
+ | {{language info|en=Template:Npc infobox}} |
||
+ | </noinclude> |
Aktuelle Version vom 8. März 2022, 00:33 Uhr
- Diese Vorlage definiert die Tabelle „NPCs“. Tabelle ansehen.
- Diese Vorlage fügt Zeilen zur Tabelle „Items“ hinzu, die von der Vorlage Item infobox definiert wird. Tabelle ansehen.
Infobox-Vorlage zur Verwendung in allen NPC-Artikeln. Wird an den Anfang der Seite gesetzt und bietet einen knappen Überblick über die wichtigsten Informationen.
Alle Parameter sind optional. Wird {{nameen}}
jedoch nicht spezifiziert und existiert kein Eintrag im Wörterbuch, sollte er mit angegeben werden.
Verwendung
Parameter | Description | Auto | Example | Default value (if omitted) |
Note |
---|---|---|---|---|---|
{{npc infobox
| |||||
Boxbezogene Parameter | |||||
| boxwidth |
Breite der Infobox | 27em |
Zahl mit Einheit. Der Rahmen wird standardmäßig an die Breite der Bilder angepasst. | ||
| float |
Position der Infobox | left |
right |
||
| css or | style |
CSS style, der die gesamte Infobox betrifft | Jede oder Eigenschaft, die hier definiert wird, überschreibt die Parameter und der Vorlage.
| |||
| tab or | tabs |
Umschalten der Schwierigkeitsregisterkarten |
|
Die Registerkarten Classic/Expert/Master werden nicht für Haus-NPCs, Tiere, Einrichtungsgegenstände, und exklusive Varianten verwendet, sondern für alle anderen NPCs. Dieser Parameter setzt diese Standardkonfiguration außer Kraft. | ||
| auto |
Ermöglicht automatische Daten | 201 |
Kann auch sein (siehe notes oben).
| ||
| id |
ID des NPC | ✓ | 201 |
Kosmetische ID, die angezeigt werden soll; überschreibt die Anzeige von und .
| |
| name |
Name des NPC | ✓ | Skeleton |
<page name> |
Wird als Überschrift der Infobox angezeigt. |
| name2 |
Kosmetischer Zusatz zum Namen |   / {{expert|Lunatic Cultist}} |
Wird direkt an angehängt.
| ||
| namesub |
Name Unter-Überschrift | ✓ | Zusätzliche Informationen direkt unter dem Titel der Infobox. Hauptsächlich interne NPC-Variantennamen, wie .
| ||
| namesub2 |
Name Unter-Überschrift | First Form |
Zusätzliche Informationen direkt unter dem Titel der Infobox oder unter . Soll als manueller verwendet werden, da das manuelle Setzen von auf etwas die automatische Anzeige verhindern würde.
| ||
| namenote |
Name Unter-Unterüberschrift | ✓ | Wird unter angezeigt / angezeigt. Hauptsächlich NPC-Variantenbeschreibungen, wie .
| ||
| variant |
Hinweis zur Plattformexklusivität | yes |
Zeigt einen Hinweis am oberen Rand der Infobox an, der über die Old-gen-Konsolen- und -Version-Exklusivität des NPCs informiert. | ||
| expertonly |
Expert-Exklusiv des NPC | yes |
Entfernt die Registerkarte "Classic" und zeigt die folgende Zeile unter dem Titel an / / / : (Experten-Modus-exklusiv)
| ||
| masteronly |
Master-Exklusiv des NPC | yes |
Entfernt die Registerkarte "Classic" und "Experte" und zeigt die folgende Zeile unter dem Titel an / / / : (Meister-Modus-exklusiv)
| ||
Image-related parameters | |||||
| imagealt |
Complete custom control over the display of the first image | [[File:Skeleton.png]] |
Overrides the and parameters. Multiple images can be provided and/or text and other formatting.
| ||
| image |
Main image of the NPC | Skeleton.png |
$namesub.png or $name.png |
This is the image that is stored to cargo by default. | |
| imagesize |
Size of the main image | 40x20px*0.75 |
*1 |
Corresponds to the parameter of {{image}}: <width>x<height>*<scale>
| |
| imageexpert |
Image of the Expert variant | Skeleton.png |
|||
| image2 |
Additional image | Skeleton.png |
Default value: <$image without ".png">_(old).png / .gif . Leave it empty to disable this automatic old image discovering.
| ||
| imagemode |
Controls image display | full |
Setting it to anything other than prevents the automatic display of .
| ||
| image3 |
Additional image | Skeleton.png |
|||
| imageversion2 |
Exclusive versions of
|
desktop-console |
old-gen-3ds |
Versions that will be displayed when hovering over (by default the one, so the "old" versions are the default). Valid values are , , , , and .
| |
| imageversion3 |
Exclusive versions of
|
desktop-console |
Versions that will be displayed when hovering over . Valid values are the same as for .
| ||
| imageother |
Additional, visually separated image | Map Icon Skeletron.png |
Will be displayed underneath all other images, above the statistics, separated by a horizontal line at the bottom of the infobox. Usually used for map icons or sprites of NPCs' temporary states (e.g. the "rolling" state of the Sroller). Can be a slash-separated ( ) list for multiple images.
| ||
| imageothercaption |
Caption of
|
Rolling state |
Will be displayed underneath . Has no effect if is not set. Is not mandatory; the image will also be displayed if the caption is omitted.
| ||
Statistics-related parameters | |||||
| type (deprecated: | type2 ,| type3 ) |
Classification and categorization | Boss |
Enemy |
Broad classifications like "Flying Enemy", "Critter", etc. Separate multiple values with a slash ( ). All types will be linked, if the respective page exists.
| |
| environment (deprecated: | environment2 ,| environment3 ) |
Native environment of the NPC | Desert Forest+Rain Desert / Forest Desert / Forest+Rain |
Biome in which or event during which the NPC naturally spawns. All environments will be linked if the respective page exists. A plus ( ) means "AND" and a slash ( ) means "OR".
The | ||
| ai |
AI style of the NPC | ✓ | Fighter AI |
||
| damage |
Damage | ✓ | |||
| damage2 |
Addition to the damage | Will be directly appended to . Can be used, for instance, for differentiation between different attacks of the NPC or different platforms.
| |||
| life |
Maximum health of the NPC | ✓ | |||
| life2 |
Addition to the maximum health | Will be directly appended to .
| |||
| defense |
Defense of the NPC | ✓ | |||
| defense2 |
Addition to the defense | Will be directly appended to .
| |||
| knockback |
Resistance to knockback of the NPC | ✓ | |||
| knockback2 |
Addition to the knockback resistance | Will be directly appended to .
| |||
| banner |
Banner of the NPC | ✓ | yes |
Setting it to will cause it to take as the banner name, but it can also simply be set to the name of the banner.
Note that, if using | |
| immune (deprecated: | immune1 | immune2 ... | immune<n> ) |
Debuffs to which the NPC is immune | ✓ | Poisoned / Frostburn |
The /etc. parameters are deprecated, instead use only the parameter. Separate multiple debuff names with a slash ( ).
All immunity-related information will only be displayed if | |
| immuneall |
Immunity to all debuffs | ✓ | yes |
All immunity-related information will only be displayed if does not contain , , and .
| |
| immuneallnotwhips |
Immunity to all debuffs except whip debuffs | ✓ | yes |
||
| immuneallnote or | immunenote |
Addition to /
|
Will be directly appended to the text that is displayed if / is set.
Example: All immunity-related information will only be displayed if | |||
Buff- & Debuff-related parameters | |||||
| buff |
Buff that the NPC causes | ✗ | Dryad's Blessing |
Name of the buff. As a shortcut for , , and , they can be appended to this value, separated with a slash: | buff = <name> / <duration> / <chance> <mode> . Chance and mode may also be omitted, and only the standard mode values[1] are allowed.
Examples:
| |
| idbuff |
Buff ID | ✓ | |||
| bufflink |
Buff link target | ✓ | |||
| bufftip |
Buff tooltip | ✓ | |||
| buffchance |
Buff chance | ✗ | |||
| buffduration |
Buff duration | ✗ | Enter the value using the {{duration}} template. | ||
| buffmode |
Mode-exclusivity of the buff | ✗ | Can be one of the standard mode options[1] or , , or . The buff will only be displayed in the respective tab(s). By default, it will be displayed in all three tabs.
| ||
| buffidshow |
Vanity buff ID | ||||
| buff<n> |
Additional buff that the NPC causes | 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 | ||||
| buffmode<n> |
Mode-exclusivity | ||||
| buffidshow<n> |
Vanity buff ID | ||||
| debuff |
Debuff that the NPC inflicts | ✗ | See above. Debuffs and buffs are handled identically. | ||
| iddebuff |
Debuff ID | ✓ | |||
| debufflink |
Debuff link target | ||||
| debufftip |
Debuff tooltip | ✓ | |||
| debuffchance |
Debuff chance | ✗ | |||
| debuffduration |
Debuff duration | ✗ | |||
| debuffmode |
Mode-exclusivity of the debuff | ✗ | |||
| debuffidshow |
Vanity debuff ID | ||||
| debuff<n> |
Additional debuff that the NPC causes | 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 | ||||
| debuffmode<n> |
Mode-exclusivity | ||||
| debuffidshow<n> |
Vanity debuff ID | ||||
Drop-related parameters | |||||
| money |
Base amount of money that the NPC drops | ✓ | {{coin|3gc 80sc}} |
Use the {{Vorlage:Nslink}} template. | |
| money2 |
Addition to dropped money | Will be directly appended to .
| |||
| <item name 1>
...
|
Dropped item | ✗ | |Gel|2–5|{{modes|75%|100%}}
|
Note that these are unnamed parameters, i.e., they are not used with an equals sign (= ) like the other parameters.
| |
|:group:start
...
|
Group of dropped items | |:group:start|Only one of the following 4 will drop|@normal
...
|
Note that these are unnamed parameters, i.e., they are not used with an equals sign (= ) like the other parameters.
| ||
|:loot:start
...
|
Subgroup of a dropped item | Note that these are unnamed parameters, i.e., they are not used with an equals sign (= ) like the other parameters.
All items inside the section will be stored to cargo with the name of the item directly above the section, instead of the name of the NPC as usual. For example, preceding a loot section on Wall of Flesh that contains the Demon Heart with Treasure Bag (Wall of Flesh) will store the dropping entity of the Demon Heart as "Treasure Bag (Wall of Flesh)" instead of "Wall of Flesh", as would be the case with all items outside the loot section. | |||
| custom:<raw item name(s)> |
Custom dropped item | Note that these are unnamed parameters, i.e., they are not used with an equals sign (= ) like the other parameters.
| |||
Sound-related parameters | |||||
| soundhurt |
Hurt sound effect | ✓ | NPC_Hit_1.wav |
Can be a comma-separated list for multiple sounds. Caption is "Getroffen". Set to an empty value (|soundhurt= ) to hide the automatically generated sounds.
| |
| soundkilled |
Killed sound effect | ✓ | NPC_Killed_1.wav |
Can be a comma-separated list for multiple sounds. Caption is "Getötet". Set to an empty value (|soundkilled= ) to hide the automatically generated sounds.
| |
| sound1 |
Custom additional sound effect | Can be a comma-separated list for multiple sounds. | |||
| soundcaption1 |
Caption for the sound effect | ||||
| soundmode1 |
Mode-exclusivity of the sound effect |
|
Can be , , or . The sound(s) will only be displayed in the respective tab (both Expert and Master if set to ). By default, a sound will be displayed in all three tabs.
| ||
| sound2 |
Custom additional sound effect | See above. These parameters behave in the exact same manner. | |||
| soundcaption2 |
Caption for the sound effect | ||||
| soundmode2 |
Mode-exclusivity of 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 | ||||
| soundmode<n> |
Mode-exclusivity of the sound effect | ||||
Back-end-related parameters | |||||
| cate |
Toggles all categorization | ✗ | no |
Set to to force categorization when it is disabled by default (on non-mainspace pages). Set to to disable categorization.
| |
| listcat (deprecated: | listcat2 ) |
Categorization | ✗ | Supplemental category names (Category:<$listcat> NPCs ). Separate multiple with a slash ( ).
Note: The template mainly categorizes the page based on the | ||
| allversions |
Platform version availability | ✓ |
|
Set to to assert that the NPC is available on all platforms of Terraria. This is only to be used if no {{exclusive}} banner is on the page. If omitted, it will be detected automatically based on the result of {{eversions|<NPC name>}} (even though might not be set!). Categorizes the page in all five version content categories (with the exception of Category:Japanese console content), if is determined.
| |
| hardmode |
Hardmode-exclusivity | ✗ | yes |
Set to to assert that the NPC is not available in pre-Hardmode, but only becomes available in Hardmode. Categorizes the page in Category:Hardmode-only NPCs.
| |
| cargo |
Toggles cargo data storage | ✗ | no |
Set to to force cargo data storage when it is disabled by default (on non-mainspace root pages[2]). Set to to disable cargo data storage.
| |
| cargodrops |
Toggles drops cargo data storage | ✗ | no |
By default, dropped item data will be stored to cargo if , i.e., main cargo data storage, is enabled. Use this parameter to override that.
A frequently used example is in cases where an enemy with multiple parts, e.g. a worm, does not store its main infobox data to cargo (since only the individual parts should be stored), but contains the drop information in the main infobox, which should be stored to cargo. | |
| idcargo |
NPC ID to store to cargo | ✗ | 201 |
Can be a comma-separated list. Can also be left empty to prevent cargo storage as well. | |
| imagecargo |
NPC image to store to cargo | ✗ | [[File:Skeleton.png]] |
Define an image to store to cargo, completely overriding the image parameters. |
Subpages
There are numerous supplemental subpages which are mainly used for formatting certain data:
- Vorlage:Npc infobox/AI
- Vorlage:Npc infobox/Dokumentation
- Vorlage:Npc infobox/cate
- Vorlage:Npc infobox/cate/environment
- Vorlage:Npc infobox/customView
- Vorlage:Npc infobox/drop
- Vorlage:Npc infobox/environment
- Vorlage:Npc infobox/infoboxView
- Vorlage:Npc infobox/initOptions
- Vorlage:Npc infobox/knockback
- Vorlage:Npc infobox/l10n
- Vorlage:Npc infobox/modestat
- Vorlage:Npc infobox/namedb
- Vorlage:Npc infobox/namedb-cs
- Vorlage:Npc infobox/namedb-da
- Vorlage:Npc infobox/namedb-de
- Vorlage:Npc infobox/namedb-en
- Vorlage:Npc infobox/namedb-es
- Vorlage:Npc infobox/namedb-fr
- Vorlage:Npc infobox/namedb-ja
- Vorlage:Npc infobox/namedb-pt
- Vorlage:Npc infobox/namedb-tr
- Vorlage:Npc infobox/namedb-vi
- Vorlage:Npc infobox/namedb-zh
- Vorlage:Npc infobox/npcToBannerItemId
- Vorlage:Npc infobox/options
- Vorlage:Npc infobox/stat
- Vorlage:Npc infobox/strip
- Vorlage:Npc infobox/tableView
- Vorlage:Npc infobox/tableView/damage
- Vorlage:Npc infobox/tableView/damageBlock
- Vorlage:Npc infobox/tableView/defense
- Vorlage:Npc infobox/tableView/defenseBlock
- Vorlage:Npc infobox/tableView/drops
- Vorlage:Npc infobox/tableView/health
- Vorlage:Npc infobox/tableView/healthBlock
- Vorlage:Npc infobox/tableView/item
- Vorlage:Npc infobox/tableView/kbresist
- Vorlage:Npc infobox/tableView/kbresistBlock
- Vorlage:Npc infobox/tableView/money
- Vorlage:Npc infobox/tableView/moneyBlock
- Vorlage:Npc infobox/tableView/npcid
- Vorlage:Npc infobox/tableView/variant
- Vorlage:Npc infobox/tableend
- Vorlage:Npc infobox/tablestart
- Vorlage:Npc infobox/testView
- Vorlage:Npc infobox/voidView
See also
- {{item infobox}}
Footnotes
- ↑ 1,0 1,1 1,2
The following values are available:
– Classic Mode only@normal
– Expert Mode only@expert
– Master Mode only@master
– Classic and Expert Mode only#normal
– Expert and Master Mode only#expert
- ↑ A root page is a page that is not a subpage. This prevents language subpages from storing duplicates by default.