Difference for server/spell_util.c from version 1.68 to 1.69


version 1.68 version 1.69
Line 1
 
Line 1
 /*  /*
  * static char *rcsid_spell_util_c =   * static char *rcsid_spell_util_c =
  *   "$Id: spell_util.c,v 1.68 2002/11/13 00:26:13 garbled Exp $";   *   "$Id: spell_util.c,v 1.69 2002/11/13 00:49:47 garbled Exp $";
  */   */
   
   
Line 217
 
Line 217
     return 0;      return 0;
   }    }
   
 #ifdef CASTING_TIME    if (settings.casting_time == TRUE) {
   if (op->casting==-1) /* begin the casting */        if (op->casting==-1) { /* begin the casting */
    {  
      if (item == spellNormal&&!ability){       if (item == spellNormal&&!ability){
        op->casting = s->time*PATH_TIME_MULT(op,s);         op->casting = s->time*PATH_TIME_MULT(op,s);
        op->spell   = s;  /* so no one cast a spell and switchs to get lower          op->spell = s;
      casting times!!! */   /* so no one cast a spell and switchs to get lower casting times!!! */
        op->spelltype = type;         op->spelltype = type;
        op->spell_state = 1;         op->spell_state = 1;
   
   
  /*  put the stringarg into the object struct so that when the   /*  put the stringarg into the object struct so that when the
      spell is actually cast, it knows about the stringarg.       spell is actually cast, it knows about the stringarg.
      necessary for the invoke command spells.  */       necessary for the invoke command spells.  */
Line 242
 
Line 239
       new_draw_info(NDI_UNIQUE, 0,op,"You are casting!");        new_draw_info(NDI_UNIQUE, 0,op,"You are casting!");
     return 0;      return 0;
   }    }
 #endif    }
   
   /*  ban removed on clerical spells in no-magic areas */    /*  ban removed on clerical spells in no-magic areas */
   if (!ability && item != spellPotion &&     if (!ability && item != spellPotion &&
  ( ((!s->cleric)&&blocks_magic(op->map,op->x,op->y))||   ( ((!s->cleric)&&blocks_magic(op->map,op->x,op->y))||
Line 273
 
Line 271
   
     play_sound_player_only(op->contr, SOUND_FUMBLE_SPELL,0,0);      play_sound_player_only(op->contr, SOUND_FUMBLE_SPELL,0,0);
     new_draw_info(NDI_UNIQUE, 0,op,"You fumble the spell.");      new_draw_info(NDI_UNIQUE, 0,op,"You fumble the spell.");
 #ifdef CASTING_TIME      if (settings.casting_time == TRUE) {
   op->casting = -1;    op->casting = -1;
   op->spell_state = 1;    op->spell_state = 1;
 #endif          }
     if(s->sp==0) /* Shouldn't happen... */      if(s->sp==0) /* Shouldn't happen... */
       return 0;        return 0;
     return(random_roll(1, SP_level_spellpoint_cost(op,caster,type), op,       return(random_roll(1, SP_level_spellpoint_cost(op,caster,type), op,
Line 301
 
Line 299
  * spell takes effect, and the caster can possibly be disturbed.   * spell takes effect, and the caster can possibly be disturbed.
  * (maybe that should depend upon the spell cast?)   * (maybe that should depend upon the spell cast?)
  */   */
 #ifdef CASTING_TIME    if (settings.casting_time == TRUE) {
 if (item == spellNormal && !ability ){  if (item == spellNormal && !ability ){
   op->casting = -1;    op->casting = -1;
   op->spell_state = 1;    op->spell_state = 1;
Line 309
 
Line 307
   type = op->spelltype;    type = op->spelltype;
   stringarg = op->spellarg;    stringarg = op->spellarg;
 }  }
 #else    } else {
   /* It seems the that the patch that added spell casting times    /* It seems the that the patch that added spell casting times
    * increased the time value of most spells by about 10.  So divide     * increased the time value of most spells by about 10.  So divide
    * by 10 to get back to more normal use.     * by 10 to get back to more normal use.
    */     */
   op->speed_left -= (s->time*PATH_TIME_MULT(op,s) / 10) * FABS(op->speed);    op->speed_left -= (s->time*PATH_TIME_MULT(op,s) / 10) * FABS(op->speed);
 #endif    }
   switch((enum spellnrs) type) {    switch((enum spellnrs) type) {
   case SP_BULLET:    case SP_BULLET:
   case SP_LARGE_BULLET:    case SP_LARGE_BULLET:
Line 670
 
Line 668
     if(caster->type == PLAYER)      if(caster->type == PLAYER)
       success=write_rune(op,dir,0,-2,stringarg);        success=write_rune(op,dir,0,-2,stringarg);
     else success= 0;      else success= 0;
 #ifdef CASTING_TIME  
    /* free the spell arg */     /* free the spell arg */
    if(stringarg) {free(stringarg);stringarg=NULL; };      if(settings.casting_time == TRUE && stringarg) {
 #endif   free(stringarg);
    stringarg=NULL;
       }
     break;      break;
   case SP_LIGHT:    case SP_LIGHT:
     success = cast_light(op,caster,dir);      success = cast_light(op,caster,dir);
Line 752
 
Line 749
   }    }
   
   play_sound_map(op->map, op->x, op->y, SOUND_CAST_SPELL_0 + type);    play_sound_map(op->map, op->x, op->y, SOUND_CAST_SPELL_0 + type);
 #ifdef CASTING_TIME  
    /* free the spell arg */     /* free the spell arg */
    if(stringarg) {free(stringarg);stringarg=NULL; };    if(settings.casting_time == TRUE && stringarg) {
 #endif        free(stringarg);stringarg=NULL;
     }
   
 #ifdef SPELLPOINT_LEVEL_DEPEND  #ifdef SPELLPOINT_LEVEL_DEPEND
   return success?SP_level_spellpoint_cost(op,caster,type):0;    return success?SP_level_spellpoint_cost(op,caster,type):0;


Legend:
line(s) removed in v.1.68 
line(s) changed
 line(s) added in v.1.69

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