version 1.149 | | version 1.150 |
---|
| | |
/* | | /* |
* static char *rcsid_spell_effect_c = | | * static char *rcsid_spell_effect_c = |
* "$Id: spell_effect.c,v 1.149 2006/02/19 18:06:24 akirschbaum Exp $"; | | * "$Id: spell_effect.c,v 1.150 2006/03/18 15:05:37 ryo_saeba Exp $"; |
*/ | | */ |
| | |
| | |
| | |
#include <spells.h> | | #include <spells.h> |
#include <sounds.h> | | #include <sounds.h> |
| | |
/* cast_magic_storm: This is really used mostly for spell | | /** |
| | * This is really used mostly for spell |
* fumbles at the like. tmp is the object to propogate. | | * fumbles at the like. tmp is the object to propogate. |
* op is what is casting this. | | * op is what is casting this. |
*/ | | */ |
| | |
* an item of proper value is generated. | | * an item of proper value is generated. |
*/ | | */ |
| | |
/* polymorph_living - takes a living object (op) and turns it into | | /** |
| | * Takes a living object (op) and turns it into |
* another monster of some sort. Currently, we only deal with single | | * another monster of some sort. Currently, we only deal with single |
* space monsters. | | * space monsters. |
*/ | | */ |
| | |
} | | } |
| | |
| | |
/* polymorph_melt Destroys item from polymorph failure | | /** |
| | * Destroys item from polymorph failure |
* who is the caster of the polymorph, op is the | | * who is the caster of the polymorph, op is the |
* object destroyed. We should probably do something | | * object destroyed. We should probably do something |
* more clever ala nethack - create an iron golem or | | * more clever ala nethack - create an iron golem or |
| | |
return; | | return; |
} | | } |
| | |
/* polymorph_item - changes an item to another item of similar type. | | /** |
| | * Changes an item to another item of similar type. |
* who is the caster of spell, op is the object to be changed. | | * who is the caster of spell, op is the object to be changed. |
*/ | | */ |
void polymorph_item(object *who, object *op) { | | void polymorph_item(object *who, object *op) { |
| | |
insert_ob_in_map(new_ob,who->map,new_ob,INS_NO_MERGE | INS_NO_WALK_ON); | | insert_ob_in_map(new_ob,who->map,new_ob,INS_NO_MERGE | INS_NO_WALK_ON); |
} | | } |
| | |
/* polymorh - caster who has hit object op. */ | | /** Caster who has hit object op. */ |
void polymorph(object *op, object *who) { | | void polymorph(object *op, object *who) { |
| | |
int tmp; | | int tmp; |
| | |
} | | } |
| | |
| | |
/* cast_polymorph - | | /** |
| | * cast_polymorph - |
* object *op is the player/monster | | * object *op is the player/monster |
* caster is object that cast it. | | * caster is object that cast it. |
* spell_ob is the actually spell object. | | * spell_ob is the actually spell object. |
| | |
| | |
| | |
| | |
/* Create a missile (nonmagic - magic +4). Will either create bolts or arrows | | /** |
| | * Create a missile (nonmagic - magic +4). Will either create bolts or arrows |
* based on whether a crossbow or bow is equiped. If neither, it defaults to | | * based on whether a crossbow or bow is equiped. If neither, it defaults to |
* arrows. | | * arrows. |
* Sets the plus based on the casters level. It is also settable with the | | * Sets the plus based on the casters level. It is also settable with the |
| | |
} | | } |
| | |
| | |
/* allows the choice of what sort of food object to make. | | /** |
* If stringarg is NULL, it will create food dependent on level --PeterM*/ | | * allows the choice of what sort of food object to make. |
| | * If stringarg is NULL, it will create food dependent on level --PeterM |
| | */ |
int cast_create_food(object *op,object *caster, object *spell_ob, int dir, const char *stringarg) | | int cast_create_food(object *op,object *caster, object *spell_ob, int dir, const char *stringarg) |
{ | | { |
int food_value; | | int food_value; |
| | |
} | | } |
| | |
| | |
/* This checks to see if 'pl' is invisible to 'mon'. | | /** |
| | * This checks to see if 'pl' is invisible to 'mon'. |
* does race check, undead check, etc | | * does race check, undead check, etc |
* Returns TRUE if mon can't see pl, false | | * Returns TRUE if mon can't see pl, false |
* otherwise. This doesn't check range, walls, etc. It | | * otherwise. This doesn't check range, walls, etc. It |
| | |
} | | } |
} | | } |
| | |
/* Makes the player or character invisible. | | /** |
| | * Makes the player or character invisible. |
* Note the spells to 'stack', but perhaps in odd ways. | | * Note the spells to 'stack', but perhaps in odd ways. |
* the duration for all is cumulative. | | * the duration for all is cumulative. |
* In terms of invis undead/normal invis, it is the last one cast that | | * In terms of invis undead/normal invis, it is the last one cast that |
| | |
return 1; | | return 1; |
} | | } |
| | |
/* earth to dust spell. Basically destroys earthwalls in the area. | | /** |
| | * Basically destroys earthwalls in the area. |
*/ | | */ |
int cast_earth_to_dust(object *op,object *caster, object *spell_ob) { | | int cast_earth_to_dust(object *op,object *caster, object *spell_ob) { |
object *tmp, *next; | | object *tmp, *next; |
| | |
return 1; | | return 1; |
} | | } |
| | |
| | /** |
| | * Handles the actual word of recalling. Called when force in player inventory expires. |
| | */ |
void execute_word_of_recall(object *op) { | | void execute_word_of_recall(object *op) { |
object *wor=op; | | object *wor=op; |
while(op!=NULL && op->type!=PLAYER) | | while(op!=NULL && op->type!=PLAYER) |
| | |
free_object(wor); | | free_object(wor); |
} | | } |
| | |
/* Word of recall causes the player to return 'home'. | | /** |
| | * Word of recall causes the player to return 'home'. |
* we put a force into the player object, so that there is a | | * we put a force into the player object, so that there is a |
* time delay effect. | | * time delay effect. |
*/ | | */ |
| | |
return 1; | | return 1; |
} | | } |
| | |
/* cast_wonder | | /** |
* wonder is really just a spell that will likely cast another | | * wonder is really just a spell that will likely cast another |
* spell. | | * spell. |
*/ | | */ |
| | |
return 1; | | return 1; |
} | | } |
| | |
/* int cast_create_town_portal (object *op, object *caster, int dir) | | /** |
* | | |
* This function cast the spell of town portal for op | | * This function cast the spell of town portal for op |
* | | * |
* The spell operates in two passes. During the first one a place | | * The spell operates in two passes. During the first one a place |
| | |
} | | } |
| | |
| | |
/* This creates magic walls. Really, it can create most any object, | | /** |
| | * This creates magic walls. Really, it can create most any object, |
* within some reason. | | * within some reason. |
*/ | | */ |
| | |
| | |
return 1; | | return 1; |
| | |
if (op->type == PLAYER) | | if (op->type == PLAYER) |
MapNewmapCmd(op->contr); | | map_newmap_cmd(op->contr); |
op->speed_left= -FABS(op->speed)*5; /* Freeze them for a short while */ | | op->speed_left= -FABS(op->speed)*5; /* Freeze them for a short while */ |
return 1; | | return 1; |
} | | } |
| | |
| | |
/* cast_heal: Heals something. | | /** |
| | * Heals something. |
* op is the caster. | | * op is the caster. |
* dir is the direction he is casting it in. | | * dir is the direction he is casting it in. |
* spell is the spell object. | | * spell is the spell object. |
| | |
} | | } |
| | |
| | |
/* This is used for the spells that gain stats. There are no spells | | /** |
| | * This is used for the spells that gain stats. There are no spells |
* right now that icnrease wis/int/pow on a temp basis, so no | | * right now that icnrease wis/int/pow on a temp basis, so no |
* good comments for those. | | * good comments for those. |
*/ | | */ |
| | |
return 1; | | return 1; |
} | | } |
| | |
/* This used to be part of cast_change_ability, but it really didn't make | | /** |
| | * This used to be part of cast_change_ability, but it really didn't make |
* a lot of sense, since most of the values it derives are from the god | | * a lot of sense, since most of the values it derives are from the god |
* of the caster. | | * of the caster. |
*/ | | */ |
| | |
} | | } |
| | |
| | |
/* This function removes the cursed/damned status on equipped | | /** |
| | * This function removes the cursed/damned status on equipped |
* items. | | * items. |
*/ | | */ |
int remove_curse(object *op, object *caster, object *spell) { | | int remove_curse(object *op, object *caster, object *spell) { |
| | |
return success; | | return success; |
} | | } |
| | |
/* Identifies objects in the players inventory/on the ground */ | | /** Identifies objects in the players inventory/on the ground */ |
| | |
int cast_identify(object *op, object *caster, object *spell) { | | int cast_identify(object *op, object *caster, object *spell) { |
object *tmp; | | object *tmp; |
int success = 0, num_ident; | | int success = 0, num_ident; |
| | |
} | | } |
} | | } |
| | |
/* cast_transfer | | /** |
* This spell transfers sp from the player to another person. | | * This spell transfers sp from the player to another person. |
* We let the target go above their normal maximum SP. | | * We let the target go above their normal maximum SP. |
*/ | | */ |
| | |
} | | } |
| | |
| | |
/* counterspell: nullifies spell effects. | | /** |
| | * Nullifies spell effects. |
* op is the counterspell object, dir is the direction | | * op is the counterspell object, dir is the direction |
* it was cast in. | | * it was cast in. |
* Basically, if the object has a magic attacktype, | | * Basically, if the object has a magic attacktype, |
| | |
| | |
| | |
| | |
/* cast_consecrate() - a spell to make an altar your god's */ | | /** A spell to make an altar your god's */ |
int cast_consecrate(object *op, object *caster, object *spell) { | | int cast_consecrate(object *op, object *caster, object *spell) { |
char buf[MAX_BUF]; | | char buf[MAX_BUF]; |
| | |
| | |
return 0; | | return 0; |
} | | } |
| | |
/* animate_weapon - | | /** |
* Generalization of staff_to_snake. Makes a golem out of the caster's weapon. | | * Generalization of staff_to_snake. Makes a golem out of the caster's weapon. |
* The golem is based on the archetype specified, modified by the caster's level | | * The golem is based on the archetype specified, modified by the caster's level |
* and the attributes of the weapon. The weapon is inserted in the golem's | | * and the attributes of the weapon. The weapon is inserted in the golem's |
| | |
return 1; | | return 1; |
} | | } |
| | |
/* cast_daylight() - changes the map darkness level *lower* */ | | /** |
| | |
/* cast_change_map_lightlevel: Was cast_daylight/nightfall. | | |
* This changes the light level for the entire map. | | * This changes the light level for the entire map. |
*/ | | */ |
| | |
| | |
| | |
| | |
| | |
/* create an aura spell object and put it in the player's inventory. | | /** |
| | * Create an aura spell object and put it in the player's inventory. |
* as usual, op is player, caster is the object casting the spell, | | * as usual, op is player, caster is the object casting the spell, |
* spell is the spell object itself. | | * spell is the spell object itself. |
*/ | | */ |
| | |
} | | } |
| | |
| | |
/* move aura function. An aura is a part of someone's inventory, | | /** |
| | * An aura is a part of someone's inventory, |
* which he carries with him, but which acts on the map immediately | | * which he carries with him, but which acts on the map immediately |
* around him. | | * around him. |
* Aura parameters: | | * Aura parameters: |
| | |
insert_ob_in_ob(aura, env); | | insert_ob_in_ob(aura, env); |
} | | } |
| | |
/* moves the peacemaker spell. | | /** |
| | * moves the peacemaker spell. |
* op is the piece object. | | * op is the piece object. |
*/ | | */ |
| | |
| | |
} | | } |
| | |
| | |
/* This writes a rune that contains the appropriate message. | | /** |
| | * This writes a rune that contains the appropriate message. |
* There really isn't any adjustments we make. | | * There really isn't any adjustments we make. |
*/ | | */ |
| | |