Skip to content

Commit

Permalink
Removed the stun resistance property. On second thought, this is an a…
Browse files Browse the repository at this point in the history
…ilment better left alone - the shimmering dragon scales can take care of it. I've replaced it with the danger property, which acts like the amulet of danger - granting infravision and increased monster difficulty.
  • Loading branch information
elunna committed Oct 13, 2023
1 parent 954132d commit 660832f
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 31 deletions.
9 changes: 4 additions & 5 deletions include/obj.h
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,7 @@ struct obj {
#define ITEM_SLOW 0x04000000L /* slowness */
#define ITEM_SUSTAIN 0x08000000L /* sustain ability,
* items retain their enchantment level */
#define ITEM_STUN 0x10000000L /* stun resistance */
#define ITEM_DANGER 0x10000000L /* infravision + increased difficulty */
#define ITEM_BURDEN 0x20000000L /* stability, but item weighs more */

#define ITEM_MAGICAL 0x80000000L /* known to have magical properties */
Expand All @@ -631,18 +631,17 @@ struct obj {
/* Properties that grant both a worn resistance and attack type */
#define ITEM_RES_PROPS (ITEM_FIRE | ITEM_FROST | ITEM_SHOCK | ITEM_VENOM \
| ITEM_SIZZLE | ITEM_SCREAM | ITEM_DECAY \
| ITEM_SLEEP | ITEM_FLEX | ITEM_FILTH \
| ITEM_STUN)
| ITEM_SLEEP | ITEM_FLEX | ITEM_FILTH)
/* Positive properties */
#define ITEM_GOOD_PROPS (ITEM_OILSKIN | ITEM_ESP | ITEM_SEARCH \
| ITEM_VIGIL | ITEM_EXCEL | ITEM_SUSTAIN \
| ITEM_STEALTH | ITEM_INSIGHT | ITEM_BURDEN \
| ITEM_SURF | ITEM_SWIM | ITEM_RAGE | ITEM_TOUGH)
/* Negative properties */
#define ITEM_BAD_PROPS (ITEM_FUMBLE | ITEM_HUNGER | ITEM_STENCH \
| ITEM_TELE | ITEM_SLOW)
| ITEM_TELE | ITEM_SLOW | ITEM_DANGER)

#define NON_WEP_PROPS (ITEM_FLEX | ITEM_STUN)
#define NON_WEP_PROPS (ITEM_FLEX)
#define ONLY_WEP_PROPS (ITEM_RAGE | ITEM_PROWESS)

