copperwater / xNetHack

Experimental features and improvements applied to NetHack 3.7-dev
Other
54 stars 15 forks source link

Object lookup doesn't work for certain phrasings of item #102

Open copperwater opened 1 year ago

copperwater commented 1 year ago

Object lookup works fine for "X of Y" phrasings like "wand of death" or "ring of slow digestion". But it does not work for "Y X" phrasings like "death wand" and "slow digestion ring"; these just get whatever encyclopedia entry happens to match.

zindorsky commented 1 year ago

I think this existing code actually does this: https://github.com/copperwater/xNetHack/blob/master/src/objnam.c#L4477 At least, wishing for "death wand", "slow digestion ring", "esp amulet" etc all seem to work.

copperwater commented 1 year ago

This is regarding object lookup, not wishing. Object lookup uses a different parser.

To reproduce, type /ndeath wand - the intended behavior is you see

Object lookup for "death wand": 
Ray wand. 
Base cost 500, weighs 7 aum.
Is inherently magical.

Encyclopedia entry for "death wand" (matched to "wand *"):
[...]

But what you actually get when you try this is just the encyclopedia entry. (Whereas entering /nwand of death does produce the object lookup information.)