This commit is contained in:
Charles 2001-02-08 15:42:59 +00:00
parent b1cf92f44b
commit 4014e0c55e
3 changed files with 15 additions and 2 deletions

View File

@ -145,16 +145,21 @@ void CNpc::processCloseAnemone2Attack( int _frames )
void CNpc::processCloseAnemone3Attack( int _frames ) void CNpc::processCloseAnemone3Attack( int _frames )
{ {
CProjectile *projectile; CProjectile *projectile;
u8 lifetime = 8;
DVECTOR newPos = Pos; DVECTOR newPos = Pos;
newPos.vy -= 100; newPos.vy -= 100;
projectile = new( "test projectile" ) CProjectile; projectile = new( "test projectile" ) CProjectile;
projectile->init( newPos, m_heading, CProjectile::PROJECTILE_GAS_CLOUD, CProjectile::PROJECTILE_FINITE_LIFE ); projectile->init( newPos,
m_heading,
CProjectile::PROJECTILE_GAS_CLOUD,
CProjectile::PROJECTILE_FINITE_LIFE,
lifetime * GameState::getOneSecondInFrames() );
m_controlFunc = NPC_CONTROL_MOVEMENT; m_controlFunc = NPC_CONTROL_MOVEMENT;
m_timerFunc = NPC_TIMER_ATTACK_DONE; m_timerFunc = NPC_TIMER_ATTACK_DONE;
m_timerTimer = 4 * GameState::getOneSecondInFrames(); m_timerTimer = ( lifetime + 4 ) * GameState::getOneSecondInFrames();
m_sensorFunc = NPC_SENSOR_NONE; m_sensorFunc = NPC_SENSOR_NONE;
} }

View File

@ -75,6 +75,13 @@ void CProjectile::init( DVECTOR initPos, s16 initHeading, PROJECTILE_MOVEMENT_TY
m_lifetimeType = initLifeType; m_lifetimeType = initLifeType;
} }
void CProjectile::init( DVECTOR initPos, s16 initHeading, PROJECTILE_MOVEMENT_TYPE initMoveType, PROJECTILE_LIFETIME_TYPE initLifeType, s32 initLifetime )
{
init( initPos, initHeading, initMoveType, initLifeType );
m_lifetime = initLifetime;
}
void CProjectile::shutdown() void CProjectile::shutdown()
{ {
m_spriteBank->dump(); delete m_spriteBank; m_spriteBank->dump(); delete m_spriteBank;

View File

@ -44,6 +44,7 @@ public:
void init(); void init();
void init( DVECTOR initPos, s16 initHeading ); void init( DVECTOR initPos, s16 initHeading );
void init( DVECTOR initPos, s16 initHeading, PROJECTILE_MOVEMENT_TYPE initMoveType, PROJECTILE_LIFETIME_TYPE initLifeType ); void init( DVECTOR initPos, s16 initHeading, PROJECTILE_MOVEMENT_TYPE initMoveType, PROJECTILE_LIFETIME_TYPE initLifeType );
void init( DVECTOR initPos, s16 initHeading, PROJECTILE_MOVEMENT_TYPE initMoveType, PROJECTILE_LIFETIME_TYPE initLifeType, s32 initLifetime );
void shutdown(); void shutdown();
void think(int _frames); void think(int _frames);
virtual void render(); virtual void render();