Thread: locked doors?
View Single Post
Old January 30, 2020, 07:08   #2
wobbly
Veteran
 
Join Date: May 2012
Location: Adelaide, Australia
Posts: 2,314
wobbly is on a distinguished road
In cmd-cave.c

Code:
/**
 * Determine if a given grid may be "opened"
 */
static bool do_cmd_open_test(struct loc grid)
{
	/* Must have knowledge */
	if (!square_isknown(cave, grid)) {
		msg("You see nothing there.");
		return false;
	}

	/* Must be a closed door */
	if (!square_iscloseddoor(cave, grid)) {
		msgt(MSG_NOTHING_TO_OPEN, "You see nothing there to open.");
		return false;
	}

	return (true);
}
I'd add an extra check for permalocked door, though you'd have to add the relevant bit in cave-square.c & the routine to set a permalocked door.

Another way you can do it would be to make lock values > x unpickable. Anyway you can look through the door opening code in cmd-cave.c & see if there's anything you are comfortable changing.
wobbly is offline   Reply With Quote