#include "StdAfx.h" #include "DnActorStatIntervalManipulator.h" #include "DnDamageBase.h" #ifdef _DEBUG #define new new(_NORMAL_BLOCK,__FILE__,__LINE__) #endif CDnActorStatIntervalManipulator::CDnActorStatIntervalManipulator( DnActorHandle hActor, DnBlowHandle hParentBlow ) : m_hActor( hActor ), m_hParentBlow( hParentBlow ), m_LocalStartTime( 0 ), m_dwInterval( 0 ), m_LocalElapsedTime( 0 ), m_LastIntervalTime( 0 ) { } CDnActorStatIntervalManipulator::~CDnActorStatIntervalManipulator(void) { } void CDnActorStatIntervalManipulator::OnBegin( LOCAL_TIME LocalTime, DWORD dwInterval ) { m_LocalElapsedTime = 0; m_LocalStartTime = LocalTime; m_LastIntervalTime = LocalTime; m_dwInterval = dwInterval; } //void CDnActorStatIntervalManipulator::_ProcessInterval( int& iProcessManipulateCount, int iDestProcessCount ) //{ // if( !m_hActor || m_hActor->IsDie() ) // return; // //#ifdef _GAMESERVER // // ÀÌ °´Ã¼¸¦ ¼ÒÀ¯ÇÑ »óÅÂÈ¿°ú´Â ¹Ýµå½Ã ÁÖ±âÀûÀ¸·Î ó¸®ÇÏ´Â ÇÔ¼ö¸¦ ±¸ÇöÇÑ »óÅ¿©¾ß ÇÔ. // bool bResult = m_hParentBlow->OnCustomIntervalProcess(); // _ASSERT( bResult ); // // // Blow ·Î Á×¾úÀ¸¸é Blow ½ÃÀü Actor ¸¦ Hitter ·Î ¼³Á¤ÇØÁØ´Ù. // if( m_hActor->IsDie() ) // { // DnActorHandle hHitter; // if( m_hParentBlow ) // { // const CDnSkill::SkillInfo* pSkillInfo = m_hParentBlow->GetParentSkillInfo(); // if( pSkillInfo ) // hHitter = pSkillInfo->hSkillUser; // } // // m_hActor->Die( hHitter ); // } //#endif //} void CDnActorStatIntervalManipulator::Process( LOCAL_TIME LocalTime, float fDelta ) { if( 0 == LocalTime ) return; if( !m_hActor || m_hActor->IsDie() ) return; // Á¸ À̵¿Çϸé LocalTime ÀÌ ¸®¼ÂµÇ¹Ç·Î.. if( LocalTime < m_LastIntervalTime ) m_LastIntervalTime = LocalTime; if( m_dwInterval < LocalTime - m_LastIntervalTime ) { // ÀÌ °´Ã¼¸¦ ¼ÒÀ¯ÇÑ »óÅÂÈ¿°ú´Â ¹Ýµå½Ã ÁÖ±âÀûÀ¸·Î ó¸®ÇÏ´Â ÇÔ¼ö¸¦ ±¸ÇöÇÑ »óÅ¿©¾ß ÇÔ. bool bResult = m_hParentBlow->OnCustomIntervalProcess(); _ASSERT( bResult ); m_LastIntervalTime = LocalTime; #ifdef _GAMESERVER // Blow ·Î Á×¾úÀ¸¸é Blow ½ÃÀü Actor ¸¦ Hitter ·Î ¼³Á¤ÇØÁØ´Ù. // Áß¿ä!! // ¹Ýµå½Ã Die 󸮰¡ °¡Àå ³ªÁß¿¡ µÇ¾î¾ß ÇÑ´Ù. // Die 󸮰¡ µÇ¸é »óÅÂÈ¿°ú°¡ »ç¶óÁö¹Ç·Î ÇØ´ç »óÅÂÈ¿°ú°¡ °¡Áö°í ÀÖ´Â ÀÌ °´Ã¼ ¶ÇÇÑ »ç¶óÁü. // ±×·¯¹Ç·Î ¾î¶°ÇÑ Á¶ÀÛµµ À־ ¾ÈµÈ´Ù. #if defined(PRE_FIX_61382) DnActorHandle hActor = CDnActor::GetOwnerActorHandle(m_hActor); if( hActor && hActor->IsDie() ) { DnActorHandle hHitter; if( m_hParentBlow ) { const CDnSkill::SkillInfo* pSkillInfo = m_hParentBlow->GetParentSkillInfo(); if( pSkillInfo ) hHitter = pSkillInfo->hSkillUser; } hActor->Die( hHitter ); // ÀÌ ¾Æ·¡¿¡¼­ ¾î¶°ÇÑ º¯¼ö °ª º¯°æÀ̳ª 󸮸¦ ÇÏ¸é ¾ÈµÊ! return; } #else if( m_hActor->IsDie() ) { DnActorHandle hHitter; if( m_hParentBlow ) { const CDnSkill::SkillInfo* pSkillInfo = m_hParentBlow->GetParentSkillInfo(); if( pSkillInfo ) hHitter = pSkillInfo->hSkillUser; } m_hActor->Die( hHitter ); // ÀÌ ¾Æ·¡¿¡¼­ ¾î¶°ÇÑ º¯¼ö °ª º¯°æÀ̳ª 󸮸¦ ÇÏ¸é ¾ÈµÊ! return; } #endif // PRE_FIX_61382 #endif } } void CDnActorStatIntervalManipulator::OnEnd( LOCAL_TIME LocalTime, float fDelta ) { //if( false == m_hActor || m_hActor->IsDie() ) // return; //if( m_hParentBlow->GetDurationTime() > 0.0f ) //{ // // Áß°£¿¡ ²÷¾îÁø »óŶó¸é ServerEndTimeÀº ÀÌ¹Ì CmdRemoveStateEffect ÆÐŶÀ» ½î´Â ½ÃÁ¡¿¡ ±× ½Ã°£À¸·Î °»½ÅµÈ »óÅÂÀÓ.. // LOCAL_TIME WholeElapsed = m_ServerEndTime - m_ServerStartTime; // int iChangedProcessCount = int(WholeElapsed / m_dwInterval) + 1; // if( m_iProcessedManipulateCount < iChangedProcessCount ) // _ProcessInterval( m_iProcessedManipulateCount, iChangedProcessCount ); //} //else //{ // _ProcessInterval( m_iProcessedManipulateCount, m_iExpectedManipulateCount ); //} }