Difference between revisions of "Template:FairPoints"

From Stardew Valley Wiki
Jump to navigation Jump to search
(Whoops, silver base value modifier is 1.25, not 1.50.)
m (Protected "Template:FairPoints": Archived template ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite)))
 
(15 intermediate revisions by 4 users not shown)
Line 1: Line 1:
<includeonly>
+
<includeonly>|-{{#ifeq:{{lc:{{{iridium|}}}}} | n | {{#arraydefine:qualities|0,1,2,ERROR|,}} | {{#arraydefine:qualities|0,1,2,4|,}}}}
|-
+
{{#if:{{lc:{{{qualities|}}}}} | {{#arraydefine:qualities|{{{qualities|}}}|,}}}}
|[[File:{{{1}}}.png]]
+
| {{name|{{{1|}}}|link={{{name|}}}}}
|[[{{{1}}}]]
+
| data-sort-value="{{{2|}}}"|{{#iferror: {{price|{{{2|}}}}} | {{{2|}}} | {{price|{{{2|}}}}} }}
|{{{2}}}
+
| {{#arrayprint:qualities|{{!}}{{!}}| $quality
|{{FairPointsValue|{{{2}}}}}
+
| <nowiki/> {{#ifexpr: {{#ifeq:{{{3|n}}}|y|1| $quality < 1 }}
 +
  | {{#iferror: {{#expr: {{{2}}} * (1 + $quality * .25) }}
 +
    | data-sort-value="00"{{!}}&mdash;
 +
    | {{#arraydefine: prices | {{#expr: {{{2}}} * (1 + $quality * .25)}} | <nowiki/> }}
 +
      {{#arrayprint: prices || $price
 +
      | {{#expr: 1 + $quality
 +
        + {{#expr:  19 < $price }}
 +
        + {{#expr:  89 < $price }}
 +
        + {{#expr: 199 < $price }}
 +
        + {{#expr: 299 < $price and $quality < 2 }}
 +
        + {{#expr: 399 < $price and $quality < 1 }}
 +
        }}
 +
      }}<!-- arrayprint: prices -->
 +
    }}<!-- iferror -->
 +
  | data-sort-value="00"{{!}}&mdash; <!-- !ifexpr -->
 +
  }} <!-- end ifexpr -->
 +
}}<!-- arrayprint:qualities --></includeonly><noinclude>
 +
==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.
  
<!-- silver and gold values, if requested -->
+
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.
{{#ifeq: {{{3}}}|y|
 
  
{{!}}<!--silver value-->
+
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.
{{#iferror: {{{2}}} + 1
 
|
 
{{{2}}}
 
|
 
{{#ifexpr:
 
{{#expr: 2 + {{FairPointsValue|{{#expr: {{{2}}} * 1.50}}}}}} > 6 | 6 | {{#expr: 2 + {{FairPointsValue|{{#expr: {{{2}}} * 1.50}}}}}}
 
}}
 
}}<!-- //end silver value -->
 
  
{{!}}<!--gold value-->
+
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>
{{#iferror: {{{2}}} + 1
 
|
 
{{{2}}}
 
|
 
{{#ifexpr:
 
{{#expr: 2 + {{FairPointsValue|{{#expr: {{{2}}} * 1.50}}}}}} > 6 | 6 | {{#expr: 2 + {{FairPointsValue|{{#expr: {{{2}}} * 1.25}}}}}}
 
}}
 
}}<!-- //end gold value -->
 
  
|
+
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==
}}<!-- //end gold/silver point values --><!--
+
<pre>{{FairPoints}}</pre>
--></includeonly><noinclude>
+
 
Creates a sortable table entry for a given item's value in the Stardew Valley Fair grange display.
+
==Example==
First argument is the item name, and the second argument is its value.
+
<pre>
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.
+
{| class="wikitable sortable"
The point value for silver and gold items is calculated assuming that judging is based on the quality value of the item instead of the base value, i.e. silver items are worth (1 + points(1.25 * base)) instead of just (1 + points(base)).
+
!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}}
 +
|}</pre>
  
 
{| class="wikitable sortable"
 
{| class="wikitable sortable"
!Image
+
!Item
!Name
+
!Price
!Value
+
!Base
!Points
 
 
!Silver
 
!Silver
 
!Gold
 
!Gold
{{FairPoints|Radish|60|y}}
+
!Iridium
 +
{{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}}
 
|}
 
|}
 
+
[[Category:Archived templates]]</noinclude>
</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