From d88f4e26aed2c48046386b7bea0efd1d714d4b4e Mon Sep 17 00:00:00 2001 From: Alex Date: Tue, 20 Sep 2016 20:21:53 -0400 Subject: [PATCH 1/6] Remove psuedonym from AUTHORS.md Removed myself from public relations as podcaster as well. Someone else is doing that now. I doubt this file is very up-to-date anyway, heh. --- AUTHORS.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/AUTHORS.md b/AUTHORS.md index 204d45258..2a43168e6 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -17,7 +17,7 @@ Programmers aegis Aleksandar Jovanov Alex Haddad (rainChu) - Alex McKibben (WeirdSexy) + Alex McKibben alexanderkjall Alexander Nadeau (wareya) Alexander Olofsson (Ace) @@ -159,7 +159,6 @@ Packagers Public Relations and Translations --------------------------------- - Alex McKibben (WeirdSexy) - Podcaster Artem Kotsynyak (greye) - Russian News Writer Jim Clauwaert (Zedd) - Public Outreach Julien Voisin (jvoisin/ap0) - French News Writer From 563ae479e879691622e6628606b23bd8452254cd Mon Sep 17 00:00:00 2001 From: Allofich Date: Wed, 21 Sep 2016 23:34:32 +0900 Subject: [PATCH 2/6] Give "on touch" spells same range as vanilla MW --- apps/openmw/mwworld/worldimp.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/apps/openmw/mwworld/worldimp.cpp b/apps/openmw/mwworld/worldimp.cpp index b5ef7de52..73e0bdf06 100644 --- a/apps/openmw/mwworld/worldimp.cpp +++ b/apps/openmw/mwworld/worldimp.cpp @@ -2642,7 +2642,8 @@ namespace MWWorld // Get the target to use for "on touch" effects, using the facing direction from Head node MWWorld::Ptr target; - float distance = 192.f; // ?? + float distance = getMaxActivationDistance(); + osg::Vec3f hitPosition = actor.getRefData().getPosition().asVec3(); osg::Vec3f origin = getActorHeadTransform(actor).getTrans(); @@ -2680,6 +2681,16 @@ namespace MWWorld hitPosition = result2.mHitPointWorld; } + // When targeting an actor that is in combat with an "on touch" spell, + // compare against the minimum of activation distance and combat distance. + + if (!target.isEmpty() && target.getClass().isActor() && target.getClass().getCreatureStats (target).getAiSequence().isInCombat()) + { + distance = std::min (distance, getStore().get().find("fCombatDistance")->getFloat()); + if (distance < dist1 && distance < dist2) + target = NULL; + } + std::string selectedSpell = stats.getSpells().getSelectedSpell(); MWMechanics::CastSpell cast(actor, target); From 37cc4e9efec3d766cee0905b904916b38ed19ec9 Mon Sep 17 00:00:00 2001 From: Allofich Date: Thu, 22 Sep 2016 00:00:11 +0900 Subject: [PATCH 3/6] Don't play area vfx for 0-area touch spells that hit non-actors --- apps/openmw/mwworld/worldimp.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/openmw/mwworld/worldimp.cpp b/apps/openmw/mwworld/worldimp.cpp index b5ef7de52..b877aef34 100644 --- a/apps/openmw/mwworld/worldimp.cpp +++ b/apps/openmw/mwworld/worldimp.cpp @@ -3176,7 +3176,8 @@ namespace MWWorld if (effectIt->mArea <= 0) { - mRendering->spawnEffect("meshes\\" + areaStatic->mModel, texture, origin, 1.0f); + if (effectIt->mRange == ESM::RT_Target) + mRendering->spawnEffect("meshes\\" + areaStatic->mModel, texture, origin, 1.0f); continue; } else From eecf412b853c2fcdd436bb45c9b54fd4067a207b Mon Sep 17 00:00:00 2001 From: Allofich Date: Fri, 23 Sep 2016 00:16:51 +0900 Subject: [PATCH 4/6] Recreate vanilla-like behavior for telekinesis and touch spells --- apps/openmw/mwworld/worldimp.cpp | 25 ++++++++++++++++++------- apps/openmw/mwworld/worldimp.hpp | 1 + 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/apps/openmw/mwworld/worldimp.cpp b/apps/openmw/mwworld/worldimp.cpp index 9b371b69f..c6a94a48e 100644 --- a/apps/openmw/mwworld/worldimp.cpp +++ b/apps/openmw/mwworld/worldimp.cpp @@ -1020,12 +1020,7 @@ namespace MWWorld facedObject = getFacedObject(getMaxActivationDistance() * 50, false); else { - float telekinesisRangeBonus = - mPlayer->getPlayer().getClass().getCreatureStats(mPlayer->getPlayer()).getMagicEffects() - .get(ESM::MagicEffect::Telekinesis).getMagnitude(); - telekinesisRangeBonus = feetToGameUnits(telekinesisRangeBonus); - - float activationDistance = getMaxActivationDistance() + telekinesisRangeBonus; + float activationDistance = getActivationDistancePlusTelekinesis(); facedObject = getFacedObject(activationDistance, true); @@ -2642,7 +2637,7 @@ namespace MWWorld // Get the target to use for "on touch" effects, using the facing direction from Head node MWWorld::Ptr target; - float distance = getMaxActivationDistance(); + float distance = getActivationDistancePlusTelekinesis(); osg::Vec3f hitPosition = actor.getRefData().getPosition().asVec3(); osg::Vec3f origin = getActorHeadTransform(actor).getTrans(); @@ -2674,11 +2669,15 @@ namespace MWWorld { target = result1.mHitObject; hitPosition = result1.mHitPos; + if (!target.isEmpty() && dist1 > getMaxActivationDistance() && !target.getClass().allowTelekinesis(target)) + target = NULL; } else if (result2.mHit) { target = result2.mHitObject; hitPosition = result2.mHitPointWorld; + if (!target.isEmpty() && dist2 > getMaxActivationDistance() && !target.getClass().allowTelekinesis(target)) + target = NULL; } // When targeting an actor that is in combat with an "on touch" spell, @@ -3011,6 +3010,18 @@ namespace MWWorld return feet * 22; } + float World::getActivationDistancePlusTelekinesis() + { + float telekinesisRangeBonus = + mPlayer->getPlayer().getClass().getCreatureStats(mPlayer->getPlayer()).getMagicEffects() + .get(ESM::MagicEffect::Telekinesis).getMagnitude(); + telekinesisRangeBonus = feetToGameUnits(telekinesisRangeBonus); + + float activationDistance = getMaxActivationDistance() + telekinesisRangeBonus; + + return activationDistance; + } + MWWorld::Ptr World::getPlayerPtr() { return mPlayer->getPlayer(); diff --git a/apps/openmw/mwworld/worldimp.hpp b/apps/openmw/mwworld/worldimp.hpp index 8774e549f..3508c0b46 100644 --- a/apps/openmw/mwworld/worldimp.hpp +++ b/apps/openmw/mwworld/worldimp.hpp @@ -168,6 +168,7 @@ namespace MWWorld int mDaysInPrison; float feetToGameUnits(float feet); + float getActivationDistancePlusTelekinesis(); MWWorld::ConstPtr getClosestMarker( const MWWorld::Ptr &ptr, const std::string &id ); MWWorld::ConstPtr getClosestMarkerFromExteriorPosition( const osg::Vec3f& worldPos, const std::string &id ); From 0c603e986dc0e86c20768c3d62f5391c440a0f45 Mon Sep 17 00:00:00 2001 From: Allofich Date: Fri, 23 Sep 2016 01:58:12 +0900 Subject: [PATCH 5/6] Don't play touch spell explosions on non-activatable statics --- apps/openmw/mwworld/worldimp.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apps/openmw/mwworld/worldimp.cpp b/apps/openmw/mwworld/worldimp.cpp index c6a94a48e..af0551e69 100644 --- a/apps/openmw/mwworld/worldimp.cpp +++ b/apps/openmw/mwworld/worldimp.cpp @@ -3187,6 +3187,9 @@ namespace MWWorld if (effectIt->mRange != rangeType || (effectIt->mArea <= 0 && !ignore.isEmpty() && ignore.getClass().isActor())) continue; // Not right range type, or not area effect and hit an actor + if (effectIt->mRange == ESM::RT_Touch && (!ignore.isEmpty()) && (!ignore.getClass().isActor() && !ignore.getClass().canBeActivated(ignore))) + continue; // Don't play explosion for touch spells on non-activatable objects + // Spawn the explosion orb effect const ESM::Static* areaStatic; if (!effect->mArea.empty()) From 0582f2d91822339341ecb7847ad797748a1457b4 Mon Sep 17 00:00:00 2001 From: Allofich Date: Fri, 23 Sep 2016 20:35:22 +0900 Subject: [PATCH 6/6] Adjust touch spell/telekinesis interaction --- apps/openmw/mwworld/worldimp.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/openmw/mwworld/worldimp.cpp b/apps/openmw/mwworld/worldimp.cpp index af0551e69..328a67ecb 100644 --- a/apps/openmw/mwworld/worldimp.cpp +++ b/apps/openmw/mwworld/worldimp.cpp @@ -2669,15 +2669,15 @@ namespace MWWorld { target = result1.mHitObject; hitPosition = result1.mHitPos; - if (!target.isEmpty() && dist1 > getMaxActivationDistance() && !target.getClass().allowTelekinesis(target)) - target = NULL; + if (dist1 > getMaxActivationDistance() && !target.isEmpty() && (target.getClass().isActor() || !target.getClass().canBeActivated(target))) + target = NULL; } else if (result2.mHit) { target = result2.mHitObject; hitPosition = result2.mHitPointWorld; - if (!target.isEmpty() && dist2 > getMaxActivationDistance() && !target.getClass().allowTelekinesis(target)) - target = NULL; + if (dist2 > getMaxActivationDistance() && !target.isEmpty() && (target.getClass().isActor() || !target.getClass().canBeActivated(target))) + target = NULL; } // When targeting an actor that is in combat with an "on touch" spell,