Difference for server/skill_util.c from version 1.16 to 1.17


version 1.16 version 1.17
Line 1
 
Line 1
 /*  /*
  * static char *rcsid_skill_util_c =   * static char *rcsid_skill_util_c =
  *   "$Id: skill_util.c,v 1.16 2001/04/19 04:37:36 mwedel Exp $";   *   "$Id: skill_util.c,v 1.17 2001/05/29 04:41:54 mwedel Exp $";
  */   */
 /*  /*
     CrossFire, A Multiplayer game for X-windows      CrossFire, A Multiplayer game for X-windows
Line 66
 
Line 66
 };  };
   
   
   typedef struct _skill_name_table {
    char *name;
    int id;
   }_skill_name_table;
   
   static _skill_name_table skill_name_table[] = {
    {"agility", CS_STAT_SKILLEXP_AGILITY},
    {"personality", CS_STAT_SKILLEXP_PERSONAL},
    {"mental", CS_STAT_SKILLEXP_MENTAL},
    {"physique", CS_STAT_SKILLEXP_PHYSIQUE},
    {"magic", CS_STAT_SKILLEXP_MAGIC},
    {"wisdom", CS_STAT_SKILLEXP_WISDOM},
    {"",-1}
   };
   
   /* find and assign the skill exp stuff */
   
   void find_skill_exp_name(object *pl, object *exp, int index)
   {
   
    register int s;
   
    for(s=0;skill_name_table[s].id != -1;s++)
    {
    if(!strcmp(skill_name_table[s].name, exp->name) )
           {
    pl->contr->last_skill_ob[index] = exp;
    pl->contr->last_skill_id[index] = skill_name_table[s].id;
    pl->contr->last_skill_index++;
    return;
           }
   
    }
   }
   
   
 /* do_skill() - Main skills use function-similar in scope to cast_spell().   /* do_skill() - Main skills use function-similar in scope to cast_spell().
  * We handle all requests for skill use outside of some combat here.    * We handle all requests for skill use outside of some combat here.
  * We require a separate routine outside of fire() so as to allow monsters    * We require a separate routine outside of fire() so as to allow monsters
Line 707
 
Line 743
         LOG(llevError, "init_player_exp(): called non-player %s.\n",pl->name);          LOG(llevError, "init_player_exp(): called non-player %s.\n",pl->name);
  return 0;   return 0;
    }     }
   
      pl->contr->last_skill_index = 0;
   
    /* first-pass find all current exp objects */     /* first-pass find all current exp objects */
    for(tmp=pl->inv;tmp;tmp=tmp->below)     for(tmp=pl->inv;tmp;tmp=tmp->below)
       if(tmp->type==EXPERIENCE) {        if(tmp->type==EXPERIENCE) {
            exp_ob[exp_index] = tmp;             exp_ob[exp_index] = tmp;
        find_skill_exp_name(pl, tmp, pl->contr->last_skill_index);
            exp_index++;             exp_index++;
       } else if (exp_index == MAX_EXP_CAT)        } else if (exp_index == MAX_EXP_CAT)
        return 0;          return 0;
Line 853
 
Line 893
    /* We're going to unapply all skills */     /* We're going to unapply all skills */
    pl->chosen_skill = NULL;     pl->chosen_skill = NULL;
    CLEAR_FLAG (pl, FLAG_READY_SKILL);     CLEAR_FLAG (pl, FLAG_READY_SKILL);
      pl->contr->last_skill_index = 0;
   
    /* first find all exp and skill objects */     /* first find all exp and skill objects */
    for(tmp=pl->inv;tmp&&sk_index<100;tmp=tmp->below)     for(tmp=pl->inv;tmp&&sk_index<100;tmp=tmp->below)
       if(tmp->type==EXPERIENCE) {        if(tmp->type==EXPERIENCE) {
            exp_ob[exp_index] = tmp;             exp_ob[exp_index] = tmp;
       find_skill_exp_name(pl, tmp, pl->contr->last_skill_index);
            tmp->nrof=1; /* to handle multiple instances */             tmp->nrof=1; /* to handle multiple instances */
            exp_index++;             exp_index++;
       } else if (tmp->type==SKILL) {        } else if (tmp->type==SKILL) {
Line 1531
 
Line 1573
   object *head = op->head ? op->head : op;    object *head = op->head ? op->head : op;
   int level;    int level;
   
 #ifdef ALLOW_SKILLS  
   if(head->type==PLAYER && head->chosen_skill && head->chosen_skill->level!=0) {    if(head->type==PLAYER && head->chosen_skill && head->chosen_skill->level!=0) {
  level = head->chosen_skill->level;   level = head->chosen_skill->level;
   } else {    } else {
  level = head->level;   level = head->level;
   }    }
 #else  
   level = head->level;  
 #endif  
   
   if(level<=0)    if(level<=0)
   {    {


Legend:
line(s) removed in v.1.16 
line(s) changed
 line(s) added in v.1.17

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