Module:ItemData/doc: Difference between revisionsGive feedback
Jump to navigation
Jump to search
Gammaton32 (talk | contribs) updated |
Updated doc with new functions explained |
||
| (3 intermediate revisions by 2 users not shown) | |||
| Line 10: | Line 10: | ||
**returns true/false | **returns true/false | ||
*<code>get_prop|ITEM_NAME|PROPERTY</code> | *<code>get_prop|ITEM_NAME|PROPERTY</code> | ||
**Returns the value of one of the item's properties. Check the [[Data:ItemData.json|json file]] for item properties | **Returns the value of one of the item's properties. Check the [[Data:ItemData.json|json file]] for item properties. | ||
**Automatically appends "%" to percentage-based properties and shows scaling templates (Boon/Ss) when applicable. | |||
*<code>get_codename|ITEM_NAME</code> | |||
**Returns the item's codename in game files | |||
*<code>get_component_name|ITEM_NAME</code> | |||
**Returns the display name of the item's first component (if any) | |||
*<code>get_headcount</code> | |||
**Returns the number of items that are not disabled | |||
*<code>get_builds_into|ITEM_NAME</code> | |||
**Returns a formatted list of items that use this item as a component, rendered with ItemIcon templates (e.g., "ItemIcon templates separated by commas and 'and'") | |||
*<code>get_builds_into_count|ITEM_NAME</code> | |||
**Returns the number of items that use this item as a component | |||
*<code>get_builds_into_name|ITEM_NAME|INDEX</code> | |||
**Returns the display name of the nth item (1-indexed) that uses this item as a component | |||
==Example== | ==Example== | ||
| Line 24: | Line 37: | ||
<code>{{#invoke:ItemData|get_prop|Boundless Spirit|TechPower}}</code> | <code>{{#invoke:ItemData|get_prop|Boundless Spirit|TechPower}}</code> | ||
If an item key (English name) has been provided, the item name can be replaced by: | |||
<pre>{{#var:item_key_or_en}}</pre> | |||
for example: | |||
<pre>{{#invoke:ItemData|get_prop|{{#var:item_key_or_en}}|TechPower}}</pre> | |||
To get Boundless Spirit's codename: | |||
<pre>{{#invoke:ItemData|get_codename|Boundless Spirit}}</pre> | |||
and it would return: | |||
<code>{{#invoke:ItemData|get_codename|Boundless Spirit}}</code> | |||
To find what items Debuff Reducer builds into: | |||
<pre>{{#invoke:ItemData|get_builds_into|Debuff Reducer}}</pre> | |||
and it would return: | |||
<code>{{#invoke:ItemData|get_builds_into|Debuff Reducer}}</code> | |||
Latest revision as of 17:19, 17 February 2026
Loads data from Data:ItemData.json
Usage
[edit source]{{#invoke:ItemData|FUNCTION_NAME|PARAMETER1|PARAMETER2}}
Functions
[edit source]get_cost|ITEM_NAME- Returns the total cost including components.
get_type|ITEM_NAME- The ItemData.json has different names for each category: Weapon = Weapon, Vitality = Armor, Spirit = Tech. This function will return Weapon, Vitality, or Spirit
is_active|ITEM_NAME- returns true/false
get_prop|ITEM_NAME|PROPERTY- Returns the value of one of the item's properties. Check the json file for item properties.
- Automatically appends "%" to percentage-based properties and shows scaling templates (Boon/Ss) when applicable.
get_codename|ITEM_NAME- Returns the item's codename in game files
get_component_name|ITEM_NAME- Returns the display name of the item's first component (if any)
get_headcount- Returns the number of items that are not disabled
get_builds_into|ITEM_NAME- Returns a formatted list of items that use this item as a component, rendered with ItemIcon templates (e.g., "ItemIcon templates separated by commas and 'and'")
get_builds_into_count|ITEM_NAME- Returns the number of items that use this item as a component
get_builds_into_name|ITEM_NAME|INDEX- Returns the display name of the nth item (1-indexed) that uses this item as a component
Example
[edit source]To get the total cost of Boundless Spirit you'd type:
{{#invoke:ItemData|get_cost|Boundless Spirit}}
and it would return:
6,400
To get Boundless Spirit's Spirit Power:
{{#invoke:ItemData|get_prop|Boundless Spirit|TechPower}}
and it would return:
30
If an item key (English name) has been provided, the item name can be replaced by:
{{#var:item_key_or_en}}
for example:
{{#invoke:ItemData|get_prop|{{#var:item_key_or_en}}|TechPower}}
To get Boundless Spirit's codename:
{{#invoke:ItemData|get_codename|Boundless Spirit}}
and it would return:
upgrade_boundless_spirit
To find what items Debuff Reducer builds into:
{{#invoke:ItemData|get_builds_into|Debuff Reducer}}
and it would return: