Skip to content

Commit 84851aa

Browse files
committed
Re-add regular bracers, minor bug fixes from initial Druid commit.
1 parent 40687f6 commit 84851aa

12 files changed

+447
-1600
lines changed

doc/evilhack-changelog.md

+2
Original file line numberDiff line numberDiff line change
@@ -3383,4 +3383,6 @@ The following changes to date are:
33833383
- Fix: prevent Nazgul from attacking undead hobbit types
33843384
- Fix: Monks incurring to-hit penalty when wearing bracers (martial arts)
33853385
- Fix: Kathryn the Enchantress and 'summon insects' spell
3386+
- Revert Druid role
3387+
- Re-add regular bracers, minor bug fixes from initial Druid commit
33863388

include/obj.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ struct obj {
270270
#define is_suit(otmp) \
271271
(otmp->oclass == ARMOR_CLASS && objects[otmp->otyp].oc_armcat == ARM_SUIT)
272272
#define is_bracer(otmp) \
273-
((otmp)->otyp == DARK_ELVEN_BRACERS)
273+
((otmp)->otyp == BRACERS || (otmp)->otyp == DARK_ELVEN_BRACERS)
274274
#define is_elven_armor(otmp) \
275275
((otmp)->otyp == ELVEN_HELM \
276276
|| (otmp)->otyp == ELVEN_CHAIN_MAIL || (otmp)->otyp == ELVEN_CLOAK \

src/apply.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -2195,7 +2195,7 @@ struct obj *obj;
21952195
break;
21962196
case 6:
21972197
if (Slow)
2198-
goto end; /* unicorn horns don't cure being slow */
2198+
goto end; /* unicorn horns don't cure being slow */
21992199
break;
22002200
case 7:
22012201
if (Deaf) /* make_deaf() won't give feedback when already deaf */

src/do_wear.c

+2
Original file line numberDiff line numberDiff line change
@@ -853,6 +853,7 @@ Shield_on(VOID_ARGS)
853853
switch (uarms->otyp) {
854854
case SMALL_SHIELD:
855855
case ELVEN_SHIELD:
856+
case BRACERS:
856857
case DARK_ELVEN_BRACERS:
857858
case URUK_HAI_SHIELD:
858859
case ORCISH_SHIELD:
@@ -889,6 +890,7 @@ Shield_off(VOID_ARGS)
889890
switch (otmp->otyp) {
890891
case SMALL_SHIELD:
891892
case ELVEN_SHIELD:
893+
case BRACERS:
892894
case DARK_ELVEN_BRACERS:
893895
case URUK_HAI_SHIELD:
894896
case ORCISH_SHIELD:

src/files.c

+6-1
Original file line numberDiff line numberDiff line change
@@ -2596,7 +2596,12 @@ char *origbuf;
25962596
(void) strncpy(catname, bufp, PL_PSIZ - 1);
25972597
} else if (match_varname(buf, "RATNAME", 3)) {
25982598
(void) strncpy(ratname, bufp, PL_PSIZ - 1);
2599-
2599+
} else if (match_varname(buf, "PSEUDONAME", 6)) {
2600+
(void) strncpy(pseudoname, bufp, PL_PSIZ - 1);
2601+
} else if (match_varname(buf, "HOMUNNAME", 5)) {
2602+
(void) strncpy(homunname, bufp, PL_PSIZ - 1);
2603+
} else if (match_varname(buf, "SPIDERNAME", 6)) {
2604+
(void) strncpy(spidername, bufp, PL_PSIZ - 1);
26002605
#ifdef SYSCF
26012606
} else if (src == SET_IN_SYS && match_varname(buf, "WIZARDS", 7)) {
26022607
if (sysopt.wizards)

src/mkobj.c

+15
Original file line numberDiff line numberDiff line change
@@ -3509,6 +3509,19 @@ static const struct icp sling_bullet_materials[] = {
35093509
{ 10, PLATINUM}
35103510
};
35113511

3512+
static const struct icp bracers_materials[] = {
3513+
{500, LEATHER},
3514+
{200, IRON},
3515+
{100, BONE},
3516+
{ 50, MINERAL},
3517+
{ 50, METAL},
3518+
{ 30, MITHRIL},
3519+
{ 20, SILVER},
3520+
{ 20, COPPER},
3521+
{ 20, GOLD},
3522+
{ 10, DRAGON_HIDE}
3523+
};
3524+
35123525
/* Return the appropriate above list for a given object, or NULL if there isn't
35133526
* an appropriate list. */
35143527
const struct icp*
@@ -3634,6 +3647,8 @@ struct obj* obj;
36343647
return rod_materials;
36353648
case SLING_BULLET:
36363649
return sling_bullet_materials;
3650+
case BRACERS:
3651+
return bracers_materials;
36373652
default:
36383653
break;
36393654
}

src/objects.c

+4-2
Original file line numberDiff line numberDiff line change
@@ -536,8 +536,6 @@ SHIELD("small shield", None,
536536
1, 0, 0, 0, 4, 0, 30, 3, 9, 0, WOOD, HI_WOOD),
537537
SHIELD("elven shield", "blue and green shield",
538538
0, 0, 0, 0, 2, 0, 40, 7, 8, 0, WOOD, CLR_GREEN),
539-
SHIELD("dark elven bracers", "etched bracers",
540-
0, 0, 0, 0, 1, 0, 25, 30, 8, 0, ADAMANTINE, CLR_BLACK),
541539
SHIELD("Uruk-hai shield", "white-handed shield",
542540
0, 0, 0, 0, 2, 0, 50, 7, 9, 0, IRON, HI_METAL),
543541
SHIELD("orcish shield", "red-eyed shield",
@@ -552,6 +550,10 @@ SHIELD("shield of light", "shiny shield",
552550
0, 1, 0, 0, 3, 0, 60, 400, 8, 0, GOLD, CLR_YELLOW),
553551
SHIELD("shield of mobility", "slippery shield",
554552
0, 1, 0, FREE_ACTION, 3, 0, 50, 300, 8, 0, METAL, HI_METAL),
553+
SHIELD("bracers", None,
554+
1, 0, 0, 0, 4, 0, 10, 10, 9, 0, LEATHER, CLR_BROWN),
555+
SHIELD("dark elven bracers", "etched bracers",
556+
0, 0, 0, 0, 1, 0, 20, 30, 8, 0, ADAMANTINE, CLR_BLACK),
555557

556558
/* gloves */
557559
/* These have their color but not material shuffled, so the IRON must

src/objnam.c

+9-5
Original file line numberDiff line numberDiff line change
@@ -609,7 +609,7 @@ struct obj *obj;
609609
* identification status */
610610
#define force_material_name(typ) \
611611
((typ) == ARMOR || (typ) == STUDDED_ARMOR \
612-
|| (typ) == JACKET || (typ) == CLOAK \
612+
|| (typ) == JACKET || (typ) == CLOAK || (typ) == BRACERS \
613613
|| ((typ) == GLOVES && objects[GLOVES].oc_name_known) \
614614
|| ((typ) == GAUNTLETS && objects[GAUNTLETS].oc_name_known))
615615

@@ -762,7 +762,7 @@ unsigned cxn_flags; /* bitmask of CXN_xxx values */
762762
}
763763

764764
if (is_boots(obj)
765-
|| typ == DARK_ELVEN_BRACERS
765+
|| is_bracer(obj)
766766
|| (is_gloves(obj) && typ != MUMMIFIED_HAND))
767767
Strcat(buf, "pair of ");
768768

@@ -778,13 +778,13 @@ unsigned cxn_flags; /* bitmask of CXN_xxx values */
778778
}
779779

780780
if (obj->otyp >= ELVEN_SHIELD && obj->otyp <= ORCISH_SHIELD
781-
&& obj->otyp != DARK_ELVEN_BRACERS && !dknown) {
781+
&& !is_bracer(obj) && !dknown) {
782782
Strcat(buf, "shield");
783783
propnames(buf, obj->oprops, obj->oprops_known,
784784
FALSE, FALSE);
785785
break;
786786
}
787-
if (obj->otyp == DARK_ELVEN_BRACERS && !dknown) {
787+
if (is_bracer(obj) && !dknown) {
788788
Strcat(buf, "bracers");
789789
propnames(buf, obj->oprops, obj->oprops_known,
790790
FALSE, FALSE);
@@ -812,6 +812,8 @@ unsigned cxn_flags; /* bitmask of CXN_xxx values */
812812
Strcat(buf, helm_simple_name(obj));
813813
else if (is_shield(obj))
814814
Strcat(buf, "shield");
815+
else if (is_bracer(obj))
816+
Strcat(buf, "bracers");
815817
else
816818
Strcat(buf, "armor");
817819
propnames(buf, obj->oprops, obj->oprops_known,
@@ -2612,7 +2614,7 @@ static struct sing_plur one_off[] = {
26122614
static const char *const as_is[] = {
26132615
/* makesingular() leaves these plural due to how they're used */
26142616
"boots", "shoes", "gloves", "lenses", "scales",
2615-
"eyes", "gauntlets", "iron bars", "goggles",
2617+
"eyes", "gauntlets", "iron bars", "goggles", "bracers",
26162618
/* both singular and plural are spelled the same */
26172619
"bison", "deer", "elk", "fish", "fowl",
26182620
"tuna", "yaki", "-hai", "krill", "manes",
@@ -3203,6 +3205,7 @@ STATIC_OVL NEARDATA const struct o_range o_ranges[] = {
32033205
{ "candle", TOOL_CLASS, TALLOW_CANDLE, WAX_CANDLE },
32043206
{ "horn", TOOL_CLASS, TOOLED_HORN, HORN_OF_PLENTY },
32053207
{ "shield", ARMOR_CLASS, SMALL_SHIELD, SHIELD_OF_MOBILITY },
3208+
{ "bracers", ARMOR_CLASS, BRACERS, DARK_ELVEN_BRACERS },
32063209
{ "hat", ARMOR_CLASS, DUNCE_CAP, FEDORA },
32073210
{ "helm", ARMOR_CLASS, DUNCE_CAP, HELM_OF_TELEPATHY },
32083211
{ "gloves", ARMOR_CLASS, GLOVES, MUMMIFIED_HAND },
@@ -3294,6 +3297,7 @@ static const struct alt_spellings {
32943297
{ "drow boots", DARK_ELVEN_BOOTS },
32953298
/* armor */
32963299
{ "gloves", GLOVES },
3300+
{ "bracers", BRACERS },
32973301
{ (const char *) 0, 0 },
32983302
};
32993303

src/options.c

-9
Original file line numberDiff line numberDiff line change
@@ -2398,15 +2398,6 @@ boolean tinitial, tfrom_file;
23982398
return retval;
23992399
}
24002400

2401-
fullname = "ratname";
2402-
if (match_optname(opts, fullname, 3, TRUE)) {
2403-
if (negated)
2404-
bad_negation(fullname, FALSE);
2405-
else if ((op = string_for_env_opt(fullname, opts, FALSE)) != 0)
2406-
nmcpy(ratname, op, PL_PSIZ);
2407-
return retval;
2408-
}
2409-
24102401
fullname = "number_pad";
24112402
if (match_optname(opts, fullname, 10, TRUE)) {
24122403
boolean compat = (strlen(opts) <= 10);

src/spell.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -2084,7 +2084,7 @@ int spell;
20842084
* player's role-specific spell. Metallic shields still adversely
20852085
* affect spellcasting, no matter how light they are.
20862086
*/
2087-
if (uarms && ((is_metallic(uarms) && uarms->otyp != DARK_ELVEN_BRACERS)
2087+
if (uarms && ((is_metallic(uarms) && !is_bracer(uarms))
20882088
|| (weight(uarms) > (int) objects[SMALL_SHIELD].oc_weight))) {
20892089
if (spellid(spell) == urole.spelspec) {
20902090
chance /= 2;

src/u_init.c

+7-4
Original file line numberDiff line numberDiff line change
@@ -1028,10 +1028,11 @@ u_init()
10281028
break;
10291029

10301030
case PM_TORTLE:
1031-
if (!rn2(4)
1032-
&& !Role_if(PM_ARCHEOLOGIST) && !Role_if(PM_ROGUE)) {
1033-
/* in case they want to go for a swim */
1034-
ini_inv(Oilskin);
1031+
if (!Role_if(PM_ARCHEOLOGIST) && !Role_if(PM_ROGUE)) {
1032+
if (!rn2(4)) {
1033+
/* in case they want to go for a swim */
1034+
ini_inv(Oilskin);
1035+
}
10351036
}
10361037
break;
10371038

@@ -1690,6 +1691,8 @@ register struct trobj *origtrop;
16901691
u.twoweap = FALSE;
16911692
} else if (is_helmet(obj) && !uarmh)
16921693
setworn(obj, W_ARMH);
1694+
else if (is_bracer(obj) && !uarms)
1695+
setworn(obj, W_ARMS);
16931696
else if (is_gloves(obj) && !uarmg)
16941697
setworn(obj, W_ARMG);
16951698
else if (is_shirt(obj) && !uarmu)

0 commit comments

Comments
 (0)