This commit is contained in:
Charles 2001-05-16 14:11:52 +00:00
parent f83b0938ea
commit 76f68fe28a
3 changed files with 58 additions and 78 deletions

View File

@ -85,3 +85,59 @@ void CNpcSmallJellyfish2BackgroundEnemy::render()
}
}
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CNpcSmallJellyfish2BackgroundEnemy::collidedWith( CThing *_thisThing )
{
if ( m_isActive && !m_isCaught && !m_isDying )
{
switch(_thisThing->getThingType())
{
case TYPE_PLAYER:
{
CPlayer *player = (CPlayer *) _thisThing;
ATTACK_STATE playerState = player->getAttackState();
if(playerState==ATTACK_STATE__NONE)
{
if ( !player->isRecoveringFromHit() )
{
switch( m_data[m_type].detectCollision )
{
case DETECT_NO_COLLISION:
{
// ignore
break;
}
case DETECT_ALL_COLLISION:
{
m_oldControlFunc = m_controlFunc;
m_controlFunc = NPC_CONTROL_COLLISION;
processUserCollision( _thisThing );
break;
}
case DETECT_ATTACK_COLLISION_GENERIC:
{
processAttackCollision();
processUserCollision( _thisThing );
break;
}
}
}
}
break;
}
default:
break;
}
}
}

View File

@ -22,6 +22,8 @@ class CNpcSmallJellyfish2BackgroundEnemy : public CNpcSmallJellyfishBackgroundEn
{
public:
virtual void render();
protected:
virtual void collidedWith(CThing *_thisThing);
};
#endif

View File

@ -282,82 +282,4 @@ u8 CNpcSmallJellyfishBackgroundEnemy::hasBeenAttacked()
void CNpcSmallJellyfishBackgroundEnemy::collidedWith( CThing *_thisThing )
{
// do nothing
/*if ( m_isActive && !m_isCaught && !m_isDying )
{
switch(_thisThing->getThingType())
{
case TYPE_PLAYER:
{
CPlayer *player = (CPlayer *) _thisThing;
ATTACK_STATE playerState = player->getAttackState();
if(playerState==ATTACK_STATE__NONE)
{
if ( !player->isRecoveringFromHit() )
{
switch( m_data[m_type].detectCollision )
{
case DETECT_NO_COLLISION:
{
// ignore
break;
}
case DETECT_ALL_COLLISION:
{
m_oldControlFunc = m_controlFunc;
m_controlFunc = NPC_CONTROL_COLLISION;
processUserCollision( _thisThing );
break;
}
case DETECT_ATTACK_COLLISION_GENERIC:
{
processAttackCollision();
processUserCollision( _thisThing );
break;
}
}
}
}
else
{
// player is attacking, respond appropriately
if ( m_controlFunc != NPC_CONTROL_SHOT )
{
if(playerState==ATTACK_STATE__BUTT_BOUNCE)
{
player->justButtBouncedABadGuy();
}
m_controlFunc = NPC_CONTROL_SHOT;
m_state = NPC_GENERIC_HIT_CHECK_HEALTH;
}
}
break;
}
case TYPE_ENEMY:
{
CNpcEnemy *enemy = (CNpcEnemy *) _thisThing;
if ( canCollideWithEnemy() && enemy->canCollideWithEnemy() )
{
processEnemyCollision( _thisThing );
}
break;
}
default:
ASSERT(0);
break;
}
}*/
}