Difference for server/spell_effect.c from version 1.149 to 1.150


version 1.149 version 1.150
Line 1
 
Line 1
 /*  /*
  * 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 $";
  */   */
   
   
Line 36
 
Line 36
 #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.
  */   */
Line 123
 
Line 124
  * 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.
  */   */
Line 212
 
Line 214
 }  }
   
   
 /* 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
Line 230
 
Line 233
     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) {
Line 311
 
Line 315
     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;
Line 350
 
Line 354
 }  }
   
   
 /* 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.
Line 404
 
Line 409
   
   
   
 /* 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
Line 495
 
Line 501
 }  }
   
   
 /*  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;
Line 596
 
Line 604
 }  }
   
   
 /* 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
Line 627
 
Line 636
     }      }
 }  }
   
 /* 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
Line 678
 
Line 688
     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;
Line 716
 
Line 727
     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)
Line 732
 
Line 745
     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.
  */   */
Line 780
 
Line 794
     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.
  */   */
Line 859
 
Line 873
     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
Line 1099
 
Line 1112
 }  }
   
   
 /* 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.
  */   */
   
Line 1348
 
Line 1362
         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.
Line 1457
 
Line 1472
 }  }
   
   
 /* 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.
  */   */
Line 1584
 
Line 1600
     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.
  */   */
Line 1864
 
Line 1881
 }  }
   
   
 /* 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) {
Line 1903
 
Line 1921
     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;
Line 2159
 
Line 2176
     }      }
 }  }
   
 /* 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.
  */   */
Line 2225
 
Line 2242
 }  }
   
   
 /* 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,
Line 2294
 
Line 2312
   
   
   
 /* 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];
   
Line 2332
 
Line 2350
     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
Line 2529
 
Line 2547
     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.
  */   */
   
Line 2554
 
Line 2570
   
   
   
 /* 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.
  */   */
Line 2586
 
Line 2603
 }  }
   
   
 /* 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:
Line 2655
 
Line 2673
     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.
  */         */      
   
Line 2701
 
Line 2720
 }     }   
               
   
 /* 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.
  */   */
   


Legend:
line(s) removed in v.1.149 
line(s) changed
 line(s) added in v.1.150

File made using version 1.98 of cvs2html by leaf at 2011-07-21 17:47