Difference for server/spell_effect.c from version 1.31 to 1.32


version 1.31 version 1.32
Line 1
 
Line 1
 /*  /*
  * static char *rcsid_spell_effect_c =   * static char *rcsid_spell_effect_c =
  *   "$Id: spell_effect.c,v 1.31 2000/11/24 01:16:01 peterm Exp $";   *   "$Id: spell_effect.c,v 1.32 2000/12/04 00:40:05 cvs Exp $";
  */   */
   
   
Line 754
 
Line 754
 }  }
   
 int magic_wall(object *op,object *caster,int dir,int spell_type) {  int magic_wall(object *op,object *caster,int dir,int spell_type) {
   object *tmp;      object *tmp, *tmp2; 
       int i,posblocked=0,negblocked=0;
   
   if(!dir) {    if(!dir) {
     new_draw_info(NDI_UNIQUE, 0,op,"In what direction?");      new_draw_info(NDI_UNIQUE, 0,op,"In what direction?");
     return 0;      return 0;
Line 766
 
Line 768
   switch(spell_type) {    switch(spell_type) {
   case SP_EARTH_WALL:    case SP_EARTH_WALL:
     tmp=get_archetype("earthwall");      tmp=get_archetype("earthwall");
     tmp->immune=0,tmp->protected=0;       for (i=0; i<NROFATTACKS; i++)
    tmp->resist[i]=0;
     tmp->stats.hp = SP_PARAMETERS[spell_type].bdur +      tmp->stats.hp = SP_PARAMETERS[spell_type].bdur +
                   10* SP_level_strength_adjust(op,caster,spell_type);                    10* SP_level_strength_adjust(op,caster,spell_type);
  /* More solid, since they can be torn down */   /* More solid, since they can be torn down */
     tmp->stats.maxhp = tmp->stats.hp;      tmp->stats.maxhp = tmp->stats.hp;
     break;      break;
   
   case SP_FIRE_WALL:    case SP_FIRE_WALL:
     tmp=get_archetype("firebreath");      tmp=get_archetype("firebreath");
     tmp->attacktype |= AT_MAGIC;      tmp->attacktype |= AT_MAGIC;
Line 780
 
Line 784
     tmp->stats.dam=SP_PARAMETERS[spell_type].bdam      tmp->stats.dam=SP_PARAMETERS[spell_type].bdam
                   +SP_level_dam_adjust(op,caster,spell_type);                    +SP_level_dam_adjust(op,caster,spell_type);
     tmp->stats.food=1;                        /* so it doesn't propagate */      tmp->stats.food=1;                        /* so it doesn't propagate */
 #if 0  
     SET_SLOW_MOVE(tmp);  
     SET_SLOW_PENALTY(tmp,2);  
 #endif  
     SET_FLAG(tmp, FLAG_WALK_ON);      SET_FLAG(tmp, FLAG_WALK_ON);
     SET_FLAG(tmp, FLAG_FLY_ON);      SET_FLAG(tmp, FLAG_FLY_ON);
     set_owner(tmp,op);      set_owner(tmp,op);
     break;      break;
   
   case SP_FROST_WALL:    case SP_FROST_WALL:
     tmp=get_archetype("icestorm");      tmp=get_archetype("icestorm");
     tmp->attacktype |= AT_MAGIC;      tmp->attacktype |= AT_MAGIC;
Line 797
 
Line 798
                   +SP_level_dam_adjust(op,caster,spell_type);                    +SP_level_dam_adjust(op,caster,spell_type);
   
     tmp->stats.food=1;                        /* so it doesn't propagate */      tmp->stats.food=1;                        /* so it doesn't propagate */
 #if 0  
     SET_SLOW_MOVE(tmp);  
     SET_SLOW_PENALTY(tmp,3);  
 #endif  
     SET_FLAG(tmp, FLAG_WALK_ON);      SET_FLAG(tmp, FLAG_WALK_ON);
     SET_FLAG(tmp, FLAG_FLY_ON);      SET_FLAG(tmp, FLAG_FLY_ON);
     set_owner(tmp,op);      set_owner(tmp,op);
     break;      break;
   
   case SP_WALL_OF_THORNS:    case SP_WALL_OF_THORNS:
     tmp=get_archetype("thorns");      tmp=get_archetype("thorns");
     tmp->stats.hp=SP_PARAMETERS[spell_type].bdur      tmp->stats.hp=SP_PARAMETERS[spell_type].bdur
Line 812
 
Line 810
     tmp->stats.dam=SP_PARAMETERS[spell_type].bdam      tmp->stats.dam=SP_PARAMETERS[spell_type].bdam
                   +SP_level_dam_adjust(op,caster,spell_type);                    +SP_level_dam_adjust(op,caster,spell_type);
     SET_FLAG(tmp, FLAG_WALK_ON);      SET_FLAG(tmp, FLAG_WALK_ON);
     /* SET_FLAG(tmp, FLAG_FLY_ON); */  
     /* SET_FLAG(tmp, FLAG_BLOCKSVIEW); */   
     set_owner(tmp,op);      set_owner(tmp,op);
     break;      break;
   
   case SP_CHAOS_POOL:    case SP_CHAOS_POOL:
     tmp=get_archetype("color_spray");      tmp=get_archetype("color_spray");
     tmp->attacktype|=AT_MAGIC;      tmp->attacktype|=AT_MAGIC;
Line 829
 
Line 826
     SET_FLAG(tmp, FLAG_FLY_ON);      SET_FLAG(tmp, FLAG_FLY_ON);
     set_owner(tmp,op);      set_owner(tmp,op);
     break;      break;
   
   case SP_DARKNESS:    case SP_DARKNESS:
     tmp=get_archetype("darkness");      tmp=get_archetype("darkness");
     tmp->stats.food = SP_PARAMETERS[SP_DARKNESS].bdur      tmp->stats.food = SP_PARAMETERS[SP_DARKNESS].bdur
                       + SP_level_strength_adjust (op, caster, SP_DARKNESS);                        + SP_level_strength_adjust (op, caster, SP_DARKNESS);
     break;       break;
   
   case SP_COUNTERWALL:    case SP_COUNTERWALL:
     tmp=get_archetype("counterspell");      tmp=get_archetype("counterspell");
     tmp->attacktype|=AT_MAGIC;      tmp->attacktype|=AT_MAGIC;
Line 842
 
Line 841
     tmp->stats.dam=SP_PARAMETERS[spell_type].bdam      tmp->stats.dam=SP_PARAMETERS[spell_type].bdam
                   +SP_level_dam_adjust(op,caster,spell_type);                    +SP_level_dam_adjust(op,caster,spell_type);
     tmp->stats.food=1;      tmp->stats.food=1;
   
 /*  
     tmp->level=op->level;  
 */  
     tmp->level=SK_level(op);      tmp->level=SK_level(op);
     SET_FLAG(tmp, FLAG_WALK_ON);      SET_FLAG(tmp, FLAG_WALK_ON);
     SET_FLAG(tmp, FLAG_FLY_ON);      SET_FLAG(tmp, FLAG_FLY_ON);
     set_owner(tmp,op);      set_owner(tmp,op);
     break;      break;
   
   default:    default:
     LOG(llevError,"Unimplemented magic_wall spell: %d\n",spell_type);      LOG(llevError,"Unimplemented magic_wall spell: %d\n",spell_type);
     return 0;      return 0;
Line 867
 
Line 863
  created wall can extend, it won't go extend through   created wall can extend, it won't go extend through
  blocked spaces.  */   blocked spaces.  */
   
   {int i,posblocked=0,negblocked=0; object *tmp2;    
   for(i=1;i<5;i++) {    for(i=1;i<5;i++) {
  int x,y,dir2;   int x,y,dir2;
    
Line 888
 
Line 883
  insert_ob_in_map(tmp2,op->map,op);   insert_ob_in_map(tmp2,op->map,op);
  } else negblocked=1;   } else negblocked=1;
   }    }
   }  
   
   if(QUERY_FLAG(tmp, FLAG_BLOCKSVIEW))    if(QUERY_FLAG(tmp, FLAG_BLOCKSVIEW))
     update_all_los(op->map);      update_all_los(op->map);
Line 1193
 
Line 1188
     break;      break;
   case SP_IRONWOOD_SKIN:    case SP_IRONWOOD_SKIN:
   case SP_ARMOUR: {    case SP_ARMOUR: {
       /* With PR code, I wonder if this could get merged in with the other protection spells */
    /* peterm, modified so that it uses level-depend functions */     /* peterm, modified so that it uses level-depend functions */
     force->stats.ac=2+SP_level_dam_adjust(op,caster,spell_type);      force->stats.ac=2+SP_level_dam_adjust(op,caster,spell_type);
     if((tmp->stats.ac-force->stats.ac)<-20)       if((tmp->stats.ac-force->stats.ac)<-20)
  force->stats.ac=tmp->stats.ac+20;   force->stats.ac=tmp->stats.ac+20;
   
     force->armour = 5+4*SP_level_dam_adjust(op,caster,spell_type);      force->resist[ATNR_PHYSICAL] = 5+4*SP_level_dam_adjust(op,caster,spell_type);
     if (force->armour > 25)      if (force->resist[ATNR_PHYSICAL] > 25)
       force->armour = 25;   force->resist[ATNR_PHYSICAL]=25;
     if(tmp->armour>70&& force->armour>(100-tmp->armour)/3)      if(tmp->resist[ATNR_PHYSICAL]>70&& force->resist[ATNR_PHYSICAL]>(100-tmp->resist[ATNR_PHYSICAL])/3)
  force->armour=3;  /* diminishing returns at high armor. */   force->resist[ATNR_PHYSICAL]=3;  /* diminishing returns at high armor. */
     new_draw_info(NDI_UNIQUE, 0,tmp,"A force shimmers around you.");      new_draw_info(NDI_UNIQUE, 0,tmp,"A force shimmers around you.");
     break; }      break;
     }
   case SP_CONFUSION:    case SP_CONFUSION:
     force->attacktype |= (AT_CONFUSION|AT_PHYSICAL);      force->attacktype |= (AT_CONFUSION|AT_PHYSICAL);
     force->protected |= AT_CONFUSION;      force->resist[ATNR_CONFUSION] = 50; /*??? It was here before PR */
     break;      break;
   case SP_HEROISM:    case SP_HEROISM:
     if (tmp->type != PLAYER)      if (tmp->type != PLAYER)
Line 1219
 
Line 1216
   case SP_HOLY_POSSESSION: {    case SP_HOLY_POSSESSION: {
 #ifdef MULTIPLE_GODS  #ifdef MULTIPLE_GODS
     object *god = find_god(determine_god(op));      object *god = find_god(determine_god(op));
       int i;
   
     if(god) {      if(god) {
       force->attacktype|=god->attacktype;        force->attacktype|=god->attacktype;
       if(god->slaying) force->slaying = add_string(god->slaying);        if(god->slaying) force->slaying = add_string(god->slaying);
       force->immune|=god->immune;  
       force->protected|=god->protected;   /* Only give out good benefits, not bad */
    for (i=0; i<NROFATTACKS; i++)
        if (god->resist[i]>0) force->resist[i] = god->resist[i];
   
       force->path_attuned|=god->path_attuned;        force->path_attuned|=god->path_attuned;
       new_draw_info_format(NDI_UNIQUE, 0,tmp,        new_draw_info_format(NDI_UNIQUE, 0,tmp,
     "You are possessed by the essence of %s!",god->name);      "You are possessed by the essence of %s!",god->name);
Line 1257
 
Line 1259
 #ifdef MULTIPLE_GODS  #ifdef MULTIPLE_GODS
     object *god = find_god(determine_god(op));      object *god = find_god(determine_god(op));
     if(god) {      if(god) {
        force->protected|=god->protected;   int i;
   
    /* Only give out good benefits, and put a max on it */
    for (i=0; i<NROFATTACKS; i++)
        if (god->resist[i]>0) {
    force->resist[i] = god->resist[i];
    if (force->resist[i]>50) force->resist[i]=50;
        }
        force->path_attuned|=god->path_attuned;         force->path_attuned|=god->path_attuned;
           new_draw_info_format(NDI_UNIQUE, 0,tmp,            new_draw_info_format(NDI_UNIQUE, 0,tmp,
  "You receive the blessing of %s.",god->name);   "You receive the blessing of %s.",god->name);
Line 1272
 
Line 1281
     SET_FLAG(force,FLAG_SEE_IN_DARK);      SET_FLAG(force,FLAG_SEE_IN_DARK);
     break;      break;
   case SP_PROT_COLD:    case SP_PROT_COLD:
     force->protected|=AT_COLD;      force->resist[ATNR_COLD]=50;
     break;      break;
   case SP_PROT_FIRE:    case SP_PROT_FIRE:
     force->protected|=AT_FIRE;      force->resist[ATNR_FIRE]=50;
     break;      break;
   case SP_PROT_ELEC:    case SP_PROT_ELEC:
     force->protected|=AT_ELECTRICITY;      force->resist[ATNR_ELECTRICITY]=50;
     break;      break;
   case SP_PROT_POISON:    case SP_PROT_POISON:
     force->protected|=AT_POISON;      force->resist[ATNR_POISON]=50;
     break;      break;
   case SP_PROT_SLOW:    case SP_PROT_SLOW:
     force->protected|=AT_SLOW;      force->resist[ATNR_SLOW]=50;
     break;      break;
   case SP_PROT_PARALYZE:    case SP_PROT_PARALYZE:
     force->protected|=AT_PARALYZE;      force->resist[ATNR_PARALYZE]=50;
     break;      break;
   case SP_PROT_DRAIN:    case SP_PROT_DRAIN:
     force->protected|=AT_DRAIN;      force->resist[ATNR_DRAIN]=50;
     break;      break;
   case SP_PROT_ATTACK:    case SP_PROT_ATTACK:
     force->protected|=AT_PHYSICAL;      force->resist[ATNR_PHYSICAL]=50;
     break;      break;
   case SP_PROT_MAGIC:    case SP_PROT_MAGIC:
     force->protected|=AT_MAGIC;      force->resist[ATNR_MAGIC]=50;
     break;      break;
   case SP_PROT_CONFUSE:    case SP_PROT_CONFUSE:
     force->protected|=AT_CONFUSION;      force->resist[ATNR_CONFUSION]=50;
     break;      break;
   case SP_PROT_CANCEL:    case SP_PROT_CANCEL:
     force->protected|=AT_CANCELLATION;      force->resist[ATNR_CANCELLATION]=50;
     break;      break;
   case SP_PROT_DEPLETE:    case SP_PROT_DEPLETE:
     force->protected|=AT_DEPLETE;      force->resist[ATNR_DEPLETE]=50;
     break;      break;
   case SP_LEVITATE:    case SP_LEVITATE:
     SET_FLAG(force, FLAG_FLYING);      SET_FLAG(force, FLAG_FLYING);
     break;      break;
  /*mlee*/   /*mlee*/
   case SP_IMMUNE_COLD:    case SP_IMMUNE_COLD:
     force->immune|=AT_COLD;      force->resist[ATNR_COLD]=100;
     break;      break;
   case SP_IMMUNE_FIRE:    case SP_IMMUNE_FIRE:
     force->immune|=AT_FIRE;      force->resist[ATNR_FIRE]=100;
     break;      break;
   case SP_IMMUNE_ELEC:    case SP_IMMUNE_ELEC:
     force->immune|=AT_ELECTRICITY;      force->resist[ATNR_ELECTRICITY]=100;
     break;      break;
   case SP_IMMUNE_POISON:    case SP_IMMUNE_POISON:
     force->immune|=AT_POISON;      force->resist[ATNR_POISON]=100;
     break;      break;
   case SP_IMMUNE_SLOW:    case SP_IMMUNE_SLOW:
     force->immune|=AT_SLOW;      force->resist[ATNR_SLOW]=100;
     break;      break;
   case SP_IMMUNE_PARALYZE:    case SP_IMMUNE_PARALYZE:
     force->immune|=AT_PARALYZE;      force->resist[ATNR_PARALYZE]=100;
     break;      break;
   case SP_IMMUNE_DRAIN:    case SP_IMMUNE_DRAIN:
     force->immune|=AT_DRAIN;      force->resist[ATNR_DRAIN]=100;
     break;      break;
   case SP_IMMUNE_ATTACK:    case SP_IMMUNE_ATTACK:
     force->immune|=AT_PHYSICAL;      force->resist[ATNR_PHYSICAL]=100;
     break;      break;
   case SP_IMMUNE_MAGIC:    case SP_IMMUNE_MAGIC:
     force->immune|=AT_MAGIC;      force->resist[ATNR_MAGIC]=100;
     break;      break;
   
   case SP_INVULNERABILITY:    case SP_INVULNERABILITY:
     force->immune|=262143;  
     break;  
   case SP_PROTECTION:    case SP_PROTECTION:
     force->protected|=262143;      /* Don't give them everything, so can't do a simple loop.
     break;       * Added holyword & blind with PR's - they seemed to be
        * misising before.
        */
       if (spell_type == SP_INVULNERABILITY) i=100;
       else i=50;
       force->resist[ATNR_PHYSICAL]=i;
       force->resist[ATNR_MAGIC]=i;
       force->resist[ATNR_FIRE]=i;
       force->resist[ATNR_ELECTRICITY]=i;
       force->resist[ATNR_COLD]=i;
       force->resist[ATNR_CONFUSION]=i;
       force->resist[ATNR_ACID]=i;
       force->resist[ATNR_DRAIN]=i;
       force->resist[ATNR_GHOSTHIT]=i;
       force->resist[ATNR_POISON]=i;
       force->resist[ATNR_SLOW]=i;
       force->resist[ATNR_PARALYZE]=i;
       force->resist[ATNR_TURN_UNDEAD]=i;
       force->resist[ATNR_FEAR]=i;
       force->resist[ATNR_DEPLETE]=i;
       force->resist[ATNR_DEATH]=i;
       force->resist[ATNR_HOLYWORD]=i;
       force->resist[ATNR_BLIND]=i;
   
   
   case SP_HASTE:    case SP_HASTE:
     force->stats.exp=(3+SP_level_dam_adjust(op, caster,SP_HASTE));      force->stats.exp=(3+SP_level_dam_adjust(op, caster,SP_HASTE));
     if(op->speed > 0.2 * SP_level_strength_adjust(op,caster,SP_HASTE))       if(op->speed > 0.2 * SP_level_strength_adjust(op,caster,SP_HASTE))
Line 2118
 
Line 2150
         if(!tmp->race||!god||!god->race          if(!tmp->race||!god||!god->race
           ||!strstr(god->race,tmp->race)) {            ||!strstr(god->race,tmp->race)) {
 #endif  #endif
           if(tmp->immune&AT_MAGIC||tmp->immune&AT_GODPOWER) 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; 
    if(weap->slaying) /* selective pacify */      if(weap->slaying) /* selective pacify */
Line 2291
 
Line 2323
     if(plyr) {      if(plyr) {
       /* DAMN: added spell strength adjust; higher level casters transfer mana faster */        /* DAMN: added spell strength adjust; higher level casters transfer mana faster */
  int maxsp=plyr->stats.maxsp;   int maxsp=plyr->stats.maxsp;
  int sp=(plyr->stats.sp += SP_PARAMETERS[SP_TRANSFER].bdam   int sp=(plyr->stats.sp + SP_PARAMETERS[SP_TRANSFER].bdam
  + SP_level_dam_adjust(op,op,SP_TRANSFER));   + SP_level_dam_adjust(op,op,SP_TRANSFER));
   
    plyr->stats.sp = sp;
   
  new_draw_info(NDI_UNIQUE, 0,plyr,"You feel energy course through you.");   new_draw_info(NDI_UNIQUE, 0,plyr,"You feel energy course through you.");
  if(sp>=maxsp*2) {   if(sp>=maxsp*2) {
             new_draw_info(NDI_UNIQUE, 0,plyr,"Your head explodes!");              new_draw_info(NDI_UNIQUE, 0,plyr,"Your head explodes!");
Line 2456
 
Line 2490
      tmp&&(!QUERY_FLAG(tmp,FLAG_MONSTER));tmp=tmp->above);       tmp&&(!QUERY_FLAG(tmp,FLAG_MONSTER));tmp=tmp->above);
  if(!tmp) continue;   if(!tmp) continue;
  if(tmp->type==PLAYER) continue;   if(tmp->type==PLAYER) continue;
  if(tmp->immune & AT_MAGIC) continue;   if(tmp->resist[ATNR_MAGIC]==100) continue;
  if(QUERY_FLAG(tmp,FLAG_UNDEAD)) continue;   if(QUERY_FLAG(tmp,FLAG_UNDEAD)) continue;
  if(tmp->more || tmp->head) continue;  /* multiple square monsters NOT */   if(tmp->more || tmp->head) continue;  /* multiple square monsters NOT */
  /* 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; */
Line 2497
 
Line 2531
             tmp&&(!QUERY_FLAG(tmp,FLAG_MONSTER));tmp=tmp->above);              tmp&&(!QUERY_FLAG(tmp,FLAG_MONSTER));tmp=tmp->above);
         if(!tmp) continue;          if(!tmp) continue;
         if(tmp->type==PLAYER) continue;          if(tmp->type==PLAYER) continue;
         if(tmp->immune & AT_MAGIC) continue;          if(tmp->resist[ATNR_MAGIC]==100) continue;
         if(!QUERY_FLAG(tmp,FLAG_UNDEAD)) continue;          if(!QUERY_FLAG(tmp,FLAG_UNDEAD)) continue;
         if(tmp->more || tmp->head) continue;  /* multiple square monsters NOT */          if(tmp->more || tmp->head) continue;  /* multiple square monsters NOT */
         if(SK_level(op)+bonus < ( (RANDOM()%(2*tmp->level+1))-(op->stats.Wis-10)/2)) continue;          if(SK_level(op)+bonus < ( (RANDOM()%(2*tmp->level+1))-(op->stats.Wis-10)/2)) continue;
Line 2789
 
Line 2823
     }      }
   }    }
   tmp->attacktype|=god->attacktype;    tmp->attacktype|=god->attacktype;
   tmp->vulnerable|=god->vulnerable;    memcpy(tmp->resist, god->resist, sizeof(tmp->resist));
   tmp->immune|=god->immune;  
   tmp->protected|=god->protected;  
   if (tmp->race) {    if (tmp->race) {
     free_string (tmp->race);      free_string (tmp->race);
     tmp->race = NULL;      tmp->race = NULL;
Line 2887
 
Line 2919
    
 int cast_consecrate(object *op) {  int cast_consecrate(object *op) {
     char buf[MAX_BUF];      char buf[MAX_BUF];
     int success=0;  
   
 #ifdef MULTIPLE_GODS  #ifdef MULTIPLE_GODS
     object *tmp, *god=find_god(determine_god(op));      object *tmp, *god=find_god(determine_god(op));
Line 3115
 
Line 3146
   /* attacktype */    /* attacktype */
   if ( ! tmp->attacktype)    if ( ! tmp->attacktype)
     tmp->attacktype = AT_PHYSICAL;      tmp->attacktype = AT_PHYSICAL;
   
   for(i=0; i<NROFMATERIALS; i++)    for(i=0; i<NROFMATERIALS; i++)
     for(j=0; j<NROFATTACKS; j++)      for(j=0; j<NROFATTACKS; j++)
       if(weapon->material & (1<<i)) {        if(weapon->material & (1<<i)) {
    /* There was code here to try to even out the saving
    * throws.  This is probably not ideal, but works
    * for the time being.
    */
  if(material[i].save[j] < 3)    if(material[i].save[j] < 3)
    tmp->protected |= (1<<j);       tmp->resist[j] = 40;
  else if(material[i].save[j] > 14)    else if(material[i].save[j] > 14)
    tmp->vulnerable |= (1<<j);       tmp->resist[j] = -50;
       }        }
   tmp->protected &= ~weapon->vulnerable;  
   tmp->vulnerable &= ~(weapon->immune | weapon->protected);  
   /* Set weapon's immunity */    /* Set weapon's immunity */
   tmp->immune = weapon->immune | AT_CONFUSION | AT_POISON | AT_SLOW    tmp->resist[ATNR_CONFUSION] = 100;
     | AT_PARALYZE | AT_TURN_UNDEAD | AT_FEAR | AT_DEPLETE | AT_DEATH    tmp->resist[ATNR_POISON] = 100;
     | AT_BLIND;    tmp->resist[ATNR_SLOW] = 100;
     tmp->resist[ATNR_PARALYZE] = 100;
     tmp->resist[ATNR_TURN_UNDEAD] = 100;
     tmp->resist[ATNR_FEAR] = 100;
     tmp->resist[ATNR_DEPLETE] = 100;
     tmp->resist[ATNR_DEATH] = 100;
     tmp->resist[ATNR_BLIND] = 100;
   
   /* Improve weapon's armour value according to best save vs. physical of its material */    /* Improve weapon's armour value according to best save vs. physical of its material */
   for(a=0,i=0; i<NROFMATERIALS; i++) {    for(a=0,i=0; i<NROFMATERIALS; i++) {
     if(weapon->material & (1<<i) && material[i].save[0] > a) {      if(weapon->material & (1<<i) && material[i].save[0] > a) {
       a = material[i].save[0];        a = material[i].save[0];
     }      }
   }    }
   tmp->armour = 100 - (int)((100.0-(float)tmp->armour)/(30.0-2.0*(a>14?14.0:(float)a)));    tmp->resist[ATNR_PHYSICAL] = 100 - (int)((100.0-(float)tmp->resist[ATNR_PHYSICAL])/(30.0-2.0*(a>14?14.0:(float)a)));
   LOG (llevDebug, "animate_weapon: slaying %s\n",    LOG (llevDebug, "animate_weapon: slaying %s\n",
        tmp->slaying ? tmp->slaying : "nothing");         tmp->slaying ? tmp->slaying : "nothing");
   
Line 3151
 
Line 3193
  / ((float)(weapon->weight>1000)? weapon->weight : 1000)));   / ((float)(weapon->weight>1000)? weapon->weight : 1000)));
   if(tmp->speed > 3.33) tmp->speed = 3.33;    if(tmp->speed > 3.33) tmp->speed = 3.33;
   LOG(llevDebug,"animate_weapon: armour:%d  speed:%f  exp:%d.\n",    LOG(llevDebug,"animate_weapon: armour:%d  speed:%f  exp:%d.\n",
       tmp->armour, tmp->speed, tmp->stats.exp);        tmp->resist[ATNR_PHYSICAL], tmp->speed, tmp->stats.exp);
   
   /* spell-dependent finishing touches and descriptive text */    /* spell-dependent finishing touches and descriptive text */
   switch(spellnum) {    switch(spellnum) {
Line 3251
 
Line 3293
       tmp=get_map_ob(op->map,op->x+i,op->y+j);        tmp=get_map_ob(op->map,op->x+i,op->y+j);
       while(tmp!=NULL&&(!QUERY_FLAG(tmp, FLAG_ALIVE)        while(tmp!=NULL&&(!QUERY_FLAG(tmp, FLAG_ALIVE)
  ||tmp->type==PLAYER||tmp->more||tmp->head   ||tmp->type==PLAYER||tmp->more||tmp->head
  ||tmp->immune==AT_MAGIC))   ||tmp->resist[ATNR_MAGIC]==100))
         tmp=tmp->above;          tmp=tmp->above;
       if(tmp==NULL)        if(tmp==NULL)
         continue;          continue;
Line 3292
 
Line 3334
   if(out_of_map(op->map,x,y)) return 0;    if(out_of_map(op->map,x,y)) return 0;
   
   for(tmp=get_map_ob(op->map,x,y);tmp;tmp=tmp->above) {    for(tmp=get_map_ob(op->map,x,y);tmp;tmp=tmp->above) {
     if(QUERY_FLAG(tmp, FLAG_ALIVE)||tmp->immune&AT_MAGIC)      if(QUERY_FLAG(tmp, FLAG_ALIVE)||tmp->resist[ATNR_MAGIC]==100)
  continue;   continue;
     if(QUERY_FLAG(tmp,FLAG_IS_FLOOR)) break;      if(QUERY_FLAG(tmp,FLAG_IS_FLOOR)) break;
   }    }
Line 3504
 
Line 3546
   object *tmp;    object *tmp;
   char buf[MAX_BUF];    char buf[MAX_BUF];
   for(tmp=get_map_ob(op->map,op->x,op->y);tmp!=NULL;tmp=tmp->above) {    for(tmp=get_map_ob(op->map,op->x,op->y);tmp!=NULL;tmp=tmp->above) {
     int atk_lev, def_lev, kill_lev;      int atk_lev, def_lev;
   
     if(!QUERY_FLAG(tmp,FLAG_MONSTER)) continue;      if(!QUERY_FLAG(tmp,FLAG_MONSTER)) continue;
     if(QUERY_FLAG(tmp,FLAG_UNAGGRESSIVE)) continue;      if(QUERY_FLAG(tmp,FLAG_UNAGGRESSIVE)) continue;
     if(tmp->stats.exp == 0) continue;      if(tmp->stats.exp == 0) continue;


Legend:
line(s) removed in v.1.31 
line(s) changed
 line(s) added in v.1.32

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