Source:NetHack 5.0.0/src/sit.c
Jump to navigation
Jump to search
Below is the full text to sit.c from the source code of NetHack 5.0.0. To link to a particular line, write [[Source:NetHack 5.0.0/src/sit.c#line12]], for example.
The NetHack General Public License applies to screenshots, source code and other content from NetHack.
This content was modified from the original NetHack source code distribution (by splitting up NetHack content between wiki pages, and possibly further editing). See the page history for a list of who changed it, and on what dates.
1. /* NetHack 5.0 sit.c $NHDT-Date: 1718136168 2024/06/11 20:02:48 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.95 $ */ 2. /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ 3. /*-Copyright (c) Robert Patrick Rankin, 2012. */ 4. /* NetHack may be freely redistributed. See license for details. */ 5. 6. #include "hack.h" 7. #include "artifact.h" 8. 9. staticfn void throne_sit_effect(void); 10. staticfn int lay_an_egg(void); 11. 12. /* take away the hero's money */ 13. void 14. take_gold(void) 15. { 16. struct obj *otmp, *nobj; 17. int lost_money = 0; 18. 19. for (otmp = gi.invent; otmp; otmp = nobj) { 20. nobj = otmp->nobj; 21. if (otmp->oclass == COIN_CLASS) { 22. lost_money = 1; 23. remove_worn_item(otmp, FALSE); 24. delobj(otmp); 25. } 26. } 27. if (!lost_money) { 28. You_feel("a strange sensation."); 29. } else { 30. You("notice you have no gold!"); 31. disp.botl = TRUE; 32. } 33. } 34. 35. staticfn void special_throne_effect(int effect); 36. 37. /* maybe do something when hero sits on a throne */ 38. staticfn void 39. throne_sit_effect(void) 40. { 41. coordxy tx = u.ux, ty = u.uy; 42. 43. boolean special_throne = !!In_V_tower(&u.uz); 44. 45. if (rnd(6) > 4) { /* [why so convoluted? it's the same as '!rn2(3)'] */ 46. int effect = rnd(13); 47. 48. if (wizard && !iflags.debug_fuzzer) { 49. char buf[BUFSZ]; 50. int which; 51. 52. buf[0] = '\0'; 53. getlin("Throne sit effect (1..13) [0=random]", buf); 54. if (buf[0] == '\033') { 55. pline("%s", Never_mind); 56. return; /* caller will still cause a move to elapse */ 57. } 58. which = atoi(buf); 59. if (which >= 1 && which <= 13) 60. effect = which; 61. } 62. 63. if (special_throne) { 64. special_throne_effect(effect); 65. return; 66. } 67. 68. switch (effect) { 69. case 1: 70. (void) adjattrib(rn2(A_MAX), -rn1(4, 3), FALSE); 71. losehp(rnd(10), "cursed throne", KILLED_BY_AN); 72. break; 73. case 2: 74. (void) adjattrib(rn2(A_MAX), 1, FALSE); 75. break; 76. case 3: 77. pline("A%s electric shock shoots through your body!", 78. (Shock_resistance) ? "n" : " massive"); 79. losehp(Shock_resistance ? rnd(6) : rnd(30), "electric chair", 80. KILLED_BY_AN); 81. exercise(A_CON, FALSE); 82. break; 83. case 4: 84. You_feel("much, much better!"); 85. if (Upolyd) { 86. if (u.mh >= (u.mhmax - 5)) 87. u.mhmax += 4; 88. u.mh = u.mhmax; 89. } 90. if (u.uhp >= (u.uhpmax - 5)) { 91. u.uhpmax += 4; 92. if (u.uhpmax > u.uhppeak) 93. u.uhppeak = u.uhpmax; 94. } 95. u.uhp = u.uhpmax; 96. u.ucreamed = 0; 97. make_blinded(0L, TRUE); 98. make_sick(0L, (char *) 0, FALSE, SICK_ALL); 99. heal_legs(0); 100. disp.botl = TRUE; 101. break; 102. case 5: 103. take_gold(); 104. break; 105. case 6: 106. if (u.uluck + rn2(5) < 0) { 107. You_feel("your luck is changing."); 108. change_luck(1); 109. } else 110. makewish(); 111. break; 112. case 7: 113. { 114. int cnt = rnd(10); 115. 116. /* Magical voice not affected by deafness */ 117. pline("A voice echoes:"); 118. SetVoice((struct monst *) 0, 0, 80, voice_throne); 119. verbalize("Thine audience hath been summoned, %s!", 120. flags.female ? "Dame" : "Sire"); 121. while (cnt--) 122. (void) makemon(courtmon(), tx, ty, NO_MM_FLAGS); 123. break; 124. } 125. case 8: 126. /* Magical voice not affected by deafness */ 127. pline("A voice echoes:"); 128. SetVoice((struct monst *) 0, 0, 80, voice_throne); 129. verbalize("By thine Imperious order, %s...", 130. flags.female ? "Dame" : "Sire"); 131. do_genocide(5); /* REALLY|ONTHRONE, see do_genocide() */ 132. break; 133. case 9: 134. /* Magical voice not affected by deafness */ 135. pline("A voice echoes:"); 136. SetVoice((struct monst *) 0, 0, 80, voice_throne); 137. verbalize( 138. "A curse upon thee for sitting upon this most holy throne!"); 139. if (Luck > 0) { 140. make_blinded(BlindedTimeout + rn1(100, 250), TRUE); 141. change_luck((Luck > 1) ? -rnd(2) : -1); 142. } else 143. rndcurse(); 144. break; 145. case 10: 146. if (Luck < 0 || (HSee_invisible & INTRINSIC)) { 147. if (svl.level.flags.nommap) { 148. pline("A terrible drone fills your head!"); 149. make_confused((HConfusion & TIMEOUT) + (long) rnd(30), 150. FALSE); 151. } else { 152. pline("An image forms in your mind."); 153. do_mapping(); 154. } 155. } else { 156. /* avoid "vision clears" if hero can't see */ 157. if (!Blind) { 158. Your("vision becomes clear."); 159. } else { 160. int num_of_eyes = eyecount(gy.youmonst.data); 161. const char *eye = body_part(EYE); 162. 163. /* note: 1 eye case won't actually happen--can't 164. sit on throne when poly'd into always-levitating 165. floating eye and can't polymorph into Cyclops */ 166. switch (num_of_eyes) { /* 2, 1, or 0 */ 167. default: 168. case 2: /* more than 1 eye */ 169. eye = makeplural(eye); 170. FALLTHROUGH; 171. /*FALLTHRU*/ 172. case 1: /* one eye (Cyclops, floating eye) */ 173. Your("%s %s...", eye, vtense(eye, "tingle")); 174. break; 175. case 0: /* no eyes */ 176. You("have a very strange feeling in your %s.", 177. body_part(HEAD)); 178. break; 179. } 180. } 181. HSee_invisible |= FROMOUTSIDE; 182. newsym(u.ux, u.uy); 183. } 184. break; 185. case 11: 186. if (Luck < 0) { 187. You_feel("threatened."); 188. aggravate(); 189. } else { 190. You_feel("a wrenching sensation."); 191. tele(); /* teleport him */ 192. } 193. break; 194. case 12: 195. You("are granted an insight!"); 196. if (gi.invent) { 197. /* rn2(5) agrees w/seffects() */ 198. identify_pack(rn2(5), FALSE); 199. } 200. break; 201. case 13: 202. Your("mind turns into a pretzel!"); 203. make_confused((HConfusion & TIMEOUT) + (long) rn1(7, 16), 204. FALSE); 205. break; 206. default: 207. impossible("throne effect"); 208. break; 209. } 210. } else { 211. if (is_prince(gy.youmonst.data) || u.uevent.uhand_of_elbereth) 212. You_feel("very comfortable here."); 213. else 214. You_feel("somehow out of place..."); 215. } 216. 217. /* 5.0: when the random chance for removal is hit, ask for confirmation 218. if in wizard mode, and remove the throne even if hero was teleported 219. away from it. [This used to remove a throne at hero's current 220. location if there happened to be one, so for the teleport case that 221. only happened when teleporting back to the same point where hero 222. started from.] "Analyzing a throne" doesn't really make any sense 223. but if the answer is yes than it will vanish in a puff of logic. */ 224. if (!special_throne && 225. !rn2(3) && (!wizard || y_n("Analyze throne?") == 'y')) { 226. levl[tx][ty].typ = ROOM, levl[tx][ty].flags = 0; 227. map_background(tx, ty, FALSE); 228. newsym_force(tx, ty); 229. /* "[God] promptly vanishes in a puff of logic" is from 230. Douglas Adams' _The_Hitchhiker's_Guide_to_the_Galaxy_. */ 231. pline_The("throne %s in a puff of logic.", 232. cansee(tx, ty) ? "vanishes" : "has vanished"); 233. } 234. } 235. 236. /* special throne in Vlad's tower: effect is 1 to 13 inclusive */ 237. staticfn void 238. special_throne_effect(int effect) { 239. coordxy tx = u.ux, ty = u.uy; 240. 241. switch (effect) { 242. case 1: 243. case 2: 244. case 3: 245. case 4: 246. /* 4 chances of a wish, but then the throne disappears. 247. 248. This is the only way the throne can disappear from sitting 249. on it, so if you sit on it enough (enduring the negative 250. effects) you are guaranteed an eventual wish. */ 251. makewish(); 252. levl[tx][ty].typ = ROOM, levl[tx][ty].flags = 0; 253. map_background(tx, ty, FALSE); 254. newsym_force(tx, ty); 255. pline_The("throne disintegrates, having spent its power."); 256. break; 257. case 5: 258. /* permanent level drain */ 259. pline("Sitting on the throne was a terrible experience."); 260. if (!Drain_resistance) { 261. losexp("a bad experience sitting on a throne"); 262. if (u.ulevelmax > u.ulevel) 263. u.ulevelmax -= 1; 264. } 265. break; 266. case 6: 267. { 268. /* grease hands and inventory 269. 270. Same rules for which items can be affected as grease_ok in apply.c */ 271. struct obj *otmp; 272. 273. pline("A greasy liquid sprays all over you!"); 274. for (otmp = gi.invent; otmp; otmp = otmp->nobj) 275. if (otmp->oclass != COIN_CLASS) 276. otmp->greased = 1; 277. make_glib(rn1(101, 100)); 278. update_inventory(); 279. break; 280. } 281. case 7: 282. /* lose an intrinsic */ 283. attrcurse(); 284. pline_The("throne somehow seems to be amused."); 285. break; 286. case 8: 287. { 288. /* level teleport to Vibrating Square level */ 289. d_level vs_level; 290. find_hell(&vs_level); 291. vs_level.dlevel = svd.dungeons[vs_level.dnum].num_dunlevs - 1; 292. if (u.uhave.amulet) 293. You_feel("extremely disoriented for a moment."); 294. else 295. schedule_goto( 296. &vs_level, UTOTYPE_NONE, (char *) 0, 297. "You feel extremely out of place."); 298. break; 299. } 300. case 9: 301. { 302. /* summon demons; a NULL argument to msummon summons demons as 303. though they were summoned by the Wizard of Yendor */ 304. pline_The("throne seeems to be calling for help!"); 305. msummon(NULL); 306. msummon(NULL); 307. msummon(NULL); 308. break; 309. } 310. case 10: 311. { 312. /* confused blessed remove curse effect */ 313. struct obj fake_spellbook; 314. long save_confusion = HConfusion; 315. 316. fake_spellbook = cg.zeroobj; 317. fake_spellbook.otyp = SPE_REMOVE_CURSE; 318. fake_spellbook.oclass = SPBOOK_CLASS; 319. fake_spellbook.blessed = 1; 320. HConfusion = 1L; 321. (void) seffects(&fake_spellbook); 322. HConfusion = save_confusion; 323. break; 324. } 325. case 11: 326. /* polymorph effect (not blocked by magic resistance, but other things 327. that protect from polymorphs work) */ 328. if (is_vampire(gy.youmonst.data)) { 329. You_feel("unworthy."); 330. } else { 331. pline("This throne was not meant for those such as you!"); 332. You_feel("a change coming over you."); 333. polyself(POLY_NOFLAGS); 334. } 335. break; 336. case 12: 337. /* acid damage */ 338. pline("The throne is covered in acid!"); 339. losehp(Acid_resistance ? rnd(16) : rnd(80), "acidic chair", 340. KILLED_BY_AN); 341. exercise(A_CON, FALSE); 342. break; 343. case 13: 344. { 345. /* ability shuffle */ 346. int ability; 347. pline("As you sit on the throne, your body and mind start to warp."); 348. for (ability = 0; ability < A_MAX; ++ability) { 349. adjattrib(ability, rn2(5) - 2, -1); 350. } 351. break; 352. } 353. } 354. } 355. 356. /* hero lays an egg */ 357. staticfn int 358. lay_an_egg(void) 359. { 360. struct obj *uegg; 361. 362. if (!flags.female) { 363. pline("%s can't lay eggs!", 364. Hallucination 365. ? "You may think you are a platypus, but a male still" 366. : "Males"); 367. return ECMD_OK; 368. } else if (u.uhunger < (int) objects[EGG].oc_nutrition) { 369. You("don't have enough energy to lay an egg."); 370. return ECMD_OK; 371. } else if (eggs_in_water(gy.youmonst.data)) { 372. if (!(Underwater || Is_waterlevel(&u.uz))) { 373. pline("A splash tetra you are not."); 374. return ECMD_OK; 375. } 376. if (Upolyd 377. && (gy.youmonst.data == &mons[PM_GIANT_EEL] 378. || gy.youmonst.data == &mons[PM_ELECTRIC_EEL])) { 379. You("yearn for the Sargasso Sea."); 380. return ECMD_OK; 381. } 382. } 383. uegg = mksobj(EGG, FALSE, FALSE); 384. uegg->spe = 1; 385. uegg->quan = 1L; 386. uegg->owt = weight(uegg); 387. /* this sets hatch timers if appropriate */ 388. set_corpsenm(uegg, egg_type_from_parent(u.umonnum, FALSE)); 389. uegg->known = 1; 390. observe_object(uegg); 391. You("%s an egg.", eggs_in_water(gy.youmonst.data) ? "spawn" : "lay"); 392. dropy(uegg); 393. stackobj(uegg); 394. morehungry((int) objects[EGG].oc_nutrition); 395. return ECMD_TIME; 396. } 397. 398. /* #sit command */ 399. int 400. dosit(void) 401. { 402. static const char sit_message[] = "sit on the %s."; 403. struct trap *trap = t_at(u.ux, u.uy); 404. int typ = levl[u.ux][u.uy].typ; 405. 406. if (u.usteed) { 407. You("are already sitting on %s.", mon_nam(u.usteed)); 408. return ECMD_OK; 409. } 410. if (u.uundetected && is_hider(gy.youmonst.data) 411. && u.umonnum != PM_TRAPPER) /* trapper can stay hidden on floor */ 412. u.uundetected = 0; /* no longer on the ceiling */ 413. 414. if (!can_reach_floor(FALSE)) { 415. if (u.uswallow) 416. There("are no seats in here!"); 417. else if (Levitation) 418. You("tumble in place."); 419. else 420. You("are sitting on air."); 421. return ECMD_OK; 422. } else if (u.ustuck && !sticks(gy.youmonst.data)) { 423. /* holding monster is next to hero rather than beneath, but 424. hero is in no condition to actually sit at has/her own spot */ 425. if (humanoid(u.ustuck->data)) 426. pline("%s won't offer %s lap.", Monnam(u.ustuck), mhis(u.ustuck)); 427. else 428. pline("%s has no lap.", Monnam(u.ustuck)); 429. return ECMD_OK; 430. } else if (is_pool(u.ux, u.uy) && !Underwater) { /* water walking */ 431. goto in_water; 432. } else if (Upolyd && u.umonnum == PM_GREMLIN 433. && (levl[u.ux][u.uy].typ == FOUNTAIN || is_pool(u.ux, u.uy))) { 434. goto in_water; 435. } 436. 437. if (OBJ_AT(u.ux, u.uy) 438. /* ensure we're not standing on the precipice */ 439. && !(uteetering_at_seen_pit(trap) || uescaped_shaft(trap))) { 440. struct obj *obj; 441. 442. obj = svl.level.objects[u.ux][u.uy]; 443. if (gy.youmonst.data->mlet == S_DRAGON && obj->oclass == COIN_CLASS) { 444. You("coil up around your %shoard.", 445. (obj->quan + money_cnt(gi.invent) < u.ulevel * 1000) 446. ? "meager " : ""); 447. } else if (obj->otyp == TOWEL) { 448. pline("It's probably not a good time for a picnic..."); 449. } else { 450. if (slithy(gy.youmonst.data)) 451. You("coil up around %s.", the(xname(obj))); 452. else 453. You("sit on %s.", the(xname(obj))); 454. if (obj->otyp == CORPSE && amorphous(&mons[obj->corpsenm])) 455. pline("It's squishy..."); 456. else if (obj->otyp == CREAM_PIE) { 457. if (!Deaf) { 458. Soundeffect(se_squelch, 30); 459. pline("Squelch!"); 460. } 461. useupf(obj, obj->quan); 462. } else if (!(Is_box(obj) 463. || objects[obj->otyp].oc_material == CLOTH)) 464. pline("It's not very comfortable..."); 465. } 466. } else if (trap != 0 || (u.utrap && (u.utraptype >= TT_LAVA))) { 467. if (u.utrap) { 468. exercise(A_WIS, FALSE); /* you're getting stuck longer */ 469. if (u.utraptype == TT_BEARTRAP) { 470. You_cant("sit down with your %s in the bear trap.", 471. body_part(FOOT)); 472. u.utrap++; 473. } else if (u.utraptype == TT_PIT) { 474. if (trap && trap->ttyp == SPIKED_PIT) { 475. You("sit down on a spike. Ouch!"); 476. losehp(Half_physical_damage ? rn2(2) : 1, 477. "sitting on an iron spike", KILLED_BY); 478. exercise(A_STR, FALSE); 479. } else 480. You("sit down in the pit."); 481. u.utrap += rn2(5); 482. } else if (u.utraptype == TT_WEB) { 483. You("sit in the spider web and get entangled further!"); 484. u.utrap += rn1(10, 5); 485. } else if (u.utraptype == TT_LAVA) { 486. /* Must have fire resistance or they'd be dead already */ 487. You("sit in the %s!", hliquid("lava")); 488. if (Slimed) 489. burn_away_slime(); 490. u.utrap += rnd(4); 491. losehp(d(2, 10), "sitting in lava", 492. KILLED_BY); /* lava damage */ 493. } else if (u.utraptype == TT_INFLOOR 494. || u.utraptype == TT_BURIEDBALL) { 495. You_cant("maneuver to sit!"); 496. u.utrap++; 497. } 498. } else { 499. /* when flying, "you land" might need some refinement; it sounds 500. as if you're staying on the ground but you will immediately 501. take off again unless you become stuck in a holding trap */ 502. You("%s.", Flying ? "land" : "sit down"); 503. dotrap(trap, VIASITTING); 504. } 505. } else if ((Underwater || Is_waterlevel(&u.uz)) 506. && !eggs_in_water(gy.youmonst.data)) { 507. if (Is_waterlevel(&u.uz)) 508. There("are no cushions floating nearby."); 509. else 510. You("sit down on the muddy bottom."); 511. } else if (is_pool(u.ux, u.uy) && !eggs_in_water(gy.youmonst.data)) { 512. in_water: 513. You("sit in the %s.", hliquid("water")); 514. if (Upolyd && u.umonnum == PM_GREMLIN) { 515. if (split_mon(&gy.youmonst, (struct monst *) 0)) { 516. if (levl[u.ux][u.uy].typ == FOUNTAIN) 517. dryup(u.ux, u.uy, TRUE); 518. } 519. /* splitting--or failing to do so--protects gear from the water */ 520. } else { 521. if (!rn2(10) && uarm) 522. (void) water_damage(uarm, "armor", TRUE); 523. if (!rn2(10) && uarmf && uarmf->otyp != WATER_WALKING_BOOTS) 524. (void) water_damage(uarm, "armor", TRUE); 525. } 526. } else if (IS_SINK(typ)) { 527. You(sit_message, defsyms[S_sink].explanation); 528. Your("%s gets wet.", 529. humanoid(gy.youmonst.data) ? "rump" : "underside"); 530. } else if (IS_ALTAR(typ)) { 531. You(sit_message, defsyms[S_altar].explanation); 532. altar_wrath(u.ux, u.uy); 533. } else if (IS_GRAVE(typ)) { 534. You(sit_message, defsyms[S_grave].explanation); 535. } else if (typ == STAIRS) { 536. You(sit_message, "stairs"); 537. } else if (typ == LADDER) { 538. You(sit_message, "ladder"); 539. } else if (is_lava(u.ux, u.uy)) { 540. /* must be WWalking */ 541. You(sit_message, hliquid("lava")); 542. burn_away_slime(); 543. if (likes_lava(gy.youmonst.data)) { 544. pline_The("%s feels warm.", hliquid("lava")); 545. return ECMD_TIME; 546. } 547. pline_The("%s burns you!", hliquid("lava")); 548. losehp(d((Fire_resistance ? 2 : 10), 10), /* lava damage */ 549. "sitting on lava", KILLED_BY); 550. } else if (is_ice(u.ux, u.uy)) { 551. You(sit_message, defsyms[S_ice].explanation); 552. if (!Cold_resistance) 553. pline_The("ice feels cold."); 554. } else if (typ == DRAWBRIDGE_DOWN) { 555. You(sit_message, "drawbridge"); 556. } else if (IS_THRONE(typ)) { 557. You(sit_message, defsyms[S_throne].explanation); 558. throne_sit_effect(); 559. } else if (lays_eggs(gy.youmonst.data)) { 560. return lay_an_egg(); 561. } else { 562. pline("Having fun sitting on the %s?", surface(u.ux, u.uy)); 563. } 564. return ECMD_TIME; 565. } 566. 567. /* curse a few inventory items at random! */ 568. void 569. rndcurse(void) 570. { 571. int nobj = 0; 572. int cnt, onum; 573. struct obj *otmp; 574. static const char mal_aura[] = "feel a malignant aura surround %s."; 575. 576. if (u_wield_art(ART_MAGICBANE) && rn2(20)) { 577. You(mal_aura, "the magic-absorbing blade"); 578. return; 579. } 580. 581. if (Antimagic) { 582. shieldeff(u.ux, u.uy); 583. } 584. 585. You(mal_aura, "you"); 586. 587. for (otmp = gi.invent; otmp; otmp = otmp->nobj) { 588. /* gold isn't subject to being cursed or blessed */ 589. if (otmp->oclass == COIN_CLASS) 590. continue; 591. nobj++; 592. } 593. cnt = rnd(6 / ((!!Antimagic) + (!!Half_spell_damage) + 1)); 594. if (nobj) { 595. for (; cnt > 0; cnt--) { 596. onum = rnd(nobj); 597. for (otmp = gi.invent; otmp; otmp = otmp->nobj) { 598. /* as above */ 599. if (otmp->oclass == COIN_CLASS) 600. continue; 601. if (--onum == 0) 602. break; /* found the target */ 603. } 604. /* the !otmp case should never happen; picking an already 605. cursed item happens--avoid "resists" message in that case */ 606. if (!otmp || otmp->cursed) 607. continue; /* next target */ 608. 609. if (otmp->oartifact && spec_ability(otmp, SPFX_INTEL) 610. && rn2(10) < 8) { 611. pline("%s!", Tobjnam(otmp, "resist")); 612. continue; 613. } 614. 615. if (otmp->blessed) 616. unbless(otmp); 617. else 618. curse(otmp); 619. } 620. update_inventory(); 621. } 622. 623. /* treat steed's saddle as extended part of hero's inventory */ 624. if (u.usteed && !rn2(4) && (otmp = which_armor(u.usteed, W_SADDLE)) != 0 625. && !otmp->cursed) { /* skip if already cursed */ 626. if (otmp->blessed) 627. unbless(otmp); 628. else 629. curse(otmp); 630. if (!Blind) { 631. pline("%s %s.", Yobjnam2(otmp, "glow"), 632. hcolor(otmp->cursed ? NH_BLACK : (const char *) "brown")); 633. otmp->bknown = Hallucination ? 0 : 1; /* bypass set_bknown() */ 634. } else { 635. otmp->bknown = 0; /* bypass set_bknown() */ 636. } 637. } 638. } 639. 640. /* remove a random INTRINSIC ability from hero. 641. returns the intrinsic property which was removed, 642. or 0 if nothing was removed. */ 643. int 644. attrcurse(void) 645. { 646. int ret = 0; 647. 648. switch (rnd(11)) { 649. case 1: 650. if (HFire_resistance & INTRINSIC) { 651. HFire_resistance &= ~INTRINSIC; 652. You_feel("warmer."); 653. ret = FIRE_RES; 654. break; 655. } 656. FALLTHROUGH; 657. /*FALLTHRU*/ 658. case 2: 659. if (HTeleportation & INTRINSIC) { 660. HTeleportation &= ~INTRINSIC; 661. You_feel("less jumpy."); 662. ret = TELEPORT; 663. break; 664. } 665. FALLTHROUGH; 666. /*FALLTHRU*/ 667. case 3: 668. if (HPoison_resistance & INTRINSIC) { 669. HPoison_resistance &= ~INTRINSIC; 670. You_feel("a little sick!"); 671. ret = POISON_RES; 672. break; 673. } 674. FALLTHROUGH; 675. /*FALLTHRU*/ 676. case 4: 677. if (HTelepat & INTRINSIC) { 678. HTelepat &= ~INTRINSIC; 679. if (Blind && !Blind_telepat) 680. see_monsters(); /* Can't sense mons anymore! */ 681. Your("senses fail!"); 682. ret = TELEPAT; 683. break; 684. } 685. FALLTHROUGH; 686. /*FALLTHRU*/ 687. case 5: 688. if (HCold_resistance & INTRINSIC) { 689. HCold_resistance &= ~INTRINSIC; 690. You_feel("cooler."); 691. ret = COLD_RES; 692. break; 693. } 694. FALLTHROUGH; 695. /*FALLTHRU*/ 696. case 6: 697. if (HInvis & INTRINSIC) { 698. HInvis &= ~INTRINSIC; 699. You_feel("paranoid."); 700. ret = INVIS; 701. break; 702. } 703. FALLTHROUGH; 704. /*FALLTHRU*/ 705. case 7: 706. if (HSee_invisible & INTRINSIC) { 707. HSee_invisible &= ~INTRINSIC; 708. if (!See_invisible) { 709. set_mimic_blocking(); 710. see_monsters(); 711. /* might not be able to see self anymore */ 712. newsym(u.ux, u.uy); 713. } 714. You("%s!", Hallucination ? "tawt you taw a puttie tat" 715. : "thought you saw something"); 716. ret = SEE_INVIS; 717. break; 718. } 719. FALLTHROUGH; 720. /*FALLTHRU*/ 721. case 8: 722. if (HFast & INTRINSIC) { 723. HFast &= ~INTRINSIC; 724. You_feel("slower."); 725. ret = FAST; 726. break; 727. } 728. FALLTHROUGH; 729. /*FALLTHRU*/ 730. case 9: 731. if (HStealth & INTRINSIC) { 732. HStealth &= ~INTRINSIC; 733. You_feel("clumsy."); 734. ret = STEALTH; 735. break; 736. } 737. FALLTHROUGH; 738. /*FALLTHRU*/ 739. case 10: 740. /* intrinsic protection is just disabled, not set back to 0 */ 741. if (HProtection & INTRINSIC) { 742. HProtection &= ~INTRINSIC; 743. You_feel("vulnerable."); 744. ret = PROTECTION; 745. break; 746. } 747. FALLTHROUGH; 748. /*FALLTHRU*/ 749. case 11: 750. if (HAggravate_monster & INTRINSIC) { 751. HAggravate_monster &= ~INTRINSIC; 752. You_feel("less attractive."); 753. ret = AGGRAVATE_MONSTER; 754. break; 755. } 756. FALLTHROUGH; 757. /*FALLTHRU*/ 758. default: 759. break; 760. } 761. return ret; 762. } 763. 764. /*sit.c*/