MCPcopy Index your code
hub / github.com/NetHack/NetHack / ugolemeffects

Function ugolemeffects

src/polyself.c:2159–2188  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2157}
2158
2159void
2160ugolemeffects(int damtype, int dam)
2161{
2162 int heal = 0;
2163
2164 /* We won't bother with "slow"/"haste" since players do not
2165 * have a monster-specific slow/haste so there is no way to
2166 * restore the old velocity once they are back to human.
2167 */
2168 if (u.umonnum != PM_FLESH_GOLEM && u.umonnum != PM_IRON_GOLEM)
2169 return;
2170 switch (damtype) {
2171 case AD_ELEC:
2172 if (u.umonnum == PM_FLESH_GOLEM)
2173 heal = (dam + 5) / 6; /* Approx 1 per die */
2174 break;
2175 case AD_FIRE:
2176 if (u.umonnum == PM_IRON_GOLEM)
2177 heal = dam;
2178 break;
2179 }
2180 if (heal && (u.mh < u.mhmax)) {
2181 u.mh += heal;
2182 if (u.mh > u.mhmax)
2183 u.mh = u.mhmax;
2184 disp.botl = TRUE;
2185 pline("Strangely, you feel better than before.");
2186 exercise(A_STR, TRUE);
2187 }
2188}
2189
2190staticfn int
2191armor_to_dragon(int atyp)

Callers 7

passiveFunction · 0.85
zapyourselfFunction · 0.85
zhituFunction · 0.85
gulpmuFunction · 0.85
explmuFunction · 0.85
gazemuFunction · 0.85
explodeFunction · 0.85

Calls 2

exerciseFunction · 0.85
plineFunction · 0.70

Tested by

no test coverage detected