MCPcopy Create free account
hub / github.com/NetHack/NetHack / golemeffects

Function golemeffects

src/mon.c:5679–5707  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5677}
5678
5679void
5680golemeffects(struct monst *mon, int damtype, int dam)
5681{
5682 int heal = 0, slow = 0;
5683
5684 if (mon->data == &mons[PM_FLESH_GOLEM]) {
5685 if (damtype == AD_ELEC)
5686 heal = (dam + 5) / 6;
5687 else if (damtype == AD_FIRE || damtype == AD_COLD)
5688 slow = 1;
5689 } else if (mon->data == &mons[PM_IRON_GOLEM]) {
5690 if (damtype == AD_ELEC)
5691 slow = 1;
5692 else if (damtype == AD_FIRE)
5693 heal = dam;
5694 } else {
5695 return;
5696 }
5697 if (slow) {
5698 if (mon->mspeed != MSLOW)
5699 mon_adjust_speed(mon, -1, (struct obj *) 0);
5700 }
5701 if (heal) {
5702 if (healmon(mon, heal, 0)) {
5703 if (cansee(mon->mx, mon->my))
5704 pline_mon(mon, "%s seems healthier.", Monnam(mon));
5705 }
5706 }
5707}
5708
5709/* anger the Minetown watch */
5710boolean

Callers 7

mhitm_ad_fireFunction · 0.85
mhitm_ad_coldFunction · 0.85
mhitm_ad_elecFunction · 0.85
gulpumFunction · 0.85
passivemmFunction · 0.85
passiveumFunction · 0.85
explodeFunction · 0.85

Calls 4

mon_adjust_speedFunction · 0.85
healmonFunction · 0.85
pline_monFunction · 0.85
MonnamFunction · 0.85

Tested by

no test coverage detected