Jump to content

Template talk:RecipeRow/NoBuffsHealthEnergy

From Stardew Valley Wiki
Revision as of 19:17, 1 May 2024 by imported>群星之尘 (→Showing crafting recipes: new section)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Showing crafting recipes

I found this template can be used to display crafting recipes conveniently while updating them, but a problem occurs while showing selling prices.

  • I'd better to discuss about this before changing the template :)

Comparison

Coral is no longer used to craft Deluxe Speed-Gro in v1.6, so let's use Coral as an example. I'm sorry for that, but for a better explanation of the problem, I deleted the line "sellprice = Cannot be sold" in the page Bait Maker. You could revoke that change if it is necessary.

The old code

{|class="wikitable sortable roundedborder"
!Image
!Name
!Description
!Ingredients
!Recipe Source
|-
|[[File:Warp Totem Beach.png|center]]
|[[Warp Totem: Beach]]
|{{Description|Warp Totem: Beach}}
|{{name|Hardwood|1}}{{name|Coral|2}}{{name|Fiber|10}}
|[[File:Foraging Skill Icon.png|24px|link=]] [[Foraging#Foraging Skill|Foraging]] Level 6
|-
|[[File:Bait Maker.png|center]]
|[[Bait Maker]]
|{{Description|Bait Maker}}
|{{name|Iron Bar|3}}{{name|Coral|3}}{{name|Sea Urchin|1}}
|[[File:Fishing Skill Icon.png|24px|link=]] [[Fishing#Fishing Skill|Fishing]] Level 6
|}
Image Name Description Ingredients Recipe Source
Warp Totem: Beach Warp directly to the beach. Consumed on use. Hardwood (1) Coral (2) Fiber (10) Foraging Level 6
Bait Maker Place a fish inside to create targeted bait. Iron Bar (3) Coral (3) Sea Urchin (1) Fishing Level 6

The new code

{{Recipes|header|hide=buff,duration,restores|crafting=true}}
{{:Warp Totem: Beach|RecipeRow/NoBuffsHealthEnergy}}
{{:Bait Maker|RecipeRow/NoBuffsHealthEnergy}}
{{Recipes|footer}}


Image Name Description Ingredients Recipe Source(s) Sell Price
Warp Totem: Beach Warp directly to the beach. Consumed on use. Hardwood (1) Coral (2) Fiber (10) Foraging Level 6 data-sort-value="20">20g
RecipeRow/NoBuffsHealthEnergy
Information
Source Crafting
Sell Price Cannot be sold
Crafting
Recipe Source Fishing (Level 6)
Ingredients Iron Bar (3) Coral (3) Sea Urchin (1)
Produces Targeted Bait (5-10)

{{#seo: keywords=Stardew Valley Wiki, Stardew Valley, RecipeRow/NoBuffsHealthEnergy, gift site_name=Stardew Valley Wiki type=article title=RecipeRow/NoBuffsHealthEnergy - Stardew Valley Wiki

}} The Bait Maker is a piece of Refining Equipment that is used to create Targeted Bait from any fish. It takes 10m to process fish into bait. It can be crafted after reaching Fishing Level 6.

To use, insert any fish into the machine. It will then produce 5-10 "[fish name] Bait," which will increase the chance of catching that fish when attached. Any fish can be used, including Legendary Fish (which cannot be caught more than once per save file) and Crab Pot Fish. However, catchable items such as Seaweed, Algae, and Jelly cannot be put into the Bait Maker.

History

  • 1.6: Introduced.


de:Köderhersteller es:CreaCebos fr:Fabricant d'appâts it:Macchina per esche ja:エサ製造器 ko:미끼 제작기 hu:Csalikészítő pt:Máquina de Iscas ru:Автонаживщик tr:Yem Yapıcı zh:鱼饵制造机

Discussion

I believe this template works really well, because the code is clean and tidy. What's more, it frees us from repetitive work. If another update comes and some recipes are changed, what we need to do will only be editing the main page of the changed item, instead of copying the work to every ingredient.

However, since this page is designed for cooking recipes initially, they haven't considered the case that the items cannot be sold. You can see that an error "data-sort-value="">g" will take place in the "Sell Price" line of the Bait Maker (BTW, using the unchanged infobox of Bait Maker results in a more terrible error).

My suggestion: A switch function could be added to check whether the item is priceless in Template:Infobox cooking and Template:RecipeRow/NoBuffsHealthEnergy. See the "default sellprice" in Template:Infobox:

<td id="infoboxdetail">{{#switch:{{lc:{{{sellprice|}}}}}
			|n/a|unverkäuflich|n/d|no puede venderse|cannot be sold|''cannot be sold''|ne peut être vendu|non può essere venduto|なし|売却不可|해당 없음|판매 불가|nem lehet eladni|não pode ser vendido|н/д|нельзя продать|satılamaz|不适用|不能出售|不可出售 = ''Cannot be sold''
			|#default = 
				{{#switch:{{lc:{{{quality|all}}}}}
					|false|normal = {{#iferror: {{Price|{{{sellprice|}}}}} | {{{sellprice|}}} | {{Price|{{{sellprice|}}}}} }}
					|#default = {{Qualityprice|{{{eng|Blank icon}}}|{{{sellprice|0}}}|dsv=false}} 
				}} }}
		</td>

Unfortunately, I haven't used this programming language in wiki before, so I'm afraid coding is difficult for me. Maybe some excellent programmers could help? Thank you very much :) 群星之尘 (talk) 19:17, 1 May 2024 (UTC)