Template:Infobox fish: Difference between revisions
Appearance
imported>Nebulous Maestress add nopricebonus parameter; fix formatting of roe links |
imported>Nebulous Maestress Revamp: new translation support, add roe, new templates, etc. |
||
| Line 1: | Line 1: | ||
<includeonly><div id="infoboxborder"> | <includeonly><!-- | ||
// TRANSLATIONS | |||
-->{{#arraydefine:$lang_information | Information }}<!-- | |||
-->{{#arraydefine:$lang_foundin | Found in }}<!-- | |||
-->{{#arraydefine:$lang_time | Time of Day }}<!-- | |||
-->{{#arraydefine:$lang_season | Season }}<!-- | |||
-->{{#arraydefine:$lang_weather | Weather }}<!-- | |||
-->{{#arraydefine:$lang_difficulty | Difficulty }}<!-- | |||
-->{{#arraydefine:$lang_behavior | Behavior }}<!-- | |||
-->{{#arraydefine:$lang_behaviorlink | Fish#Behavior }}<!-- | |||
-->{{#arraydefine:$lang_levelrequired | Level Required }}<!-- | |||
-->{{#arraydefine:$lang_fishing | Fishing }}<!-- | |||
-->{{#arraydefine:$lang_fishsize | Size (inches)}}<!-- | |||
-->{{#arraydefine:$lang_xp | XP}}<!-- | |||
-->{{#arraydefine:$lang_healingeffect | Healing Effect }}<!-- | |||
-->{{#arraydefine:$lang_roe | Roe }}<!-- | |||
-->{{#arraydefine:$lang_agedroe | Aged Roe }}<!-- | |||
-->{{#arraydefine:$lang_caviar | Caviar }}<!-- | |||
-->{{ParseInputValues|code=behav|| | |||
,Mixed, | |||
,Smooth, | |||
,Sinker, | |||
,Floater, | |||
,Dart, | |||
}}{{ParseInputValues|code=legend|| | |||
,Crimsonfish, | |||
,Angler, | |||
,Legend, | |||
,Glacierfish, | |||
,Mutant Carp, | |||
}}<!-- | |||
// set usemetric to true (or any nonempty value) if metric units should be used for fish size | |||
-->{{#arraydefine:$lang_usemetric |}}<!-- | |||
// END of translations | |||
// Initialize array variables | |||
-->{{#arraydefine:$quality|{{ParseInputQuality|quality={{{quality|}}}|iridium={{{iridium|}}}|hide={{{hide|}}}}}}}<!-- | |||
--><includeonly><div id="infoboxborder"> | |||
{| id="infoboxtable" | {| id="infoboxtable" | ||
|colspan="2" id="infoboxheader"|{{{name|{{PAGENAME}}}}} | | colspan="2" id="infoboxheader" | {{{name|{{PAGENAME}}}}} | ||
|- | |- | ||
|colspan="2" style="padding-bottom: 5px;"|{{ | | colspan="2" style="padding-bottom:5px; text-align: center;" | {{Autoimage|{{{image|}}}|eng={{{eng|}}}}} | ||
|- | |- | ||
|colspan="2" id="infoboxdetail" style="text-align: center; font-style: italic;"|{{#if:{{{description|}}}|{{{description|}}}|{{Description|{{PAGENAME}}}}}} | | colspan="2" id="infoboxdetail" style="text-align: center; font-style: italic;" | {{#if:{{{description|}}}|{{{description|}}}|{{Description|{{PAGENAME}}}}}} | ||
|- | |- | ||
|colspan="2" id="infoboxsection" style="text-align:center;"| | | colspan="2" id="infoboxsection" style="text-align:center;" | {{#arrayprint:$lang_information}}{{#if:{{{location|}}} |<nowiki /> | ||
{{!}}- | |||
{{!}}- | {{!}} id="infoboxsection" {{!}} {{#arrayprint:$lang_foundin}}: | ||
{{!}}id="infoboxsection"{{!}} | {{!}} id="infoboxdetail" {{!}} {{#ifexist:{{{location|}}}|[[{{{location|}}}]]|{{{location|}}}}} | ||
{{!}}id="infoboxdetail"{{!}}{{{location|}}} |}} | }}{{#if:{{{time|}}} |<nowiki /> | ||
{{!}}-{ | |||
{{!}}- | {{!}} id="infoboxsection" {{!}} {{#arrayprint:$lang_time}}: | ||
{{!}}id="infoboxsection"{{!}} | {{!}} id="infoboxdetail" {{!}} {{{time|}}} | ||
{{!}}id="infoboxdetail"{{!}}{{{time|}}} | }}{{#if:{{{season|}}} |<nowiki /> | ||
{{!}}- | |||
{{!}}- | {{!}} id="infoboxsection" {{!}} {{#arrayprint:$lang_season}}: | ||
{{!}}id="infoboxsection"{{!}} | {{!}} id="infoboxdetail" {{!}} {{Season|{{{season}}}}} | ||
{{!}}id="infoboxdetail"{{!}}{{ | }}{{#if:{{{weather|}}} |<nowiki /> | ||
{{!}}- | |||
{{!}} id="infoboxsection" {{!}} {{#arrayprint:$lang_weather}}: | |||
{{!}} id="infoboxdetail" {{!}} {{Weather inline|{{{weather}}}}} | |||
| | }}{{#if:{{{difficulty|}}} |<nowiki /> | ||
{{!}}- | |||
{{!}} id="infoboxsection" {{!}} {{#arrayprint:$lang_difficulty}}: | |||
{{!}} id="infoboxdetail" {{!}} {{{difficulty|}}} | |||
}}{{#if:{{{behavior|}}} |<nowiki /> | |||
{{!}}id=" | {{!}}- | ||
{{ | {{!}} id="infoboxsection" {{!}} [[{{#arrayprint:$lang_behaviorlink}}|<span style="color: white;">{{#arrayprint:$lang_behavior}}</span>]]: | ||
{{!}} id="infoboxdetail" {{!}} {{ParseInputValues|code=behav|{{{behavior|}}}|default=true|translate=true}} | |||
| | }}{{#if:{{{fl|}}}|<nowiki /> | ||
{{!}}- | |||
{{!}} id="infoboxsection" {{!}} [[{{#arrayprint:$lang_fishing}}|<span style="color: white;">{{#arrayprint:$lang_fishing}}</span>]] {{#arrayprint:$lang_levelrequired}}: | |||
{{!}} id="infoboxdetail {{!}} {{{fl|}}} | |||
{{ | }}{{#if:{{{size|}}}|<nowiki /> | ||
{{!}}- | |||
{{!}}- | {{!}} id="infoboxsection" {{!}} {{#arrayprint:$lang_fishsize}}: | ||
{{!}}id="infoboxsection"{{!}}[[ | {{!}} id="infoboxdetail" {{!}} <!-- | ||
{{!}}id="infoboxdetail | -->{{#if:{{#arrayprint:$lang_usemetric}} | ||
| {{#if:{{#pos:{{{size|}}}|-}} | |||
{{!}}- | | {{#expr:{{#explode:{{{size|}}}|-|0}}*2.54 round 0}} - {{#expr:{{#explode:{{{size|}}}|-|1}}*2.54 round 0}} | ||
{{!}}id="infoboxsection"{{!}} | | {{#expr:{{{size|}}}*2.54 round 0}}}} | ||
{{!}}id="infoboxdetail{{! | | {{{size|}}} | ||
-->{{#if:{{{size|}}} | | }}}}{{#if:{{{difficulty|}}}|<nowiki /> | ||
{{!}}- | |||
{{ | {{!}} id="infoboxsection" {{!}} {{#arrayprint:$lang_xp}}: | ||
{{!}} id="infoboxdetail" {{!}}<!-- | |||
--> {{#arraydefine:$legendary|{{ParseInputValues|code=legend|{{{eng|{{{name|{{PAGENAME}}}}}}}}}}}}<!-- | |||
--> {{#arraydefine:$quality_values|Normal, Silver, Gold, Iridium}}<!-- | |||
--> {{#arrayprint:$quality_values||@qual@<!-- | |||
{{ | --> | {{#ifeq:@qual@|Normal|| [[File:@qual@ Quality.png|14px|link=|alt=@qual@]] }}<!-- | ||
-->{{#expr: {{#if:{{#arrayprint:$legendary}}|5|1}} | |||
* floor( 3 * (1 + {{#switch:@qual@|Normal=0|Silver=1|Gold=2|Iridium=4}}) | |||
+ {{{difficulty}}}/3) | |||
}}}}}}{{#if:{{{edibility|}}}|<nowiki /> | |||
{{!}}- | |||
{{#iferror: {{ | <!-- | ||
{{!}}id="infoboxsection" | // Display edibility. Use two-column format when many values: so not if poison/inedible/0 | ||
-->{{#ifexpr:{{#iferror:{{#expr:{{{edibility|0}}}>0|0|1}}|0}} |<nowiki/> | |||
{{# | {{!}} id="infoboxsection" colspan="2" style="text-align: center;" {{!}} {{#arrayprint:$lang_healingeffect}} | ||
{{!}}- | {{!}}- | ||
{{!}}id=" | {{!}} id="infoboxdetail" {{!}} {{Edibility |{{{edibility|}}} |quality={{{healq|true}}} |iridium={{{iridium|}}} |statistics=Energy}} | ||
{{ | {{!}} id="infoboxdetail" {{!}} {{Edibility |{{{edibility|}}} |quality={{{healq|true}}} |iridium={{{iridium|}}} |statistics=Health}} | ||
{{!}} | |<nowiki/> | ||
{{!}} | {{!}} id="infoboxsection" {{!}} {{#arrayprint:$lang_healingeffect}}: | ||
{{ | {{!}} id="infoboxdetail" {{!}} {{Edibility |{{{edibility|}}} |quality={{{healq|true}}} |iridium={{{iridium|}}}}} | ||
{{{ | }}}}<!-- | ||
{{ | |||
{{!}}id=" | // custom_price if defined provides entire text of all price-related sections | ||
-->{{#if:{{{custom_price|}}} | |||
|{{{custom_price}}}<!-- | |||
{{#if:{{{ | // Display all item prices: Base price plus all professions listed in {{{profession}}} | ||
{{ | // Subtemplate automatically decides how to handle multiple columns, etc. | ||
{{ | --> |{{Infosection price | ||
|prof = Base, Fisher, Angler | |||
| | |item = {{{eng|{{{name|{{#ifeq:{{CONTENTLANG}}|en|{{PAGENAME}}|{{{image|}}}}}}}}}}} | ||
{{ | |price = {{{price|}}} | ||
{{{ | |iridium = {{{iridium|}}} | ||
{{ | |hide = {{{hideprice|}}} | ||
{{ | }}{{#if:{{{roe|}}}| | ||
{{ | {{Infosection price | ||
{{{ | |prof = Base, Base, Artisan | ||
|srcprice = {{{price|}}} | |||
{{ | |auto = true | ||
{{ | |artisan = true | ||
{{ | |itemcell1 = Roe | ||
|itemcell2 = {{#ifeq:{{{eng|{{{name|{{{PAGENAME}}}}}}}}}|Sturgeon|Caviar|Aged Roe}} | |||
|itemcell3 = {{#ifeq:{{{eng|{{{name|{{{PAGENAME}}}}}}}}}|Sturgeon|Caviar|Aged Roe}} | |||
|imageRoe = {{{roe}}} Roe | |||
|linkRoe = {{#arrayprint:$lang_roe}} | |||
|linkAged Roe={{#arrayprint:$lang_agedroe}} | |||
|linkCaviar = {{#arrayprint:$lang_caviar}} | |||
|ncolumns = 3 | |||
}} | |||
}}}} | |||
}} | |||
|} | |} | ||
</div>{{InfoboxSEO}}{{#seo: | </div>{{InfoboxSEO}}{{#seo: | ||
|og:image={{#if:{{{image|}}}|{{filepath:{{{image|}}}}}}} | |og:image={{#if:{{{image|}}}|{{filepath:{{{image|}}}}}}} | ||
}}</includeonly><noinclude>{{{{FULLPAGENAME}}/doc}}</noinclude> | }}</includeonly><noinclude>{{Englishdoc}}{{#ifexist:{{FULLPAGENAME}}/doc |<nowiki/> | ||
{{{{FULLPAGENAME}}/doc}} }}</noinclude> | |||
Revision as of 17:48, 10 September 2020
Description
This template is used to display an infobox for fish (and fish-like item) pages. Do not use this on your user page. It is reserved for content pages.
Parameters
| Parameter | Notes |
|---|---|
| eng | English fish name (Required in all languages. Used to populate image and prices.) |
| description | In-game item description (optional -- populated by Template:Description if omitted). It is preferable to omit this parameter and update Template:Description instead. |
| location | Area(s) where the fish can be caught |
| source | How to obtain the fish, other than fishing pole |
| time | What time range the fish can be caught in |
| season | What season(s) the fish can caught in (e.g., Summer) |
| weather | What weather the fish can be found in (e.g., Rain) |
| difficulty | Difficulty level of the fish. Auto-populates the "Fishing XP" section if present. |
| behavior | Behavior type of the fish (described in Fish#Behavior) |
| fl | Required fishing level (optional) |
| size | Base size range of the fish in inches (converts to other languages automatically). Can be found in the data file Fish.xnb Note: Size range must be entered using the hyphen key on a standard English keyboard. This will be replaced with the appropriate character in the template (en dash, wave dash, etc.). |
| xp | XP (and type of XP). Only for fish without the difficulty parameter set. |
| price | Base price of the fish, no star |
| edibility | Base edibility of the fish, no star |
| quality | Set to "normal" or "false" for fish that come only in normal quality (Optional) Can also set to "normal,silver" or "0,1" for crab pot fish that come in normal & silver quality (Optional) |
| roe | The color of the Roe (matching the filenames in Category:Roe images) to add a section showing Roe, Aged Roe, and prices |
| professions | Set to false to suppress Fisher & Angler prices (Optional) |