version 1.35 | | version 1.36 |
---|
| | |
/* | | /* |
* static char *rcsid_attack_c = | | * static char *rcsid_attack_c = |
* "$Id: attack.c,v 1.35 2001/04/21 01:16:29 mardahl Exp $"; | | * "$Id: attack.c,v 1.36 2001/05/29 04:41:53 mwedel Exp $"; |
*/ | | */ |
/* | | /* |
CrossFire, A Multiplayer game for X-windows | | CrossFire, A Multiplayer game for X-windows |
| | |
| | |
if (hitter->slaying) { | | if (hitter->slaying) { |
if (((op->race !=NULL && strstr(hitter->slaying,op->race)) || | | if (((op->race !=NULL && strstr(hitter->slaying,op->race)) || |
#ifndef MULTIPLE_GODS | | |
(strstr(hitter->slaying, undead_name) && QUERY_FLAG(op,FLAG_UNDEAD)) || | | |
#endif | | |
(op->arch && op->arch->name!=NULL && strstr(op->arch->name, hitter->slaying)))) { | | (op->arch && op->arch->name!=NULL && strstr(op->arch->name, hitter->slaying)))) { |
does_slay=1; | | does_slay=1; |
dam*=3; | | dam*=3; |
| | |
if(owner!=hitter) { | | if(owner!=hitter) { |
(void) sprintf(buf,"You killed %s with %s.",query_name(op) | | (void) sprintf(buf,"You killed %s with %s.",query_name(op) |
,query_name(hitter)); | | ,query_name(hitter)); |
#ifdef ALLOW_SKILLS | | |
old_hitter = hitter; | | old_hitter = hitter; |
owner->exp_obj=hitter->exp_obj; | | owner->exp_obj=hitter->exp_obj; |
#endif | | |
} else { | | } else { |
(void) sprintf(buf,"You killed %s.",query_name(op)); | | (void) sprintf(buf,"You killed %s.",query_name(op)); |
} | | } |
| | |
if(get_owner(hitter)!=NULL) { | | if(get_owner(hitter)!=NULL) { |
(void) sprintf(buf,"%s killed %s with %s%s.",hitter->owner->name, | | (void) sprintf(buf,"%s killed %s with %s%s.",hitter->owner->name, |
query_name(op),query_name(hitter), battleg? " (duel)":""); | | query_name(op),query_name(hitter), battleg? " (duel)":""); |
#ifdef ALLOW_SKILLS | | |
old_hitter = hitter; | | old_hitter = hitter; |
owner->exp_obj=hitter->exp_obj; | | owner->exp_obj=hitter->exp_obj; |
#endif | | |
hitter=hitter->owner; | | hitter=hitter->owner; |
} | | } |
else | | else |
| | |
exp=(exp*(op->level+1))/MAX(hitter->level+1, 1); | | exp=(exp*(op->level+1))/MAX(hitter->level+1, 1); |
| | |
/* new exp system in here. Try to insure the right skill is modifying gained exp */ | | /* new exp system in here. Try to insure the right skill is modifying gained exp */ |
#ifdef ALLOW_SKILLS | | |
if(hitter->type==PLAYER && !old_hitter) | | if(hitter->type==PLAYER && !old_hitter) |
exp = calc_skill_exp(hitter,op); | | exp = calc_skill_exp(hitter,op); |
/* case for attack spells, summoned monsters killing */ | | /* case for attack spells, summoned monsters killing */ |
| | |
exp = calc_skill_exp(hitter,op); | | exp = calc_skill_exp(hitter,op); |
hitter->chosen_skill = old_skill; | | hitter->chosen_skill = old_skill; |
} | | } |
#endif /* ALLOW_SKILLS */ | | |
| | |
/* Really don't give much experience for killing other players */ | | /* Really don't give much experience for killing other players */ |
if (op->type==PLAYER) { | | if (op->type==PLAYER) { |