Difference for server/spell_util.c from version 1.55 to 1.56


version 1.55 version 1.56
Line 1
 
Line 1
 /*  /*
  * static char *rcsid_spell_util_c =   * static char *rcsid_spell_util_c =
  *   "$Id: spell_util.c,v 1.55 2001/06/13 12:51:58 michtoen Exp $";   *   "$Id: spell_util.c,v 1.56 2001/07/14 04:11:18 mwedel Exp $";
  */   */
   
 /*  /*
Line 35
 
Line 35
 #endif  #endif
 #include <sounds.h>  #include <sounds.h>
   
 #ifdef sequent  
 /* stoopid sequent includes don't do this like they should */  
 extern char * sys_errlist[];  
 extern int sys_nerr;  
 #endif  
   
 char *range_name[range_size] = {  char *range_name[range_size] = {
   "none", "bow", "magic", "wand", "rod", "scroll", "horn"    "none", "bow", "magic", "wand", "rod", "scroll", "horn"
  ,"steal"   ,"steal"
Line 95
 
Line 89
     effect->x = x;      effect->x = x;
     effect->y = y;      effect->y = y;
   
     insert_ob_in_map(effect, map, originator);      insert_ob_in_map(effect, map, originator,0);
   }    }
 }  }
   
Line 814
 
Line 808
   }    }
   new_op->x=op->x+freearr_x[dir];    new_op->x=op->x+freearr_x[dir];
   new_op->y=op->y+freearr_y[dir];    new_op->y=op->y+freearr_y[dir];
   insert_ob_in_map(new_op,op->map,op);    insert_ob_in_map(new_op,op->map,op,0);
   return dir;    return dir;
 }  }
   
Line 882
 
Line 876
   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,op);    insert_ob_in_map(tmp,op->map,op,0);
   return 1;    return 1;
 }  }
   
Line 985
 
Line 979
     tmp->x=op->x,tmp->y=op->y;      tmp->x=op->x,tmp->y=op->y;
     tmp->direction=absdir(tmp->direction+4);      tmp->direction=absdir(tmp->direction+4);
   }    }
   if ((tmp = insert_ob_in_map(tmp,op->map,op)) != NULL)    if ((tmp = insert_ob_in_map(tmp,op->map,op,0)) != NULL)
     move_bolt (tmp);      move_bolt (tmp);
   return 1;    return 1;
 }  }
Line 1040
 
Line 1034
   if(QUERY_FLAG(tmp, FLAG_IS_TURNABLE))    if(QUERY_FLAG(tmp, FLAG_IS_TURNABLE))
     SET_ANIMATION(tmp, dir);      SET_ANIMATION(tmp, dir);
   
   if ((tmp = insert_ob_in_map (tmp, op->map, op)) == NULL)    if ((tmp = insert_ob_in_map (tmp, op->map, op,0)) == NULL)
     return 1;      return 1;
   switch(type) {    switch(type) {
     case SP_M_MISSILE:      case SP_M_MISSILE:
Line 1103
 
Line 1097
         && tmp->stats.dam)          && tmp->stats.dam)
       LOG (llevDebug, "cast_cone(): arch %s doesn't have walk_on 1 and "        LOG (llevDebug, "cast_cone(): arch %s doesn't have walk_on 1 and "
            "fly_on 1\n", spell_arch->name);             "fly_on 1\n", spell_arch->name);
     insert_ob_in_map(tmp,op->map,op);      insert_ob_in_map(tmp,op->map,op,0);
     if(tmp->other_arch) cone_drop(tmp);      if(tmp->other_arch) cone_drop(tmp);
   }    }
   return success;    return success;
Line 1167
 
Line 1161
      remove_ob(tmp);       remove_ob(tmp);
      tmp->x = nx;       tmp->x = nx;
      tmp->y = ny;       tmp->y = ny;
      insert_ob_in_map(tmp,op->map,op);       insert_ob_in_map(tmp,op->map,op,0);
  }   }
 #endif  #endif
     }      }
Line 1185
 
Line 1179
     new_ob->chosen_skill=op->chosen_skill;      new_ob->chosen_skill=op->chosen_skill;
     new_ob->exp_obj = op->chosen_skill->exp_obj;      new_ob->exp_obj = op->chosen_skill->exp_obj;
   }    }
   insert_ob_in_map(new_ob,op->map,op);    insert_ob_in_map(new_ob,op->map,op,0);
      
 }  }
   
