diff --git a/makefile.gaz b/makefile.gaz index 39edc3621..052ed5ffd 100644 --- a/makefile.gaz +++ b/makefile.gaz @@ -128,7 +128,8 @@ hazard_src := hazard \ fx_src := fx \ projectl_src := projectl \ - prnpc + prnpc \ + prnpcspr fileio_src := fileio \ $($(FILE_SYSTEM)_FILESYS_SRC) diff --git a/source/enemy/npc.h b/source/enemy/npc.h index 33a123711..bd1e8d799 100644 --- a/source/enemy/npc.h +++ b/source/enemy/npc.h @@ -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; diff --git a/source/enemy/nsdart.cpp b/source/enemy/nsdart.cpp index 41742e03d..5c209bd52 100644 --- a/source/enemy/nsdart.cpp +++ b/source/enemy/nsdart.cpp @@ -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 ); +} \ No newline at end of file diff --git a/source/enemy/nsdart.h b/source/enemy/nsdart.h index e933d287d..82e232afd 100644 --- a/source/enemy/nsdart.h +++ b/source/enemy/nsdart.h @@ -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 diff --git a/source/enemy/nsjfish.cpp b/source/enemy/nsjfish.cpp index 9c2156c47..c290315a8 100644 --- a/source/enemy/nsjfish.cpp +++ b/source/enemy/nsjfish.cpp @@ -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 ); +} \ No newline at end of file diff --git a/source/enemy/nsjfish.h b/source/enemy/nsjfish.h index d0b3f04df..8d22f1e93 100644 --- a/source/enemy/nsjfish.h +++ b/source/enemy/nsjfish.h @@ -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 { diff --git a/users/paul/spongebob project/spongebob project.dsp b/users/paul/spongebob project/spongebob project.dsp index 6c6d26410..da47e8e1c 100644 --- a/users/paul/spongebob project/spongebob project.dsp +++ b/users/paul/spongebob project/spongebob project.dsp @@ -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