模板:Qualityprice:修订间差异
来自星露谷物语扩展百科
更多语言
更多操作
删除的内容 添加的内容
Margotbean(留言 | 贡献) 无编辑摘要 |
Margotbean(留言 | 贡献) Update to remove arrays |
||
| 第1行: | 第1行: | ||
<includeonly>{{#ifeq:{{lc:{{{dsv|}}}}}|false||<span style="display: none;">data-sort-value="{{#invoke:Calcsellprice|csp |
|||
<includeonly><!-- |
|||
|im = {{{1|}}} |
|||
|bp = {{{srcprice|{{#expr:{{{2|0}}}}}}}} |
|||
// Define letter/symbol used for gold in current language |
|||
|q = 0 |
|||
-->{{#arraydefine:$lang_qp_gold|金}}<!-- |
|||
|pm = {{{pm|{{{prof_mult|{{{4|1}}}}}}}}} |
|||
// Items that get autofilled by Infobox and therefore need to be autotranslated to fill in link |
|||
|ll = {{CONTENTLANG}} |
|||
// (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 = {{{srcprice|{{#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|{{{prof_mult|{{{4|1}}}}}}}}} <!-- profession multiplier --> |
|||
-->{{#arraydefine:$qpqual|{{ParseInputQuality|quality={{#if:{{{quality|}}}|{{{quality}}}|true}}|iridium={{{3|{{{iridium|}}}}}}|hide={{{hide|}}}}}}}<!-- |
|||
|ll = {{CONTENTLANG}} <!-- local language --> |
|||
-->{{#if:{{{auto|}}} |
|||
|fm = true <!-- format number? --> |
|||
| {{#switch:{{lc:{{{1|}}}}} |
|||
}} }} |
|||
|wine|pale ale|beer|mead= {{#arraydefine:$qpqual|Normal,Silver,Gold,Iridium}} |
|||
</td> |
|||
|juice|jelly|pickles|honey|roe|caviar|aged roe= {{#arraydefine:$qpqual|Normal}} |
|||
</tr> |
|||
}}}}<!-- |
|||
}} }}{{#if:{{#pos:{{{hide|}}}|silver}}||{{#switch:{{lc:{{{1|}}}}} |
|||
// Don't allow artisan bonus to ever be applied to coffee, oil. Done regardless of {{{auto}}} |
|||
|juice|pickles|jelly|honey|oil|cave carrot|green tea|tea leaves= |
|||
-->{{#arraydefine:$qpmult| |
|||
|#default={{#switch:{{{quality|all}}} |
|||
|silver|all|1 = |
|||
|oil|coffee = 1 |
|||
<tr> |
|||
|#default = {{#iferror:{{#expr:{{{prof_mult}}}*1}}|1|{{{prof_mult}}}}}}}}}<!-- |
|||
<td>{{Overlayimg|{{{1|Blank icon}}}|width=24|center=true|type=star|quality=1}}</td> |
|||
// Set price to {{{2}}} or derive from srcprice if {{{auto}}}, srcprice is valid, and item name is recognized |
|||
<td>{{#iferror:{{#expr:{{{2|}}}}}|{{{2|}}}|{{#invoke:Calcsellprice|csp |
|||
// (extra complication for roe: allow [color]_roe / [color]_aged_roe to be recognized) |
|||
|im = {{{1|}}} <!-- image --> |
|||
-->{{#arraydefine:$qpprice |
|||
|bp = {{{srcprice|{{#expr:{{{2|0}}}}}}}} <!-- base price --> |
|||
|{{#ifexpr:{{#if:{{{auto|}}}|1|0}} and {{#if:{{{srcprice|}}}|1|0}} and {{#iferror:{{#expr:{{{srcprice}}}*1}}|0|1}} |
|||
|q = 1 <!-- silver quality --> |
|||
|{{#ifeq:{{lc:{{#sub:{{{1|}}}|-3|3}}}}|roe |
|||
|pm = {{{pm|{{{prof_mult|{{{4|1}}}}}}}}} <!-- profession multiplier --> |
|||
|ll = {{CONTENTLANG}} <!-- local language --> |
|||
|{{#expr:2*trunc(30+trunc({{{srcprice}}})/2)}}{{#arraydefine:$qpqual|Normal}} |
|||
|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= |
|||
|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 --> |
|||
|bp = {{{srcprice|{{#expr:{{{2|0}}}}}}}} <!-- base price --> |
|||
|mead = 200 |
|||
|q = 2 <!-- gold quality --> |
|||
|#default = {{{2|0}}} |
|||
|pm = {{{pm|{{{prof_mult|{{{4|1}}}}}}}}} <!-- profession multiplier --> |
|||
}}}} |
|||
|ll = {{CONTENTLANG}} <!-- local language --> |
|||
|{{{2|0}}} |
|||
|fm = true <!-- format number? --> |
|||
}}}}{{#arraydefine:$qplink| |
|||
}} }} |
|||
{{#ifeq:{{{link}}}||| |
|||
</td> |
|||
{{#if:{{#if:{{{auto|}}}|{{ParseInputValues|code=qitem|{{{1|}}}|translate=true}}}} |
|||
</tr> |
|||
|{{ParseInputValues|code=qitem|{{{1|}}}|translate=true}} |
|||
}} }} }}{{#if:{{#pos:{{{hide|}}}|iridium}}||{{#switch:{{lc:{{{1|}}}}} |
|||
|juice|pickles|jelly|honey|oil|cave carrot|green tea|tea leaves= |
|||
// Display sort key (0 for text/non-numeric price so it doesn't mess up table) |
|||
|#default={{#switch:{{{quality|all}}} |
|||
--><span data-sort-value="{{#ifeq:{{{sortkey}}}|||{{#ifeq:{{{sortkey|true}}}|true |
|||
|iridium|all|4 = |
|||
|{{#iferror:{{#expr:{{#arrayprint:$qpprice}}>0}} |
|||
<tr> |
|||
|0 |
|||
<td>{{Overlayimg|{{{1|Blank icon}}}|width=24|center=true|type=star|quality=4}}</td> |
|||
|{{#expr:trunc(({{#arrayprint:$qpmult}})*trunc({{#arrayprint:$qpprice}}))}}}} |
|||
<td>{{#iferror:{{#expr:{{{2|}}}}}|{{{2|}}}|{{#invoke:Calcsellprice|csp |
|||
|{{{sortkey}}}}}}}"><!-- |
|||
|im = {{{1|}}} <!-- image --> |
|||
// Start table and loop through each requested quality |
|||
|bp = {{{srcprice|{{#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|{{{prof_mult|{{{4|1}}}}}}}}} <!-- profession multiplier --> |
|||
{{#arrayprint:$qpqual||@qual@|<nowiki/> |
|||
|ll = {{CONTENTLANG}} <!-- local language --> |
|||
{{!}}- |
|||
|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|}}}}}}}}}}} |
|||
}} }} |
|||
{{!}} {{#iferror:{{#expr:{{#arrayprint:$qpprice}}>0}} |
|||
</td> |
|||
|{{{2|}}} |
|||
</tr> |
|||
|{{formatnum:{{#expr: |
|||
}} }} }}</table></includeonly><noinclude>{{Englishdoc}}</noinclude> |
|||
trunc (trunc( ({{#arrayprint:$qpmult}}) * 10 * |
|||
trunc ( {{#switch:@qual@|Silver=1.25|Gold=1.5|Iridium=2|Normal|#default=1}} * |
|||
trunc({{#arrayprint:$qpprice}}) ) ) / 10) |
|||
}}}}{{#arrayprint:$lang_qp_gold}} |
|||
}}}} |
|||
{{!}}}</span><!-- |
|||
--></includeonly><noinclude>{{Englishdoc}}</noinclude> |
|||