📄 moveeffectunit.cpp
字号:
// MoveEffectUnit.cpp: implementation of the CMoveEffectUnit class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "MoveEffectUnit.h"
#include "MoveEffectUnitDesc.h"
#include "..\MoveManager.h"
#include "..\ObjectManager.h"
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CMoveEffectUnit::CMoveEffectUnit()
{
}
CMoveEffectUnit::~CMoveEffectUnit()
{
}
void CMoveEffectUnit::Initialize(CEffectUnitDesc* pEffectUnitDesc,EFFECTPARAM* pEffectParam)
{
CEffectUnit::Initialize(pEffectUnitDesc,pEffectParam);
}
void CMoveEffectUnit::Release()
{
CMoveEffectUnitDesc::ReleaseUnit(this);
}
void CMoveEffectUnit::DoOn(EFFECTPARAM* pParam,TARGETSET* pObject)
{
if(pObject->pTarget->GetState() == eObjectState_Die)
{
if((pParam->m_dwFlag & EFFECT_FLAG_DIE) == FALSE)
return;
}
CMoveEffectUnitDesc* pDesc = (CMoveEffectUnitDesc*)m_pEffectUnitDesc;
if(pDesc->m_bYMove) // y绵 捞悼
{
MOVEMGR->EffectYMove(pObject->pTarget,
pDesc->m_Position.x,pDesc->m_Position.y,
pDesc->m_Duration);
}
else // 弊成 捞悼
{
VECTOR3 pos,cpos;
VRand(&pos,&pDesc->m_Position,&pDesc->m_RandomPos);
if(pDesc->m_bApplyWeight)
pos = pos * (1/pObject->pTarget->GetWeight()) * gAntiGravity;
if(pDesc->m_bRelatedCoordinate) // 惑措 谅钎肺 函券
{
float angle = pObject->pTarget->GetAngle();
if(pDesc->IsDangledToOperator() == FALSE)
if(pParam->m_pOperator)
{
angle = pParam->m_pOperator->GetAngle();
angle += gPHI;
}
TransToRelatedCoordinate(&pos,&pos,angle);
}
pObject->pTarget->GetPosition(&cpos);
pos = cpos + pos;
if(pDesc->m_bTurnChar)
{
MOVEMGR->SetLookatPos(pObject->pTarget,&pos,0,gCurTime);
}
MOVEMGR->HeroEffectMove(pObject->pTarget,&pos,pDesc->m_Duration,pParam->m_pOperator);
}
}
void CMoveEffectUnit::DoOff(EFFECTPARAM* pParam,TARGETSET* pObject)
{
}
void CMoveEffectUnit::DoProcess(DWORD tickTime,EFFECTPARAM* pParam)
{
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -