Skip to content

Commit

Permalink
Additional info for monster lookup (pokedex).
Browse files Browse the repository at this point in the history
Some nice updates from EvilHack here.
  • Loading branch information
elunna committed Dec 3, 2024
1 parent 23be35f commit 710e824
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
2 changes: 2 additions & 0 deletions include/mondata.h
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,8 @@
#define herbivorous(ptr) (((ptr)->mflags1 & M1_HERBIVORE) != 0L)
#define metallivorous(ptr) (((ptr)->mflags1 & M1_METALLIVORE) != 0L)
#define lithivorous(ptr) ((ptr) == &mons[PM_ROCK_MOLE])
#define inediate(ptr) (((ptr)->mflags1 & \
(M1_CARNIVORE | M1_HERBIVORE | M1_METALLIVORE)) == 0L)
#define polyok(ptr) (((ptr)->mflags2 & M2_NOPOLY) == 0L)
#define is_outflanker(ptr) (((ptr)->mflags2 & M2_FLANK) != 0)
#define follows_you(ptr) (((ptr)->mflags2 & M2_STALK) != 0)
Expand Down
14 changes: 11 additions & 3 deletions src/pager.c
Original file line number Diff line number Diff line change
Expand Up @@ -910,7 +910,7 @@ static const char * attacktypes[] = {
"bearhug", /* AT_HUGS 7 */
"spit", /* AT_SPIT 10 */
"engulf", /* AT_ENGL 11 */
"breath", /* AT_BREA 12 */
"breathe", /* AT_BREA 12 */
"explode", /* AT_EXPL 13 */
"explode on death", /* AT_BOOM 14 */
"gaze", /* AT_GAZE 15 */
Expand Down Expand Up @@ -1140,7 +1140,6 @@ add_mon_info(winid datawin, struct permonst * pm)
if (!noncorporeal(pm))
APPENDC(unsolid(pm), "unsolid");
APPENDC(acidic(pm), "acidic");
APPENDC(thick_skinned(pm), "thick-skinned");
APPENDC(poisonous(pm), "poisonous");
APPENDC(regenerates(pm), "regenerating");
APPENDC(is_reviver(pm), "reviving");
Expand All @@ -1150,14 +1149,20 @@ add_mon_info(winid datawin, struct permonst * pm)
APPENDC(is_undead(pm), "undead");
if (!is_undead(pm))
APPENDC(nonliving(pm), "nonliving");
APPENDC(mindless(pm), "mindless");
APPENDC(telepathic(pm), "telepathic");
APPENDC(is_displacer(pm), "displaces monsters");
APPENDC(strongmonst(pm), "strong");
APPENDC(is_immobile(pm), "stationary");
APPENDC(follows_you(pm), "follows you");
APPENDC(keeps_distance(pm), "skittish");
APPENDC(is_accurate(pm), "accurate");
APPENDC(infravisible(pm), "infravisible");

APPENDC(carnivorous(pm), "carnivorous");
APPENDC(herbivorous(pm), "herbivorous");
APPENDC(metallivorous(pm), "metallivorous");
APPENDC(lithivorous(pm), "lithivorous");
APPENDC(inediate(pm), "inediate");
if (*buf) {
Snprintf(buf2, BUFSZ, "Is %s.", buf);
MONPUTSTR(buf2);
Expand All @@ -1177,6 +1182,7 @@ add_mon_info(winid datawin, struct permonst * pm)
APPENDC(is_jumper(pm), "jump");
APPENDC(is_outflanker(pm), "flank");
APPENDC(is_berserker(pm), "go berserk");
APPENDC(lays_eggs(pm), "lay eggs");
APPENDC(webmaker(pm), "spin webs");
APPENDC(needspick(pm), "mine");
APPENDC(innate_reflector(pm), "has reflective scales");
Expand All @@ -1189,6 +1195,8 @@ add_mon_info(winid datawin, struct permonst * pm)
}

/* Full-line remarks. */
if (thick_skinned(pm))
MONPUTSTR("Has a thick hide.");
if (touch_petrifies(pm))
MONPUTSTR("Petrifies by touch.");
if (infravision(pm))
Expand Down

0 comments on commit 710e824

Please sign in to comment.