161 lines
4.6 KiB
C++
161 lines
4.6 KiB
C++
|
|
#include "StdAfx.h"
|
|||
|
|
#include "DnDissolveBufBlow.h"
|
|||
|
|
|
|||
|
|
#ifdef _DEBUG
|
|||
|
|
#define new new(_NORMAL_BLOCK,__FILE__,__LINE__)
|
|||
|
|
#endif
|
|||
|
|
|
|||
|
|
CDnDissolveBufBlow::CDnDissolveBufBlow( DnActorHandle hActor, const char* szValue ) : CDnBlow( hActor )
|
|||
|
|
{
|
|||
|
|
m_StateBlow.emBlowIndex = STATE_BLOW::BLOW_083;
|
|||
|
|
SetValue( szValue );
|
|||
|
|
//m_nValue = atoi( szValue );
|
|||
|
|
m_fValue = (float)atof(szValue);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
CDnDissolveBufBlow::~CDnDissolveBufBlow(void)
|
|||
|
|
{
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
void CDnDissolveBufBlow::OnBegin( LOCAL_TIME LocalTime, float fDelta )
|
|||
|
|
{
|
|||
|
|
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>ȿ<EFBFBD><C8BF> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ƴ϶<C6B4> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>ų <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>.
|
|||
|
|
multimap<int, DnBlowHandle> mmapBuffBlowsBySkill;
|
|||
|
|
|
|||
|
|
int iDissolveCount = 0;
|
|||
|
|
int iNumAppliedBlow = m_hActor->GetNumAppliedStateBlow();
|
|||
|
|
vector<int> vlBuffSkillID;
|
|||
|
|
for( int iBlow = 0; iBlow < iNumAppliedBlow; ++iBlow )
|
|||
|
|
{
|
|||
|
|
DnBlowHandle hBlow = m_hActor->GetAppliedStateBlow( iBlow );
|
|||
|
|
if( !hBlow )
|
|||
|
|
continue;
|
|||
|
|
|
|||
|
|
const CDnSkill::SkillInfo* pSkillInfo = hBlow->GetParentSkillInfo();
|
|||
|
|
|
|||
|
|
// <20><><EFBFBD>Ƿ<EFBFBD> <20>־<EFBFBD><D6BE>ִ<EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>ȿ<EFBFBD><C8BF><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ƴ<EFBFBD>.
|
|||
|
|
if( hBlow->IsPermanent() )
|
|||
|
|
continue;
|
|||
|
|
|
|||
|
|
if( pSkillInfo && pSkillInfo->iSkillID )
|
|||
|
|
{
|
|||
|
|
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>ȿ<EFBFBD><C8BF>. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>ų<EFBFBD><C5B3><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>Ѵ<EFBFBD>.
|
|||
|
|
// <20><>, <20>нú<D0BD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>Ǿ<EFBFBD><C7BE>ִ<EFBFBD> <20>͵<EFBFBD><CDB5><EFBFBD> <20><><EFBFBD><EFBFBD>.
|
|||
|
|
if( (0 == pSkillInfo->iDissolvable) &&
|
|||
|
|
(CDnSkill::Passive != pSkillInfo->eSkillType ) &&
|
|||
|
|
(CDnSkill::Buff == pSkillInfo->eDurationType) )
|
|||
|
|
{
|
|||
|
|
// <20>ٿ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ۿ<EFBFBD><DBBF><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD> Ư<><C6AF> <20><>ų ȸ<><C8B8> <20><><EFBFBD><EFBFBD>ȿ<EFBFBD><C8BF><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>ȿ<EFBFBD><C8BF><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ʴ´<CAB4>.
|
|||
|
|
// <20><><EFBFBD>Ŀ<EFBFBD> <20>Ϲ<EFBFBD><CFB9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> ó<><C3B3><EFBFBD><EFBFBD><EFBFBD>־<EFBFBD><D6BE><EFBFBD> <20><>.
|
|||
|
|
if( hBlow->IsFromSourceItem() )
|
|||
|
|
continue;
|
|||
|
|
|
|||
|
|
if( hBlow->IsEternity() )
|
|||
|
|
continue;
|
|||
|
|
|
|||
|
|
mmapBuffBlowsBySkill.insert( make_pair(pSkillInfo->iSkillID, hBlow) );
|
|||
|
|
|
|||
|
|
// <20>ϳ<EFBFBD><CFB3><EFBFBD> <20><>ų<EFBFBD><C5B3> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>ȿ<EFBFBD><C8BF><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><> <20>ִ<EFBFBD>. <20><><EFBFBD><EFBFBD>ũ<EFBFBD><C5A9> <20><>ų <20><><EFBFBD>̵<EFBFBD><CCB5><EFBFBD> <20>־<EFBFBD><D6BE>ش<EFBFBD>.
|
|||
|
|
if( vlBuffSkillID.end() == find( vlBuffSkillID.begin(), vlBuffSkillID.end(), pSkillInfo->iSkillID ) )
|
|||
|
|
vlBuffSkillID.push_back( pSkillInfo->iSkillID );
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
DNVector(int) vlAppliedBuffBlowIDs;
|
|||
|
|
for( int i = 0; i < (int)vlBuffSkillID.size(); ++i )
|
|||
|
|
{
|
|||
|
|
if( iDissolveCount >= (int)m_fValue )
|
|||
|
|
break;
|
|||
|
|
|
|||
|
|
pair<multimap<int, DnBlowHandle>::iterator, multimap<int, DnBlowHandle>::iterator> iter_pair =
|
|||
|
|
mmapBuffBlowsBySkill.equal_range( vlBuffSkillID.at(i) );
|
|||
|
|
|
|||
|
|
// <20><><EFBFBD><EFBFBD> <20><>ų<EFBFBD><C5B3><EFBFBD><EFBFBD> <20><><EFBFBD>Ե<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>ȿ<EFBFBD><C8BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>Ƶд<C6B5>.
|
|||
|
|
multimap<int, DnBlowHandle>::iterator iter = iter_pair.first;
|
|||
|
|
for( iter; iter != iter_pair.second; ++iter )
|
|||
|
|
vlAppliedBuffBlowIDs.push_back( iter->second->GetBlowID() );
|
|||
|
|
|
|||
|
|
++iDissolveCount;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>нú<D0BD> <20><>ų<EFBFBD><C5B3> <20>ƴ<EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>ȿ<EFBFBD><C8BF><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
|||
|
|
int iNumBlow = (int)vlAppliedBuffBlowIDs.size();
|
|||
|
|
for( int iBlow = 0; iBlow < iNumBlow; ++iBlow )
|
|||
|
|
{
|
|||
|
|
int iBlowID = vlAppliedBuffBlowIDs.at( iBlow );
|
|||
|
|
m_hActor->RemoveStateBlowFromID( iBlowID );
|
|||
|
|
|
|||
|
|
//// Note: <20><><EFBFBD>ǵ<EFBFBD> <20><><EFBFBD><EFBFBD>ȿ<EFBFBD><C8BF> <20>ε<EFBFBD><CEB5><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ϹǷ<CFB9> <20><><EFBFBD><EFBFBD> Ÿ<><C5B8><EFBFBD><EFBFBD> 1<><31> <20>̻<EFBFBD><CCBB><EFBFBD> <20><> <20>ִ<EFBFBD>.
|
|||
|
|
//// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> hBlow <20><> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>̹<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>Ǿ<EFBFBD><C7BE><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD> <20><>ȿ<EFBFBD><C8BF> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>Ѵ<EFBFBD>.
|
|||
|
|
//if( hBlow )
|
|||
|
|
//{
|
|||
|
|
// m_hActor->RemoveStateBlowByBlowDefineIndex( hBlow->GetBlowIndex() );
|
|||
|
|
//}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
OutputDebug( "CDnDissolveBufBlow::OnBegin, Value:%d \n", (int)m_fValue );
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
void CDnDissolveBufBlow::OnEnd( LOCAL_TIME LocalTime, float fDelta )
|
|||
|
|
{
|
|||
|
|
OutputDebug( "CDnDissolveBufBlow::OnEnd\n");
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
#if defined(PRE_ADD_PREFIX_SYSTE_RENEW)
|
|||
|
|
void CDnDissolveBufBlow::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 CDnDissolveBufBlow::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
|