diff --git a/src/NetHack_3.7/src/mhitu.c b/src/NetHack_3.7/src/mhitu.c index a4494ca..eb0e0b1 100644 --- a/src/NetHack_3.7/src/mhitu.c +++ b/src/NetHack_3.7/src/mhitu.c @@ -157,14 +157,15 @@ mpoisons_subj(struct monst *mtmp, struct attack *mattk) void u_slow_down(void) { - HFast = 0L; + HFast = 0L; // Clear the duration of the fast status if (!Fast) - You("slow down."); + You("slow down."); // Displays a message to indicate that the player is slowing down else /* speed boots */ - Your("quickness feels less natural."); - exercise(A_DEX, FALSE); + Your("quickness feels less natural.");// Displays a message indicating that the player's quickness feels less natural, likely due to the effect of having worn magical speed boots + exercise(A_DEX, FALSE); // Increase the player's dexterity by exercising it } + /* monster attacked wrong location due to monster blindness, hero invisibility, hero displacement, or hero being underwater */ static void @@ -1194,14 +1195,14 @@ gulp_blnd_check(void) { struct attack *mattk; - if (!Blinded && u.uswallow - && (mattk = attacktype_fordmg(u.ustuck->data, AT_ENGL, AD_BLND)) - && can_blnd(u.ustuck, &gy.youmonst, mattk->aatyp, (struct obj *) 0)) { - ++u.uswldtim; /* compensate for gulpmu change */ - (void) gulpmu(u.ustuck, mattk); - return TRUE; + if (!Blinded && u.uswallow// Check if the player is not already blinded and is currently swallowed by another creature + && (mattk = attacktype_fordmg(u.ustuck->data, AT_ENGL, AD_BLND)) // Get the type of attack used by the creature to blind its prey + && can_blnd(u.ustuck, &gy.youmonst, mattk->aatyp, (struct obj *) 0)) { // Check if this kind of attack can blind the player + ++u.uswldtim; /* compensate for gulpmu change */ // Increase the swallow delay timer to compensate for any changes caused by swallowing the player + (void) gulpmu(u.ustuck, mattk); // Perform the swallow attack + return TRUE; // Return that the player should be blinded } - return FALSE; + return FALSE;// Return that the player should not be blinded } /* monster swallows you, or damage if u.uswallow */ @@ -1810,16 +1811,17 @@ gazemu(struct monst *mtmp, struct attack *mattk) void mdamageu(struct monst *mtmp, int n) { - gc.context.botl = 1; - if (Upolyd) { - u.mh -= n; - if (u.mh < 1) - rehumanize(); - } else { - n = saving_grace(n); - u.uhp -= n; - if (u.uhp < 1) - done_in_by(mtmp, DIED); + gc.context.botl = 1; // Set the botl (bottom line) flag to indicate that the status line needs to be updated + + if (Upolyd) { // If the player is currently in a polymorphed form + u.mh -= n; // Reduce the player's monster hit points by the specified amount of damage + if (u.mh < 1) // If the player's monster hit points drop below 1 + rehumanize(); // Change the player back to human form + } else { // If the player is in human form + n = saving_grace(n); // Apply any necessary reductions to the damage based on the player's abilities + u.uhp -= n; // Reduce the player's hit points by the modified amount of damage + if (u.uhp < 1) // If the player's hit points drop below 1 + done_in_by(mtmp, DIED); // Handle the player's death caused by the monster } }