|
Atrinik Server 2.5
|
#include <global.h>Go to the source code of this file.
Functions | |
| void | init_spells () |
| void | dump_spells () |
| int | insert_spell_effect (char *archname, mapstruct *m, int x, int y) |
| spell_struct * | find_spell (int spelltype) |
| int | check_spell_known (object *op, int spell_type) |
| int | cast_spell (object *op, object *caster, int dir, int type, int ability, int item, const char *stringarg) |
| int | cast_create_obj (object *op, object *new_op, int dir) |
| static int | ok_to_put_more (mapstruct *m, int x, int y, object *op) |
| int | fire_bolt (object *op, object *caster, int dir, int type) |
| int | fire_arch_from_position (object *op, object *caster, sint16 x, sint16 y, int dir, archetype *at, int type, object *target) |
| int | cast_cone (object *op, object *caster, int dir, int strength, int spell_type, archetype *spell_arch) |
| void | cone_drop (object *op) |
| void | move_cone (object *op) |
| void | forklightning (object *op, object *tmp) |
| int | reflwall (mapstruct *m, int x, int y, object *sp_op) |
| void | move_bolt (object *op) |
| void | explode_object (object *op) |
| void | check_fired_arch (object *op) |
| void | move_fired_arch (object *op) |
| int | find_target_for_spell (object *op, object **target, uint32 flags) |
| int | SP_level_dam_adjust (object *caster, int spell_type, int base_dam, int exact) |
| int | SP_level_strength_adjust (object *caster, int spell_type) |
| int | SP_level_spellpoint_cost (object *caster, int spell_type, int caster_level) |
| void | move_swarm_spell (object *op) |
| void | fire_swarm (object *op, object *caster, int dir, archetype *swarm_type, int spell_type, int n, int magic) |
Variables | |
| archetype * | spellarch [NROFREALSPELLS] |
Spell related helper functions.
Definition in file spell_util.c.
| int cast_cone | ( | object * | op, |
| object * | caster, | ||
| int | dir, | ||
| int | strength, | ||
| int | spell_type, | ||
| archetype * | spell_arch | ||
| ) |
Casts a cone spell.
| op | Person firing the object. |
| caster | Object casting the spell. |
| dir | Direction to fire in. |
| strength | Strength of the spell. |
| spell_type | ID of the spell. |
| spell_arch | Spell's arch. |
| 0 | Couldn't cast. |
| 1 | Successful cast. |
Definition at line 999 of file spell_util.c.
Creates object new_op in direction dir or if that is blocked, beneath the player (op).
| op | Who is casting. |
| new_op | Object to insert. |
| dir | Direction to insert into. Can be 0. |
Definition at line 769 of file spell_util.c.
| int cast_spell | ( | object * | op, |
| object * | caster, | ||
| int | dir, | ||
| int | type, | ||
| int | ability, | ||
| int | item, | ||
| const char * | stringarg | ||
| ) |
Cast a spell.
| op | The creature that is owner of the object that is casting the spell. |
| caster | The actual object (wand, potion) casting the spell. Can be same as op. |
| dir | Direction to cast in. |
| type | Spell ID. |
| ability | If true, the spell is the innate ability of a monster (ie, don't check for blocks_magic(), and don't add AT_MAGIC to attacktype). |
| item | The type of object that is casting the spell. |
| stringarg | Any options that are being used. |
Definition at line 317 of file spell_util.c.
| void check_fired_arch | ( | object * | op | ) |
If we are here, the arch (spell) we check was able to move to this place. wall() has failed, including reflection checking.
Look for a target.
| op | The spell object. |
Definition at line 1471 of file spell_util.c.
| int check_spell_known | ( | object * | op, |
| int | spell_type | ||
| ) |
Checks to see if player knows the spell.
| op | Object we're checking. |
| spell_type | Spell ID. |
Definition at line 288 of file spell_util.c.
| void cone_drop | ( | object * | op | ) |
Drops an object based on what is in the cone's "other_arch".
| op | The object. |
Definition at line 1097 of file spell_util.c.
| void dump_spells | ( | ) |
Dumps all the spells.
Definition at line 172 of file spell_util.c.
| void explode_object | ( | object * | op | ) |
Causes an object to explode, eg, a firebullet, poison cloud ball, etc.
| op | The object to explode. |
Definition at line 1429 of file spell_util.c.
| spell_struct* find_spell | ( | int | spelltype | ) |
Find a spell in the spells array.
| spelltype | ID of the spell to find. |
Definition at line 273 of file spell_util.c.
Detect target for casting a spell.
| op | Caster. | |
| [out] | target | Will contain target for the spell we're casting. |
| flags | Spell flags. |
Definition at line 1644 of file spell_util.c.
| int fire_arch_from_position | ( | object * | op, |
| object * | caster, | ||
| sint16 | x, | ||
| sint16 | y, | ||
| int | dir, | ||
| archetype * | at, | ||
| int | type, | ||
| object * | target | ||
| ) |
Fires an archetype.
| op | Person firing the object. |
| caster | Object casting the spell. |
| x | X position where to fire the spell. |
| y | Y position where to fire the spell. |
| dir | Direction to fire in. |
| at | The archetype to fire. |
| type | Spell ID. |
Definition at line 925 of file spell_util.c.
Cast a bolt-like spell.
| op | Who is casting the spell. |
| caster | What object is casting the spell (rod, ...). |
| dir | Firing direction. |
| type | Spell ID. |
| 0 | No bolt could be fired. |
| 1 | Bolt was fired (but may have been destroyed already). |
Definition at line 848 of file spell_util.c.
| void fire_swarm | ( | object * | op, |
| object * | caster, | ||
| int | dir, | ||
| archetype * | swarm_type, | ||
| int | spell_type, | ||
| int | n, | ||
| int | magic | ||
| ) |
The following routine creates a swarm of objects. It actually sets up a specific swarm object, which then fires off all the parts of the swarm.
| op | Who is casting. |
| caster | What object is casting. |
| dir | Cast direction. |
| swarm_type | Archetype of the swarm. |
| spell_type | ID of the spell. |
| n | The number to be fired. |
| magic | Magic. |
Definition at line 1926 of file spell_util.c.
Causes op to fork.
| op | Original bolt. |
| tmp | First piece of the fork. |
Definition at line 1224 of file spell_util.c.
| void init_spells | ( | ) |
Initialize spells.
Definition at line 39 of file spell_util.c.
| int insert_spell_effect | ( | char * | archname, |
| mapstruct * | m, | ||
| int | x, | ||
| int | y | ||
| ) |
Inserts a spell effect on map.
| archname | Spell effect arch. |
| m | Map. |
| x | X position on map. |
| y | Y position on map. |
Definition at line 229 of file spell_util.c.
| void move_bolt | ( | object * | op | ) |
Moves bolt 'op'. Basically, it just advances a space, and checks for various things that may stop it.
| op | The bolt object moving. |
Definition at line 1323 of file spell_util.c.
| void move_cone | ( | object * | op | ) |
Causes cone object 'op' to move a space/hit creatures.
| op | Cone object moving. |
Definition at line 1119 of file spell_util.c.
| void move_fired_arch | ( | object * | op | ) |
| void move_swarm_spell | ( | object * | op | ) |
This is an implementation of the swarm spell. It was written for meteor swarm, but it could be used for any swarm. A swarm spell is a special type of object that casts swarms of other types of spells. Which spell it casts is flexible. It fires the spells from a set of squares surrounding the caster, in a given direction.
| op | The spell effect. |
Definition at line 1850 of file spell_util.c.
Returns true if it is ok to put spell op on the space/may provided.
| m | Map. |
| x | X position on map. |
| y | Y position on map. |
| op | Object to test for. |
Definition at line 811 of file spell_util.c.
Decides whether the (spell-)object sp_op will be reflected from the given mapsquare. Returns 1 if true.
(Note that for living creatures there is a small chance that reflect_spell fails.)
| m | Map. |
| x | X position. |
| y | Y position. |
| sp_op | Spell object to test. |
Definition at line 1299 of file spell_util.c.
| int SP_level_dam_adjust | ( | object * | caster, |
| int | spell_type, | ||
| int | base_dam, | ||
| int | exact | ||
| ) |
Returns adjusted damage based on the caster.
| caster | Who is casting. |
| spell_type | Spell ID we're adjusting. |
| base_dam | Base damage. |
| exact | Return exact damage, unadjusted by random percent? |
Definition at line 1753 of file spell_util.c.
| int SP_level_spellpoint_cost | ( | object * | caster, |
| int | spell_type, | ||
| int | caster_level | ||
| ) |
Scales the spellpoint cost of a spell by it's increased effectiveness. Some of the lower level spells become incredibly vicious at high levels. Very cheap mass destruction. This function is intended to keep the sp cost related to the effectiveness.
| caster | What is casting the spell. |
| spell_type | Spell ID. |
| caster_level | Level of caster. If -1, will use SK_level() to determine caster's level. |
Definition at line 1826 of file spell_util.c.
| int SP_level_strength_adjust | ( | object * | caster, |
| int | spell_type | ||
| ) |
Adjust the strength of the spell based on level.
| caster | Who is casting. |
| spell_type | Spell ID we're adjusting. |
Definition at line 1794 of file spell_util.c.
Array of pointers to archetypes used by the spells for quick access.
Definition at line 35 of file spell_util.c.
1.7.4