Difference for server/player.c from version 1.5 to 1.6


version 1.5 version 1.6
Line 1
 
Line 1
 /*  /*
  * static char *rcsid_player_c =   * static char *rcsid_player_c =
  *   "$Id: player.c,v 1.5 1999/08/18 20:55:37 damn Exp $";   *   "$Id: player.c,v 1.6 1999/09/17 19:01:19 damn Exp $";
  */   */
   
 /*  /*
Line 204
 
Line 204
     p->last_stats.grace=0, p->last_stats.maxgrace=0;      p->last_stats.grace=0, p->last_stats.maxgrace=0;
     p->last_stats.exp= -1,p->last_stats.food=0;      p->last_stats.exp= -1,p->last_stats.food=0;
     p->digestion=0,p->gen_hp=0,p->gen_sp=0,p->gen_grace=0;      p->digestion=0,p->gen_hp=0,p->gen_sp=0,p->gen_grace=0;
       p->gen_sp_armour=10;
     p->last_spell= -1;      p->last_spell= -1;
     p->last_value= -1;      p->last_value= -1;
     p->last_speed= -1;      p->last_speed= -1;
Line 1417
 
Line 1418
   object *tmp;    object *tmp;
   int last_food=op->stats.food;    int last_food=op->stats.food;
   int gen_hp, gen_sp, gen_grace;    int gen_hp, gen_sp, gen_grace;
     int over_hp, over_sp, over_grace;
   int x,y,i;  /*  these are for resurrection */    int x,y,i;  /*  these are for resurrection */
   mapstruct *map;  /*  this is for resurrection */    mapstruct *map;  /*  this is for resurrection */
     const int rate_hp = 1200;
     const int rate_sp = 2500;
     const int rate_grace = 2000;
     const int max_hp = 1;
     const int max_sp = 1;
     const int max_grace = 1;
   
   if (op->contr->outputs_sync) {    if (op->contr->outputs_sync) {
     for (i=0; i<NUM_OUTPUT_BUFS; i++)      for (i=0; i<NUM_OUTPUT_BUFS; i++)
Line 1431
 
Line 1439
     gen_hp=(op->contr->gen_hp+1)*op->stats.maxhp;      gen_hp=(op->contr->gen_hp+1)*op->stats.maxhp;
     gen_sp=(op->contr->gen_sp+1)*op->stats.maxsp;      gen_sp=(op->contr->gen_sp+1)*op->stats.maxsp;
  gen_grace=(op->contr->gen_grace+1)*op->stats.maxgrace;   gen_grace=(op->contr->gen_grace+1)*op->stats.maxgrace;
   
       /* Regenerate Spell Points */
     if(op->contr->golem==NULL&&--op->last_sp<0) {      if(op->contr->golem==NULL&&--op->last_sp<0) {
  if(op->stats.sp<op->stats.maxsp)        gen_sp = gen_sp * 10 / (op->contr->gen_sp_armour < 10? 10 : op->contr->gen_sp_armour);
  op->stats.sp++,op->stats.food--;        if(op->stats.sp<op->stats.maxsp) {
  op->last_sp=2000/(gen_sp<20 ? 30 : gen_sp+10);   op->stats.sp++;
  for(tmp=op->inv;tmp!=NULL;tmp=tmp->below)   op->stats.food--;
  if((tmp->type==ARMOUR||tmp->type==HELMET||tmp->type==BOOTS||   if(op->contr->digestion<0)
    tmp->type==SHIELD||tmp->type==GLOVES||tmp->type==GIRDLE||     op->stats.food+=op->contr->digestion;
    tmp->type==AMULET)   else if(op->contr->digestion>0&&RANDOM()%(1+op->contr->digestion))
  &&QUERY_FLAG(tmp, FLAG_APPLIED))     op->stats.food=last_food;
  op->last_sp+=ARMOUR_SPELLS(tmp);        }
         if (max_sp>1) {
    over_sp = (gen_sp+10)/rate_sp;
    if (over_sp > 0) {
      if(op->stats.sp<op->stats.maxsp) {
        op->stats.sp += over_sp>max_sp ? max_sp : over_sp;
        if(RANDOM()%rate_sp > ((gen_sp+10)%rate_sp))
          op->stats.sp--;
        if(op->stats.sp>op->stats.maxsp)
          op->stats.sp=op->stats.maxsp;
      }
      op->last_sp=0;
    } else {
      op->last_sp=rate_sp/(gen_sp<20 ? 30 : gen_sp+10);
    }
         } else {
    op->last_sp=rate_sp/(gen_sp<20 ? 30 : gen_sp+10);
         }
     }      }
   
  /* regenerate grace */      /* Regenerate Grace */
  /* I altered this a little - maximum grace is ony achieved through prayer -b.t.*/   /* I altered this a little - maximum grace is ony achieved through prayer -b.t.*/
  if(--op->last_grace<0) {   if(--op->last_grace<0) {
 #ifndef ALLOW_SKILLS /* allow regen 'naturally' to only 1/2 maxgrace w/ skills code */   #ifndef ALLOW_SKILLS /* allow regen 'naturally' to only 1/2 maxgrace w/ skills code */
Line 1452
 
Line 1479
  if(op->stats.grace<op->stats.maxgrace/2)   if(op->stats.grace<op->stats.maxgrace/2)
 #endif  #endif
  op->stats.grace++;  /* no penalty in food for regaining grace */   op->stats.grace++;  /* no penalty in food for regaining grace */
  op->last_grace=2500/(gen_grace<20? 30:gen_grace+10);        if(max_grace>1) {
    over_grace = (gen_grace<20 ? 30 : gen_grace+10)/rate_grace;
    if (over_grace > 0) {
      op->stats.sp += over_grace
        + (RANDOM()%rate_grace > ((gen_grace<20 ? 30 : gen_grace+10)%rate_grace))? -1 : 0;
      op->last_grace=0;
    } else {
      op->last_grace=rate_grace/(gen_grace<20 ? 30 : gen_grace+10);
    }
         } else {
    op->last_grace=rate_grace/(gen_grace<20 ? 30 : gen_grace+10);
         }
  /* wearing stuff doesn't detract from grace generation. */   /* wearing stuff doesn't detract from grace generation. */
  }   }
   
       /* Regenerate Hit Points */
     if(--op->last_heal<0) {      if(--op->last_heal<0) {
  if(op->stats.hp<op->stats.maxhp)        if(op->stats.hp<op->stats.maxhp) {
  op->stats.hp++,op->stats.food--;   op->stats.hp++;
  op->last_heal=1200/(gen_hp<20 ? 30 : gen_hp+10);   op->stats.food--;
  if(op->contr->digestion<0)   if(op->contr->digestion<0)
  op->stats.food+=op->contr->digestion;   op->stats.food+=op->contr->digestion;
  else if(op->contr->digestion>0&&RANDOM()%(1+op->contr->digestion))   else if(op->contr->digestion>0&&RANDOM()%(1+op->contr->digestion))
  op->stats.food=last_food;   op->stats.food=last_food;
     }      }
         if(max_hp>1) {
    over_hp = (gen_hp<20 ? 30 : gen_hp+10)/rate_hp;
    if (over_hp > 0) {
      op->stats.sp += over_hp
        + (RANDOM()%rate_hp > ((gen_hp<20 ? 30 : gen_hp+10)%rate_hp))? -1 : 0;
      op->last_heal=0;
    } else {
      op->last_heal=rate_hp/(gen_hp<20 ? 30 : gen_hp+10);
    }
         } else {
    op->last_heal=rate_hp/(gen_hp<20 ? 30 : gen_hp+10);
         }
       }
   
       /* Digestion */
     if(--op->last_eat<0) {      if(--op->last_eat<0) {
  int bonus=op->contr->digestion>0?op->contr->digestion:0,   int bonus=op->contr->digestion>0?op->contr->digestion:0,
  penalty=op->contr->digestion<0?-op->contr->digestion:0;   penalty=op->contr->digestion<0?-op->contr->digestion:0;
Line 1473
 
Line 1527
  op->stats.food--;   op->stats.food--;
     }      }
  }   }
   
   if(op->contr->state==ST_PLAYING&&op->stats.food<0&&op->stats.hp>=0) {    if(op->contr->state==ST_PLAYING&&op->stats.food<0&&op->stats.hp>=0) {
    object *tmp;     object *tmp;
    for(tmp=op->inv;tmp!=NULL;tmp=tmp->below)     for(tmp=op->inv;tmp!=NULL;tmp=tmp->below)


Legend:
line(s) removed in v.1.5 
line(s) changed
 line(s) added in v.1.6

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