spellbook_item 
A entry in the spellbook. Can add anything/adjust anything, but should be themed after magic. Only one instance of any given type should exist at a time. These are singleton instances, and are stored in GLOB.all_spellbook_datums, in a assoc list of (entry.type -> entry singleton).
Vars | |
| can_be_picked | Controls if this item can actually ever be picked by anyone. Useful for purely visual things. |
|---|---|
| category | The category of the item. Should use a define from spellbook_categories.dm. |
| description | The description of the entry to be displayed under the name. |
| entry_type | Returns the type of entry this is. Uses defines from spellbook_entry_types.dm. |
| has_params | Does this entry have parameters for customization? If this is set to true, you MUST override generate_customization_params. |
| lore | This entry's place in the world. Should include it's importance, how people see it, what it's related to, etc. general worldbuilding. Should also include what and who typically has this entry. Note: NEVER make a HARD limit without good reason. Creativity is key, and people should be able to make up reasons for whatever they want. |
| name | Displayed name of the spellbook entry. |
Procs | |
| apply | The effect of the item on the person that picked it. Called when a character spawns in and has this as an enabled entry. |
| can_apply | Called before apply() in spellbook_manager.dm. Used for determining if a specific entry should be enabled/applied. |
| generate_customization_params | Generates the assoc list of (key: String -> spellbook_customization_entry instance) entries for use in entry customization. See spellbook_customization_entry for documentation on the variables you need to set. This MUST be overridden, but not parent-called, if you use params. |
| get_customization_menu_path | In the case that a item wants to return a custom menu, this proc exists. Should return a typepath of /datum/spellbook_item_customization_menu |
| get_customization_params | Returns an assoc list of (key: String -> spellbook_customization_entry instance), and applies existing values associated with said key to those instances. |
| get_existing_params | Should always return the existing parameters associated with this type. Can be null. |
| handle_spellbook_action | Takes in an action from a spellbook manager and applies it |
Var Details
can_be_picked 
Controls if this item can actually ever be picked by anyone. Useful for purely visual things.
category 
The category of the item. Should use a define from spellbook_categories.dm.
description 
The description of the entry to be displayed under the name.
entry_type 
Returns the type of entry this is. Uses defines from spellbook_entry_types.dm.
has_params 
Does this entry have parameters for customization? If this is set to true, you MUST override generate_customization_params.
lore 
This entry's place in the world. Should include it's importance, how people see it, what it's related to, etc. general worldbuilding. Should also include what and who typically has this entry. Note: NEVER make a HARD limit without good reason. Creativity is key, and people should be able to make up reasons for whatever they want.
name 
Displayed name of the spellbook entry.
Proc Details
apply
The effect of the item on the person that picked it. Called when a character spawns in and has this as an enabled entry.
can_apply
Called before apply() in spellbook_manager.dm. Used for determining if a specific entry should be enabled/applied.
generate_customization_params
Generates the assoc list of (key: String -> spellbook_customization_entry instance) entries for use in entry customization. See spellbook_customization_entry for documentation on the variables you need to set. This MUST be overridden, but not parent-called, if you use params.
get_customization_menu_path
In the case that a item wants to return a custom menu, this proc exists. Should return a typepath of /datum/spellbook_item_customization_menu
get_customization_params
Returns an assoc list of (key: String -> spellbook_customization_entry instance), and applies existing values associated with said key to those instances.
get_existing_params
Should always return the existing parameters associated with this type. Can be null.
handle_spellbook_action
Takes in an action from a spellbook manager and applies it
Useful for subtypes of spellbook items with unique actions