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

Function rustm

src/mhitm.c:1259–1280  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1257}
1258
1259void
1260rustm(struct monst *mdef, struct obj *obj)
1261{
1262 int dmgtyp = ERODE_NONE, chance = 1;
1263
1264 if (!mdef || !obj)
1265 return; /* just in case */
1266 /* AD_ACID and AD_ENCH are handled in passivemm() and passiveum() */
1267 if (dmgtype(mdef->data, AD_CORR)) {
1268 dmgtyp = ERODE_CORRODE;
1269 } else if (dmgtype(mdef->data, AD_RUST)) {
1270 dmgtyp = ERODE_RUST;
1271 } else if (dmgtype(mdef->data, AD_FIRE)
1272 /* steam vortex: fire resist applies, fire damage doesn't */
1273 && mdef->data != &mons[PM_STEAM_VORTEX]) {
1274 dmgtyp = ERODE_BURN;
1275 chance = 6;
1276 }
1277
1278 if (dmgtyp != ERODE_NONE && !rn2(chance))
1279 (void) erode_obj(obj, (char *) 0, dmgtyp, EF_GREASE | EF_VERBOSE);
1280}
1281
1282staticfn void
1283mswingsm(

Callers 1

mhitm_ad_physFunction · 0.85

Calls 3

dmgtypeFunction · 0.85
rn2Function · 0.85
erode_objFunction · 0.85

Tested by

no test coverage detected