Difference for server/spell_effect.c from version 1.53 to 1.54


version 1.53 version 1.54
Line 1
 
Line 1
 /*  /*
  * static char *rcsid_spell_effect_c =   * static char *rcsid_spell_effect_c =
  *   "$Id: spell_effect.c,v 1.53 2001/05/25 07:23:32 mardahl Exp $";   *   "$Id: spell_effect.c,v 1.54 2001/05/29 04:41:54 mwedel Exp $";
  */   */
   
   
Line 96
 
Line 96
   
 void prayer_failure(object *op, int failure,int power)  void prayer_failure(object *op, int failure,int power)
 {    { 
 #ifdef MULTIPLE_GODS   
   char *godname;    char *godname;
   
   if(!strcmp((godname=determine_god(op)),"none")) godname="Your spirit";    if(!strcmp((godname=determine_god(op)),"none")) godname="Your spirit";
 #endif   
   
   if(failure<= -20&&failure > -40) /* wonder */    if(failure<= -20&&failure > -40) /* wonder */
     {      {
 #ifdef MULTIPLE_GODS   
      new_draw_info_format(NDI_UNIQUE, 0,op,"%s gives a sign to renew your faith.",godname);       new_draw_info_format(NDI_UNIQUE, 0,op,"%s gives a sign to renew your faith.",godname);
 #else  
      new_draw_info(NDI_UNIQUE, 0,op,"God gives a sign to renew your faith.");  
 #endif  
      cast_cone(op,op,0,10,SP_WOW,spellarch[SP_WOW],0);       cast_cone(op,op,0,10,SP_WOW,spellarch[SP_WOW],0);
     }      }
   
Line 119
 
Line 113
    }     }
   else if (failure <= -60&&failure> -150) /* paralysis */    else if (failure <= -60&&failure> -150) /* paralysis */
   {    {
 #ifdef MULTIPLE_GODS  
     new_draw_info_format(NDI_UNIQUE, 0,op,"%s requires you to pray NOW.",godname);      new_draw_info_format(NDI_UNIQUE, 0,op,"%s requires you to pray NOW.",godname);
 #else  
     new_draw_info(NDI_UNIQUE, 0,op,"Your god requires you to pray NOW.");  
 #endif  
  new_draw_info(NDI_UNIQUE, 0,op,"You comply, ignoring all else.");   new_draw_info(NDI_UNIQUE, 0,op,"You comply, ignoring all else.");
     paralyze_player(op,op,99);      paralyze_player(op,op,99);
   }    }
   else if (failure <= -150) /* blast the immediate area */    else if (failure <= -150) /* blast the immediate area */
   {     {
 #ifdef MULTIPLE_GODS  
    new_draw_info_format(NDI_UNIQUE, 0,op,"%s smites you!",godname);     new_draw_info_format(NDI_UNIQUE, 0,op,"%s smites you!",godname);
 #else  
    new_draw_info(NDI_UNIQUE, 0,op,"God smites you!");  
 #endif  
      
    cast_magic_storm(op,get_archetype("god_power"), power);     cast_magic_storm(op,get_archetype("god_power"), power);
   
   }    }
 }  }
   
Line 1277
 
