MCPcopy Create free account
hub / github.com/NetHack/NetHack / attrcurse

Function attrcurse

src/sit.c:643–762  ·  view source on GitHub ↗

remove a random INTRINSIC ability from hero. returns the intrinsic property which was removed, or 0 if nothing was removed. */

Source from the content-addressed store, hash-verified

641 returns the intrinsic property which was removed,
642 or 0 if nothing was removed. */
643int
644attrcurse(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;

Callers 4

special_throne_effectFunction · 0.85
mhitm_ad_cursFunction · 0.85
angrygodsFunction · 0.85
cpostfxFunction · 0.85

Calls 7

rndFunction · 0.85
You_feelFunction · 0.85
see_monstersFunction · 0.85
YourFunction · 0.85
set_mimic_blockingFunction · 0.85
newsymFunction · 0.85
YouFunction · 0.85

Tested by

no test coverage detected