202 lines
5.6 KiB
C++
202 lines
5.6 KiB
C++
|
|
#include "StdAfx.h"
|
|||
|
|
#include "DnParryBlow.h"
|
|||
|
|
#ifdef _GAMESERVER
|
|||
|
|
#include "DnStateBlow.h"
|
|||
|
|
#include "DnPlayerActor.h"
|
|||
|
|
#endif
|
|||
|
|
|
|||
|
|
#ifdef _DEBUG
|
|||
|
|
#define new new(_NORMAL_BLOCK,__FILE__,__LINE__)
|
|||
|
|
#endif
|
|||
|
|
|
|||
|
|
CDnParryBlow::CDnParryBlow(DnActorHandle hActor, const char *szValue)
|
|||
|
|
: CDnBlow(hActor)
|
|||
|
|
{
|
|||
|
|
m_StateBlow.emBlowIndex = STATE_BLOW::BLOW_031;
|
|||
|
|
AddCallBackType(SB_ONDEFENSEATTACK);
|
|||
|
|
SetValue(szValue);
|
|||
|
|
//m_nValue = atoi( szValue );
|
|||
|
|
m_fValue = (float)atof(szValue);
|
|||
|
|
|
|||
|
|
#ifdef _GAMESERVER
|
|||
|
|
m_strParringActionName.assign( "Skill_Parrying" );
|
|||
|
|
m_bEnable = false;
|
|||
|
|
m_bEnableLastLoop = false;
|
|||
|
|
m_fAdditionalSignalProb = 0.0f;
|
|||
|
|
m_fAdditionalSignalProbLastLoop = 0.0f;
|
|||
|
|
#endif
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
CDnParryBlow::~CDnParryBlow(void)
|
|||
|
|
{
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void CDnParryBlow::Process( LOCAL_TIME LocalTime, float fDelta )
|
|||
|
|
{
|
|||
|
|
CDnBlow::Process( LocalTime, fDelta );
|
|||
|
|
|
|||
|
|
#ifdef _GAMESERVER
|
|||
|
|
// <20><><EFBFBD><EFBFBD> process <20><><EFBFBD><EFBFBD> <20><><EFBFBD>κп<CEBA> <20><><EFBFBD><EFBFBD>ȿ<EFBFBD><C8BF> process <20><> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>⼭ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD> <20>и<EFBFBD><D0B8>ñ׳<C3B1><D7B3><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ϰ<EFBFBD> enable <20><> ó<><C3B3><EFBFBD><EFBFBD> <20><>.
|
|||
|
|
m_bEnableLastLoop = m_bEnable;
|
|||
|
|
m_fAdditionalSignalProbLastLoop = m_fAdditionalSignalProb;
|
|||
|
|
m_bEnable = false;
|
|||
|
|
m_fAdditionalSignalProb = 0.0f;
|
|||
|
|
#endif
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void CDnParryBlow::OnBegin( LOCAL_TIME LocalTime, float fDelta )
|
|||
|
|
{
|
|||
|
|
OutputDebug( "CDnParryBlow::OnBegin\n" );
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void CDnParryBlow::OnEnd( LOCAL_TIME LocalTime, float fDelta )
|
|||
|
|
{
|
|||
|
|
OutputDebug( "CDnParryBlow::OnEnd\n" );
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
#ifdef _GAMESERVER
|
|||
|
|
bool CDnParryBlow::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;
|
|||
|
|
|
|||
|
|
if( !m_bEnableLastLoop )
|
|||
|
|
return false;
|
|||
|
|
|
|||
|
|
if( !bHitSuccess )
|
|||
|
|
return false;
|
|||
|
|
|
|||
|
|
/*
|
|||
|
|
// 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 )
|
|||
|
|
{
|
|||
|
|
// #29204 fDamage<67><65> 0<>϶<EFBFBD> <20>и<EFBFBD> Ǯ<><C7AE><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>.
|
|||
|
|
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD>츸 <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> [2011/02/24 semozz]
|
|||
|
|
// <20>ٸ<EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><>ƾ ó<><C3B3>...
|
|||
|
|
if (hHitter && m_hActor &&
|
|||
|
|
(hHitter->GetTeam() == m_hActor->GetTeam()))
|
|||
|
|
{
|
|||
|
|
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
|
|||
|
|
|
|||
|
|
#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
|
|||
|
|
|
|||
|
|
// <20>÷<EFBFBD><C3B7>̾<EFBFBD><CCBE><EFBFBD> <20><><EFBFBD>쿣,
|
|||
|
|
if( m_hActor->IsPlayerActor() )
|
|||
|
|
{
|
|||
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>϶<EFBFBD><CFB6><EFBFBD> <20>ߵ<EFBFBD><DFB5><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>.
|
|||
|
|
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( pPlayerActor->IsTransformMode() )
|
|||
|
|
return false;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
float fAddProb = m_fAdditionalSignalProbLastLoop;
|
|||
|
|
if( m_hActor->GetStateBlow()->IsApplied( STATE_BLOW::BLOW_056 ) )
|
|||
|
|
{
|
|||
|
|
DNVector(DnBlowHandle) vlhParryingProbBlow;
|
|||
|
|
m_hActor->GetStateBlow()->GetStateBlowFromBlowIndex( STATE_BLOW::BLOW_056, vlhParryingProbBlow );
|
|||
|
|
int iNumBlow = (int)vlhParryingProbBlow.size();
|
|||
|
|
for( int i = 0; i < iNumBlow; ++i )
|
|||
|
|
fAddProb += vlhParryingProbBlow.at( i )->GetFloatValue();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
int iProb = int((m_fValue+fAddProb) * 10000.0f);
|
|||
|
|
int iRandValue = (_rand(GetRoom())%10000);
|
|||
|
|
if( iRandValue <= iProb )
|
|||
|
|
{
|
|||
|
|
// HitParam<61><6D> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>Ѵ<EFBFBD>.
|
|||
|
|
HitParam.szActionName = m_strParringActionName;
|
|||
|
|
OutputDebug( "CDnParryingBlow::OnDefenseAttack\n" );
|
|||
|
|
|
|||
|
|
// <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_PARRING_SUCCESS ) );
|
|||
|
|
pEvent->SetSkillID( m_ParentSkillInfo.iSkillID );
|
|||
|
|
Notify( pEvent );
|
|||
|
|
//////////////////////////////////////////////////////////////////////////
|
|||
|
|
|
|||
|
|
return true;
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
return false;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
#endif
|
|||
|
|
|
|||
|
|
#if defined(PRE_ADD_PREFIX_SYSTE_RENEW)
|
|||
|
|
void CDnParryBlow::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 CDnParryBlow::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
|