This commit is contained in:
parent
c0cf19869f
commit
de42770b92
3 changed files with 28 additions and 1 deletions
|
@ -88,7 +88,7 @@ void CNpcSubSharkEnemy::processMovement( int _frames )
|
||||||
|
|
||||||
CProjectile *projectile;
|
CProjectile *projectile;
|
||||||
projectile = CProjectile::Create();
|
projectile = CProjectile::Create();
|
||||||
projectile->init( Pos, 1024 );
|
projectile->init( Pos, 1024, CProjectile::PROJECTILE_MINE, CProjectile::PROJECTILE_FINITE_LIFE );
|
||||||
|
|
||||||
m_salvoCount--;
|
m_salvoCount--;
|
||||||
|
|
||||||
|
|
|
@ -46,7 +46,9 @@
|
||||||
#ifndef __ENEMY_NPC_H__
|
#ifndef __ENEMY_NPC_H__
|
||||||
#include "enemy\npc.h"
|
#include "enemy\npc.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "gfx\otpos.h"
|
#include "gfx\otpos.h"
|
||||||
|
#include "fx\fx.h"
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -347,6 +349,20 @@ void CProjectile::think(int _frames)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case PROJECTILE_MINE:
|
||||||
|
{
|
||||||
|
s32 moveY = _frames * m_speed;
|
||||||
|
|
||||||
|
s32 groundHeight = CGameScene::getCollision()->getHeightFromGround( Pos.vx, Pos.vy + moveY, 16 );
|
||||||
|
|
||||||
|
if ( groundHeight < 0 )
|
||||||
|
{
|
||||||
|
moveY = groundHeight;
|
||||||
|
}
|
||||||
|
|
||||||
|
Pos.vy += moveY;
|
||||||
|
}
|
||||||
|
|
||||||
case PROJECTILE_DUMBFIRE:
|
case PROJECTILE_DUMBFIRE:
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
|
@ -371,6 +387,11 @@ void CProjectile::think(int _frames)
|
||||||
if ( m_lifetime <= 0 )
|
if ( m_lifetime <= 0 )
|
||||||
{
|
{
|
||||||
setToShutdown();
|
setToShutdown();
|
||||||
|
|
||||||
|
if ( m_movementType == PROJECTILE_MINE )
|
||||||
|
{
|
||||||
|
CFX::Create( CFX::FX_TYPE_EXPLODE, Pos );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -434,6 +455,11 @@ void CProjectile::collidedWith(CThing *_thisThing)
|
||||||
if ( m_lifetimeType != PROJECTILE_INFINITE_LIFE )
|
if ( m_lifetimeType != PROJECTILE_INFINITE_LIFE )
|
||||||
{
|
{
|
||||||
setToShutdown();
|
setToShutdown();
|
||||||
|
|
||||||
|
if ( m_movementType == PROJECTILE_MINE )
|
||||||
|
{
|
||||||
|
CFX::Create( CFX::FX_TYPE_EXPLODE, Pos );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -29,6 +29,7 @@ public:
|
||||||
PROJECTILE_DUMBFIRE = 1,
|
PROJECTILE_DUMBFIRE = 1,
|
||||||
PROJECTILE_USER_SEEK,
|
PROJECTILE_USER_SEEK,
|
||||||
PROJECTILE_GAS_CLOUD,
|
PROJECTILE_GAS_CLOUD,
|
||||||
|
PROJECTILE_MINE,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum PROJECTILE_LIFETIME_TYPE
|
enum PROJECTILE_LIFETIME_TYPE
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue