This commit is contained in:
parent
6f6b54fd0f
commit
f37209b515
22 changed files with 403 additions and 71 deletions
|
@ -27,6 +27,15 @@
|
|||
#include <ACTOR_SQUIDWARD_Anim.h>
|
||||
#endif
|
||||
|
||||
#ifndef __ANIM_SANDY_HEADER__
|
||||
#include <ACTOR_SANDY_Anim.h>
|
||||
#endif
|
||||
|
||||
#ifndef __ANIM_PATRICK_HEADER__
|
||||
#include <ACTOR_PATRICK_Anim.h>
|
||||
#endif
|
||||
|
||||
|
||||
CNpcFriend::NPC_FRIEND_DATA CNpcFriend::m_data[NPC_FRIEND_UNIT_TYPE_MAX] =
|
||||
{
|
||||
{ // NPC_FRIEND_BARNACLE_BOY
|
||||
|
@ -50,7 +59,7 @@ CNpcFriend::NPC_FRIEND_DATA CNpcFriend::m_data[NPC_FRIEND_UNIT_TYPE_MAX] =
|
|||
},
|
||||
|
||||
{ // NPC_FRIEND_KRUSTY
|
||||
ACTORS_CLAM_SBK,
|
||||
ACTORS_KRUSTY_SBK,
|
||||
true,
|
||||
3,
|
||||
128,
|
||||
|
@ -70,7 +79,7 @@ CNpcFriend::NPC_FRIEND_DATA CNpcFriend::m_data[NPC_FRIEND_UNIT_TYPE_MAX] =
|
|||
},
|
||||
|
||||
{ // NPC_FRIEND_PATRICK
|
||||
ACTORS_CLAM_SBK,
|
||||
ACTORS_PATRICK_SBK,
|
||||
true,
|
||||
3,
|
||||
128,
|
||||
|
@ -80,7 +89,7 @@ CNpcFriend::NPC_FRIEND_DATA CNpcFriend::m_data[NPC_FRIEND_UNIT_TYPE_MAX] =
|
|||
},
|
||||
|
||||
{ // NPC_FRIEND_SANDY_CHEEKS
|
||||
ACTORS_CLAM_SBK,
|
||||
ACTORS_SANDY_SBK,
|
||||
true,
|
||||
3,
|
||||
128,
|
||||
|
|
|
@ -19,6 +19,10 @@
|
|||
#include "utils\utils.h"
|
||||
#endif
|
||||
|
||||
#ifndef __LEVEL_LEVEL_H__
|
||||
#include "level\level.h"
|
||||
#endif
|
||||
|
||||
#ifndef __GAME_CONVO_H__
|
||||
#include "game\convo.h"
|
||||
#endif
|
||||
|
@ -32,7 +36,26 @@
|
|||
|
||||
void CNpcKrustyFriend::postInit()
|
||||
{
|
||||
m_conversation = SCRIPTS_CH1L4_01_DAT;
|
||||
switch( CLevel::getCurrentChapter() )
|
||||
{
|
||||
case 4:
|
||||
{
|
||||
m_conversation = SCRIPTS_CH4L3_01_DAT;
|
||||
break;
|
||||
}
|
||||
|
||||
case 2:
|
||||
{
|
||||
m_conversation = SCRIPTS_CH2L1_01_DAT;
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
{
|
||||
m_conversation = SCRIPTS_CH1L4_01_DAT;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -45,9 +68,37 @@ void CNpcKrustyFriend::startConderversation()
|
|||
{
|
||||
CConversation::trigger( m_conversation );
|
||||
|
||||
if ( m_conversation == SCRIPTS_CH1L4_01_DAT )
|
||||
switch( CLevel::getCurrentChapter() )
|
||||
{
|
||||
m_conversation = SCRIPTS_CH1L4_02_DAT;
|
||||
case 4:
|
||||
{
|
||||
if ( m_conversation == SCRIPTS_CH4L3_01_DAT )
|
||||
{
|
||||
m_conversation = SCRIPTS_CH4L3_02_DAT;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case 2:
|
||||
{
|
||||
if ( m_conversation == SCRIPTS_CH2L1_01_DAT )
|
||||
{
|
||||
m_conversation = SCRIPTS_CH2L1_02_DAT;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
{
|
||||
if ( m_conversation == SCRIPTS_CH1L4_01_DAT )
|
||||
{
|
||||
m_conversation = SCRIPTS_CH1L4_02_DAT;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,6 +20,12 @@
|
|||
|
||||
class CNpcKrustyFriend : public CNpcFriend
|
||||
{
|
||||
public:
|
||||
virtual void postInit();
|
||||
protected:
|
||||
virtual void startConderversation();
|
||||
|
||||
FileEquate m_conversation;
|
||||
};
|
||||
|
||||
#endif
|
|
@ -34,20 +34,20 @@ extern int s_globalLevelSelectThing;
|
|||
|
||||
void CNpcPatrickFriend::postInit()
|
||||
{
|
||||
switch( s_globalLevelSelectThing )
|
||||
/*switch( CLevel::getCurrentChapter() )
|
||||
{
|
||||
/*case 5:
|
||||
{
|
||||
m_conversation = SCRIPTS_CH2L1_01_DAT;
|
||||
break;
|
||||
}*/
|
||||
case 3:
|
||||
{*/
|
||||
m_conversation = SCRIPTS_CH3L3_01_DAT;
|
||||
/*break;
|
||||
}
|
||||
|
||||
default:
|
||||
{
|
||||
m_conversation = SCRIPTS_CH2L2_01_DAT;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -60,17 +60,17 @@ void CNpcPatrickFriend::startConderversation()
|
|||
{
|
||||
CConversation::trigger( m_conversation );
|
||||
|
||||
switch( s_globalLevelSelectThing )
|
||||
/*switch( CLevel::getCurrentChapter() )
|
||||
{
|
||||
/*case 5:
|
||||
{
|
||||
if ( m_conversation == SCRIPTS_CH2L1_01_DAT )
|
||||
case 3:
|
||||
{*/
|
||||
if ( m_conversation == SCRIPTS_CH3L3_01_DAT )
|
||||
{
|
||||
m_conversation = SCRIPTS_CH2L1_02_DAT;
|
||||
m_conversation = SCRIPTS_CH3L3_02_DAT;
|
||||
}
|
||||
|
||||
break;
|
||||
}*/
|
||||
/*break;
|
||||
}
|
||||
|
||||
default:
|
||||
{
|
||||
|
@ -81,7 +81,7 @@ void CNpcPatrickFriend::startConderversation()
|
|||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}*/
|
||||
}
|
||||
}
|
||||
}
|
|
@ -20,6 +20,12 @@
|
|||
|
||||
class CNpcPatrickFriend : public CNpcFriend
|
||||
{
|
||||
public:
|
||||
virtual void postInit();
|
||||
protected:
|
||||
virtual void startConderversation();
|
||||
|
||||
FileEquate m_conversation;
|
||||
};
|
||||
|
||||
#endif
|
|
@ -23,10 +23,6 @@
|
|||
#include "system\vid.h"
|
||||
#endif
|
||||
|
||||
#ifndef __GAME_CONVO_H__
|
||||
#include "game\convo.h"
|
||||
#endif
|
||||
|
||||
#ifndef __UTILS_HEADER__
|
||||
#include "utils\utils.h"
|
||||
#endif
|
||||
|
@ -182,6 +178,12 @@ void CNpcFriend::init( DVECTOR initPos )
|
|||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void CNpcFriend::postInit()
|
||||
{
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void CNpcFriend::shutdown()
|
||||
{
|
||||
//m_spriteBank->dump(); delete m_spriteBank;
|
||||
|
@ -277,12 +279,4 @@ void CNpcFriend::collidedWith( CThing *_thisThing )
|
|||
void CNpcFriend::startConderversation()
|
||||
{
|
||||
// I am 'avin a fayg
|
||||
|
||||
if ( m_data[this->m_type].canTalk )
|
||||
{
|
||||
if( !CConversation::isActive() )
|
||||
{
|
||||
CConversation::trigger( SCRIPTS_SPEECHTEST_DAT );
|
||||
}
|
||||
}
|
||||
}
|
|
@ -39,6 +39,7 @@ public:
|
|||
|
||||
void init();
|
||||
void init( DVECTOR initPos );
|
||||
virtual void postInit();
|
||||
void shutdown();
|
||||
virtual void think(int _frames);
|
||||
void render();
|
||||
|
@ -74,7 +75,7 @@ protected:
|
|||
|
||||
static NPC_FRIEND_UNIT_TYPE mapEditConvertTable[NPC_FRIEND_UNIT_TYPE_MAX];
|
||||
|
||||
void startConderversation();
|
||||
virtual void startConderversation();
|
||||
|
||||
virtual void collidedWith(CThing *_thisThing);
|
||||
|
||||
|
|
|
@ -20,6 +20,8 @@
|
|||
|
||||
class CNpcSandyFriend : public CNpcFriend
|
||||
{
|
||||
protected:
|
||||
virtual void startConderversation();
|
||||
};
|
||||
|
||||
#endif
|
|
@ -19,11 +19,24 @@
|
|||
#include "utils\utils.h"
|
||||
#endif
|
||||
|
||||
#ifndef __GAME_CONVO_H__
|
||||
#include "game\convo.h"
|
||||
#endif
|
||||
|
||||
#ifndef __ANIM_SQUIDWARD_HEADER__
|
||||
#include <ACTOR_SQUIDWARD_Anim.h>
|
||||
#endif
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void CNpcSquidwardFriend::postInit()
|
||||
{
|
||||
m_conversation = SCRIPTS_CH1L1_01_DAT;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void CNpcSquidwardFriend::think( int _frames )
|
||||
{
|
||||
CNpcThing::think(_frames);
|
||||
|
@ -60,4 +73,22 @@ void CNpcSquidwardFriend::think( int _frames )
|
|||
m_animPlaying = true;
|
||||
m_frame = 0;
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void CNpcSquidwardFriend::startConderversation()
|
||||
{
|
||||
if ( m_data[this->m_type].canTalk )
|
||||
{
|
||||
if( !CConversation::isActive() )
|
||||
{
|
||||
CConversation::trigger( m_conversation );
|
||||
|
||||
if ( m_conversation == SCRIPTS_CH1L1_01_DAT )
|
||||
{
|
||||
m_conversation = SCRIPTS_CH1L1_02_DAT;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -22,6 +22,11 @@ class CNpcSquidwardFriend : public CNpcFriend
|
|||
{
|
||||
public:
|
||||
virtual void think(int _frames);
|
||||
virtual void postInit();
|
||||
protected:
|
||||
virtual void startConderversation();
|
||||
|
||||
FileEquate m_conversation;
|
||||
};
|
||||
|
||||
#endif
|
|
@ -426,5 +426,41 @@ void CConversation::dumpConversationScripts()
|
|||
}
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
Function:
|
||||
Purpose:
|
||||
Params:
|
||||
Returns:
|
||||
---------------------------------------------------------------------- */
|
||||
void CConversation::registerConversationLevelScripts(int level)
|
||||
{
|
||||
switch( level )
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
CConversation::registerConversationScript(SCRIPTS_CH1L1_01_DAT);
|
||||
CConversation::registerConversationScript(SCRIPTS_CH1L1_02_DAT);
|
||||
|
||||
// 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;
|
||||
}
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
/*===========================================================================
|
||||
end */
|
||||
|
|
|
@ -43,6 +43,7 @@ public:
|
|||
static void think(int _frames);
|
||||
static void render();
|
||||
|
||||
static void registerConversationLevelScripts(int level);
|
||||
static void registerConversationScript(FileEquate _feScript);
|
||||
static void trigger(FileEquate _feScript);
|
||||
static int isActive();
|
||||
|
|
|
@ -297,7 +297,7 @@ void CGameScene::initLevel()
|
|||
CThingManager::init();
|
||||
|
||||
CConversation::init();
|
||||
CConversation::registerConversationScript(SCRIPTS_SPEECHTEST_DAT); // Register one script for testing..
|
||||
CConversation::registerConversationLevelScripts( s_globalLevelSelectThing );
|
||||
|
||||
s_levelFinished=false;
|
||||
Level.init(s_globalLevelSelectThing);
|
||||
|
@ -337,6 +337,7 @@ void CGameScene::initLevel()
|
|||
CNpcFriend *friendNpc;
|
||||
friendNpc=CNpcFriend::Create(ThisActor);
|
||||
friendNpc->setLayerCollision( Level.getCollisionLayer() );
|
||||
friendNpc->postInit();
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
|
@ -46,6 +46,9 @@
|
|||
#include "enemy\npc.h"
|
||||
#include "gfx\actor.h"
|
||||
|
||||
/*****************************************************************************/
|
||||
extern int s_globalLevelSelectThing;
|
||||
|
||||
/*****************************************************************************/
|
||||
sLvlTab LvlTable[]=
|
||||
{
|
||||
|
@ -425,4 +428,20 @@ sLayerHdr *layer;
|
|||
}
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
/*****************************************************************************/
|
||||
/*****************************************************************************/
|
||||
int CLevel::getCurrentChapter()
|
||||
{
|
||||
return( LvlTable[s_globalLevelSelectThing].Chapter );
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/*****************************************************************************/
|
||||
/*****************************************************************************/
|
||||
int CLevel::getCurrentChapterLevel()
|
||||
{
|
||||
return( LvlTable[s_globalLevelSelectThing].Level );
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
|
|
@ -34,6 +34,10 @@ public:
|
|||
void setCameraCentre(DVECTOR _pos) {MapPos=_pos;}
|
||||
static DVECTOR getCameraPos() {return MapPos;}
|
||||
static DVECTOR getPlayerSpawnPos() {return s_playerSpawnPos;}
|
||||
|
||||
static int getCurrentChapter();
|
||||
static int getCurrentChapterLevel();
|
||||
|
||||
int getActorCount() {return ActorCount;}
|
||||
sThingActor **getActorList() {return ActorList;}
|
||||
int getPlatformCount() {return PlatformCount;}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue