forked from teamnwah/openmw-tes3coop
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);
|
||||
}
|
||||
|
||||
healthdmg = (otherstats.getFatigue().getCurrent() < 1.0f);
|
||||
healthdmg = (otherstats.getFatigue().getCurrent() < 1.0f)
|
||||
|| (otherstats.getMagicEffects().get(ESM::MagicEffect::Paralyze).mMagnitude > 0);
|
||||
if(stats.isWerewolf())
|
||||
{
|
||||
healthdmg = true;
|
||||
|
|
|
@ -797,7 +797,12 @@ namespace MWMechanics
|
|||
iter->second->updateContinuousVfx();
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
void Actors::restoreDynamicStats()
|
||||
|
|
|
@ -91,6 +91,8 @@ namespace MWMechanics
|
|||
mPathFinder.checkPathCompleted(pos.pos[0],pos.pos[1],pos.pos[2]);
|
||||
|
||||
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);
|
||||
MWWorld::Class::get(actor).getMovementSettings(actor).mPosition[1] = 1;
|
||||
|
||||
|
@ -105,6 +107,7 @@ namespace MWMechanics
|
|||
float directionResult = sqrt(directionX * directionX + directionY * directionY);
|
||||
|
||||
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);
|
||||
|
||||
mPathFinder.clearPath();
|
||||
|
|
|
@ -161,6 +161,7 @@ namespace MWMechanics
|
|||
if(distanceBetweenResult <= mMaxDist * mMaxDist)
|
||||
{
|
||||
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);
|
||||
MWWorld::Class::get(actor).getMovementSettings(actor).mPosition[1] = 1;
|
||||
mMaxDist = 470;
|
||||
|
|
|
@ -97,6 +97,7 @@ namespace MWMechanics
|
|||
}
|
||||
|
||||
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);
|
||||
movement.mPosition[1] = 1;
|
||||
|
||||
|
|
|
@ -236,6 +236,7 @@ namespace MWMechanics
|
|||
if(mWalking)
|
||||
{
|
||||
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);
|
||||
MWWorld::Class::get(actor).getMovementSettings(actor).mPosition[1] = 1;
|
||||
|
||||
|
|
|
@ -955,9 +955,12 @@ void CharacterController::update(float duration)
|
|||
refreshCurrentAnims(idlestate, movestate, forcestateupdate);
|
||||
|
||||
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;
|
||||
}
|
||||
else if(cls.getCreatureStats(mPtr).isDead())
|
||||
|
|
Loading…
Reference in a new issue