version 1.62 | | version 1.63 |
---|
| | |
/* | | /* |
* static char *rcsid_player_c = | | * static char *rcsid_player_c = |
* "$Id: player.c,v 1.62 2001/06/29 05:59:46 mwedel Exp $"; | | * "$Id: player.c,v 1.63 2001/07/14 04:11:18 mwedel Exp $"; |
*/ | | */ |
| | |
/* | | /* |
| | |
op->x = x; | | op->x = x; |
op->y = y; | | op->y = y; |
SET_ANIMATION(op, 2); /* So player faces south */ | | SET_ANIMATION(op, 2); /* So player faces south */ |
insert_ob_in_map (op, op->map, op); | | insert_ob_in_map (op, op->map, op,0); |
strncpy(op->contr->title,op->arch->clone.name,MAX_NAME); | | strncpy(op->contr->title,op->arch->clone.name,MAX_NAME); |
add_statbonus(op); | | add_statbonus(op); |
tmp_loop=allowed_class(op); | | tmp_loop=allowed_class(op); |
} | | } |
update_object(op); | | update_object(op,UP_OBJ_FACE); |
esrv_update_item(UPD_FACE,op,op); | | esrv_update_item(UPD_FACE,op,op); |
fix_player(op); | | fix_player(op); |
op->stats.hp=op->stats.maxhp; | | op->stats.hp=op->stats.maxhp; |
| | |
SET_FLAG(arrow, FLAG_FLY_ON); | | SET_FLAG(arrow, FLAG_FLY_ON); |
SET_FLAG(arrow, FLAG_WALK_ON); | | SET_FLAG(arrow, FLAG_WALK_ON); |
play_sound_map(op->map, op->x, op->y, SOUND_FIRE_ARROW); | | play_sound_map(op->map, op->x, op->y, SOUND_FIRE_ARROW); |
insert_ob_in_map(arrow,op->map,op); | | insert_ob_in_map(arrow,op->map,op,0); |
move_arrow(arrow); | | move_arrow(arrow); |
if (was_destroyed (left, left_tag)) | | if (was_destroyed (left, left_tag)) |
esrv_del_item(op->contr, left_tag); | | esrv_del_item(op->contr, left_tag); |
| | |
if(face != -1) | | if(face != -1) |
SET_ANIMATION(op,face); | | SET_ANIMATION(op,face); |
| | |
update_object(op); | | update_object(op, UP_OBJ_FACE); |
| | |
return 0; | | return 0; |
} | | } |
| | |
remove_ob(op); | | remove_ob(op); |
op->x = env->x; | | op->x = env->x; |
op->y = env->y; | | op->y = env->y; |
insert_ob_in_map(op, env->map, NULL); | | insert_ob_in_map(op, env->map, NULL,0); |
} | | } |
else if (op->inv) remove_unpaid_objects(op->inv, env); | | else if (op->inv) remove_unpaid_objects(op->inv, env); |
op=next; | | op=next; |
| | |
tmp->msg=add_string(buf); | | tmp->msg=add_string(buf); |
tmp->value=0, tmp->material=0, tmp->type=0; | | tmp->value=0, tmp->material=0, tmp->type=0; |
tmp->x = op->x, tmp->y = op->y; | | tmp->x = op->x, tmp->y = op->y; |
insert_ob_in_map(tmp,op->map,op); | | insert_ob_in_map(tmp,op->map,op,0); |
} | | } |
| | |
/* teleport defeated player to new destination*/ | | /* teleport defeated player to new destination*/ |
| | |
op->contr->killer); | | op->contr->killer); |
tmp->msg = add_string(buf); | | tmp->msg = add_string(buf); |
tmp->x=op->x,tmp->y=op->y; | | tmp->x=op->x,tmp->y=op->y; |
insert_ob_in_map (tmp, op->map, NULL); | | insert_ob_in_map (tmp, op->map, NULL,0); |
| | |
/**************************************/ | | /**************************************/ |
/* */ | | /* */ |
| | |
free_string (tmp->msg); | | free_string (tmp->msg); |
tmp->msg = add_string(buf); | | tmp->msg = add_string(buf); |
tmp->x=x,tmp->y=y; | | tmp->x=x,tmp->y=y; |
insert_ob_in_map (tmp, map, NULL); | | insert_ob_in_map (tmp, map, NULL,0); |
#else | | #else |
/* peterm: added to create a corpse at deathsite. */ | | /* peterm: added to create a corpse at deathsite. */ |
tmp=arch_to_object(find_archetype("corpse_pl")); | | tmp=arch_to_object(find_archetype("corpse_pl")); |
| | |
free_string(tmp->msg); | | free_string(tmp->msg); |
tmp->msg = add_string (gravestone_text(op)); | | tmp->msg = add_string (gravestone_text(op)); |
SET_FLAG (tmp, FLAG_UNIQUE); | | SET_FLAG (tmp, FLAG_UNIQUE); |
insert_ob_in_map (tmp, map, NULL); | | insert_ob_in_map (tmp, map, NULL,0); |
#endif | | #endif |
} | | } |
| | |
| | |
if(tmp->nrof>1) { | | if(tmp->nrof>1) { |
tmp2=get_split_ob(tmp,1+RANDOM()%(tmp->nrof-1)); | | tmp2=get_split_ob(tmp,1+RANDOM()%(tmp->nrof-1)); |
free_object(tmp2); | | free_object(tmp2); |
insert_ob_in_map(tmp,op->map,NULL); | | insert_ob_in_map(tmp,op->map,NULL,0); |
} else | | } else |
free_object(tmp); | | free_object(tmp); |
} else | | } else |
insert_ob_in_map(tmp,op->map,NULL); | | insert_ob_in_map(tmp,op->map,NULL,0); |
} | | } |
} | | } |
| | |
| | |
op->contr->tmp_invis = 0; | | op->contr->tmp_invis = 0; |
if(QUERY_FLAG(op, FLAG_UNDEAD)&&!is_true_undead(op)) | | if(QUERY_FLAG(op, FLAG_UNDEAD)&&!is_true_undead(op)) |
CLEAR_FLAG(op, FLAG_UNDEAD); | | CLEAR_FLAG(op, FLAG_UNDEAD); |
update_object(op); | | update_object(op,UP_OBJ_FACE); |
} | | } |
| | |
int is_true_undead(object *op) { | | int is_true_undead(object *op) { |