Crossfire Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

CF: Patch: "improvement output"



Hi,

the following patch shows players some more information about improved
weapons. It does two things
a) the weapon description "(dam+x)(wc+y)..." gets an additional
   (improved foo/bar) to tell how many improvements the waepon has,
   and how many it can have.
b) the 'skills output adds an "you can handle xxx weapon improvements"
   to the physique category.

------------------------------ Cut ------------------------------

diff -C 5 -r crossfire-0.94.0/common/item.c ../crossfire/common/item.c
*** crossfire-0.94.0/common/item.c	Sun Feb  8 06:26:15 1998
--- ../crossfire/common/item.c	Tue Feb 10 18:35:49 1998
***************
*** 577,586 ****
--- 581,594 ----
          }
          if(op->stats.ac) {
            sprintf(buf,"(ac%+d)",op->stats.ac);
            strcat(retbuf,buf);
          }
+ 	if (op->type==WEAPON && op->level>0) {
+ 	  sprintf(buf,"(improved %d/%d)",op->last_eat,op->level);
+           strcat(retbuf,buf);
+ 	}
          break;
        default:
          break;
        }
      }
diff -C 5 -r crossfire-0.94.0/server/skill_util.c ../crossfire/server/skill_util.c
*** crossfire-0.94.0/server/skill_util.c	Sun Feb  8 06:26:19 1998
--- ../crossfire/server/skill_util.c	Wed Feb 11 12:08:30 1998
***************
*** 1016,1026 ****
  #ifdef LINKED_SKILL_LIST
    }
  #endif
  
  /* print out skills by category */
!   for (i=0;i<=nrofexpcat;i++) { 
      is_first=1;
      if(i==nrofexpcat) i=EXP_NONE; /* skip to misc exp category */
  #ifdef LINKED_SKILL_LIST
      for (obl=op->sk_list;obl;obl=obl->next) {
        tmp = obl->ob;
--- 1016,1028 ----
  #ifdef LINKED_SKILL_LIST
    }
  #endif
  
  /* print out skills by category */
!   for (i=0;i<=nrofexpcat;i++) {
!     char Special[100];
!     Special[0]='\0';
      is_first=1;
      if(i==nrofexpcat) i=EXP_NONE; /* skip to misc exp category */
  #ifdef LINKED_SKILL_LIST
      for (obl=op->sk_list;obl;obl=obl->next) {
        tmp = obl->ob;
***************
*** 1037,1050 ****
              if(tmp->exp_obj) { 
  	      object *tmp_exp = tmp->exp_obj;
  	      int k=(length-15-strlen(tmp_exp->name)); 
  	      char tmpbuf[40];
  	      strcpy(tmpbuf,tmp_exp->name);
! 	      while(k>0) {k--; strcat(tmpbuf,".");} 
                new_draw_info_format(NDI_UNIQUE,0,op,"%slvl:%3d (xp:%d/%d)",
  		tmpbuf,tmp_exp->level,tmp_exp->stats.exp,
  		level_exp(tmp_exp->level+1, op->expmul));
              } else if(i==EXP_NONE) { 
                new_draw_info(NDI_UNIQUE,0,op,"misc.");
  	    } 
  	  }
  
--- 1039,1056 ----
              if(tmp->exp_obj) { 
  	      object *tmp_exp = tmp->exp_obj;
  	      int k=(length-15-strlen(tmp_exp->name)); 
  	      char tmpbuf[40];
  	      strcpy(tmpbuf,tmp_exp->name);
! 	      while(k>0) {k--; strcat(tmpbuf,".");}
                new_draw_info_format(NDI_UNIQUE,0,op,"%slvl:%3d (xp:%d/%d)",
  		tmpbuf,tmp_exp->level,tmp_exp->stats.exp,
  		level_exp(tmp_exp->level+1, op->expmul));
+ 	      if (strcmp(tmp_exp->name,"physique")==0)
+ 		{
+ 		  sprintf(Special,"You can handle %d weapon improvements.",tmp_exp->level/5+5);
+ 		}
              } else if(i==EXP_NONE) { 
                new_draw_info(NDI_UNIQUE,0,op,"misc.");
  	    } 
  	  }
  
***************
*** 1057,1068 ****
                (void) sprintf(buf,"%s%s %s",in,
  		QUERY_FLAG(tmp,FLAG_APPLIED)?"*":"-",
  		skills[tmp->stats.sp].name);
  
            new_draw_info(NDI_UNIQUE,0,op,buf);
!       } 
      }
    }
  }    
  
  /* use_skill() - similar to invoke command, it executes the skill in the 
   * direction that the user is facing. Returns false if we are unable to 
--- 1063,1078 ----
                (void) sprintf(buf,"%s%s %s",in,
  		QUERY_FLAG(tmp,FLAG_APPLIED)?"*":"-",
  		skills[tmp->stats.sp].name);
  
            new_draw_info(NDI_UNIQUE,0,op,buf);
!       }
      }
+     if (Special[0]!='\0')
+       {
+ 	new_draw_info(NDI_UNIQUE,0,op,Special);
+       }
    }
  }    
  
  /* use_skill() - similar to invoke command, it executes the skill in the 
   * direction that the user is facing. Returns false if we are unable to 

-- 
Christian (Icho/Gandhi/Ribald @sunbroy53.informatik.tu-muenchen.de, 13326)
[to unsubscribe etc., send mail to crossfire-request@ifi.uio.no]