From: snelling@bnr.ca (Peter Snelling)
Subject: Re: Unusual Death...
Reply-To: snelling@bnr.ca (Peter Snelling)
Organization: Bell-Northern Research Ltd.
Date: Tue, 17 Nov 1992 16:21:43 GMT

In article <1992Nov17.104303.8189@cs.nott.ac.uk>, rji@trellis.cs.nott.ac.uk (Rob Ingram) writes:
>In article <BxtFsC.4oH@acsu.buffalo.edu>, bandu@acsu.buffalo.edu (Jagath Samarabandu) writes:
>|> In article <1992Nov16.123906.8677@cs.nott.ac.uk> rji@trellis.cs.nott.ac.uk (Rob Ingram) writes:
>|> >Sounds like you learned a valuable lesson:
>|> > #untrap those chests before you touch them!
>|> 
>|> Well, I've never been able to do this. I mean when I #untrap, it says you don't
>|> see any traps on the box. But open it and *boom* gas, fire or electricity.
>|> 
>|> This happened to me twice, so I'm pretty sure about this. Any reasons why?
>|> 
>
>I guess its something to do with your ability to search, but I don't know
>the exact factors that define this ability. I think DEX has something to
>do with it, anybody know of anything else?
>Also it may work like ordinary searching, you have to do it a few times to
>be sure, but this is just a guess.

Finding traps
-------------
Well, the code says:

          if((otmp->otrapped && !confused
                      && rn2(MAXLEVEL+2-dlevel) < 10)
              || confused && !rn2(3)) {
              You("find a trap on the %s!  Disarm it? ", xname(otmp));

Looks like if you're confused (or hallucinating) you have a 1/3 chance
of finding a trap (even if the chest is not actually trapped).  Yes,
it's true -- if you're confused, and say #untrap, you could get:
     There is a chest (oval keyhole) here, check for traps?
     You find a trap on the chest!  Disarm it?
     That a chest (oval keyhole) was not trapped.

Otherwise, if you're not confused and there is a trap on the chest, you
have a rn2(MAXLEVEL+2-dlevel) < 10 chance of finding it.  MAXLEVEL is
50, so it looks like early on you have an approximately 1/5 chance of
finding a trap.  Only if you are on dlevel 42 or deeper are you 
guaranteed to find any trap.

Disarming traps
---------------
Once you find a trap you have a chance of disarming it depending on
the dungeon level and your character level.  Traps deeper in the 
dungeon are harder to disarm, but higher level characters (especially
Rogues) are better at disarming them.  Also note that you can't disarm
a trap if you're confused (or hallucinating) or fumbling. ie:
              if(otmp->otrapped) {
                  ch = 15 + (pl_character[0] == 'R') ? u.ulevel*3
                                                      : u.ulevel;
                  if(confused || Fumbling || rnd(75+dlevel/2) > ch) {
                      You("set it off!");
                      (void) chest_trap(otmp, FINGER);
                  } else {
                     You("disarm it!");
                     otmp->otrapped = 0;

Character    Dlevel       Chance of         Chance of 
level                     finding trap     Disarming trap
   1            1             20%          21% (24% for R's)
   5            5             22%          26% (39% for R's)
  10           10             24%          31% (56% for R's)
  15           20             32%          35% (70% for R's)
  20           30             45%          39% (83% for R's)          
  30           50            100%          45% (100% for R's)


I'd say it's not really worth checking on early levels.  Just
drop your burnable stuff, and unlock it.  It's never a good
idea to try to disarm a trap (unless you're a >level 10 Rogue).
-- 
Peter Snelling