Line 1261
     cast_change_attr(op,caster,dir,SP_CONSTITUTION);      cast_change_attr(op,caster,dir,SP_CONSTITUTION);
     break;      break;
   case SP_HOLY_POSSESSION: {    case SP_HOLY_POSSESSION: {
 #ifdef MULTIPLE_GODS  
     object *god = find_god(determine_god(op));      object *god = find_god(determine_god(op));
     int i;      int i;
   
Line 1299
 
Line 1282
     "You are possessed by the essence of %s!",god->name);      "You are possessed by the essence of %s!",god->name);
     } else       } else
         new_draw_info(NDI_UNIQUE, 0,op,"Your blessing seems empty.");          new_draw_info(NDI_UNIQUE, 0,op,"Your blessing seems empty.");
 #endif  
     if(tmp!=op && op->type==PLAYER && tmp->type==PLAYER) {      if(tmp!=op && op->type==PLAYER && tmp->type==PLAYER) {
       new_draw_info_format(NDI_UNIQUE, 0, op,        new_draw_info_format(NDI_UNIQUE, 0, op,
     "You bless %s mightily!", tmp->name);      "You bless %s mightily!", tmp->name);
Line 1313
 
Line 1295
     force->stats.hp = 1 + SP_level_dam_adjust(op, caster,SP_REGENERATION);      force->stats.hp = 1 + SP_level_dam_adjust(op, caster,SP_REGENERATION);
     break;      break;
   case SP_CURSE: {      case SP_CURSE: { 
 #ifdef MULTIPLE_GODS  
     object *god = find_god(determine_god(op));      object *god = find_god(determine_god(op));
     if(god) {      if(god) {
       force->path_repelled|=god->path_repelled;        force->path_repelled|=god->path_repelled;
Line 1322
 
Line 1303
  "You are a victim of %s's curse!",god->name);   "You are a victim of %s's curse!",god->name);
     } else       } else
         new_draw_info(NDI_UNIQUE, 0,op,"Your curse seems empty.");          new_draw_info(NDI_UNIQUE, 0,op,"Your curse seems empty.");
 #endif  
     if(tmp!=op && caster->type==PLAYER)      if(tmp!=op && caster->type==PLAYER)
       new_draw_info_format(NDI_UNIQUE, 0, caster, "You curse %s!",tmp->name);        new_draw_info_format(NDI_UNIQUE, 0, caster, "You curse %s!",tmp->name);
     force->stats.ac -= SP_level_dam_adjust(op, caster,SP_CURSE);       force->stats.ac -= SP_level_dam_adjust(op, caster,SP_CURSE);
     force->stats.wc -= SP_level_dam_adjust(op, caster,SP_CURSE);      force->stats.wc -= SP_level_dam_adjust(op, caster,SP_CURSE);
     break; }       break; }
   case SP_BLESS: {     case SP_BLESS: {
 #ifdef MULTIPLE_GODS  
     object *god = find_god(determine_god(op));      object *god = find_god(determine_god(op));
     if(god) {      if(god) {
  int i;   int i;
Line 1347
 
Line 1327
  "You receive the blessing of %s.",god->name);   "You receive the blessing of %s.",god->name);
     } else       } else
         new_draw_info(NDI_UNIQUE, 0,op,"Your blessing seems empty.");          new_draw_info(NDI_UNIQUE, 0,op,"Your blessing seems empty.");
 #endif  
     if(tmp!=op && op->type==PLAYER && tmp->type==PLAYER) {      if(tmp!=op && op->type==PLAYER && tmp->type==PLAYER) {
       new_draw_info_format(NDI_UNIQUE, 0, op, "You bless %s.", tmp->name);        new_draw_info_format(NDI_UNIQUE, 0, op, "You bless %s.", tmp->name);
       new_draw_info_format(NDI_UNIQUE, 0, tmp, "%s blessed you.", op->name);        new_draw_info_format(NDI_UNIQUE, 0, tmp, "%s blessed you.", op->name);
Line 2119
 
Line 2099
             done_one = (tmp->type == PLAYER);              done_one = (tmp->type == PLAYER);
           break;            break;
         case SP_DETECT_EVIL: {           case SP_DETECT_EVIL: {
 #ifdef MULTIPLE_GODS  
    done_one = 0;     done_one = 0;
    if(QUERY_FLAG(tmp,FLAG_MONSTER)&&tmp->race) {     if(QUERY_FLAG(tmp,FLAG_MONSTER)&&tmp->race) {
      object *god=find_god(determine_god(op));       object *god=find_god(determine_god(op));
             if(god&&god->slaying&&strstr(god->slaying,tmp->race))              if(god&&god->slaying&&strstr(god->slaying,tmp->race))
  done_one = 1;   done_one = 1;
    }      }
 #else            break;
           if (op->type == PLAYER)   }
             done_one = (QUERY_FLAG(tmp, FLAG_MONSTER)&&  
  !QUERY_FLAG(tmp, FLAG_UNAGGRESSIVE)&&  
  !QUERY_FLAG(tmp, FLAG_FRIENDLY));  
           else  
             done_one = (tmp->type == PLAYER);  
 #endif  
           break; }   
         case SP_SHOW_INVIS:          case SP_SHOW_INVIS:
      /* Might there be other objects that we can make visibile? */       /* Might there be other objects that we can make visibile? */
      if (tmp->invisible && (QUERY_FLAG(tmp, FLAG_MONSTER) ||        if (tmp->invisible && (QUERY_FLAG(tmp, FLAG_MONSTER) ||
Line 2211
 
Line 2183
 int cast_pacify(object *op, object *weap, archetype *arch,int spellnum ) {  int cast_pacify(object *op, object *weap, archetype *arch,int spellnum ) {
   int i,r,j;     int i,r,j;
   object *tmp,*effect;    object *tmp,*effect;
 #ifdef MULTIPLE_GODS  
   object *god = find_god(determine_god(op));    object *god = find_god(determine_god(op));
 #endif  
      
   r= 1 + SP_level_strength_adjust(op,weap,SP_PACIFY);    r= 1 + SP_level_strength_adjust(op,weap,SP_PACIFY);
   
Line 2226
 
Line 2196
         if(!tmp) continue;          if(!tmp) continue;
         if(tmp->type==PLAYER) continue;          if(tmp->type==PLAYER) continue;
   
 #ifdef MULTIPLE_GODS /* we only go through checking if the monster is not aligned    /* we only go through checking if the monster is not aligned
  member, we dont worship a god, or monster has no race */    member, we dont worship a god, or monster has no race */
         if(!tmp->race||!god||!god->race          if(!tmp->race||!god||!god->race
           ||!strstr(god->race,tmp->race)) {            ||!strstr(god->race,tmp->race)) {
 #endif  
           if(tmp->resist[ATNR_MAGIC]==100||tmp->resist[ATNR_GODPOWER]==100) continue;            if(tmp->resist[ATNR_MAGIC]==100||tmp->resist[ATNR_GODPOWER]==100) continue;
  /* multiple square monsters only when caster is => level of creature */   /* multiple square monsters only when caster is => level of creature */
           if((tmp->more || tmp->head) && (SK_level(op) < tmp->level)) continue;              if((tmp->more || tmp->head) && (SK_level(op) < tmp->level)) continue; 
Line 2238
 
Line 2208
  if(tmp->race != weap->slaying && tmp->name != weap->slaying) continue;   if(tmp->race != weap->slaying && tmp->name != weap->slaying) continue;
         /* if(op->level <( (RANDOM()%(2*tmp->level+1))-(op->stats.Cha-10)/2)) continue; */           /* if(op->level <( (RANDOM()%(2*tmp->level+1))-(op->stats.Cha-10)/2)) continue; */
           if(SK_level(op) <( (RANDOM()%(2*tmp->level+1))-(op->stats.Cha-10)/2)) continue;            if(SK_level(op) <( (RANDOM()%(2*tmp->level+1))-(op->stats.Cha-10)/2)) continue;
 #ifdef MULTIPLE_GODS  
         }          }
 #endif  
         if((effect=get_archetype("detect_magic"))){          if((effect=get_archetype("detect_magic"))){
                 effect->x = tmp->x;                  effect->x = tmp->x;
                 effect->y = tmp->y;                  effect->y = tmp->y;
Line 2846
 
Line 2815
    
 int summon_avatar(object *op,object *caster,int dir, archetype *at, int spellnum) {  int summon_avatar(object *op,object *caster,int dir, archetype *at, int spellnum) {
   object *tmp;    object *tmp;
 #ifdef MULTIPLE_GODS  
   char buf[MAX_BUF];    char buf[MAX_BUF];
   object *god = find_god(determine_god(caster));     object *god = find_god(determine_god(caster));
   
Line 2862
 
Line 2830
    ,god->name,spellnum==SP_SUMMON_AVATAR?"avatar":"servant");     ,god->name,spellnum==SP_SUMMON_AVATAR?"avatar":"servant");
       return 0;        return 0;
   }    }
 #endif  
   
   /* safety checks... */    /* safety checks... */
   if(op->type==PLAYER)    if(op->type==PLAYER)
Line 2900
 
Line 2867
   if(tmp->stats.dam<0) tmp->stats.dam=127;  /*seen this go negative!*/    if(tmp->stats.dam<0) tmp->stats.dam=127;  /*seen this go negative!*/
   if(tmp->other_arch) tmp->other_arch=NULL;    if(tmp->other_arch) tmp->other_arch=NULL;
   
 #ifdef MULTIPLE_GODS /* tailor it to the gods nature */    /* tailor it to the gods nature */
   if(tmp) {     if(tmp) {
     object *tmp2;      object *tmp2;
     for(tmp2=tmp;tmp2;tmp2=tmp2->more) {       for(tmp2=tmp;tmp2;tmp2=tmp2->more) {
Line 2923
 
Line 2890
   if(god->slaying) tmp->slaying = add_string(god->slaying);    if(god->slaying) tmp->slaying = add_string(god->slaying);
   /* safety, we must allow a god's servants some reasonable attack */    /* safety, we must allow a god's servants some reasonable attack */
   if(!(tmp->attacktype&AT_PHYSICAL)) tmp->attacktype|=AT_PHYSICAL;    if(!(tmp->attacktype&AT_PHYSICAL)) tmp->attacktype|=AT_PHYSICAL;
 #else  
   tmp->attacktype|=AT_WEAPONMAGIC;  
 #endif  
   
   /*  make experience increase in proportion to the strength of     /*  make experience increase in proportion to the strength of
    *  the summoned creature. */     *  the summoned creature. */
Line 3007
 
Line 2971
 int cast_consecrate(object *op) {  int cast_consecrate(object *op) {
     char buf[MAX_BUF];      char buf[MAX_BUF];
   
 #ifdef MULTIPLE_GODS  
     object *tmp, *god=find_god(determine_god(op));      object *tmp, *god=find_god(determine_god(op));
   
     if(!god) {      if(!god) {
Line 3043
 
Line 3006
     }      }
     new_draw_info(NDI_UNIQUE, 0,op,"You are not standing over an altar!");      new_draw_info(NDI_UNIQUE, 0,op,"You are not standing over an altar!");
     return 0;      return 0;
 #else  
     new_draw_info(NDI_UNIQUE, 0,op,"Nothing happens.");  
     return 0;  
 #endif  
 }  }
   
   


Legend:
line(s) removed in v.1.53 
line(s) changed
 line(s) added in v.1.54

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