Thread: locked doors?
View Single Post
Old January 31, 2020, 02:41   #6
eastwind
Apprentice
 
Join Date: Dec 2019
Location: Mexico, undisclosed location
Posts: 79
eastwind is on a distinguished road
Ok, so I looked at the caller, do_cmd_open_aux(), set a breakpoint in it, and discovered that trying to move onto the door one time actually rolls 100 times for lock picking. Given that do_cmd_open_aux() enforces a minimum 2% chance of success on each roll, any character with any level of lockpicking skill will succeed against any lock with any power 87% of the time. 1-(.98^100).

When I comment out the minimum 2% enforcement line, I get
"you failed to pick the lock" (100x).

So I could put a specific check in do_cmd_open_aux() for depth == 0 *and* power > 90, and set the power of the doors I make > 90 and then if a wizard creates another door it won't have power > 90 (I assume) and so that new door will be openable.

if ((player->depth == 0) && (j > 90)) {
/* print special you-fail message */
}

and if I put this before j is changed from power to difficulty, it should work, but will print the special you-fail message 100 times each time they try.

IMHO 100 rolls is too many to give on one player try.
eastwind is offline   Reply With Quote