ITEM.Collectable
The collectable item base. Also the parent of the card and sticker bases.
- SharedITEM:AutoBuild() → ITEMSource ☍
-
Automatically set name, descripition, category and unique ID.
Returns
- SharedITEM:AutoCategory() → ITEMSource ☍
-
Automatically set the item's category.
Returns
- SharedITEM:AutoDescription() → ITEMSource ☍
-
Automatically set the item's description from foil status, item / series title and collectable type.
Returns
- SharedITEM:AutoID() → ITEMSource ☍
-
Automatically set the item's unique ID
Returns
- SharedITEM:AutoName() → ITEMSource ☍
-
Automatically set the item name from foil status, item / series title and collectable type.
Returns
- SharedITEM:AutoRegister() → boolean|nilSource ☍
-
Build and register a collectable automatically.
Returns
- boolean|nil
- SharedITEM:BuildCard() → boolean|nilSource ☍
-
Build and register a collectable automatically. See:
AutoRegisterReturns
- boolean|nil
- SharedITEM:BuildSticker() → boolean|nilSource ☍
-
Build and register a collectable automatically. See:
AutoRegisterReturns
- boolean|nil
- SharedITEM:FindLookup(lookup, id, name) → string?Source ☍
-
Finds the name of an ID in a look up table. Sets the name if provided.
Parameters
- lookuptableLookup Table.
- idstringID to get/set.
- namestring?Name to set.
Returns
- string?/stored name.
- SharedITEM:New(series, name, foil) → ITEM.CollectableSource ☍
-
Create a new card. Overrides
ITEM:Newwith a different signature; subclasses of this base that override it again must declare their own@classfor the override to take, or they inherit this signature instead.Parameters
- series(string|table)?Either the series id, or {series id, series title}.
- name(string|table)?Either the name id, or {name id, name title}.
- foilboolean?If the card is a foil.
Returns
- ITEM.CollectableThe new collectable.
- SharedITEM:onDestroy(ply)Source ☍
-
onDestroyhook/override for this item base.Parameters
- plyPlayer
- SharedITEM:onDrop(ply, pos)Source ☍
-
onDrophook/override for this item base.Parameters
- SharedITEM:onGive(ply, to, amt)Source ☍
-
onGivehook/override for this item base.Parameters
- SharedITEM:SetCollectable(id, name) → ITEMSource ☍
-
Set the collectable type of this item.
Parameters
- idstringCollectable ID.
- namestring?Collectable Title.
Returns
- SharedITEM:SetItem(id, name) → ITEMSource ☍
-
Set the name in series of this item.
Parameters
- idstringItem / Name ID.
- namestring?Title.
Returns
- SharedITEM:SetLookup(lookup, id, name) → ITEMSource ☍
-
Set a lookup'd class on the item.
Parameters
- lookupstringClass to set.
- idstringID to get/set.
- namestring?Name to set.
Returns
- SharedITEM:SetSeries(id, name) → ITEMSource ☍
-
Set the series of this item.
Parameters
- idstringSeries ID.
- namestring?Series Title.
Returns