Difference for server/spell_effect.c from version 1.14 to 1.15


version 1.14 version 1.15
Line 1
 
Line 1
 /*  /*
  * static char *rcsid_spell_effect_c =   * static char *rcsid_spell_effect_c =
  *   "$Id: spell_effect.c,v 1.14 2000/05/17 03:51:15 cvs Exp $";   *   "$Id: spell_effect.c,v 1.15 2000/05/26 09:50:49 jec Exp $";
  */   */
   
   
Line 86
 
Line 86
      else tmp->stats.dam=power; /* nasty recoils! */       else tmp->stats.dam=power; /* nasty recoils! */
   
      tmp->stats.maxhp=tmp->count; /*??*/       tmp->stats.maxhp=tmp->count; /*??*/
      insert_ob_in_map(tmp,op->map);       insert_ob_in_map(tmp,op->map,NULL);
  }   }
     }      }
 }  }
Line 159
 
Line 159
     tmp->stats.hp+=lvl/5;  /* increase the area of destruction */      tmp->stats.hp+=lvl/5;  /* increase the area of destruction */
     tmp->stats.dam=lvl; /* nasty recoils! */       tmp->stats.dam=lvl; /* nasty recoils! */
     tmp->stats.maxhp=tmp->count; /*??*/       tmp->stats.maxhp=tmp->count; /*??*/
     insert_ob_in_map(tmp,op->map);       insert_ob_in_map(tmp,op->map,op);
   
 }  }
   
Line 167
 
Line 167
   int i,j;    int i,j;
   object *tmp;    object *tmp;
   
   spell_effect(SP_AGGRAVATION, op->x, op->y, op->map);    spell_effect(SP_AGGRAVATION, op->x, op->y, op->map, op);
   
   for (i = 0; i < op->map->mapx; i++)    for (i = 0; i < op->map->mapx; i++)
     for (j = 0; j < op->map->mapy; j++) {      for (j = 0; j < op->map->mapy; j++) {
Line 196
 
Line 196
     new_draw_info_format(NDI_UNIQUE, 0, op,      new_draw_info_format(NDI_UNIQUE, 0, op,
  "The %s vibrates violently, then explodes!",query_name(wand));   "The %s vibrates violently, then explodes!",query_name(wand));
     play_sound_map(op->map, op->x, op->y, SOUND_OB_EXPLODE);      play_sound_map(op->map, op->x, op->y, SOUND_OB_EXPLODE);
     spell_effect(SP_DESTRUCTION, op->x, op->y, op->map);      spell_effect(SP_DESTRUCTION, op->x, op->y, op->map, op);
     remove_ob(wand);      remove_ob(wand);
     free_object(wand);      free_object(wand);
     return 1;      return 1;
Line 269
 
Line 269
     for(tmp = op->inv; tmp != NULL; tmp = next) {      for(tmp = op->inv; tmp != NULL; tmp = next) {
  next = tmp->below;   next = tmp->below;
  if(QUERY_FLAG(tmp, FLAG_APPLIED))   if(QUERY_FLAG(tmp, FLAG_APPLIED))
      apply(op,tmp,0);       manual_apply(op,tmp,0);
  if(tmp->type == ABILITY) {   if(tmp->type == ABILITY) {
      remove_ob(tmp);       remove_ob(tmp);
      free_object(tmp);       free_object(tmp);
Line 294
 
Line 294
   
     /* Put the new creature on the map */      /* Put the new creature on the map */
     op->x = x; op->y = y;      op->x = x; op->y = y;
     insert_ob_in_map(op,map);      insert_ob_in_map(op,map,owner);
   
     /* It is possible that there is something on the map that kills      /* It is possible that there is something on the map that kills
      * the object when inserted.  Unlikely, but worth checking. */       * the object when inserted.  Unlikely, but worth checking. */
Line 491
 
Line 491
  */   */
  image->stats.food += range;   image->stats.food += range;
  image->speed_left = 0.1;   image->speed_left = 0.1;
  insert_ob_in_map(image,op->map);   insert_ob_in_map(image,op->map,op);
     }      }
     return 1;      return 1;
 }  }
Line 567
 
Line 567
   spb->speed_left= -0.1;    spb->speed_left= -0.1;
   if(type==SP_LARGE_SPEEDBALL)    if(type==SP_LARGE_SPEEDBALL)
     spb->stats.dam=30;      spb->stats.dam=30;
   insert_ob_in_map(spb,op->map);    insert_ob_in_map(spb,op->map,op);
   return 1;    return 1;
 }  }
   
