2024-12-21 10:04:04 +08:00
# 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
// // <20> <> <20> <> ü<EFBFBD> <C3BC> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> ȿ<EFBFBD> <C8BF> <EFBFBD> <EFBFBD> <20> ݵ<EFBFBD> <DDB5> <EFBFBD> <20> ֱ<EFBFBD> <D6B1> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ó<> <C3B3> <EFBFBD> ϴ<EFBFBD> <20> Լ<EFBFBD> <D4BC> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> ¿<EFBFBD> <C2BF> <EFBFBD> <20> <> .
// bool bResult = m_hParentBlow->OnCustomIntervalProcess();
// _ASSERT( bResult );
//
// // Blow <20> <> <20> <EFBFBD> <D7BE> <EFBFBD> <EFBFBD> <EFBFBD> Blow <20> <> <EFBFBD> <EFBFBD> Actor <20> <> Hitter <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ش<EFBFBD> .
// 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 ;
// <20> <> <20> ̵<EFBFBD> <CCB5> ϸ<EFBFBD> LocalTime <20> <> <20> <> <EFBFBD> µǹǷ<C7B9> ..
if ( LocalTime < m_LastIntervalTime )
m_LastIntervalTime = LocalTime ;
if ( m_dwInterval < LocalTime - m_LastIntervalTime )
{
// <20> <> <20> <> ü<EFBFBD> <C3BC> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> ȿ<EFBFBD> <C8BF> <EFBFBD> <EFBFBD> <20> ݵ<EFBFBD> <DDB5> <EFBFBD> <20> ֱ<EFBFBD> <D6B1> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ó<> <C3B3> <EFBFBD> ϴ<EFBFBD> <20> Լ<EFBFBD> <D4BC> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> ¿<EFBFBD> <C2BF> <EFBFBD> <20> <> .
bool bResult = m_hParentBlow - > OnCustomIntervalProcess ( ) ;
_ASSERT ( bResult ) ;
m_LastIntervalTime = LocalTime ;
# ifdef _GAMESERVER
// Blow <20> <> <20> <EFBFBD> <D7BE> <EFBFBD> <EFBFBD> <EFBFBD> Blow <20> <> <EFBFBD> <EFBFBD> Actor <20> <> Hitter <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ش<EFBFBD> .
// <20> ߿<EFBFBD> !!
// <20> ݵ<EFBFBD> <DDB5> <EFBFBD> Die ó<> <C3B3> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> ߿<EFBFBD> <20> Ǿ<EFBFBD> <C7BE> <EFBFBD> <20> Ѵ <EFBFBD> .
// Die ó<> <C3B3> <EFBFBD> <EFBFBD> <20> Ǹ<EFBFBD> <20> <> <EFBFBD> <EFBFBD> ȿ<EFBFBD> <C8BF> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ƿ<EFBFBD> <20> ش<EFBFBD> <20> <> <EFBFBD> <EFBFBD> ȿ<EFBFBD> <C8BF> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> ִ<EFBFBD> <20> <> <20> <> ü <20> <> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> .
// <20> <EFBFBD> <D7B7> Ƿ<EFBFBD> <20> <EFBFBD> <EEB6B0> <20> <> <EFBFBD> ۵ <EFBFBD> <20> ־ <20> ȵȴ<C8B5> .
# 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 ) ;
// <20> <> <20> Ʒ <EFBFBD> <C6B7> <EFBFBD> <EFBFBD> <EFBFBD> <20> <EFBFBD> <EEB6B0> <20> <> <EFBFBD> <EFBFBD> <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> ̳<EFBFBD> ó<> <C3B3> <EFBFBD> <EFBFBD> <20> ϸ<EFBFBD> <20> ȵ<EFBFBD> !
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 ) ;
// <20> <> <20> Ʒ <EFBFBD> <C6B7> <EFBFBD> <EFBFBD> <EFBFBD> <20> <EFBFBD> <EEB6B0> <20> <> <EFBFBD> <EFBFBD> <20> <> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> ̳<EFBFBD> ó<> <C3B3> <EFBFBD> <EFBFBD> <20> ϸ<EFBFBD> <20> ȵ<EFBFBD> !
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 )
//{
// // <20> ߰<EFBFBD> <DFB0> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> ¶<EFBFBD> <C2B6> <EFBFBD> ServerEndTime<6D> <65> <20> ̹<EFBFBD> CmdRemoveStateEffect <20> <> Ŷ<EFBFBD> <C5B6> <20> <> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <20> ð<EFBFBD> <C3B0> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> ŵ<EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ..
// 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 );
//}
}