version 1.5 | | version 1.6 |
---|
| | |
/* | | /* |
* static char *rcsid_skills_c = | | * static char *rcsid_skills_c = |
* "$Id: skills.c,v 1.5 2000/04/27 07:35:01 cvs Exp $"; | | * "$Id: skills.c,v 1.6 2000/05/26 09:50:49 jec Exp $"; |
*/ | | */ |
/* | | /* |
CrossFire, A Multiplayer game for X-windows | | CrossFire, A Multiplayer game for X-windows |
| | |
/* int load=dist/(pl->speed*spaces); */ | | /* int load=dist/(pl->speed*spaces); */ |
| | |
CLEAR_FLAG(pl,FLAG_FLYING); | | CLEAR_FLAG(pl,FLAG_FLYING); |
insert_ob_in_map(pl,pl->map); | | insert_ob_in_map(pl,pl->map,pl); |
if (pl->type==PLAYER) draw(pl); | | if (pl->type==PLAYER) draw(pl); |
| | |
/* pl->speed_left= (int) -FABS((load*8)+1); */ | | /* pl->speed_left= (int) -FABS((load*8)+1); */ |
| | |
if(scroll->stats.sp && (RANDOM()%(scroll->level*2+1))>SK_level(pl)) { | | if(scroll->stats.sp && (RANDOM()%(scroll->level*2+1))>SK_level(pl)) { |
new_draw_info_format(NDI_UNIQUE,0,pl, | | new_draw_info_format(NDI_UNIQUE,0,pl, |
"Oops! You accidently read it while trying to write on it."); | | "Oops! You accidently read it while trying to write on it."); |
apply(pl,scroll,0); | | manual_apply(pl,scroll,0); |
change_skill(pl,SK_INSCRIPTION); | | change_skill(pl,SK_INSCRIPTION); |
return 0; | | return 0; |
} | | } |
| | |
new_draw_info_format(NDI_UNIQUE, 0,op, | | new_draw_info_format(NDI_UNIQUE, 0,op, |
"The %s sticks to your hand!",query_name(tmp)); | | "The %s sticks to your hand!",query_name(tmp)); |
tmp = NULL; | | tmp = NULL; |
} else | | } else { |
CLEAR_FLAG(tmp,FLAG_APPLIED); | | tag_t tag = tmp->count; |
} | | player_apply (op, tmp, AP_UNAPPLY, 0); |
else if (QUERY_FLAG(tmp,FLAG_INV_LOCKED)) { | | if (was_destroyed (tmp, tag)) { |
new_draw_info_format(NDI_UNIQUE, 0, op, | | tmp = NULL; |
"The %s is locked - you can't throw it.", query_name(tmp)); | | } else if (QUERY_FLAG (tmp, FLAG_APPLIED)) { |
| | LOG (llevError, "BUG: find_throw_ob(): couldn't unapply\n"); |
tmp=NULL; | | tmp=NULL; |
} | | } |
} | | } |
| | } |
| | } |
| | |
| | if (tmp && QUERY_FLAG (tmp, FLAG_INV_LOCKED)) { |
| | LOG (llevError, "BUG: find_throw_ob(): object is locked\n"); |
| | tmp=NULL; |
| | } |
| | |
return tmp; | | return tmp; |
} | | } |
| | |
| | |
| | |
if(orig) { | | if(orig) { |
toss_item=get_object(); | | toss_item=get_object(); |
| | if (QUERY_FLAG (orig, FLAG_APPLIED)) { |
| | LOG (llevError, "BUG: make_throw_ob(): ob is applied\n"); |
| | /* insufficient workaround, but better than nothing */ |
CLEAR_FLAG(orig,FLAG_APPLIED); | | CLEAR_FLAG(orig,FLAG_APPLIED); |
| | } |
copy_object(orig,toss_item); | | copy_object(orig,toss_item); |
toss_item->type = THROWN_OBJ; | | toss_item->type = THROWN_OBJ; |
CLEAR_FLAG(toss_item,FLAG_CHANGING); | | CLEAR_FLAG(toss_item,FLAG_CHANGING); |
| | |
/* bounces off 'wall', and drops to feet */ | | /* bounces off 'wall', and drops to feet */ |
remove_ob(throw_ob); | | remove_ob(throw_ob); |
throw_ob->x = op->x; throw_ob->y = op->y; | | throw_ob->x = op->x; throw_ob->y = op->y; |
insert_ob_in_map(throw_ob,op->map); | | insert_ob_in_map(throw_ob,op->map,op); |
if(op->type==PLAYER) { | | if(op->type==PLAYER) { |
if(eff_str<=1) { | | if(eff_str<=1) { |
new_draw_info_format(NDI_UNIQUE, 0,op, | | new_draw_info_format(NDI_UNIQUE, 0,op, |
| | |
throw_ob->last_sp,throw_ob->speed,throw_ob->stats.food); | | throw_ob->last_sp,throw_ob->speed,throw_ob->stats.food); |
LOG(llevDebug,"inserting tossitem (%d) into map\n",throw_ob->count); | | LOG(llevDebug,"inserting tossitem (%d) into map\n",throw_ob->count); |
#endif | | #endif |
insert_ob_in_map(throw_ob,op->map); | | insert_ob_in_map(throw_ob,op->map,op); |
move_arrow(throw_ob); | | move_arrow(throw_ob); |
} | | } |
| | |