version 1.124 | | version 1.125 |
---|
| | |
/* | | /* |
* static char *rcsid_attack_c = | | * static char *rcsid_attack_c = |
* "$Id: attack.c,v 1.124 2006/05/03 00:51:52 qal21 Exp $"; | | * "$Id: attack.c,v 1.125 2006/05/05 09:26:34 ryo_saeba Exp $"; |
*/ | | */ |
/* | | /* |
CrossFire, A Multiplayer game for X-windows | | CrossFire, A Multiplayer game for X-windows |
| | |
| | |
/*#define ATTACK_DEBUG*/ | | /*#define ATTACK_DEBUG*/ |
| | |
| | static void slow_player(object *op, object *hitter, int dam); |
| | static void deathstrike_player(object *op, object *hitter, int *dam); |
| | static int adj_attackroll(object *hitter, object *target); |
| | static int is_aimed_missile(object *op); |
| | static int did_make_save_item(object *op, int type, object *originator); |
| | static void poison_player(object *op, object *hitter, int dam); |
| | |
/** | | /** |
* Cancels object *op. Cancellation basically means an object loses | | * Cancels object *op. Cancellation basically means an object loses |
* its magical benefits. | | * its magical benefits. |
*/ | | */ |
void cancellation(object *op) | | static void cancellation(object *op) |
{ | | { |
object *tmp; | | object *tmp; |
| | |
| | |
* any further action (like destroying the item). | | * any further action (like destroying the item). |
*/ | | */ |
| | |
int did_make_save_item(object *op, int type, object *originator) { | | static int did_make_save_item(object *op, int type, object *originator) { |
int i, roll, saves=0, attacks=0, number; | | int i, roll, saves=0, attacks=0, number; |
materialtype_t *mt; | | materialtype_t *mt; |
| | |
| | |
return 0; | | return 0; |
} | | } |
| | |
void attack_message(int dam, int type, object *op, object *hitter) { | | static void attack_message(int dam, int type, object *op, object *hitter) { |
char buf[MAX_BUF], buf1[MAX_BUF], buf2[MAX_BUF]; | | char buf[MAX_BUF], buf1[MAX_BUF], buf2[MAX_BUF]; |
int i, found=0; | | int i, found=0; |
mapstruct *map; | | mapstruct *map; |
| | |
} | | } |
| | |
| | |
void tear_down_wall(object *op) | | static void tear_down_wall(object *op) |
{ | | { |
int perc=0; | | int perc=0; |
| | |
| | |
} | | } |
} | | } |
| | |
void scare_creature(object *target, object *hitter) | | static void scare_creature(object *target, object *hitter) |
{ | | { |
object *owner = get_owner(hitter); | | object *owner = get_owner(hitter); |
| | |
| | |
* Note - changed for PR code - we now pass the attack number and not | | * Note - changed for PR code - we now pass the attack number and not |
* the attacktype. Makes it easier for the PR code. */ | | * the attacktype. Makes it easier for the PR code. */ |
| | |
int hit_player_attacktype(object *op, object *hitter, int dam, | | static int hit_player_attacktype(object *op, object *hitter, int dam, |
uint32 attacknum, int magic) { | | uint32 attacknum, int magic) { |
| | |
int doesnt_slay = 1; | | int doesnt_slay = 1; |
| | |
* a bit - I think it should be functionally equivalant. | | * a bit - I think it should be functionally equivalant. |
* MSW 2002-07-17 | | * MSW 2002-07-17 |
*/ | | */ |
int kill_object(object *op,int dam, object *hitter, int type) | | static int kill_object(object *op,int dam, object *hitter, int type) |
{ | | { |
char buf[MAX_BUF]; | | char buf[MAX_BUF]; |
const char *skill; | | const char *skill; |
| | |
} | | } |
| | |
| | |
void poison_player(object *op, object *hitter, int dam) | | static void poison_player(object *op, object *hitter, int dam) |
{ | | { |
archetype *at = find_archetype("poisoning"); | | archetype *at = find_archetype("poisoning"); |
object *tmp=present_arch_in_ob(at,op); | | object *tmp=present_arch_in_ob(at,op); |
| | |
tmp->stats.food++; | | tmp->stats.food++; |
} | | } |
| | |
void slow_player(object *op,object *hitter,int dam) | | static void slow_player(object *op,object *hitter,int dam) |
{ archetype *at = find_archetype("slowness"); | | { archetype *at = find_archetype("slowness"); |
object *tmp; | | object *tmp; |
if(at == NULL) { | | if(at == NULL) { |
| | |
* Attempts to kill 'op'. hitter is the attack object, dam is | | * Attempts to kill 'op'. hitter is the attack object, dam is |
* the computed damaged. | | * the computed damaged. |
*/ | | */ |
void deathstrike_player(object *op, object *hitter, int *dam) | | static void deathstrike_player(object *op, object *hitter, int *dam) |
{ | | { |
/* The intention of a death attack is to kill outright things | | /* The intention of a death attack is to kill outright things |
** that are a lot weaker than the attacker, have a chance of killing | | ** that are a lot weaker than the attacker, have a chance of killing |
| | |
| | |
/** adj_attackroll() - adjustments to attacks by various conditions */ | | /** adj_attackroll() - adjustments to attacks by various conditions */ |
| | |
int adj_attackroll (object *hitter, object *target) { | | static int adj_attackroll (object *hitter, object *target) { |
object *attacker = hitter; | | object *attacker = hitter; |
int adjust=0; | | int adjust=0; |
| | |
| | |
| | |
| | |
/** determine if the object is an 'aimed' missile */ | | /** determine if the object is an 'aimed' missile */ |
int is_aimed_missile ( object *op) { | | static int is_aimed_missile ( object *op) { |
| | |
/* I broke what used to be one big if into a few nested | | /* I broke what used to be one big if into a few nested |
* ones so that figuring out the logic is at least possible. | | * ones so that figuring out the logic is at least possible. |