return TRUE iff player relocated */
| 5056 | |
| 5057 | /* return TRUE iff player relocated */ |
| 5058 | boolean |
| 5059 | drown(void) |
| 5060 | { |
| 5061 | const char *pool_of_water; |
| 5062 | boolean inpool_ok = FALSE; |
| 5063 | int i; |
| 5064 | coordxy x, y; |
| 5065 | boolean is_solid = is_waterwall(u.ux, u.uy); |
| 5066 | |
| 5067 | feel_newsym(u.ux, u.uy); /* in case Blind, map the water here */ |
| 5068 | /* happily wading in the same contiguous pool */ |
| 5069 | if (u.uinwater && is_pool(u.ux - u.dx, u.uy - u.dy) |
| 5070 | && (Swimming || Amphibious || Breathless)) { |
| 5071 | /* water effects on objects every now and then */ |
| 5072 | if (!rn2(5)) |
| 5073 | inpool_ok = TRUE; |
| 5074 | else |
| 5075 | return FALSE; |
| 5076 | } |
| 5077 | |
| 5078 | if (!u.uinwater) { |
| 5079 | You("%s into the %s%c", is_solid ? "plunge" : "fall", |
| 5080 | waterbody_name(u.ux, u.uy), |
| 5081 | (Amphibious || Swimming || Breathless) ? '.' : '!'); |
| 5082 | if (!Swimming && !is_solid) |
| 5083 | You("sink like %s.", Hallucination ? "the Titanic" : "a rock"); |
| 5084 | } |
| 5085 | |
| 5086 | water_damage_chain(gi.invent, FALSE); |
| 5087 | |
| 5088 | if (u.umonnum == PM_GREMLIN && rn2(3)) { |
| 5089 | (void) split_mon(&gy.youmonst, (struct monst *) 0); |
| 5090 | } else if (u.umonnum == PM_IRON_GOLEM) { |
| 5091 | You("rust!"); |
| 5092 | i = Maybe_Half_Phys(d(2, 6)); |
| 5093 | if (u.mhmax > i) |
| 5094 | u.mhmax -= i; |
| 5095 | losehp(i, "rusting away", KILLED_BY); |
| 5096 | } |
| 5097 | if (inpool_ok) |
| 5098 | return FALSE; |
| 5099 | |
| 5100 | if ((i = number_leashed()) > 0) { |
| 5101 | pline_The("leash%s slip%s loose.", (i > 1) ? "es" : "", |
| 5102 | (i > 1) ? "" : "s"); |
| 5103 | unleash_all(); |
| 5104 | } |
| 5105 | |
| 5106 | if (Amphibious || Breathless || Swimming) { |
| 5107 | if (Amphibious || Breathless) { |
| 5108 | if (flags.verbose) |
| 5109 | pline("But you aren't drowning."); |
| 5110 | if (!Is_waterlevel(&u.uz)) { |
| 5111 | if (Hallucination) |
| 5112 | Your("keel hits the bottom."); |
| 5113 | else |
| 5114 | You("touch bottom."); |
| 5115 | } |
no test coverage detected