本文整理汇总了C++中CMoveShape::SetDirEx方法的典型用法代码示例。如果您正苦于以下问题:C++ CMoveShape::SetDirEx方法的具体用法?C++ CMoveShape::SetDirEx怎么用?C++ CMoveShape::SetDirEx使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CMoveShape
的用法示例。
在下文中一共展示了CMoveShape::SetDirEx方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Execute
//执行
void COpDirec::Execute(CMoveShape* pShape)
{
if (pShape == m_pParam->pUser && m_eDir!=eDir_Mouse)
{
return;
}
CMoveShape *pMoveShape = GetOpShape(pShape);
long lX = 0,lY = 0;
if(pMoveShape == NULL)
{
lX = m_pParam->nMouseX;
lY = m_pParam->nMouseY;
float fDir =GetRadianDir((float)m_pParam->pUser->GetTileX(),(float)m_pParam->pUser->GetTileY(),(float)lX,(float)lY);
m_pParam->pUser->SetDir((long)fDir);
//SendChangeDir(m_pParam->pUser);
return;
}
if(m_eDir == eDir_Mouse)
{
lX = m_pParam->nMouseX;
lY = m_pParam->nMouseY;
}
else if(m_eDir == eDir_Self)
{
lX = m_pParam->pUser->GetTileX();
lY = m_pParam->pUser->GetTileY();
}
else if(m_eDir == eDir_Dest && pShape )//&&
{
lX = pShape->GetTileX();
lY = pShape->GetTileY();
if (m_pParam->pMouseShape)
{
lX = m_pParam->pMouseShape->GetTileX();
lY = m_pParam->pMouseShape->GetTileY();
}
}
if((lX !=0 || lY !=0) && pMoveShape)
{
float fDir =GetRadianDir((float)pMoveShape->GetTileX(),(float)pMoveShape->GetTileY(),(float)lX,(float)lY);
pMoveShape->SetDirEx(fDir);
//SendChangeDir(pMoveShape);
}
}
示例2: OnSkillMessage
//.........这里部分代码省略.........
GetGame()->GetGameControl()->SetSendedUseSkillMsgCount(0);
/*if(g_bDebug)
{
char strInfo[512]="";
_snprintf(strInfo,512,"技能吟唱中,次数清0:%d,key:%d",lSkillID,lSkillKey);
PutStringToFile("SkillTimesTest",strInfo);
}*/
}else if (lSkillID>=50000&&lSkillID<=50006)
{
if (lSkillID>=50000&&lSkillID<=50002)
{
((CPlayer*)pMoveShape)->SetToolsID(CDeputyOccuSystemClient::OB_Collection);
}else if (lSkillID>=50003&&lSkillID<=50005)
{
((CPlayer*)pMoveShape)->SetToolsID(CDeputyOccuSystemClient::OB_Facture);
}else if (lSkillID==50006)
{
((CPlayer*)pMoveShape)->SetToolsID(CDeputyOccuSystemClient::OB_TaskCollection,lLevel);
}
}
/////////////////////////////////////////////////////////////////
//char strInfo[512]="";
//_snprintf(strInfo,512,"SKILLTYPE_INTONATE_Set Intonate Skill Key:%d",lSkillKey);
//PutStringToFile("IntonateSkillTest",strInfo);
/////////////////////////////////////////////////////////////////
}
}
else
{
SAFE_DELETE(pSkill);
return;
}
pMoveShape->SetDirEx(fDir);
// 更新快捷栏的冷却动画
if(pMoveShape==GetGame()->GetMainPlayer())
{
GetGame()->GetMainPlayer()->UpdateSkillCoolDownTime(true);
//CSkillListXml::tagSkill *pS = CSkillListXml::GetProperty(lSkillID);
/***********************************************************************/
/* zhaohang fix */
/***********************************************************************/
if(ptagS && pTagSkill && pTagSkill->dwSkillState != 0 && !pTagSkill->bLockSkill)
{
ptagS->dwUseingStartTime = timeGetTime();
}
}
}
else // 施放阶段
{
/***********************************************************************/
/* 赵航 fix */
//CSkillXml *m_pSkill = new CSkillXml();
/***********************************************************************/
ConcreteSkillComp* SkillCom = new ConcreteSkillComp();
//SkillCom的内存交给了CSkillXml的析构来管理
CSkillXml* pSkill = new ConcreteDecSkillXml(SkillCom);
pSkill->IntonateTime(lTime);
if(pSkill&&pSkill->StepRun(lSkillID, lLevel, lType, ID, lDestX, lDestY, fDir, vecType, vecID) )
{
pSkill->SetSkillKey(lSkillKey);
pMoveShape->AddCurSkillList(lSkillKey,pSkill);
CSkillListXml::tagSkill *pTagSkill = CSkillListXml::GetProperty(lSkillID);
// 引导类技能
if(pTagSkill && pTagSkill->bIsLead)