Line 872
 
Line 872
     return 0;      return 0;
   }    }
   tmp->x=op->x+freearr_x[dir],tmp->y=op->y+freearr_y[dir];    tmp->x=op->x+freearr_x[dir],tmp->y=op->y+freearr_y[dir];
   insert_ob_in_map(tmp,op->map);    insert_ob_in_map(tmp,op->map,op);
   
   if (QUERY_FLAG(tmp, FLAG_REMOVED)) {    if (QUERY_FLAG(tmp, FLAG_REMOVED)) {
     new_draw_info(NDI_UNIQUE, 0,op,"Something destroys your wall");      new_draw_info(NDI_UNIQUE, 0,op,"Something destroys your wall");
Line 896
 
Line 896
  tmp2 = get_object();   tmp2 = get_object();
  copy_object(tmp,tmp2);   copy_object(tmp,tmp2);
  tmp2->x = x; tmp2->y = y;   tmp2->x = x; tmp2->y = y;
  insert_ob_in_map(tmp2,op->map);   insert_ob_in_map(tmp2,op->map,op);
  } else posblocked=1;   } else posblocked=1;
  x = tmp->x-i*freearr_x[dir2]; y = tmp->y-i*freearr_y[dir2];   x = tmp->x-i*freearr_x[dir2]; y = tmp->y-i*freearr_y[dir2];
  if(!blocked(op->map,x,y)&&!negblocked) {   if(!blocked(op->map,x,y)&&!negblocked) {
  tmp2 = get_object();   tmp2 = get_object();
  copy_object(tmp,tmp2);   copy_object(tmp,tmp2);
  tmp2->x = x; tmp2->y = y;   tmp2->x = x; tmp2->y = y;
  insert_ob_in_map(tmp2,op->map);   insert_ob_in_map(tmp2,op->map,op);
  } else negblocked=1;   } else negblocked=1;
   }    }
   }    }
Line 959
 
Line 959
   tmp->glow_radius=dam;    tmp->glow_radius=dam;
   tmp->x=x,tmp->y=y;    tmp->x=x,tmp->y=y;
   if(tmp->speed<=0) tmp->speed = 0.000001; /* safety */    if(tmp->speed<=0) tmp->speed = 0.000001; /* safety */
   insert_ob_in_map(tmp,op->map);    insert_ob_in_map(tmp,op->map,op);
   
   if(op->type==PLAYER) draw(op);    if(op->type==PLAYER) draw(op);
   return 1;    return 1;
Line 1003
 
Line 1003
   
      remove_ob(op);       remove_ob(op);
      op->x=x,op->y=y;       op->x=x,op->y=y;
      insert_ob_in_map(op,op->map);       insert_ob_in_map(op,op->map,op);
      draw(op);       draw(op);
      return 1;       return 1;
  }   }
Line 1031
 
Line 1031
     /* Actually move the player now */      /* Actually move the player now */
     remove_ob(op);      remove_ob(op);
     op->x+=freearr_x[dir]*dist,op->y+=freearr_y[dir]*dist;      op->x+=freearr_x[dir]*dist,op->y+=freearr_y[dir]*dist;
     insert_ob_in_map(op,op->map);      insert_ob_in_map(op,op->map,op);
     draw(op);      draw(op);
     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;
Line 1482
 
Line 1482
       prev = tmp;        prev = tmp;
     }      }
     head->direction = dir;      head->direction = dir;
     insert_ob_in_map(head, op->map);      insert_ob_in_map(head, op->map, op);
     if (!QUERY_FLAG(head, FLAG_FREED) && head->randomitems != NULL) {      if (!QUERY_FLAG(head, FLAG_FREED) && head->randomitems != NULL) {
       object *tmp;        object *tmp;
       create_treasure(head->randomitems,head,GT_INVENTORY,6,0);        create_treasure(head->randomitems,head,GT_INVENTORY,6,0);
Line 1528
 
Line 1528
   
   set_owner(tmp,op);    set_owner(tmp,op);
   tmp->x=dx,tmp->y=dy;    tmp->x=dx,tmp->y=dy;
   insert_ob_in_map(tmp,op->map);    insert_ob_in_map(tmp,op->map,op);
   return 1;    return 1;
 }  }
   
