#include "StdAfx.h" #include "DnActionBase.h" #include "DnRenderBase.h" #include "DnWeapon.h" #include "DnProjectile.h" #include "DNGameServerManager.h" #include "PerfCheck.h" #include "DnActionSpecificInfo.h" CDnActionBase::CDnActionBase() { m_pRender = NULL; ResetActionBase(); m_CustomActionTime = 0; m_fCustomPrevFrame = 0.f; // ÀÌ Æ÷ÀÎÅͰ¡ °¡¸®Å°´Â ±¸Á¶Ã¼ÀÇ ÁÖ¼Ò´Â ÇÁ·Î±×·¥ÀÌ Á¾·áµÇ±â Àü±îÁø º¯ÇÏÁö ¾Ê´Â´Ù. m_pProjectileCountInfo = NULL; m_pCheckPreSignalFunc = CDnActionBase::CheckPreSignal; m_pCheckPostSignalFunc = CDnActionBase::CheckPostSignal; } void CDnActionBase::ResetActionBase() { m_LocalTime = 0; m_ActionTime = 0; m_nActionIndex = -1; m_nPrevActionIndex = -1; m_fPrevFrame = 0.f; m_fFrame = 0.f; m_fQueueBlendFrame = m_fQueueStartFrame = 0.f; m_nCustomActionIndex = -1; m_nLoopCount = 0; m_fFPS = 60.f; m_bCustomProcessSignal = false; } CDnActionBase::~CDnActionBase() { FreeAction(); } bool CDnActionBase::Initialize( CDnRenderBase *pRender ) { m_pRender = pRender; return true; } void CDnActionBase::ProcessAction( LOCAL_TIME LocalTime, float fDelta ) { m_LocalTime = LocalTime; if( !m_szActionQueue.empty() ) { if( m_fQueueBlendFrame == -1 ) { ActionElementStruct *pStruct = GetElement( m_nActionIndex ); if( pStruct ) { m_fQueueBlendFrame = (float)pStruct->dwBlendFrame; } } SetAction( m_szActionQueue.c_str(), m_fQueueStartFrame, m_fQueueBlendFrame ); m_szActionQueue.clear(); } if( m_nActionIndex == -1 ) return; ActionElementStruct *pStruct = GetElement( m_nActionIndex ); if( 0.0f < m_fFPS ) m_fFrame = ( ( m_LocalTime - m_ActionTime ) / 1000.f ) * m_fFPS; else return; if( !pStruct ) return; if( m_fFrame < 0.f ) m_fFrame = (float)pStruct->dwLength + 1.f; if( m_fFrame > (float)pStruct->dwLength ) { ProcessSignal( pStruct, m_fFrame, m_fPrevFrame ); if( m_pRender && m_nVecAniIndexList[m_nActionIndex] != -1 ) { EtVector3 vDist; m_pRender->CalcAniDistance( m_nVecAniIndexList[m_nActionIndex], (float)pStruct->dwLength, m_fPrevFrame, vDist ); m_pRender->AddAniDistance( vDist ); } if( m_nLoopCount > 0 || m_nLoopCount == -1 ) { if( m_nLoopCount > 0 ) m_nLoopCount--; OnLoopAction( m_fFrame, m_fPrevFrame ); float fTemp = m_fFrame - (float)pStruct->dwLength; if( pStruct->szNextActionName == pStruct->szName ) { fTemp += (float)pStruct->dwNextActionFrame; if( fTemp > (float)pStruct->dwLength ) fTemp = (float)pStruct->dwLength; } SetAction( m_szAction.c_str(), fTemp, 0.f, true ); OnNextAction( m_szAction.c_str() , pStruct->szNextActionName.c_str() ); } else { OnFinishAction(m_szAction.c_str(), LocalTime); if( pStruct->szNextActionName.empty() ) { m_nPrevActionIndex = m_nActionIndex; m_nActionIndex = -1; m_fFrame = -1.f; m_szAction.clear(); return; } else { SetAction( pStruct->szNextActionName.c_str(), ( pStruct->dwNextActionFrame == 0 ) ? 0.f : (float)pStruct->dwNextActionFrame - 0.001f, (float)pStruct->dwBlendFrame ); if( m_fFrame > 0.f ) m_fPrevFrame -= 1.f; OnNextAction( m_szAction.c_str() , pStruct->szNextActionName.c_str() ); } } if( m_nActionIndex == -1 ) return; pStruct = GetElement( m_nActionIndex ); if( !pStruct ) return; } if( m_nCustomActionIndex != -1 ) { ActionElementStruct *pCustomStruct = GetElement( m_nCustomActionIndex ); if( pCustomStruct ) { float fFrame = ( ( m_LocalTime - m_CustomActionTime ) / 1000.f ) * m_fFPS; if( fFrame > (float)pCustomStruct->dwLength ) { ResetCustomAction(); ProcessSignal( pCustomStruct, fFrame, m_fCustomPrevFrame ); } else { m_bCustomProcessSignal = true; float fTemp = m_fCustomPrevFrame; ProcessSignal( pCustomStruct, fFrame, m_fCustomPrevFrame ); m_bCustomProcessSignal = false; if( m_fCustomPrevFrame == fTemp ) { if( fFrame == m_fCustomPrevFrame ) m_fCustomPrevFrame = fFrame + 0.001f; else m_fCustomPrevFrame = fFrame; } } } } // CanMove °¡ True À̰í CustomAction ÀÌ ½ÇÇàµÇ´Â °æ¿ì¿¡ // Input Signal µéÀº À̵¿¿¡ ÀÖ´Â ½Ã±×³ÎµéÀ» ó¸®ÇØÁÖ¸é ÆíÇϱ⠶«½Ã ÀÏ´Ü Ç®¾î³õ´Â´Ù.. // ÀÌÄÉ Çϸé CanMove °¡ Áß°£¿¡ True ·ç ¹Ù²î´Â °æ¿ì¿¡ ±× ¾Æ·¡ Input Signal µéÀ» ³Ö¾îÁÙ Çʿ䰡 ¾ø´Ù. // ´Ü ¿òÁ÷ÀÌÁö ¾Ê¾ÒÀ» °æ¿ì¿£ Move ÂÊ¿¡ ¹ÚÇôÀÖ´Â SignalµéÀÌ Àû¿ëµÇÁö ¾ÊÀ¸¹Ç·Î ÇÊ¿ä½Ã Ãß°¡·Î ³Ö¾îÁÖ±æ ¹Ù¶÷ // ProcessSignal( pStruct, m_fFrame, m_fPrevFrame ); else { ProcessSignal( pStruct, m_fFrame, m_fPrevFrame ); } if( m_fFrame == m_fPrevFrame ) m_fPrevFrame = m_fFrame + 0.001f; else m_fPrevFrame = m_fFrame; } void CDnActionBase::ProcessSignal( ActionElementStruct *pStruct, float fFrame, float fPrevFrame ) { CEtActionSignal *pSignal; for( DWORD i=0; ipVecSignalList.size(); i++ ) { pSignal = pStruct->pVecSignalList[i]; if( pSignal->CheckSignal( fPrevFrame, fFrame ) == true ) { LOCAL_TIME StartTime = m_LocalTime - (LOCAL_TIME)( 1000.f / m_fFPS * ( fFrame - pSignal->GetStartFrame() ) ); LOCAL_TIME EndTime = m_LocalTime + (LOCAL_TIME)( 1000.f / m_fFPS * ( pSignal->GetEndFrame() - fFrame ) ); OnSignal( (SignalTypeEnum)pSignal->GetSignalIndex(), pSignal->GetData(), m_LocalTime, StartTime, EndTime, pSignal->GetSignalListArrayIndex() ); } if( !m_szActionQueue.empty() ) break; } } void CDnActionBase::SetAction( const char *szActionName, float fFrame, float fBlendFrame, bool bLoop ) { if (szActionName == NULL) return; int nIndex = GetElementIndex( szActionName ); if( nIndex == -1 ) { #ifdef _DEBUG OutputDebug( "Can't find Action : %s, %s\n", m_szFileName.c_str(), szActionName ); #endif return; } std::string szPrevAction = m_szAction; m_nPrevActionIndex = m_nActionIndex; m_nActionIndex = nIndex; m_szAction = szActionName; m_fFrame = m_fPrevFrame = (float)fFrame; m_ActionTime = m_LocalTime - (LOCAL_TIME)( fFrame / m_fFPS * 1000.f ); if( m_ActionTime < 0 ) m_ActionTime = 0; if( m_pRender && m_nVecAniIndexList[nIndex] != -1 ) { m_pRender->ChangeAnimation( m_nVecAniIndexList[nIndex], fFrame, fBlendFrame ); if( bLoop ) m_pRender->SetPrevFrame( 0.f ); } OnChangeAction( szPrevAction.c_str() ); } void CDnActionBase::SetActionQueue( const char *szActionName, int nLoopCount, float fBlendFrame, float fStartFrame ) { m_szActionQueue = szActionName; m_fQueueBlendFrame = fBlendFrame; m_fQueueStartFrame = fStartFrame; m_nLoopCount = nLoopCount; OnChangeActionQueue( m_szAction.c_str() ); } const char *CDnActionBase::GetCurrentAction() { if( !m_szActionQueue.empty() ) return m_szActionQueue.c_str(); return m_szAction.c_str(); } void CDnActionBase::SetCustomAction( const char *szActionName, float fFrame ) { m_szCustomAction = szActionName; m_CustomActionTime = m_LocalTime - (LOCAL_TIME)( fFrame / m_fFPS * 1000.f ); m_nCustomActionIndex = GetElementIndex( szActionName ); m_fCustomPrevFrame = fFrame - 1.f; } bool CDnActionBase::IsCustomAction() { return ( m_nCustomActionIndex == -1 ) ? false : true; } void CDnActionBase::ResetCustomAction() { m_szCustomAction.clear(); m_nCustomActionIndex = -1; } #include "DNConfig.h" extern TGameConfig g_Config; bool CDnActionBase::LoadAction( const char *szFullPathName ) { m_ProjectileCountInfoForInit.Clear(); m_SkillChainInfoForInit.Clear(); m_PassiveSkillInfoForInit.Clear(); m_BasicAttackInfoForInit.Clear(); bool bResult = false; bResult = CEtActionBase::LoadAction( szFullPathName ); if( bResult ) CacheAniIndex(); if( bResult ) { if( false == m_ProjectileCountInfoForInit.mapMaxProjectileCountInAction.empty() || false == m_ProjectileCountInfoForInit.mapSendActionWeapon.empty() ) { if (g_Config.bPreLoad && g_Config.bAllLoaded) { //ÇÁ¸®·Îµå°¡ ÄÑÁ®ÀÖÀ¸¸é ¼­¹ö±âµ¿½Ã À̿ܿ¡ ¿©±â¿¡ µé¾î¿À¸é ¾ÈµÊ´Ù! ÀÏ´Ü ·Î±×¹ÛÀ½ g_Log.Log(LogType::_PRELOADED_DYNAMICLOAD, L"DynamicLoad [%S]\n", szFullPathName); } CDnActionSpecificInfo::GetInstance().AddProjectileSignalInfo( szFullPathName, m_ProjectileCountInfoForInit ); } m_pProjectileCountInfo = CDnActionSpecificInfo::GetInstance().FindProjectileSignalInfo( szFullPathName ); if( false == m_SkillChainInfoForInit.setSkillChainAction.empty() ) { if (g_Config.bPreLoad && g_Config.bAllLoaded) { //ÇÁ¸®·Îµå°¡ ÄÑÁ®ÀÖÀ¸¸é ¼­¹ö±âµ¿½Ã À̿ܿ¡ ¿©±â¿¡ µé¾î¿À¸é ¾ÈµÊ´Ù! ÀÏ´Ü ·Î±×¹ÛÀ½ g_Log.Log(LogType::_PRELOADED_DYNAMICLOAD, L"DynamicLoad [%S]\n", szFullPathName); } CDnActionSpecificInfo::GetInstance().AddSkillChainActionSet( szFullPathName, m_SkillChainInfoForInit ); } m_pSetSkillChainAction = CDnActionSpecificInfo::GetInstance().FindSkillChainActionSet( szFullPathName ); if( false == m_PassiveSkillInfoForInit.mapPassiveSkillInfo.empty() ) { if (g_Config.bPreLoad && g_Config.bAllLoaded) { //ÇÁ¸®·Îµå°¡ ÄÑÁ®ÀÖÀ¸¸é ¼­¹ö±âµ¿½Ã À̿ܿ¡ ¿©±â¿¡ µé¾î¿À¸é ¾ÈµÊ´Ù! ÀÏ´Ü ·Î±×¹ÛÀ½ g_Log.Log(LogType::_PRELOADED_DYNAMICLOAD, L"DynamicLoad [%S]\n", szFullPathName); } CDnActionSpecificInfo::GetInstance().AddPassiveSkillInfo( szFullPathName, m_PassiveSkillInfoForInit ); } m_pPassiveSkillInfo = CDnActionSpecificInfo::GetInstance().FindPassiveSkillInfo( szFullPathName ); if( false == m_BasicAttackInfoForInit.mapBasicAttackInfo.empty() ) { if (g_Config.bPreLoad && g_Config.bAllLoaded) { //ÇÁ¸®·Îµå°¡ ÄÑÁ®ÀÖÀ¸¸é ¼­¹ö±âµ¿½Ã À̿ܿ¡ ¿©±â¿¡ µé¾î¿À¸é ¾ÈµÊ´Ù! ÀÏ´Ü ·Î±×¹ÛÀ½ g_Log.Log(LogType::_PRELOADED_DYNAMICLOAD, L"DynamicLoad [%S]\n", szFullPathName); } CDnActionSpecificInfo::GetInstance().AddBasicAttackActionInfo( szFullPathName, m_BasicAttackInfoForInit ); } m_pBasicAttackInfo = CDnActionSpecificInfo::GetInstance().FindBasicAttackInfo( szFullPathName ); } return bResult; } void CDnActionBase::FreeAction() { CEtActionBase::FreeAction(); } void CDnActionBase::CacheAniIndex() { m_nVecAniIndexList.clear(); // ¼­¹ö ´ýÇÁ , ÄÁÅ×À̳ʿ¡ Æ÷ÀÎÅ͸¦ ¹°·Á³õ´Â °æ¿ì´Â Å©·¡½¬¸¦ À¯¹ßÇÒ¼ö ÀÖ´Ù ÀÏ´Ü empty() üũ¸¦ Ãß°¡Çϰí empty() // ÀÚü¸¦ ÄÝÇÏ´Ù°¡ Å©·¡½¬°¡ ³­´Ù¸é ÀڷᱸÁ¶¸¦ ¹Ù²ã¾ßÇÒµí ½Í½À´Ï´Ù. if (m_pVecActionElementList == NULL || m_pVecActionElementList->empty() ) return; for( DWORD i=0; isize(); i++ ) { int nIndex = -1; if( m_pRender && (*m_pVecActionElementList)[i] && !(*m_pVecActionElementList)[i]->szLinkAniName.empty() ) { nIndex = m_pRender->GetAniIndex( (*m_pVecActionElementList)[i]->szLinkAniName.c_str() ); } m_nVecAniIndexList.push_back( nIndex ); } } void CDnActionBase::CheckPreSignal( ActionElementStruct *pElement, int nElementIndex, CEtActionSignal *pSignal, int nSignalIndex, CEtActionBase *pActionBase ) { /* ÁÖÀÇ.. ¹Ì¸® »ý¼º½Ã Room Æ÷ÀÎÅ͸¦ ³Ñ°Ü¾ß ÇÏ´Â °æ¿ì°¡ Àִµ¥¿ä.. This¸¦ ¾ò¾î¼­ ³Ö¾îÁÖ°Ô µÇ¸é ¾ÈµË´Ï´Ù. ¹Ýµå½Ã (CMultiRoom*)g_pGameServerManager->GetRootRoom() ·ëÀ» ¾ò¾î¼­ ¼ÂÆÃÇÏ½Ã°í ¾ò¾î¿À½Ç¶§µµ ÇØ´ç °´Ã¼ÀÇ ·ëÀ» ¾òÀ¸½Ã¸é ¾ÈµÇ°í GetRootRoom() À» »ç¿ëÇØ¼­ ¾òÀ¸¼¼¿ä~ */ switch( pSignal->GetSignalIndex() ) { case STE_Input: { if( pSignal->GetStartFrame() == 0 && pSignal->GetEndFrame() == pElement->dwLength ) { pSignal->SetStartFrame( -1 ); } // ÀÎDz ½Ã±×³Î¿¡ ½ºÅ³ üÀÎ Ç÷¡±×°¡ ÄÑÁ® ÀÖ´Â °æ¿ì¿¡ ½ºÅ³ üÀεǴ ¾×¼ÇÀ¸·Î ¹Ì¸® ºÐ·ùÇØµÎ¾ú´Ù°¡ ÇÙÀ» ¸·´Â´Ù. if( pActionBase ) { CDnActionBase* pDnActionBase = static_cast( pActionBase ); pDnActionBase->InsertBasicAttackInfo( nElementIndex, pSignal ); pDnActionBase->InsertSkillChainInfo( pElement, nElementIndex, pSignal ); pDnActionBase->InsertBasicShootActionCoolTime( pElement, nElementIndex, pSignal ); } } break; case STE_InputHasPassiveSkill: { InputHasPassiveSkillStruct *pStruct = (InputHasPassiveSkillStruct *)pSignal->GetData(); if( pSignal->GetStartFrame() == 0 && pSignal->GetEndFrame() == pElement->dwLength ) { pSignal->SetStartFrame( -1 ); } if( !pStruct->szEXSkillChangeAction ) pSignal->InsertStrTable( (char*)&pStruct->szEXSkillChangeAction, std::string("") ); if( pActionBase ) { ((CDnActionBase*)pActionBase)->InsertPassiveSkillInfo( nElementIndex, pSignal ); } } break; case STE_Projectile: { ProjectileStruct *pStruct = (ProjectileStruct *)pSignal->GetData(); pStruct->nProjectileIndex = -1; if( !g_pGameServerManager ) break; // ¹«±â À妽º°¡ 0ÀÎ °æ¿ì´Â Ŭ¶óÀÌ¾ðÆ®¿¡¼­ º¸Á¶ ¹«±âÀÇ À妽º·Î ´ëÃ¼ÇØ¼­ ³ª°¡µµ·Ï Ŭ¶ó¿¡¼­ µÇ¾îÀֱ⠶§¹®¿¡ // ¹«±â À妽º°¡ 0 À̶ó°í break µÇ´Â ºÎºÐ À§¿¡ Ä«¿îÆ®°¡ µÇ¾î¾ß ÇÑ´Ù. // ÀÌ ¾×¼Ç¿¡¼­ ³ª°¥ ¼ö ÀÖ´Â ¹ß»çüÀÇ ÃÖ´ë °¹¼ö¸¦ ÀúÀåÇØµÐ´Ù. // Ŭ¶ó·ÎºÎÅÍ ¹ß»çü ÆÐŶÀÌ ¿À¸é ¾×¼ÇÀÌ ¹Ù²î±â Àü¿¡ ÃÖ´ë °¹¼ö¸¦ ³Ñ±âÁö ¾Êµµ·Ï ½ð´Ù. if( pActionBase ) ((CDnActionBase*)pActionBase)->InsertProjectileCountInfo( nElementIndex, pSignal ); if( pStruct->nWeaponTableID == 0 ) break; CDnProjectile *pProjectile = new CDnProjectile( (CMultiRoom*)g_pGameServerManager->GetRootRoom(), CDnActor::Identity(), false , false ); pProjectile->CDnWeapon::Initialize( pStruct->nWeaponTableID, -1 ); pProjectile->CDnWeapon::CreateObject(); pStruct->nProjectileIndex = pProjectile->GetMyIndex(); } break; case STE_SendAction_Weapon: { if( pActionBase ) ((CDnActionBase*)pActionBase)->InsertSendActionProjectileCountInfo( nElementIndex, pSignal ); } break; case STE_Gravity: { GravityStruct *pStruct = (GravityStruct *)pSignal->GetData(); if( !pStruct->vOffset ) pSignal->InsertVec3Table( (EtVector3*)&pStruct->vOffset, EtVector3( 0.f, 0.f, 0.f ) ); } break; default: { if( pActionBase ) { CDnActionBase* pDnActionBase = static_cast( pActionBase ); pDnActionBase->InsertStandChangeSEShootSkillCoolTime( pElement, nElementIndex, pSignal ); } } break; } } void CDnActionBase::CheckPostSignal( ActionElementStruct *pElement, int nElementIndex, CEtActionSignal *pSignal, int nSignalIndex, CEtActionBase *pActionBase ) { if( !g_pGameServerManager ) return; if( !g_pGameServerManager->GetRootRoom() ) return; switch( pSignal->GetSignalIndex() ) { case STE_Projectile: { ProjectileStruct *pStruct = (ProjectileStruct *)pSignal->GetData(); if( pStruct->nWeaponTableID == 0 ) break; if( pStruct->nProjectileIndex == -1 ) break; DnWeaponHandle hWeapon = CDnWeapon::GetSmartPtr( (CMultiRoom*)g_pGameServerManager->GetRootRoom(), pStruct->nProjectileIndex ); SAFE_RELEASE_SPTR( hWeapon ); } break; } } void CDnActionBase::InsertBasicAttackInfo( int nElementIndex, CEtActionSignal *pSignal ) { InputStruct* pInputStruct = (InputStruct*)(pSignal->GetData()); CDnActionSpecificInfo::S_BASIC_ATTACK_INPUT_SIGNAL_INFO BasicActionSignalInfo; BasicActionSignalInfo.strChangeActionName = pInputStruct->szChangeAction; int iStartFrame = pSignal->GetStartFrame() < 0 ? 0 : pSignal->GetStartFrame(); BasicActionSignalInfo.dwStartFrame = iStartFrame; BasicActionSignalInfo.dwEndFrame = pSignal->GetEndFrame(); m_BasicAttackInfoForInit.mapBasicAttackInfo[ nElementIndex ].push_back( BasicActionSignalInfo ); } void CDnActionBase::InsertSkillChainInfo( ActionElementStruct *pElement, int nElementIndex, CEtActionSignal *pSignal ) { InputStruct* pInputStruct = (InputStruct*)(pSignal->GetData()); if( TRUE == pInputStruct->bSkillChain ) { m_SkillChainInfoForInit.setSkillChainAction.insert( nElementIndex ); m_SkillChainInfoForInit.mapCanChainToThisAction[ nElementIndex ].push_back( pInputStruct->szChangeAction ); } } void CDnActionBase::InsertBasicShootActionCoolTime( ActionElementStruct *pElement, int nElementIndex, CEtActionSignal *pSignal ) { InputStruct* pInputStruct = (InputStruct*)(pSignal->GetData()); // ±âº» ½¸ ¾×¼ÇÀÌ°í º¯È¯ ¾×¼ÇÀÌ pick, jump ¾×¼ÇÀÌ ¾Æ´Ñ °Í. const char* pActionName = pElement->szName.c_str(); if( strstr(pActionName, "Shoot_") ) { if( stricmp("Pick", pInputStruct->szChangeAction) != 0 && stricmp("Jump", pInputStruct->szChangeAction) != 0 ) { // ½ÇÁ¦ ´Ù¸¥ ¾×¼ÇÀ¸·Î ¹Ù²î´Â ÀÎDzÀÌ ¿©·¯°³ ÀÖ´õ¶óµµ ±×³É µ¤¾î ¾º¿î´Ù. int iStartFrame = pSignal->GetStartFrame() < 0 ? 0 : pSignal->GetStartFrame(); m_ProjectileCountInfoForInit.mapBasicShootActionCoolTime[ nElementIndex ] = DWORD(((float)iStartFrame / m_fFPS) * 1000); } } } void CDnActionBase::InsertStandChangeSEShootSkillCoolTime( ActionElementStruct *pElement, int nElementIndex, CEtActionSignal *pSignal ) { if( m_ProjectileCountInfoForInit.mapBasicShootActionCoolTime.end() == m_ProjectileCountInfoForInit.mapBasicShootActionCoolTime.find( nElementIndex ) ) { const char* pActionName = pElement->szName.c_str(); // ½ÃÁî ½ºÅĽºÀÇ °ø°Ý ¾×¼Çµµ ÄðŸÀÓÀÌ ÇÊ¿äÇÏ´Ù. ÀÔ·ÂÀ» ¹Þ¾Æ ¾×¼ÇÀÌ ¹Ù²î¸é¼­ ¹ß»çü¸¦ ½î±â ¶§¹®¿¡.. // ¾à°£ ¸ð¾ç»õ°¡ ÁÁÁø ¾ÊÁö¸¸ ¿©±â¼­ ½ÃÁÅĽº¾îÅà ¾×¼ÇÀÇ Àüü ±æÀ̸¦ ÄðŸÀÓÀ¸·Î ¼³Á¤ÇÑ´Ù. // ½ÃÁÅĽº¾îÅà ¾×¼Ç¿¡¼­´Â ÀÌ input ½Ã±×³Î·Î Á¡ÇÁ ÀÔ·Â ¹Þ´Â °Í ¹Û¿£ ¾ø´Ù. // µ¥¸ô¸®¼Çµµ ¸¶Âù°¡Áö·Î ½ÃÁî ½ºÅĽº¿Í ±¸Á¶°¡ °°À¸¹Ç·Î °°Àº ¹æ½ÄÀ¸·Î ó¸®ÇÑ´Ù. if( strcmp(pActionName, "Skill_SiegeStance_Attack") == 0 || strcmp(pActionName, "Skill_Demolition_Attack1") == 0 || strcmp(pActionName, "Skill_Demolition_Attack2") == 0 ) { m_ProjectileCountInfoForInit.mapBasicShootActionCoolTime[ nElementIndex ] = DWORD(((float)pElement->dwLength / m_fFPS) * 1000); } else if( strcmp(pActionName, "Skill_FlashStance_AttackL") == 0 || strcmp(pActionName, "Skill_FlashStance_AttackR") == 0 ) { // Ç÷¡½¬ ½ºÅĽº´Â Ç÷¡½¬ ½ºÅĽº °ø°Ý¾×¼Ç¿¡ input À¸·Î °ø°ÝÇÏ´Â ½Ã±×³ÎÀÌ ÀÖÀ¸¹Ç·Î input ½Ã±×³Î ±¸°£±îÁö ½Ã°£À» °è»êÇØ µÐ´Ù. // °ø°Ý ¾×¼Ç¿¡ ÇöÀç´Â °°Àº ½ÃÀÛ ÇÁ·¹ÀÓ¿¡ 2°³ÀÇ Input ½Ã±×³ÎÀÌ ÀÖÁö¸¸ ÃßÈÄ¿¡ ½ÃÀÛ ÇÁ·¹ÀÓÀÌ ´Þ¶óÁú ¼ÒÁö°¡ ÀÖ´Ù. // ±×·± °æ¿ì¿£ °¡Àå ¸ÕÀú ½ÃÀ۵Ǵ Input ½Ã±×³ÎÀÇ ÇÁ·¹ÀÓÀ» ±âÁØÀ¸·Î ÄðŸÀÓÀ» Àâ¾ÆµÐ´Ù. int iSmallestStartFrame = INT_MAX; int iNumSignals = (int)pElement->pVecSignalList.size(); for( int iSignal = 0; iSignal < iNumSignals; ++iSignal ) { CEtActionSignal* pSignal = pElement->pVecSignalList.at( iSignal ); if( STE_Input == pSignal->GetSignalIndex() ) { InputStruct* pInputStruct = (InputStruct*)(pSignal->GetData()); if( stricmp("Pick", pInputStruct->szChangeAction) != 0 && stricmp("Jump", pInputStruct->szChangeAction) != 0 ) { int iStartFrame = pSignal->GetStartFrame() < 0 ? 0 : pSignal->GetStartFrame(); if( iStartFrame < iSmallestStartFrame ) { iSmallestStartFrame = iStartFrame; } } } } if( INT_MAX != iSmallestStartFrame ) { m_ProjectileCountInfoForInit.mapBasicShootActionCoolTime[ nElementIndex ] = DWORD(((float)iSmallestStartFrame / m_fFPS) * 1000); } } } } void CDnActionBase::InsertPassiveSkillInfo( int nElementIndex, CEtActionSignal *pSignal ) { InputHasPassiveSkillStruct* pStruct = (InputHasPassiveSkillStruct*)(pSignal->GetData()); CDnActionSpecificInfo::S_PASSIVESKILL_SIGNAL_INFO PassiveSignalInfo; PassiveSignalInfo.iSkillID = pStruct->nSkillIndex; PassiveSignalInfo.strChangeActionName = pStruct->szChangeAction; PassiveSignalInfo.strEXSkillChangeActionName = pStruct->szEXSkillChangeAction; m_PassiveSkillInfoForInit.mapPassiveSkillInfo[ nElementIndex ].push_back( PassiveSignalInfo ); } void CDnActionBase::InsertProjectileCountInfo( int nElementIndex, CEtActionSignal *pSignal ) { ProjectileStruct *pStruct = (ProjectileStruct *)pSignal->GetData(); map::iterator iter = m_ProjectileCountInfoForInit.mapMaxProjectileCountInAction.find( nElementIndex ); if( iter != m_ProjectileCountInfoForInit.mapMaxProjectileCountInAction.end() ) m_ProjectileCountInfoForInit.mapMaxProjectileCountInAction[ nElementIndex ]++; else m_ProjectileCountInfoForInit.mapMaxProjectileCountInAction.insert( make_pair(nElementIndex, 1) ); // ¹«±â Å×À̺í IDµµ ¹Þ¾ÆµÐ´Ù. ÀÏ¹Ý °ø°Ý¾×¼Ç ÆÐŶÀ¸·Î ½ºÅ³ üũ ·çƾÀ» ÇÇÇϰí, // ¹ß»çü °¹¼ö üũ ·çƾÀ¸·Î ÃæÀüµÈ Çѹ߷Π¹«±â ¹øÈ£ ¹Ù²ã¼­ º¸³»´Â ³ðµéÀÌ ÀÖÀ½.... ¾Æ ¯±ú... m_ProjectileCountInfoForInit.mapUsingProjectileWeaponTableIDs[ nElementIndex ].insert( pStruct->nWeaponTableID ); // ½ºÅ³ ¹ß»çü ¹Ù²ãº¸³»´Â °Í°ú º°µµ·Î, ¾ÆÃÄ, ¼Ò¼­¸®½ºÀÇ ±âº» °ø°Ý ¾×¼Ç°ú ¹ß»çü ÆÐŶÀ» ³­»çÇØ¼­ ¸¶±¸ ½î´Â °ÍÀ» // ¸·±â À§ÇØ ¹ß»çü ÆÐŶÀ» ¹Þ¾ÒÀ» ¶§ ½Ã±×³ÎÀÇ °£°Ýµµ üũÇÑ´Ù. m_ProjectileCountInfoForInit.mapProjectileSignalFrameOffset[ nElementIndex ].push_back( pSignal->GetStartFrame() ); } void CDnActionBase::InsertSendActionProjectileCountInfo( int nElementIndex, CEtActionSignal *pSignal ) { SendAction_WeaponStruct *pStruct = (SendAction_WeaponStruct *)pSignal->GetData(); if( 2 <= pStruct->nWeaponIndex ) return; CDnActionSpecificInfo::S_WEAPONACTION_INFO WeaponActionInfo; WeaponActionInfo.iWeaponIndex = pStruct->nWeaponIndex; WeaponActionInfo.iFrame = pSignal->GetStartFrame(); if( 0 < strlen(pStruct->szActionName) ) WeaponActionInfo.strActionName = pStruct->szActionName; map >::iterator iter = m_ProjectileCountInfoForInit.mapSendActionWeapon.find( nElementIndex ); if( m_ProjectileCountInfoForInit.mapSendActionWeapon.end() == iter ) { // ÃÖÃÊ·Î ¹ß°ßµÇ¾úÀ½. vector vlWeaponActionInfo; vlWeaponActionInfo.push_back( WeaponActionInfo ); m_ProjectileCountInfoForInit.mapSendActionWeapon.insert( make_pair(nElementIndex, vlWeaponActionInfo) ); } else { // µÎ¹øÂ° ºÎÅÍ´Â º¤ÅÍ·Î Ãß°¡. (ex)Å©·Î½º º¸¿ì) iter->second.push_back( WeaponActionInfo ); } } void CDnActionBase::SetFPS( float fValue ) { if( 0.0f < fValue ) { m_ActionTime = m_LocalTime - (LOCAL_TIME)( m_fFrame / fValue * 1000.f ); if( IsCustomAction() ) { float fFrame = ( ( m_LocalTime - m_CustomActionTime ) / 1000.f ) * m_fFPS; m_CustomActionTime = m_LocalTime - (LOCAL_TIME)( fFrame / fValue * 1000.f ); } } else { // fValue °¡ 0.0f ·Î È£ÃâµÈ °æ¿ì. m_ActionTime = m_LocalTime; if( IsCustomAction() ) { m_CustomActionTime = m_LocalTime; } } m_fFPS = fValue; if( m_pRender ) m_pRender->SetFPS( fValue ); } float CDnActionBase::GetFPS() { return m_fFPS; } bool CDnActionBase::IsIgnoreSignal( int nSignalIndex ) { switch( nSignalIndex ) { case STE_DnNullSignal: case STE_Sound: case STE_Particle: case STE_EnvironmentEffect: case STE_ShowWeapon: case STE_AlphaBlending: case STE_AttachTrail: case STE_CameraEffect_Shake: case STE_FX: case STE_CanRotate: case STE_ActionObject: case STE_ObjectVisible: case STE_AttachSwordTrail: case STE_ShowSwordTrail: case STE_CameraEffect_RadialBlur: case STE_Decal: case STE_HeadLook: case STE_ShaderCustomParameter: case STE_ChangeWeaponLink: case STE_FreezeCamera: case STE_SocialAction: case STE_HideExposureInfo: case STE_PhysicsSkip: case STE_Particle_LoopEnd: case STE_FX_LoopEnd: case STE_OutlineFilter: case STE_Billboard: case STE_EyeLightTrail: case STE_PointLight: case STE_OtherSelfEffect: case STE_ImmediatelyAttach: case STE_Dialogue: case STE_AttachLine: case STE_SyncChangeAction: case STE_CannonTargeting: case STE_SkillChecker: case STE_CameraEffect_Swing: return true; } return false; }