Browse Source

🚩 Add ini toggle for displaying monster type. Disabled by default.

pull/1241/head
Juliano Leal Goncalves 5 years ago committed by Anders Jenbo
parent
commit
1bf3fd6f35
  1. 2
      Source/diablo.cpp
  2. 2
      Source/diablo.h
  3. 14
      Source/monster.cpp
  4. 18
      SourceX/qol.cpp

2
Source/diablo.cpp

@ -444,6 +444,7 @@ static void SaveOptions()
setIniInt("Game", "Auto Equip Shields", sgOptions.Gameplay.bAutoEquipShields);
setIniInt("Game", "Auto Equip Jewelry", sgOptions.Gameplay.bAutoEquipJewelry);
setIniInt("Game", "Enable All Quests for Single Player", sgOptions.Gameplay.bAllQuests);
setIniInt("Game", "Show Monster Type", sgOptions.Gameplay.bShowMonsterType);
setIniValue("Network", "Bind Address", sgOptions.Network.szBindAddress);
}
@ -498,6 +499,7 @@ static void LoadOptions()
sgOptions.Gameplay.bAutoEquipShields = getIniBool("Game", "Auto Equip Shields", false);
sgOptions.Gameplay.bAutoEquipJewelry = getIniBool("Game", "Auto Equip Jewelry", false);
sgOptions.Gameplay.bAllQuests = getIniBool("Game", "Enable All Quests for Single Player", false);
sgOptions.Gameplay.bShowMonsterType = getIniBool("Game", "Show Monster Type", false);
getIniValue("Network", "Bind Address", sgOptions.Network.szBindAddress, sizeof(sgOptions.Network.szBindAddress), "0.0.0.0");
}

2
Source/diablo.h

@ -98,6 +98,8 @@ typedef struct GameplayOptions {
bool bAutoEquipJewelry;
/** @brief Enable All Quests for Single Player */
bool bAllQuests;
/** @brief Indicates whether or not mosnter type (Animal, Demon, Undead) is shown along with other monster information. */
bool bShowMonsterType;
} GameplayOptions;
typedef struct NetworkOptions {

14
Source/monster.cpp

@ -5173,7 +5173,12 @@ void PrintMonstHistory(int mt)
{
int minHP, maxHP, res;
sprintf(tempstr, "Type: %s Kills: %i", GetMonsterTypeText(monsterdata[mt]), monstkills[mt]);
if (sgOptions.Gameplay.bShowMonsterType) {
sprintf(tempstr, "Type: %s Kills: %i", GetMonsterTypeText(monsterdata[mt]), monstkills[mt]);
} else {
sprintf(tempstr, "Total kills: %i", monstkills[mt]);
}
AddPanelString(tempstr, TRUE);
if (monstkills[mt] >= 30) {
minHP = monsterdata[mt].mMinHP;
@ -5248,8 +5253,11 @@ void PrintUniqueHistory()
{
int res;
sprintf(tempstr, "Type: %s", GetMonsterTypeText(*monster[pcursmonst].MData));
AddPanelString(tempstr, TRUE);
if (sgOptions.Gameplay.bShowMonsterType) {
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");

18
SourceX/qol.cpp

@ -90,14 +90,18 @@ void DrawMonsterHealthBar(CelOutputBuffer out)
borderSize <<= 1;
FillRect(out, xPos, yPos, (width * currentLife) / maxLife, height, filledColor);
for (int j = 0; j < borderSize; j++) {
FastDrawHorizLine(out, xPos - xOffset - corners, yPos - borderSize - yOffset + j, (xOffset + corners) * 2 + width, borderColor);
FastDrawHorizLine(out, xPos - xOffset, yPos + height + yOffset + j, width + corners + xOffset * 2, borderColor);
}
for (int j = -yOffset; j < yOffset + height + corners; ++j) {
FastDrawHorizLine(out, xPos - xOffset - borderSize, yPos + j, borderSize, borderColor);
FastDrawHorizLine(out, xPos + xOffset + width, yPos + j, borderSize, borderColor);
if (sgOptions.Gameplay.bShowMonsterType) {
for (int j = 0; j < borderSize; j++) {
FastDrawHorizLine(out, xPos - xOffset - corners, yPos - borderSize - yOffset + j, (xOffset + corners) * 2 + width, borderColor);
FastDrawHorizLine(out, xPos - xOffset, yPos + height + yOffset + j, width + corners + xOffset * 2, borderColor);
}
for (int j = -yOffset; j < yOffset + height + corners; ++j) {
FastDrawHorizLine(out, xPos - xOffset - borderSize, yPos + j, borderSize, borderColor);
FastDrawHorizLine(out, xPos + xOffset + width, yPos + j, borderSize, borderColor);
}
}
for (int k = 0; k < resSize; ++k) {
if (mres & immunes[k]) {
drawImmu = true;

Loading…
Cancel
Save