This commit is contained in:
Charles 2001-05-09 16:04:17 +00:00
parent 548031076b
commit 3de584bf8b
7 changed files with 116 additions and 3 deletions

View File

@ -80,7 +80,8 @@ enemy_src := npc \
nsdart \ nsdart \
ndustdev \ ndustdev \
npbug \ npbug \
nprojjf nprojjf \
nmjback
friend_src := friend \ friend_src := friend \
fdata \ fdata \

View File

@ -185,6 +185,10 @@
#include "enemy\nshell.h" #include "enemy\nshell.h"
#endif #endif
#ifndef __ENEMY_NMJBACK_H__
#include "enemy\nmjback.h"
#endif
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Enemy NPCs // Enemy NPCs
@ -357,7 +361,17 @@ CNpcEnemy *CNpcEnemy::Create(sThingActor *ThisActor)
case CNpcEnemy::NPC_MOTHER_JELLYFISH: case CNpcEnemy::NPC_MOTHER_JELLYFISH:
{ {
printf("NPC_MOTHER_JELLYFISH\n"); printf("NPC_MOTHER_JELLYFISH\n");
if ( CLevel::getCurrentChapterLevel() == 4 )
{
enemy = new ("mother jellyfish background") CNpcMotherJellyfishBackground;
enemyType = NPC_MOTHER_JELLYFISH_BACKGROUND;
}
else
{
enemy = new ("mother jellyfish") CNpcMotherJellyfishEnemy; enemy = new ("mother jellyfish") CNpcMotherJellyfishEnemy;
}
break; break;
} }

View File

@ -81,6 +81,7 @@ public:
NPC_BALL_BLOB, NPC_BALL_BLOB,
NPC_SHELL, NPC_SHELL,
NPC_PROJECTILE_JELLYFISH, NPC_PROJECTILE_JELLYFISH,
NPC_MOTHER_JELLYFISH_BACKGROUND,
NPC_UNIT_TYPE_MAX, NPC_UNIT_TYPE_MAX,
}; };

View File

@ -971,6 +971,28 @@ CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] =
true, true,
false, false,
}, },
{ // NPC_SMALL_JELLYFISH_1
ACTORS_MOTHERJELLYFISH_SBK,
ANIM_CLAM_SIDESNAP,
NPC_SENSOR_NONE,
NPC_MOVEMENT_FIXED_PATH,
NPC_CLOSE_NONE,
NPC_TIMER_NONE,
false,
2,
128,
DETECT_NO_COLLISION,
DAMAGE__SHOCK_ENEMY,
256,
0,
NPC_SHOT_GENERIC,
0,
0,
false,
false,
false,
},
}; };
CNpcEnemy::NPC_UNIT_TYPE CNpcEnemy::mapEditConvertTable[NPC_UNIT_TYPE_MAX] = CNpcEnemy::NPC_UNIT_TYPE CNpcEnemy::mapEditConvertTable[NPC_UNIT_TYPE_MAX] =
@ -1015,4 +1037,5 @@ CNpcEnemy::NPC_UNIT_TYPE CNpcEnemy::mapEditConvertTable[NPC_UNIT_TYPE_MAX] =
NPC_GHOST_PIRATE, NPC_GHOST_PIRATE,
NPC_OIL_BLOB, NPC_OIL_BLOB,
NPC_PARASITIC_WORM_SEGMENT, NPC_PARASITIC_WORM_SEGMENT,
NPC_MOTHER_JELLYFISH_BACKGROUND,
}; };

View File

@ -19,6 +19,14 @@
#include "level\layercollision.h" #include "level\layercollision.h"
#endif #endif
#ifndef __GAME_GAME_H__
#include "game\game.h"
#endif
#ifndef __VID_HEADER_
#include "system\vid.h"
#endif
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CNpcBoatHazard::init() void CNpcBoatHazard::init()
@ -72,6 +80,15 @@ void CNpcBoatHazard::processMovement( int _frames )
distX = distX / abs( distX ); distX = distX / abs( distX );
if ( distX > 0 )
{
m_reversed = false;
}
else
{
m_reversed = true;
}
if ( m_layerCollision->getHeightFromGround( Pos.vx + ( distX * 3 * _frames ), Pos.vy ) < -maxHeight ) if ( m_layerCollision->getHeightFromGround( Pos.vx + ( distX * 3 * _frames ), Pos.vy ) < -maxHeight )
{ {
// there is an obstacle in the way, increment the path point (hopefully this will resolve the problem) // there is an obstacle in the way, increment the path point (hopefully this will resolve the problem)
@ -103,3 +120,49 @@ void CNpcBoatHazard::processMovement( int _frames )
Pos.vx += moveX; Pos.vx += moveX;
Pos.vy += moveY; Pos.vy += moveY;
} }
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CNpcBoatHazard::render()
{
if ( m_isActive )
{
CHazardThing::render();
// Render
DVECTOR renderPos;
DVECTOR offset = CLevel::getCameraPos();
renderPos.vx = Pos.vx - offset.vx;
renderPos.vy = Pos.vy - offset.vy;
CRECT collisionRect = getCollisionArea();
collisionRect.x1 -= Pos.vx;
collisionRect.x2 -= Pos.vx;
collisionRect.y1 -= Pos.vy;
collisionRect.y2 -= Pos.vy;
if ( renderPos.vx + collisionRect.x2 >= 0 && renderPos.vx + collisionRect.x1 <= VidGetScrW() )
{
if ( renderPos.vy + collisionRect.y2 >= 0 && renderPos.vy + collisionRect.y1 <= VidGetScrH() )
{
VECTOR flip;
if ( m_reversed )
{
flip.vx = ONE;
}
else
{
flip.vx = -ONE;
}
flip.vy = ONE;
flip.vz = ONE;
m_modelGfx->Render( renderPos, NULL, NULL, &flip );
//m_actorGfx->Render(renderPos,0,0,0);
}
}
}
}

View File

@ -22,8 +22,11 @@ class CNpcBoatHazard : public CNpcHazard
{ {
public: public:
void init(); void init();
virtual void render();
protected: protected:
void processMovement( int _frames ); void processMovement( int _frames );
u8 m_reversed;
}; };
#endif #endif

View File

@ -229,6 +229,14 @@ SOURCE=..\..\..\source\enemy\nmine.h
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\..\..\source\enemy\nmjback.cpp
# End Source File
# Begin Source File
SOURCE=..\..\..\source\enemy\nmjback.h
# End Source File
# Begin Source File
SOURCE=..\..\..\source\enemy\nmjfish.cpp SOURCE=..\..\..\source\enemy\nmjfish.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File