From 5d3a1e684bed7a7d622a2a1ad72d466e94c169d3 Mon Sep 17 00:00:00 2001 From: Alex Smith Date: Wed, 18 Mar 2026 22:16:22 +0000 Subject: [PATCH] Add shields of shock resistance and of drain resistance These both appear as "wooden shield" when unidentified; so does the small shield. --- doc/fixes3-7-0.txt | 1 + include/objects.h | 14 ++++++++++---- include/patchlevel.h | 2 +- src/do_wear.c | 6 +++++- src/u_init.c | 6 ++++-- win/share/objects.txt | 40 +++++++++++++++++++++++++++++++++++++++- 6 files changed, 60 insertions(+), 9 deletions(-) diff --git a/doc/fixes3-7-0.txt b/doc/fixes3-7-0.txt index 431a7e113..82df2aec0 100644 --- a/doc/fixes3-7-0.txt +++ b/doc/fixes3-7-0.txt @@ -2904,6 +2904,7 @@ ring of stealth prevents hero from leaving tracks the game now automatically tracks which sell prices and buy prices you have seen for each type of item; these are visible in the discoveries list, and can also be shown elsewhere using the new 'price_quotes' option +new shields: shield of shock resistance, shield of drain resistance Platform- and/or Interface-Specific New Features diff --git a/include/objects.h b/include/objects.h index 0de88dbba..932d063f6 100644 --- a/include/objects.h +++ b/include/objects.h @@ -650,9 +650,15 @@ CLOAK("cloak of displacement", "piece of cloth", CLOAK_OF_DISPLACEMENT), /* shields */ -SHIELD("small shield", NoDes, - 1, 0, 0, 0, 6, 0, 30, 3, 9, 0, WOOD, HI_WOOD, +SHIELD("small shield", "wooden shield", + 0, 0, 0, 0, 4, 0, 30, 3, 9, 0, WOOD, HI_WOOD, SMALL_SHIELD), +SHIELD("shield of drain resistance", "wooden shield", + 0, 1, 0, DRAIN_RES, 3, 0, 30, 50, 9, 0, WOOD, HI_WOOD, + SHIELD_OF_DRAIN_RESISTANCE), +SHIELD("shield of shock resistance", "wooden shield", + 0, 1, 0, SHOCK_RES, 3, 0, 30, 50, 9, 0, WOOD, HI_WOOD, + SHIELD_OF_SHOCK_RESISTANCE), SHIELD("elven shield", "blue and green shield", 0, 0, 0, 0, 2, 0, 40, 7, 8, 0, WOOD, CLR_GREEN, ELVEN_SHIELD), @@ -663,10 +669,10 @@ SHIELD("orcish shield", "red-eyed shield", 0, 0, 0, 0, 2, 0, 50, 7, 9, 0, IRON, CLR_RED, ORCISH_SHIELD), SHIELD("large shield", NoDes, - 1, 0, 1, 0, 7, 0, 100, 10, 8, 0, IRON, HI_METAL, + 1, 0, 1, 0, 4, 0, 100, 10, 8, 0, IRON, HI_METAL, LARGE_SHIELD), SHIELD("dwarvish roundshield", "large round shield", - 0, 0, 0, 0, 4, 0, 100, 10, 8, 0, IRON, HI_METAL, + 0, 0, 0, 0, 3, 0, 100, 10, 8, 0, IRON, HI_METAL, DWARVISH_ROUNDSHIELD), SHIELD("shield of reflection", "polished silver shield", 0, 1, 0, REFLECTING, 3, 0, 50, 50, 8, 0, SILVER, HI_SILVER, diff --git a/include/patchlevel.h b/include/patchlevel.h index 64ff46ee3..0d814189e 100644 --- a/include/patchlevel.h +++ b/include/patchlevel.h @@ -17,7 +17,7 @@ * Incrementing EDITLEVEL can be used to force invalidation of old bones * and save files. */ -#define EDITLEVEL 133 +#define EDITLEVEL 134 /* * Development status possibilities. diff --git a/src/do_wear.c b/src/do_wear.c index 025b097ef..382b17741 100644 --- a/src/do_wear.c +++ b/src/do_wear.c @@ -706,10 +706,12 @@ Shield_on(void) { /* no shield currently requires special handling when put on, but we keep this uncommented in case somebody adds a new one which does - [reflection is handled by setting u.uprops[REFLECTION].extrinsic + [the magical shields are handled by setting u.uprops[*].extrinsic in setworn() called by armor_or_accessory_on() before Shield_on()] */ switch (uarms->otyp) { case SMALL_SHIELD: + case SHIELD_OF_DRAIN_RESISTANCE: + case SHIELD_OF_SHOCK_RESISTANCE: case ELVEN_SHIELD: case URUK_HAI_SHIELD: case ORCISH_SHIELD: @@ -736,6 +738,8 @@ Shield_off(void) keep this uncommented in case somebody adds a new one which does */ switch (uarms->otyp) { case SMALL_SHIELD: + case SHIELD_OF_DRAIN_RESISTANCE: + case SHIELD_OF_SHOCK_RESISTANCE: case ELVEN_SHIELD: case URUK_HAI_SHIELD: case ORCISH_SHIELD: diff --git a/src/u_init.c b/src/u_init.c index 9c37508c0..dcf3e4077 100644 --- a/src/u_init.c +++ b/src/u_init.c @@ -603,8 +603,10 @@ knows_class(char sym) */ for (ct = svb.bases[(uchar) sym]; ct < svb.bases[(uchar) sym + 1]; ct++) { - /* not flagged as magic but shouldn't be pre-discovered */ - if (ct == CORNUTHAUM || ct == DUNCE_CAP) + /* not flagged as magic but shouldn't be pre-discovered + (small shields look the same as two types of magical shield; + cornuthaum / dunce cap look the same as each other) */ + if (ct == CORNUTHAUM || ct == DUNCE_CAP || ct == SMALL_SHIELD) continue; if (sym == WEAPON_CLASS) { odummy.otyp = ct; /* update 'o' */ diff --git a/win/share/objects.txt b/win/share/objects.txt index 9c1a3e736..64a53c16a 100644 --- a/win/share/objects.txt +++ b/win/share/objects.txt @@ -2938,7 +2938,45 @@ Z = (195, 195, 195) .....PPPPPAA.... .......PPAA..... } -# tile 152 (small shield) +# tile 152 (wooden shield / small shield) +{ + ................ + ................ + ................ + ................ + ................ + ...C.CJJ.J...... + ...CCKKJJJA..... + ...CKKKJJJA..... + ...CKKJJJJA..... + ...CKKJJJJA..... + ....CKKJJAA..... + .....CKJAA...... + ......CAA....... + .......A........ + ................ + ................ +} +# tile 152 (wooden shield / shield of drain resistance) +{ + ................ + ................ + ................ + ................ + ................ + ...C.CJJ.J...... + ...CCKKJJJA..... + ...CKKKJJJA..... + ...CKKJJJJA..... + ...CKKJJJJA..... + ....CKKJJAA..... + .....CKJAA...... + ......CAA....... + .......A........ + ................ + ................ +} +# tile 152 (wooden shield / shield of shock resistance) { ................ ................