Module:ItemData/doc: Difference between revisions

Jump to navigation Jump to search
LVL (talk | contribs)
Updated doc
LVL (talk | contribs)
Updated doc with new functions explained
 
Line 11: Line 11:
*<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.
**Automatically appends "%" to percentage-based properties and shows scaling templates (Boon/Ss) when applicable.
*<code>get_codename|ITEM_NAME</code>
*<code>get_codename|ITEM_NAME</code>
**Returns the item's codename in game files
**Returns the item's codename in game files
Line 18: Line 18:
*<code>get_headcount</code>
*<code>get_headcount</code>
**Returns the number of items that are not disabled
**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 43: Line 49:


<code>{{#invoke:ItemData|get_codename|Boundless Spirit}}</code>
<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>