Difference between revisions of "Template:FairPoints"

From Stardew Valley Wiki
Jump to navigation Jump to search
(Added iridium column.)
m (Protected "Template:FairPoints": Archived template ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite)))
 
(12 intermediate revisions by the same user not shown)
Line 1: Line 1:
<includeonly>|- {{#arraydefine:qualities|0,1,2,4|,}}
+
<includeonly>|-{{#ifeq:{{lc:{{{iridium|}}}}} | n | {{#arraydefine:qualities|0,1,2,ERROR|,}} | {{#arraydefine:qualities|0,1,2,4|,}}}}
| [[File:{{{1}}}.png|center]]
+
{{#if:{{lc:{{{qualities|}}}}} | {{#arraydefine:qualities|{{{qualities|}}}|,}}}}
| [[{{{1}}}]]
+
| {{name|{{{1|}}}|link={{{name|}}}}}
| {{{2}}}
+
| data-sort-value="{{{2|}}}"|{{#iferror: {{price|{{{2|}}}}} | {{{2|}}} | {{price|{{{2|}}}}} }}  
 
| {{#arrayprint:qualities|{{!}}{{!}}| $quality
 
| {{#arrayprint:qualities|{{!}}{{!}}| $quality
 
| <nowiki/> {{#ifexpr: {{#ifeq:{{{3|n}}}|y|1| $quality < 1 }}
 
| <nowiki/> {{#ifexpr: {{#ifeq:{{{3|n}}}|y|1| $quality < 1 }}
 
   | {{#iferror: {{#expr: {{{2}}} * (1 + $quality * .25) }}
 
   | {{#iferror: {{#expr: {{{2}}} * (1 + $quality * .25) }}
     | {{{2}}}
+
     | data-sort-value="00"{{!}}&mdash;
 
     | {{#arraydefine: prices | {{#expr: {{{2}}} * (1 + $quality * .25)}} | <nowiki/> }}
 
     | {{#arraydefine: prices | {{#expr: {{{2}}} * (1 + $quality * .25)}} | <nowiki/> }}
 
       {{#arrayprint: prices || $price
 
       {{#arrayprint: prices || $price
       | {{#expr: 0
+
       | {{#expr: 1 + $quality
        + $quality + 1
 
 
         + {{#expr:  19 < $price }}
 
         + {{#expr:  19 < $price }}
 
         + {{#expr:  89 < $price }}
 
         + {{#expr:  89 < $price }}
Line 17: Line 16:
 
         + {{#expr: 399 < $price and $quality < 1 }}
 
         + {{#expr: 399 < $price and $quality < 1 }}
 
         }}
 
         }}
       }}
+
       }}<!-- arrayprint: prices -->
     }}
+
     }}<!-- iferror -->
   |
+
   | data-sort-value="00"{{!}}&mdash; <!-- !ifexpr -->
   }}
+
   }} <!-- end ifexpr -->
}}</includeonly><noinclude>
+
}}<!-- arrayprint:qualities --></includeonly><noinclude>
Creates a sortable table entry for a given item's ''base value'' in the Stardew Valley Fair grange display.
+
==Description==
 +
This template calculates point values awarded for items in the Stardew Valley Fair.  It creates a sortable table entry for a given item's ''base sell price'' (excluding profession bonuses) in the Stardew Valley Fair grange display.
  
First argument is the item name, and the second argument is its ''base value''.
+
The first argument is the item's image name, and the second argument is its ''base sell price''. The image name will also be the link to the item unless an alternate name is specified.
The third argument is "y" if the item can have quality stars. It can be omitted or "n" to display dashes in the silver and gold columns.
 
  
The point value for silver-, gold- and iridium-quality items is calculated assuming that judging is based on the quality value of the item instead of the base value, i.e. silver-quality items are worth (1 + points(1.25 * base)) instead of just (1 + points(base)).
+
The third argument is "y" if the item can have quality stars. It can be omitted or set to "n" to display dashes in the silver/gold/iridium columns.
  
 +
For items with unusual qualities, an optional named parameter "qualities" can be specified.  This parameter should consist of a comma-separated list of qualities, including some non-numeric word as a placeholder for invalid qualities.  Example:  <code><nowiki>{{FairPoints|Mayonnaise|190|y|qualities=0,none,2,none}}</nowiki></code>
 +
 +
The point value for silver-, gold- and iridium-quality items is calculated assuming that judging is based on the quality sell price of the item instead of the base sell price, ''i.e.,'' silver-quality items are worth (1 + points(1.25 * base)) instead of just (1 + points(base)).
 +
 +
==Use==
 +
<pre>{{FairPoints}}</pre>
 +
 +
==Example==
 +
<pre>
 
{| class="wikitable sortable"
 
{| class="wikitable sortable"
!Image
+
!Item
!Name
+
!Price
!Base Value
+
!Base
!Points
 
 
!Silver
 
!Silver
 
!Gold
 
!Gold
 
!Iridium
 
!Iridium
{{FairPoints|Radish|60|y}}
+
{{FairPoints|Radish|name=Gold Bar|60|y}}
 
{{FairPoints|Pumpkin|320|y}}
 
{{FairPoints|Pumpkin|320|y}}
 
{{FairPoints|Egg|240|n}}
 
{{FairPoints|Egg|240|n}}
{{FairPoints|Oil of Garlic|???|n}}
+
{{FairPoints|Oil of Garlic|1000}}
 +
{{FairPoints|Mayonnaise|190|y|qualities=0,none,2,none}}
 +
|}</pre>
 +
 
 +
{| class="wikitable sortable"
 +
!Item
 +
!Price
 +
!Base
 +
!Silver
 +
!Gold
 +
!Iridium
 +
{{FairPoints|Radish|name=Gold Bar|60|y}}
 +
{{FairPoints|Pumpkin|320|y}}
 +
{{FairPoints|Egg|240|n}}
 +
{{FairPoints|Oil of Garlic|1000}}
 +
{{FairPoints|Mayonnaise|190|y|qualities=0,none,2,none}}
 
|}
 
|}
 
+
[[Category:Archived templates]]</noinclude>
{{{{FULLPAGENAME}}/doc}}</noinclude>
 

Latest revision as of 21:13, 8 April 2023

Description

This template calculates point values awarded for items in the Stardew Valley Fair. It creates a sortable table entry for a given item's base sell price (excluding profession bonuses) in the Stardew Valley Fair grange display.

The first argument is the item's image name, and the second argument is its base sell price. The image name will also be the link to the item unless an alternate name is specified.

The third argument is "y" if the item can have quality stars. It can be omitted or set to "n" to display dashes in the silver/gold/iridium columns.

For items with unusual qualities, an optional named parameter "qualities" can be specified. This parameter should consist of a comma-separated list of qualities, including some non-numeric word as a placeholder for invalid qualities. Example: {{FairPoints|Mayonnaise|190|y|qualities=0,none,2,none}}

The point value for silver-, gold- and iridium-quality items is calculated assuming that judging is based on the quality sell price of the item instead of the base sell price, i.e., silver-quality items are worth (1 + points(1.25 * base)) instead of just (1 + points(base)).

Use

{{FairPoints}}

Example

{| class="wikitable sortable"
!Item
!Price
!Base
!Silver
!Gold
!Iridium
{{FairPoints|Radish|name=Gold Bar|60|y}}
{{FairPoints|Pumpkin|320|y}}
{{FairPoints|Egg|240|n}}
{{FairPoints|Oil of Garlic|1000}}
{{FairPoints|Mayonnaise|190|y|qualities=0,none,2,none}}
|}
Item Price Base Silver Gold Iridium
Radish.png Gold Bar data-sort-value="60">Gold.png60g 2 3 5 7
Pumpkin.png Pumpkin data-sort-value="320">Gold.png320g 5 6 6 8
Egg.png Egg data-sort-value="240">Gold.png240g 4
Oil of Garlic.png Oil of Garlic data-sort-value="1000">Gold.png1,000g 6
Mayonnaise.png Mayonnaise data-sort-value="190">Gold.png190g 3 6