Skip to content

Commit 5fa417c

Browse files
committed
Allow player monsters to be Draugr, part one.
This lays the foundation for player monster Draugr. More to do here, namely gear templates specific for Draugr (no spellbooks or regular food), and I need to figure out a way to swap out player monster infidel spellcasting attacks with regular attacks if Draugr.
1 parent 58204d7 commit 5fa417c

File tree

4 files changed

+44
-14
lines changed

4 files changed

+44
-14
lines changed

doc/evilhack-changelog.md

+1
Original file line numberDiff line numberDiff line change
@@ -3435,4 +3435,5 @@ The following changes to date are:
34353435
- Ensure unique undead monsters are appropriately hostile towards Draugr
34363436
- Tweak feedback between shopkeepers and Draugr
34373437
- Shop prices for Draugr, other price tweaks
3438+
- Allow player monsters to be Draugr, part one
34383439

src/mhitu.c

+12-6
Original file line numberDiff line numberDiff line change
@@ -1012,7 +1012,8 @@ register struct monst *mtmp;
10121012
/* if our hero is sized tiny/small and unencumbered,
10131013
they have a decent chance of evading a zombie's
10141014
bite attack */
1015-
if (is_zombie(mdat) && mattk->aatyp == AT_BITE
1015+
if ((is_zombie(mdat) || racial_draugr(mtmp))
1016+
&& mattk->aatyp == AT_BITE
10161017
&& (youmonst.data)->msize <= MZ_SMALL
10171018
&& is_animal(youmonst.data)
10181019
&& (near_capacity() == UNENCUMBERED)
@@ -1254,7 +1255,8 @@ struct attack *mattk;
12541255
(mattk->adtyp == AD_WRAP
12551256
&& mtmp->data != &mons[PM_SALAMANDER])
12561257
? "slips off of"
1257-
: (mattk->adtyp == AD_DRIN && is_zombie(mtmp->data))
1258+
: (mattk->adtyp == AD_DRIN
1259+
&& (is_zombie(mtmp->data) || racial_draugr(mtmp)))
12581260
? "bites you, but slips off of"
12591261
: "grabs you, but cannot hold onto",
12601262
obj->greased ? "greased" : "slippery",
@@ -1772,13 +1774,17 @@ register struct attack *mattk;
17721774
if (uarmh && is_hard(uarmh) && rn2(4)) {
17731775
/* not body_part(HEAD) */
17741776
Your("%s blocks the %s to your head.",
1775-
helm_simple_name(uarmh), is_zombie(mdat) ? "bite" : "attack");
1777+
helm_simple_name(uarmh),
1778+
(is_zombie(mdat) || racial_draugr(mtmp)) ? "bite"
1779+
: "attack");
17761780
break;
17771781
}
17781782

17791783
if (uarmh && !is_hard(uarmh) && rn2(2)) {
17801784
Your("%s repels the %s to your head.",
1781-
helm_simple_name(uarmh), is_zombie(mdat) ? "bite" : "attack");
1785+
helm_simple_name(uarmh),
1786+
(is_zombie(mdat) || racial_draugr(mtmp)) ? "bite"
1787+
: "attack");
17821788
break;
17831789
}
17841790

@@ -1788,7 +1794,7 @@ register struct attack *mattk;
17881794
break;
17891795
}
17901796

