#include "stdafx.h" #include "SGameOtherCreature.h" #include "SCreatureStateMachine.h" SGameOtherCreature::SGameOtherCreature( int nCreatureID, unsigned char ucEnhance ) : SGameCreature(nCreatureID, ucEnhance) { m_pStateVM = new SOtherCreatureStateMachine; //상태 머신 m_pStateVM->SetReceiver( this ); m_dwOldTime = 0; m_pMasterPlayer = NULL; m_hMaster = 0; } SGameOtherCreature::~SGameOtherCreature() { } //다른 플레이어가 크리처에 올라탔을때 void SGameOtherCreature::SetViewVectorStateIdle( const K3DVector &tpos ) { float fTargetRoll = atan2( tpos.y, tpos.x ); if( fTargetRoll != m_fTargetRoll ) { m_fTargetRoll = atan2( tpos.y, tpos.x ); m_dwPrevTime = m_dwTime; m_bUseRot = true; StandingDegree(); } } //다른 플레이어의 크리처도 같은 방향을 보게 하려면 추가해야한다. ( 나중에 필요하면 추가하자 ) void SGameOtherCreature::SetMaster( AR_HANDLE hMaster, SGameAvatarEx * pMaster ) { m_pMasterPlayer = pMaster; m_hMaster = hMaster; } bool SGameOtherCreature::Process( DWORD time, unsigned long uProcessBitVector ) // sonador 1.8.15 다른 플레이어의 크리처 스킬 연출 오류 수정 { if( time - m_dwOldTime > 2000 ) { m_dwOldTime = time; //이동중 공격중 스킬 사용중 및 살아있는중 삭제 보류 대상이 아니여야 하며 마운트 모드 및 마운트 상태가 아니여야 한다 if( !IsMoving() && !IsAttacking() && !IsUsingSkill() && IsLive() && !IsReservation() && !IsMount() && !IsMountMode() ) { SGameAvatarEx* pMaster = (SGameAvatarEx*)GetGameObject( m_hMaster ); if( pMaster ) { SetViewVectorStateIdle( pMaster->GetViewVector() ); } } } SGameCreature::Process( time, uProcessBitVector ); // sonador 1.8.15 다른 플레이어의 크리처 스킬 연출 오류 수정 return true; }