Line 1265
 
Line 1259
      tmp->stats.maxhp=op->stats.maxhp;       tmp->stats.maxhp=op->stats.maxhp;
      tmp->stats.dam = op->stats.dam;       tmp->stats.dam = op->stats.dam;
      tmp->attacktype=op->attacktype;       tmp->attacktype=op->attacktype;
      insert_ob_in_map(tmp,op->map,op);       insert_ob_in_map(tmp,op->map,op,0);
      if(tmp->other_arch) { cone_drop(tmp);}       if(tmp->other_arch) { cone_drop(tmp);}
  }   }
     }      }
Line 1293
 
Line 1287
   tmp->level = op->level;    tmp->level = op->level;
   SET_ANIMATION(tmp, dir);    SET_ANIMATION(tmp, dir);
   SET_FLAG(tmp, FLAG_FLYING);    SET_FLAG(tmp, FLAG_FLYING);
   if ((tmp = insert_ob_in_map (tmp, op->map, op)) != NULL)    if ((tmp = insert_ob_in_map (tmp, op->map, op,0)) != NULL)
     move_fired_arch (tmp);      move_fired_arch (tmp);
 }  }
   
Line 1310
 
Line 1304
   if(op->above!=NULL&&op->above->type!=PLAYER) {    if(op->above!=NULL&&op->above->type!=PLAYER) {
     SET_FLAG (op, FLAG_NO_APPLY);      SET_FLAG (op, FLAG_NO_APPLY);
     remove_ob(op);      remove_ob(op);
     insert_ob_in_map(op,op->map,op);      insert_ob_in_map(op,op->map,op,0);
     CLEAR_FLAG (op, FLAG_NO_APPLY);      CLEAR_FLAG (op, FLAG_NO_APPLY);
   }    }
   hit_map(op,0,op->attacktype);    hit_map(op,0,op->attacktype);
Line 1330
 
Line 1324
         tmp->stats.hp--;          tmp->stats.hp--;
         tmp->value=0;          tmp->value=0;
         tmp->x=dx,tmp->y=dy;          tmp->x=dx,tmp->y=dy;
         insert_ob_in_map(tmp,m,op);          insert_ob_in_map(tmp,m,op,0);
       }        }
     }      }
   }    }
Line 1372
 
Line 1366
  new_bolt->stats.dam++;   new_bolt->stats.dam++;
  tmp->stats.dam /= 2;  /* reduce father bolt damage */   tmp->stats.dam /= 2;  /* reduce father bolt damage */
  tmp->stats.dam++;   tmp->stats.dam++;
  new_bolt = insert_ob_in_map(new_bolt,op->map,op);   new_bolt = insert_ob_in_map(new_bolt,op->map,op,0);
  update_turn_face(new_bolt);   update_turn_face(new_bolt);
   }    }
 }  }
Line 1440
 
Line 1434
       tmp->value=0;        tmp->value=0;
       tmp->stats.hp++;        tmp->stats.hp++;
       tmp->x+=DIRX(tmp),tmp->y+=DIRY(tmp);        tmp->x+=DIRX(tmp),tmp->y+=DIRY(tmp);
       tmp = insert_ob_in_map(tmp,op->map,op);        tmp = insert_ob_in_map(tmp,op->map,op,0);
   
  /* New forking code.  Possibly create forks of this object   /* New forking code.  Possibly create forks of this object
  going off in other directions. */   going off in other directions. */
Line 1552
 
Line 1546
      }       }
  } /* If victim */   } /* If victim */
     }      }
     if(made_attack) update_object(op);      if(made_attack) update_object(op,UP_OBJ_FACE);
 }  }
   
 void control_golem(object *op,int dir) {  void control_golem(object *op,int dir) {
Line 1599
 
Line 1593
     op->direction=absdir(op->direction+((op->direction-i+8)%8<4?-1:1));      op->direction=absdir(op->direction+((op->direction-i+8)%8<4?-1:1));
     SET_ANIMATION(op, op->direction);      SET_ANIMATION(op, op->direction);
   }    }
   insert_ob_in_map(op,op->map,op);    insert_ob_in_map(op,op->map,op,0);
 }  }
   
 void explode_object(object *op)  void explode_object(object *op)
Line 1626
 
