diff --git a/source/enemy/npc.h b/source/enemy/npc.h index a088c4474..f0e9d472b 100644 --- a/source/enemy/npc.h +++ b/source/enemy/npc.h @@ -108,6 +108,7 @@ public: virtual u8 canBeCaughtByNet(); void caughtWithNet(); virtual int getFrameCount(); + virtual int getFrame() {return( m_frame );} void setSpeed( s16 newSpeed ) {m_speed = newSpeed;} static CNpcEnemy *Create(sThingActor *ThisActor); diff --git a/source/enemy/nshell.cpp b/source/enemy/nshell.cpp index bd5b9b4ab..6058ef385 100644 --- a/source/enemy/nshell.cpp +++ b/source/enemy/nshell.cpp @@ -19,6 +19,19 @@ #include #endif +#ifndef __UTILS_HEADER__ +#include "utils\utils.h" +#endif + + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +void CNpcShellEnemy::postInit() +{ + CNpcEnemy::postInit(); + + m_shellType = FRM_SHELL_STATIC0000 + ( getRnd() % ( FRM_SHELL_STATIC0002 - FRM_SHELL_STATIC0000 + 1 ) ); +} //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -34,7 +47,7 @@ void CNpcShellEnemy::render() { DVECTOR &renderPos=getRenderPos(); - SprFrame = m_spriteBank->printRotatedScaledSprite( FRM_SHELL_STATIC0000,renderPos.vx,renderPos.vy,4096,4096,m_drawRotation,10); + SprFrame = m_spriteBank->printRotatedScaledSprite( m_shellType,renderPos.vx,renderPos.vy,4096,4096,m_drawRotation,10); // get xmax, xmin, ymax, ymin diff --git a/source/enemy/nshell.h b/source/enemy/nshell.h index e5ac97005..bb7d7d133 100644 --- a/source/enemy/nshell.h +++ b/source/enemy/nshell.h @@ -21,8 +21,13 @@ class CNpcShellEnemy : public CNpcEnemy { public: + virtual void postInit(); virtual void render(); virtual int getFrameCount() {return( 1 );} + virtual int getFrame() {return( m_shellType );} +protected: + + u8 m_shellType; }; #endif diff --git a/source/player/pmcoral.cpp b/source/player/pmcoral.cpp index 6656c3109..957b5758b 100644 --- a/source/player/pmcoral.cpp +++ b/source/player/pmcoral.cpp @@ -240,6 +240,7 @@ void CPlayerModeCoralBlower::think() // Got an enemy.. suck him up if(m_enemy->suckUp(getSuckUpPoint(),1)) { + m_enemyFrame = m_enemy->getFrame(); m_blowerState=BLOWER_STATE__FULL; } } @@ -276,7 +277,7 @@ void CPlayerModeCoralBlower::think() //CActorGfx *projectileGfx; //projectileGfx=CActorPool::GetActor((FileEquate)ACTORS_SHELL_SBK); //projectile->setGraphic( projectileGfx ); - projectile->setGraphic( FRM_SHELL_STATIC0000 ); + projectile->setGraphic( m_enemyFrame ); projectile->setHasRGB( false ); } break; diff --git a/source/player/pmcoral.h b/source/player/pmcoral.h index caf9f95fe..6c6682b4d 100644 --- a/source/player/pmcoral.h +++ b/source/player/pmcoral.h @@ -58,7 +58,8 @@ private: DVECTOR *getSuckUpPoint(); BlowerState m_blowerState; - class CNpcEnemy *m_enemy; + class CNpcEnemy *m_enemy; + u8 m_enemyFrame; };