154 lines
4.9 KiB
C++
154 lines
4.9 KiB
C++
|
|
#include "StdAfx.h"
|
|||
|
|
#include "DnWorldShooterBrokenProp.h"
|
|||
|
|
#include "DnStateBlow.h"
|
|||
|
|
#include "DnTableDB.h"
|
|||
|
|
#include "DnProjectile.h"
|
|||
|
|
#include "TaskManager.h"
|
|||
|
|
#include "DnGameTask.h"
|
|||
|
|
|
|||
|
|
|
|||
|
|
CDnWorldShooterBrokenProp::CDnWorldShooterBrokenProp( CMultiRoom* pRoom ) : CDnWorldBrokenProp( pRoom )
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
CDnWorldShooterBrokenProp::~CDnWorldShooterBrokenProp(void)
|
|||
|
|
{
|
|||
|
|
ReleasePostCustomParam();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
bool CDnWorldShooterBrokenProp::Initialize( CEtWorldSector *pParentSector, const char *szPropName, EtVector3 &vPos, EtVector3 &vRotate, EtVector3 &vScale )
|
|||
|
|
{
|
|||
|
|
if( CDnWorldBrokenProp::Initialize( pParentSector, szPropName, vPos, vRotate, vScale ) == false ) return false;
|
|||
|
|
if( m_hMonster ) *m_hMonster->GetMatEx() = *GetMatEx();
|
|||
|
|
return true;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
bool CDnWorldShooterBrokenProp::InitializeTable( int nTableID )
|
|||
|
|
{
|
|||
|
|
if( CDnWorldActProp::InitializeTable(nTableID) == false ) return false;
|
|||
|
|
|
|||
|
|
bool bResult = false;
|
|||
|
|
|
|||
|
|
if( GetData() )
|
|||
|
|
{
|
|||
|
|
ShooterBrokenStruct* pStruct = (ShooterBrokenStruct*)GetData();
|
|||
|
|
int nDurability = pStruct->nDurability;
|
|||
|
|
int nItemDropGroupTableID = pStruct->nItemDropGroupTableID;
|
|||
|
|
int nMonsterTableID = pStruct->nMonsterTableID;
|
|||
|
|
int nSkillTableID = pStruct->nSkillTableID;
|
|||
|
|
int nSkillLevel = pStruct->nSkillLevel;
|
|||
|
|
|
|||
|
|
//#61146 TrapŸ<70><C5B8> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>ݷ<EFBFBD><DDB7><EFBFBD> <20><><EFBFBD>̵<EFBFBD><CCB5><EFBFBD> <20><><EFBFBD><EFBFBD> <20>ٸ<EFBFBD><D9B8><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20>ִ<EFBFBD> <20><><EFBFBD><EFBFBD>.
|
|||
|
|
#ifdef PER_ADD_PROP_TRAP_DIFFICULT_SET
|
|||
|
|
bResult = InitializeMonsterActorProp( nMonsterTableID, ( pStruct->MonsterWeight ? true : false ) );
|
|||
|
|
#else
|
|||
|
|
bResult = InitializeMonsterActorProp( nMonsterTableID );
|
|||
|
|
#endif
|
|||
|
|
|
|||
|
|
if( bResult )
|
|||
|
|
{
|
|||
|
|
m_SkillComponent.Initialize( nSkillTableID, nSkillLevel );
|
|||
|
|
|
|||
|
|
m_nDurability = nDurability;
|
|||
|
|
|
|||
|
|
// <20>ϴ<EFBFBD> <20><EFBFBD><D7BC><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ʵ<EFBFBD><CAB5><EFBFBD><EFBFBD>Ѵ<EFBFBD>. <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Ŭ<><C5AC><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20>ð<EFBFBD><C3B0><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>Ѵ<EFBFBD>..
|
|||
|
|
SetAction( "Idle", 0.0f, 0.0f );
|
|||
|
|
|
|||
|
|
if( -1 != m_nDurability )
|
|||
|
|
{
|
|||
|
|
if( 0 == m_nDurability ) m_nDurability = 1;
|
|||
|
|
m_nItemDropGroupTableID = pStruct->nItemDropGroupTableID;
|
|||
|
|
if( m_nItemDropGroupTableID > 0 ) {
|
|||
|
|
CDnDropItem::CalcDropItemList( GetRoom(), Dungeon::Difficulty::Max, m_nItemDropGroupTableID, m_VecDropItemList );
|
|||
|
|
|
|||
|
|
if (m_VecDropItemList.empty())
|
|||
|
|
{
|
|||
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD>α<EFBFBD>
|
|||
|
|
// g_pLogConnection->QueryLogStage(GetRoom()->GetRoomID(), pTask->GetMapTableID(), 0, 0, nTableID); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>α<EFBFBD> 090226
|
|||
|
|
}
|
|||
|
|
else {
|
|||
|
|
for( DWORD i=0; i<m_VecDropItemList.size(); i++ ) {
|
|||
|
|
#if defined(PRE_ADD_STAGE_CLEAR_ENCHANT_REWARD)
|
|||
|
|
if( CDnDropItem::PreInitializeItem( GetRoom(), m_VecDropItemList[i].nItemID, m_VecDropItemList[i].nEnchantID ) == false )
|
|||
|
|
#else // #if defined(PRE_ADD_STAGE_CLEAR_ENCHANT_REWARD)
|
|||
|
|
if( CDnDropItem::PreInitializeItem( GetRoom(), m_VecDropItemList[i].nItemID ) == false )
|
|||
|
|
#endif // #if defined(PRE_ADD_STAGE_CLEAR_ENCHANT_REWARD)
|
|||
|
|
{
|
|||
|
|
m_VecDropItemList.erase( m_VecDropItemList.begin() + i );
|
|||
|
|
i--;
|
|||
|
|
continue;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD>α<EFBFBD>
|
|||
|
|
// g_pLogConnection->QueryLogStage(GetRoom()->GetRoomID(), pTask->GetMapTableID(), 0, m_VecDropItemList[i].nItemID, nTableID); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>α<EFBFBD> 090226
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
return bResult;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
// <20>ϴ<EFBFBD> Shooter <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>ų<EFBFBD><C5B3><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><EFBFBD>Ʈ <20>غ<EFBFBD><D8BA><EFBFBD>..
|
|||
|
|
|
|||
|
|
void CDnWorldShooterBrokenProp::OnSignal( SignalTypeEnum Type, void *pPtr, LOCAL_TIME LocalTime, LOCAL_TIME SignalStartTime, LOCAL_TIME SignalEndTime, int nSignalIndex )
|
|||
|
|
{
|
|||
|
|
if( m_hMonster )
|
|||
|
|
{
|
|||
|
|
*(m_hMonster->GetMatEx()) = m_Cross;
|
|||
|
|
m_SkillComponent.OnSignal( m_hMonster, GetMySmartPtr(), Type, pPtr, LocalTime, SignalStartTime, SignalEndTime, nSignalIndex );
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
CDnWorldBrokenProp::OnSignal( Type, pPtr, LocalTime, SignalStartTime, SignalEndTime, nSignalIndex );
|
|||
|
|
|
|||
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>¾Ҵ<C2BE> <20><EFBFBD><D7BC><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ؼ<EFBFBD> Normal <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20>ٽ<EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><>.
|
|||
|
|
if( STE_Projectile == Type )
|
|||
|
|
{
|
|||
|
|
const char* pCurrentAttackAction = GetCurrentAction();
|
|||
|
|
if( strlen( pCurrentAttackAction ) )
|
|||
|
|
m_strLastActionName.assign( pCurrentAttackAction );
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
void CDnWorldShooterBrokenProp::OnSyncComplete( CDNUserSession* pBreakIntoGameSession/*=NULL*/ )
|
|||
|
|
{
|
|||
|
|
if( pBreakIntoGameSession )
|
|||
|
|
CmdAction( GetCurrentAction(), pBreakIntoGameSession );
|
|||
|
|
else
|
|||
|
|
CmdAction( m_szDefaultActionName.c_str(), pBreakIntoGameSession );
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><EFBFBD>ü<EFBFBD><C3BC> Ŭ<><C5AC><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>Ȯ<EFBFBD>ϰ<EFBFBD> <20>¾ƾ<C2BE> <20>ϱ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><EFBFBD> <20><><EFBFBD>涧<EFBFBD><E6B6A7><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>Ŷ<EFBFBD><C5B6> <20><><EFBFBD><EFBFBD><EFBFBD>ش<EFBFBD>.
|
|||
|
|
void CDnWorldShooterBrokenProp::OnChangeAction( const char *szPrevAction )
|
|||
|
|
{
|
|||
|
|
//// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ٸ<EFBFBD> <20><EFBFBD><D7BC><EFBFBD><EFBFBD><EFBFBD> <20>ٲ<EFBFBD><D9B2><EFBFBD> <20>ʴ<EFBFBD> <20>̻<EFBFBD> idle <20><> <20>ݺ<EFBFBD><DDBA>DZ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
//// idle <20><EFBFBD><D7BC><EFBFBD> <20><><EFBFBD>쿣 idle <20><> <20><><EFBFBD><EFBFBD><EFBFBD>Ǿ<EFBFBD><C7BE><EFBFBD> <20><> <20>ѹ<EFBFBD><D1B9><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
|||
|
|
//// Idle <20><EFBFBD><D7BC><EFBFBD> ª<><C2AA> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><>Ŷ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD>. (#17409)
|
|||
|
|
//const char* pCurrentAction = GetCurrentAction();
|
|||
|
|
//if( strcmp(pCurrentAction, "Idle") == 0 )
|
|||
|
|
//{
|
|||
|
|
// if( strcmp(szPrevAction, "Idle") != 0 )
|
|||
|
|
// {
|
|||
|
|
// ActionSync( pCurrentAction );
|
|||
|
|
// }
|
|||
|
|
//}
|
|||
|
|
//else
|
|||
|
|
// ActionSync( pCurrentAction );
|
|||
|
|
|
|||
|
|
// <20><EFBFBD><D7BC><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>Ǿ<EFBFBD><C7BE><EFBFBD> <20><><EFBFBD><EFBFBD> <20><>Ŷ <20><><EFBFBD><EFBFBD>.
|
|||
|
|
if( m_nActionIndex != m_nPrevActionIndex )
|
|||
|
|
ActionSync( GetCurrentAction() );
|
|||
|
|
|
|||
|
|
if( strcmp( szPrevAction, "Hit" ) )
|
|||
|
|
{
|
|||
|
|
if( !m_strLastActionName.empty() )
|
|||
|
|
SetActionQueue( m_strLastActionName.c_str() );
|
|||
|
|
}
|
|||
|
|
}
|