459 lines
12 KiB
C++
459 lines
12 KiB
C++
|
|
#include "StdAfx.h"
|
|||
|
|
#include "DnAddStateOnConditionBlow.h"
|
|||
|
|
#if defined( _GAMESERVER )
|
|||
|
|
#include "DnPlayerActor.h"
|
|||
|
|
#endif // #if defined( _GAMESERVER )
|
|||
|
|
|
|||
|
|
#if !defined( USE_BOOST_MEMPOOL )
|
|||
|
|
#ifdef _DEBUG
|
|||
|
|
#define new new(_NORMAL_BLOCK,__FILE__,__LINE__)
|
|||
|
|
#endif
|
|||
|
|
#endif // #if !defined( USE_BOOST_MEMPOOL )
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
CDnAddStateOnConditionBlow::CDnAddStateOnConditionBlow( DnActorHandle hActor, const char* szValue ) : CDnBlow( hActor )
|
|||
|
|
#if !defined(_GAMESERVER)
|
|||
|
|
,m_IntervalChecker( hActor, GetMySmartPtr() )
|
|||
|
|
#endif // _GAMESERVER
|
|||
|
|
{
|
|||
|
|
m_StateBlow.emBlowIndex = STATE_BLOW::BLOW_172;
|
|||
|
|
SetValue( szValue );
|
|||
|
|
|
|||
|
|
SetInfo(szValue);
|
|||
|
|
|
|||
|
|
#ifdef _GAMESERVER
|
|||
|
|
AddCallBackType( SB_ONTARGETHIT );
|
|||
|
|
|
|||
|
|
m_bCalcProb = false;
|
|||
|
|
m_bOnDamaged = false;
|
|||
|
|
#else
|
|||
|
|
//<2F>⺻<EFBFBD><E2BABB><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>Ʈ ǥ<><C7A5> <20><><EFBFBD><EFBFBD> <20>ʵ<EFBFBD><CAB5><EFBFBD>..
|
|||
|
|
UseTableDefinedGraphicEffect( false );
|
|||
|
|
m_bGraphicEffectShow = false;
|
|||
|
|
m_bTrigger = false;
|
|||
|
|
#endif
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
CDnAddStateOnConditionBlow::~CDnAddStateOnConditionBlow(void)
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
void CDnAddStateOnConditionBlow::OnBegin(LOCAL_TIME LocalTime, float fDelta )
|
|||
|
|
{
|
|||
|
|
__super::OnBegin(LocalTime, fDelta);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
void CDnAddStateOnConditionBlow::Process( LOCAL_TIME LocalTime, float fDelta )
|
|||
|
|
{
|
|||
|
|
__super::Process( LocalTime, fDelta );
|
|||
|
|
|
|||
|
|
#if defined(_GAMESERVER)
|
|||
|
|
m_bCalcProb = m_bOnDamaged = false;
|
|||
|
|
#else
|
|||
|
|
if (m_bTrigger)
|
|||
|
|
{
|
|||
|
|
if (m_bGraphicEffectShow)
|
|||
|
|
{
|
|||
|
|
_AttachGraphicEffect();
|
|||
|
|
if( m_hEtcObjectEffect )
|
|||
|
|
{
|
|||
|
|
CEtActionBase::ActionElementStruct* pStruct = m_hEtcObjectEffect->GetElement( "Idle" );
|
|||
|
|
if( pStruct )
|
|||
|
|
m_IntervalChecker.OnBegin( LocalTime, pStruct->dwLength + 1000);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
if (m_hEtcObjectEffect)
|
|||
|
|
{
|
|||
|
|
_DetachGraphicEffect();
|
|||
|
|
m_IntervalChecker.OnEnd(LocalTime, fDelta);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
m_bTrigger = false;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
m_IntervalChecker.Process( LocalTime, fDelta );
|
|||
|
|
#endif // _GAMESERVER
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
void CDnAddStateOnConditionBlow::OnEnd( LOCAL_TIME LocalTime, float fDelta )
|
|||
|
|
{
|
|||
|
|
__super::OnEnd(LocalTime, fDelta);
|
|||
|
|
|
|||
|
|
#if !defined(_GAMESERVER)
|
|||
|
|
_DetachGraphicEffect();
|
|||
|
|
#endif // _GAMESERVER
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void CDnAddStateOnConditionBlow::SetInfo(const char* szValue)
|
|||
|
|
{
|
|||
|
|
std::string str = szValue;//"[Ȯ<><C8AE>;HitStateIndex;HitAttackAttributeIndex;DestStateIndex;<3B><><EFBFBD><EFBFBD>ȿ<EFBFBD><C8BF><EFBFBD><EFBFBD><EFBFBD>ӽð<D3BD>][<5B><><EFBFBD><EFBFBD>ȿ<EFBFBD><C8BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>]";
|
|||
|
|
std::vector<std::string> tokens;
|
|||
|
|
std::string delimiters = "[]";
|
|||
|
|
|
|||
|
|
//1. <20><><EFBFBD><EFBFBD>
|
|||
|
|
TokenizeA(str, tokens, delimiters);
|
|||
|
|
|
|||
|
|
if (tokens.size() != 2)
|
|||
|
|
{
|
|||
|
|
OutputDebug("%s :: %s --> <20><><EFBFBD><EFBFBD>ȿ<EFBFBD><C8BF> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20>ʿ<EFBFBD>!!!\n", __FUNCTION__, szValue);
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
//2. <20>⺻ <20><><EFBFBD><EFBFBD>
|
|||
|
|
std::string defaultInfo = tokens[0];
|
|||
|
|
std::vector<std::string> infoTokens;
|
|||
|
|
delimiters = ";";
|
|||
|
|
|
|||
|
|
TokenizeA(defaultInfo, infoTokens, delimiters);
|
|||
|
|
if (5 == infoTokens.size())
|
|||
|
|
{
|
|||
|
|
m_fRate = m_fValue = (float)atof(infoTokens[0].c_str());
|
|||
|
|
m_nHitStateBlowIndex = atoi(infoTokens[1].c_str());
|
|||
|
|
m_nHitAttackAttribute = atoi(infoTokens[2].c_str());
|
|||
|
|
m_nDestStateBlowIndex = atoi(infoTokens[3].c_str());
|
|||
|
|
m_nStateDurationTime = atoi(infoTokens[4].c_str());
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
OutputDebug("%s :: %s --> <20><><EFBFBD><EFBFBD>ȿ<EFBFBD><C8BF> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20>ʿ<EFBFBD>!!!\n", __FUNCTION__, szValue);
|
|||
|
|
|
|||
|
|
//3. <20><><EFBFBD><EFBFBD>ȿ<EFBFBD><C8BF> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
m_strStateAttribute = tokens[1];
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
#ifdef _GAMESERVER
|
|||
|
|
bool CDnAddStateOnConditionBlow::CalcProb()
|
|||
|
|
{
|
|||
|
|
bool bExecuteable = false;
|
|||
|
|
|
|||
|
|
//<2F><>ų <20><>Ÿ<EFBFBD><C5B8> <20><><EFBFBD><EFBFBD><EFBFBD>ؾ<EFBFBD><D8BE><EFBFBD>..
|
|||
|
|
//<2F>нú<D0BD> <20><>ų<EFBFBD>϶<EFBFBD><CFB6><EFBFBD>??
|
|||
|
|
DnSkillHandle hSkill;
|
|||
|
|
const CDnSkill::SkillInfo* pSkillInfo = GetParentSkillInfo();
|
|||
|
|
if (pSkillInfo)
|
|||
|
|
{
|
|||
|
|
hSkill = m_hActor->FindSkill(pSkillInfo->iSkillID);
|
|||
|
|
|
|||
|
|
if (!hSkill)
|
|||
|
|
return bExecuteable;
|
|||
|
|
|
|||
|
|
if (CDnSkill::UsingResult::Success != hSkill->CanExecute())
|
|||
|
|
{
|
|||
|
|
OutputDebug("%s CanExecute <20><><EFBFBD><EFBFBD>\n", __FUNCTION__);
|
|||
|
|
return bExecuteable;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
return bExecuteable;
|
|||
|
|
|
|||
|
|
//Ȯ<><C8AE> <20><><EFBFBD><EFBFBD>..
|
|||
|
|
bExecuteable = rand() % 10000 <= (m_fRate * 10000.0f);
|
|||
|
|
if (!bExecuteable)
|
|||
|
|
{
|
|||
|
|
OutputDebug("%s Ȯ<><C8AE> <20>ɷ<EFBFBD><C9B7><EFBFBD>\n", __FUNCTION__);
|
|||
|
|
return bExecuteable;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// <20><>Ÿ<EFBFBD><C5B8> <20><><EFBFBD><EFBFBD> <20><>û [2011/03/15 semozz]
|
|||
|
|
//Ŭ<><C5AC><EFBFBD>̾<EFBFBD>Ʈ<EFBFBD><C6AE> <20>н<EFBFBD><D0BD><EFBFBD> <20><>ų <20><>Ÿ<EFBFBD><C5B8> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><>Ŷ <20><><EFBFBD><EFBFBD>..
|
|||
|
|
bool isPassiveSkill = CDnSkill::Passive == hSkill->GetSkillType();
|
|||
|
|
if (isPassiveSkill)
|
|||
|
|
{
|
|||
|
|
BYTE pBuffer[128];
|
|||
|
|
CPacketCompressStream Stream( pBuffer, 128 );
|
|||
|
|
|
|||
|
|
DWORD dwUniqueID = m_hActor ? m_hActor->GetUniqueID() : -1;
|
|||
|
|
int nSkillID = hSkill->GetClassID();
|
|||
|
|
|
|||
|
|
Stream.Write( &dwUniqueID, sizeof(dwUniqueID) );
|
|||
|
|
Stream.Write( &nSkillID, sizeof(nSkillID));
|
|||
|
|
|
|||
|
|
m_hActor->Send(eActor::SC_PASSIVESKILL_COOLTIME, &Stream);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if (hSkill)
|
|||
|
|
hSkill->OnBeginCoolTime();
|
|||
|
|
|
|||
|
|
return bExecuteable;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void CDnAddStateOnConditionBlow::OnTargetHit( DnActorHandle hTargetActor )
|
|||
|
|
{
|
|||
|
|
if (!hTargetActor)
|
|||
|
|
return;
|
|||
|
|
|
|||
|
|
// 1. HitStateIndex<65><78> <20>ش<EFBFBD><D8B4>ϴ<EFBFBD> <20><><EFBFBD><EFBFBD>ȿ<EFBFBD><C8BF><EFBFBD><EFBFBD> <20>ִ<EFBFBD><D6B4><EFBFBD> Ȯ<><C8AE>.
|
|||
|
|
DNVector(DnBlowHandle) vlAppliedBlows;
|
|||
|
|
hTargetActor->GatherAppliedStateBlowByBlowIndex((STATE_BLOW::emBLOW_INDEX)m_nHitStateBlowIndex, vlAppliedBlows);
|
|||
|
|
if (vlAppliedBlows.empty())
|
|||
|
|
return;
|
|||
|
|
|
|||
|
|
//////////////////////////////////////////////////////////////////////////
|
|||
|
|
//#52905 <20><><EFBFBD><EFBFBD>
|
|||
|
|
//<2F>߰<EFBFBD> <20><><EFBFBD><EFBFBD>ȿ<EFBFBD><C8BF> <20><><EFBFBD><EFBFBD> <20>ð<EFBFBD><C3B0><EFBFBD> -1<><31> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>ȿ<EFBFBD><C8BF><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20>ð<EFBFBD><C3B0><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20>ϵ<EFBFBD><CFB5><EFBFBD> <20>Ѵ<EFBFBD>.
|
|||
|
|
int nListCount = (int)vlAppliedBlows.size();
|
|||
|
|
float fDurationTime = 0.0f;
|
|||
|
|
for (int i = 0; i < nListCount; ++i)
|
|||
|
|
{
|
|||
|
|
DnBlowHandle hBlow = vlAppliedBlows[i];
|
|||
|
|
if (hBlow && hBlow->GetDurationTime() > fDurationTime)
|
|||
|
|
fDurationTime = hBlow->GetDurationTime();
|
|||
|
|
}
|
|||
|
|
//////////////////////////////////////////////////////////////////////////
|
|||
|
|
|
|||
|
|
// 2. <20><><EFBFBD><EFBFBD> <20>Ӽ<EFBFBD><D3BC><EFBFBD> Ȯ<><C8AE>
|
|||
|
|
CDnDamageBase::SHitParam* pHitParam = hTargetActor->GetHitParam();
|
|||
|
|
if (NULL == pHitParam || pHitParam->HasElement != m_nHitAttackAttribute)
|
|||
|
|
return;
|
|||
|
|
|
|||
|
|
// 3. Ȯ<><C8AE><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
|||
|
|
//Ȯ<><C8AE> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>Ǿ<EFBFBD> <20><><EFBFBD><EFBFBD> <20>ʴٸ<CAB4> Ȯ<><C8AE> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>ų <20><><EFBFBD><EFBFBD> <20><><EFBFBD>θ<EFBFBD> Ȯ<><C8AE><EFBFBD>Ѵ<EFBFBD>.
|
|||
|
|
if (false == m_bCalcProb)
|
|||
|
|
{
|
|||
|
|
m_bOnDamaged = CalcProb();
|
|||
|
|
m_bCalcProb = true;
|
|||
|
|
|
|||
|
|
if (m_bOnDamaged)
|
|||
|
|
{
|
|||
|
|
//<2F><><EFBFBD><EFBFBD>Ʈ ǥ<>ÿ<EFBFBD> <20><>Ŷ<EFBFBD><C5B6> <20><><EFBFBD><EFBFBD>..
|
|||
|
|
BYTE pBuffer[128];
|
|||
|
|
CPacketCompressStream Stream( pBuffer, 128 );
|
|||
|
|
|
|||
|
|
DWORD dwUniqueID = m_hActor ? m_hActor->GetUniqueID() : -1;
|
|||
|
|
bool bShowEffect = true;
|
|||
|
|
Stream.Write( &dwUniqueID, sizeof(dwUniqueID) );
|
|||
|
|
Stream.Write( &m_StateBlow.emBlowIndex, sizeof(m_StateBlow.emBlowIndex));
|
|||
|
|
Stream.Write( &bShowEffect, sizeof(bShowEffect));
|
|||
|
|
|
|||
|
|
m_hActor->Send(eActor::SC_SHOW_STATE_EFFECT, &Stream);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//////////////////////////////////////////////////////////////////////////
|
|||
|
|
// #52905 <20><><EFBFBD><EFBFBD>
|
|||
|
|
// m_nStateDurationTime <20><> -1<><31> <20><><EFBFBD><EFBFBD> <20>Ǿ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>س<EFBFBD><D8B3><EFBFBD> fDurationTime<6D><65> <20><><EFBFBD><EFBFBD> <20>ϵ<EFBFBD><CFB5><EFBFBD> <20>Ѵ<EFBFBD>.
|
|||
|
|
// fDurationTime<6D><65> 1.0 -> 1<><31>. ===> 1000<30><30><EFBFBD><EFBFBD> 1<><31> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20>ؾ<EFBFBD> <20>Ѵ<EFBFBD>.
|
|||
|
|
int nApplyDurationTime = m_nStateDurationTime;
|
|||
|
|
if (m_nStateDurationTime == -1)
|
|||
|
|
nApplyDurationTime = (int)(fDurationTime * 1000.0f);
|
|||
|
|
//////////////////////////////////////////////////////////////////////////
|
|||
|
|
|
|||
|
|
if (m_bOnDamaged)
|
|||
|
|
hTargetActor->CmdAddStateEffect(&m_ParentSkillInfo, (STATE_BLOW::emBLOW_INDEX)m_nDestStateBlowIndex, nApplyDurationTime, m_strStateAttribute.c_str());
|
|||
|
|
}
|
|||
|
|
#else
|
|||
|
|
bool CDnAddStateOnConditionBlow::OnCustomIntervalProcess( void )
|
|||
|
|
{
|
|||
|
|
if (m_hEtcObjectEffect)
|
|||
|
|
{
|
|||
|
|
_DetachGraphicEffect();
|
|||
|
|
m_IntervalChecker.OnEnd(0, 0.0f);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
return true;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void CDnAddStateOnConditionBlow::ShowGraphicEffect(bool bShow)
|
|||
|
|
{
|
|||
|
|
m_bGraphicEffectShow = bShow;
|
|||
|
|
m_bTrigger = true;
|
|||
|
|
}
|
|||
|
|
#endif
|
|||
|
|
|
|||
|
|
#if defined(PRE_ADD_PREFIX_SYSTE_RENEW)
|
|||
|
|
void CDnAddStateOnConditionBlow::AddStateEffectValue(const char* szOrigValue, const char* szAddValue, std::string& szNewValue)
|
|||
|
|
{
|
|||
|
|
char szBuff[128] = {0, };
|
|||
|
|
|
|||
|
|
std::string strValue[2];
|
|||
|
|
std::vector<std::string> tokens[2];
|
|||
|
|
std::string delimiters = "[]";
|
|||
|
|
|
|||
|
|
|
|||
|
|
float fRate[2] = {0.0f, };
|
|||
|
|
int nHitStateBlowIndex[2] = {0, };
|
|||
|
|
int nHitAttackAttribute[2] = {0, };
|
|||
|
|
int nDestStateBlowIndex[2] = {0, };
|
|||
|
|
int nStateDurationTime[2] = {0, };
|
|||
|
|
std::string szArgment[2];
|
|||
|
|
|
|||
|
|
|
|||
|
|
strValue[0] = szOrigValue;
|
|||
|
|
//1. <20><><EFBFBD><EFBFBD>
|
|||
|
|
TokenizeA(strValue[0], tokens[0], delimiters);
|
|||
|
|
|
|||
|
|
if (tokens[0].size() != 2)
|
|||
|
|
{
|
|||
|
|
OutputDebug("%s :: %s --> <20><><EFBFBD><EFBFBD>ȿ<EFBFBD><C8BF> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20>ʿ<EFBFBD>!!!\n", __FUNCTION__, szOrigValue);
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
//2. <20>⺻ <20><><EFBFBD><EFBFBD>
|
|||
|
|
std::string defaultInfo = tokens[0][0];
|
|||
|
|
std::vector<std::string> infoTokens;
|
|||
|
|
delimiters = ";";
|
|||
|
|
|
|||
|
|
TokenizeA(defaultInfo, infoTokens, delimiters);
|
|||
|
|
if (5 == infoTokens.size())
|
|||
|
|
{
|
|||
|
|
fRate[0] = (float)atof(infoTokens[0].c_str());
|
|||
|
|
nHitStateBlowIndex[0] = atoi(infoTokens[1].c_str());
|
|||
|
|
nHitAttackAttribute[0] = atoi(infoTokens[2].c_str());
|
|||
|
|
nDestStateBlowIndex[0] = atoi(infoTokens[3].c_str());
|
|||
|
|
nStateDurationTime[0] = atoi(infoTokens[4].c_str());
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
OutputDebug("%s :: %s --> <20><><EFBFBD><EFBFBD>ȿ<EFBFBD><C8BF> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20>ʿ<EFBFBD>!!!\n", __FUNCTION__, szOrigValue);
|
|||
|
|
|
|||
|
|
//3. <20><><EFBFBD><EFBFBD>ȿ<EFBFBD><C8BF> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
szArgment[0] = tokens[0][1];
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//////////////////////////////////////////////////////////////////////////
|
|||
|
|
strValue[1] = szAddValue;
|
|||
|
|
//1. <20><><EFBFBD><EFBFBD>
|
|||
|
|
TokenizeA(strValue[1], tokens[1], delimiters);
|
|||
|
|
|
|||
|
|
if (tokens[1].size() != 2)
|
|||
|
|
{
|
|||
|
|
OutputDebug("%s :: %s --> <20><><EFBFBD><EFBFBD>ȿ<EFBFBD><C8BF> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20>ʿ<EFBFBD>!!!\n", __FUNCTION__, szAddValue);
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
//2. <20>⺻ <20><><EFBFBD><EFBFBD>
|
|||
|
|
std::string defaultInfo = tokens[1][0];
|
|||
|
|
std::vector<std::string> infoTokens;
|
|||
|
|
delimiters = ";";
|
|||
|
|
|
|||
|
|
TokenizeA(defaultInfo, infoTokens, delimiters);
|
|||
|
|
if (5 == infoTokens.size())
|
|||
|
|
{
|
|||
|
|
fRate[1] = (float)atof(infoTokens[0].c_str());
|
|||
|
|
nHitStateBlowIndex[1] = atoi(infoTokens[1].c_str());
|
|||
|
|
nHitAttackAttribute[1] = atoi(infoTokens[2].c_str());
|
|||
|
|
nDestStateBlowIndex[1] = atoi(infoTokens[3].c_str());
|
|||
|
|
nStateDurationTime[1] = atoi(infoTokens[4].c_str());
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
OutputDebug("%s :: %s --> <20><><EFBFBD><EFBFBD>ȿ<EFBFBD><C8BF> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20>ʿ<EFBFBD>!!!\n", __FUNCTION__, szAddValue);
|
|||
|
|
|
|||
|
|
//3. <20><><EFBFBD><EFBFBD>ȿ<EFBFBD><C8BF> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
szArgment[1] = tokens[1][1];
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
float fResultRate = fRate[0] + fRate[1];
|
|||
|
|
int nResultHitStateBlowIndex = nHitStateBlowIndex[0];
|
|||
|
|
int nResultHitAttackAttribute = nHitAttackAttribute[0];
|
|||
|
|
int nResultDestStateBlowIndex = nDestStateBlowIndex[0];
|
|||
|
|
int nResultStateDurationTime = max(nStateDurationTime[0], nStateDurationTime[1]);
|
|||
|
|
|
|||
|
|
sprintf_s(szBuff, "[%f;%d;%d;%d;%d][%s]", fResultRate, nResultHitStateBlowIndex, nResultHitAttackAttribute, nResultDestStateBlowIndex, nResultStateDurationTime, szArgment[0].c_str());
|
|||
|
|
|
|||
|
|
szNewValue = szBuff;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void CDnAddStateOnConditionBlow::RemoveStateEffectValue(const char* szOrigValue, const char* szAddValue, std::string& szNewValue)
|
|||
|
|
{
|
|||
|
|
char szBuff[128] = {0, };
|
|||
|
|
|
|||
|
|
std::string strValue[2];
|
|||
|
|
std::vector<std::string> tokens[2];
|
|||
|
|
std::string delimiters = "[]";
|
|||
|
|
|
|||
|
|
|
|||
|
|
float fRate[2] = {0.0f, };
|
|||
|
|
int nHitStateBlowIndex[2] = {0, };
|
|||
|
|
int nHitAttackAttribute[2] = {0, };
|
|||
|
|
int nDestStateBlowIndex[2] = {0, };
|
|||
|
|
int nStateDurationTime[2] = {0, };
|
|||
|
|
std::string szArgment[2];
|
|||
|
|
|
|||
|
|
|
|||
|
|
strValue[0] = szOrigValue;
|
|||
|
|
//1. <20><><EFBFBD><EFBFBD>
|
|||
|
|
TokenizeA(strValue[0], tokens[0], delimiters);
|
|||
|
|
|
|||
|
|
if (tokens[0].size() != 2)
|
|||
|
|
{
|
|||
|
|
OutputDebug("%s :: %s --> <20><><EFBFBD><EFBFBD>ȿ<EFBFBD><C8BF> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20>ʿ<EFBFBD>!!!\n", __FUNCTION__, szOrigValue);
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
//2. <20>⺻ <20><><EFBFBD><EFBFBD>
|
|||
|
|
std::string defaultInfo = tokens[0][0];
|
|||
|
|
std::vector<std::string> infoTokens;
|
|||
|
|
delimiters = ";";
|
|||
|
|
|
|||
|
|
TokenizeA(defaultInfo, infoTokens, delimiters);
|
|||
|
|
if (5 == infoTokens.size())
|
|||
|
|
{
|
|||
|
|
fRate[0] = (float)atof(infoTokens[0].c_str());
|
|||
|
|
nHitStateBlowIndex[0] = atoi(infoTokens[1].c_str());
|
|||
|
|
nHitAttackAttribute[0] = atoi(infoTokens[2].c_str());
|
|||
|
|
nDestStateBlowIndex[0] = atoi(infoTokens[3].c_str());
|
|||
|
|
nStateDurationTime[0] = atoi(infoTokens[4].c_str());
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
OutputDebug("%s :: %s --> <20><><EFBFBD><EFBFBD>ȿ<EFBFBD><C8BF> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20>ʿ<EFBFBD>!!!\n", __FUNCTION__, szOrigValue);
|
|||
|
|
|
|||
|
|
//3. <20><><EFBFBD><EFBFBD>ȿ<EFBFBD><C8BF> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
szArgment[0] = tokens[0][1];
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
//////////////////////////////////////////////////////////////////////////
|
|||
|
|
strValue[1] = szAddValue;
|
|||
|
|
//1. <20><><EFBFBD><EFBFBD>
|
|||
|
|
TokenizeA(strValue[1], tokens[1], delimiters);
|
|||
|
|
|
|||
|
|
if (tokens[1].size() != 2)
|
|||
|
|
{
|
|||
|
|
OutputDebug("%s :: %s --> <20><><EFBFBD><EFBFBD>ȿ<EFBFBD><C8BF> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20>ʿ<EFBFBD>!!!\n", __FUNCTION__, szAddValue);
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
//2. <20>⺻ <20><><EFBFBD><EFBFBD>
|
|||
|
|
std::string defaultInfo = tokens[1][0];
|
|||
|
|
std::vector<std::string> infoTokens;
|
|||
|
|
delimiters = ";";
|
|||
|
|
|
|||
|
|
TokenizeA(defaultInfo, infoTokens, delimiters);
|
|||
|
|
if (5 == infoTokens.size())
|
|||
|
|
{
|
|||
|
|
fRate[1] = (float)atof(infoTokens[0].c_str());
|
|||
|
|
nHitStateBlowIndex[1] = atoi(infoTokens[1].c_str());
|
|||
|
|
nHitAttackAttribute[1] = atoi(infoTokens[2].c_str());
|
|||
|
|
nDestStateBlowIndex[1] = atoi(infoTokens[3].c_str());
|
|||
|
|
nStateDurationTime[1] = atoi(infoTokens[4].c_str());
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
OutputDebug("%s :: %s --> <20><><EFBFBD><EFBFBD>ȿ<EFBFBD><C8BF> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20>ʿ<EFBFBD>!!!\n", __FUNCTION__, szAddValue);
|
|||
|
|
|
|||
|
|
//3. <20><><EFBFBD><EFBFBD>ȿ<EFBFBD><C8BF> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
szArgment[1] = tokens[1][1];
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
float fResultRate = fRate[0] + fRate[1];
|
|||
|
|
int nResultHitStateBlowIndex = nHitStateBlowIndex[0];
|
|||
|
|
int nResultHitAttackAttribute = nHitAttackAttribute[0];
|
|||
|
|
int nResultDestStateBlowIndex = nDestStateBlowIndex[0];
|
|||
|
|
int nResultStateDurationTime = max(nStateDurationTime[0], nStateDurationTime[1]);
|
|||
|
|
|
|||
|
|
sprintf_s(szBuff, "[%f;%d;%d;%d;%d][%s]", fResultRate, nResultHitStateBlowIndex, nResultHitAttackAttribute, nResultDestStateBlowIndex, nResultStateDurationTime, szArgment[0].c_str());
|
|||
|
|
|
|||
|
|
szNewValue = szBuff;
|
|||
|
|
}
|
|||
|
|
#endif // PRE_ADD_PREFIX_SYSTE_RENEW
|