special damage bonus */
| 1088 | |
| 1089 | /* special damage bonus */ |
| 1090 | int |
| 1091 | spec_dbon(struct obj *otmp, struct monst *mon, int tmp) |
| 1092 | { |
| 1093 | const struct artifact *weap = get_artifact(otmp); |
| 1094 | |
| 1095 | if ((weap == &artilist[ART_NONARTIFACT]) |
| 1096 | || (weap->attk.adtyp == AD_PHYS /* check for `NO_ATTK' */ |
| 1097 | && weap->attk.damn == 0 && weap->attk.damd == 0)) |
| 1098 | gs.spec_dbon_applies = FALSE; |
| 1099 | else if (is_art(otmp, ART_GRIMTOOTH)) |
| 1100 | /* Grimtooth has SPFX settings to warn against elves but we want its |
| 1101 | damage bonus to apply to all targets, so bypass spec_applies() */ |
| 1102 | gs.spec_dbon_applies = TRUE; |
| 1103 | else |
| 1104 | gs.spec_dbon_applies = spec_applies(weap, mon); |
| 1105 | |
| 1106 | if (gs.spec_dbon_applies) |
| 1107 | return weap->attk.damd ? rnd((int) weap->attk.damd) : max(tmp, 1); |
| 1108 | return 0; |
| 1109 | } |
| 1110 | |
| 1111 | /* add identified artifact to discoveries list */ |
| 1112 | void |
no test coverage detected