Hero remembers trapped boxes

After finding a trap on a chest or a large box, remember it
as trapped: "You see here a trapped large box."
Randomly generated chests and boxes can be obviously trapped.
Allow defining obviously trapped containers via lua.

Invalidates saves and bones.
This commit is contained in:
Pasi Kallinen
2024-12-19 12:37:13 +02:00
parent 27a03ef75b
commit 87694e1a95
12 changed files with 75 additions and 36 deletions

View File

@@ -852,6 +852,7 @@ unknow_object(struct obj *obj)
obj->bknown = obj->rknown = 0;
obj->cknown = obj->lknown = 0;
obj->tknown = 0;
/* for an existing object, awareness of charges or enchantment has
gone poof... [object types which don't use the known flag have
it set True for some reason] */
@@ -1000,6 +1001,7 @@ mksobj_init(struct obj *otmp, boolean artif)
case LARGE_BOX:
otmp->olocked = !!(rn2(5));
otmp->otrapped = !(rn2(10));
otmp->tknown = otmp->otrapped && !rn2(100); /* obvious trap */
FALLTHROUGH;
/*FALLTHRU*/
case ICE_BOX: