mirror of
https://github.com/OpenMW/openmw.git
synced 2025-03-03 15:09:39 +00:00
Factor race weight into magic projectile speed (bug #6343)
This commit is contained in:
parent
3ade72a7ad
commit
b918135b4b
3 changed files with 13 additions and 3 deletions
|
@ -69,6 +69,7 @@
|
||||||
Bug #6323: Wyrmhaven: Alboin doesn't follower the player character out of his house
|
Bug #6323: Wyrmhaven: Alboin doesn't follower the player character out of his house
|
||||||
Bug #6326: Detect Enchantment/Key should detect items in unresolved containers
|
Bug #6326: Detect Enchantment/Key should detect items in unresolved containers
|
||||||
Bug #6327: Blocking roots the character in place
|
Bug #6327: Blocking roots the character in place
|
||||||
|
Bug #6343: Magic projectile speed doesn't take race weight into account
|
||||||
Bug #6347: PlaceItem/PlaceItemCell/PlaceAt should work with levelled creatures
|
Bug #6347: PlaceItem/PlaceItemCell/PlaceAt should work with levelled creatures
|
||||||
Bug #6354: SFX abruptly cut off after crossing max distance; implement soft fading of sound effects
|
Bug #6354: SFX abruptly cut off after crossing max distance; implement soft fading of sound effects
|
||||||
Bug #6363: Some scripts in Morrowland fail to work
|
Bug #6363: Some scripts in Morrowland fail to work
|
||||||
|
|
|
@ -22,6 +22,8 @@
|
||||||
#include <components/sceneutil/lightmanager.hpp>
|
#include <components/sceneutil/lightmanager.hpp>
|
||||||
#include <components/sceneutil/nodecallback.hpp>
|
#include <components/sceneutil/nodecallback.hpp>
|
||||||
|
|
||||||
|
#include <components/settings/settings.hpp>
|
||||||
|
|
||||||
#include "../mwworld/manualref.hpp"
|
#include "../mwworld/manualref.hpp"
|
||||||
#include "../mwworld/class.hpp"
|
#include "../mwworld/class.hpp"
|
||||||
#include "../mwworld/esmstore.hpp"
|
#include "../mwworld/esmstore.hpp"
|
||||||
|
@ -407,6 +409,7 @@ namespace MWWorld
|
||||||
|
|
||||||
void ProjectileManager::moveMagicBolts(float duration)
|
void ProjectileManager::moveMagicBolts(float duration)
|
||||||
{
|
{
|
||||||
|
static const bool normaliseRaceSpeed = Settings::Manager::getBool("normalise race speed", "Game");
|
||||||
for (auto& magicBoltState : mMagicBolts)
|
for (auto& magicBoltState : mMagicBolts)
|
||||||
{
|
{
|
||||||
if (magicBoltState.mToDelete)
|
if (magicBoltState.mToDelete)
|
||||||
|
@ -426,10 +429,16 @@ namespace MWWorld
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const auto& store = MWBase::Environment::get().getWorld()->getStore();
|
||||||
osg::Quat orient = magicBoltState.mNode->getAttitude();
|
osg::Quat orient = magicBoltState.mNode->getAttitude();
|
||||||
static float fTargetSpellMaxSpeed = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>()
|
static float fTargetSpellMaxSpeed = store.get<ESM::GameSetting>().find("fTargetSpellMaxSpeed")->mValue.getFloat();
|
||||||
.find("fTargetSpellMaxSpeed")->mValue.getFloat();
|
|
||||||
float speed = fTargetSpellMaxSpeed * magicBoltState.mSpeed;
|
float speed = fTargetSpellMaxSpeed * magicBoltState.mSpeed;
|
||||||
|
if (!normaliseRaceSpeed && !caster.isEmpty() && caster.getClass().isNpc())
|
||||||
|
{
|
||||||
|
const auto npc = caster.get<ESM::NPC>()->mBase;
|
||||||
|
const auto race = store.get<ESM::Race>().find(npc->mRace);
|
||||||
|
speed *= npc->isMale() ? race->mData.mWeight.mMale : race->mData.mWeight.mFemale;
|
||||||
|
}
|
||||||
osg::Vec3f direction = orient * osg::Vec3f(0,1,0);
|
osg::Vec3f direction = orient * osg::Vec3f(0,1,0);
|
||||||
direction.normalize();
|
direction.normalize();
|
||||||
projectile->setVelocity(direction * speed);
|
projectile->setVelocity(direction * speed);
|
||||||
|
|
|
@ -275,7 +275,7 @@ normalise race speed
|
||||||
:Range: True/False
|
:Range: True/False
|
||||||
:Default: False
|
:Default: False
|
||||||
|
|
||||||
By default race weight is factored into horizontal movement speed like in Morrowind.
|
By default race weight is factored into horizontal movement and magic projectile speed like in Morrowind.
|
||||||
For example, an NPC which has 1.2 race weight is faster than an NPC with the exact same stats and weight 1.0 by a factor of 120%.
|
For example, an NPC which has 1.2 race weight is faster than an NPC with the exact same stats and weight 1.0 by a factor of 120%.
|
||||||
If this setting is true, race weight is ignored in the calculations which allows for a movement behavior
|
If this setting is true, race weight is ignored in the calculations which allows for a movement behavior
|
||||||
equivalent to the one introduced by the equivalent Morrowind Code Patch feature.
|
equivalent to the one introduced by the equivalent Morrowind Code Patch feature.
|
||||||
|
|
Loading…
Reference in a new issue