Vorlage:Qualityprice: Unterschied zwischen den Versionen

Aus Stardew Valley Wiki
Zur Navigation springen Zur Suche springen
(Move auto-derived prices/qualities here instead of infosection_price)
 
(28 dazwischenliegende Versionen von 3 Benutzern werden nicht angezeigt)
Zeile 1: Zeile 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|g}}<!--
+
|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,    Wein,
+
--><table class="no-wrap" style="text-align: left; margin: 0; padding: 0; border-spacing: 0; border: 0;">
, Juice,    Saft,
+
{{#if:{{#pos:{{{hide|}}}|normal}}||
, Jelly,    Gelee,
+
{{#switch:{{{quality|all}}}
, Pickles,  Eingelegtes,
+
  |normal|base|all|0 =
, Roe,      Fischlaich,
+
<tr>
, Aged Roe, Gealterter Fischlaich,
+
<td>{{Overlayimg|{{{1|Blank icon}}}|width=24|center=true|type=star|quality=0}}</td>
, Caviar,  Kaviar,
+
<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
+
|q  = 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
+
|= 2 <!-- gold quality -->
              |#default = {{{2|0}}}
+
|pm = {{{pm|1}}} <!-- profession multiplier -->
          }}}}
+
|fm = true <!-- format number? -->
        |{{{2|0}}}
+
}} }}
  }}}}{{#arraydefine:$qplink|{{{link|{{ParseInputValues|code=qitem|{{{1|}}}}}}}}}}<!--
+
</td>
// If $qpprice is a text value (non-numeric) display it and quit; set sortkey=0 so it doesn't mess up table
+
</tr>
-->{{#iferror:{{#expr:{{#arrayprint:$qpprice}}>0}}
+
}} }} }}{{#if:{{#pos:{{{hide|}}}|iridium}}||{{#switch:{{lc:{{{1|}}}}}
      |<span class="sortkey" style="display:none;">0</span>''{{{2|}}}''<!--
+
|juice|pickles|jelly|honey|oil|cave carrot|green tea|tea leaves|ginger|qi fruit=
// Display sort key and start table
+
|#default={{#switch:{{{quality|all}}}
-->   |<span class="sortkey" style="display:none;">{{#expr:trunc(({{#arrayprint:$qpmult}})*trunc({{#arrayprint:$qpprice}}))}}</span>
+
|iridium|all|4 =
{{{!}} class="no-wrap" style="border-spacing: 0;"<!--
+
<tr>
 
+
<td>{{Overlayimg|{{{1|Blank icon}}}|width=24|center=true|type=star|quality=4}}</td>
// Loop through each requested quality.  Display icon using Quality template and calculate/display price
+
<td>{{#iferror:{{#expr:{{{2|}}}}}|{{{2|}}}|{{#invoke:Calcsellprice|csp
-->{{#arrayprint:$qpqual||@qual@|<nowiki/>
+
|im = {{{1|}}}  <!-- image -->
{{!}}-
+
|bp = {{#expr:{{{2|0}}}}} <!-- base price -->
{{!}} {{Quality|{{{1|}}}|@qual@| size={{{size|24}}} |link={{#arrayprint:$qplink}} |alt={{{alt|{{#if:{{#arrayprint:$qplink}}|{{#arrayprint:$qplink}}|{{{1|}}}}}}}}}}
+
|q  = 4 <!-- iridium quality -->
{{!}} {{#expr:
+
|pm = {{{pm|1}}} <!-- profession multiplier -->
          trunc( ({{#arrayprint:$qpmult}}) *
+
|fm = true
            trunc ( {{#switch:@qual@|Silver=1.25|Gold=1.5|Iridium=2|Normal|#default=1}} *
+
}} }}
                trunc({{#arrayprint:$qpprice}}) ) )
+
</td>
      }}{{#arrayprint:$lang_qp_gold}}
+
</tr>
}}
+
}} }} }}</table></includeonly><noinclude>{{Englishdoc}}</noinclude>
{{!}}}<!--
 
-->}}</includeonly><noinclude>{{Englishdoc}}{{#ifexist:{{FULLPAGENAME}}/doc |<nowiki/>
 
{{{{FULLPAGENAME}}/doc}} }}</noinclude>
 

Aktuelle Version vom 18. März 2023, 20:54 Uhr

Details zur Vorlage finden Sie auf der englischsprachigen Dokumentationsseite.

Verwendung

Diese Vorlage kann verwendet werden, indem Sie auf eine relevante Seite folgendes eingeben.

{{Qualityprice}}

Ergibt...

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