From 1a8e09a7f51dc1d3e37510f76b895b8d920fe818 Mon Sep 17 00:00:00 2001 From: Juliano Leal Goncalves Date: Fri, 11 Sep 2020 21:30:32 -0300 Subject: [PATCH] :sparkles: Expose monster types on monster info --- Source/monster.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/Source/monster.cpp b/Source/monster.cpp index 365533983..26e38ff3a 100644 --- a/Source/monster.cpp +++ b/Source/monster.cpp @@ -5156,11 +5156,24 @@ void M_FallenFear(int x, int y) } } +const char* GetMonsterTypeText(const MonsterData& monsterData) { + switch (monsterData.mMonstClass) { + case MC_ANIMAL: + return "Animal"; + + case MC_DEMON: + return "Demon"; + + case MC_UNDEAD: + return "Undead"; + } +} + void PrintMonstHistory(int mt) { int minHP, maxHP, res; - sprintf(tempstr, "Total kills: %i", monstkills[mt]); + sprintf(tempstr, "Type: %s Kills: %i", GetMonsterTypeText(monsterdata[mt]), monstkills[mt]); AddPanelString(tempstr, TRUE); if (monstkills[mt] >= 30) { minHP = monsterdata[mt].mMinHP; @@ -5235,6 +5248,8 @@ void PrintUniqueHistory() { int res; + sprintf(tempstr, "Type: %s", GetMonsterTypeText(*monster[pcursmonst].MData)); + AddPanelString(tempstr, TRUE); res = monster[pcursmonst].mMagicRes & (RESIST_MAGIC | RESIST_FIRE | RESIST_LIGHTNING | IMMUNE_MAGIC | IMMUNE_FIRE | IMMUNE_LIGHTNING); if (!res) { strcpy(tempstr, "No resistances");