| 563 | } |
| 564 | |
| 565 | staticfn int |
| 566 | mcast_lightning(struct monst *mtmp, int dmg) |
| 567 | { |
| 568 | int orig_dmg; |
| 569 | boolean reflects; |
| 570 | |
| 571 | Soundeffect(se_bolt_of_lightning, 80); |
| 572 | pline("A bolt of lightning strikes down at you from above!"); |
| 573 | reflects = ureflects("It bounces off your %s%s.", ""); |
| 574 | orig_dmg = dmg = d(8, 6); |
| 575 | if (reflects || Shock_resistance) { |
| 576 | shieldeff(u.ux, u.uy); |
| 577 | dmg = 0; |
| 578 | if (reflects) { |
| 579 | monstseesu(M_SEEN_REFL); |
| 580 | return dmg; |
| 581 | } |
| 582 | monstunseesu(M_SEEN_REFL); |
| 583 | monstseesu(M_SEEN_ELEC); |
| 584 | } else { |
| 585 | monstunseesu(M_SEEN_ELEC | M_SEEN_REFL); |
| 586 | } |
| 587 | if (Half_spell_damage) |
| 588 | dmg = (dmg + 1) / 2; |
| 589 | (void) destroy_items(&gy.youmonst, AD_ELEC, orig_dmg); |
| 590 | /* lightning might destroy iron bars if hero is on such a spot; |
| 591 | reflection protects terrain here [execution won't get here due |
| 592 | to 'if (reflects) break' above] but hero resistance doesn't; |
| 593 | do this before maybe blinding the hero via flashburn() */ |
| 594 | mon_spell_hits_spot(mtmp, AD_ELEC, u.ux, u.uy); |
| 595 | /* blind hero; no effect if already blind */ |
| 596 | (void) flashburn((long) rnd(100), TRUE); |
| 597 | return dmg; |
| 598 | } |
| 599 | |
| 600 | staticfn int |
| 601 | mcast_psi_bolt(int dmg) |
no test coverage detected