spellbook_entry ![code/modules/antagonists/wizard/equipment/spellbook_entries/_entry.dm 10](git.png)
Spellbook entries
Wizard spellbooks are automatically populated with a list of every spellbook entry subtype when they're made.
Wizards can then buy entries from the book to learn magic, invoke rituals, or summon items.
Vars | |
buy_word | Flavor. Verb used in saying how the spell is acquired. Ex "[Learn] Fireball" or "[Summon] Ghosts" |
---|---|
category | What category the entry falls in |
cooldown | The cooldown of the spell |
cost | How many book charges does the spell take |
desc | The description of the entry |
limit | The limit on number of purchases from this entry in a given spellbook. If null, infinite are allowed. |
name | The name of the entry |
no_coexistence_typecache | Used so you can't have specific spells together |
refundable | Is this refundable? |
requires_wizard_garb | Whether the spell requires wizard garb or not |
spell_type | The type of spell that the entry grants (typepath) |
times | How many times has the spell been purchased. Compared against limit. |
Procs | |
buy_spell | Actually buy the entry for the user |
can_be_purchased | Determines if this entry can be purchased from a spellbook Used for configs / round related restrictions. |
can_buy | Checks if the user, with the supplied spellbook, can purchase the given entry. |
can_refund | Checks if the user, with the supplied spellbook, can refund the entry |
refund_spell | Actually refund the entry for the user |
set_spell_info | Set any of the spell info saved on our entry after something has occured |
Var Details
buy_word ![code/modules/antagonists/wizard/equipment/spellbook_entries/_entry.dm 28](git.png)
Flavor. Verb used in saying how the spell is acquired. Ex "[Learn] Fireball" or "[Summon] Ghosts"
category ![code/modules/antagonists/wizard/equipment/spellbook_entries/_entry.dm 18](git.png)
What category the entry falls in
cooldown ![code/modules/antagonists/wizard/equipment/spellbook_entries/_entry.dm 30](git.png)
The cooldown of the spell
cost ![code/modules/antagonists/wizard/equipment/spellbook_entries/_entry.dm 20](git.png)
How many book charges does the spell take
desc ![code/modules/antagonists/wizard/equipment/spellbook_entries/_entry.dm 14](git.png)
The description of the entry
limit ![code/modules/antagonists/wizard/equipment/spellbook_entries/_entry.dm 24](git.png)
The limit on number of purchases from this entry in a given spellbook. If null, infinite are allowed.
name ![code/modules/antagonists/wizard/equipment/spellbook_entries/_entry.dm 12](git.png)
The name of the entry
no_coexistence_typecache ![code/modules/antagonists/wizard/equipment/spellbook_entries/_entry.dm 36](git.png)
Used so you can't have specific spells together
refundable ![code/modules/antagonists/wizard/equipment/spellbook_entries/_entry.dm 26](git.png)
Is this refundable?
requires_wizard_garb ![code/modules/antagonists/wizard/equipment/spellbook_entries/_entry.dm 32](git.png)
Whether the spell requires wizard garb or not
spell_type ![code/modules/antagonists/wizard/equipment/spellbook_entries/_entry.dm 16](git.png)
The type of spell that the entry grants (typepath)
times ![code/modules/antagonists/wizard/equipment/spellbook_entries/_entry.dm 22](git.png)
How many times has the spell been purchased. Compared against limit.
Proc Details
buy_spell
Actually buy the entry for the user
Arguments
- user - the mob who's bought the spell
- book - what book they've bought the spell from
Return truthy if the purchase was successful, FALSE otherwise
can_be_purchased
Determines if this entry can be purchased from a spellbook Used for configs / round related restrictions.
Return FALSE to prevent the entry from being added to wizard spellbooks, TRUE otherwise
can_buy
Checks if the user, with the supplied spellbook, can purchase the given entry.
Arguments
- user - the mob who's buying the spell
- book - what book they're buying the spell from
Return TRUE if it can be bought, FALSE otherwise
can_refund
Checks if the user, with the supplied spellbook, can refund the entry
Arguments
- user - the mob who's refunding the spell
- book - what book they're refunding the spell from
Return TRUE if it can refunded, FALSE otherwise
refund_spell
Actually refund the entry for the user
Arguments
- user - the mob who's refunded the spell
- book - what book they're refunding the spell from
Return -1 on failure, or return the point value of the refund on success
set_spell_info
Set any of the spell info saved on our entry after something has occured
For example, updating the cooldown after upgrading it