Difference between revisions of "Template:Consumable test"
Jump to navigation
Jump to search
(consumable durability is hardcoded and only few items have it, define by switch statement) |
(fix for shovel damage and damage type variables spillover) |
||
| (3 intermediate revisions by the same user not shown) | |||
| Line 14: | Line 14: | ||
-->{{#vardefine:MiddleText|{{#explode: {{#var:Datastring}}|§|-1}}}}<!-- | -->{{#vardefine:MiddleText|{{#explode: {{#var:Datastring}}|§|-1}}}}<!-- | ||
-->{{#vardefine:Freshness|{{#explode: {{#var:Datastring}}|§|7}}}}<!-- | -->{{#vardefine:Freshness|{{#explode: {{#var:Datastring}}|§|7}}}}<!-- | ||
-->{{#vardefine:Fodder|{{#explode: {{#var:Datastring}}|§| | -->{{#vardefine:Fodder|{{#explode: {{#var:Datastring}}|§|78}}}}<!-- | ||
-->{{#vardefine:NoProperties|{{#ifeq: {{#var:Category}}|junk|1|}}}}<!-- | -->{{#vardefine:NoProperties|{{#ifeq: {{#var:Category}}|junk|1|}}}}<!-- | ||
-->{{#vardefine:Uses|{{#ifeq: {{#var:Category}}|ingredient||{{#explode: {{#var:Datastring}}|§|9}}}}}}<!-- | -->{{#vardefine:Uses|{{#ifeq: {{#var:Category}}|ingredient||{{#explode: {{#var:Datastring}}|§|9}}}}}}<!-- | ||
-->{{#vardefine:Description|{{#explode: {{#var:Datastring}}|§|-2}}}}<!-- | -->{{#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}} | -->{{#vardefine:Durability|{{#switch: {{#var:Page}} | ||
|Surgeon Toolkit = 20 | |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;"|<!-- | ||
--><span style="font-size: 20px;">{{Translate|{{#var:Page}}|ConsumableNames}}</span><br /><!-- | --><span style="font-size: 20px;">{{#if:{{#var:Name}}|{{Translate|{{#var:Name}}|ConsumableNames}}|{{Translate|{{#var:Page}}|ConsumableNames}}}}</span><br /><!-- | ||
--><span style="color:#9d9a9a;">{{Translate|{{#var:Category}}|Properties}}</span><!-- | --><span style="color:#9d9a9a;">{{Translate|{{#var:Category}}|Properties}}</span><!-- | ||
|- | |||
|style="text-align:center;"|<!-- | |||
--- 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: {{#var:NoProperties}}||{{Tooltip rule}}}} | --> {{#if: {{#var:NoProperties}}||{{Tooltip rule}}}} | ||
Latest revision as of 03:42, 3 September 2025
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
| Vivifying Essence medicine |
Healing Efficiency: -25% (60 t) Sanity: -3% Health Replenishment: +40% |
When asked about its recipe, alchemists prefer to maintain mysterious silence. |
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. |
| Herbalist Satchel |
| 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. |
|
| 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. |
| 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. |
| Map of Osbrook Outskirts |
| Foldable Flagpole upgrade |
Required for the Caravan upgrade, "Caravan Banner". |
When the future lacks certainty, symbols become more important than ever. |
| "Hunting Net" schematic |
Required materials: • Rope • Rope • Wire |
A list of materials complete with concise but informative instructions for achieving the intended result. |
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. |
| Surgeon Toolkit |
| Shovel tool 16 Crushing Damage |
Allows for some digging. Durability: 100/100
|
Be careful not to dig too greedily and too deep. |
| Nonexistant Item |
Data does not exist. |
| Nonexistant Item |




