Difference between revisions of "Template:Qualityprice/doc"

From Stardew Valley Wiki
Jump to navigation Jump to search
(Document prof_mult parameter)
Line 1: Line 1:
 
==Description==
 
==Description==
This template is used to provide a template that takes the base cost of each item, calculates the silver and gold quality costs, and displays it in a table. The cost calculation is silver=(basecost)*1.25 and gold=(basecost)*1.50. It always truncates the fraction (rounds down for positive numbers and up for negative numbers).
+
This template is used to provide a template that takes the base cost of each item, calculates the silver and gold quality costs, and displays it in a table. The cost calculation is silver=(basecost)*1.25 and gold=(basecost)*1.50. It always truncates any fraction (rounds down).
 +
 
 +
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 <tt>prof_mult</tt> parameter.
  
 
Note that this intentionally doesn't show the money icon as to not clutter the page with multiple icons.
 
Note that this intentionally doesn't show the money icon as to not clutter the page with multiple icons.
Line 12: Line 14:
 
{{Qualityprice|item name|item base cost}}
 
{{Qualityprice|item name|item base cost}}
 
{{Qualityprice|item name|item base cost|iridium quality|hide|size}}
 
{{Qualityprice|item name|item base cost|iridium quality|hide|size}}
 +
{{Qualityprice|item_name|item base cost|prof_mult=1.25}}
 
</pre>
 
</pre>
 
===parameters===
 
===parameters===
Line 19: Line 22:
 
; hide: (optional) Any quality listed here will hide that quality. Specifying iridium here and in the third parameter will result in an error.  To hide normal/regular quality, specify "hide=normal".
 
; hide: (optional) Any quality listed here will hide that quality. Specifying iridium here and in the third parameter will result in an error.  To hide normal/regular quality, specify "hide=normal".
 
; size: (optional) Size of item image in pixels (16, 32, 48, 64).  Default is 24.
 
; size: (optional) Size of item image in pixels (16, 32, 48, 64).  Default is 24.
 +
; prof_mult: (optional) Any other multipliers (e.g., profession price bonuses) that should be included in the calculated price.
  
 
===Example===
 
===Example===
Line 25: Line 29:
 
</pre>
 
</pre>
 
{{Qualityprice|Pumpkin|100}}
 
{{Qualityprice|Pumpkin|100}}
 +
 +
<pre>
 +
{{Qualityprice|Pumpkin|100|prof_mult=1.1}}
 +
</pre>
 +
{{Qualityprice|Pumpkin|100|prof_mult=1.1}}
  
 
<pre>
 
<pre>

Revision as of 05:47, 30 August 2020

Description

This template is used to provide a template that takes the base cost of each item, calculates the silver and gold quality costs, and displays it in a table. The cost calculation is silver=(basecost)*1.25 and gold=(basecost)*1.50. It always truncates any fraction (rounds down).

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.

Note that this intentionally doesn't show the money icon as to not clutter the page with multiple icons.

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

Usage

This template can be used by entering the following onto a relevant page.

{{Qualityprice|item name|item base cost}}
{{Qualityprice|item name|item base cost|iridium quality|hide|size}}
{{Qualityprice|item_name|item base cost|prof_mult=1.25}}

parameters

item name
This unnamed parameter accepts an item name.
item base cost
This unnamed parameter accepts the item's base cost.
iridium quality
(optional) If this unnamed parameter exist, iridium quality will be added.
hide
(optional) Any quality listed here will hide that quality. Specifying iridium here and in the third parameter will result in an error. To hide normal/regular quality, specify "hide=normal".
size
(optional) Size of item image in pixels (16, 32, 48, 64). Default is 24.
prof_mult
(optional) Any other multipliers (e.g., profession price bonuses) that should be included in the calculated price.

Example

{{Qualityprice|Pumpkin|100}}

data-sort-value="100"

Pumpkin.png
100g
Pumpkin.png
Silver Quality Icon.png
125g
Pumpkin.png
Gold Quality Icon.png
150g
Pumpkin.png
Iridium Quality Icon.png
200g
{{Qualityprice|Pumpkin|100|prof_mult=1.1}}

data-sort-value="100"

Pumpkin.png
100g
Pumpkin.png
Silver Quality Icon.png
125g
Pumpkin.png
Gold Quality Icon.png
150g
Pumpkin.png
Iridium Quality Icon.png
200g
{{Qualityprice|Leek|60|iridium}}

data-sort-value="60"

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

data-sort-value="42"

Apple.png
42g
Apple.png
Iridium Quality Icon.png
84g
{{Qualityprice|Apple|42|iridium|hide=silver,iridium}}

data-sort-value="42"

Apple.png
42g
Apple.png
Gold Quality Icon.png
63g