Line 1545
 
Line 1545
  if (op->type==PLAYER) drop(env,op);   if (op->type==PLAYER) drop(env,op);
  else {   else {
      remove_ob(op);       remove_ob(op);
      insert_ob_in_map(op, env->map);       insert_ob_in_map(op, env->map, op);
  }   }
   }    }
   if (env->map == NULL)    if (env->map == NULL)
Line 1581
 
Line 1581
     if(op->type==PLAYER)      if(op->type==PLAYER)
  set_owner(tmp,op);   set_owner(tmp,op);
   
     insert_ob_in_map(tmp,op->map);      if ((tmp = insert_ob_in_map(tmp,op->map,op)) != NULL)
   
     /* It is possible that the object got destroyed by the insert above */  
     if (!QUERY_FLAG(tmp, FLAG_FREED))  
  move_cancellation(tmp);   move_cancellation(tmp);
     return 1;      return 1;
 }  }
Line 1599
 
Line 1596
   if(reflwall(op->map,op->x,op->y)) {    if(reflwall(op->map,op->x,op->y)) {
   
     op->direction=absdir(op->direction+4);      op->direction=absdir(op->direction+4);
     insert_ob_in_map(op,op->map);      insert_ob_in_map(op,op->map,op);
     return;      return;
   }    }
   hit_map(op, 0, op->attacktype);    hit_map(op, 0, op->attacktype);
   insert_ob_in_map(op,op->map);    insert_ob_in_map(op,op->map,op);
 }  }
   
 void cancellation(object *op)  void cancellation(object *op)
Line 1792
 
Line 1789
  tmp-> nrof = small_nuggets;   tmp-> nrof = small_nuggets;
  tmp->x = x;   tmp->x = x;
  tmp->y = y;   tmp->y = y;
  insert_ob_in_map(tmp, op->map);   insert_ob_in_map(tmp, op->map, op);
  }   }
  if (large_nuggets) {   if (large_nuggets) {
  tmp = get_object();   tmp = get_object();
Line 1800
 
Line 1797
  tmp-> nrof = large_nuggets;   tmp-> nrof = large_nuggets;
  tmp->x = x;   tmp->x = x;
  tmp->y = y;   tmp->y = y;
  insert_ob_in_map(tmp, op->map);   insert_ob_in_map(tmp, op->map, op);
  }   }
 }  }
   
Line 1974
 
Line 1971
   if (!success)    if (!success)
     new_draw_info(NDI_UNIQUE, 0,op, "You can't reach anything unidentified.");      new_draw_info(NDI_UNIQUE, 0,op, "You can't reach anything unidentified.");
   else {    else {
     spell_effect(SP_IDENTIFY, op->x, op->y, op->map);      spell_effect(SP_IDENTIFY, op->x, op->y, op->map, op);
   }    }
   return success;    return success;
 }  }
Line 2065
 
Line 2062
           object *detect_ob = arch_to_object(detect_arch);            object *detect_ob = arch_to_object(detect_arch);
           detect_ob->x = x;            detect_ob->x = x;
           detect_ob->y = y;            detect_ob->y = y;
           insert_ob_in_map(detect_ob, op->map);            insert_ob_in_map(detect_ob, op->map, op);
       }        }
     }      }
   if ((type == SP_DETECT_MAGIC || type == SP_DETECT_CURSE) &&    if ((type == SP_DETECT_MAGIC || type == SP_DETECT_CURSE) &&
Line 2143
 
Line 2140
         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;
                 insert_ob_in_map(effect,tmp->map);                  insert_ob_in_map(effect,tmp->map,op);
         }          }
         SET_FLAG(tmp,FLAG_UNAGGRESSIVE);          SET_FLAG(tmp,FLAG_UNAGGRESSIVE);
   }          }      
Line 2181
 