/*
Expand Down
2 changes: 0 additions & 2 deletions src/artifact.c
Original file line number Diff line number Diff line change
Expand Up @@ -772,8 +772,6 @@ struct obj *otmp;
return TRUE;
if (adtyp == AD_DISE && (otmp->oprops & ITEM_FILTH))
return TRUE;
if (adtyp == AD_STUN && (otmp->oprops & ITEM_STUN))
return TRUE;
}
return FALSE;
}
Expand Down
8 changes: 4 additions & 4 deletions src/do_wear.c
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,8 @@ long mask;
EStone_resistance |= mask;
if (props & ITEM_FILTH)
ESick_resistance |= mask;
if (props & ITEM_STUN)
EStun_resistance |= mask;
if (props & ITEM_DANGER)
EInfravision |= mask;
if (props & ITEM_RAGE) {
EFearless |= mask;
if (Afraid) {
Expand Down Expand Up @@ -344,8 +344,8 @@ long mask;
EStone_resistance &= ~mask;
if (props & ITEM_FILTH)
ESick_resistance &= ~mask;
if (props & ITEM_STUN)
EStun_resistance &= ~mask;
if (props & ITEM_DANGER)
EInfravision &= ~mask;
if (props & ITEM_RAGE)
EFearless &= ~mask;
if (props & ITEM_TOUGH)
Expand Down
3 changes: 2 additions & 1 deletion src/dungeon.c
Original file line number Diff line number Diff line change
Expand Up @@ -1678,7 +1678,8 @@ level_difficulty()
*/
#endif /*0*/
}
if (uamul && uamul->otyp == AMULET_OF_DANGER) {
if ((uamul && uamul->otyp == AMULET_OF_DANGER)
|| using_oprop(ITEM_DANGER)) {
res += 15;
}
/* Wishes increase difficulty (unless fuzzing) */
Expand Down
14 changes: 7 additions & 7 deletions src/objnam.c
Original file line number Diff line number Diff line change
Expand Up @@ -590,10 +590,10 @@ boolean has_of;
Strcpy(of, " and");
}
}
if (props & ITEM_STUN) {
if ((props_known & ITEM_STUN) || dump_prop_flag) {
if (props & ITEM_DANGER) {
if ((props_known & ITEM_DANGER) || dump_prop_flag) {
Strcat(buf, of),
Strcat(buf, of), Strcat(buf, " stun resistance"),
Strcat(buf, of), Strcat(buf, " danger"),
Strcpy(of, " and");
}
}
Expand Down Expand Up @@ -4319,9 +4319,9 @@ struct obj *no_wish;
if (!objpropcount || wizard)
objprops |= ITEM_FILTH;
objpropcount++;
} else if (!strncmpi((p + of), "stun", l = strlen("stun"))) {
} else if (!strncmpi((p + of), "danger", l = strlen("danger"))) {
if (!objpropcount || wizard)
objprops |= ITEM_STUN;
objprops |= ITEM_DANGER;
objpropcount++;
} else if (!strncmpi((p + of), "rage", l = strlen("rage"))) {
if (!objpropcount || wizard)
Expand Down Expand Up @@ -5400,8 +5400,8 @@ struct obj *no_wish;
objprops &= ~(ITEM_RES_PROPS & ~ITEM_FLEX);
else if (objprops & ITEM_FILTH)
objprops &= ~(ITEM_RES_PROPS & ~ITEM_FILTH);
else if (objprops & ITEM_STUN)
objprops &= ~(ITEM_RES_PROPS & ~ITEM_STUN);
else if (objprops & ITEM_DANGER)
objprops &= ~(ITEM_RES_PROPS & ~ITEM_DANGER);
else if (objprops & ITEM_RAGE)
objprops &= ~(ITEM_RES_PROPS & ~ITEM_RAGE);
else if (objprops & ITEM_TOUGH)
Expand Down
2 changes: 1 addition & 1 deletion src/pager.c
Original file line number Diff line number Diff line change
Expand Up @@ -1291,7 +1291,7 @@ char *usr_text;
if (obj->oprops & ITEM_SLEEP) OBJPUTSTR("Grants sleep resistance");
if (obj->oprops & ITEM_FLEX) OBJPUTSTR("Grants petrification resistance");
if (obj->oprops & ITEM_FILTH) OBJPUTSTR("Grants sickness resistance");
if (obj->oprops & ITEM_STUN) OBJPUTSTR("Grants stun resistance");
if (obj->oprops & ITEM_DANGER) OBJPUTSTR("Grants infravision with increased difficulty");
if (obj->oprops & ITEM_RAGE) OBJPUTSTR("Grants rage and fearlessness");
if (obj->oprops & ITEM_PROWESS) OBJPUTSTR("Grants prowess in technical skills");
if (obj->oprops & ITEM_TOUGH) OBJPUTSTR("Grants disintegration resistance, indestructible item");
Expand Down
16 changes: 8 additions & 8 deletions src/wield.c
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,8 @@ register struct obj *obj;
if (olduwep->oprops & ITEM_FLEX) {
EStone_resistance &= ~W_WEP;
}
if (olduwep->oprops & ITEM_STUN) {
EStun_resistance &= ~W_WEP;
if (olduwep->oprops & ITEM_DANGER) {
EInfravision &= ~W_WEP;
}
if (olduwep->oprops & ITEM_RAGE) {
EFearless &= ~W_WEP;
Expand Down Expand Up @@ -276,8 +276,8 @@ register struct obj *obj;
if (uwep->oprops & ITEM_FLEX) {
EStone_resistance |= W_WEP;
}
if (uwep->oprops & ITEM_STUN) {
EStun_resistance |= W_WEP;
if (uwep->oprops & ITEM_DANGER) {
EInfravision |= W_WEP;
}
if (uwep->oprops & ITEM_RAGE) {
EFearless |= W_WEP;
Expand Down Expand Up @@ -569,8 +569,8 @@ register struct obj *obj;
EStone_resistance &= ~W_SWAPWEP;
}
/* Stun resistance */
if (olduswapwep->oprops & ITEM_STUN) {
EStun_resistance &= ~W_SWAPWEP;
if (olduswapwep->oprops & ITEM_DANGER) {
EInfravision &= ~W_SWAPWEP;
}
/* Fearlessness */
if (olduswapwep->oprops & ITEM_RAGE) {
Expand Down Expand Up @@ -655,8 +655,8 @@ register struct obj *obj;
if (uswapwep->oprops & ITEM_FLEX) {
EStone_resistance |= W_SWAPWEP;
}
if (uswapwep->oprops & ITEM_STUN) {
EStun_resistance |= W_SWAPWEP;
if (uswapwep->oprops & ITEM_DANGER) {
EInfravision |= W_SWAPWEP;
}
if (uswapwep->oprops & ITEM_RAGE) {
EFearless |= W_SWAPWEP;
Expand Down
6 changes: 3 additions & 3 deletions src/worn.c
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ const struct PropTypes prop_lookup[NUM_PROPERTIES] = {
{ SLEEP_RES, ITEM_SLEEP },
{ STONE_RES, ITEM_FLEX },
{ SICK_RES, ITEM_FILTH },
{ STUN_RES, ITEM_STUN },
{ INFRAVISION, ITEM_DANGER },
{ FEARLESS, ITEM_RAGE },
{ TELEPAT, ITEM_ESP },
{ FUMBLING, ITEM_FUMBLE },
Expand Down Expand Up @@ -646,9 +646,9 @@ boolean on, silently;
if (obj->oclass != WEAPON_CLASS && !is_weptool(obj))
which = STONE_RES;
break;
case ITEM_STUN:
case ITEM_DANGER:
if (obj->oclass != WEAPON_CLASS && !is_weptool(obj))
which = STUN_RES;
which = INFRAVISION;
break;
case ITEM_RAGE:
if (obj->oclass != WEAPON_CLASS && !is_weptool(obj))
Expand Down

0 comments on commit 660832f

Please sign in to comment.