Skip to content

Commit 6633883

Browse files
committed
Draugr and various interactions with NPC's.
The main part of this commit is Draugr and their interactions with NPC's like shopkeepers, priests, and guards. There's some other changes here as well, we'll get to that. Guards (minetown watch) that see a Draugr will instantly become hostile at seeing 'another zombie'. Killing the watch after they become angry actually gives Draugr a slight alignment bump, just like an Infidel. Non-aligned priests will also become hostile (co-aligned/unaligned will stay peaceful and tolerate Draugr). Shopkeepers treat Draugr the same as a Convict wearing their striped shirt - player is banned, but the shopkeeper is still peaceful. Other bits: Draugr can stay hungry for a longer period of time before it becomes an issue (same as Convicts). Draugr will always start with -10 alignment, Infidel being the exception. Throwing treats to non-tame domestic animals will not tame them (same as Convict). Draugr are never scared of ghosts appearing out of nowhere - being nearly mindless, fear just doesn't register.
1 parent c0410a6 commit 6633883

9 files changed

+57
-20
lines changed

doc/evilhack-changelog.md

+1
Original file line numberDiff line numberDiff line change
@@ -3429,4 +3429,5 @@ The following changes to date are:
34293429
- Clean up role-specific bits for Draugr
34303430
- Draugr cannot gain intrinsic telepathy
34313431
- Draugr as Infidel and crowning
3432+
- Draugr and various interactions with NPC's
34323433

src/dog.c

+3-2
Original file line numberDiff line numberDiff line change
@@ -1243,8 +1243,9 @@ struct obj *obj;
12431243
&& mtmp->data->mlet == S_DOG)
12441244
return FALSE;
12451245

