version 1.9 | | version 1.10 |
---|
| | |
/* | | /* |
* static char *rcsid_spell_attack_c = | | * static char *rcsid_spell_attack_c = |
* "$Id: spell_attack.c,v 1.9 2004/02/29 01:53:47 temitchell Exp $"; | | * "$Id: spell_attack.c,v 1.10 2004/04/04 16:37:02 temitchell Exp $"; |
*/ | | */ |
| | |
| | |
| | |
void check_spell_knockback(object *op) { | | void check_spell_knockback(object *op) { |
object *tmp, *tmp2; /* object on the map */ | | object *tmp, *tmp2; /* object on the map */ |
int weight_move; | | int weight_move; |
| | int frictionmod=2; /*poor man's physics - multipy targets weight by this amount */ |
| | |
if(! op->weight) { /*shouldn't happen but if cone object has no weight drop out*/ | | if(! op->weight) { /*shouldn't happen but if cone object has no weight drop out*/ |
/*LOG (llevDebug, "DEBUG: arch weighs nothing");*/ | | /*LOG (llevDebug, "DEBUG: arch weighs nothing");*/ |
| | |
{ | | { |
int num_sections = 1; | | int num_sections = 1; |
| | |
| | /* don't move DM */ |
| | if(QUERY_FLAG(tmp, FLAG_WIZ)) |
| | return; |
| | |
/* don't move parts of objects */ | | /* don't move parts of objects */ |
if(tmp->head) continue; | | if(tmp->head) continue; |
| | |
| | |
| | |
/* surface area? -tm */ | | /* surface area? -tm */ |
| | |
if(rndm(0, weight_move-1) > tmp->weight/num_sections) { /* move it. */ | | if(QUERY_FLAG(tmp, FLAG_FLYING)) |
| | frictionmod = 1 ; /* flying objects loose the friction modifier */ |
| | |
| | if(rndm(0, weight_move-1) > ((tmp->weight / num_sections) * frictionmod)) { /* move it. */ |
/* move_object is really for monsters, but looking at | | /* move_object is really for monsters, but looking at |
* the move_object function, it appears that it should | | * the move_object function, it appears that it should |
* also be safe for objects. | | * also be safe for objects. |