模板:Qualityprice:修订间差异
来自星露谷物语扩展百科
更多语言
更多操作
Margotbean(留言 | 贡献) no-wrap prices |
Nebulous Maestress(留言 | 贡献) sync with english template |
||
| 第1行: | 第1行: | ||
<includeonly>{| | <includeonly><!-- | ||
|< | |||
| | // Define letter/symbol used for gold in current language | ||
|<nowiki /> | -->{{#arraydefine:$lang_qp_gold|金}}<!-- | ||
// 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, 果酒, | |||
,Juice, 果汁, | |||
,Jelly, 果酱, | |||
,Pickles, 腌菜, | |||
,Roe, 鱼籽, | |||
,Aged Roe, 腌鱼籽, | |||
,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|{{{1|}}}||{{# | {{!}} {{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}} | |||
|''{{{2|}}}'' | |||
|{{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> | |||
2020年10月4日 (日) 08:40的版本
描述
该模板用于显示指定品质物品的价格,并根据显示语言进行适当格式化。物品图像(包含品质星级)将替代金币图标显示,图片尺寸固定为 24 像素。
参数
| 参数 | 说明 |
|---|---|
| 第一个(未命名)参数 | 图片名称(传入的参数含有 .png 后缀时会自动移除) |
| 第二个(未命名)参数 | 物品基础售价(可在 ObjectInformation.xnb 文件中查找) 或 制作工匠物品所用原料的基础售价(参见下方示例) 注:可接受非数字值(如 3x base fruit price),不会引发错误 |
| quality | 指定显示单个品质等级 默认显示全部品质(普通、银星、金星、铱星) 仅存在普通品质的物品无需指定(如山洞萝卜、姜、绿茶、蜂蜜、果酱、果汁、油、腌菜、齐瓜、茶叶等) 注:未来可能添加其他物品。当前可通过 quality=normal 或 quality=0 强制指定普通品质
|
| hide | 需要隐藏的品质等级 (例:hide=silver,gold 隐藏银星和金星) |
| pm | 职业修正系数 农耕人 +10% 售价:pm=1.1 垂钓者 +50% 售价:pm=1.5 |
| dsv | 数据排序值控制 设置为 false 时禁用排序功能(适用于信息框等非排序结构) 默认 true(需要排序时可省略此参数) |
示例
| 模板调用 | 效果 | ||||||||
|---|---|---|---|---|---|---|---|---|---|
{{Qualityprice|Melon|250}}
|
| ||||||||
{{Qualityprice|Parsnip|35|pm=1.1}}
|
| ||||||||
{{Qualityprice|Ginger|60}}
|
| ||||||||
{{Qualityprice|Goat Cheese|400|hide=normal,silver}}
|
| ||||||||
{{Qualityprice|Large Goat Milk FR|345}}
|
| ||||||||
{{Qualityprice|Juice|260}}(红叶卷心菜基础售价260, 红叶卷心菜果汁基础售价585) |
| ||||||||
{{Qualityprice|Purple Juice|260|quality=0}}(使用彩色图标时必须指定 quality=normal 或 quality=0) |
| ||||||||
{{Qualityprice|Wine|750|pm=1.4}}(杨桃基础售价750, 杨桃葡萄酒工匠基础售价3150) |
| ||||||||
{{Qualityprice|Honey|30}}(郁金香基础售价30, 郁金香蜂蜜基础售价160) |
|