This commit is contained in:
parent
a5722bd7e1
commit
504688e4cd
21 changed files with 242 additions and 133 deletions
|
@ -40,7 +40,7 @@ void CNpcSquidDartEnemy::render()
|
|||
DVECTOR origRenderPos;
|
||||
DVECTOR offset = CLevel::getCameraPos();
|
||||
|
||||
int frame = 6 + ( m_frame >> 8 );
|
||||
int frame = FRM_SQUIDDART_SWIM0001 + ( m_frame >> 8 );
|
||||
|
||||
int spriteWidth = m_spriteBank->getFrameWidth( frame );
|
||||
int spriteHeight = m_spriteBank->getFrameHeight( frame );
|
||||
|
|
|
@ -14,11 +14,15 @@
|
|||
#ifndef __ENEMY_NSDART_H__
|
||||
#define __ENEMY_NSDART_H__
|
||||
|
||||
#ifndef __SPR_SPRITES_H__
|
||||
#include <sprites.h>
|
||||
#endif
|
||||
|
||||
class CNpcSquidDartEnemy : public CNpcEnemy
|
||||
{
|
||||
public:
|
||||
void render();
|
||||
virtual int getFrameCount() {return( 4 );}
|
||||
virtual int getFrameCount() {return( FRM_SQUIDDART_SWIM0004 - FRM_SQUIDDART_SWIM0001 + 1 );}
|
||||
virtual u8 canCollideWithEnemy() {return( false );}
|
||||
};
|
||||
|
||||
|
|
|
@ -62,7 +62,7 @@ void CNpcSmallJellyfishEnemy::render()
|
|||
{
|
||||
if ( renderPos.vy >= 0 && renderPos.vy <= VidGetScrH() )
|
||||
{
|
||||
SprFrame = m_spriteBank->printRotatedScaledSprite( m_frame>>8,renderPos.vx,renderPos.vy,4096,4096,m_drawRotation,10);
|
||||
SprFrame = m_spriteBank->printRotatedScaledSprite( FRM_JELLYFISH1_SWIM1 + ( m_frame >> 8 ),renderPos.vx,renderPos.vy,4096,4096,m_drawRotation,10);
|
||||
setRGB0( SprFrame, 255, 128, 255 );
|
||||
|
||||
// get xmax, xmin, ymax, ymin
|
||||
|
|
|
@ -18,11 +18,15 @@
|
|||
#include "enemy\npc.h"
|
||||
#endif
|
||||
|
||||
#ifndef __SPR_SPRITES_H__
|
||||
#include <sprites.h>
|
||||
#endif
|
||||
|
||||
class CNpcSmallJellyfishEnemy : public CNpcEnemy
|
||||
{
|
||||
public:
|
||||
void render();
|
||||
virtual int getFrameCount() {return( 6 );}
|
||||
virtual int getFrameCount() {return( FRM_JELLYFISH1_SWIM6 - FRM_JELLYFISH1_SWIM1 + 1 );}
|
||||
virtual u8 canCollideWithEnemy() {return( false );}
|
||||
protected:
|
||||
virtual bool processSensor();
|
||||
|
|
|
@ -40,7 +40,6 @@ CNpcFriend::NPC_FRIEND_DATA CNpcFriend::m_data[NPC_FRIEND_UNIT_TYPE_MAX] =
|
|||
{
|
||||
{ // NPC_FRIEND_BARNACLE_BOY
|
||||
ACTORS_CLAM_SBK,
|
||||
true,
|
||||
3,
|
||||
128,
|
||||
false,
|
||||
|
@ -50,7 +49,6 @@ CNpcFriend::NPC_FRIEND_DATA CNpcFriend::m_data[NPC_FRIEND_UNIT_TYPE_MAX] =
|
|||
|
||||
{ // NPC_FRIEND_GARY
|
||||
ACTORS_CLAM_SBK,
|
||||
true,
|
||||
3,
|
||||
128,
|
||||
false,
|
||||
|
@ -60,7 +58,6 @@ CNpcFriend::NPC_FRIEND_DATA CNpcFriend::m_data[NPC_FRIEND_UNIT_TYPE_MAX] =
|
|||
|
||||
{ // NPC_FRIEND_KRUSTY
|
||||
ACTORS_KRUSTY_SBK,
|
||||
true,
|
||||
3,
|
||||
128,
|
||||
false,
|
||||
|
@ -70,7 +67,6 @@ CNpcFriend::NPC_FRIEND_DATA CNpcFriend::m_data[NPC_FRIEND_UNIT_TYPE_MAX] =
|
|||
|
||||
{ // NPC_FRIEND_MERMAID_MAN
|
||||
ACTORS_CLAM_SBK,
|
||||
true,
|
||||
3,
|
||||
128,
|
||||
false,
|
||||
|
@ -80,7 +76,6 @@ CNpcFriend::NPC_FRIEND_DATA CNpcFriend::m_data[NPC_FRIEND_UNIT_TYPE_MAX] =
|
|||
|
||||
{ // NPC_FRIEND_PATRICK
|
||||
ACTORS_PATRICK_SBK,
|
||||
true,
|
||||
3,
|
||||
128,
|
||||
false,
|
||||
|
@ -90,7 +85,6 @@ CNpcFriend::NPC_FRIEND_DATA CNpcFriend::m_data[NPC_FRIEND_UNIT_TYPE_MAX] =
|
|||
|
||||
{ // NPC_FRIEND_SANDY_CHEEKS
|
||||
ACTORS_SANDY_SBK,
|
||||
true,
|
||||
3,
|
||||
128,
|
||||
false,
|
||||
|
@ -100,7 +94,6 @@ CNpcFriend::NPC_FRIEND_DATA CNpcFriend::m_data[NPC_FRIEND_UNIT_TYPE_MAX] =
|
|||
|
||||
{ // NPC_FRIEND_SQUIDWARD
|
||||
ACTORS_SQUIDWARD_SBK,
|
||||
true,
|
||||
3,
|
||||
128,
|
||||
false,
|
||||
|
@ -118,5 +111,6 @@ CNpcFriend::NPC_FRIEND_UNIT_TYPE CNpcFriend::mapEditConvertTable[NPC_FRIEND_UNIT
|
|||
NPC_FRIEND_PATRICK,
|
||||
NPC_FRIEND_SANDY_CHEEKS,
|
||||
NPC_FRIEND_SQUIDWARD,
|
||||
NPC_FRIEND_PLANKTON,
|
||||
};
|
||||
|
||||
|
|
|
@ -62,43 +62,40 @@ void CNpcKrustyFriend::postInit()
|
|||
|
||||
void CNpcKrustyFriend::startConderversation()
|
||||
{
|
||||
if ( m_data[this->m_type].canTalk )
|
||||
if( !CConversation::isActive() )
|
||||
{
|
||||
if( !CConversation::isActive() )
|
||||
CConversation::trigger( m_conversation );
|
||||
|
||||
switch( CLevel::getCurrentChapter() )
|
||||
{
|
||||
CConversation::trigger( m_conversation );
|
||||
|
||||
switch( CLevel::getCurrentChapter() )
|
||||
case 4:
|
||||
{
|
||||
case 4:
|
||||
if ( m_conversation == SCRIPTS_CH4L3_01_DAT )
|
||||
{
|
||||
if ( m_conversation == SCRIPTS_CH4L3_01_DAT )
|
||||
{
|
||||
m_conversation = SCRIPTS_CH4L3_02_DAT;
|
||||
}
|
||||
|
||||
break;
|
||||
m_conversation = SCRIPTS_CH4L3_02_DAT;
|
||||
}
|
||||
|
||||
case 2:
|
||||
{
|
||||
if ( m_conversation == SCRIPTS_CH2L1_01_DAT )
|
||||
{
|
||||
m_conversation = SCRIPTS_CH2L1_02_DAT;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
break;
|
||||
case 2:
|
||||
{
|
||||
if ( m_conversation == SCRIPTS_CH2L1_01_DAT )
|
||||
{
|
||||
m_conversation = SCRIPTS_CH2L1_02_DAT;
|
||||
}
|
||||
|
||||
default:
|
||||
{
|
||||
if ( m_conversation == SCRIPTS_CH1L4_01_DAT )
|
||||
{
|
||||
m_conversation = SCRIPTS_CH1L4_02_DAT;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
break;
|
||||
default:
|
||||
{
|
||||
if ( m_conversation == SCRIPTS_CH1L4_01_DAT )
|
||||
{
|
||||
m_conversation = SCRIPTS_CH1L4_02_DAT;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,6 +23,10 @@
|
|||
#include "game\convo.h"
|
||||
#endif
|
||||
|
||||
#ifndef __LEVEL_LEVEL_H__
|
||||
#include "level\level.h"
|
||||
#endif
|
||||
|
||||
#ifndef __ANIM_PATRICK_HEADER__
|
||||
#include <ACTOR_PATRICK_Anim.h>
|
||||
#endif
|
||||
|
@ -34,12 +38,12 @@ extern int s_globalLevelSelectThing;
|
|||
|
||||
void CNpcPatrickFriend::postInit()
|
||||
{
|
||||
/*switch( CLevel::getCurrentChapter() )
|
||||
switch( CLevel::getCurrentChapter() )
|
||||
{
|
||||
case 3:
|
||||
{*/
|
||||
{
|
||||
m_conversation = SCRIPTS_CH3L3_01_DAT;
|
||||
/*break;
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
|
@ -47,41 +51,38 @@ void CNpcPatrickFriend::postInit()
|
|||
m_conversation = SCRIPTS_CH2L2_01_DAT;
|
||||
break;
|
||||
}
|
||||
}*/
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void CNpcPatrickFriend::startConderversation()
|
||||
{
|
||||
if ( m_data[this->m_type].canTalk )
|
||||
if( !CConversation::isActive() )
|
||||
{
|
||||
if( !CConversation::isActive() )
|
||||
CConversation::trigger( m_conversation );
|
||||
|
||||
switch( CLevel::getCurrentChapter() )
|
||||
{
|
||||
CConversation::trigger( m_conversation );
|
||||
|
||||
/*switch( CLevel::getCurrentChapter() )
|
||||
case 3:
|
||||
{
|
||||
case 3:
|
||||
{*/
|
||||
if ( m_conversation == SCRIPTS_CH3L3_01_DAT )
|
||||
{
|
||||
m_conversation = SCRIPTS_CH3L3_02_DAT;
|
||||
}
|
||||
|
||||
/*break;
|
||||
}
|
||||
|
||||
default:
|
||||
if ( m_conversation == SCRIPTS_CH3L3_01_DAT )
|
||||
{
|
||||
if ( m_conversation == SCRIPTS_CH2L2_01_DAT )
|
||||
{
|
||||
m_conversation = SCRIPTS_CH2L2_02_DAT;
|
||||
}
|
||||
|
||||
break;
|
||||
m_conversation = SCRIPTS_CH3L3_02_DAT;
|
||||
}
|
||||
}*/
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
{
|
||||
if ( m_conversation == SCRIPTS_CH2L2_01_DAT )
|
||||
{
|
||||
m_conversation = SCRIPTS_CH2L2_02_DAT;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -31,6 +31,10 @@
|
|||
#include <sprites.h>
|
||||
#endif
|
||||
|
||||
#ifndef __GAME_CONVO_H__
|
||||
#include "game\convo.h"
|
||||
#endif
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
@ -83,4 +87,14 @@ void CNpcPlanktonFriend::render()
|
|||
|
||||
void CNpcPlanktonFriend::think( int _frames )
|
||||
{
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void CNpcPlanktonFriend::startConderversation()
|
||||
{
|
||||
if( !CConversation::isActive() )
|
||||
{
|
||||
CConversation::trigger( SCRIPTS_CH3L1_01_DAT );
|
||||
}
|
||||
}
|
|
@ -26,6 +26,7 @@ public:
|
|||
virtual void think(int _frames);
|
||||
virtual void shutdown();
|
||||
protected:
|
||||
virtual void startConderversation();
|
||||
SpriteBank *m_spriteBank;
|
||||
};
|
||||
|
||||
|
|
|
@ -55,6 +55,10 @@
|
|||
#include "friend\fsquid.h"
|
||||
#endif
|
||||
|
||||
#ifndef __FRIEND_FPLNKTON_H__
|
||||
#include "friend\fplnkton.h"
|
||||
#endif
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Friend NPCs
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -109,6 +113,12 @@ CNpcFriend *CNpcFriend::Create(sThingActor *ThisActor)
|
|||
break;
|
||||
}
|
||||
|
||||
case CNpcFriend::NPC_FRIEND_PLANKTON:
|
||||
{
|
||||
friendNpc = new ("plankton") CNpcPlanktonFriend;
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
{
|
||||
printf("UNKNOWN %i\n",friendType);
|
||||
|
|
|
@ -34,15 +34,16 @@ public:
|
|||
NPC_FRIEND_PATRICK,
|
||||
NPC_FRIEND_SANDY_CHEEKS,
|
||||
NPC_FRIEND_SQUIDWARD,
|
||||
NPC_FRIEND_PLANKTON,
|
||||
NPC_FRIEND_UNIT_TYPE_MAX,
|
||||
};
|
||||
|
||||
void init();
|
||||
virtual void init();
|
||||
void init( DVECTOR initPos );
|
||||
virtual void postInit();
|
||||
void shutdown();
|
||||
virtual void shutdown();
|
||||
virtual void think(int _frames);
|
||||
void render();
|
||||
virtual void render();
|
||||
void setLayerCollision( class CLayerCollision *_layer ) {m_layerCollision=_layer;}
|
||||
void setType( NPC_FRIEND_UNIT_TYPE newType ) {m_type = newType;}
|
||||
|
||||
|
@ -56,7 +57,6 @@ protected:
|
|||
typedef struct NPC_FRIEND_DATA_TYPE
|
||||
{
|
||||
int skelType;
|
||||
bool canTalk;
|
||||
u8 speed;
|
||||
u16 turnSpeed;
|
||||
bool detectCollision;
|
||||
|
|
|
@ -32,11 +32,8 @@
|
|||
|
||||
void CNpcSandyFriend::startConderversation()
|
||||
{
|
||||
if ( m_data[this->m_type].canTalk )
|
||||
if( !CConversation::isActive() )
|
||||
{
|
||||
if( !CConversation::isActive() )
|
||||
{
|
||||
CConversation::trigger( SCRIPTS_CH1L2_03_DAT );
|
||||
}
|
||||
CConversation::trigger( SCRIPTS_CH1L2_03_DAT );
|
||||
}
|
||||
}
|
|
@ -79,16 +79,13 @@ void CNpcSquidwardFriend::think( int _frames )
|
|||
|
||||
void CNpcSquidwardFriend::startConderversation()
|
||||
{
|
||||
if ( m_data[this->m_type].canTalk )
|
||||
if( !CConversation::isActive() )
|
||||
{
|
||||
if( !CConversation::isActive() )
|
||||
{
|
||||
CConversation::trigger( m_conversation );
|
||||
CConversation::trigger( m_conversation );
|
||||
|
||||
if ( m_conversation == SCRIPTS_CH1L1_01_DAT )
|
||||
{
|
||||
m_conversation = SCRIPTS_CH1L1_02_DAT;
|
||||
}
|
||||
if ( m_conversation == SCRIPTS_CH1L1_01_DAT )
|
||||
{
|
||||
m_conversation = SCRIPTS_CH1L1_02_DAT;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -42,6 +42,10 @@
|
|||
#include "pad\pads.h"
|
||||
#endif
|
||||
|
||||
#ifndef __LEVEL_LEVEL_H__
|
||||
#include "level\level.h"
|
||||
#endif
|
||||
|
||||
|
||||
/* Std Lib
|
||||
------- */
|
||||
|
@ -58,6 +62,7 @@
|
|||
#endif
|
||||
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
Tyepdefs && Defines
|
||||
------------------- */
|
||||
|
@ -453,27 +458,105 @@ void CConversation::dumpConversationScripts()
|
|||
---------------------------------------------------------------------- */
|
||||
void CConversation::registerConversationLevelScripts(int level)
|
||||
{
|
||||
switch( level )
|
||||
switch( CLevel::getCurrentChapter() )
|
||||
{
|
||||
case 0:
|
||||
case 1:
|
||||
{
|
||||
CConversation::registerConversationScript(SCRIPTS_CH1L1_01_DAT);
|
||||
CConversation::registerConversationScript(SCRIPTS_CH1L1_02_DAT);
|
||||
switch ( CLevel::getCurrentChapterLevel() )
|
||||
{
|
||||
case 1:
|
||||
{
|
||||
CConversation::registerConversationScript(SCRIPTS_CH1L1_01_DAT);
|
||||
CConversation::registerConversationScript(SCRIPTS_CH1L1_02_DAT);
|
||||
break;
|
||||
}
|
||||
|
||||
case 2:
|
||||
{
|
||||
CConversation::registerConversationScript(SCRIPTS_CH1L2_01_DAT);
|
||||
CConversation::registerConversationScript(SCRIPTS_CH1L2_02_DAT);
|
||||
CConversation::registerConversationScript(SCRIPTS_CH1L2_03_DAT);
|
||||
break;
|
||||
}
|
||||
|
||||
case 4:
|
||||
{
|
||||
CConversation::registerConversationScript(SCRIPTS_CH1L4_01_DAT);
|
||||
CConversation::registerConversationScript(SCRIPTS_CH1L4_02_DAT);
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case 2:
|
||||
{
|
||||
switch ( CLevel::getCurrentChapterLevel() )
|
||||
{
|
||||
case 1:
|
||||
{
|
||||
CConversation::registerConversationScript(SCRIPTS_CH2L1_01_DAT);
|
||||
CConversation::registerConversationScript(SCRIPTS_CH2L1_02_DAT);
|
||||
break;
|
||||
}
|
||||
|
||||
case 2:
|
||||
{
|
||||
CConversation::registerConversationScript(SCRIPTS_CH2L2_01_DAT);
|
||||
CConversation::registerConversationScript(SCRIPTS_CH2L2_02_DAT);
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case 3:
|
||||
{
|
||||
switch ( CLevel::getCurrentChapterLevel() )
|
||||
{
|
||||
case 1:
|
||||
{
|
||||
CConversation::registerConversationScript(SCRIPTS_CH3L1_01_DAT);
|
||||
break;
|
||||
}
|
||||
|
||||
case 3:
|
||||
{
|
||||
CConversation::registerConversationScript(SCRIPTS_CH3L3_01_DAT);
|
||||
CConversation::registerConversationScript(SCRIPTS_CH3L3_02_DAT);
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case 4:
|
||||
{
|
||||
switch ( CLevel::getCurrentChapterLevel() )
|
||||
{
|
||||
case 3:
|
||||
{
|
||||
CConversation::registerConversationScript(SCRIPTS_CH4L3_01_DAT);
|
||||
CConversation::registerConversationScript(SCRIPTS_CH4L3_02_DAT);
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
// temporary
|
||||
//CConversation::registerConversationScript(SCRIPTS_CH1L2_01_DAT);
|
||||
//CConversation::registerConversationScript(SCRIPTS_CH1L2_02_DAT);
|
||||
//CConversation::registerConversationScript(SCRIPTS_CH1L2_03_DAT);
|
||||
//CConversation::registerConversationScript(SCRIPTS_CH1L4_01_DAT);
|
||||
//CConversation::registerConversationScript(SCRIPTS_CH1L4_02_DAT);
|
||||
//CConversation::registerConversationScript(SCRIPTS_CH2L1_01_DAT);
|
||||
//CConversation::registerConversationScript(SCRIPTS_CH2L1_02_DAT);
|
||||
//CConversation::registerConversationScript(SCRIPTS_CH2L2_01_DAT);
|
||||
//CConversation::registerConversationScript(SCRIPTS_CH2L2_02_DAT);
|
||||
//CConversation::registerConversationScript(SCRIPTS_CH3L3_01_DAT);
|
||||
//CConversation::registerConversationScript(SCRIPTS_CH3L3_02_DAT);
|
||||
CConversation::registerConversationScript(SCRIPTS_CH4L3_01_DAT);
|
||||
CConversation::registerConversationScript(SCRIPTS_CH4L3_02_DAT);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue