version 1.8 | | version 1.9 |
---|
| | |
/* | | /* |
* static char *rcsid_attack_c = | | * static char *rcsid_attack_c = |
* "$Id: attack.c,v 1.8 2000/05/21 21:41:45 jec Exp $"; | | * "$Id: attack.c,v 1.9 2000/05/26 09:50:48 jec Exp $"; |
*/ | | */ |
/* | | /* |
CrossFire, A Multiplayer game for X-windows | | CrossFire, A Multiplayer game for X-windows |
| | |
esrv_send_item(env, op); | | esrv_send_item(env, op); |
} else { | | } else { |
op->x=x,op->y=y; | | op->x=x,op->y=y; |
insert_ob_in_map(op,m); | | insert_ob_in_map(op,m,NULL); |
} | | } |
} | | } |
return; | | return; |
| | |
insert_ob_in_ob(op,env); | | insert_ob_in_ob(op,env); |
} else { | | } else { |
op->x=x,op->y=y; | | op->x=x,op->y=y; |
insert_ob_in_map(op,m); | | insert_ob_in_map(op,m,NULL); |
} | | } |
} | | } |
return; | | return; |
| | |
if ((tmp = present_arch(at,op->map,op->x,op->y)) == NULL) { | | if ((tmp = present_arch(at,op->map,op->x,op->y)) == NULL) { |
tmp = arch_to_object(at); | | tmp = arch_to_object(at); |
tmp->x=op->x,tmp->y=op->y; | | tmp->x=op->x,tmp->y=op->y; |
insert_ob_in_map(tmp,op->map); | | insert_ob_in_map(tmp,op->map,NULL); |
} | | } |
remove_ob(op); | | remove_ob(op); |
(void) insert_ob_in_ob(op,tmp); | | (void) insert_ob_in_ob(op,tmp); |
| | |
free_object(tmp); | | free_object(tmp); |
else { | | else { |
tmp->x=op->x+freearr_x[j],tmp->y=op->y+freearr_y[j]; | | tmp->x=op->x+freearr_x[j],tmp->y=op->y+freearr_y[j]; |
insert_ob_in_map(tmp,op->map); | | insert_ob_in_map(tmp,op->map,NULL); |
} | | } |
} | | } |
if(friendly) | | if(friendly) |
| | |
if((tmp=present(PARAIMAGE,op->map,op->x,op->y))==NULL) { | | if((tmp=present(PARAIMAGE,op->map,op->x,op->y))==NULL) { |
tmp=clone_arch(PARAIMAGE); | | tmp=clone_arch(PARAIMAGE); |
tmp->x=op->x,tmp->y=op->y; | | tmp->x=op->x,tmp->y=op->y; |
insert_ob_in_map(tmp,op->map); | | insert_ob_in_map(tmp,op->map,NULL); |
} | | } |
op->speed_left-=(float)FABS(op->speed)*(dam*3); | | op->speed_left-=(float)FABS(op->speed)*(dam*3); |
tmp->stats.food+=(signed short) (dam*3)/op->speed; | | tmp->stats.food+=(signed short) (dam*3)/op->speed; |
| | |
break; | | break; |
case POISON: /* poison drinks */ | | case POISON: /* poison drinks */ |
if(QUERY_FLAG(victim,FLAG_ALIVE)&&!QUERY_FLAG(victim,FLAG_UNDEAD) | | if(QUERY_FLAG(victim,FLAG_ALIVE)&&!QUERY_FLAG(victim,FLAG_UNDEAD) |
&&!(victim->immune&AT_POISON)) apply(victim,tmp,0); | | &&!(victim->immune&AT_POISON)) apply_poison(victim,tmp); |
break; | | break; |
case CONTAINER: | | case CONTAINER: |
/* spill_container(victim,RANDOM()%(hitter->stats.dam+1)); */ | | /* spill_container(victim,RANDOM()%(hitter->stats.dam+1)); */ |