This wiki is a read-only version of the Stardew Valley Wiki. The official editable wiki maintained by ConcernedApe can be found at stardewvalleywiki.com

Template:Qualityprice

From Stardew Valley Wiki
Jump to: navigation, search

Qualityprice displays a table of the sell prices for a requested item for all item qualities. Each sell price is shown with the image icon and a superimposed quality star (see Template:Quality). It intentionally does not show the money icon so as to not clutter the page with multiple icons.

In order for the values to be calculated correctly, the input value should always be the item base cost. If other factors should be included (e.g., professions that increase the price), those factors should be specified using the prof_mult parameter.

For variable price items (Wine, Juice, Pickles, Jelly, Roe, Aged Roe, Honey, etc.)[1], this template also allows the item base price to be automatically calculated from the source item price.

Additionally, a sortkey is provided allowing correct sorting in tables where a column contains multiple instances of this template.

Notes

The sell price is calculated by:

  • Rounding down (truncating any fraction) on the input base cost (for the sake of derived base costs such as fruit-specific wine)
  • Applying the quality adjustment to the price: multiplying by 1.25 for Silver, 1.5 for Gold, or 2 for Iridium
  • Rounding down the quality-adjusted price
  • Applying any profession-related bonuses (from the prof_mult parameter)
  • Rounding down to yield the final displayed sell price.

This sequence of operations (and the specific order in which they are done) replicates the calculations done by the game code in Object::sellToStorePrice. Changing the order of operations and/or omitting any of the rounding-down steps will cause changes in the calculated values for some items and result in discrepancies between the wiki's displayed values and the actual in-game values.

Usage

Syntax

Basic usage:

{{Qualityprice |item_name| base_cost }}

Complete argument list:

{{Qualityprice |item_name| base_cost | prof_mult=mult | quality=values
               | srcprice=price | auto=true
               | iridium=true | hide=values | size=px | link=link | alt=alt | sortkey=value }}

Parameters

There are two unnamed, required parameters, item_name and base_cost. All other parameters are named and optional. Default value for all arguments is empty, unless specified otherwise.

See Template:ParseInputQuality for more information on quality-related parameters.

  • item_name
    • First unnamed parameter, required.
    • Name of item being displayed. There should be a corresponding image named File:item_name.png.
    • On non-english wikis this should normally be the english item_name. Even if there is a language-specific item image (e.g., File:Large Milk FR.png in French), it should not be necessary to alter the image name (Template:Quality automatically handles all variants of milk image names).
    • To provide the translated item name, see link and/or alt.
    • Note that there must be no spaces following the item_name -- the "|" symbol must come immediately afterwards, or the template will fail (due to quirks of how mediawiki templates process arguments)
  • base_cost
    • Second unnamed parameter.
    • Required unless srcprice and auto are specified AND the item is one whose price can be auto-calculated.[1]
    • The base cost of the displayed item.
    • Normally the base cost should be a numeric value (or valid numeric expression). If a non-numeric cost is provided, it will be printed as-is for all requested qualities (and the sortkey is set to "0" to hide the non-numeric data from any table-sorting).
  • prof_mult=mult
    • Any other multipliers (e.g., profession price bonuses) that should be included in the calculated price. Default value is 1.
    • This value is always ignored (prof_mult is forced to be 1) for Oil and Coffee, to ensure that the Artisan Profession bonus is not accidentally displayed for these items. This allows oil to be shown in multi-item infobox displays alongside other artisan goods without any special handling elsewhere.
  • quality=values
    • List of quality values to display. Default value is Normal, Silver, Gold
    • Set quality to true to get Normal, Silver, Gold, or
    • Set quality to false or Normal to get Normal, or
    • Set quality to one or more specific quality values
    • iridium is disabled by default. Enable by explicitly adding iridium to the listed quality values or by setting iridium=true
    • If auto is set and the displayed item is recognized, any input quality value will be ignored and instead the quality will be automatically set based on the item's default allowed qualities.
  • srcprice=price
    • The base price of the source item (e.g., vegetable, fruit, flower, or fish) used to create the displayed item.
    • Only relevant if auto is set, and the displayed item is one whose price depends upon the source item (Wine, Juice, Pickles, Jelly, Roe, Aged Roe, Honey, etc.)[1]. In which case, the item base price will be automatically derived from srcrprice.
    • For example, to display the price of Salmonberry Wine, set srcrprice=5.
  • auto=true
    • Set auto to true in order to allow quality and base_cost to be automatically set for recognized items.[1]
  • iridium=true
    • Set iridium to true to display iridium values.
    • Also recognizes iridium=false as equivalent to hide=iridium (although it's easier to just omit the entire iridium parameter)
  • hide=values
    • List of quality values to hide, as a comma-separated list of individual values.
    • In case of conflict, hide overrides any other input.
    • For backwards compatibility hide=base is recognized as equivalent to hide=normal, but this is deprecated.
  • size=px
    • Size of icons in pixels. Default value is 24
    • Only the number should be provided (do not append "px").
  • link=link
    • Name of page (without square brackets) that item icon should link to.
    • By default, link is automatically set to item_name.
    • Setting link to an empty value (|link=|) disables the image link (clicking on the item does nothing).
  • alt=alt
    • Alt text for item icon. Default value is link or item_name.
    • This is not normally directly displayed on the page, but may be used by screen readers or accessibility-aware browsers.
    • Setting alt to an empty value (|alt=|) disables the alt text.
  • sortkey=value
    • Override the value used for the sortkey. Default value is true, in which case the sortkey is set to the normal quality value (or to 0 for non-numeric data)
    • This parameter should not normally be necessary. One known use case, however, is when one table cell makes multiple calls to Qualityprice, in which case only one of the calls should be allowed to set a sortkey. Therefore, the sortkey should be set to an empty value on all but the first template call in a single cell.

Examples

{{Qualityprice|Pumpkin|100}}

Pumpkin
100g
Pumpkin
Silver
125g
Pumpkin
Gold
150g
{{Qualityprice|Pumpkin|100|prof_mult=1.1|link=Vegetables}}

Vegetables
110g
Vegetables
Silver
137g
Vegetables
Gold
165g
{{Qualityprice|Leek|60|iridium|link=}}

Leek
60g
Leek
Silver
75g
Leek
Gold
90g
Leek
Iridium
120g
{{Qualityprice|Apple|42|iridium|hide=gold,silver|size=48}}

Apple
42g
Apple
Iridium
84g
{{Qualityprice|Apple|42|iridium|hide=silver,iridium}}

Apple
42g
Apple
Gold
63g
{{Qualityprice|Wine|auto=true|srcprice=42|prof_mult=1.4}}

Wine
176g
Wine
Silver
219g
Wine
Gold
264g
Wine
Iridium
352g

References

  1. 1.0 1.1 1.2 1.3 The full list of items for which the quality and base price can be automatically set is: Wine, Juice, Jelly, Pickles, Honey, Roe, Caviar, Aged Roe, Pale Ale, Beer, and Mead. A few fixed-price items are included in this list so multiple-item infobox displays can be handled more easily.