SBSPSS/source/enemy/npuffa.cpp
Charles 5b8ef72209
2001-04-05 15:33:11 +00:00

103 lines
1.7 KiB
C++

/*=========================================================================
npuffa.cpp
Author: CRB
Created:
Project: Spongebob
Purpose:
Copyright (c) 2001 Climax Development Ltd
===========================================================================*/
#ifndef __ENEMY_NPC_H__
#include "enemy\npc.h"
#endif
#ifndef __GAME_GAME_H__
#include "game\game.h"
#endif
#ifndef __ANIM_PUFFAFISH_HEADER__
#include <ACTOR_PUFFAFISH_ANIM.h>
#endif
void CNpcEnemy::processClosePuffaFishInflate( int _frames )
{
if ( playerXDistSqr + playerYDistSqr > 15000 )
{
if ( !m_animPlaying )
{
switch( m_state )
{
case PUFFA_FISH_NO_INFLATE:
{
m_animNo = ANIM_PUFFAFISH_SWIM;
m_controlFunc = NPC_CONTROL_MOVEMENT;
m_timerFunc = NPC_TIMER_ATTACK_DONE;
m_timerTimer = GameState::getOneSecondInFrames();
m_sensorFunc = NPC_SENSOR_NONE;
break;
}
case PUFFA_FISH_TURN:
{
// reverse turn at some point
m_state = PUFFA_FISH_NO_INFLATE;
m_animNo = ANIM_PUFFAFISH_TURN;
break;
}
case PUFFA_FISH_INFLATE:
{
// reverse puff up
m_state = PUFFA_FISH_TURN;
m_animNo = ANIM_PUFFAFISH_PUFFUP;
break;
}
}
m_frame = 0;
m_animPlaying = true;
}
}
else if ( !m_animPlaying )
{
switch( m_state )
{
case PUFFA_FISH_NO_INFLATE:
{
m_state = PUFFA_FISH_TURN;
m_animNo = ANIM_PUFFAFISH_TURN;
break;
}
case PUFFA_FISH_TURN:
{
m_state = PUFFA_FISH_INFLATE;
m_animNo = ANIM_PUFFAFISH_PUFFUP;
break;
}
case PUFFA_FISH_INFLATE:
{
m_animNo = ANIM_PUFFAFISH_PUFFUPIDLE;
break;
}
}
m_frame = 0;
m_animPlaying = true;
}
}