Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Random stuff #178

Merged
merged 5 commits into from
Jun 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions doc/evilhack-changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3497,3 +3497,8 @@ The following changes to date are:
- Fix: Infidel Draugr kept getting fire resistance back after
save/reload
- Fix: Enchanting armor of excellence didn't adjust charisma
- Fix: tty character selection filtering menu
- Fix: drawbridges crush both rider and steed
- Fix: stethoscopes shouldn't open chests
- Fix: blunt weptools had +4 TH bonus
- Count corpses left by zombies for draugr same-race sacrifice
15 changes: 13 additions & 2 deletions src/dbridge.c
Original file line number Diff line number Diff line change
Expand Up @@ -505,16 +505,27 @@ int xkill_flags, how;
} else {
int entitycnt;

struct monst *steed = 0;
if (has_erid(etmp->emon))
steed = ERID(etmp->emon)->mon_steed;

killer.name[0] = 0;
/* fake "digested to death" damage-type suppresses corpse */
#define mk_message(dest) (((dest & XKILL_NOMSG) != 0) ? (char *) 0 : "")
#define mk_corpse(dest) (((dest & XKILL_NOCORPSE) != 0) ? AD_DGST : AD_PHYS)
/* if monsters are moving, one of them caused the destruction */
if (context.mon_moving)
if (context.mon_moving) {
monkilled(etmp->emon,
mk_message(xkill_flags), mk_corpse(xkill_flags));
else /* you caused it */
if (steed)
monkilled(steed,
mk_message(xkill_flags), mk_corpse(xkill_flags));
}
else { /* you caused it */
xkilled(etmp->emon, xkill_flags);
if (steed)
xkilled(steed, xkill_flags);
}
etmp->edata = (struct permonst *) 0;

/* dead long worm handling */
Expand Down
6 changes: 6 additions & 0 deletions src/lock.c
Original file line number Diff line number Diff line change
Expand Up @@ -568,6 +568,12 @@ struct obj *container; /* container, for autounlock */
}
}

/* stethoscopes only work on safes */
if (picktyp == STETHOSCOPE && otmp->otyp != IRON_SAFE) {
You("cannot open such a container with a stethoscope.");
return PICKLOCK_LEARNED_SOMETHING;
}

