Module spells
Information about spells.
Functions
cast (spell[, x=0[, y=0[, if=false]]]) | Cast a spell at a target. |
dir (name) | Is this spell castable in a direction? |
dir_or_target (name) | Does this spell take a direction or target? |
fail (name) | The failure rate of the spell as a number in [0,100]. |
fail_severity (name) | The failure severity of the spell. |
god_hates (name) | Does our god hate this spell? |
god_likes (name) | Does our god like this spell? |
god_loathes (name) | Does our god loathe this spell? |
letter (name) | What letter is this spell assigned to? |
level (name) | The level of the named spell. |
mana_cost (name) | The MP cost of the spell. |
max_power (name) | The maximum spellpower (in bars). |
max_range (name) | The maximum range of the spell. |
memorised (spellname) | Is this spell memorised? |
min_range (name) | The minimum range of the spell. |
path (spell, x, y, x, y) | If this spell is aimed at (x,y), what path will it actually take? |
power (name) | The current spellpower (in bars). |
power_perc (name) | The current spellpower (as an integer percentage 0-100). |
range (name) | The current range of the spell. |
targ_obj (name) | Can this spell target objects? |
target (name) | Is this spell targetable? |
Functions
- cast (spell[, x=0[, y=0[, if=false]]])
-
Cast a spell at a target. If the target is not provided, enters interactive
targeting.
Parameters:
- spell string name
- x number coordinate (default 0)
- y number coordinate (default 0)
- if boolean true, aim at the target; if false, shoot past it (default false)
Returns:
-
boolean
whether an action took place
- dir (name)
-
Is this spell castable in a direction?
Parameters:
- name string
Returns:
-
boolean
- dir_or_target (name)
-
Does this spell take a direction or target?
Parameters:
- name string
Returns:
-
boolean
- fail (name)
-
The failure rate of the spell as a number in [0,100].
Parameters:
- name string
Returns:
-
int
- fail_severity (name)
-
The failure severity of the spell.
TODO: Document these numbers
Parameters:
- name string
Returns:
-
int
- god_hates (name)
-
Does our god hate this spell?
Casting this will result in pennance or excommunication.
Parameters:
- name string
Returns:
-
boolean
- god_likes (name)
-
Does our god like this spell?
Parameters:
- name string
Returns:
-
boolean
- god_loathes (name)
-
Does our god loathe this spell?
Casting this will result in excommunication.
Parameters:
- name string
Returns:
-
boolean
- letter (name)
-
What letter is this spell assigned to?
Parameters:
- name string
Returns:
-
string or nil
the spell letter or nil if not memorised
- level (name)
-
The level of the named spell.
Parameters:
- name string
Returns:
-
int
- mana_cost (name)
-
The MP cost of the spell.
Parameters:
- name string
Returns:
-
int
- max_power (name)
-
The maximum spellpower (in bars).
Parameters:
- name string
Returns:
-
int
- max_range (name)
-
The maximum range of the spell.
Parameters:
- name string
Returns:
-
int
- memorised (spellname)
-
Is this spell memorised?
Parameters:
- spellname string
Returns:
-
boolean
- min_range (name)
-
The minimum range of the spell.
Parameters:
- name string
Returns:
-
int
- path (spell, x, y, x, y)
-
If this spell is aimed at (x,y), what path will it actually take?
Parameters:
- spell string name
- x int coordinate of spell source, in player coordinates (default=0)
- y int coordinate of spell source, in player coordinates (default=0)
- x int coordinate of spell source, in player coordinates (default=0)
- y int coordinate of spell source, in player coordinates (default=0)
Returns:
-
table or nil
a table of {x,y} of the path the spell will take, in player coordinates.
Nil is returned if the spell does not follow a path (eg., smite-targeted spells) or if the spell has zero range.
- power (name)
-
The current spellpower (in bars).
Parameters:
- name string
Returns:
-
int
- power_perc (name)
-
The current spellpower (as an integer percentage 0-100).
Parameters:
- name string
Returns:
-
int
- range (name)
-
The current range of the spell.
Parameters:
- name string
Returns:
-
int
- targ_obj (name)
-
Can this spell target objects?
Parameters:
- name string
Returns:
-
boolean
- target (name)
-
Is this spell targetable?
Parameters:
- name string
Returns:
-
boolean