“Template:Qualityprice”的版本间的差异

来自Stardew Valley Wiki
跳到导航 跳到搜索
(sync with english template)
 
(未显示3个用户的10个中间版本)
第1行: 第1行:
<includeonly><!--
+
<includeonly>{{#ifeq:{{lc:{{{dsv|}}}}}|false||<span style="display: none;">data-sort-value="{{#invoke:Calcsellprice|csp
 
+
|im = {{{1|}}} <!-- image -->
// Define letter/symbol used for gold in current language
+
|bp = {{#expr:{{{2|0}}}}} <!-- base price -->
-->{{#arraydefine:$lang_qp_gold| }}<!--
+
|q  = 0 <!-- quality = normal -->
// Items that get autofilled by Infobox and therefore need to be autotranslated to fill in link
+
|pm = {{{pm|1}}} <!-- profession multiplier -->
// (other items are tested below, but the tested values should be image names which are same on all sites)
+
|fm = false <!-- format number? -->
-->{{ParseInputValues|code=qitem||
+
}}"</span>}}<!--
,Wine,   果酒,
+
--><table class="no-wrap" style="text-align: left; margin: 0; padding: 0; border-spacing: 0; border: 0;">
,Juice,   果汁,
+
{{#if:{{#pos:{{{hide|}}}|normal}}||
,Jelly,   果酱,
+
{{#switch:{{{quality|all}}}
,Pickles,  腌菜,
+
  |normal|base|all|0 =
,Roe,    鱼籽,
+
<tr>
,Aged Roe, 腌鱼籽,
+
<td>{{Overlayimg|{{{1|Blank icon}}}|width=24|center=true|type=star|quality=0}}</td>
,Caviar,  鱼籽酱,
+
<td>{{#iferror:{{#expr:{{{2|}}}}}|{{{2|}}}|{{#invoke:Calcsellprice|csp
}}<!--
+
|im = {{{1|}}} <!-- image -->
// END of translation
+
|bp = {{#expr:{{{2|0}}}}} <!-- base price -->
 
+
|q  = 0 <!-- normal quality -->
// Get list of qualities. Set from quality/iridium/hide OR override for specific items if {{{auto}}}
+
|pm = {{{pm|1}}} <!-- profession multiplier -->
-->{{#arraydefine:$qpqual|{{ParseInputQuality|quality={{#if:{{{quality|}}}|{{{quality}}}|true}}|iridium={{{3|{{{iridium|}}}}}}|hide={{{hide|}}}}}}}<!--
+
|fm = true <!-- format number? -->
-->{{#if:{{{auto|}}}
+
}} }}
    | {{#switch:{{lc:{{{1|}}}}}
+
</td>
      |wine|pale ale|beer|mead= {{#arraydefine:$qpqual|Normal,Silver,Gold,Iridium}}
+
</tr>
      |juice|jelly|pickles|honey|roe|caviar|aged roe= {{#arraydefine:$qpqual|Normal}}
+
}} }}{{#if:{{#pos:{{{hide|}}}|silver}}||{{#switch:{{lc:{{{1|}}}}}
  }}}}<!--
+
|juice|pickles|jelly|honey|oil|cave carrot|green tea|tea leaves|ginger|qi fruit=
// Don't allow artisan bonus to ever be applied to coffee, oil.  Done regardless of {{{auto}}}
+
|#default={{#switch:{{{quality|all}}}
-->{{#arraydefine:$qpmult|
+
|silver|all|1 =
    {{#switch:{{lc:{{{1|}}}}}
+
<tr>
     |oil|coffee = 1
+
<td>{{Overlayimg|{{{1|Blank icon}}}|width=24|center=true|type=star|quality=1}}</td>
|#default = {{#iferror:{{#expr:{{{prof_mult}}}*1}}|1|{{{prof_mult}}}}}}}}}<!--
+
<td>{{#iferror:{{#expr:{{{2|}}}}}|{{{2|}}}|{{#invoke:Calcsellprice|csp
// Set price to {{{2}}} or derive from srcprice if {{{auto}}}, srcprice is valid, and item name is recognized
+
|im = {{{1|}}} <!-- image -->
// (extra complication for roe: allow [color]_roe to be recognized ... but don't confuse with aged roe)
+
|bp = {{#expr:{{{2|0}}}}} <!-- base price -->
-->{{#arraydefine:$qpprice
+
|= 1 <!-- silver quality -->
    |{{#ifexpr:{{#if:{{{auto|}}}|1|0}} and {{#if:{{{srcprice|}}}|1|0}} and {{#iferror:{{#expr:{{{srcprice}}}*1}}|0|1}}
+
|pm = {{{pm|1}}} <!-- profession multiplier -->
     |{{#ifexpr:{{#ifeq:{{lc:{{{1|}}}}}|aged roe|0|1}} and {{#ifeq:{{lc:{{#sub:{{{1|}}}|-3|3}}}}|roe|1|0}}
+
|fm = true <!-- format number? -->
   |{{#expr:30+trunc({{{srcprice}}})/2}}{{#arraydefine:$qpqual|Normal}}
+
}} }}
       |{{#switch:{{lc:{{{1|}}}}}|
+
</td>
        |wine   = {{#expr:trunc({{{srcprice}}})*3}}
+
</tr>
        |juice   = {{#expr:trunc({{{srcprice}}})*2.25}}
+
}} }} }}{{#if:{{#pos:{{{hide|}}}|gold}}||{{#switch:{{lc:{{{1|}}}}}
        |jelly
+
|juice|pickles|jelly|honey|oil|cave carrot|green tea|tea leaves|ginger|qi fruit=
        |pickles  = {{#expr:trunc({{{srcprice}}})*2 + 50}}
+
|#default={{#switch:{{{quality|all}}}
        |honey   = {{#expr:trunc({{{srcprice}}})*2 + 100}}
+
|gold|all|2 =
        |roe    = {{#expr:30+trunc({{{srcprice}}})/2}}
+
<tr>
    |caviar  = 500
+
<td>{{Overlayimg|{{{1|Blank icon}}}|width=24|center=true|type=star|quality=2}}</td>
        |aged roe = {{#expr:2*trunc(30+trunc({{{srcprice}}})/2)}}
+
<td>{{#iferror:{{#expr:{{{2|}}}}}|{{{2|}}}|{{#invoke:Calcsellprice|csp
    |pale ale = 300
+
|im = {{{1|}}} <!-- image -->
    |beer   = 200
+
|bp = {{#expr:{{{2|0}}}}} <!-- base price -->
    |mead   = 200
+
|q  = 2 <!-- gold quality -->
        |#default = {{{2|0}}}
+
|pm = {{{pm|1}}} <!-- profession multiplier -->
      }}}}
+
|fm = true <!-- format number? -->
     |{{{2|0}}}
+
}} }}
  }}}}{{#arraydefine:$qplink|
+
</td>
   {{#ifeq:{{{link}}}|||
+
</tr>
     {{#if:{{#if:{{{auto|}}}|{{ParseInputValues|code=qitem|{{{1|}}}|translate=true}}}}
+
}} }} }}{{#if:{{#pos:{{{hide|}}}|iridium}}||{{#switch:{{lc:{{{1|}}}}}
      |{{ParseInputValues|code=qitem|{{{1|}}}|translate=true}}
+
|juice|pickles|jelly|honey|oil|cave carrot|green tea|tea leaves|ginger|qi fruit=
      |{{#ifeq:{{{link|}}}|1||{{{link|{{#ifeq:{{CONTENTLANG}}|en|{{{1|}}}}}}}}}}}}}}}}<!--
+
|#default={{#switch:{{{quality|all}}}
// Display sort key (0 for text/non-numeric price so it doesn't mess up table)
+
|iridium|all|4 =
--><span class="sortkey" style="display:none;">{{#iferror:
+
<tr>
   {{#expr:{{#arrayprint:$qpprice}}>0}}
+
<td>{{Overlayimg|{{{1|Blank icon}}}|width=24|center=true|type=star|quality=4}}</td>
     |0
+
<td>{{#iferror:{{#expr:{{{2|}}}}}|{{{2|}}}|{{#invoke:Calcsellprice|csp
     |{{#expr:trunc(({{#arrayprint:$qpmult}})*trunc({{#arrayprint:$qpprice}}))}}}}</span><!--
+
|im = {{{1|}}}  <!-- image -->
// Start table and loop through each requested quality
+
|bp = {{#expr:{{{2|0}}}}} <!-- base price -->
// Display icon using Quality template and calculate/display price-->
+
|q  = 4 <!-- iridium quality -->
{{{!}} class="no-wrap" style="border-spacing: 0;"
+
|pm = {{{pm|1}}} <!-- profession multiplier -->
{{#arrayprint:$qpqual||@qual@|<nowiki/>
+
|fm = true
{{!}}-
+
}} }}
{{!}} {{Quality|{{{1|}}}|@qual@| size={{#if:{{{size|}}}|{{{size}}}|24}} |link={{#arrayprint:$qplink}} |alt={{#ifeq:{{{alt}}}|||{{#if:{{{alt|}}}|{{{alt}}}|{{#if:{{#arrayprint:$qplink}}|{{#arrayprint:$qplink}}|{{{1|}}}}}}}}}}}
+
</td>
{{!}} {{#iferror:{{#expr:{{#arrayprint:$qpprice}}>0}}
+
</tr>
     |{{Italics|{{{2|}}}}}
+
}} }} }}</table></includeonly><noinclude>{{Englishdoc}}</noinclude>
     |{{formatnum:{{#expr:
 
      trunc( ({{#arrayprint:$qpmult}}) *
 
        trunc ( {{#switch:@qual@|Silver=1.25|Gold=1.5|Iridium=2|Normal|#default=1}} *
 
         trunc({{#arrayprint:$qpprice}}) ) )
 
     }}}}{{#arrayprint:$lang_qp_gold}}
 
}}}}
 
{{!}}}<!--
 
--></includeonly><noinclude>{{Englishdoc}}{{#ifexist:{{FULLPAGENAME}}/doc |<nowiki/>
 
{{{{FULLPAGENAME}}/doc}} }}</noinclude>
 

2023年3月18日 (六) 21:01的最新版本

有关此模板的详细信息,请参阅英语语言文档页

用法

可以通过在相关页面上输入以下内容来使用此模板。

{{Qualityprice}}

结果是...

data-sort-value="0"

Blank icon.png
0
Blank icon.png
Silver Quality Icon.png
0
Blank icon.png
Gold Quality Icon.png
0
Blank icon.png
Iridium Quality Icon.png
0