This commit is contained in:
parent
5c2faa793b
commit
02eafd0a46
15 changed files with 160 additions and 273 deletions
|
@ -0,0 +1,3 @@
|
||||||
|
idlebreathe
|
||||||
|
idleShakeHead
|
||||||
|
idleTap
|
|
@ -143,6 +143,8 @@ LEVELS/FMA_SHADYEXTERIOR.Tex
|
||||||
|
|
||||||
actors/SPONGEBOB.SBK
|
actors/SPONGEBOB.SBK
|
||||||
|
|
||||||
|
actors/SQUIDWARD.SBK
|
||||||
|
|
||||||
actors/ANENOME.SBK
|
actors/ANENOME.SBK
|
||||||
actors/BABYOCTOPUS.SBK
|
actors/BABYOCTOPUS.SBK
|
||||||
actors/BALLBLOB.SBK
|
actors/BALLBLOB.SBK
|
||||||
|
|
|
@ -72,7 +72,6 @@ enemy_src := npc \
|
||||||
nocto \
|
nocto \
|
||||||
nfskull \
|
nfskull \
|
||||||
nsklfish \
|
nsklfish \
|
||||||
ngary \
|
|
||||||
nworm \
|
nworm \
|
||||||
nhcrab \
|
nhcrab \
|
||||||
nbblob \
|
nbblob \
|
||||||
|
@ -82,6 +81,10 @@ enemy_src := npc \
|
||||||
ndustdev \
|
ndustdev \
|
||||||
npbug
|
npbug
|
||||||
|
|
||||||
|
friend_src := friend \
|
||||||
|
fdata \
|
||||||
|
fgary
|
||||||
|
|
||||||
platform_src := platform \
|
platform_src := platform \
|
||||||
platdata \
|
platdata \
|
||||||
plinear \
|
plinear \
|
||||||
|
|
|
@ -107,7 +107,7 @@ ACTOR_MAKEFILE_DIR := $(TEMP_BUILD_DIR)/actor
|
||||||
ACTOR_DIRS_TO_MAKE := $(ACTOR_MAKEFILE_DIR) $(ACTOR_OUT_DIR)
|
ACTOR_DIRS_TO_MAKE := $(ACTOR_MAKEFILE_DIR) $(ACTOR_OUT_DIR)
|
||||||
|
|
||||||
ACTOR_SPONGEBOB := SPONGEBOB
|
ACTOR_SPONGEBOB := SPONGEBOB
|
||||||
ACTOR_NPC :=
|
ACTOR_NPC := Squidward
|
||||||
# BarnacleBoy Gary Krusty MermaidMan Patrick Plankton Sandy Squidward
|
# BarnacleBoy Gary Krusty MermaidMan Patrick Plankton Sandy Squidward
|
||||||
|
|
||||||
ACTOR_ENEMY := Anenome BabyOctopus Ballblob Caterpillar clam Dustdevil Eyeball \
|
ACTOR_ENEMY := Anenome BabyOctopus Ballblob Caterpillar clam Dustdevil Eyeball \
|
||||||
|
|
|
@ -41,7 +41,6 @@
|
||||||
#include "game\convo.h"
|
#include "game\convo.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#include "Gfx\actor.h"
|
#include "Gfx\actor.h"
|
||||||
|
|
||||||
#ifndef __VID_HEADER_
|
#ifndef __VID_HEADER_
|
||||||
|
@ -179,131 +178,6 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// Friend NPCs
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
void CNpcFriend::init()
|
|
||||||
{
|
|
||||||
CNpcThing::init();
|
|
||||||
|
|
||||||
Pos.vx = 100;
|
|
||||||
Pos.vy = 100;
|
|
||||||
|
|
||||||
m_extension = EXTEND_RIGHT;
|
|
||||||
|
|
||||||
// temporary
|
|
||||||
m_actorGfx=CActorPool::GetActor(ACTORS_CLAM_SBK);
|
|
||||||
|
|
||||||
//m_animPlaying = true;
|
|
||||||
m_animNo = 0;
|
|
||||||
m_frame = 0;
|
|
||||||
m_reversed = false;
|
|
||||||
|
|
||||||
DVECTOR ofs = getCollisionSize();
|
|
||||||
|
|
||||||
m_drawOffset.vx = 0;
|
|
||||||
m_drawOffset.vy = -( ofs.vy >> 1 );
|
|
||||||
|
|
||||||
setCollisionCentreOffset( 0, -( ofs.vy >> 1 ) );
|
|
||||||
|
|
||||||
//m_spriteBank=new ("enemy sprites") SpriteBank();
|
|
||||||
//m_spriteBank->load(UI_UIGFX_SPR);
|
|
||||||
}
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
void CNpcFriend::shutdown()
|
|
||||||
{
|
|
||||||
//m_spriteBank->dump(); delete m_spriteBank;
|
|
||||||
|
|
||||||
delete m_actorGfx;
|
|
||||||
CNpcThing::shutdown();
|
|
||||||
}
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
void CNpcFriend::think(int _frames)
|
|
||||||
{
|
|
||||||
CNpcThing::think(_frames);
|
|
||||||
|
|
||||||
switch( m_data[m_type].movementFunc )
|
|
||||||
{
|
|
||||||
case NPC_FRIEND_MOVEMENT_GARY:
|
|
||||||
processGaryMovement( _frames );
|
|
||||||
|
|
||||||
break;
|
|
||||||
|
|
||||||
case NPC_FRIEND_MOVEMENT_STATIC:
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
void CNpcFriend::render()
|
|
||||||
{
|
|
||||||
CNpcThing::render();
|
|
||||||
|
|
||||||
// Render
|
|
||||||
DVECTOR renderPos;
|
|
||||||
DVECTOR offset = CLevel::getCameraPos();
|
|
||||||
|
|
||||||
renderPos.vx = Pos.vx - offset.vx;
|
|
||||||
renderPos.vy = Pos.vy - offset.vy;
|
|
||||||
|
|
||||||
if ( renderPos.vx >= 0 && renderPos.vx <= VidGetScrW() )
|
|
||||||
{
|
|
||||||
if ( renderPos.vy >= 0 && renderPos.vy <= VidGetScrH() )
|
|
||||||
{
|
|
||||||
m_actorGfx->Render(renderPos,m_animNo,m_frame,m_reversed);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
void CNpcFriend::processEvent( GAME_EVENT evt, CThing *sourceThing )
|
|
||||||
{
|
|
||||||
switch( evt )
|
|
||||||
{
|
|
||||||
case USER_REQUEST_TALK_EVENT:
|
|
||||||
{
|
|
||||||
if ( m_data[this->m_type].canTalk )
|
|
||||||
{
|
|
||||||
DVECTOR sourcePos;
|
|
||||||
s32 xDiffSqr, yDiffSqr;
|
|
||||||
|
|
||||||
// check talk distance
|
|
||||||
|
|
||||||
sourcePos = sourceThing->getPos();
|
|
||||||
|
|
||||||
xDiffSqr = this->Pos.vx - sourcePos.vx;
|
|
||||||
xDiffSqr *= xDiffSqr;
|
|
||||||
|
|
||||||
yDiffSqr = this->Pos.vy - sourcePos.vy;
|
|
||||||
yDiffSqr *= yDiffSqr;
|
|
||||||
|
|
||||||
if ( xDiffSqr + yDiffSqr < 10000 )
|
|
||||||
{
|
|
||||||
if( !CConversation::isActive() )
|
|
||||||
{
|
|
||||||
CConversation::trigger( SCRIPTS_SPEECHTEST_DAT );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
default:
|
|
||||||
// ignore
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
// Enemy NPCs
|
// Enemy NPCs
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -313,7 +187,6 @@ s32 CNpcEnemy::playerYDist;
|
||||||
s32 CNpcEnemy::playerXDistSqr;
|
s32 CNpcEnemy::playerXDistSqr;
|
||||||
s32 CNpcEnemy::playerYDistSqr;
|
s32 CNpcEnemy::playerYDistSqr;
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
CNpcEnemy::NPC_UNIT_TYPE CNpcEnemy::getTypeFromMapEdit( u16 newType )
|
CNpcEnemy::NPC_UNIT_TYPE CNpcEnemy::getTypeFromMapEdit( u16 newType )
|
||||||
|
@ -322,6 +195,7 @@ CNpcEnemy::NPC_UNIT_TYPE CNpcEnemy::getTypeFromMapEdit( u16 newType )
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
CNpcEnemy *CNpcEnemy::Create(sThingActor *ThisActor)
|
CNpcEnemy *CNpcEnemy::Create(sThingActor *ThisActor)
|
||||||
{
|
{
|
||||||
CNpcEnemy *enemy;
|
CNpcEnemy *enemy;
|
||||||
|
|
|
@ -37,77 +37,6 @@
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
class CNpcFriend : public CNpcThing
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
enum NPC_FRIEND_UNIT_TYPE
|
|
||||||
{
|
|
||||||
NPC_FRIEND_SANDY_CHEEKS = 0,
|
|
||||||
NPC_FRIEND_GARY = 1,
|
|
||||||
NPC_FRIEND_UNIT_TYPE_MAX,
|
|
||||||
};
|
|
||||||
|
|
||||||
void init();
|
|
||||||
void shutdown();
|
|
||||||
void think(int _frames);
|
|
||||||
void render();
|
|
||||||
void processEvent( GAME_EVENT evt, CThing *sourceThing );
|
|
||||||
void setLayerCollision( class CLayerCollision *_layer ) {m_layerCollision=_layer;}
|
|
||||||
void setType( NPC_FRIEND_UNIT_TYPE newType ) {m_type = newType;}
|
|
||||||
|
|
||||||
private:
|
|
||||||
class CLayerCollision *m_layerCollision;
|
|
||||||
|
|
||||||
protected:
|
|
||||||
enum NPC_FRIEND_MOVEMENT_FUNC
|
|
||||||
{
|
|
||||||
NPC_FRIEND_MOVEMENT_STATIC = 0,
|
|
||||||
NPC_FRIEND_MOVEMENT_GARY = 1,
|
|
||||||
};
|
|
||||||
|
|
||||||
typedef struct NPC_FRIEND_DATA_TYPE
|
|
||||||
{
|
|
||||||
//NPC_FRIEND_INIT_FUNC initFunc;
|
|
||||||
//NPC_FRIEND_SENSOR_FUNC sensorFunc;
|
|
||||||
NPC_FRIEND_MOVEMENT_FUNC movementFunc;
|
|
||||||
//NPC_FRIEND_CLOSE_FUNC closeFunc;
|
|
||||||
//NPC_FRIEND_TIMER_FUNC timerFunc;
|
|
||||||
bool canTalk;
|
|
||||||
u8 speed;
|
|
||||||
u16 turnSpeed;
|
|
||||||
bool detectCollision;
|
|
||||||
DAMAGE_TYPE damageToUserType;
|
|
||||||
}
|
|
||||||
NPC_FRIEND_DATA;
|
|
||||||
|
|
||||||
// gary functions
|
|
||||||
|
|
||||||
void processGaryMovement( int _frames );
|
|
||||||
|
|
||||||
// data
|
|
||||||
|
|
||||||
static NPC_FRIEND_DATA m_data[NPC_FRIEND_UNIT_TYPE_MAX];
|
|
||||||
|
|
||||||
// class SpriteBank *m_spriteBank;
|
|
||||||
|
|
||||||
enum
|
|
||||||
{
|
|
||||||
EXTEND_RIGHT = true,
|
|
||||||
EXTEND_LEFT = false,
|
|
||||||
};
|
|
||||||
|
|
||||||
// internal variables
|
|
||||||
|
|
||||||
NPC_FRIEND_UNIT_TYPE m_type;
|
|
||||||
s32 m_extension;
|
|
||||||
|
|
||||||
int m_frame;
|
|
||||||
int m_animNo;
|
|
||||||
CActorGfx *m_actorGfx;
|
|
||||||
DVECTOR m_drawOffset;
|
|
||||||
bool m_reversed;
|
|
||||||
};
|
|
||||||
|
|
||||||
class CNpcEnemy : public CEnemyThing
|
class CNpcEnemy : public CEnemyThing
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -108,37 +108,6 @@
|
||||||
//#endif
|
//#endif
|
||||||
|
|
||||||
|
|
||||||
CNpcFriend::NPC_FRIEND_DATA CNpcFriend::m_data[NPC_FRIEND_UNIT_TYPE_MAX] =
|
|
||||||
{
|
|
||||||
{ // NPC_SANDY_CHEEKS
|
|
||||||
//NPC_FRIEND_INIT_DEFAULT,
|
|
||||||
//NPC_FRIEND_SENSOR_NONE,
|
|
||||||
NPC_FRIEND_MOVEMENT_STATIC,
|
|
||||||
//NPC_FRIEND_MOVEMENT_MODIFIER_NONE,
|
|
||||||
//NPC_FRIEND_CLOSE_NONE,
|
|
||||||
//NPC_FRIEND_TIMER_NONE,
|
|
||||||
true,
|
|
||||||
3,
|
|
||||||
128,
|
|
||||||
false,
|
|
||||||
DAMAGE__HIT_ENEMY,
|
|
||||||
},
|
|
||||||
|
|
||||||
{ // NPC_GARY
|
|
||||||
//NPC_FRIEND_INIT_DEFAULT,
|
|
||||||
//NPC_FRIEND_SENSOR_NONE,
|
|
||||||
NPC_FRIEND_MOVEMENT_GARY,
|
|
||||||
//NPC_FRIEND_MOVEMENT_MODIFIER_NONE,
|
|
||||||
//NPC_FRIEND_CLOSE_NONE,
|
|
||||||
//NPC_FRIEND_TIMER_NONE,
|
|
||||||
false,
|
|
||||||
3,
|
|
||||||
2048,
|
|
||||||
false,
|
|
||||||
DAMAGE__HIT_ENEMY,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] =
|
CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] =
|
||||||
{
|
{
|
||||||
/*{ // NPC_FALLING_ITEM
|
/*{ // NPC_FALLING_ITEM
|
||||||
|
|
|
@ -15,76 +15,80 @@
|
||||||
#include "friend\friend.h"
|
#include "friend\friend.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef __ANIM_SQUIDWARD_HEADER__
|
||||||
|
#include <ACTOR_SQUIDWARD_Anim.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
CNpcFriend::NPC_FRIEND_DATA CNpcFriend::m_data[NPC_FRIEND_UNIT_TYPE_MAX] =
|
CNpcFriend::NPC_FRIEND_DATA CNpcFriend::m_data[NPC_FRIEND_UNIT_TYPE_MAX] =
|
||||||
{
|
{
|
||||||
{ // NPC_FRIEND_BARNACLE_BOY
|
{ // NPC_FRIEND_BARNACLE_BOY
|
||||||
ACTORS_CLAM_SBK,
|
ACTORS_CLAM_SBK,
|
||||||
NPC_FRIEND_MOVEMENT_STATIC,
|
|
||||||
true,
|
true,
|
||||||
3,
|
3,
|
||||||
128,
|
128,
|
||||||
false,
|
false,
|
||||||
DAMAGE__HIT_ENEMY,
|
DAMAGE__HIT_ENEMY,
|
||||||
|
0,
|
||||||
},
|
},
|
||||||
|
|
||||||
{ // NPC_FRIEND_GARY
|
{ // NPC_FRIEND_GARY
|
||||||
ACTORS_CLAM_SBK,
|
ACTORS_CLAM_SBK,
|
||||||
NPC_FRIEND_MOVEMENT_STATIC,
|
|
||||||
true,
|
true,
|
||||||
3,
|
3,
|
||||||
128,
|
128,
|
||||||
false,
|
false,
|
||||||
DAMAGE__HIT_ENEMY,
|
DAMAGE__HIT_ENEMY,
|
||||||
|
0,
|
||||||
},
|
},
|
||||||
|
|
||||||
{ // NPC_FRIEND_KRUSTY
|
{ // NPC_FRIEND_KRUSTY
|
||||||
ACTORS_CLAM_SBK,
|
ACTORS_CLAM_SBK,
|
||||||
NPC_FRIEND_MOVEMENT_STATIC,
|
|
||||||
true,
|
true,
|
||||||
3,
|
3,
|
||||||
128,
|
128,
|
||||||
false,
|
false,
|
||||||
DAMAGE__HIT_ENEMY,
|
DAMAGE__HIT_ENEMY,
|
||||||
|
0,
|
||||||
},
|
},
|
||||||
|
|
||||||
{ // NPC_FRIEND_MERMAID_MAN
|
{ // NPC_FRIEND_MERMAID_MAN
|
||||||
ACTORS_CLAM_SBK,
|
ACTORS_CLAM_SBK,
|
||||||
NPC_FRIEND_MOVEMENT_STATIC,
|
|
||||||
true,
|
true,
|
||||||
3,
|
3,
|
||||||
128,
|
128,
|
||||||
false,
|
false,
|
||||||
DAMAGE__HIT_ENEMY,
|
DAMAGE__HIT_ENEMY,
|
||||||
|
0,
|
||||||
},
|
},
|
||||||
|
|
||||||
{ // NPC_FRIEND_PATRICK
|
{ // NPC_FRIEND_PATRICK
|
||||||
ACTORS_CLAM_SBK,
|
ACTORS_CLAM_SBK,
|
||||||
NPC_FRIEND_MOVEMENT_STATIC,
|
|
||||||
true,
|
true,
|
||||||
3,
|
3,
|
||||||
128,
|
128,
|
||||||
false,
|
false,
|
||||||
DAMAGE__HIT_ENEMY,
|
DAMAGE__HIT_ENEMY,
|
||||||
|
0,
|
||||||
},
|
},
|
||||||
|
|
||||||
{ // NPC_FRIEND_SANDY_CHEEKS
|
{ // NPC_FRIEND_SANDY_CHEEKS
|
||||||
ACTORS_CLAM_SBK,
|
ACTORS_CLAM_SBK,
|
||||||
NPC_FRIEND_MOVEMENT_STATIC,
|
|
||||||
true,
|
true,
|
||||||
3,
|
3,
|
||||||
128,
|
128,
|
||||||
false,
|
false,
|
||||||
DAMAGE__HIT_ENEMY,
|
DAMAGE__HIT_ENEMY,
|
||||||
|
0,
|
||||||
},
|
},
|
||||||
|
|
||||||
{ // NPC_FRIEND_SQUIDWARD
|
{ // NPC_FRIEND_SQUIDWARD
|
||||||
ACTORS_SQUIDWARD_SBK,
|
ACTORS_SQUIDWARD_SBK,
|
||||||
NPC_FRIEND_MOVEMENT_STATIC,
|
|
||||||
true,
|
true,
|
||||||
3,
|
3,
|
||||||
128,
|
128,
|
||||||
false,
|
false,
|
||||||
DAMAGE__HIT_ENEMY,
|
DAMAGE__HIT_ENEMY,
|
||||||
|
ANIM_SQUIDWARD_IDLEBREATHE,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -11,8 +11,8 @@
|
||||||
|
|
||||||
===========================================================================*/
|
===========================================================================*/
|
||||||
|
|
||||||
#ifndef __FRIEND_FRIEND_H__
|
#ifndef __FRIEND_FGARY_H__
|
||||||
#include "friend\friend.h"
|
#include "friend\fgary.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef __GAME_GAME_H__
|
#ifndef __GAME_GAME_H__
|
||||||
|
@ -20,8 +20,10 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
void CNpcFriend::processGaryMovement( int _frames )
|
void CNpcGaryFriend::think( int _frames )
|
||||||
{
|
{
|
||||||
|
CNpcThing::think(_frames);
|
||||||
|
|
||||||
s8 multiplier = -1 + ( 2 * m_extension );
|
s8 multiplier = -1 + ( 2 * m_extension );
|
||||||
s32 maxHeight = 20;
|
s32 maxHeight = 20;
|
||||||
s32 fallSpeed = 3;
|
s32 fallSpeed = 3;
|
||||||
|
|
|
@ -31,6 +31,10 @@
|
||||||
#include "utils\utils.h"
|
#include "utils\utils.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef __FRIEND_FSQUID_H__
|
||||||
|
#include "friend\fsquid.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
// Friend NPCs
|
// Friend NPCs
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -45,7 +49,7 @@ CNpcFriend *CNpcFriend::Create(sThingActor *ThisActor)
|
||||||
{
|
{
|
||||||
case CNpcFriend::NPC_FRIEND_SQUIDWARD:
|
case CNpcFriend::NPC_FRIEND_SQUIDWARD:
|
||||||
{
|
{
|
||||||
friendNpc = new ("squidward") CNpcFriend;
|
friendNpc = new ("squidward") CNpcSquidwardFriend;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -97,8 +101,8 @@ void CNpcFriend::init()
|
||||||
|
|
||||||
m_actorGfx = CActorPool::GetActor( (FileEquate) m_data[m_type].skelType );
|
m_actorGfx = CActorPool::GetActor( (FileEquate) m_data[m_type].skelType );
|
||||||
|
|
||||||
//m_animPlaying = true;
|
m_animPlaying = true;
|
||||||
m_animNo = 0;
|
m_animNo = m_data[m_type].idleAnim;
|
||||||
m_frame = 0;
|
m_frame = 0;
|
||||||
m_reversed = false;
|
m_reversed = false;
|
||||||
|
|
||||||
|
@ -134,16 +138,53 @@ void CNpcFriend::think(int _frames)
|
||||||
{
|
{
|
||||||
CNpcThing::think(_frames);
|
CNpcThing::think(_frames);
|
||||||
|
|
||||||
switch( m_data[m_type].movementFunc )
|
if ( m_animPlaying )
|
||||||
{
|
{
|
||||||
case NPC_FRIEND_MOVEMENT_GARY:
|
s32 frameCount;
|
||||||
processGaryMovement( _frames );
|
|
||||||
|
|
||||||
break;
|
frameCount = m_actorGfx->getFrameCount( m_animNo );
|
||||||
|
|
||||||
case NPC_FRIEND_MOVEMENT_STATIC:
|
s32 frameShift = ( _frames << 8 ) >> 1;
|
||||||
default:
|
|
||||||
break;
|
if ( ( frameCount << 8 ) - m_frame > frameShift )
|
||||||
|
{
|
||||||
|
m_frame += frameShift;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_frame = ( frameCount - 1 ) << 8;
|
||||||
|
m_animPlaying = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
s32 fallSpeed = 3;
|
||||||
|
s8 yMovement = fallSpeed * _frames;
|
||||||
|
s8 groundHeight;
|
||||||
|
|
||||||
|
// check vertical collision
|
||||||
|
|
||||||
|
groundHeight = m_layerCollision->getHeightFromGround( Pos.vx, Pos.vy, yMovement + 16 );
|
||||||
|
|
||||||
|
if ( groundHeight <= 0 )
|
||||||
|
{
|
||||||
|
// make sure we are on the ground, not below it
|
||||||
|
|
||||||
|
Pos.vy += groundHeight;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// above ground
|
||||||
|
|
||||||
|
if ( groundHeight < yMovement )
|
||||||
|
{
|
||||||
|
// colliding with ground
|
||||||
|
|
||||||
|
Pos.vy += groundHeight;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Pos.vy += yMovement;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -164,7 +205,7 @@ void CNpcFriend::render()
|
||||||
{
|
{
|
||||||
if ( renderPos.vy >= 0 && renderPos.vy <= VidGetScrH() )
|
if ( renderPos.vy >= 0 && renderPos.vy <= VidGetScrH() )
|
||||||
{
|
{
|
||||||
m_actorGfx->Render(renderPos,m_animNo,m_frame,m_reversed);
|
m_actorGfx->Render(renderPos,m_animNo,(m_frame>>8),m_reversed);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,7 +40,7 @@ public:
|
||||||
void init();
|
void init();
|
||||||
void init( DVECTOR initPos );
|
void init( DVECTOR initPos );
|
||||||
void shutdown();
|
void shutdown();
|
||||||
void think(int _frames);
|
virtual void think(int _frames);
|
||||||
void render();
|
void render();
|
||||||
void processEvent( GAME_EVENT evt, CThing *sourceThing );
|
void processEvent( GAME_EVENT evt, CThing *sourceThing );
|
||||||
void setLayerCollision( class CLayerCollision *_layer ) {m_layerCollision=_layer;}
|
void setLayerCollision( class CLayerCollision *_layer ) {m_layerCollision=_layer;}
|
||||||
|
@ -49,25 +49,19 @@ public:
|
||||||
static CNpcFriend *Create(sThingActor *ThisActor);
|
static CNpcFriend *Create(sThingActor *ThisActor);
|
||||||
static NPC_FRIEND_UNIT_TYPE getTypeFromMapEdit( u16 newType );
|
static NPC_FRIEND_UNIT_TYPE getTypeFromMapEdit( u16 newType );
|
||||||
|
|
||||||
private:
|
protected:
|
||||||
class CLayerCollision *m_layerCollision;
|
class CLayerCollision *m_layerCollision;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
enum NPC_FRIEND_MOVEMENT_FUNC
|
|
||||||
{
|
|
||||||
NPC_FRIEND_MOVEMENT_STATIC = 0,
|
|
||||||
NPC_FRIEND_MOVEMENT_GARY = 1,
|
|
||||||
};
|
|
||||||
|
|
||||||
typedef struct NPC_FRIEND_DATA_TYPE
|
typedef struct NPC_FRIEND_DATA_TYPE
|
||||||
{
|
{
|
||||||
int skelType;
|
int skelType;
|
||||||
NPC_FRIEND_MOVEMENT_FUNC movementFunc;
|
|
||||||
bool canTalk;
|
bool canTalk;
|
||||||
u8 speed;
|
u8 speed;
|
||||||
u16 turnSpeed;
|
u16 turnSpeed;
|
||||||
bool detectCollision;
|
bool detectCollision;
|
||||||
DAMAGE_TYPE damageToUserType;
|
DAMAGE_TYPE damageToUserType;
|
||||||
|
u16 idleAnim;
|
||||||
}
|
}
|
||||||
NPC_FRIEND_DATA;
|
NPC_FRIEND_DATA;
|
||||||
|
|
||||||
|
@ -96,6 +90,7 @@ protected:
|
||||||
|
|
||||||
int m_frame;
|
int m_frame;
|
||||||
int m_animNo;
|
int m_animNo;
|
||||||
|
u8 m_animPlaying;
|
||||||
CActorGfx *m_actorGfx;
|
CActorGfx *m_actorGfx;
|
||||||
DVECTOR m_drawOffset;
|
DVECTOR m_drawOffset;
|
||||||
bool m_reversed;
|
bool m_reversed;
|
||||||
|
|
25
source/friend/fsquid.h
Normal file
25
source/friend/fsquid.h
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
/*=========================================================================
|
||||||
|
|
||||||
|
fsquid.cpp
|
||||||
|
|
||||||
|
Author: CRB
|
||||||
|
Created:
|
||||||
|
Project: Spongebob
|
||||||
|
Purpose:
|
||||||
|
|
||||||
|
Copyright (c) 2000 Climax Development Ltd
|
||||||
|
|
||||||
|
===========================================================================*/
|
||||||
|
|
||||||
|
#ifndef __FRIEND_FSQUID_H__
|
||||||
|
#define __FRIEND_FSQUID_H__
|
||||||
|
|
||||||
|
#ifndef __FRIEND_FRIEND_H__
|
||||||
|
#include "friend\friend.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
class CNpcSquidwardFriend : public CNpcFriend
|
||||||
|
{
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
|
@ -27,6 +27,10 @@
|
||||||
#include "enemy\npc.h"
|
#include "enemy\npc.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef __FRIEND_FRIEND_H__
|
||||||
|
#include "friend\friend.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef __PLATFORM_PLATFORM_H__
|
#ifndef __PLATFORM_PLATFORM_H__
|
||||||
#include "platform\platform.h"
|
#include "platform\platform.h"
|
||||||
#endif
|
#endif
|
||||||
|
@ -322,6 +326,14 @@ void CGameScene::initLevel()
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case CGameScene::ACTOR_FRIEND_NPC:
|
||||||
|
{
|
||||||
|
CNpcFriend *friendNpc;
|
||||||
|
friendNpc=CNpcFriend::Create(ThisActor);
|
||||||
|
friendNpc->setLayerCollision( Level.getCollisionLayer() );
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -75,14 +75,14 @@ Player=1
|
||||||
#Health=0
|
#Health=0
|
||||||
#AttackStrength=0
|
#AttackStrength=0
|
||||||
|
|
||||||
#[Squidward]
|
[Squidward]
|
||||||
#Gfx=..\..\graphics\characters\
|
Gfx=..\..\graphics\characters\Squidward\render\psx\Squidward_idlebreathe0000.bmp
|
||||||
#WayPoints=0
|
WayPoints=0
|
||||||
#Speed=0
|
Speed=0
|
||||||
#TurnRate=0
|
TurnRate=0
|
||||||
#Collision=0
|
Collision=0
|
||||||
#Health=0
|
Health=0
|
||||||
#AttackStrength=0
|
AttackStrength=0
|
||||||
|
|
||||||
#[Plankton]
|
#[Plankton]
|
||||||
#Gfx=..\..\graphics\characters\
|
#Gfx=..\..\graphics\characters\
|
||||||
|
|
|
@ -193,10 +193,6 @@ SOURCE=..\..\..\source\enemy\nfskull.h
|
||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|
||||||
SOURCE=..\..\..\source\enemy\ngary.cpp
|
|
||||||
# End Source File
|
|
||||||
# Begin Source File
|
|
||||||
|
|
||||||
SOURCE=..\..\..\source\enemy\ngen.cpp
|
SOURCE=..\..\..\source\enemy\ngen.cpp
|
||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
@ -1544,6 +1540,34 @@ SOURCE=..\..\..\source\map\map.cpp
|
||||||
SOURCE=..\..\..\source\map\map.h
|
SOURCE=..\..\..\source\map\map.h
|
||||||
# End Source File
|
# End Source File
|
||||||
# End Group
|
# End Group
|
||||||
|
# Begin Group "friend"
|
||||||
|
|
||||||
|
# PROP Default_Filter ""
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=..\..\..\source\friend\fdata.cpp
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=..\..\..\source\friend\fgary.cpp
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=..\..\..\source\friend\fgary.h
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=..\..\..\source\friend\friend.cpp
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=..\..\..\source\friend\friend.h
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=..\..\..\source\friend\fsquid.h
|
||||||
|
# End Source File
|
||||||
|
# End Group
|
||||||
# End Group
|
# End Group
|
||||||
# Begin Group "makefiles"
|
# Begin Group "makefiles"
|
||||||
|
|
||||||
|
@ -1708,6 +1732,10 @@ SOURCE=..\..\..\out\USA\include\ACTOR_SQUIDDART_Anim.h
|
||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=..\..\..\out\USA\include\ACTOR_SQUIDWARD_Anim.h
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
SOURCE=..\..\..\out\USA\include\ACTOR_STOMPER_Anim.h
|
SOURCE=..\..\..\out\USA\include\ACTOR_STOMPER_Anim.h
|
||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|
Loading…
Add table
Reference in a new issue