diff --git a/apps/openmw/mwmechanics/spellcasting.cpp b/apps/openmw/mwmechanics/spellcasting.cpp index e9719d5171..1388d5f57e 100644 --- a/apps/openmw/mwmechanics/spellcasting.cpp +++ b/apps/openmw/mwmechanics/spellcasting.cpp @@ -543,8 +543,9 @@ namespace MWMechanics std::string texture = ""; - // Use particle textures for non-harmful effects - if (!magicEffect->mParticle.empty() && !(magicEffect->mData.mFlags & ESM::MagicEffect::Harmful)) + // TODO: Choosing whether to apply the override texture should be chosen based on nodes in the .NIF file. + if (magicEffect->mHit.empty() || magicEffect->mHit == "VFX_DefaultHit" || magicEffect->mHit == "VFX_MysticismHit" + || magicEffect->mHit == "VFX_SoulTrapHit") texture = magicEffect->mParticle; // TODO: VFX are no longer active after saving/reloading the game @@ -939,12 +940,18 @@ namespace MWMechanics if (mCaster.getClass().isActor()) // TODO: Non-actors (except for large statics?) should also create a spell cast vfx { const ESM::Static* castStatic; + std::string texture = ""; + if (!effect->mCasting.empty()) castStatic = store.get().find (effect->mCasting); else castStatic = store.get().find ("VFX_DefaultCast"); - animation->addEffect("meshes\\" + castStatic->mModel, effect->mIndex); + // TODO: Choosing whether to apply the override texture should be chosen based on nodes in the .NIF file. + if (effect->mCasting.empty() || effect->mCasting == "VFX_DefaultCast" || effect->mCasting == "VFX_ShieldCast") + texture = effect->mParticle; + + animation->addEffect("meshes\\" + castStatic->mModel, effect->mIndex, false, "", texture); } if (!mCaster.getClass().isActor()) diff --git a/apps/openmw/mwworld/projectilemanager.cpp b/apps/openmw/mwworld/projectilemanager.cpp index 07a40a03e1..277ac58695 100644 --- a/apps/openmw/mwworld/projectilemanager.cpp +++ b/apps/openmw/mwworld/projectilemanager.cpp @@ -79,7 +79,10 @@ namespace { const ESM::MagicEffect *magicEffect = MWBase::Environment::get().getWorld()->getStore().get().find ( effects.mList.begin()->mEffectID); - texture = magicEffect->mParticle; + + // TODO: Choosing whether to apply the override texture should be chosen based on nodes in the .NIF file. + if (magicEffect->mBolt.empty() || magicEffect->mBolt == "VFX_DefaultBolt" || magicEffect->mBolt == "VFX_DestructBolt") + texture = magicEffect->mParticle; } if (projectileEffects.mList.size() > 1) // insert a VFX_Multiple projectile if there are multiple projectile effects diff --git a/apps/openmw/mwworld/worldimp.cpp b/apps/openmw/mwworld/worldimp.cpp index 1b83345597..d3e6db3283 100644 --- a/apps/openmw/mwworld/worldimp.cpp +++ b/apps/openmw/mwworld/worldimp.cpp @@ -3163,11 +3163,7 @@ namespace MWWorld const ESM::MagicEffect* effect = getStore().get().find(effectIt->mEffectID); if ((effectIt->mArea <= 0 && !ignore.isEmpty() && ignore.getClass().isActor()) || effectIt->mRange != rangeType) -<<<<<<< fe3a033642f21393bc267afa4edcc373c9d5f80b continue; // Not right range type, or not area effect and hit an actor -======= - continue; // Not right range type ->>>>>>> Use particle texture for "hit" effects // Spawn the explosion orb effect const ESM::Static* areaStatic; @@ -3176,13 +3172,19 @@ namespace MWWorld else areaStatic = getStore().get().find ("VFX_DefaultArea"); + std::string texture = ""; + + // TODO: Choosing whether to apply the override texture should be chosen based on nodes in the .NIF file. + if (effect->mArea.empty() || effect->mArea == "VFX_DefaultArea") + texture = effect->mParticle; + if (effectIt->mArea <= 0) { - mRendering->spawnEffect("meshes\\" + areaStatic->mModel, "", origin, 1.0f); + mRendering->spawnEffect("meshes\\" + areaStatic->mModel, texture, origin, 1.0f); continue; } else - mRendering->spawnEffect("meshes\\" + areaStatic->mModel, "", origin, static_cast(effectIt->mArea * 2)); + mRendering->spawnEffect("meshes\\" + areaStatic->mModel, texture, origin, static_cast(effectIt->mArea * 2)); // Play explosion sound (make sure to use NoTrack, since we will delete the projectile now) static const std::string schools[] = {