artifact name formatting

Many (most?) non-weapon artifacts show up in inventory and messages
as "the <foo> of <bar>" even when their underlying object type hasn't been
discovered yet.  For types which don't use the `known' bit, obj->known is
forced to 1; obj_is_pname() checked that but not the oc_name_known flag
for the type.  So you'd see things like "the Heart of Ahriman" instead of
"a luckstone named <the H of A>" or "a gray stone named <the H of A>" even
though it hadn't been identified yet, unintentionally hiding the artifact's
object type from the player.
This commit is contained in:
nethack.rankin
2007-03-17 01:50:45 +00:00
parent e2f1ec76ac
commit e16a078655
2 changed files with 8 additions and 7 deletions
+2 -1
View File
@@ -340,7 +340,7 @@ towel equipped in weapon, alternate weapon, or quiver slot can be applied
lit candle or potion of oil which burned out while equipped would leave stale lit candle or potion of oil which burned out while equipped would leave stale
weapon/alternate-weapon/quiver pointer that could cause panic or crash weapon/alternate-weapon/quiver pointer that could cause panic or crash
wielded/worn figurine which auto-transformed had same stale pointer bug wielded/worn figurine which auto-transformed had same stale pointer bug
familiars are now created without any starting inventory format names of not yet id'd artifacts such that obj type shows for non-weapons
Platform- and/or Interface-Specific Fixes Platform- and/or Interface-Specific Fixes
@@ -379,6 +379,7 @@ support ^R (and ^L in numpad mode) to request display repaint during direction
intelligent pets will use keys to unlock doors intelligent pets will use keys to unlock doors
destroyed drawbridge leaves some iron chains destroyed drawbridge leaves some iron chains
give feedback when a nearby monster grows into a stronger form give feedback when a nearby monster grows into a stronger form
familiars are now created without any starting inventory
Platform- and/or Interface-Specific New Features Platform- and/or Interface-Specific New Features
+6 -6
View File
@@ -180,11 +180,11 @@ boolean
obj_is_pname(obj) obj_is_pname(obj)
register struct obj *obj; register struct obj *obj;
{ {
return((boolean)( if (!obj->oartifact || !has_oname(obj)) return FALSE;
((obj->dknown && obj->known) || iflags.override_ID) && has_oname(obj) && if (!program_state.gameover && !iflags.override_ID) {
/* Since there aren't any objects which are both if (not_fully_identified(obj)) return FALSE;
artifacts and unique, the last check is redundant. */ }
obj->oartifact && !objects[obj->otyp].oc_unique)); return TRUE;
} }
@@ -905,7 +905,7 @@ register struct obj *otmp;
#else #else
!otmp->bknown || !otmp->bknown ||
#endif #endif
!objects[otmp->otyp].oc_name_known) /* ?redundant? */ !objects[otmp->otyp].oc_name_known)
return TRUE; return TRUE;
if ((!otmp->cknown && (Is_container(otmp) || otmp->otyp == STATUE)) || if ((!otmp->cknown && (Is_container(otmp) || otmp->otyp == STATUE)) ||
(!otmp->lknown && Is_box(otmp))) (!otmp->lknown && Is_box(otmp)))