Use real thrown weapon damage in tooltips and weapon rating (feature #4697)

pull/541/head
Capostrophic 6 years ago
parent fc82e680b4
commit 77b0ff7a75

@ -189,6 +189,7 @@
Feature #4642: Batching potion creation
Feature #4647: Cull actors outside of AI processing range
Feature #4682: Use the collision box from basic creature mesh if the X one have no collisions
Feature #4697: Use the real thrown weapon damage in tooltips and AI
Task #2490: Don't open command prompt window on Release-mode builds automatically
Task #4545: Enable is_pod string test
Task #4605: Optimize skinning

@ -265,7 +265,7 @@ namespace MWClass
std::string text;
// weapon type & damage
if ((ref->mBase->mData.mType < 12 || Settings::Manager::getBool("show projectile damage", "Game")) && ref->mBase->mData.mType < 14)
if ((ref->mBase->mData.mType < ESM::Weapon::Arrow || Settings::Manager::getBool("show projectile damage", "Game")) && ref->mBase->mData.mType <= ESM::Weapon::Bolt)
{
text += "\n#{sType} ";
@ -295,7 +295,15 @@ namespace MWClass
((oneOrTwoHanded != "") ? ", " + store.get<ESM::GameSetting>().find(oneOrTwoHanded)->mValue.getString() : "");
// weapon damage
if (ref->mBase->mData.mType >= 9)
if (ref->mBase->mData.mType == ESM::Weapon::MarksmanThrown)
{
// Thrown weapons have 2x real damage applied
// as they're both the weapon and the ammo
text += "\n#{sAttack}: "
+ MWGui::ToolTips::toString(static_cast<int>(ref->mBase->mData.mChop[0] * 2))
+ " - " + MWGui::ToolTips::toString(static_cast<int>(ref->mBase->mData.mChop[1] * 2));
}
else if (ref->mBase->mData.mType >= ESM::Weapon::MarksmanBow)
{
// marksman
text += "\n#{sAttack}: "

@ -58,8 +58,16 @@ namespace MWMechanics
}
const float chop = (weapon->mData.mChop[0] + weapon->mData.mChop[1]) / 2.f;
if (weapon->mData.mType >= ESM::Weapon::MarksmanBow)
// We need to account for the fact that thrown weapons have 2x real damage applied to the target
// as they're both the weapon and the ammo of the hit
if (weapon->mData.mType == ESM::Weapon::MarksmanThrown)
{
rating = chop * 2;
}
else if (weapon->mData.mType >= ESM::Weapon::MarksmanBow)
{
rating = chop;
}
else
{
const float slash = (weapon->mData.mSlash[0] + weapon->mData.mSlash[1]) / 2.f;

Loading…
Cancel
Save