1791-
if (is_zombie(mdat) && rn2(6)) {
1797+
if ((is_zombie(mdat) || racial_draugr(mtmp)) && rn2(6)) {
17921798
if (uncancelled) {
17931799
if (!Upolyd && Race_if(PM_DRAUGR))
17941800
pline("%s tries to eat your brains, but can't.",
@@ -1821,7 +1827,7 @@ register struct attack *mattk;
18211827
break;
18221828
} else {
18231829
(void) adjattrib(A_INT, -rnd(2), FALSE);
1824-
if (!is_zombie(mdat)) {
1830+
if (!(is_zombie(mdat) || racial_draugr(mtmp))) {
18251831
forget_traps();
18261832
if (rn2(2))
18271833
forget(rnd(u.uluck <= 0 ? 4 : 2));

src/mon.c

+17-7
Original file line numberDiff line numberDiff line change
@@ -6470,7 +6470,8 @@ unsigned long permitted;
64706470

64716471
const short mraces[] = { PM_HUMAN, PM_ELF, PM_DWARF, PM_GNOME,
64726472
PM_ORC, PM_GIANT, PM_HOBBIT, PM_CENTAUR,
6473-
PM_ILLITHID, PM_TORTLE, PM_DROW, 0 };
6473+
PM_ILLITHID, PM_TORTLE, PM_DROW, PM_DRAUGR,
6474+
0 };
64746475

64756476
for (i = 0; mraces[i]; i++) {
64766477
if (permitted & mons[mraces[i]].mhflags
@@ -6542,7 +6543,7 @@ short mndx;
65426543
break;
65436544
case PM_BARBARIAN:
65446545
permitted |= (MH_DWARF | MH_ORC | MH_GIANT | MH_CENTAUR
6545-
| MH_TORTLE);
6546+
| MH_TORTLE | MH_DRAUGR);
65466547
break;
65476548
case PM_CAVEMAN:
65486549
case PM_CAVEWOMAN:
@@ -6551,7 +6552,7 @@ short mndx;
65516552
case PM_CONVICT:
65526553
permitted |=
65536554
(MH_DWARF | MH_ORC | MH_GNOME | MH_HOBBIT | MH_ILLITHID
6554-
| MH_DROW);
6555+
| MH_DROW | MH_DRAUGR);
65556556
break;
65566557
case PM_HEALER:
65576558
permitted |=
@@ -6560,15 +6561,15 @@ short mndx;
65606561
break;
65616562
case PM_INFIDEL:
65626563
permitted |= (MH_ELF | MH_GIANT | MH_ORC | MH_ILLITHID
6563-
| MH_DROW);
6564+
| MH_DROW | MH_DRAUGR);
65646565
break;
65656566
case PM_KNIGHT:
65666567
permitted |= (MH_DWARF | MH_ELF | MH_ORC | MH_CENTAUR
6567-
| MH_DROW);
6568+
| MH_DROW | MH_DRAUGR);
65686569
break;
65696570
case PM_MONK:
65706571
permitted |= (MH_DWARF | MH_ELF | MH_GIANT | MH_CENTAUR
6571-
| MH_TORTLE | MH_DROW);
6572+
| MH_TORTLE | MH_DROW | MH_DRAUGR);
65726573
break;
65736574
case PM_PRIEST:
65746575
case PM_PRIESTESS:
@@ -6582,7 +6583,7 @@ short mndx;
65826583
break;
65836584
case PM_ROGUE:
65846585
permitted |= (MH_ELF | MH_HOBBIT | MH_ORC | MH_GNOME
6585-
| MH_DROW);
6586+
| MH_DROW | MH_DRAUGR);
65866587
break;
65876588
case PM_SAMURAI:
65886589
permitted |= (MH_DWARF | MH_GIANT | MH_TORTLE);
@@ -6797,6 +6798,15 @@ short raceidx;
67976798
if (mtmp->mnum == PM_INFIDEL)
67986799
rptr->ralign = -128;
67996800
break;
6801+
case PM_DRAUGR:
6802+
rptr->mattk[2].aatyp = AT_BITE;
6803+
rptr->mattk[2].adtyp = AD_DRIN;
6804+
rptr->mattk[2].damn = 2;
6805+
rptr->mattk[2].damd = 1;
6806+
rptr->ralign = -3;
6807+
if (mtmp->mnum == PM_INFIDEL)
6808+
rptr->ralign = -128;
6809+
break;
68006810
}
68016811
}
68026812

src/mplayer.c

+14-1
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,18 @@ static const char *drow_female_names[] = {
170170
0
171171
};
172172

173+
static const char *draugr_male_names[] = {
174+
"Bjorn", "Erik", "Gorm", "Halfdan", "Leif",
175+
"Njal", "Sten", "Svend", "Torsten", "Ulf",
176+
0
177+
};
178+
179+
static const char *draugr_female_names[] = {
180+
"Astrid", "Frida", "Gunhild", "Helga", "Sigrid",
181+
"Revna", "Thyra", "Thurid", "Yrsa", "Ulfhild",
182+
0
183+
};
184+
173185
struct mfnames {
174186
const char **male;
175187
const char **female;
@@ -187,7 +199,8 @@ static const struct mfnames namelists[] = {
187199
{ centaur_male_names, centaur_female_names },
188200
{ illithid_male_names, illithid_female_names },
189201
{ tortle_male_names, tortle_female_names },
190-
{ drow_male_names, drow_female_names }
202+
{ drow_male_names, drow_female_names },
203+
{ draugr_male_names, draugr_female_names }
191204
};
192205

193206
void

0 commit comments

Comments
 (0)