Editing Module:ItemData/doc

Warning: You are not logged in. Once you make an edit, a temporary account will be created for you. Learn more. Log in or create an account to continue receiving notifications after this account expires, and to access other features.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision Your text
Line 1: Line 1:
Loads data from [[Data:ItemData.json]]
Loads data from [[Data:ItemData.json]]
==Usage==
 
<pre>{{#invoke:ItemData|FUNCTION_NAME|PARAMETER1|PARAMETER2}}</pre>
==Functions==
==Functions==
*<code>get_cost|ITEM_NAME</code>
* get_cost|ITEM_NAME
**Returns the total cost including components. 
* get_type|ITEM_NAME
*<code>get_type|ITEM_NAME</code>
* is_active|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
** returns true/false
*<code>is_active|ITEM_NAME</code>
* get_prop|ITEM_NAME|PROPERTY
**returns true/false
** check the [[Data:ItemData.json|json file]] for item properties
*<code>get_prop|ITEM_NAME|PROPERTY</code>
==TO DO==
**Returns the value of one of the item's properties. Check the [[Data:ItemData.json|json file]] for item properties
Its difficult to get a list of what items are components because components are listed under each full item rather than it being a true/false flag
**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==
To get the total cost of [[Boundless Spirit]] you'd type:
<pre>{{#invoke:ItemData|get_cost|Boundless Spirit}}</pre>
and it would return:
 
<code>{{#invoke:ItemData|get_cost|Boundless Spirit}}</code>
 
To get Boundless Spirit's Spirit Power:
<pre>{{#invoke:ItemData|get_prop|Boundless Spirit|TechPower}}</pre>
and it would return:
 
<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>
Please note that all contributions to The Deadlock Wiki are considered to be released under the Creative Commons Attribution-NonCommercial-ShareAlike (see Deadlock:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!
Cancel Editing help (opens in new window)
Preview page with this template