Give gremlin the property it stole, if possible

This commit is contained in:
Pasi Kallinen
2023-01-25 21:55:11 +02:00
parent 1b8edf852f
commit d19c92281a
6 changed files with 80 additions and 54 deletions
+18 -2
View File
@@ -447,15 +447,20 @@ rndcurse(void)
}
}
/* remove a random INTRINSIC ability */
void
/* remove a random INTRINSIC ability from hero.
returns the intrinsic property which was removed,
or 0 if nothing was removed. */
int
attrcurse(void)
{
int ret = 0;
switch (rnd(11)) {
case 1:
if (HFire_resistance & INTRINSIC) {
HFire_resistance &= ~INTRINSIC;
You_feel("warmer.");
ret = FIRE_RES;
break;
}
/*FALLTHRU*/
@@ -463,6 +468,7 @@ attrcurse(void)
if (HTeleportation & INTRINSIC) {
HTeleportation &= ~INTRINSIC;
You_feel("less jumpy.");
ret = TELEPORT;
break;
}
/*FALLTHRU*/
@@ -470,6 +476,7 @@ attrcurse(void)
if (HPoison_resistance & INTRINSIC) {
HPoison_resistance &= ~INTRINSIC;
You_feel("a little sick!");
ret = POISON_RES;
break;
}
/*FALLTHRU*/
@@ -479,6 +486,7 @@ attrcurse(void)
if (Blind && !Blind_telepat)
see_monsters(); /* Can't sense mons anymore! */
Your("senses fail!");
ret = TELEPAT;
break;
}
/*FALLTHRU*/
@@ -486,6 +494,7 @@ attrcurse(void)
if (HCold_resistance & INTRINSIC) {
HCold_resistance &= ~INTRINSIC;
You_feel("cooler.");
ret = COLD_RES;
break;
}
/*FALLTHRU*/
@@ -493,6 +502,7 @@ attrcurse(void)
if (HInvis & INTRINSIC) {
HInvis &= ~INTRINSIC;
You_feel("paranoid.");
ret = INVIS;
break;
}
/*FALLTHRU*/
@@ -507,6 +517,7 @@ attrcurse(void)
}
You("%s!", Hallucination ? "tawt you taw a puttie tat"
: "thought you saw something");
ret = SEE_INVIS;
break;
}
/*FALLTHRU*/
@@ -514,6 +525,7 @@ attrcurse(void)
if (HFast & INTRINSIC) {
HFast &= ~INTRINSIC;
You_feel("slower.");
ret = FAST;
break;
}
/*FALLTHRU*/
@@ -521,6 +533,7 @@ attrcurse(void)
if (HStealth & INTRINSIC) {
HStealth &= ~INTRINSIC;
You_feel("clumsy.");
ret = STEALTH;
break;
}
/*FALLTHRU*/
@@ -529,6 +542,7 @@ attrcurse(void)
if (HProtection & INTRINSIC) {
HProtection &= ~INTRINSIC;
You_feel("vulnerable.");
ret = PROTECTION;
break;
}
/*FALLTHRU*/
@@ -536,12 +550,14 @@ attrcurse(void)
if (HAggravate_monster & INTRINSIC) {
HAggravate_monster &= ~INTRINSIC;
You_feel("less attractive.");
ret = AGGRAVATE_MONSTER;
break;
}
/*FALLTHRU*/
default:
break;
}
return ret;
}
/*sit.c*/