version 1.40 | | version 1.41 |
---|
| | |
/* | | /* |
* static char *rcsid_skills_c = | | * static char *rcsid_skills_c = |
* "$Id: skills.c,v 1.40 2003/06/26 11:27:43 gros Exp $"; | | * "$Id: skills.c,v 1.41 2003/09/04 06:25:32 temitchell Exp $"; |
*/ | | */ |
/* | | /* |
CrossFire, A Multiplayer game for X-windows | | CrossFire, A Multiplayer game for X-windows |
| | |
if (number < ((dex + bonus) - difficulty)) { | | if (number < ((dex + bonus) - difficulty)) { |
remove_door(door); | | remove_door(door); |
success = 1; | | success = 1; |
} else if (door->inv && door->inv->type==RUNE) { /* set off any traps? */ | | } else if (door->inv && (door->inv->type==RUNE || door->inv->type==TRAP)) { /* set off any traps? */ |
spring_trap(door->inv,pl); | | spring_trap(door->inv,pl); |
} | | } |
return success; | | return success; |
| | |
int find_traps (object *pl) { | | int find_traps (object *pl) { |
object *tmp,*tmp2; | | object *tmp,*tmp2; |
int i,expsum=0; | | int i,expsum=0; |
/*First we search all around us for runes and traps, which are | | /*First we search all around us for runes and traps*/ |
all type RUNE */ | | |
for(i=0;i<9;i++) { | | for(i=0;i<9;i++) { |
/* Check everything in the square for trapness */ | | /* Check everything in the square for trapness */ |
if(out_of_map(pl->map,pl->x + freearr_x[i],pl->y + freearr_y[i])) continue; | | if(out_of_map(pl->map,pl->x + freearr_x[i],pl->y + freearr_y[i])) continue; |
| | |
of these objects' inventory */ | | of these objects' inventory */ |
| | |
for(tmp2=tmp->inv;tmp2!=NULL;tmp2=tmp2->below) | | for(tmp2=tmp->inv;tmp2!=NULL;tmp2=tmp2->below) |
if(tmp2->type==RUNE) | | if(tmp2->type==RUNE || tmp2->type==TRAP) |
if(trap_see(pl,tmp2)) { | | if(trap_see(pl,tmp2)) { |
trap_show(tmp2,tmp); | | trap_show(tmp2,tmp); |
if(tmp2->stats.Cha>1) { | | if(tmp2->stats.Cha>1) { |
| | |
tmp2->stats.Cha = 1; /* unhide the trap */ | | tmp2->stats.Cha = 1; /* unhide the trap */ |
} | | } |
} | | } |
if(tmp->type==RUNE) | | if(tmp->type==RUNE || tmp->type==TRAP) |
if(trap_see(pl,tmp)) { | | if(trap_see(pl,tmp)) { |
trap_show(tmp,tmp); | | trap_show(tmp,tmp); |
if(tmp->stats.Cha>1) { | | if(tmp->stats.Cha>1) { |
| | |
* of these objects' inventory */ | | * of these objects' inventory */ |
| | |
for(tmp2=tmp->inv;tmp2!=NULL;tmp2=tmp2->below) | | for(tmp2=tmp->inv;tmp2!=NULL;tmp2=tmp2->below) |
if(tmp2->type==RUNE&&tmp2->stats.Cha<=1) { | | if((tmp2->type==RUNE || tmp2->type==TRAP)&&tmp2->stats.Cha<=1) { |
trap_show(tmp2,tmp); | | trap_show(tmp2,tmp); |
if(trap_disarm(op,tmp2,1) && (!tmp2->owner || tmp2->owner->type!=PLAYER)) | | if(trap_disarm(op,tmp2,1) && (!tmp2->owner || tmp2->owner->type!=PLAYER)) |
success += calc_skill_exp(op,tmp2); | | success += calc_skill_exp(op,tmp2); |
} | | } |
| | |
if(tmp->type==RUNE&&tmp->stats.Cha<=1) { | | if((tmp->type==RUNE || tmp->type==TRAP)&&tmp->stats.Cha<=1) { |
trap_show(tmp,tmp); | | trap_show(tmp,tmp); |
if (trap_disarm(op,tmp,1) && (!tmp->owner || tmp->owner->type!=PLAYER)) | | if (trap_disarm(op,tmp,1) && (!tmp->owner || tmp->owner->type!=PLAYER)) |
success += calc_skill_exp(op,tmp); | | success += calc_skill_exp(op,tmp); |
| | |
move_arrow(throw_ob); | | move_arrow(throw_ob); |
return 1; | | return 1; |
} | | } |
| | |