BOOL CActorInstance::ComboAttack(DWORD dwMotionIndex, float fDirRot, float fBlendTime) { BlendRotation(fDirRot, fBlendTime); SetAdvancingRotation(fDirRot); InterceptOnceMotion(dwMotionIndex, fBlendTime, 0, __GetAttackSpeed()); __OnAttack(dwMotionIndex); NEW_SetAtkPixelPosition(NEW_GetCurPixelPositionRef()); return TRUE; }
BOOL CActorInstance::NormalAttack(float fDirRot, float fBlendTime) { WORD wMotionIndex; if (!m_pkCurRaceData->GetNormalAttackIndex(m_wcurMotionMode, &wMotionIndex)) return FALSE; BlendRotation(fDirRot, fBlendTime); SetAdvancingRotation(fDirRot); InterceptOnceMotion(wMotionIndex, 0.1f, 0, __GetAttackSpeed()); __OnAttack(wMotionIndex); NEW_SetAtkPixelPosition(NEW_GetCurPixelPositionRef()); return TRUE; }
void CActorInstance::__Push(int x, int y) { if (IsResistFallen()) return; //DWORD dwVID=GetVirtualID(); //Tracenf("VID %d SyncPixelPosition %d %d", dwVID, x, y); const D3DXVECTOR3& c_rv3Src=GetPosition(); const D3DXVECTOR3 c_v3Dst=D3DXVECTOR3(x, -y, c_rv3Src.z); const D3DXVECTOR3 c_v3Delta=c_v3Dst-c_rv3Src; const int LoopValue = 100; const D3DXVECTOR3 inc=c_v3Delta / LoopValue; D3DXVECTOR3 v3Movement(0.0f, 0.0f, 0.0f); IPhysicsWorld* pWorld = IPhysicsWorld::GetPhysicsWorld(); if (!pWorld) { return; } for(int i = 0; i < LoopValue; ++i) { if (pWorld->isPhysicalCollision(c_rv3Src + v3Movement)) { ResetBlendingPosition(); return; } v3Movement += inc; } SetBlendingPosition(c_v3Dst); if (!IsUsingSkill()) { int len=sqrt(c_v3Delta.x*c_v3Delta.x+c_v3Delta.y*c_v3Delta.y); if (len>150.0f) { InterceptOnceMotion(CRaceMotionData::NAME_DAMAGE_FLYING); PushOnceMotion(CRaceMotionData::NAME_STAND_UP); } } }
void CActorInstance::OnShootDamage() { if (IsStun()) { Die(); } else { __Shake(100); if (!isLock() && !__IsKnockDownMotion() && !__IsStandUpMotion()) { if (InterceptOnceMotion(CRaceMotionData::NAME_DAMAGE)) PushLoopMotion(CRaceMotionData::NAME_WAIT); } } }