This commit is contained in:
Charles 2001-05-04 22:34:23 +00:00
parent 0000a0bbe5
commit a25bbc13fb
7 changed files with 89 additions and 2 deletions

View File

@ -128,7 +128,8 @@ hazard_src := hazard \
fx_src := fx \
projectl_src := projectl \
prnpc
prnpc \
prnpcspr
fileio_src := fileio \
$($(FILE_SYSTEM)_FILESYS_SRC)

View File

@ -115,7 +115,7 @@ public:
bool canBeSuckedUp();
bool suckUp( DVECTOR *suckPos, int _frames );
void fireAsProjectile( s16 heading );
virtual void fireAsProjectile( s16 heading );
protected:
class CLayerCollision *m_layerCollision;

View File

@ -27,6 +27,13 @@
#include "system\vid.h"
#endif
#ifndef __PROJECTL_PRNPCSPR_H__
#include "projectl\prnpcspr.h"
#endif
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CNpcSquidDartEnemy::render()
{
SprFrame = NULL;
@ -81,3 +88,26 @@ void CNpcSquidDartEnemy::render()
}
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CNpcSquidDartEnemy::fireAsProjectile( s16 heading )
{
m_isActive = false;
setToShutdown();
DVECTOR newPos = Pos;
newPos.vy -= 10;
CEnemyAsSpriteProjectile *projectile;
projectile = new( "blower projectile" ) CEnemyAsSpriteProjectile;
projectile->init( newPos,
heading,
CPlayerProjectile::PLAYER_PROJECTILE_DUMBFIRE,
CPlayerProjectile::PLAYER_PROJECTILE_FINITE_LIFE,
5*60);
projectile->setLayerCollision( m_layerCollision );
projectile->setGraphic( FRM_SQUIDDART_SWIM0001 );
projectile->setHasRGB( true );
projectile->setRGB( 255, 128, 255 );
}

View File

@ -24,6 +24,7 @@ public:
void render();
virtual int getFrameCount() {return( FRM_SQUIDDART_SWIM0004 - FRM_SQUIDDART_SWIM0001 + 1 );}
virtual u8 canCollideWithEnemy() {return( false );}
virtual void fireAsProjectile( s16 heading );
};
#endif

View File

@ -35,6 +35,13 @@
#include "system\vid.h"
#endif
#ifndef __PROJECTL_PRNPCSPR_H__
#include "projectl\prnpcspr.h"
#endif
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CNpcSmallJellyfishEnemy::render()
{
SprFrame = NULL;
@ -102,6 +109,8 @@ void CNpcSmallJellyfishEnemy::render()
}
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CNpcSmallJellyfishEnemy::processClose( int _frames )
{
s32 moveX = 0, moveY = 0;
@ -235,6 +244,8 @@ void CNpcSmallJellyfishEnemy::processClose( int _frames )
}
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
bool CNpcSmallJellyfishEnemy::processSensor()
{
switch( m_sensorFunc )
@ -259,6 +270,8 @@ bool CNpcSmallJellyfishEnemy::processSensor()
}
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CNpcSmallJellyfishEnemy::processMovementModifier( int _frames, s32 distX, s32 distY, s32 dist, s16 headingChange )
{
s32 newX, newY;
@ -346,3 +359,36 @@ void CNpcSmallJellyfishEnemy::processMovementModifier( int _frames, s32 distX, s
m_drawRotation = m_heading;
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CNpcSmallJellyfishEnemy::fireAsProjectile( s16 heading )
{
m_isActive = false;
if ( m_data[m_type].respawning )
{
m_timerFunc = NPC_TIMER_RESPAWN;
m_timerTimer = 4 * GameState::getOneSecondInFrames();
}
else
{
setToShutdown();
}
DVECTOR newPos = Pos;
newPos.vy -= 10;
CEnemyAsSpriteProjectile *projectile;
projectile = new( "blower projectile" ) CEnemyAsSpriteProjectile;
projectile->init( newPos,
heading,
CPlayerProjectile::PLAYER_PROJECTILE_DUMBFIRE,
CPlayerProjectile::PLAYER_PROJECTILE_FINITE_LIFE,
5*60);
projectile->setLayerCollision( m_layerCollision );
projectile->setGraphic( FRM_JELLYFISH1_SWIM1 );
projectile->setHasRGB( true );
projectile->setRGB( 255, 128, 255 );
}

View File

@ -32,6 +32,7 @@ protected:
virtual bool processSensor();
virtual void processClose( int _frames );
virtual void processMovementModifier( int _frames, s32 distX, s32 distY, s32 dist, s16 headingChange );
virtual void fireAsProjectile( s16 heading );
enum
{

View File

@ -1473,6 +1473,14 @@ SOURCE=..\..\..\source\projectl\prnpc.h
# End Source File
# Begin Source File
SOURCE=..\..\..\source\projectl\prnpcspr.cpp
# End Source File
# Begin Source File
SOURCE=..\..\..\source\projectl\prnpcspr.h
# End Source File
# Begin Source File
SOURCE=..\..\..\source\projectl\projectl.cpp
# End Source File
# Begin Source File