/* crystal chest can only be opened by artifacts */
if (otmp->otyp == CRYSTAL_CHEST && !pick->oartifact) {
You_cant("%s %ssuch a container with a mundane %s.",
Expand Down
10 changes: 5 additions & 5 deletions src/objects.c
Original file line number Diff line number Diff line change
Expand Up @@ -729,9 +729,9 @@ OBJECT(OBJ("Amulet of Yendor", /* note: description == name */
OBJECT(OBJ(name, desc), \
BITS(kn, 0, chg, 1, mgc, chg, 0, 0, 0, 0, 0, P_NONE, mat), \
0, TOOL_CLASS, prob, 0, wt, cost, 0, 0, 0, 0, wt, color)
#define WEPTOOL(name,desc,kn,mgc,bi,prob,wt,cost,sdam,ldam,hitbon,sub,mat,clr) \
#define WEPTOOL(name,desc,kn,mgc,bi,prob,wt,cost,sdam,ldam,hitbon,typ,sub,mat,clr) \
OBJECT(OBJ(name, desc), \
BITS(kn, 0, 1, 0, mgc, 1, 0, 0, bi, 0, hitbon, sub, mat), \
BITS(kn, 0, 1, 0, mgc, 1, 0, 0, bi, 0, typ, sub, mat), \
0, TOOL_CLASS, prob, 0, wt, cost, sdam, ldam, hitbon, 0, wt, clr)
/* containers */
CONTAINER("large box", None, 1, 0, 0, 40, 350, 8, WOOD, HI_WOOD),
Expand Down Expand Up @@ -813,11 +813,11 @@ TOOL("leather drum", "drum", 0, 0, 0, 0, 4, 25, 25, LEATHER, HI_LEATHER
TOOL("drum of earthquake","drum", 0, 0, 1, 1, 2, 25, 25, LEATHER, HI_LEATHER),
/* tools useful as weapons */
WEPTOOL("pick-axe", None,
1, 0, 0, 20, 100, 50, 6, 3, WHACK, P_PICK_AXE, IRON, HI_METAL),
1, 0, 0, 20, 100, 50, 6, 3, 0, WHACK, P_PICK_AXE, IRON, HI_METAL),
WEPTOOL("grappling hook", "iron hook",
0, 0, 0, 5, 30, 50, 2, 6, WHACK, P_FLAIL, IRON, HI_METAL),
0, 0, 0, 5, 30, 50, 2, 6, 0, WHACK, P_FLAIL, IRON, HI_METAL),
WEPTOOL("unicorn horn", None,
1, 1, 0, 0, 20, 100, 8, 10, PIERCE, P_UNICORN_HORN, BONE, CLR_WHITE),
1, 1, 0, 0, 20, 100, 8, 10, 1, PIERCE, P_UNICORN_HORN, BONE, CLR_WHITE),
/* 3.4.1: unicorn horn left classified as "magic" */
/* two unique tools;
* not artifacts, despite the comment which used to be here
Expand Down
3 changes: 2 additions & 1 deletion src/pray.c
Original file line number Diff line number Diff line change
Expand Up @@ -1743,7 +1743,8 @@ dosacrifice()

if (your_race(ptr)
|| (Race_if(PM_ELF) && is_drow(ptr))
|| (Race_if(PM_DROW) && is_elf(ptr))) {
|| (Race_if(PM_DROW) && is_elf(ptr))
|| (Race_if(PM_DRAUGR) && otmp->zombie_corpse)) {
if (is_demon(raceptr(&youmonst))) {
You("find the idea very satisfying.");
exercise(A_WIS, TRUE);
Expand Down
39 changes: 30 additions & 9 deletions win/tty/wintty.c
Original file line number Diff line number Diff line change
Expand Up @@ -1173,13 +1173,32 @@ int role, gend, algn;
high_ch = 0;
}

/* filtering: picking race, so choose by first letter, with
capital letter as unseen accelerator;
!filtering: resetting filter rather than picking, choose by
capital letter since lowercase role letters will be present */
add_menu(win, NO_GLYPH, &any,
filtering ? this_ch : high_ch,
filtering ? high_ch : 0,
/* modify some this_chs when filtering to avoid conflict with roles */
if (!filtering) {
if (!strcmp(races[i].noun, "human")) {
/* healer/Hobbit are taken. 'uman? */
this_ch = 'u';
high_ch = 0;
} else if (!strcmp(races[i].noun, "illithid")) {
/* infidel is taken */
this_ch = 'I';
high_ch = 0;
} else if (!strcmp(races[i].noun, "tortle")) {
/* tourist is taken */
this_ch = 'T';
high_ch = 0;
} else if (!strcmp(races[i].noun, "centaur")) {
/* cavefolk/Convict are taken. they have 4 legs? */
this_ch = '4';
high_ch = 0;
} else if (!strcmp(races[i].noun, "dwarf")) {
/* druid/Drow are taken. Urist? */
this_ch = 'U';
high_ch = 0;
}
}

add_menu(win, NO_GLYPH, &any, this_ch, high_ch,
ATR_NONE, races[i].noun,
(!filtering && !race_ok) ? MENU_SELECTED : MENU_UNSELECTED);
}
Expand Down Expand Up @@ -1228,7 +1247,7 @@ int role, race, gend;
anything any;
boolean algn_ok;
int i;
char this_ch;
char this_ch, alt_ch;

any = zeroany;
for (i = 0; i < ROLE_ALIGNS; i++) {
Expand All @@ -1243,10 +1262,12 @@ int role, race, gend;
else
any.a_string = aligns[i].adj;
this_ch = *aligns[i].adj;
/* alternate characters to avoid conflict with races/roles */
alt_ch = (i == 0) ? '+' : (i == 1) ? '=' : '-';
/* (see setup_racemenu for explanation of selector letters
and setup_rolemenu for preselection) */
add_menu(win, NO_GLYPH, &any,
filtering ? this_ch : highc(this_ch),
filtering ? this_ch : alt_ch,
filtering ? highc(this_ch) : 0,
ATR_NONE, aligns[i].adj,
(!filtering && !algn_ok) ? MENU_SELECTED : MENU_UNSELECTED);
Expand Down
Loading