Skip to content

Commit

Permalink
Giant turtles count as tortles. This enables turtle/tortle cannibalis…
Browse files Browse the repository at this point in the history
…m, but as an interesting side effect, it also allows giant turtles to use the #monster ability to retreat into a shell. I was a bit hesitant to make this change, but it does clean up some code and simplifies the checks for tortles and turtles.
  • Loading branch information
elunna committed Nov 1, 2023
1 parent c2203d8 commit 70d2f6b
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 13 deletions.
6 changes: 3 additions & 3 deletions include/mondata.h
Original file line number Diff line number Diff line change
Expand Up @@ -542,9 +542,9 @@

/* various monsters move faster underwater vs on land */
#define is_fast_underwater(ptr) \
(is_tortle(ptr) || (ptr) == &mons[PM_WATER_TROLL] \
|| (ptr) == &mons[PM_GIANT_TURTLE] || (ptr) == &mons[PM_BABY_CROCODILE] \
|| (ptr) == &mons[PM_CROCODILE] || (ptr) == &mons[PM_GIANT_CROCODILE] \
(is_tortle(ptr) \
|| (ptr) == &mons[PM_WATER_TROLL] || (ptr) == &mons[PM_BABY_CROCODILE] \
|| (ptr) == &mons[PM_CROCODILE] || (ptr) == &mons[PM_GIANT_CROCODILE] \
|| (ptr) == &mons[PM_BABY_SEA_DRAGON] || (ptr) == &mons[PM_SEA_DRAGON])

/* return TRUE if the monster tends to revive */
Expand Down
3 changes: 1 addition & 2 deletions src/mhitm.c
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,7 @@ int target, roll;
fmt = "%s %s %s";
Sprintf(buf, fmt, s_suffix(Monnam(mdef)),
(is_dragon(mdef->data) ? "scaly hide"
: (mdef->data == &mons[PM_GIANT_TURTLE]
|| is_tortle(mdef->data))
: is_tortle(mdef->data)
? "protective shell"
: "thick hide"),
(rn2(2) ? "blocks" : "deflects"));
Expand Down
3 changes: 1 addition & 2 deletions src/mhitu.c
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,7 @@ struct attack *mattk;
&& rn2(2)) {
Your("%s %s %s attack.",
(is_dragon(youmonst.data) ? "scaly hide"
: (youmonst.data == &mons[PM_GIANT_TURTLE]
|| Race_if(PM_TORTLE))
: is_tortle(youmonst.data)
? "protective shell"
: "thick hide"),
(rn2(2) ? "blocks" : "deflects"),
Expand Down
2 changes: 2 additions & 0 deletions src/mondata.c
Original file line number Diff line number Diff line change
Expand Up @@ -822,6 +822,8 @@ struct permonst *pm1, *pm2;
/* other creatures are less precise */
if (is_giant(pm1))
return is_giant(pm2); /* open to quibbling here */
if (is_tortle(pm1))
return (is_tortle(pm2));
if (is_gnoll(pm1))
return is_gnoll(pm2);
if (is_golem(pm1))
Expand Down
4 changes: 2 additions & 2 deletions src/monst.c
Original file line number Diff line number Diff line change
Expand Up @@ -7323,7 +7323,7 @@ struct permonst _mons2[] = {
M1_ANIMAL | M1_THICK_HIDE | M1_NOHANDS | M1_HERBIVORE
| M1_AMPHIBIOUS | M1_SWIM,
M2_HOSTILE | M2_STRONG, 0,
M4_VULNERABLE_COLD, 0, 8, CLR_BRIGHT_GREEN),
M4_VULNERABLE_COLD, MH_TORTLE, 8, CLR_BRIGHT_GREEN),
MON("gila monster", S_LIZARD, /* Slash'EM */
LVL(6, 6, 6, 10, 0), (G_NOHELL | G_GENO | 1),
A(ATTK(AT_BITE, AD_DRST, 2, 6),
Expand Down Expand Up @@ -7469,7 +7469,7 @@ struct permonst _mons2[] = {
SIZ(WT_HUMAN, 400, MS_HUMANOID, MZ_HUMAN), 0, 0,
M1_HUMANOID | M1_OMNIVORE,
M2_NOPOLY | M2_STRONG | M2_COLLECT | M2_HOSTILE,
M3_INFRAVISIBLE, 0, MH_HUMAN, 12, HI_DOMESTIC),
M3_INFRAVISIBLE, 0, MH_HUMAN, 12, HI_DOMESTIC),
MON("caveman", S_HUMAN,
LVL(10, 12, 10, 0, 1), (1),
A(ATTK(AT_WEAP, AD_PHYS, 2, 4),
Expand Down
3 changes: 1 addition & 2 deletions src/mthrowu.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,7 @@ const char *name; /* if null, then format `*objp' */
|| (!Upolyd && Race_if(PM_TORTLE))) && rn2(2)) {
Your("%s %s %s.",
(is_dragon(youmonst.data) ? "scaly hide"
: (youmonst.data == &mons[PM_GIANT_TURTLE]
|| Race_if(PM_TORTLE))
: is_tortle(youmonst.data)
? "protective shell"
: "thick hide"),
(rn2(2) ? "blocks" : "deflects"), onm);
Expand Down
3 changes: 1 addition & 2 deletions src/uhitm.c
Original file line number Diff line number Diff line change
Expand Up @@ -4216,8 +4216,7 @@ boolean wouldhavehit;
pline("%s %s %s your attack.",
s_suffix(Monnam(mdef)),
(is_dragon(mdef->data) ? "scaly hide"
: (mdef->data == &mons[PM_GIANT_TURTLE]
|| is_tortle(mdef->data))
: is_tortle(mdef->data)
? "protective shell"
: "thick hide"),
(rn2(2) ? "blocks" : "deflects"));
Expand Down

0 comments on commit 70d2f6b

Please sign in to comment.