Line 2178
  /* that players will garner much exp with */   /* that players will garner much exp with */
  /* this spell */   /* this spell */
 #endif  #endif
      insert_ob_in_map(tmp,op->map);       insert_ob_in_map(tmp,op->map,op);
   }    }
   
   return 1;    return 1;
Line 2266
 
Line 2263
  free_object(tmp);   free_object(tmp);
  return 0;   return 0;
     }      }
     insert_ob_in_map(tmp,op->map);      insert_ob_in_map(tmp,op->map,op);
     if(QUERY_FLAG(tmp, FLAG_BLOCKSVIEW))      if(QUERY_FLAG(tmp, FLAG_BLOCKSVIEW))
  update_all_los(op->map);   update_all_los(op->map);
     if(op->type==PLAYER)      if(op->type==PLAYER)
Line 2474
 
Line 2471
  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;
  insert_ob_in_map(effect,tmp->map);   insert_ob_in_map(effect,tmp->map,op);
  }   }
  set_owner(tmp,op);   set_owner(tmp,op);
  SET_FLAG(tmp,FLAG_MONSTER);   SET_FLAG(tmp,FLAG_MONSTER);
Line 2512
 
Line 2509
         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;
                 insert_ob_in_map(effect,tmp->map);                  insert_ob_in_map(effect,tmp->map,op);
         }          }
         set_owner(tmp,op);          set_owner(tmp,op);
         SET_FLAG(tmp,FLAG_MONSTER);          SET_FLAG(tmp,FLAG_MONSTER);
Line 2707
 
Line 2704
      }       }
  } /* if monster level is much less than character level */   } /* if monster level is much less than character level */
   
  insert_ob_in_map(head, op->map);   insert_ob_in_map(head, op->map, op);
  if (!QUERY_FLAG(head, FLAG_FREED) && head->randomitems != NULL) {   if (!QUERY_FLAG(head, FLAG_FREED) && head->randomitems != NULL) {
      object *tmp;       object *tmp;
      create_treasure(head->randomitems,head,GT_INVENTORY,6,0);       create_treasure(head->randomitems,head,GT_INVENTORY,6,0);
Line 2815
 
Line 2812
   tmp->speed_left= -1;    tmp->speed_left= -1;
   tmp->x=op->x+freearr_x[dir],tmp->y=op->y+freearr_y[dir];    tmp->x=op->x+freearr_x[dir],tmp->y=op->y+freearr_y[dir];
   tmp->direction=dir;    tmp->direction=dir;
   insert_ob_in_map(tmp,op->map);    insert_ob_in_map(tmp,op->map,op);
   return 1;    return 1;
 }  }
    
Line 2967
 
Line 2964
       }        }
   }      } 
   
   insert_ob_in_map(hitter,op->map);     insert_ob_in_map(hitter,op->map,op);
    
   return success;    return success;
 }  }
Line 3204
 
Line 3201
   tmp->speed_left= -1;    tmp->speed_left= -1;
   tmp->x=op->x+freearr_x[dir],tmp->y=op->y+freearr_y[dir];    tmp->x=op->x+freearr_x[dir],tmp->y=op->y+freearr_y[dir];
   tmp->direction=dir;    tmp->direction=dir;
   insert_ob_in_map(tmp,op->map);    insert_ob_in_map(tmp,op->map,op);
   return 1;    return 1;
 }  }
   
Line 3277
 
Line 3274
         if(effect){          if(effect){
                 effect->x = tmp->x;                  effect->x = tmp->x;
                 effect->y = tmp->y;                  effect->y = tmp->y;
                 insert_ob_in_map(effect,op->map);                  insert_ob_in_map(effect,op->map,op);
         }          }
       }        }
 #endif  #endif
Line 3435
 
Line 3432
  flash->x = x;   flash->x = x;
  flash->y = y;   flash->y = y;
  flash->map = walk->map;   flash->map = walk->map;
  insert_ob_in_map(flash,walk->map);   insert_ob_in_map(flash,walk->map,op);
  return 1;   return 1;
    }     }
    free_object(disease);     free_object(disease);


Legend:
line(s) removed in v.1.14 
line(s) changed
 line(s) added in v.1.15

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