mtmp hits you for n points damage */
| 1899 | |
| 1900 | /* mtmp hits you for n points damage */ |
| 1901 | void |
| 1902 | mdamageu(struct monst *mtmp, int n) |
| 1903 | { |
| 1904 | if (n < 0) { |
| 1905 | impossible("mdamageu for negative damage? (%d)", n); |
| 1906 | n = 0; |
| 1907 | } |
| 1908 | |
| 1909 | disp.botl = TRUE; |
| 1910 | if (Upolyd) { |
| 1911 | u.mh -= n; |
| 1912 | showdamage(n); |
| 1913 | /* caller might have reduced mhmax before calling mdamageu() */ |
| 1914 | if (u.mh > u.mhmax) |
| 1915 | u.mh = u.mhmax; |
| 1916 | if (u.mh < 1) |
| 1917 | rehumanize(); |
| 1918 | } else { |
| 1919 | u.uhp -= n; |
| 1920 | showdamage(n); |
| 1921 | /* caller might have reduced uhpmax before calling mdamageu() */ |
| 1922 | if (u.uhp > u.uhpmax) |
| 1923 | u.uhp = u.uhpmax; |
| 1924 | if (u.uhp < 1) |
| 1925 | done_in_by(mtmp, DIED); |
| 1926 | } |
| 1927 | } |
| 1928 | |
| 1929 | /* returns 0 if seduction impossible, |
| 1930 | * 1 if fine, |
no test coverage detected