with decreasing skill (effective skill = skill/(2*dist-1).) Walking around will also search, with probability (skill in 30) (but only adjacent squares.)
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@695 c06c8d41-db1a-0410-9941-cceddc491573
W7KGGF2VUXLD6YH55EPIRQ5SF5VKVKT33P6RNKCFCVQ4QXOLQE7AC for (srx = you.x_pos - 1; srx < you.x_pos + 2; srx++)
// Traps and doors stepdown skill:// skill/(2x-1) for squares at distance xint max_dist = (you.skills[SK_TRAPS_DOORS] + 1) / 2;if ( max_dist > 5 )max_dist = 5;if ( max_dist > 1 && only_adjacent )max_dist = 1;for ( int srx = you.x_pos - max_dist; srx <= you.x_pos + max_dist; ++srx )
// don't exclude own square; may be levitatingif (grd[srx][sry] == DNGN_SECRET_DOOR&& random2(17) <= 1 + you.skills[SK_TRAPS_DOORS]){grd[srx][sry] = DNGN_CLOSED_DOOR;mpr("You found a secret door!");exercise(SK_TRAPS_DOORS, ((coinflip())? 2 : 1));}if (grd[srx][sry] == DNGN_UNDISCOVERED_TRAP&& random2(17) <= 1 + you.skills[SK_TRAPS_DOORS])
if ( see_grid(srx,sry) ) // must have LOS
if (i != -1)grd[srx][sry] = trap_category(env.trap[i].type);
// don't exclude own square; may be levitatingif (dist == 0)++dist;// making this harsher by removing the old +1int effective = you.skills[SK_TRAPS_DOORS] / (2*dist - 1);if (grd[srx][sry] == DNGN_SECRET_DOOR &&random2(17) <= effective){grd[srx][sry] = DNGN_CLOSED_DOOR;mpr("You found a secret door!");exercise(SK_TRAPS_DOORS, ((coinflip()) ? 2 : 1));}
//if (random2(10) < you.skills [SK_TRAPS_DOORS] + 2) search_around();
if ( !you.paralysis && !you.mutation[MUT_BLURRY_VISION] &&(you.mutation[MUT_ACUTE_VISION] >= 2 ||random2(30) < you.skills[SK_TRAPS_DOORS]) )search_around(true); // only check adjacent squares
// Returning the random trap scans as a way to get more use from the// skill and acute mutations.if (you.mutation[MUT_ACUTE_VISION] >= 2|| (!you.mutation[MUT_BLURRY_VISION]&& random2(100) <stat_mult(you.intel, skill_bump(SK_TRAPS_DOORS)))){search_around();}