check whether hero is wearing something that player definitely knows confers the target property; item must have been seen and its type discovered but it doesn't necessarily have to be fully identified */
| 264 | confers the target property; item must have been seen and its type |
| 265 | discovered but it doesn't necessarily have to be fully identified */ |
| 266 | staticfn boolean |
| 267 | cause_known( |
| 268 | int propindx) /* index of a property which can be conveyed by worn item */ |
| 269 | { |
| 270 | struct obj *o; |
| 271 | long mask = W_ARMOR | W_AMUL | W_RING | W_TOOL; |
| 272 | |
| 273 | /* simpler than from_what()/what_gives(); we don't attempt to |
| 274 | handle artifacts and we deliberately ignore wielded items */ |
| 275 | for (o = gi.invent; o; o = o->nobj) { |
| 276 | if (!(o->owornmask & mask)) |
| 277 | continue; |
| 278 | if ((int) objects[o->otyp].oc_oprop == propindx |
| 279 | && objects[o->otyp].oc_name_known && o->dknown) |
| 280 | return TRUE; |
| 281 | } |
| 282 | return FALSE; |
| 283 | } |
| 284 | |
| 285 | /* format a characteristic value, accommodating Strength's strangeness */ |
| 286 | staticfn char * |
no outgoing calls
no test coverage detected