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

Function peffect_oil

src/potion.c:1259–1294  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1257}
1258
1259staticfn void
1260peffect_oil(struct obj *otmp)
1261{
1262 boolean good_for_you = FALSE, vulnerable;
1263
1264 if (otmp->lamplit) {
1265 if (likes_fire(gy.youmonst.data)) {
1266 pline("Ahh, a refreshing drink.");
1267 good_for_you = TRUE;
1268 } else {
1269 /*
1270 * Note: if poly'd into green slime, hero ought to take
1271 * extra damage, but drinking potions in that form isn't
1272 * possible so there's no need to try to handle that.
1273 */
1274 You("burn your %s.", body_part(FACE));
1275 /* fire damage */
1276 vulnerable = !Fire_resistance || Cold_resistance;
1277 losehp(d(vulnerable ? 4 : 2, 4),
1278 "quaffing a burning potion of oil",
1279 KILLED_BY);
1280 }
1281 /*
1282 * This is slightly iffy because the burning isn't being
1283 * spread across the body. But the message is "the slime
1284 * that covers you burns away" and having that follow
1285 * "you burn your face" seems consistent enough.
1286 */
1287 burn_away_slime();
1288 } else if (otmp->cursed) {
1289 pline("This tastes like castor oil.");
1290 } else {
1291 pline("That was smooth!");
1292 }
1293 exercise(A_WIS, good_for_you);
1294}
1295
1296staticfn void
1297peffect_acid(struct obj *otmp)

Callers 1

peffectsFunction · 0.85

Calls 7

YouFunction · 0.85
body_partFunction · 0.85
losehpFunction · 0.85
dFunction · 0.85
burn_away_slimeFunction · 0.85
exerciseFunction · 0.85
plineFunction · 0.70

Tested by

no test coverage detected