mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-02-10 21:40:15 +00:00
Merge branch 'paralysisagainagain' into 'master'
Make paralysis cancel camera mode changes (#7997) Closes #7997 See merge request OpenMW/openmw!4122
This commit is contained in:
commit
6e0606b55b
@ -176,6 +176,7 @@
|
||||
Bug #7943: Using "addSoulGem" and "dropSoulGem" commands to creatures works only with "Weapon & Shield" flagged ones
|
||||
Bug #7970: Difference of GetPCSleep (?) behavior between vanilla and OpenMW
|
||||
Bug #7980: Paralyzed NPCs' lips move
|
||||
Bug #7997: Can toggle perspective when paralyzed
|
||||
Feature #1415: Infinite fall failsafe
|
||||
Feature #2566: Handle NAM9 records for manual cell references
|
||||
Feature #3537: Shader-based water ripples
|
||||
|
@ -984,8 +984,7 @@ namespace MWClass
|
||||
// TODO: This function is called several times per frame for each NPC.
|
||||
// It would be better to calculate it only once per frame for each NPC and save the result in CreatureStats.
|
||||
const MWMechanics::NpcStats& stats = getNpcStats(ptr);
|
||||
bool godmode = ptr == MWMechanics::getPlayer() && MWBase::Environment::get().getWorld()->getGodModeState();
|
||||
if ((!godmode && stats.isParalyzed()) || stats.getKnockedDown() || stats.isDead())
|
||||
if (stats.isParalyzed() || stats.getKnockedDown() || stats.isDead())
|
||||
return 0.f;
|
||||
|
||||
const MWBase::World* world = MWBase::Environment::get().getWorld();
|
||||
@ -1034,8 +1033,7 @@ namespace MWClass
|
||||
return 0.f;
|
||||
|
||||
const MWMechanics::NpcStats& stats = getNpcStats(ptr);
|
||||
bool godmode = ptr == MWMechanics::getPlayer() && MWBase::Environment::get().getWorld()->getGodModeState();
|
||||
if ((!godmode && stats.isParalyzed()) || stats.getKnockedDown() || stats.isDead())
|
||||
if (stats.isParalyzed() || stats.getKnockedDown() || stats.isDead())
|
||||
return 0.f;
|
||||
|
||||
const GMST& gmst = getGmst();
|
||||
|
@ -749,8 +749,7 @@ namespace MWGui
|
||||
|
||||
// Player must not be paralyzed, knocked down, or dead to pick up an item.
|
||||
const MWMechanics::NpcStats& playerStats = player.getClass().getNpcStats(player);
|
||||
bool godmode = MWBase::Environment::get().getWorld()->getGodModeState();
|
||||
if ((!godmode && playerStats.isParalyzed()) || playerStats.getKnockedDown() || playerStats.isDead())
|
||||
if (playerStats.isParalyzed() || playerStats.getKnockedDown() || playerStats.isDead())
|
||||
return;
|
||||
|
||||
MWBase::Environment::get().getMechanicsManager()->itemTaken(player, object, MWWorld::Ptr(), count);
|
||||
@ -789,8 +788,7 @@ namespace MWGui
|
||||
return;
|
||||
|
||||
const MWMechanics::CreatureStats& stats = player.getClass().getCreatureStats(player);
|
||||
bool godmode = MWBase::Environment::get().getWorld()->getGodModeState();
|
||||
if ((!godmode && stats.isParalyzed()) || stats.getKnockedDown() || stats.isDead() || stats.getHitRecovery())
|
||||
if (stats.isParalyzed() || stats.getKnockedDown() || stats.isDead() || stats.getHitRecovery())
|
||||
return;
|
||||
|
||||
ItemModel::ModelIndex selected = -1;
|
||||
|
@ -353,8 +353,7 @@ namespace MWGui
|
||||
bool isDelayNeeded = MWBase::Environment::get().getMechanicsManager()->isAttackingOrSpell(player)
|
||||
|| playerStats.getKnockedDown() || playerStats.getHitRecovery();
|
||||
|
||||
bool godmode = MWBase::Environment::get().getWorld()->getGodModeState();
|
||||
bool isReturnNeeded = (!godmode && playerStats.isParalyzed()) || playerStats.isDead();
|
||||
bool isReturnNeeded = playerStats.isParalyzed() || playerStats.isDead();
|
||||
|
||||
if (isReturnNeeded)
|
||||
{
|
||||
|
@ -236,9 +236,8 @@ namespace MWGui
|
||||
if (MWBase::Environment::get().getMechanicsManager()->isAttackingOrSpell(player))
|
||||
return;
|
||||
|
||||
bool godmode = MWBase::Environment::get().getWorld()->getGodModeState();
|
||||
const MWMechanics::CreatureStats& stats = player.getClass().getCreatureStats(player);
|
||||
if ((!godmode && stats.isParalyzed()) || stats.getKnockedDown() || stats.isDead() || stats.getHitRecovery())
|
||||
if (stats.isParalyzed() || stats.getKnockedDown() || stats.isDead() || stats.getHitRecovery())
|
||||
return;
|
||||
|
||||
mSpellView->setModel(new SpellModel(MWMechanics::getPlayer()));
|
||||
|
@ -1482,7 +1482,6 @@ namespace MWMechanics
|
||||
if (!playerHitAttemptActor.isInCell())
|
||||
player.getClass().getCreatureStats(player).setHitAttemptActorId(-1);
|
||||
}
|
||||
const bool godmode = MWBase::Environment::get().getWorld()->getGodModeState();
|
||||
const int actorsProcessingRange = Settings::game().mActorsProcessingRange;
|
||||
|
||||
// AI and magic effects update
|
||||
@ -1634,8 +1633,7 @@ namespace MWMechanics
|
||||
world->setActorActive(actor.getPtr(), true);
|
||||
|
||||
const bool isDead = actor.getPtr().getClass().getCreatureStats(actor.getPtr()).isDead();
|
||||
if (!isDead && (!godmode || !isPlayer)
|
||||
&& actor.getPtr().getClass().getCreatureStats(actor.getPtr()).isParalyzed())
|
||||
if (!isDead && actor.getPtr().getClass().getCreatureStats(actor.getPtr()).isParalyzed())
|
||||
ctrl.skipAnim();
|
||||
|
||||
// Handle player last, in case a cell transition occurs by casting a teleportation spell
|
||||
|
@ -241,6 +241,11 @@ namespace MWMechanics
|
||||
|
||||
bool CreatureStats::isParalyzed() const
|
||||
{
|
||||
MWBase::World* world = MWBase::Environment::get().getWorld();
|
||||
const MWWorld::Ptr player = world->getPlayerPtr();
|
||||
if (world->getGodModeState() && this == &player.getClass().getCreatureStats(player))
|
||||
return false;
|
||||
|
||||
return mMagicEffects.getOrDefault(ESM::MagicEffect::Paralyze).getMagnitude() > 0;
|
||||
}
|
||||
|
||||
|
@ -183,8 +183,7 @@ namespace MWWorld
|
||||
|
||||
MWWorld::Ptr player = getPlayer();
|
||||
const MWMechanics::NpcStats& playerStats = player.getClass().getNpcStats(player);
|
||||
bool godmode = MWBase::Environment::get().getWorld()->getGodModeState();
|
||||
if ((!godmode && playerStats.isParalyzed()) || playerStats.getKnockedDown() || playerStats.isDead())
|
||||
if (playerStats.isParalyzed() || playerStats.getKnockedDown() || playerStats.isDead())
|
||||
return;
|
||||
|
||||
MWWorld::Ptr toActivate = MWBase::Environment::get().getWorld()->getFacedObject();
|
||||
|
@ -1,5 +1,6 @@
|
||||
local camera = require('openmw.camera')
|
||||
local core = require('openmw.core')
|
||||
local debug = require('openmw.debug')
|
||||
local input = require('openmw.input')
|
||||
local util = require('openmw.util')
|
||||
local self = require('openmw.self')
|
||||
@ -207,7 +208,9 @@ local function onFrame(dt)
|
||||
primaryMode = mode
|
||||
end
|
||||
if mode ~= MODE.Static then
|
||||
if not next(noModeControl) then
|
||||
local paralysis = Actor.activeEffects(self):getEffect(core.magic.EFFECT_TYPE.Paralyze)
|
||||
local paralyzed = not debug.isGodMode() and paralysis.magnitude > 0
|
||||
if not next(noModeControl) and not paralyzed then
|
||||
updatePOV(dt)
|
||||
updateVanity(dt)
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user