#include "StdAfx.h" #include "DnDisarmamentBlow.h" #include "DnPlayerActor.h" #if !defined( USE_BOOST_MEMPOOL ) #ifdef _DEBUG #define new new(_NORMAL_BLOCK,__FILE__,__LINE__) #endif #endif // #if !defined( USE_BOOST_MEMPOOL ) CDnDisarmamentBlow::CDnDisarmamentBlow( DnActorHandle hActor, const char* szValue ) : CDnBlow( hActor ) { m_StateBlow.emBlowIndex = STATE_BLOW::BLOW_237; SetValue( szValue ); m_fValue = 0.0f; } CDnDisarmamentBlow::~CDnDisarmamentBlow(void) { } void CDnDisarmamentBlow::OnBegin( LOCAL_TIME LocalTime, float fDelta ) { OutputDebug( "%s\n", __FUNCTION__); #if defined(PRE_ADD_50907) if (m_hActor) m_hActor->AddDisarmamentRefCount(); //ÃÖÃÊ¿¡ ¿ø·¡ ¹«±â¸¦ ¹Þ¾Æ ³õ´Â´Ù. if (m_hActor && m_hActor->GetDisarmamentRefCount() == 1) { DnWeaponHandle hOrigWeapon = m_hActor->GetWeapon(0); bool bOrigSelefDelete = m_hActor->GetWeaponSelfDelete(0); //ChangeWeaponBlow»óÅ¿¡ »ó°ü¾øÀÌ ÇöÀç ¹«±â·Î¸¸ µÇµ¹¸®¸é µÈ´Ù.. // //ChangeWeaponÀ¸·Î ¹«±â°¡ º¯°æ µÇ¾ú´Ù¸é ¿ø·¡ ¹«±â´Â ChangeWeapon¿¡ ÀúÀåµÈ ¹«±â·Î ¼³Á¤µÇ¾î¾ß ÇÑ´Ù. // if (m_hActor->GetChangeWeaponRefCount() > 0) // { // hOrigWeapon = m_hActor->GetOrigWeaponWhenChangeWeapon(); // bOrigSelefDelete = m_hActor->GetOrigWeaponWhenChangeWeaponSelfDelete(); // } m_hActor->SetOrigWeaponWhenDisarmament(hOrigWeapon, bOrigSelefDelete); m_hActor->SetSkipOnAttatchDetachWeapon(true); //ÀÌ ¼³Á¤À» ÇØ³õ¾Æ¾ß DetachWeapon¿¡¼­ MASkillUser::OnDetachWeaponÇÔ¼ö È£ÃâÀÌ ¾ÈµÊ.(ÇÔ¼ö ³»ºÎ¿¡ »óÅÂÈ¿°ú Á¦°Å È£ÃâÀÌ µÉ ¼ö ÀÖÀ½) m_hActor->SetChangeWeaponLock(false); m_hActor->SetSkipChangeWeaponAction(true); m_hActor->DetachWeapon(0); m_hActor->SetSkipChangeWeaponAction(false); m_hActor->SetChangeWeaponLock(true); m_hActor->SetSkipOnAttatchDetachWeapon(false); if (m_hActor->IsPlayerActor()) { CDnPlayerActor* pPlayerActor = dynamic_cast(m_hActor.GetPointer()); if (pPlayerActor) pPlayerActor->SetBattleMode(false); } } #endif // PRE_ADD_50907 } void CDnDisarmamentBlow::OnEnd( LOCAL_TIME LocalTime, float fDelta ) { OutputDebug( "%s\n", __FUNCTION__); #if defined(PRE_ADD_50907) if (m_hActor) m_hActor->RemoveDisarmamentRefCount(); if (m_hActor && m_hActor->GetDisarmamentRefCount() == 0) { //¹«±â ´Ù½Ã Âø¿ë½Ã µ¿ÀÛÀ» ÇÏÁö ¾ÊÀ¸¸é ±âº» °ø°ÝÀÌ µé¾î °¡Áö ¾Ê°Ô µÊ. //±×·¡¼­ ¹«±â ÇØÁ¦½Ã´Â µ¿ÀÛ ¾ÈÇÏ°Ô Çϰí, ¿ø·¡ ¹«±â·Î Âø¿ë½Ã µ¿ÀÛÀ» Çϵµ·ÏÇÔ. m_hActor->SetChangeWeaponLock(false); //m_hActor->SetSkipChangeWeaponAction(true); m_hActor->SetSkipOnAttatchDetachWeapon(true); //ÀÌ ¼³Á¤À» ÇØ³õ¾Æ¾ß AttachWeapon/DetachWeapon¿¡¼­ MASkillUser::OnAttachWeapon/OnDetachWeaponÇÔ¼ö È£ÃâÀÌ ¾ÈµÊ.(ÇÔ¼ö ³»ºÎ¿¡¼­ »óÅÂÈ¿°ú Á¦°Å/Ãß°¡ È£ÃâÀÌ µÉ ¼ö ÀÖÀ½) DnWeaponHandle hOrigWeapon = m_hActor->GetOrigWeaponWhenDisarmament(); bool bSelfDelete = m_hActor->GetOrigWeaponWhenDisarmamentSelfDelete(); if (hOrigWeapon) m_hActor->AttachWeapon(hOrigWeapon, 0, bSelfDelete); else m_hActor->DetachWeapon(0); //m_hActor->SetSkipChangeWeaponAction(false); m_hActor->SetSkipOnAttatchDetachWeapon(false); if (m_hActor->IsPlayerActor()) { CDnPlayerActor* pPlayerActor = dynamic_cast(m_hActor.GetPointer()); if (pPlayerActor) { if (hOrigWeapon) pPlayerActor->SetBattleMode(true); else pPlayerActor->SetBattleMode(false); } } } #endif // PRE_ADD_50907 } #if defined(PRE_ADD_PREFIX_SYSTE_RENEW) void CDnDisarmamentBlow::AddStateEffectValue(const char* szOrigValue, const char* szAddValue, std::string& szNewValue) { char szBuff[128] = {0, }; szNewValue = szOrigValue; } void CDnDisarmamentBlow::RemoveStateEffectValue(const char* szOrigValue, const char* szAddValue, std::string& szNewValue) { char szBuff[128] = {0, }; szNewValue = szOrigValue; } #endif // PRE_ADD_PREFIX_SYSTE_RENEW