/tg/ Station 13 - Modules - TypesVar Details - Proc Details

spellbook_entry

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_wordFlavor. Verb used in saying how the spell is aquired. Ex "[Learn] Fireball" or "[Summon] Ghosts"
categoryWhat category the entry falls in
cooldownThe cooldown of the spell
costHow many book charges does the spell take
descThe description of the entry
limitThe limit on number of purchases from this entry in a given spellbook. If null, infinite are allowed.
nameThe name of the entry
no_coexistance_typecacheUsed so you can't have specific spells together
refundableIs this refundable?
requires_wizard_garbWhether the spell requires wizard garb or not
spell_typeThe type of spell that the entry grants (typepath)
timesHow many times has the spell been purchased. Compared against limit.

Procs

buy_spellActually buy the entry for the user
can_be_purchasedDetermines if this entry can be purchased from a spellbook Used for configs / round related restrictions.
can_buyChecks if the user, with the supplied spellbook, can purchase the given entry.
can_refundChecks if the user, with the supplied spellbook, can refund the entry
refund_spellActually refund the entry for the user
set_spell_infoSet any of the spell info saved on our entry after something has occured

Var Details

buy_word

Flavor. Verb used in saying how the spell is aquired. 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_coexistance_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.

Proc Details

buy_spell

Actually buy the entry for the user

Arguments

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

Return TRUE if it can be bought, FALSE otherwise

can_refund

Checks if the user, with the supplied spellbook, can refund the entry

Arguments

Return TRUE if it can refunded, FALSE otherwise

refund_spell

Actually refund the entry for the user

Arguments

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