173 lines
4.5 KiB
C++
173 lines
4.5 KiB
C++
|
|
#include "StdAfx.h"
|
|||
|
|
#include "DnBlockBlow.h"
|
|||
|
|
#if defined( _GAMESERVER )
|
|||
|
|
#include "DnPlayerActor.h"
|
|||
|
|
#endif // #if defined( _GAMESERVER )
|
|||
|
|
|
|||
|
|
#ifdef _DEBUG
|
|||
|
|
#define new new(_NORMAL_BLOCK,__FILE__,__LINE__)
|
|||
|
|
#endif
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
CDnBlockBlow::CDnBlockBlow( DnActorHandle hActor, const char* szValue ) : CDnBlow( hActor )
|
|||
|
|
{
|
|||
|
|
m_StateBlow.emBlowIndex = STATE_BLOW::BLOW_030;
|
|||
|
|
SetValue( szValue );
|
|||
|
|
m_fValue = (float)atof( szValue );
|
|||
|
|
|
|||
|
|
m_iCanBlockCount = (int)m_fValue;
|
|||
|
|
|
|||
|
|
AddCallBackType( SB_ONDEFENSEATTACK );
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
CDnBlockBlow::~CDnBlockBlow(void)
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
void CDnBlockBlow::OnBegin(LOCAL_TIME LocalTime, float fDelta )
|
|||
|
|
{
|
|||
|
|
OutputDebug( "CDnBlockBlow::OnBegin, Value:%d \n", (int)m_fValue );
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
void CDnBlockBlow::Process( LOCAL_TIME LocalTime, float fDelta )
|
|||
|
|
{
|
|||
|
|
CDnBlow::Process( LocalTime, fDelta );
|
|||
|
|
|
|||
|
|
#ifdef _GAMESERVER
|
|||
|
|
if( m_iCanBlockCount <= 0 )
|
|||
|
|
{
|
|||
|
|
// Ŭ<><EFBFBD> <20><><EFBFBD><EFBFBD>ȿ<EFBFBD><C8BF> <20><><EFBFBD><EFBFBD><EFBFBD>϶<EFBFBD> <20><>Ŷ<EFBFBD><C5B6> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> blow <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ų<EFBFBD><C5B2>.
|
|||
|
|
m_hActor->CmdRemoveStateEffect( m_StateBlow.emBlowIndex, false );
|
|||
|
|
SetState( STATE_BLOW::STATE_END );
|
|||
|
|
}
|
|||
|
|
#endif
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
void CDnBlockBlow::OnEnd( LOCAL_TIME LocalTime, float fDelta )
|
|||
|
|
{
|
|||
|
|
OutputDebug( "CDnBlockBlow::OnEnd\n");
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
#ifdef _GAMESERVER
|
|||
|
|
bool CDnBlockBlow::OnDefenseAttack( DnActorHandle hHitter, CDnState* pAttackerState, CDnDamageBase::SHitParam &HitParam, bool bHitSuccess )
|
|||
|
|
{
|
|||
|
|
// #25797 <20><>Ʈ <20>ñ׳ο<D7B3> bIgnoreParring <20><> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ߵ<EFBFBD><DFB5><EFBFBD><EFBFBD><EFBFBD> <20>ʴ´<CAB4>.
|
|||
|
|
if( HitParam.bIgnoreParring )
|
|||
|
|
return false;
|
|||
|
|
|
|||
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>϶<EFBFBD><CFB6><EFBFBD> <20>ߵ<EFBFBD><DFB5><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>.
|
|||
|
|
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>ȿ<EFBFBD><C8BF><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>÷<EFBFBD><C3B7>̾ <20><><EFBFBD><EFBFBD><EFBFBD>Ѵ<EFBFBD>.
|
|||
|
|
_ASSERT( m_hActor->IsPlayerActor() );
|
|||
|
|
if( m_hActor->IsPlayerActor() )
|
|||
|
|
{
|
|||
|
|
CDnPlayerActor* pPlayerActor = static_cast<CDnPlayerActor*>(m_hActor.GetPointer());
|
|||
|
|
if( pPlayerActor->IsCannonMode() )
|
|||
|
|
return false;
|
|||
|
|
|
|||
|
|
// <20><><EFBFBD>⸦ <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD>쿣 <20>ߵ<EFBFBD><DFB5><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>. #26772
|
|||
|
|
if( false == (pPlayerActor->IsBattleMode() && pPlayerActor->GetWeapon( 0 ) && pPlayerActor->GetWeapon( 1 )) )
|
|||
|
|
return false;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
#if defined(PRE_FIX_BLOCK_CONDITION)
|
|||
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ߵ<EFBFBD><DFB5><EFBFBD> fDamage<67><65> 0<>̶<EFBFBD><CCB6><EFBFBD> <20><><EFBFBD>̶<EFBFBD><CCB6><EFBFBD> <20><><EFBFBD><EFBFBD> <20>ߵ<EFBFBD> <20><><EFBFBD><EFBFBD> <20>ϵ<EFBFBD><CFB5><EFBFBD>..
|
|||
|
|
//<2F>Ʊ<EFBFBD><C6B1><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> ó<><C3B3> fDamage <20><>0<EFBFBD≯<EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20>ʵ<EFBFBD><CAB5><EFBFBD> <20><>.
|
|||
|
|
if (IsCanBlock(hHitter, m_hActor, HitParam) == false)
|
|||
|
|
return false;
|
|||
|
|
#else
|
|||
|
|
// hit percent <20><> 0% <20><> <20><><EFBFBD><EFBFBD> <20>ߵ<EFBFBD><DFB5><EFBFBD><EFBFBD><EFBFBD> <20>ʴ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>. (#21175)
|
|||
|
|
if( 0.0f == HitParam.fDamage )
|
|||
|
|
return false;
|
|||
|
|
#endif // PRE_FIX_BLOCK_CONDITION
|
|||
|
|
|
|||
|
|
bool bResult = false;
|
|||
|
|
|
|||
|
|
|
|||
|
|
#if defined(PRE_ADD_49166)
|
|||
|
|
// <20>ǰ<EFBFBD><C7B0>ڰ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (Freezing / FrameStop) <20><><EFBFBD><EFBFBD>ȿ<EFBFBD><C8BF><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>Ǿ<EFBFBD> <20>ִ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20>ߵ<EFBFBD> <20><><EFBFBD><EFBFBD> <20>ʵ<EFBFBD><CAB5><EFBFBD>..
|
|||
|
|
if (IsInVaildBlockCondition(m_hActor) == true)
|
|||
|
|
return false;
|
|||
|
|
#endif // PRE_ADD_49166
|
|||
|
|
|
|||
|
|
if( m_iCanBlockCount > 0 )
|
|||
|
|
{
|
|||
|
|
--m_iCanBlockCount;
|
|||
|
|
|
|||
|
|
HitParam.szActionName.assign( "Skill_Block" );
|
|||
|
|
OutputDebug( "CDnBlockBlow::OnDefenseAttack, CanBlockCount:%d \n", m_iCanBlockCount );
|
|||
|
|
|
|||
|
|
// <20>ɾ<EFBFBD><C9BE><EFBFBD><EFBFBD><EFBFBD> <20>ֵ<EFBFBD><D6B5><EFBFBD><EFBFBD><EFBFBD> <20>˷<EFBFBD><CBB7><EFBFBD>. /////////////////////////////////////////////
|
|||
|
|
boost::shared_ptr<IDnObserverNotifyEvent> pEvent( IDnObserverNotifyEvent::Create( EVENT_BUBBLE_BLOCK_SUCCESS ) );
|
|||
|
|
pEvent->SetSkillID( m_ParentSkillInfo.iSkillID );
|
|||
|
|
Notify( pEvent );
|
|||
|
|
//////////////////////////////////////////////////////////////////////////
|
|||
|
|
|
|||
|
|
bResult = true;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
return bResult;
|
|||
|
|
}
|
|||
|
|
#endif
|
|||
|
|
|
|||
|
|
|
|||
|
|
#if defined(PRE_ADD_PREFIX_SYSTE_RENEW)
|
|||
|
|
void CDnBlockBlow::AddStateEffectValue(const char* szOrigValue, const char* szAddValue, std::string& szNewValue)
|
|||
|
|
{
|
|||
|
|
char szBuff[128] = {0, };
|
|||
|
|
|
|||
|
|
//<2F>ʿ<EFBFBD><CABF><EFBFBD> <20><> <20><><EFBFBD><EFBFBD>
|
|||
|
|
float fValue[2];
|
|||
|
|
|
|||
|
|
//////////////////////////////////////////////////////////////////////////
|
|||
|
|
//ù<><C3B9>° <20><>
|
|||
|
|
fValue[0] = (float)atof( szOrigValue );
|
|||
|
|
//////////////////////////////////////////////////////////////////////////
|
|||
|
|
|
|||
|
|
|
|||
|
|
//////////////////////////////////////////////////////////////////////////
|
|||
|
|
//<2F>ι<EFBFBD>°
|
|||
|
|
fValue[1] = (float)atof( szAddValue );
|
|||
|
|
//////////////////////////////////////////////////////////////////////////
|
|||
|
|
|
|||
|
|
//<2F><> <20><><EFBFBD><EFBFBD> <20><><EFBFBD>Ѵ<EFBFBD>.
|
|||
|
|
float fResultValue = fValue[0] + fValue[1];
|
|||
|
|
|
|||
|
|
sprintf_s(szBuff, "%f", fResultValue);
|
|||
|
|
|
|||
|
|
szNewValue = szBuff;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void CDnBlockBlow::RemoveStateEffectValue(const char* szOrigValue, const char* szAddValue, std::string& szNewValue)
|
|||
|
|
{
|
|||
|
|
char szBuff[128] = {0, };
|
|||
|
|
|
|||
|
|
//<2F>ʿ<EFBFBD><CABF><EFBFBD> <20><> <20><><EFBFBD><EFBFBD>
|
|||
|
|
float fValue[2];
|
|||
|
|
|
|||
|
|
//////////////////////////////////////////////////////////////////////////
|
|||
|
|
//ù<><C3B9>° <20><>
|
|||
|
|
fValue[0] = (float)atof( szOrigValue );
|
|||
|
|
//////////////////////////////////////////////////////////////////////////
|
|||
|
|
|
|||
|
|
|
|||
|
|
//////////////////////////////////////////////////////////////////////////
|
|||
|
|
//<2F>ι<EFBFBD>°
|
|||
|
|
fValue[1] = (float)atof( szAddValue );
|
|||
|
|
//////////////////////////////////////////////////////////////////////////
|
|||
|
|
|
|||
|
|
//<2F><> <20><><EFBFBD><EFBFBD>
|
|||
|
|
float fResultValue = fValue[0] - fValue[1];
|
|||
|
|
|
|||
|
|
sprintf_s(szBuff, "%f", fResultValue);
|
|||
|
|
|
|||
|
|
szNewValue = szBuff;
|
|||
|
|
}
|
|||
|
|
#endif // PRE_ADD_PREFIX_SYSTE_RENEW
|