handle ring discovery; comparable to learnwand() */
| 1190 | |
| 1191 | /* handle ring discovery; comparable to learnwand() */ |
| 1192 | staticfn void |
| 1193 | learnring(struct obj *ring, boolean observed) |
| 1194 | { |
| 1195 | int ringtype = ring->otyp; |
| 1196 | |
| 1197 | /* if effect was observable then we usually discover the type */ |
| 1198 | if (observed) { |
| 1199 | /* if we already know the ring type which accomplishes this |
| 1200 | effect (assumes there is at most one type for each effect), |
| 1201 | mark this ring as having been seen (no need for makeknown); |
| 1202 | otherwise if we have seen this ring, discover its type */ |
| 1203 | if (objects[ringtype].oc_name_known) |
| 1204 | observe_object(ring); |
| 1205 | else if (ring->dknown) |
| 1206 | makeknown(ringtype); |
| 1207 | #if 0 /* see learnwand() */ |
| 1208 | else |
| 1209 | observe_object(ring); |
| 1210 | #endif |
| 1211 | } |
| 1212 | |
| 1213 | /* make enchantment of charged ring known (might be +0) and update |
| 1214 | perm invent window if we've seen this ring and know its type */ |
| 1215 | if (ring->dknown && objects[ringtype].oc_name_known) { |
| 1216 | if (objects[ringtype].oc_charged) |
| 1217 | ring->known = 1; |
| 1218 | update_inventory(); |
| 1219 | } |
| 1220 | } |
| 1221 | |
| 1222 | staticfn void |
| 1223 | adjust_attrib(struct obj *obj, int which, int val) |
no test coverage detected