Update mhitu.c

szy_
pmje2o5iu 1 year ago
parent a1973b1aa0
commit cf18d840fa

@ -157,14 +157,15 @@ mpoisons_subj(struct monst *mtmp, struct attack *mattk)
void void
u_slow_down(void) u_slow_down(void)
{ {
HFast = 0L; HFast = 0L; // Clear the duration of the fast status
if (!Fast) if (!Fast)
You("slow down."); You("slow down."); // Displays a message to indicate that the player is slowing down
else /* speed boots */ else /* speed boots */
Your("quickness feels less natural."); 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); exercise(A_DEX, FALSE); // Increase the player's dexterity by exercising it
} }
/* monster attacked wrong location due to monster blindness, hero /* monster attacked wrong location due to monster blindness, hero
invisibility, hero displacement, or hero being underwater */ invisibility, hero displacement, or hero being underwater */
static void static void
@ -1194,14 +1195,14 @@ gulp_blnd_check(void)
{ {
struct attack *mattk; struct attack *mattk;
if (!Blinded && u.uswallow 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)) && (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)) { && 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 */ ++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); (void) gulpmu(u.ustuck, mattk); // Perform the swallow attack
return TRUE; 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 */ /* monster swallows you, or damage if u.uswallow */
@ -1810,16 +1811,17 @@ gazemu(struct monst *mtmp, struct attack *mattk)
void void
mdamageu(struct monst *mtmp, int n) mdamageu(struct monst *mtmp, int n)
{ {
gc.context.botl = 1; gc.context.botl = 1; // Set the botl (bottom line) flag to indicate that the status line needs to be updated
if (Upolyd) {
u.mh -= n; if (Upolyd) { // If the player is currently in a polymorphed form
if (u.mh < 1) u.mh -= n; // Reduce the player's monster hit points by the specified amount of damage
rehumanize(); if (u.mh < 1) // If the player's monster hit points drop below 1
} else { rehumanize(); // Change the player back to human form
n = saving_grace(n); } else { // If the player is in human form
u.uhp -= n; n = saving_grace(n); // Apply any necessary reductions to the damage based on the player's abilities
if (u.uhp < 1) u.uhp -= n; // Reduce the player's hit points by the modified amount of damage
done_in_by(mtmp, DIED); 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
} }
} }

Loading…
Cancel
Save