1246-
if (Role_if(PM_CONVICT) && (is_domestic(mtmp->data) && obj)) {
1247-
/* Domestic animals are wary of the Convict */
1246+
if ((Role_if(PM_CONVICT) || (!Upolyd && Race_if(PM_DRAUGR)))
1247+
&& (is_domestic(mtmp->data) && !mtmp->mtame && obj)) {
1248+
/* Domestic animals are wary of Convicts and Draugr */
12481249
pline("%s still looks wary of you.", Monnam(mtmp));
12491250
return FALSE;
12501251
}

src/eat.c

+6-4
Original file line numberDiff line numberDiff line change
@@ -2141,8 +2141,9 @@ struct obj *otmp;
21412141
/* increasing existing nausea means that it will take longer
21422142
before eventual vomit, but also means that constitution
21432143
will be abused more times before illness completes */
2144-
if (Role_if(PM_CONVICT) && (rn2(8) > u.ulevel)) {
2145-
You_feel("a slight stomach ache."); /* prisoners are used to bad food */
2144+
if ((!Upolyd && Race_if(PM_DRAUGR))
2145+
|| (Role_if(PM_CONVICT) && (rn2(8) > u.ulevel))) {
2146+
You_feel("a slight stomach ache."); /* prisoners are used to bad food */
21462147
} else
21472148
make_vomiting((Vomiting & TIMEOUT) + (long) d(10, 4), TRUE);
21482149
} else {
@@ -3154,8 +3155,9 @@ gethungry()
31543155
amount of nutrition in the 'moves % 20' ring/amulet check below */
31553156
if ((!Unaware || !rn2(10)) /* slow metabolic rate while asleep */
31563157
&& !inediate(raceptr(&youmonst))
3157-
/* Convicts can last twice as long at hungry and below */
3158-
&& (!Role_if(PM_CONVICT) || (moves % 2) || (u.uhs < HUNGRY))
3158+
/* Convicts/Draugr can last twice as long at hungry and below */
3159+
&& (!Role_if(PM_CONVICT) || !Race_if(PM_DRAUGR)
3160+
|| (moves % 2) || (u.uhs < HUNGRY))
31593161
&& !Slow_digestion)
31603162
u.uhunger--; /* ordinary food consumption */
31613163

src/makemon.c

+4-2
Original file line numberDiff line numberDiff line change
@@ -4081,8 +4081,10 @@ struct monst *mtmp;
40814081
} else if (always_peaceful(mdat)) {
40824082
int absmal = abs(mal);
40834083
if (mtmp->mpeaceful) {
4084-
if (u.ualign.type == A_NONE) {
4085-
mtmp->malign += 1; /* Moloch's will */
4084+
if (u.ualign.type == A_NONE
4085+
|| (!Upolyd && Race_if(PM_DRAUGR))) {
4086+
/* Moloch's will, or being a Draugr */
4087+
mtmp->malign += 1;
40864088
} else if (Role_if(PM_CONVICT)) {
40874089
/* Several 'always peaceful' types become hostile
40884090
once they see a Convict. Still an alignment

src/monmove.c

+6-1
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,12 @@ register struct monst *mtmp;
141141

142142
if (mtmp->mpeaceful && in_town(u.ux + u.dx, u.uy + u.dy)
143143
&& mtmp->mcansee && m_canseeu(mtmp) && !rn2(3)) {
144-
if (Role_if(PM_CONVICT) && !Upolyd) {
144+
if (Race_if(PM_DRAUGR) && !Upolyd) {
145+
mon_yells(mtmp, "Another zombie! Attack!");
146+
(void) angry_guards(!!Deaf);
147+
stop_occupation();
148+
return;
149+
} else if (Role_if(PM_CONVICT) && !Upolyd) {
145150
mon_yells(mtmp, "Hey, you're the one from the wanted poster!");
146151
(void) angry_guards(!!Deaf);
147152
stop_occupation();

src/pray.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1066,7 +1066,7 @@ gcrownu()
10661066
; /* already got bonus above */
10671067
} else if (obj && in_hand) {
10681068
if (!Blind)
1069-
Your("%s briefly flares with an eldrtich glow.",
1069+
Your("%s briefly flares with an eldritch glow.",
10701070
xname(obj));
10711071
obj->dknown = TRUE;
10721072
} else if (!already_exists) {

src/priest.c

+25-10
Original file line numberDiff line numberDiff line change
@@ -466,13 +466,19 @@ int roomno;
466466
epri_p->enter_time = 0L;
467467
}
468468
msg1 = msg2 = 0;
469-
if (((sanctum && Is_sanctum(&u.uz)) || u.ualign.type == A_NONE)
469+
if (((sanctum && Is_sanctum(&u.uz)) || u.ualign.type == A_NONE
470+
|| (!Upolyd && Race_if(PM_DRAUGR)))
470471
&& !p_coaligned(priest)) {
471472
/* either a non-Infidel in the Sanctum, or an Infidel in any
472473
* non-Moloch temple; either way, the priest is not happy */
473474
if (priest->mpeaceful) {
474475
/* first time inside */
475-
if (u.ualign.type == A_NONE) {
476+
if (!Upolyd && Race_if(PM_DRAUGR)
477+
&& !Role_if(PM_INFIDEL)) {
478+
msg1 = "Begone, foul abomination!";
479+
msg2 = "You desecrate this holy Sanctum!";
480+
call_guards = in_town(priest->mx, priest->my);
481+
} else if (u.ualign.type == A_NONE) {
476482
msg1 = "Begone, infidel!";
477483
msg2 = "This place is barred for your cult!";
478484
call_guards = in_town(priest->mx, priest->my);
@@ -481,6 +487,7 @@ int roomno;
481487
msg2 = "Be gone!";
482488
}
483489
priest->mpeaceful = 0;
490+
newsym(priest->mx, priest->my); /* clear peaceful glyph */
484491
/* became angry voluntarily; no penalty for attacking him */
485492
set_malign(priest);
486493
} else {
@@ -498,7 +505,8 @@ int roomno;
498505
verbalize1(msg2);
499506
epri_p->enter_time = moves + (long) d(10, 100); /* ~505 */
500507
}
501-
/* for Infidels, visiting the Minetown temple is a very bad idea */
508+
/* for Infidels or possibly Draugr, visiting the Minetown
509+
temple is a very bad idea */
502510
if (call_guards) {
503511
pline("%s calls for guards!", Monnam(priest));
504512
(void) angry_guards(FALSE);
@@ -576,12 +584,15 @@ struct monst* ghost;
576584
{
577585
ghost->mpeaceful = 0;
578586
set_malign(ghost);
579-
if (multi >= 0) {
580-
if (flags.verbose)
581-
You("are frightened to death, and unable to move.");
582-
nomul(-3);
583-
multi_reason = "being terrified of a ghost";
584-
nomovemsg = "You regain your composure.";
587+
/* Draugr do not fear the undead. Or anything else for that matter */
588+
if (!maybe_polyd(is_undead(youmonst.data), Race_if(PM_DRAUGR))) {
589+
if (multi >= 0) {
590+
if (flags.verbose)
591+
You("are frightened to death, and unable to move.");
592+
nomul(-3);
593+
multi_reason = "being terrified of a ghost";
594+
nomovemsg = "You regain your composure.";
595+
}
585596
}
586597
}
587598

@@ -617,13 +628,15 @@ register struct monst *priest;
617628
if (priest->mflee || (!priest->ispriest && coaligned && strayed)) {
618629
pline("%s doesn't want anything to do with you!", Monnam(priest));
619630
priest->mpeaceful = 0;
631+
newsym(priest->mx, priest->my); /* clear peaceful glyph */
620632
return;
621633
}
622634

623635
/* priests don't chat unless peaceful and in their own temple */
624636
if (!inhistemple(priest) || !priest->mpeaceful
625637
|| !priest->mcanmove || priest->msleeping
626-
|| (u.ualign.type == A_NONE && !coaligned)) {
638+
|| (u.ualign.type == A_NONE && !coaligned)
639+
|| (!Upolyd && Race_if(PM_DRAUGR) && !coaligned)) {
627640
static const char *cranky_msg[3] = {
628641
"Thou wouldst have words, eh? I'll give thee a word or two!",
629642
"Talk? Here is what I have to say!",
@@ -638,6 +651,7 @@ register struct monst *priest;
638651
priest->mcanmove = 1;
639652
}
640653
priest->mpeaceful = 0;
654+
newsym(priest->mx, priest->my); /* clear peaceful glyph */
641655
verbalize1(cranky_msg[rn2(3)]);
642656
return;
643657
}
@@ -648,6 +662,7 @@ register struct monst *priest;
648662
verbalize(
649663
"Begone! Thou desecratest this holy place with thy presence.");
650664
priest->mpeaceful = 0;
665+
newsym(priest->mx, priest->my); /* clear peaceful glyph */
651666
return;
652667
}
653668
if (!money_cnt(invent)) {

src/shk.c

+4
Original file line numberDiff line numberDiff line change
@@ -608,6 +608,10 @@ char *enterstring;
608608
return;
609609
}
610610

611+
/* Draugr being zombies */
612+
if (!Upolyd && Race_if(PM_DRAUGR))
613+
eshkp->pbanned = TRUE;
614+
611615
/* Visible striped prison shirt */
612616
if ((uarmu && (uarmu->otyp == STRIPED_SHIRT))
613617
&& !uarm && !uarmc) {

src/u_init.c

+7
Original file line numberDiff line numberDiff line change
@@ -1298,6 +1298,13 @@ u_init()
12981298
case PM_DRAUGR:
12991299
if (!Role_if(PM_CONVICT))
13001300
ini_inv(Dra_food);
1301+
if (!Role_if(PM_CONVICT)
1302+
&& !Role_if(PM_INFIDEL)) {
1303+
/* same alignment penalty as the typical Convict */
1304+
adjalign(-20);
1305+
/* prevent automatic alignment abuse penalty */
1306+
u.ualign.abuse = 0;
1307+
}
13011308
break;
13021309

13031310
default: /* impossible */

0 commit comments

Comments
 (0)