light emitting artifact's range depends upon its curse/bless state */
| 878 | |
| 879 | /* light emitting artifact's range depends upon its curse/bless state */ |
| 880 | int |
| 881 | arti_light_radius(struct obj *obj) |
| 882 | { |
| 883 | int res; |
| 884 | |
| 885 | /* |
| 886 | * Used by begin_burn() when setting up a new light source |
| 887 | * (obj->lamplit will already be set by this point) and |
| 888 | * also by bless()/unbless()/uncurse()/curse() to decide |
| 889 | * whether to call obj_adjust_light_radius(). |
| 890 | */ |
| 891 | |
| 892 | /* sanity check [simplifies usage by bless()/curse()/&c] */ |
| 893 | if (!obj->lamplit || !artifact_light(obj)) |
| 894 | return 0; |
| 895 | |
| 896 | /* cursed radius of 1 is not noticeable for an item that's |
| 897 | carried by the hero but is if it's carried by a monster |
| 898 | or left lit on the floor (not applicable for Sunsword) */ |
| 899 | res = (obj->blessed ? 3 : !obj->cursed ? 2 : 1); |
| 900 | |
| 901 | /* if poly'd into gold dragon with embedded scales, make the scales |
| 902 | have minimum radiance (hero as light source will use light radius |
| 903 | based on monster form); otherwise, worn gold DSM gives off more |
| 904 | light than other light sources */ |
| 905 | if (obj == uskin) |
| 906 | res = 1; |
| 907 | else if (obj->otyp == GOLD_DRAGON_SCALE_MAIL) /* DSM but not scales */ |
| 908 | ++res; |
| 909 | |
| 910 | return res; |
| 911 | } |
| 912 | |
| 913 | /* adverb describing lit artifact's light; radius varies depending upon |
| 914 | curse/bless state; also used for gold dragon scales/scale mail */ |
no test coverage detected