mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-04-02 13:06:41 +00:00
Implement Paralyze magic effect
This commit is contained in:
parent
55c5d7cee4
commit
b22dd40b41
7 changed files with 18 additions and 3 deletions
|
@ -517,7 +517,8 @@ namespace MWClass
|
||||||
MWBase::Environment::get().getSoundManager()->playSound3D(victim, "critical damage", 1.0f, 1.0f);
|
MWBase::Environment::get().getSoundManager()->playSound3D(victim, "critical damage", 1.0f, 1.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
healthdmg = (otherstats.getFatigue().getCurrent() < 1.0f);
|
healthdmg = (otherstats.getFatigue().getCurrent() < 1.0f)
|
||||||
|
|| (otherstats.getMagicEffects().get(ESM::MagicEffect::Paralyze).mMagnitude > 0);
|
||||||
if(stats.isWerewolf())
|
if(stats.isWerewolf())
|
||||||
{
|
{
|
||||||
healthdmg = true;
|
healthdmg = true;
|
||||||
|
|
|
@ -797,7 +797,12 @@ namespace MWMechanics
|
||||||
iter->second->updateContinuousVfx();
|
iter->second->updateContinuousVfx();
|
||||||
|
|
||||||
for(PtrControllerMap::iterator iter(mActors.begin());iter != mActors.end();++iter)
|
for(PtrControllerMap::iterator iter(mActors.begin());iter != mActors.end();++iter)
|
||||||
|
{
|
||||||
|
if (iter->first.getClass().getCreatureStats(iter->first).getMagicEffects().get(
|
||||||
|
ESM::MagicEffect::Paralyze).mMagnitude > 0)
|
||||||
|
iter->second->skipAnim();
|
||||||
iter->second->update(duration);
|
iter->second->update(duration);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
void Actors::restoreDynamicStats()
|
void Actors::restoreDynamicStats()
|
||||||
|
|
|
@ -91,6 +91,8 @@ namespace MWMechanics
|
||||||
mPathFinder.checkPathCompleted(pos.pos[0],pos.pos[1],pos.pos[2]);
|
mPathFinder.checkPathCompleted(pos.pos[0],pos.pos[1],pos.pos[2]);
|
||||||
|
|
||||||
float zAngle = mPathFinder.getZAngleToNext(pos.pos[0], pos.pos[1]);
|
float zAngle = mPathFinder.getZAngleToNext(pos.pos[0], pos.pos[1]);
|
||||||
|
|
||||||
|
// TODO: use movement settings instead of rotating directly
|
||||||
MWBase::Environment::get().getWorld()->rotateObject(actor, 0, 0, zAngle, false);
|
MWBase::Environment::get().getWorld()->rotateObject(actor, 0, 0, zAngle, false);
|
||||||
MWWorld::Class::get(actor).getMovementSettings(actor).mPosition[1] = 1;
|
MWWorld::Class::get(actor).getMovementSettings(actor).mPosition[1] = 1;
|
||||||
|
|
||||||
|
@ -105,6 +107,7 @@ namespace MWMechanics
|
||||||
float directionResult = sqrt(directionX * directionX + directionY * directionY);
|
float directionResult = sqrt(directionX * directionX + directionY * directionY);
|
||||||
|
|
||||||
zAngle = Ogre::Radian( acos(directionY / directionResult) * sgn(asin(directionX / directionResult)) ).valueDegrees();
|
zAngle = Ogre::Radian( acos(directionY / directionResult) * sgn(asin(directionX / directionResult)) ).valueDegrees();
|
||||||
|
// TODO: use movement settings instead of rotating directly
|
||||||
MWBase::Environment::get().getWorld()->rotateObject(actor, 0, 0, zAngle, false);
|
MWBase::Environment::get().getWorld()->rotateObject(actor, 0, 0, zAngle, false);
|
||||||
|
|
||||||
mPathFinder.clearPath();
|
mPathFinder.clearPath();
|
||||||
|
|
|
@ -161,6 +161,7 @@ namespace MWMechanics
|
||||||
if(distanceBetweenResult <= mMaxDist * mMaxDist)
|
if(distanceBetweenResult <= mMaxDist * mMaxDist)
|
||||||
{
|
{
|
||||||
float zAngle = mPathFinder.getZAngleToNext(pos.pos[0], pos.pos[1]);
|
float zAngle = mPathFinder.getZAngleToNext(pos.pos[0], pos.pos[1]);
|
||||||
|
// TODO: use movement settings instead of rotating directly
|
||||||
MWBase::Environment::get().getWorld()->rotateObject(actor, 0, 0, zAngle, false);
|
MWBase::Environment::get().getWorld()->rotateObject(actor, 0, 0, zAngle, false);
|
||||||
MWWorld::Class::get(actor).getMovementSettings(actor).mPosition[1] = 1;
|
MWWorld::Class::get(actor).getMovementSettings(actor).mPosition[1] = 1;
|
||||||
mMaxDist = 470;
|
mMaxDist = 470;
|
||||||
|
|
|
@ -97,6 +97,7 @@ namespace MWMechanics
|
||||||
}
|
}
|
||||||
|
|
||||||
float zAngle = mPathFinder.getZAngleToNext(pos.pos[0], pos.pos[1]);
|
float zAngle = mPathFinder.getZAngleToNext(pos.pos[0], pos.pos[1]);
|
||||||
|
// TODO: use movement settings instead of rotating directly
|
||||||
world->rotateObject(actor, 0, 0, zAngle, false);
|
world->rotateObject(actor, 0, 0, zAngle, false);
|
||||||
movement.mPosition[1] = 1;
|
movement.mPosition[1] = 1;
|
||||||
|
|
||||||
|
|
|
@ -236,6 +236,7 @@ namespace MWMechanics
|
||||||
if(mWalking)
|
if(mWalking)
|
||||||
{
|
{
|
||||||
float zAngle = mPathFinder.getZAngleToNext(pos.pos[0], pos.pos[1]);
|
float zAngle = mPathFinder.getZAngleToNext(pos.pos[0], pos.pos[1]);
|
||||||
|
// TODO: use movement settings instead of rotating directly
|
||||||
world->rotateObject(actor, 0, 0, zAngle, false);
|
world->rotateObject(actor, 0, 0, zAngle, false);
|
||||||
MWWorld::Class::get(actor).getMovementSettings(actor).mPosition[1] = 1;
|
MWWorld::Class::get(actor).getMovementSettings(actor).mPosition[1] = 1;
|
||||||
|
|
||||||
|
|
|
@ -955,9 +955,12 @@ void CharacterController::update(float duration)
|
||||||
refreshCurrentAnims(idlestate, movestate, forcestateupdate);
|
refreshCurrentAnims(idlestate, movestate, forcestateupdate);
|
||||||
|
|
||||||
rot *= duration * Ogre::Math::RadiansToDegrees(1.0f);
|
rot *= duration * Ogre::Math::RadiansToDegrees(1.0f);
|
||||||
world->rotateObject(mPtr, rot.x, rot.y, rot.z, true);
|
|
||||||
|
|
||||||
world->queueMovement(mPtr, vec);
|
if (!mSkipAnim)
|
||||||
|
{
|
||||||
|
world->rotateObject(mPtr, rot.x, rot.y, rot.z, true);
|
||||||
|
world->queueMovement(mPtr, vec);
|
||||||
|
}
|
||||||
movement = vec;
|
movement = vec;
|
||||||
}
|
}
|
||||||
else if(cls.getCreatureStats(mPtr).isDead())
|
else if(cls.getCreatureStats(mPtr).isDead())
|
||||||
|
|
Loading…
Reference in a new issue