|
From: <cro...@li...> - 2003-03-20 07:57:58
|
Module Name: crossfire
Committed By: mwedel
Date: Thu Mar 20 07:57:57 UTC 2003
Modified Files:
crossfire: ChangeLog
crossfire/include: sproto.h
crossfire/server: apply.c
Log Message:
server/apply.c: Change weapon improving code to only use up the number of
potions that it needs, and not all on the ground. Required adding
another arg to eat_item() which is the number of items to consume.
include/sproto.h: Rebuilt for new eat_item() (actually, a static, so no
longer shows up in this file)
MSW 2003-03-19
Start of context diffs
Index: crossfire/ChangeLog
diff -c crossfire/ChangeLog:1.56 crossfire/ChangeLog:1.57
*** crossfire/ChangeLog:1.56 Wed Mar 19 23:21:04 2003
--- crossfire/ChangeLog Wed Mar 19 23:57:57 2003
***************
*** 17,22 ****
--- 17,27 ----
------------------------------------------------------------------------------
Changes for CVS:
+ server/apply.c: Change weapon improving code to only use up the number of
+ potions that it needs, and not all on the ground. Required adding
+ another arg to eat_item() which is the number of items to consume.
+ include/sproto.h: Rebuilt for new eat_item() (actually, a static, so no
+ longer shows up in this file)
server/attack.c: Change did_make_save to strip out magic attacktype when making
saves for objects - otherwise, things like poison cloud destroy objects.
server/time.c: deal with player animations special in process_object - need to
Index: crossfire/include/sproto.h
diff -c crossfire/include/sproto.h:1.85 crossfire/include/sproto.h:1.86
*** crossfire/include/sproto.h:1.85 Fri Feb 14 00:18:41 2003
--- crossfire/include/sproto.h Wed Mar 19 23:57:57 2003
***************
*** 13,19 ****
/* apply.c */
int apply_potion(object *op, object *tmp);
int check_item(object *op, char *item);
- void eat_item(object *op, char *item);
int check_weapon_power(object *who, int improvs);
int improve_weapon_stat(object *op, object *improver, object *weapon, signed char *stat, int sacrifice_count, char *statname);
int prepare_weapon(object *op, object *improver, object *weapon);
--- 13,18 ----
Index: crossfire/server/apply.c
diff -c crossfire/server/apply.c:1.80 crossfire/server/apply.c:1.81
*** crossfire/server/apply.c:1.80 Fri Mar 7 21:35:32 2003
--- crossfire/server/apply.c Wed Mar 19 23:57:56 2003
***************
*** 1,6 ****
/*
* static char *rcsid_apply_c =
! * "$Id: apply.c,v 1.80 2003/03/08 05:35:32 mwedel Exp $";
*/
/*
CrossFire, A Multiplayer game for X-windows
--- 1,6 ----
/*
* static char *rcsid_apply_c =
! * "$Id: apply.c,v 1.81 2003/03/20 07:57:56 mwedel Exp $";
*/
/*
CrossFire, A Multiplayer game for X-windows
***************
*** 294,314 ****
return count;
}
! void eat_item(object *op,char *item)
{
! object *prev;
!
! prev = op;
! op=op->below;
- while(op!=NULL) {
- if (strcmp(op->arch->name,item)==0) {
- decrease_ob_nr(op,op->nrof);
- op=prev;
- }
prev = op;
op=op->below;
! }
}
/* This checks to see of the player (who) is sufficient level to use a weapon
--- 294,325 ----
return count;
}
! /* This object removes 'nrof' of what item->slaying says to
! * remove. op is typically the player, which is only
! * really used to determine what space to look at.
! * Modified to only eat 'nrof' of objects.
! */
! static void eat_item(object *op,char *item, int nrof)
{
! object *prev;
prev = op;
op=op->below;
!
! while(op!=NULL) {
! if (strcmp(op->arch->name,item)==0) {
! if (op->nrof >= nrof) {
! decrease_ob_nr(op,nrof);
! return;
! } else {
! decrease_ob_nr(op,op->nrof);
! nrof -= op->nrof;
! }
! op=prev;
! }
! prev = op;
! op=op->below;
! }
}
/* This checks to see of the player (who) is sufficient level to use a weapon
***************
*** 422,434 ****
sacrifice_count=check_sacrifice(op,improver);
if (sacrifice_count<=0)
return 0;
! sacrifice_count = isqrt(sacrifice_count);
! weapon->level=sacrifice_count;
new_draw_info(NDI_UNIQUE,0,op,"Your sacrifice was accepted.");
! eat_item(op, improver->slaying);
new_draw_info_format(NDI_UNIQUE, 0, op,"Your *%s may be improved %d times.",
! weapon->name,sacrifice_count);
sprintf(buf,"%s's %s",op->name,weapon->name);
free_string(weapon->name);
--- 433,444 ----
sacrifice_count=check_sacrifice(op,improver);
if (sacrifice_count<=0)
return 0;
! weapon->level=isqrt(sacrifice_count);
new_draw_info(NDI_UNIQUE,0,op,"Your sacrifice was accepted.");
! eat_item(op, improver->slaying, sacrifice_count);
new_draw_info_format(NDI_UNIQUE, 0, op,"Your *%s may be improved %d times.",
! weapon->name,weapon->level);
sprintf(buf,"%s's %s",op->name,weapon->name);
free_string(weapon->name);
***************
*** 521,527 ****
"You need at least %d %s", sacrifice_needed, improver->slaying);
return 0;
}
! eat_item(op,improver->slaying);
weapon->item_power++;
switch (improver->stats.sp) {
--- 531,537 ----
"You need at least %d %s", sacrifice_needed, improver->slaying);
return 0;
}
! eat_item(op,improver->slaying, sacrifice_needed);
weapon->item_power++;
switch (improver->stats.sp) {
|