* Adjust hero intrinsics (and perform other side effects) as if this * object was being added to the hero's inventory. Called _after_ the * object has been added to the hero's inventory. * * This can be used either for updating intrinsics, or to allow the hero to * react to objects that are now in inventory. * * This is called when adding objects to the hero's inventory normally (via * ad
| 1022 | * (e.g. do not assume that the object was not in inventory already). |
| 1023 | */ |
| 1024 | void |
| 1025 | addinv_core2(struct obj *obj) |
| 1026 | { |
| 1027 | if (confers_luck(obj)) { |
| 1028 | /* new luckstone must be in inventory by this point |
| 1029 | for correct calculation */ |
| 1030 | set_moreluck(); |
| 1031 | } |
| 1032 | |
| 1033 | /* Archeologists can decipher the writing on a scroll label to work out |
| 1034 | what they are (exception: unlabeled scrolls don't have a label to |
| 1035 | decipher) */ |
| 1036 | if (Role_if(PM_ARCHEOLOGIST) && obj->oclass == SCROLL_CLASS && |
| 1037 | obj->otyp != SCR_BLANK_PAPER && !Blind && |
| 1038 | !objects[obj->otyp].oc_name_known) { |
| 1039 | observe_object(obj); |
| 1040 | pline("You decipher the label on %s.", yname(obj)); |
| 1041 | makeknown(obj->otyp); |
| 1042 | |
| 1043 | /* conduct: this is avoidable via not picking up / wishing for |
| 1044 | scrolls */ |
| 1045 | if (!u.uconduct.literate++) |
| 1046 | livelog_printf(LL_CONDUCT, |
| 1047 | "became literate by deciphering a scroll label"); |
| 1048 | } |
| 1049 | } |
| 1050 | |
| 1051 | /* |
| 1052 | * Add obj to the hero's inventory. Make sure the object is "free". |
no test coverage detected