Difference between revisions of "Template:Consumable test"

From Stoneshard wiki
Jump to navigation Jump to search
m
Tag: Manual revert
(fix for shovel damage and damage type variables spillover)
 
(15 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<includeonly><!--
<includeonly><!--
--- Define variables for properties used more than once in the template - goal is to only load each property from the Data page once. ---
--- If item name is provided as parameter, use the parameter instead of root page. ---
-->{{#vardefine:Name|{{:Consumable_data|{{ROOTPAGENAME}}|Name}}}}<!--
-->{{#vardefine:Page|{{#if:{{{1|}}}|{{{1|}}}|{{ROOTPAGENAME}}}}}}<!--
-->{{#vardefine:PropertyText|{{:Consumable_data|{{ROOTPAGENAME}}|PropertyText}}}}<!--
--- Load complete datastring into a variable - to only load from the Armor data page once. ---
-->{{#vardefine:Freshness|{{:Consumable_data|{{ROOTPAGENAME}}|Freshness}}}}<!--
-->{{#vardefine:Datastring|{{:Consumable_data|{{#var:Page}}}}}}<!--
-->{{#vardefine:Uses|{{:Consumable_data|{{ROOTPAGENAME}}|Uses}}}}<!--
--- Separate values from datastring into individual variables. ---
-->{{#vardefine:Durability|{{:Consumable_data|{{ROOTPAGENAME}}|Durability}}}}<!--
-->{{#vardefine:SubPage|{{#if:{{SUBPAGENAME}}|{{SUBPAGENAME}}|{{#var:Page}}}}}}<!--
-->{{#vardefine:Description|{{:Consumable_data|{{ROOTPAGENAME}}|Description}}}}<!--
-->{{#vardefine:BasePage|{{#if:{{BASEPAGENAME}}|{{BASEPAGENAME}}|{{#var:Page}}}}}}<!--
-->{{#vardefine:Price|{{:Consumable_data|{{ROOTPAGENAME}}|Price}}}}<!--
-->{{#vardefine:OtherPage|{{#if:{{PAGENAME}}|{{PAGENAME}}|{{#var:Page}}}}}}<!--
-->{{#vardefine:Image|{{:Consumable_data|{{ROOTPAGENAME}}|Image}}}}<!--
-->{{#vardefine:Price|{{#explode: {{#var:Datastring}}|§|0}}}}<!--
-->{{#vardefine:Image2|{{:Consumable_data|{{ROOTPAGENAME}}|Image2}}}}<!--
-->{{#vardefine:Tier|{{#explode: {{#var:Datastring}}|§|2}}}}<!--
-->{{#vardefine:Category|{{#explode: {{#var:Datastring}}|§|3}}}}<!--
-->{{#vardefine:Subcategory|{{#explode: {{#var:Datastring}}|§|4}}}}<!--
-->{{#vardefine:MiddleText|{{#explode: {{#var:Datastring}}|§|-1}}}}<!--
-->{{#vardefine:Freshness|{{#explode: {{#var:Datastring}}|§|7}}}}<!--
-->{{#vardefine:Fodder|{{#explode: {{#var:Datastring}}|§|78}}}}<!--
-->{{#vardefine:NoProperties|{{#ifeq: {{#var:Category}}|junk|1|}}}}<!--
-->{{#vardefine:Uses|{{#ifeq: {{#var:Category}}|ingredient||{{#explode: {{#var:Datastring}}|§|9}}}}}}<!--
-->{{#vardefine:Description|{{#explode: {{#var:Datastring}}|§|-2}}}}<!--
-->{{#vardefine:Name|{{#explode: {{#var:Datastring}}|§|-3}}}}<!--
--- Some items from Consumable data table have hardcoded stats, we define them here ---
--- Durability ---
-->{{#vardefine:Durability|{{#switch: {{#var:Page}}
|Surgeon Toolkit = 20
|Shovel = 100
|}}}}<!--
--- Damage and Damage Type ---
-->{{#switch: {{#var:Page}}
|Shovel = {{#vardefine:Damage|16}}{{#vardefine:DamageType|Crushing}}
|}}<!--
--- Consumable Tooltip start. ---
--- Consumable Tooltip start. ---
-->{| width=300px;
-->{| width=300px;
|style="text-align:center;"|<!--
|style="text-align:center;"|<!--
--- Check if item is marked as unobtainable. ---
--><span style="font-size: 20px;">{{#if:{{#var:Name}}|{{Translate|{{#var:Name}}|ConsumableNames}}|{{Translate|{{#var:Page}}|ConsumableNames}}}}</span><br /><!--
-->{{#if:{{:Consumable data|{{ROOTPAGENAME}}|Unobtainable}}|{{Unobtainable}}<br />|}}<!--
--><span style="color:#9d9a9a;">{{Translate|{{#var:Category}}|Properties}}</span><!--
--- Check if parameter Name exists, if yes, use that parameter value as Name, otherwise use ROOTPAGENAME. For items with name identical to another (Dirk item vs Dirk NPC). ---
|-
--><span style="font-size: 20px;">{{Translate|{{#if:{{#var:Name}}|{{#var:Name}}|{{ROOTPAGENAME}}}}|ConsumableNames}}</span><br /><!--
|style="text-align:center;"|<!--
--><span style="color:#9d9a9a;">{{Translate|{{:Consumable data|{{ROOTPAGENAME}}|ItemType}}|Properties}}</span><!--
--- If the item has damage value, show it ---
-->{{#if:{{#var:Damage}}{{#var:DamageType}}|{{Tooltip rule}}{{#var:Damage}} {{Translate|{{#var:DamageType}}|Properties}} {{Translate|Damage|Properties}}<!--
--- Then set damage variables back to empty string ---
-->{{#vardefine:Damage|}}{{#vardefine:DamageType|}}<!-- end damage if -->|}}<!--
--- Check if item has no Properties at all, if yes, then don't add a horizontal rule, otherwise add it. ---
--- Check if item has no Properties at all, if yes, then don't add a horizontal rule, otherwise add it. ---
-->{{#if: {{:Consumable data|{{ROOTPAGENAME}}|NoProperties}}|{{Tooltip rule}} }}
--> {{#if: {{#var:NoProperties}}||{{Tooltip rule}}}}
|-
|-
|<div style="width:100%;color:white;">{{Test|{{ROOTPAGENAME}}}}<!--
|<div style="width:100%;color: white;">{{Test|{{#var:Page}}}}<!--
-->{{#if: {{#var:PropertyText}} | <div style="float:left;">{{#if:{{:Consumable data|{{ROOTPAGENAME}}|Properties1}}|<br>|}}{{#if: {{#titleparts: {{PAGENAME}} | 1 | 2}} | {{#ifeq: {{PAGENAME}} | {{ROOTPAGENAME}}/Tooltip | {{#var:PropertyText}} | {{Translate|{{ROOTPAGENAME}}|ConsumableDescriptions}}}} | {{#var:PropertyText}}}}</div> {{Clear}}|}}</div><!--
-->{{#if: {{#var:MiddleText}} | <div>{{#if: {{#titleparts: {{#var:OtherPage}} | 1 | 2}} | {{#ifeq: {{#var:OtherPage}} | {{#var:Page}}/Tooltip | {{#var:MiddleText}} | {{Translate|{{#var:Page}}|ConsumableDescriptions}}}} | {{#var:MiddleText}}}}</div>{{#if: {{#var:Freshness}}{{#var:Uses}}{{#var:Durability}}|<br>}}|}}</div><!--
-->{{#if: {{#var:Freshness}} | {{#ifeq: {{#var:Freshness}}|0|<br><div><span style="color:white;">Does not spoil over time.</span></div>|<br><div style="color:#9d9a9a;">{{Translate|Will spoil in|Properties}} <span style="color:white;">{{#iferror: {{#expr: ceil({{#var:Freshness}}/24) }}|error}} {{#iferror: {{#ifexpr: {{#var:Freshness}} > 24 |days|day}}|error}}.</span></div>}}}}<!--
-->{{#if: {{#var:Freshness}} | {{#ifeq: {{#var:Freshness}}|0|<div><span style="color:white;">Does not spoil over time.</span></div>{{#if: {{#var:Uses}}|<br>}}|<div style="color:#9d9a9a;">{{Translate|Will spoil in|Properties}} <span style="color:white;">{{#iferror: {{#expr: ceil({{#var:Freshness}}/24) }}|error}} {{#iferror: {{#ifexpr: {{#var:Freshness}} > 24 |days|day}}|error}}.</span></div>{{#if: {{#var:Uses}}|<br>}}}}}}<!--
-->{{#if: {{#switch:{{#var:Uses}}|0|1=|{{#var:Uses}}}} | <br><div style="color:#9d9a9a;">{{Translate|Uses|Properties}}: <span style="color:white;">{{#var:Uses}}/{{#var:Uses}}</span></div> | }}<!--
---USES START---
-->{{#if: {{#var:Durability}} | <br><div style="color:#9d9a9a;">{{Translate|Durability|Properties}}: <span style="color:white;">{{#var:Durability}}/{{#var:Durability}}</span></div> | }}
-->{{#if: {{#switch:{{#var:Uses}}|0|1=|{{#var:Uses}}}} |<div style="color:#9d9a9a;">{{Translate|Uses|Properties}}: <span style="color:white;">{{#var:Uses}}/{{#var:Uses}}</span></div>{{#if: {{#var:Durability}}|<br>}}| }}<!--
-->{{#if: {{#var:Durability}} |<div style="color:#9d9a9a;">{{Translate|Durability|Properties}}: <span style="color:white;">{{#var:Durability}}/{{#var:Durability}}</span></div>}}<!--
---USES END---
--- FODDER, only for herbs ---
-->{{#if: {{#var:Fodder}} |{{#ifeq: {{#var:Category}}|ingredient|<span style="color:white;">Can be used for crafting {{C|Light Brown|Fodder}}.</span>|}}|}}
|-
|-
|style="color:#9d7969;"|{{Tooltip rule}}{{#if: {{#titleparts: {{PAGENAME}} | 1 | 2}} | {{#ifeq: {{PAGENAME}} | {{ROOTPAGENAME}}/Tooltip | {{#var:Description}} | {{Translate|{{ROOTPAGENAME}}|ConsumableDescriptions}}}} | {{#var:Description}}}}{{#if:{{#var:Price}}|<div style="float:right">[[File:Gold_Icon.png|18px|alt={{Translate|Price|Properties}}|link=|{{Translate|Price|Properties}}]]{{W|{{#var:Price}}}}</div>}} <br />
|style="color:#9d7969;"|{{Tooltip rule}}{{#if: {{#titleparts: {{#var:OtherPage}} | 1 | 2}} | {{#ifeq: {{#var:OtherPage}} | {{#var:Page}}/Tooltip | {{#var:Description}} | {{Translate|{{#var:Page}}|ConsumableDescriptions}}}} | {{#var:Description}}}}{{#if:{{#var:Price}}|<div style="float:right">[[File:Gold_Icon.png|18px|alt={{Translate|Price|Properties}}|link=|{{Translate|Price|Properties}}]]{{W|{{#var:Price}}}}</div>}} <br />
|-
|-
|style="text-align:center;"|[[File:{{#if:{{#var:Image}}|{{#var:Image}}|{{ROOTPAGENAME}}.png}}|class=image2x|link={{#ifeq:{{SUBPAGENAME}}|Tooltip|{{BASEPAGENAME}}|{{PAGENAME}}/Tooltip}}|alt={{Translate|{{ROOTPAGENAME}}|ConsumableNames}}|{{Translate|{{ROOTPAGENAME}}|ConsumableNames}}]]{{#if:{{#var:Image2}}|[[File:{{#var:Image2}}|class=image2x|link={{#ifeq:{{SUBPAGENAME}}|Tooltip|{{BASEPAGENAME}}|{{PAGENAME}}/Tooltip}}|alt={{Translate|{{ROOTPAGENAME}}|ConsumableNames}}|{{Translate|{{ROOTPAGENAME}}|ConsumableNames}}]]}}
|style="text-align:center;"|[[File:{{#if:{{#var:Image}}|{{#var:Image}}|{{#var:Page}}.png}}|class=image2x|link={{#ifeq:{{#var:SubPage}}|Tooltip|{{#var:BasePage}}|{{#var:OtherPage}}/Tooltip}}|alt={{Translate|{{#var:Page}}|ConsumableNames}}|{{Translate|{{#var:Page}}|ConsumableNames}}]]{{#if:{{#var:Image2}}|[[File:{{#var:Image2}}|class=image2x|link={{#ifeq:{{#var:SubPage}}|Tooltip|{{#var:BasePage}}|{{#var:OtherPage}}/Tooltip}}|alt={{Translate|{{#var:Page}}|ConsumableNames}}|{{Translate|{{#var:Page}}|ConsumableNames}}]]}}
|}
|}
</includeonly><noinclude>{{doc}}
</includeonly><noinclude>{{doc}}


[[Category:Tooltip templates]]</noinclude>
[[Category:Tooltip templates]]</noinclude>

Latest revision as of 03:42, 3 September 2025

Template-info.png Documentation

This is item template created for use together with the Template:Tooltip hover box template to display tooltip with item attributes for Consumables.

Usage: Copy this code to any page where you want to display the item tooltip:

{{{{{1|Tooltip hover box}}}|title={{Consumable_test}}}}

You can provide the item name as first parameter, otherwise the pagename is used.

By default, the page is also labelled with a category corresponding to the item type (ie. Bread will receive the Category: Food). If you don't want to add this category to a page, add the category parameter:

{{{{{1|Tooltip hover box}}}|title={{Consumable_test|Bread|category=no}}}}


Examples with properties


Butter
additive
Energy Restoration: +1% (240 t)
 
Hunger: -4%
Hunger Resistance: +3% (240 t)
 
When added to a dish during cooking, grants it an additional effect:

+25% Hunger Resistance

Will spoil in 2 days.

As the saying goes, there's no such thing as too much butter. Can add it to pretty much anything.
Price16

Butter
Mannshire Fortified
alcohol
Thirst: -10%
Thirst Change: +0.1% (90 t)
Intoxication Change: +0.01% (90 t)
Pain Change: -0.1% (90 t)
Morale: +3%
Energy Replenishment: +5%
 
Causes light Drunkenness.

Uses: 2/2

The vineyards of Mannshire have barely started producing after being ravaged by war, so finding good wine is no easy task. This bottle is clearly old stock.
Price50

Mannshire Fortified
Jug of Milk
beverage
Crushing Resistance: +1%
 
Hunger: -3%
Hunger Resistance: +5% (30 t)
Thirst: -10%
Intoxication Resistance: +5% (30 t)
 
Will spoil in 3 days.

Uses: 2/2

A jug full of sweet-smelling fresh milk.
Price25

Jug of Milk
Al'qud
drug
Intoxication: +20%
 
Grants the following effect for 480 turns:

+25% Max Energy
+25% Energy Restoration
-15% Abilities Energy Cost

Using it leads to an unpleasant Aftermath.

The recipe of al'qud is among the most carefully guarded elven secrets. Only one thing is known for sure - it's prepared from some medicinal herb. Al'qud sees frequent use by maaf warriors when they need to stave off the fatigue of prolonged battles.
Price200

Al'qud
Roasted Fatty Meat
food
Hunger: -18%
Hunger Resistance: +12% (180 t)
Fatigue Change: -0.01% (180 t)
 
When added to a dish during cooking, grants it an additional effect:
-12% Hunger
-3% Fatigue

Will spoil in 2 days.

Uses: 2/2

A hefty steak, medium rare. A true warrior's lunch.
Price38

Roasted Fatty Meat
Agrimony
ingredient
Thirst: +15%
Intoxication: -3%
 
Immunity Change: +0.02% (60 t)
 
Can be used for crafting Fodder.

Agrimony powders and infusions are sold by most healers: when consumed with food, they have a restorative effect on the body.
Price5

Agrimony
Vivifying Essence
medicine
Healing Efficiency: -25% (60 t)
 
Sanity: -3%
Health Replenishment: +40%

When asked about its recipe, alchemists prefer to maintain mysterious silence.
Price200

Vivifying Essence
Broadhead Arrows
ammo
Weapon Damage: +10%
Armor Penetration: -15%
Bodypart Damage: +25%
 
Accuracy: -10%

Arrows like these often get stuck deep in the flesh, causing massive bleeding. However, they are rather heavy, cumbersome, and have limited uses against armor.
Price6

Broadhead Arrows


Examples without properties


Herbalist Satchel
backpack
Can be used to store items, with dedicated compartments for herbs, bottles, and large flasks.

Must be equipped before use.

The plentiful pouches make it possible to store an entire collection of flasks and herbs in an orderly, easy-to-find manner.
Price300

Herbalist Satchel
Pails of Cider
commodity
Might interest some merchants.

Proper cider is brewed exclusively in the southern reaches of Aldor - this customary Sentian beverage is a cornerstone of any local festivity.
Price300

Pails of Cider
Boar Banner
flag
When raised at the Caravan Camp, grants +5% Reputation Gain and +5% Pain Resistance.

A heraldic symbol of courage in the face of death.
Price100

Boar Banner
Skull
junk

Surprisingly well preserved.
Price2

Skull
Rope
material
Might interest some merchants.

The most useful item in every household.
Price10

Rope
Convict's Hand
quest
This item is required for completing your contract.

The convict's brand is clearly visible on the back of this hand - such markings are burned into the skin before sending a criminal to the quarries.
Convict's Hand
"Osbrook Bread Bowl Stew"
recipe
Required ingredients:

• Pot of Water
• Bear Fat, Salted Bear Fat
• Bread
• Vegetable
• Leek, Onion, Garlic

Optional: Additives

A scrap of paper containing a detailed recipe. Might be worthwhile to give it a try.
Price235

Osbrook Bread Bowl Stew (Recipe)
Fodder
resource
A resource required for Caravan travels.

Grain and some other types of food and herbs can be transformed into fodder in the crafting menu.

A filling mix of multiple grains and herbs.
Price1

Fodder
Map of Osbrook Outskirts
scroll
Using it reveals the terrain and certain locations within a specific area on the global map.

A lot has transpired over the last few years, but this old pre-war map might still contain some useful information.
Price25

Map of Osbrook Outskirts
Hunting Net
tool
Hitting the target applies it with "Net":

+35% Fumble Chance
-50% Dodge Chance
-50% Block Chance
-50% Counter Chance
+35% Backfire Chance

The duration of the effect and the net's durability loss depend on the target's size.

The effect can't be applied to tiny and giant targets.

An indispensable tool for hunting small and medium game.
Price60

Hunting Net
Foldable Flagpole
upgrade
Required for the Caravan upgrade, "Caravan Banner".

When the future lacks certainty, symbols become more important than ever.
Price100

Foldable Flagpole
Amethyst
valuable
Might interest some merchants.

A gem prized for its rich color.
Price150

Amethyst
Hazzun Celestial Sphere
treasure
Can be activated on the surface once per day.

If activated during day time, grants one of these effects at random for 1440 turns: Sturdiness or Life Drain

If activated during night time, grants one of these effects at random for 2880 turns: Energy Drain or Receptiveness

An extraordinary large, spherical morion with a detailed celestial map inscribed on its finely-polished surface. This artifact held a prominent place in the rituals of Hazzun oracles - that is until it was captured by King Etbert's soldiers during the last of the Radiant Wars.
Price600

Hazzun Celestial Sphere
The Conquest of the Hills Tapestry
treasure
While in the Inventory, grants +15% Weapon Damage and -10% Damage Taken.

Conquering the Firn foothills was a major milestone for the Kingdom of Aldor. This tapestry was created by a nameless weaver to honor that grand victory and has been considered lost until now. Legends say that whoever has it in their possession is destined for great deeds.
Price600

The Conquest of the Hills Tapestry
"Hunting Net"
schematic
Required materials:

• Rope
• Rope
• Wire

A list of materials complete with concise but informative instructions for achieving the intended result.
Price80

Hunting Net (Recipe)


Some special cases


Surgeon Toolkit
medicine
Health Restoration: +10% (360 t)
Healing Efficiency: +30% (360 t)
 
Injury Treatment: +100%
 
The lower the Condition of a selected bodypart, the more painful the operation.

Durability: 20/20

The very case when expertise and courage are equally important.
Price100

Surgeon Toolkit
Dragon Fruit
food
Hunger: -5%
Thirst: -8%
Pain Change: -0.1% (30 t)
Fatigue Change: -0.1% (30 t)
 
Immunity Change: +0.25% (30 t)
 
Will spoil in 3 days.

Uses: 3/3

It's hard to believe this weird fruit to come from our world. The taste is nothing short of amazing.
Price60

Dragon Fruit
Shovel
tool
16 Crushing Damage
Allows for some digging.

Durability: 100/100

Be careful not to dig too greedily and too deep.
Price60

Shovel
Nonexistant Item

Data does not exist.

PriceData does not exist.

Nonexistant Item