From 660832fae242a73dae1d219a3fee5f3fd86052e5 Mon Sep 17 00:00:00 2001 From: Erik Lunna Date: Fri, 13 Oct 2023 12:10:09 +0200 Subject: [PATCH] Removed the stun resistance property. On second thought, this is an ailment 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. --- include/obj.h | 9 ++++----- src/artifact.c | 2 -- src/do_wear.c | 8 ++++---- src/dungeon.c | 3 ++- src/objnam.c | 14 +++++++------- src/pager.c | 2 +- src/wield.c | 16 ++++++++-------- src/worn.c | 6 +++--- 8 files changed, 29 insertions(+), 31 deletions(-) diff --git a/include/obj.h b/include/obj.h index b399821bb..1d42b7e6f 100644 --- a/include/obj.h +++ b/include/obj.h @@ -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 */ @@ -631,8 +631,7 @@ 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 \ @@ -640,9 +639,9 @@ struct obj { | 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) /* diff --git a/src/artifact.c b/src/artifact.c index 4065051cc..fd832ec25 100644 --- a/src/artifact.c +++ b/src/artifact.c @@ -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; } diff --git a/src/do_wear.c b/src/do_wear.c index efe6dd15d..53d2af53c 100644 --- a/src/do_wear.c +++ b/src/do_wear.c @@ -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) { @@ -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) diff --git a/src/dungeon.c b/src/dungeon.c index 6bca5fee8..b45a44a1a 100644 --- a/src/dungeon.c +++ b/src/dungeon.c @@ -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) */ diff --git a/src/objnam.c b/src/objnam.c index 0a9e24b2a..5822c4c52 100644 --- a/src/objnam.c +++ b/src/objnam.c @@ -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"); } } @@ -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) @@ -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) diff --git a/src/pager.c b/src/pager.c index 452ebb770..accd71db4 100644 --- a/src/pager.c +++ b/src/pager.c @@ -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"); diff --git a/src/wield.c b/src/wield.c index ece559f8c..779a4596f 100644 --- a/src/wield.c +++ b/src/wield.c @@ -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; @@ -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; @@ -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) { @@ -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; diff --git a/src/worn.c b/src/worn.c index 8b75d148e..6fab8f75a 100644 --- a/src/worn.c +++ b/src/worn.c @@ -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 }, @@ -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))