Template:Inventory: Difference between revisions

1,372 bytes added ,  15:40, 3 July 2022
m
support * argument for quantity
mNo edit summary
m (support * argument for quantity)
 
(15 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<noinclude>{{#cargo_declare:_table=Inventory|Item=String|Quantity=Integer|Equipped=Boolean}}[[Category:Templates]]</noinclude>
<noinclude>{{#cargo_declare:_table=Inventory|Item=String|ItemID=String|Population=String|Quantity=String|Equipped=Boolean|Chance=Integer|JoinKey=String}}[[Category:Cargo Store Templates]]</noinclude><includeonly>{{#cargo_store:_table=Inventory
<includeonly>{{#cargo_store:_table=Inventory|Item={{{1|}}}|Quantity={{{2|1}}}|Equipped={{{3|yes}}}}}<p>[[{{{1}}}]] x{{{2|1}}} {{#ifeq:{{{3|yes}}} | yes | {{color | y |(equipped)}} }}</p></includeonly><noinclude>
|Item={{#ifeq:{{{5|no}}}|yes||{{ID to page|{{{1|}}}}}}}
|ItemID={{#ifeq:{{{5|no}}}|yes||{{{1|}}}}}
|Population={{#ifeq:{{{5|no}}}|yes|{{{1|}}}|}}
|Quantity={{{2|1}}}
|Equipped={{{3|no}}}
|Chance={{{4|100}}}
|JoinKey={{FULLPAGENAME}}}}<!--
 
  CONTENT START
 
-->{{#invoke:Inventory| main |{{{1|}}}|{{{2|1}}}|{{{3|no}}}|{{{4|100}}}|{{{5|no}}}}}</includeonly><noinclude>
 
Template for inventory items that a Character is carrying. Meant for use in the <code>Character</code> template.
 
{| class="wikitable"
{| class="wikitable"
! 1st argument
! 1st argument
| item name. use string, it will auto link
| item name. use string, it will turn it into a link using [[Template:favilink]].
|-
|-
! 2nd argument
! 2nd argument
| quantity. defaults to 1
| quantity. defaults to 1. Can be set to '*' in combination with 5th argument set to 'yes' to represent a complex population that might return various items.
|-
|-
! 3rd agument
! 3rd argument
| if the item is equipped. defaults to yes
| is the item equipped? Enter <code>yes</code> here to indicate that the item is equipped (used for Cargo storage).
|}</noinclude>
|-
! 4th argument
| percent chance that the item will be in the character's inventory. 100 by default.
|-
! 5th argument
| 'yes' if this is a population table name. 'no' if this is a normal object ID.
|}
 
===Examples===
<code><nowiki>{{inventory|hypertractor}}</nowiki></code>
 
Character is carrying 1 hypertractor that is not equipped.
 
 
<code><nowiki>{{inventory|ulnar stimulators|2}}</nowiki></code>
 
Character is carrying 2 ulnar stimulators that are not equipped.
 
 
<code><nowiki>{{inventory|laser pistol|2|yes}}</nowiki></code>
 
Character is carrying 2 laser pistols that are both equipped.
 
 
<code><nowiki>{{inventory|electrobow|1|no|20}}</nowiki></code>
 
Character has a 20% chance to be carrying 1 electrobow, which is not equipped.
</noinclude>