Difference for server/attack.c from version 1.30 to 1.31


version 1.30 version 1.31
Line 1
 
Line 1
 /*  /*
  * static char *rcsid_attack_c =   * static char *rcsid_attack_c =
  *   "$Id: attack.c,v 1.30 2001/01/19 05:43:31 cvs Exp $";   *   "$Id: attack.c,v 1.31 2001/02/06 05:56:28 cvs Exp $";
  */   */
 /*  /*
     CrossFire, A Multiplayer game for X-windows      CrossFire, A Multiplayer game for X-windows
Line 1443
 
Line 1443
 {  {
     object *tmp,*owner;      object *tmp,*owner;
   
     /* This shouldn't happen, but will prevent divide by zero errors below if it does. */      /* Save some work if we know it isn't going to affect the player */
     if (op->resist[ATNR_BLIND]==100) return;      if (op->resist[ATNR_BLIND]==100) return;
   
     tmp = present_in_ob(BLINDNESS,op);      tmp = present_in_ob(BLINDNESS,op);
Line 1454
 
Line 1454
       /* use floats so we don't lose too much precision due to rounding errors.        /* use floats so we don't lose too much precision due to rounding errors.
        * speed is a float anyways.         * speed is a float anyways.
        */         */
       tmp->speed = 100.0 * tmp->speed / (100.0 - (float)op->resist[ATNR_BLIND]);        tmp->speed =  tmp->speed * (100.0 - (float)op->resist[ATNR_BLIND]) / 100;
   
       tmp = insert_ob_in_ob(tmp,op);        tmp = insert_ob_in_ob(tmp,op);
       change_abil(op,tmp);   /* Mostly to display any messages */        change_abil(op,tmp);   /* Mostly to display any messages */
Line 1475
 
Line 1475
     float effect,max;      float effect,max;
     object *tmp;      object *tmp;
   
     /* Same note as blindness above */  
     if (op->resist[ATNR_PARALYZE]==100) return;  
   
     if((tmp=present(PARAIMAGE,op->map,op->x,op->y))==NULL) {      if((tmp=present(PARAIMAGE,op->map,op->x,op->y))==NULL) {
  tmp=clone_arch(PARAIMAGE);   tmp=clone_arch(PARAIMAGE);
Line 1488
 
Line 1486
  insert_ob_in_map_simple(tmp,op->map);   insert_ob_in_map_simple(tmp,op->map);
     }      }
     /* Do this as a float - otherwise, rounding might very well reduce this to 0 */      /* Do this as a float - otherwise, rounding might very well reduce this to 0 */
     effect = (float)dam * 3.0 / (100.0 - (float) op->resist[ATNR_PARALYZE]);      effect = (float)dam * 3.0 * (100.0 - op->resist[ATNR_PARALYZE]) / 100;
   
       if (effect==0) return;
   
     op->speed_left-=FABS(op->speed)*effect;      op->speed_left-=FABS(op->speed)*effect;
     tmp->stats.food+=(signed short) effect/op->speed;      tmp->stats.food+=(signed short) effect/op->speed;


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

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