Skip to content

Commit 29c3347

Browse files
authored
Merge pull request #178 from k21971/random-stuff
Random stuff
2 parents 1ae6efd + 5216243 commit 29c3347

File tree

6 files changed

+61
-17
lines changed

6 files changed

+61
-17
lines changed

doc/evilhack-changelog.md

+5
Original file line numberDiff line numberDiff line change
@@ -3497,3 +3497,8 @@ The following changes to date are:
34973497
- Fix: Infidel Draugr kept getting fire resistance back after
34983498
save/reload
34993499
- Fix: Enchanting armor of excellence didn't adjust charisma
3500+
- Fix: tty character selection filtering menu
3501+
- Fix: drawbridges crush both rider and steed
3502+
- Fix: stethoscopes shouldn't open chests
3503+
- Fix: blunt weptools had +4 TH bonus
3504+
- Count corpses left by zombies for draugr same-race sacrifice

src/dbridge.c

+13-2
Original file line numberDiff line numberDiff line change
@@ -505,16 +505,27 @@ int xkill_flags, how;
505505
} else {
506506
int entitycnt;
507507

508+
struct monst *steed = 0;
509+
if (has_erid(etmp->emon))
510+
steed = ERID(etmp->emon)->mon_steed;
511+
508512
killer.name[0] = 0;
509513
/* fake "digested to death" damage-type suppresses corpse */
510514
#define mk_message(dest) (((dest & XKILL_NOMSG) != 0) ? (char *) 0 : "")
511515
#define mk_corpse(dest) (((dest & XKILL_NOCORPSE) != 0) ? AD_DGST : AD_PHYS)
512516
/* if monsters are moving, one of them caused the destruction */
513-
if (context.mon_moving)
517+
if (context.mon_moving) {
514518
monkilled(etmp->emon,
515519
mk_message(xkill_flags), mk_corpse(xkill_flags));
516-
else /* you caused it */
520+
if (steed)
521+
monkilled(steed,
522+
mk_message(xkill_flags), mk_corpse(xkill_flags));
523+
}
524+
else { /* you caused it */
517525
xkilled(etmp->emon, xkill_flags);
526+
if (steed)
527+
xkilled(steed, xkill_flags);
528+
}
518529
etmp->edata = (struct permonst *) 0;
519530

520531
/* dead long worm handling */

src/lock.c

+6
Original file line numberDiff line numberDiff line change
@@ -568,6 +568,12 @@ struct obj *container; /* container, for autounlock */
568568
}
569569
}
570570

