Created by GAN 01/28/87 * Amended by AKP 09/22/87: if not hard, don't choke, just vomit. * Amended by 3. 06/12/89: if not hard, sometimes choke anyway, to keep risk. * 11/10/89: if hard, rarely vomit anyway, for slim chance. * * To a full belly all food is bad. (It.) */
| 242 | * To a full belly all food is bad. (It.) |
| 243 | */ |
| 244 | staticfn void |
| 245 | choke(struct obj *food) |
| 246 | { |
| 247 | /* only happens if you were satiated */ |
| 248 | if (u.uhs != SATIATED) { |
| 249 | if (!food || food->otyp != AMULET_OF_STRANGULATION) |
| 250 | return; |
| 251 | } else if (Role_if(PM_KNIGHT) && u.ualign.type == A_LAWFUL) { |
| 252 | adjalign(-1); /* gluttony is unchivalrous */ |
| 253 | You_feel("like a glutton!"); |
| 254 | } |
| 255 | |
| 256 | exercise(A_CON, FALSE); |
| 257 | |
| 258 | if (Breathless || Hunger || (!Strangled && !rn2(20))) { |
| 259 | /* choking by eating AoS doesn't involve stuffing yourself */ |
| 260 | if (food && food->otyp == AMULET_OF_STRANGULATION) { |
| 261 | You("choke, but recover your composure."); |
| 262 | return; |
| 263 | } |
| 264 | You("stuff yourself and then vomit voluminously."); |
| 265 | morehungry(Hunger ? (u.uhunger - 60) : 1000); /* just got very sick! */ |
| 266 | vomit(); |
| 267 | } else { |
| 268 | svk.killer.format = KILLED_BY_AN; |
| 269 | /* |
| 270 | * Note all "killer"s below read "Choked on %s" on the |
| 271 | * high score list & tombstone. So plan accordingly. |
| 272 | */ |
| 273 | if (food) { |
| 274 | You("choke over your %s.", foodword(food)); |
| 275 | if (food->oclass == COIN_CLASS) { |
| 276 | Strcpy(svk.killer.name, "very rich meal"); |
| 277 | } else { |
| 278 | svk.killer.format = KILLED_BY; |
| 279 | Strcpy(svk.killer.name, killer_xname(food)); |
| 280 | } |
| 281 | } else { |
| 282 | You("choke over it."); |
| 283 | Strcpy(svk.killer.name, "quick snack"); |
| 284 | } |
| 285 | You("die..."); |
| 286 | done(CHOKING); |
| 287 | } |
| 288 | } |
| 289 | |
| 290 | /* modify victual.piece->owt depending on time spent consuming it */ |
| 291 | staticfn void |
no test coverage detected