144 lines
3.6 KiB
C++
144 lines
3.6 KiB
C++
|
|
#include "StdAfx.h"
|
|||
|
|
#include "DnManticoreMonsterActor.h"
|
|||
|
|
#include "DnActorClassDefine.h"
|
|||
|
|
#include "DnGameTask.h"
|
|||
|
|
#include "TaskManager.h"
|
|||
|
|
#include "MAAiBase.h"
|
|||
|
|
|
|||
|
|
|
|||
|
|
CDnManticoreMonsterActor::CDnManticoreMonsterActor( CMultiRoom *pRoom, int nClassID )
|
|||
|
|
: CDnPartsMonsterActor( pRoom, nClassID )
|
|||
|
|
{
|
|||
|
|
m_fShakeDelta = 0.f;
|
|||
|
|
m_nIgnoreNormalSuperArmorTime = 0;
|
|||
|
|
m_HitCheckType = HitCheckTypeEnum::Collision;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
CDnManticoreMonsterActor::~CDnManticoreMonsterActor()
|
|||
|
|
{
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
bool CDnManticoreMonsterActor::Initialize()
|
|||
|
|
{
|
|||
|
|
CDnPartsMonsterActor::Initialize();
|
|||
|
|
|
|||
|
|
if( !m_hObject )
|
|||
|
|
return false;
|
|||
|
|
|
|||
|
|
m_hObject->SetCollisionGroup( COLLISION_GROUP_DYNAMIC( 3 ) );
|
|||
|
|
m_hObject->SetTargetCollisionGroup( 0 );
|
|||
|
|
|
|||
|
|
return true;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
void CDnManticoreMonsterActor::Process( LOCAL_TIME LocalTime, float fDelta )
|
|||
|
|
{
|
|||
|
|
float fValue = 1.f;
|
|||
|
|
if( m_fShakeDelta > 0.f ) {
|
|||
|
|
m_fShakeDelta -= fDelta;
|
|||
|
|
if( m_fShakeDelta <= 0.f ) {
|
|||
|
|
m_fShakeDelta = 0.f;
|
|||
|
|
}
|
|||
|
|
fValue = 1.f - ( ( _rand(m_hActor->GetRoom())%100 ) * 0.0005f );
|
|||
|
|
}
|
|||
|
|
MAActorRenderBase::SetScale( EtVector3( GetScale() * fValue, GetScale(), GetScale() * fValue ) );
|
|||
|
|
|
|||
|
|
/*
|
|||
|
|
if( !IsDie() ) {
|
|||
|
|
std::vector<DnActorHandle> hVecList;
|
|||
|
|
EtVector3 vAniDist = *GetPosition();
|
|||
|
|
vAniDist.x -= GetAniDistance()->x;
|
|||
|
|
vAniDist.z -= GetAniDistance()->z;
|
|||
|
|
|
|||
|
|
int nCount = ScanActor( GetRoom(), vAniDist, (float)GetUnitSize(), hVecList );
|
|||
|
|
if( nCount > 0 ) {
|
|||
|
|
EtVector2 vDir;
|
|||
|
|
int nSumSize;
|
|||
|
|
for( int i=0; i<nCount; i++ ) {
|
|||
|
|
if( hVecList[i] == GetMySmartPtr() ) continue;
|
|||
|
|
if( hVecList[i]->IsDie() ) continue;
|
|||
|
|
vDir = EtVec3toVec2( *hVecList[i]->GetPosition() - *GetPosition() );
|
|||
|
|
nSumSize = GetUnitSize() + hVecList[i]->GetUnitSize();
|
|||
|
|
float fLength = D3DXVec2Length( &vDir );
|
|||
|
|
if( fLength > (float)nSumSize ) continue;
|
|||
|
|
|
|||
|
|
D3DXVec2Normalize( &vDir, &vDir );
|
|||
|
|
MAMovementBase *pMovement = dynamic_cast<MAMovementBase *>(hVecList[i].GetPointer());
|
|||
|
|
if( pMovement ) pMovement->MoveToWorld( vDir * (float)( nSumSize - fLength ) );
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
*/
|
|||
|
|
|
|||
|
|
CDnPartsMonsterActor::Process( LocalTime, fDelta );
|
|||
|
|
|
|||
|
|
// <20><><EFBFBD>۾Ƹ<DBBE> <20><><EFBFBD>õǴ<C3B5> <20><><EFBFBD>°<EFBFBD>
|
|||
|
|
if ( GetIgnoreNormalSuperArmor() )
|
|||
|
|
{
|
|||
|
|
if ( LocalTime - m_nIgnoreNormalSuperArmorTime > 7000 )
|
|||
|
|
{
|
|||
|
|
SetIgnoreNormalSuperArmor(false);
|
|||
|
|
m_nIgnoreNormalSuperArmorTime = 0;
|
|||
|
|
for ( size_t i = 0 ; i < m_Parts.size() ; i++ )
|
|||
|
|
{
|
|||
|
|
m_Parts[i].ResetSetting();
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
void CDnManticoreMonsterActor::OnDamage( CDnDamageBase *pHitter, SHitParam &HitParam, HitStruct *pHitStruct )
|
|||
|
|
{
|
|||
|
|
m_fShakeDelta = 0.3f;
|
|||
|
|
CDnPartsMonsterActor::OnDamage( pHitter, HitParam, pHitStruct );
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
bool CDnManticoreMonsterActor::CheckDamageAction( DnActorHandle hActor )
|
|||
|
|
{
|
|||
|
|
//MAMovementBase *pMovement = dynamic_cast<MAMovementBase *>(this);
|
|||
|
|
// <20><><EFBFBD>缼 <20><><EFBFBD><EFBFBD>
|
|||
|
|
if( IsFly() )
|
|||
|
|
{
|
|||
|
|
m_HitParam.szActionName = "Hit_AirDown";
|
|||
|
|
m_HitParam.vVelocity.y = 0.0f;
|
|||
|
|
m_HitParam.vResistance.y = 0.0f;
|
|||
|
|
|
|||
|
|
OutputDebug( "-----------Hit_AirDown------------\n");
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
return true;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
void CDnManticoreMonsterActor::OnDrop( float fCurVelocity )
|
|||
|
|
{
|
|||
|
|
/*
|
|||
|
|
if( IsAir() && IsHit() ) {
|
|||
|
|
std::string szAction;
|
|||
|
|
float fBlendFrame = 2.f;
|
|||
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ӵ<EFBFBD><D3B5><EFBFBD> 10<31>̻<EFBFBD><CCBB≯<EFBFBD> bigBounce<63><65> <20>ѹ<EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD>ش<EFBFBD>.
|
|||
|
|
if( fCurVelocity < -6.f && m_HitParam.vVelocity.y != 0.f ) {
|
|||
|
|
if( m_HitParam.vVelocity.y > 0.f ) {
|
|||
|
|
m_HitParam.vVelocity.y *= 0.6f;
|
|||
|
|
SetVelocityY( m_HitParam.vVelocity.y );
|
|||
|
|
}
|
|||
|
|
else { // <20><><EFBFBD>ӵ<EFBFBD><D3B5><EFBFBD> ó<><C3B3><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ٴ<EFBFBD><D9B4><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ִ<EFBFBD> <20><><EFBFBD>쿡<EFBFBD><ECBFA1> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ѵ<EFBFBD>.
|
|||
|
|
m_HitParam.vVelocity.y *= -0.6f;
|
|||
|
|
m_HitParam.vResistance.y *= -1.f;
|
|||
|
|
SetVelocityY( m_HitParam.vVelocity.y );
|
|||
|
|
SetResistanceY( m_HitParam.vResistance.y );
|
|||
|
|
}
|
|||
|
|
szAction = "Hit_AirBounce";
|
|||
|
|
}
|
|||
|
|
else {
|
|||
|
|
szAction = "Down_SmallBounce";
|
|||
|
|
fBlendFrame = 0.f;
|
|||
|
|
}
|
|||
|
|
SetActionQueue( szAction.c_str(), 0, fBlendFrame );
|
|||
|
|
}
|
|||
|
|
*/
|
|||
|
|
}
|