96 lines
2.7 KiB
C++
96 lines
2.7 KiB
C++
|
|
#include "StdAfx.h"
|
|||
|
|
#include "DnChangeWeightBlow.h"
|
|||
|
|
|
|||
|
|
#ifdef _DEBUG
|
|||
|
|
#define new new(_NORMAL_BLOCK,__FILE__,__LINE__)
|
|||
|
|
#endif
|
|||
|
|
|
|||
|
|
|
|||
|
|
CDnChangeWeightBlow::CDnChangeWeightBlow( DnActorHandle hActor, const char* szValue ) : CDnBlow( hActor ), m_fWeightDelta( 0.0f )
|
|||
|
|
{
|
|||
|
|
m_StateBlow.emBlowIndex = STATE_BLOW::BLOW_131;
|
|||
|
|
|
|||
|
|
SetValue( szValue );
|
|||
|
|
m_fValue = (float)atof( szValue );
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
CDnChangeWeightBlow::~CDnChangeWeightBlow(void)
|
|||
|
|
{
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
void CDnChangeWeightBlow::OnBegin( LOCAL_TIME LocalTime, float fDelta )
|
|||
|
|
{
|
|||
|
|
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><D4B0><EFBFBD> <20>Ƶд<C6B5>.
|
|||
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>ȿ<EFBFBD><C8BF><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD> <20><>Ÿ<EFBFBD><C5B8><EFBFBD><EFBFBD> <20>Ƽ<DEBE> <20><><EFBFBD>߿<EFBFBD> <20><><EFBFBD><EFBFBD> <20><>Ų<EFBFBD><C5B2>.
|
|||
|
|
float fNowWeightValue = m_hActor->GetWeight();
|
|||
|
|
m_fWeightDelta = fNowWeightValue - m_fValue;
|
|||
|
|
|
|||
|
|
// <20><><EFBFBD>Ӱ<EFBFBD> <20><><EFBFBD><EFBFBD><D4B0><EFBFBD> <20><><EFBFBD><EFBFBD>.
|
|||
|
|
m_hActor->SetWeight( m_fValue );
|
|||
|
|
|
|||
|
|
OutputDebug( "CDnChangeWeightBlow::OnBegin Value: Now: %2.2f, Dest: %2.2f, Delta: %2.2f\n", fNowWeightValue, m_fValue, m_fWeightDelta );
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
void CDnChangeWeightBlow::OnEnd( LOCAL_TIME LocalTime, float fDelta )
|
|||
|
|
{
|
|||
|
|
float fNowWeightValue = m_hActor->GetWeight();
|
|||
|
|
m_hActor->SetWeight( fNowWeightValue + m_fWeightDelta );
|
|||
|
|
|
|||
|
|
OutputDebug( "CDnChangeWeightBlow::OnEnd Value: Now: %2.2f, Dest: %2.2f, Delta: %2.2f\n", fNowWeightValue, m_fValue, m_fWeightDelta );
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
#if defined(PRE_ADD_PREFIX_SYSTE_RENEW)
|
|||
|
|
void CDnChangeWeightBlow::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 CDnChangeWeightBlow::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
|