Browse Source

Add mWhoHit Indicators

Adds mWhoHit indicator graphics to the monster health bar.
pull/3354/head
NiteKat 5 years ago committed by Anders Jenbo
parent
commit
3f85fdae37
  1. 1
      CMakeLists.txt
  2. BIN
      Packaging/resources/assets/data/monstertags.pcx
  3. 12
      Source/qol/monhealthbar.cpp

1
CMakeLists.txt

@ -716,6 +716,7 @@ set(devilutionx_assets
data/health.pcx
data/panel8buc.pcx
data/panel8bucp.pcx
data/monstertags.pcx
data/resistance.pcx
data/talkbutton.pcx
data/xpbar.pcx

BIN
Packaging/resources/assets/data/monstertags.pcx

Binary file not shown.

12
Source/qol/monhealthbar.cpp

@ -17,6 +17,7 @@ namespace {
Art healthBox;
Art resistance;
Art health;
Art playerExpTags;
} // namespace
@ -28,6 +29,7 @@ void InitMonsterHealthBar()
LoadMaskedArt("data\\healthbox.pcx", &healthBox, 1, 1);
LoadArt("data\\health.pcx", &health);
LoadMaskedArt("data\\resistance.pcx", &resistance, 6, 1);
LoadMaskedArt("data\\monstertags.pcx", &playerExpTags, 5, 1);
if ((healthBox.surface == nullptr)
|| (health.surface == nullptr)
@ -134,6 +136,16 @@ void DrawMonsterHealthBar(const Surface &out)
}
}
}
int tagOffset = 5;
for (int i = 0; i < MAX_PLRS; i++) {
if (1 << i & monster.mWhoHit) {
DrawArt(out, position + Displacement { tagOffset, height - 31 }, &playerExpTags, i + 1);
} else if (Players[i].plractive) {
DrawArt(out, position + Displacement { tagOffset, height - 31 }, &playerExpTags, 0);
}
tagOffset += playerExpTags.w();
}
}
} // namespace devilution

Loading…
Cancel
Save