Line 1620
     remove_ob (op);      remove_ob (op);
     op->x = env->x;      op->x = env->x;
     op->y = env->y;      op->y = env->y;
     insert_ob_in_map_simple (op, env->map);      insert_ob_in_map(op, env->map, op, INS_NO_MERGE | INS_NO_WALK_ON);
   } else if (out_of_map (op->map, op->x, op->y)) {    } else if (out_of_map (op->map, op->x, op->y)) {
      LOG (llevError, "BUG: explode_object(): op out of map\n");       LOG (llevError, "BUG: explode_object(): op out of map\n");
      remove_ob (op);       remove_ob (op);
Line 1671
 
Line 1665
     CLEAR_FLAG (op, FLAG_WALK_ON);      CLEAR_FLAG (op, FLAG_WALK_ON);
     CLEAR_FLAG (op, FLAG_FLY_ON);      CLEAR_FLAG (op, FLAG_FLY_ON);
   
     insert_ob_in_map (tmp, op->map, op);      insert_ob_in_map (tmp, op->map, op,0);
     break;      break;
   }    }
   case CONE:     case CONE:
Line 1764
 
Line 1758
     remove_ob (op);      remove_ob (op);
     op->x = new_x;      op->x = new_x;
     op->y = new_y;      op->y = new_y;
     if ((op = insert_ob_in_map (op, op->map, op)) == NULL)      if ((op = insert_ob_in_map (op, op->map, op,0)) == NULL)
         return;          return;
   
     if (reflwall (op->map, op->x, op->y, op)) {      if (reflwall (op->map, op->x, op->y, op)) {
Line 1870
 
Line 1864
   remove_ob(op);    remove_ob(op);
   op->y=ny;    op->y=ny;
   op->x=nx;    op->x=nx;
   insert_ob_in_map(op,op->map,op);    insert_ob_in_map(op,op->map,op,0);
    
   dam_save = op->stats.dam;  /* save the original dam: we do halfdam on     dam_save = op->stats.dam;  /* save the original dam: we do halfdam on
                                 surrounding squares */                                  surrounding squares */
Line 1896
 
Line 1890
       new_ob = arch_to_object(op->other_arch);        new_ob = arch_to_object(op->other_arch);
       new_ob->x = hx;        new_ob->x = hx;
       new_ob->y = hy;        new_ob->y = hy;
       insert_ob_in_map(new_ob,op->map,op);        insert_ob_in_map(new_ob,op->map,op,0);
     }      }
   }    }
   /* restore to the center location and damage*/    /* restore to the center location and damage*/
Line 2215
 
Line 2209
   tmp->other_arch=swarm_type;  /* the archetype of the things to be fired*/    tmp->other_arch=swarm_type;  /* the archetype of the things to be fired*/
   tmp->direction=dir;     tmp->direction=dir;
   tmp->invisible=1;    tmp->invisible=1;
   insert_ob_in_map(tmp,op->map,op);    insert_ob_in_map(tmp,op->map,op,0);
 }  }
   
 /* 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.  */
Line 2302
 
Line 2296
   
     if (head->randomitems)       if (head->randomitems)
  create_treasure(head->randomitems, head, GT_INVISIBLE, op->map->difficulty,0);   create_treasure(head->randomitems, head, GT_INVISIBLE, op->map->difficulty,0);
     insert_ob_in_map(head,op->map,op);      insert_ob_in_map(head,op->map,op,0);
   
     /* thought it'd be cool to insert a burnout, too.*/      /* thought it'd be cool to insert a burnout, too.*/
     tmp=get_archetype("burnout");      tmp=get_archetype("burnout");
     tmp->map = op->map;      tmp->map = op->map;
     tmp->x=op->x+freearr_x[dir];      tmp->x=op->x+freearr_x[dir];
     tmp->y=op->y+freearr_y[dir];      tmp->y=op->y+freearr_y[dir];
     insert_ob_in_map(tmp,op->map,op);      insert_ob_in_map(tmp,op->map,op,0);
     }      }
 }  }
   
Line 2585
 
Line 2579
    
    /* ok, tell it where to be, and insert! */     /* ok, tell it where to be, and insert! */
    effect->x=target->x;effect->y=target->y;     effect->x=target->x;effect->y=target->y;
    insert_ob_in_map(effect,op->map,op);     insert_ob_in_map(effect,op->map,op,0);
    
    return 1;     return 1;
 }  }


Legend:
line(s) removed in v.1.55 
line(s) changed
 line(s) added in v.1.56

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