Linha 1: |
Linha 1: |
− | <includeonly>{| | + | <includeonly><!-- |
− | |- | + | |
− | |<span class="sortkey" style="display:none;">{{#len:{{{2|}}}}}{{{2|}}}</span>{{#if:{{#pos:{{{hide|}}}|normal}} | + | // Define letter/symbol used for gold in current language |
− | | | + | -->{{#arraydefine:$lang_qp_gold| ouros}}<!-- |
− | |<nowiki /> | + | // Items that get autofilled by Infobox and therefore need to be autotranslated to fill in link |
| + | // (other items are tested below, but the tested values should be image names which are same on all sites) |
| + | -->{{ParseInputValues|code=qitem|| |
| + | ,Wine, Vinho, |
| + | ,Juice, Suco, |
| + | ,Jelly, Geléia, |
| + | ,Pickles, Picles, |
| + | ,Roe, Ovas, |
| + | ,Aged Roe, Ovas Maturadas, |
| + | ,Caviar, Caviar, |
| + | }}<!-- |
| + | // END of translation |
| + | |
| + | // Get list of qualities. Set from quality/iridium/hide OR override for specific items if {{{auto}}} |
| + | -->{{#arraydefine:$qpqual|{{ParseInputQuality|quality={{#if:{{{quality|}}}|{{{quality}}}|true}}|iridium={{{3|{{{iridium|}}}}}}|hide={{{hide|}}}}}}}<!-- |
| + | -->{{#if:{{{auto|}}} |
| + | | {{#switch:{{lc:{{{1|}}}}} |
| + | |wine|pale ale|beer|mead= {{#arraydefine:$qpqual|Normal,Silver,Gold,Iridium}} |
| + | |juice|jelly|pickles|honey|roe|caviar|aged roe= {{#arraydefine:$qpqual|Normal}} |
| + | }}}}<!-- |
| + | // Don't allow artisan bonus to ever be applied to coffee, oil. Done regardless of {{{auto}}} |
| + | -->{{#arraydefine:$qpmult| |
| + | {{#switch:{{lc:{{{1|}}}}} |
| + | |oil|coffee = 1 |
| + | |#default = {{#iferror:{{#expr:{{{prof_mult}}}*1}}|1|{{{prof_mult}}}}}}}}}<!-- |
| + | // Set price to {{{2}}} or derive from srcprice if {{{auto}}}, srcprice is valid, and item name is recognized |
| + | // (extra complication for roe: allow [color]_roe to be recognized ... but don't confuse with aged roe) |
| + | -->{{#arraydefine:$qpprice |
| + | |{{#ifexpr:{{#if:{{{auto|}}}|1|0}} and {{#if:{{{srcprice|}}}|1|0}} and {{#iferror:{{#expr:{{{srcprice}}}*1}}|0|1}} |
| + | |{{#ifexpr:{{#ifeq:{{lc:{{{1|}}}}}|aged roe|0|1}} and {{#ifeq:{{lc:{{#sub:{{{1|}}}|-3|3}}}}|roe|1|0}} |
| + | |{{#expr:30+trunc({{{srcprice}}})/2}}{{#arraydefine:$qpqual|Normal}} |
| + | |{{#switch:{{lc:{{{1|}}}}}| |
| + | |wine = {{#expr:trunc({{{srcprice}}})*3}} |
| + | |juice = {{#expr:trunc({{{srcprice}}})*2.25}} |
| + | |jelly |
| + | |pickles = {{#expr:trunc({{{srcprice}}})*2 + 50}} |
| + | |honey = {{#expr:trunc({{{srcprice}}})*2 + 100}} |
| + | |roe = {{#expr:30+trunc({{{srcprice}}})/2}} |
| + | |caviar = 500 |
| + | |aged roe = {{#expr:2*trunc(30+trunc({{{srcprice}}})/2)}} |
| + | |pale ale = 300 |
| + | |beer = 200 |
| + | |mead = 200 |
| + | |#default = {{{2|0}}} |
| + | }}}} |
| + | |{{{2|0}}} |
| + | }}}}{{#arraydefine:$qplink| |
| + | {{#ifeq:{{{link}}}||| |
| + | {{#if:{{#if:{{{auto|}}}|{{ParseInputValues|code=qitem|{{{1|}}}|translate=true}}}} |
| + | |{{ParseInputValues|code=qitem|{{{1|}}}|translate=true}} |
| + | |{{#ifeq:{{{link|}}}|1||{{{link|{{#ifeq:{{CONTENTLANG}}|en|{{{1|}}}}}}}}}}}}}}}}<!-- |
| + | // Display sort key (0 for text/non-numeric price so it doesn't mess up table) |
| + | --><span class="sortkey" style="display:none;">{{#iferror: |
| + | {{#expr:{{#arrayprint:$qpprice}}>0}} |
| + | |0 |
| + | |{{#expr:trunc(({{#arrayprint:$qpmult}})*trunc({{#arrayprint:$qpprice}}))}}}}</span><!-- |
| + | // Start table and loop through each requested quality |
| + | // Display icon using Quality template and calculate/display price--> |
| + | {{{!}} class="no-wrap" style="border-spacing: 0;" |
| + | {{#arrayprint:$qpqual||@qual@|<nowiki/> |
| {{!}}- | | {{!}}- |
− | {{!}}{{Quality|{{#switch: {{lc:{{{1|}}}}} | + | {{!}} {{Quality|{{{1|}}}|@qual@| size={{#if:{{{size|}}}|{{{size}}}|24}} |link={{#arrayprint:$qplink}} |alt={{#ifeq:{{{alt}}}|||{{#if:{{{alt|}}}|{{{alt}}}|{{#if:{{#arrayprint:$qplink}}|{{#arrayprint:$qplink}}|{{{1|}}}}}}}}}}} |
− | | milk = Milk ES
| + | {{!}} {{#iferror:{{#expr:{{#arrayprint:$qpprice}}>0}} |
− | | large milk = Large Milk ES
| + | |''{{{2|}}}'' |
− | | goat milk = Goat Milk ES
| + | |{{formatnum:{{#expr: |
− | | large goat milk = Large Goat Milk ES
| + | trunc( ({{#arrayprint:$qpmult}}) * |
− | | #default = {{{1|}}}}}|normal|{{#switch: {{{size|}}} |16=16|32=32|48=48|64=64|#default=24}}}}
| + | trunc ( {{#switch:@qual@|Silver=1.25|Gold=1.5|Iridium=2|Normal|#default=1}} * |
− | {{!}}style="white-space:nowrap;"{{!}}{{#expr:trunc({{{2|}}})}} ouros}}{{#if: {{#pos:{{{hide|}}}|silver}} | + | trunc({{#arrayprint:$qpprice}}) ) ) |
− | |
| + | }}}}{{#arrayprint:$lang_qp_gold}} |
− | |<nowiki />
| + | }}}} |
− | {{!}}- | + | {{!}}}<!-- |
− | {{!}}{{Quality|{{#switch: {{lc:{{{1|}}}}}
| + | --></includeonly><noinclude>{{Englishdoc}}{{#ifexist:{{FULLPAGENAME}}/doc |<nowiki/> |
− | | milk = Milk ES
| + | {{{{FULLPAGENAME}}/doc}} }}</noinclude> |
− | | large milk = Large Milk ES
| |
− | | goat milk = Goat Milk ES
| |
− | | large goat milk = Large Goat Milk ES
| |
− | | #default = {{{1|}}}}}|silver|{{#switch: {{{size|}}} |16=16|32=32|48=48|64=64|#default=24}}}}
| |
− | {{!}}style="white-space:nowrap;"{{!}}{{#expr:trunc({{{2|}}}*1.25)}} ouros}}{{#if: {{#pos:{{{hide|}}}|gold}}
| |
− | | | |
− | |<nowiki/>
| |
− | {{!}}- | |
− | {{!}}{{Quality|{{#switch: {{lc:{{{1|}}}}} | |
− | | milk = Milk ES
| |
− | | large milk = Large Milk ES
| |
− | | goat milk = Goat Milk ES
| |
− | | large goat milk = Large Goat Milk ES
| |
− | | #default = {{{1|}}}}}|gold|{{#switch: {{{size|}}} |16=16|32=32|48=48|64=64|#default=24}}}}
| |
− | {{!}}style="white-space:nowrap;"{{!}}{{#expr:trunc({{{2|}}}*1.50)}} ouros}}{{#if: {{{3|}}}
| |
− | | {{#if: {{#pos:{{{hide|}}}|iridium}}
| |
− | |<b class="error">Qualityprice: Cannot show and hide iridium.</b>
| |
− | |<nowiki/>
| |
− | {{!}}-
| |
− | {{!}}{{Quality|{{#switch: {{lc:{{{1|}}}}}
| |
− | | milk = Milk ES
| |
− | | large milk = Large Milk ES
| |
− | | goat milk = Goat Milk ES
| |
− | | large goat milk = Large Goat Milk ES
| |
− | | #default = {{{1|}}}}}|iridium|{{#switch: {{{size|}}} |16=16|32=32|48=48|64=64|#default=24}}}}
| |
− | {{!}}style="white-space:nowrap;"{{!}}{{#expr:trunc({{{2}}}*2)}} ouros
| |
− | }}
| |
− | }}
| |
− | |}</includeonly><noinclude>{{englishdoc}}</noinclude>
| |