571+
/* stethoscopes only work on safes */
572+
if (picktyp == STETHOSCOPE && otmp->otyp != IRON_SAFE) {
573+
You("cannot open such a container with a stethoscope.");
574+
return PICKLOCK_LEARNED_SOMETHING;
575+
}
576+
571577
/* crystal chest can only be opened by artifacts */
572578
if (otmp->otyp == CRYSTAL_CHEST && !pick->oartifact) {
573579
You_cant("%s %ssuch a container with a mundane %s.",

src/objects.c

+5-5
Original file line numberDiff line numberDiff line change
@@ -729,9 +729,9 @@ OBJECT(OBJ("Amulet of Yendor", /* note: description == name */
729729
OBJECT(OBJ(name, desc), \
730730
BITS(kn, 0, chg, 1, mgc, chg, 0, 0, 0, 0, 0, P_NONE, mat), \
731731
0, TOOL_CLASS, prob, 0, wt, cost, 0, 0, 0, 0, wt, color)
732-
#define WEPTOOL(name,desc,kn,mgc,bi,prob,wt,cost,sdam,ldam,hitbon,sub,mat,clr) \
732+
#define WEPTOOL(name,desc,kn,mgc,bi,prob,wt,cost,sdam,ldam,hitbon,typ,sub,mat,clr) \
733733
OBJECT(OBJ(name, desc), \
734-
BITS(kn, 0, 1, 0, mgc, 1, 0, 0, bi, 0, hitbon, sub, mat), \
734+
BITS(kn, 0, 1, 0, mgc, 1, 0, 0, bi, 0, typ, sub, mat), \
735735
0, TOOL_CLASS, prob, 0, wt, cost, sdam, ldam, hitbon, 0, wt, clr)
736736
/* containers */
737737
CONTAINER("large box", None, 1, 0, 0, 40, 350, 8, WOOD, HI_WOOD),
@@ -813,11 +813,11 @@ TOOL("leather drum", "drum", 0, 0, 0, 0, 4, 25, 25, LEATHER, HI_LEATHER
813813
TOOL("drum of earthquake","drum", 0, 0, 1, 1, 2, 25, 25, LEATHER, HI_LEATHER),
814814
/* tools useful as weapons */
815815
WEPTOOL("pick-axe", None,
816-
1, 0, 0, 20, 100, 50, 6, 3, WHACK, P_PICK_AXE, IRON, HI_METAL),
816+
1, 0, 0, 20, 100, 50, 6, 3, 0, WHACK, P_PICK_AXE, IRON, HI_METAL),
817817
WEPTOOL("grappling hook", "iron hook",
818-
0, 0, 0, 5, 30, 50, 2, 6, WHACK, P_FLAIL, IRON, HI_METAL),
818+
0, 0, 0, 5, 30, 50, 2, 6, 0, WHACK, P_FLAIL, IRON, HI_METAL),
819819
WEPTOOL("unicorn horn", None,
820-
1, 1, 0, 0, 20, 100, 8, 10, PIERCE, P_UNICORN_HORN, BONE, CLR_WHITE),
820+
1, 1, 0, 0, 20, 100, 8, 10, 1, PIERCE, P_UNICORN_HORN, BONE, CLR_WHITE),
821821
/* 3.4.1: unicorn horn left classified as "magic" */
822822
/* two unique tools;
823823
* not artifacts, despite the comment which used to be here

src/pray.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -1743,7 +1743,8 @@ dosacrifice()
17431743

17441744
if (your_race(ptr)
17451745
|| (Race_if(PM_ELF) && is_drow(ptr))
1746-
|| (Race_if(PM_DROW) && is_elf(ptr))) {
1746+
|| (Race_if(PM_DROW) && is_elf(ptr))
1747+
|| (Race_if(PM_DRAUGR) && otmp->zombie_corpse)) {
17471748
if (is_demon(raceptr(&youmonst))) {
17481749
You("find the idea very satisfying.");
17491750
exercise(A_WIS, TRUE);

win/tty/wintty.c

+30-9
Original file line numberDiff line numberDiff line change
@@ -1173,13 +1173,32 @@ int role, gend, algn;
11731173
high_ch = 0;
11741174
}
11751175

1176-
/* filtering: picking race, so choose by first letter, with
1177-
capital letter as unseen accelerator;
1178-
!filtering: resetting filter rather than picking, choose by
1179-
capital letter since lowercase role letters will be present */
1180-
add_menu(win, NO_GLYPH, &any,
1181-
filtering ? this_ch : high_ch,
1182-
filtering ? high_ch : 0,
1176+
/* modify some this_chs when filtering to avoid conflict with roles */
1177+
if (!filtering) {
1178+
if (!strcmp(races[i].noun, "human")) {
1179+
/* healer/Hobbit are taken. 'uman? */
1180+
this_ch = 'u';
1181+
high_ch = 0;
1182+
} else if (!strcmp(races[i].noun, "illithid")) {
1183+
/* infidel is taken */
1184+
this_ch = 'I';
1185+
high_ch = 0;
1186+
} else if (!strcmp(races[i].noun, "tortle")) {
1187+
/* tourist is taken */
1188+
this_ch = 'T';
1189+
high_ch = 0;
1190+
} else if (!strcmp(races[i].noun, "centaur")) {
1191+
/* cavefolk/Convict are taken. they have 4 legs? */
1192+
this_ch = '4';
1193+
high_ch = 0;
1194+
} else if (!strcmp(races[i].noun, "dwarf")) {
1195+
/* druid/Drow are taken. Urist? */
1196+
this_ch = 'U';
1197+
high_ch = 0;
1198+
}
1199+
}
1200+
1201+
add_menu(win, NO_GLYPH, &any, this_ch, high_ch,
11831202
ATR_NONE, races[i].noun,
11841203
(!filtering && !race_ok) ? MENU_SELECTED : MENU_UNSELECTED);
11851204
}
@@ -1228,7 +1247,7 @@ int role, race, gend;
12281247
anything any;
12291248
boolean algn_ok;
12301249
int i;
1231-
char this_ch;
1250+
char this_ch, alt_ch;
12321251

12331252
any = zeroany;
12341253
for (i = 0; i < ROLE_ALIGNS; i++) {
@@ -1243,10 +1262,12 @@ int role, race, gend;
12431262
else
12441263
any.a_string = aligns[i].adj;
12451264
this_ch = *aligns[i].adj;
1265+
/* alternate characters to avoid conflict with races/roles */
1266+
alt_ch = (i == 0) ? '+' : (i == 1) ? '=' : '-';
12461267
/* (see setup_racemenu for explanation of selector letters
12471268
and setup_rolemenu for preselection) */
12481269
add_menu(win, NO_GLYPH, &any,
1249-
filtering ? this_ch : highc(this_ch),
1270+
filtering ? this_ch : alt_ch,
12501271
filtering ? highc(this_ch) : 0,
12511272
ATR_NONE, aligns[i].adj,
12521273
(!filtering && !algn_ok) ? MENU_SELECTED : MENU_UNSELECTED);

0 commit comments

Comments
 (0)