Update mcastu.c

szy_
pmje2o5iu 2 years ago
parent 3c57139871
commit 02e7b55760

@ -242,7 +242,7 @@ castmu(
canseemon(mtmp) ? Monnam(mtmp) : "Something", canseemon(mtmp) ? Monnam(mtmp) : "Something",
is_waterwall(mtmp->mux,mtmp->muy) ? "empty water" is_waterwall(mtmp->mux,mtmp->muy) ? "empty water"
: "thin air"); : "thin air");
return M_ATTK_MISS; return M_ATTK_MISS;// Return a miss attack if the monster hasn't found you but thinks it has and casts a directed spell
} }
nomul(0); nomul(0);
@ -300,14 +300,14 @@ castmu(
burn_away_slime(); burn_away_slime();
break; break;
case AD_COLD: case AD_COLD:
pline("You're covered in frost."); pline("You're covered in frost."); // Display a message indicating that the player is covered in frost
if (Cold_resistance) { if (Cold_resistance) { // Check if the player has cold resistance
shieldeff(u.ux, u.uy); shieldeff(u.ux, u.uy); // Shield the player with an icy shield animation
pline("But you resist the effects."); pline("But you resist the effects."); // Display a message indicating that the player resists the effects
monstseesu(M_SEEN_COLD); monstseesu(M_SEEN_COLD); // Indicate that the monster saw the player being hit with a cold attack
dmg = 0; dmg = 0; // Set the damage amount to 0 since the player resisted the attack
} else { } else {
monstunseesu(M_SEEN_COLD); monstunseesu(M_SEEN_COLD);// Indicate that the monster saw the player being hit with a cold attack
} }
break; break;
case AD_MAGM: case AD_MAGM:
@ -341,15 +341,15 @@ castmu(
static int static int
m_cure_self(struct monst *mtmp, int dmg) m_cure_self(struct monst *mtmp, int dmg)
{ {
if (mtmp->mhp < mtmp->mhpmax) { if (mtmp->mhp < mtmp->mhpmax) { // Check if the monster's current hit points are less than its maximum hit points
if (canseemon(mtmp)) if (canseemon(mtmp)) // Check if the player can see the monster
pline("%s looks better.", Monnam(mtmp)); pline("%s looks better.", Monnam(mtmp)); // Display a message indicating that the monster looks better
/* note: player healing does 6d4; this used to do 1d8 */ /* note: player healing does 6d4; this used to do 1d8 */
if ((mtmp->mhp += d(3, 6)) > mtmp->mhpmax) if ((mtmp->mhp += d(3, 6)) > mtmp->mhpmax) // Restore some of the monster's health
mtmp->mhp = mtmp->mhpmax; mtmp->mhp = mtmp->mhpmax; // Cap the monster's hit points to its maximum hit points
dmg = 0; dmg = 0; // Set the damage amount to 0 since the monster is healing itself
} }
return dmg; return dmg; // Return the updated damage amount
} }
/* unlike the finger of death spell which behaves like a wand of death, /* unlike the finger of death spell which behaves like a wand of death,

Loading…
Cancel
Save