192 lines
4.6 KiB
C++
192 lines
4.6 KiB
C++
|
|
#include "StdAfx.h"
|
|||
|
|
#include "DnInvisibleBlow.h"
|
|||
|
|
#ifndef _GAMESERVER
|
|||
|
|
#include "DnInterface.h"
|
|||
|
|
#endif
|
|||
|
|
|
|||
|
|
#ifdef _DEBUG
|
|||
|
|
#define new new(_NORMAL_BLOCK,__FILE__,__LINE__)
|
|||
|
|
#endif
|
|||
|
|
|
|||
|
|
CDnInvisibleBlow::CDnInvisibleBlow( DnActorHandle hActor, const char* szValue ) : CDnBlow( hActor )
|
|||
|
|
{
|
|||
|
|
m_StateBlow.emBlowIndex = STATE_BLOW::BLOW_073;
|
|||
|
|
SetValue( szValue );
|
|||
|
|
m_fValue = (float)atof( szValue );
|
|||
|
|
|
|||
|
|
#if defined(_GAMESERVER)
|
|||
|
|
#else
|
|||
|
|
m_fDestAlpha = 0.0f;
|
|||
|
|
m_fNowAlpha = 1.0f;
|
|||
|
|
m_bEnded = false;
|
|||
|
|
#endif // _GAMESERVER
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
CDnInvisibleBlow::~CDnInvisibleBlow(void)
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
void CDnInvisibleBlow::OnBegin( LOCAL_TIME LocalTime, float fDelta )
|
|||
|
|
{
|
|||
|
|
#ifndef _GAMESERVER
|
|||
|
|
// Ŭ<><C5AC><EFBFBD>̾<EFBFBD>Ʈ<EFBFBD><C6AE> <20><><EFBFBD>쿡<EFBFBD><ECBFA1> <20><><EFBFBD>İ<EFBFBD> <20><><EFBFBD><EFBFBD>
|
|||
|
|
m_hActor->SetAlphaBlend( 0.0f, AL_STATEEFFECT );
|
|||
|
|
m_hActor->GetAniObjectHandle()->EnableShadowCast( false );
|
|||
|
|
GetInterface().HideEnemyGauge( m_hActor );
|
|||
|
|
m_fDestAlpha = 0.0f;
|
|||
|
|
m_fNowAlpha = 1.0f;
|
|||
|
|
m_bEnded = false;
|
|||
|
|
|
|||
|
|
|
|||
|
|
//<2F>÷<EFBFBD><C3B7>̾<EFBFBD> ij<><C4B3><EFBFBD><EFBFBD> <20>ΰ<EFBFBD><CEB0><EFBFBD> <20><><EFBFBD><EFBFBD><E2BFA1> <20><EFBFBD>ü<EFBFBD><C3BC> <20><EFBFBD><DFBB>ɶ<EFBFBD> <20><><EFBFBD><EFBFBD> <20><>ġ<EFBFBD><C4A1> <20><><EFBFBD>ſ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>.
|
|||
|
|
//<2F><EFBFBD><D7B7><EFBFBD> ij<><C4B3><EFBFBD>Ͱ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20>ʵ<EFBFBD><CAB5><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD>İ<EFBFBD><C4B0><EFBFBD> 0.0<EFBFBD><EFBFBD> <20>ƴ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ؼ<EFBFBD>
|
|||
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ġ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʈ<EFBFBD><C6AE> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ó<><C3B3> <20>ǵ<EFBFBD><C7B5><EFBFBD><EFBFBD>Ѵ<EFBFBD>..
|
|||
|
|
if (m_hActor && m_hActor->IsPlayerActor())
|
|||
|
|
m_fDestAlpha = 0.0001f;
|
|||
|
|
#endif
|
|||
|
|
|
|||
|
|
OutputDebug( "CDnInvisibleBlow::OnBegin \n");
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
void CDnInvisibleBlow::Process( LOCAL_TIME LocalTime, float fDelta )
|
|||
|
|
{
|
|||
|
|
CDnBlow::Process( LocalTime, fDelta );
|
|||
|
|
|
|||
|
|
#ifndef _GAMESERVER
|
|||
|
|
if( false == m_bEnded )
|
|||
|
|
{
|
|||
|
|
// <20><><EFBFBD><EFBFBD>/<2F>ǰ<EFBFBD>/<2F><><EFBFBD><EFBFBD> <20><><EFBFBD>϶<EFBFBD><CFB6><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Ǯ<><C7AE>. idle <20><> <20><><EFBFBD>쿣 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
|||
|
|
const char* pCurrentActionName = m_hActor->GetCurrentAction();
|
|||
|
|
if( (/*m_hActor->IsMove() ||*/ m_hActor->IsAttack() || m_hActor->IsProcessSkill() ||
|
|||
|
|
m_hActor->IsStiff() || m_hActor->IsHit() /*|| m_hActor->IsAir()*/) &&
|
|||
|
|
0 != strcmp(pCurrentActionName, "Idle") )
|
|||
|
|
{
|
|||
|
|
m_fDestAlpha = 0.5f;
|
|||
|
|
|
|||
|
|
//m_hActor->SetAlphaBlend( 0.5f );
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
{
|
|||
|
|
m_fDestAlpha = 0.0f;
|
|||
|
|
|
|||
|
|
if (m_hActor && m_hActor->IsPlayerActor())
|
|||
|
|
m_fDestAlpha = 0.0001f;
|
|||
|
|
|
|||
|
|
//m_hActor->SetAlphaBlend( 0.0f );
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if( m_fNowAlpha < m_fDestAlpha )
|
|||
|
|
{
|
|||
|
|
m_fNowAlpha += fDelta;
|
|||
|
|
}
|
|||
|
|
else
|
|||
|
|
if( m_fNowAlpha > m_fDestAlpha )
|
|||
|
|
{
|
|||
|
|
m_fNowAlpha -= fDelta;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if( false == m_bEnded )
|
|||
|
|
{
|
|||
|
|
// delta <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>״<EFBFBD><D7B4><EFBFBD> <20><><EFBFBD>ĸ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ϹǷ<CFB9> <20>ð<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>д<EFBFBD>.
|
|||
|
|
if( (0.0f < GetDurationTime()) && (GetDurationTime() < (1.0f-m_fNowAlpha)) )
|
|||
|
|
{
|
|||
|
|
m_fDestAlpha = 1.0f;
|
|||
|
|
|
|||
|
|
if( false == m_bEnded )
|
|||
|
|
SetDurationTime( 1.0f-m_fNowAlpha );
|
|||
|
|
|
|||
|
|
m_bEnded = true;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if( m_fNowAlpha != m_fDestAlpha )
|
|||
|
|
{
|
|||
|
|
float fGap = m_fNowAlpha - m_fDestAlpha;
|
|||
|
|
if( fGap < 0.05f && fGap > -0.05f )
|
|||
|
|
m_fNowAlpha = m_fDestAlpha;
|
|||
|
|
|
|||
|
|
//OutputDebug( "[Invisible] %2.2f\n", m_fNowAlpha );
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
m_hActor->SetAlphaBlend( m_fNowAlpha , AL_STATEEFFECT );
|
|||
|
|
|
|||
|
|
#endif
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
bool CDnInvisibleBlow::OnDefenseAttack( DnActorHandle hHitter, CDnState* pAttackerState, CDnDamageBase::SHitParam &HitParam, bool bHitSuccess )
|
|||
|
|
{
|
|||
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> 50%<25><>
|
|||
|
|
|
|||
|
|
return false;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
void CDnInvisibleBlow::OnEnd( LOCAL_TIME LocalTime, float fDelta )
|
|||
|
|
{
|
|||
|
|
#ifndef _GAMESERVER
|
|||
|
|
m_hActor->SetAlphaBlend( 1.0f , AL_STATEEFFECT );
|
|||
|
|
m_hActor->GetAniObjectHandle()->EnableShadowCast( true );
|
|||
|
|
GetInterface().ShowEnemyGauge( m_hActor, false );
|
|||
|
|
#endif
|
|||
|
|
|
|||
|
|
OutputDebug( "CDnInvisibleBlow::OnEnd \n");
|
|||
|
|
}
|
|||
|
|
#if defined(PRE_ADD_PREFIX_SYSTE_RENEW)
|
|||
|
|
void CDnInvisibleBlow::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 CDnInvisibleBlow::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
|