diff --git a/data/DataCache.scr b/data/DataCache.scr index 63c78fca7..6381bcecc 100644 --- a/data/DataCache.scr +++ b/data/DataCache.scr @@ -13,6 +13,7 @@ scripts/ch2l1_01.dat scripts/ch2l1_02.dat scripts/ch2l2_01.dat scripts/ch2l2_02.dat +scripts/ch3l1_01.dat scripts/ch3l3_01.dat scripts/ch3l3_02.dat scripts/ch4l3_01.dat diff --git a/data/Scripts/ch1l1_01.scr b/data/Scripts/ch1l1_01.scr index 89d6e9423..ac9edd131 100644 --- a/data/Scripts/ch1l1_01.scr +++ b/data/Scripts/ch1l1_01.scr @@ -6,32 +6,20 @@ #include data/scripts/defs/trans.scr +_setText(CHAR_SPONGEBOB,STR__INGAME__CH1__L1__SPONGEY1); +_setResponseOptions(QUESTION_OK); do { - _setText(CHAR_SPONGEBOB,STR__INGAME__CH1__L1__SPONGEY1); - _setResponseOptions(QUESTION_OK); - do - { - pause; - } - while(_getResponse()==ANSWER_NONE); - - _setText(CHAR_SQUIDWARD,STR__INGAME__CH1__L1__SQUIDWARD1); - _setResponseOptions(QUESTION_OK); - do - { - pause; - } - while(_getResponse()==ANSWER_NONE); - - _setText(CHAR_SPONGEBOB,STR__INGAME__GENERIC__CHECK1); - _setResponseOptions(QUESTION_YES_NO); - do - { - pause; - } - while(_getResponse()==ANSWER_NONE); + pause; } -while(_getResponse()!=ANSWER_YES); +while(_getResponse()==ANSWER_NONE); + +_setText(CHAR_SQUIDWARD,STR__INGAME__CH1__L1__SQUIDWARD1); +_setResponseOptions(QUESTION_OK); +do +{ + pause; +} +while(_getResponse()==ANSWER_NONE); stop; diff --git a/data/translations/text.dat b/data/translations/text.dat index f4da3380a..db146ae35 100644 --- a/data/translations/text.dat +++ b/data/translations/text.dat @@ -186,6 +186,11 @@ Chapter 2 - Level 2 - 02 eng=Here best pal you can still use my balloon!!! Happy Birthday to me! +Chapter 3 - Level 1 - 01 +[STR__INGAME__CH3__L1__PLANKTON1] +eng=Blast you SpongeBreath, you have found my secret time machine! Whatever you do make sure you fill it up before you bring it back!!!! + + Chapter 3 - Level 3 - 01 [STR__INGAME__CH3__L3__PATRICK1] eng=DA DA DA DA DA DUM DUM DUM DUM (The blue Danube) Here you go Spongebob! One bubblewand dipped and ready to go!!!! Up, down and all around! I don't know what that means. diff --git a/makefile.gaz b/makefile.gaz index 4c239de16..f94dc2dfc 100644 --- a/makefile.gaz +++ b/makefile.gaz @@ -87,7 +87,8 @@ friend_src := friend \ fsquid \ fsandy \ fkrusty \ - fpatrick + fpatrick \ + fplnkton platform_src := platform \ platdata \ diff --git a/makefile.gfx b/makefile.gfx index 0ecd23ab0..f3c18f983 100644 --- a/makefile.gfx +++ b/makefile.gfx @@ -499,7 +499,7 @@ GFX_DATA_OUT += $(MUSIC_ALL_OUT) # Script stuff.. #---------------------------------------------------------------------------- SCRIPTS_LIST := ch1l1_01 ch1l1_02 ch1l2_01 ch1l2_02 ch1l2_03 ch1l4_01 ch1l4_02 \ - ch2l1_01 ch2l1_02 ch2l2_01 ch2l2_02 ch3l3_01 ch3l3_02 ch4l3_01 ch4l3_02 + ch2l1_01 ch2l1_02 ch2l2_01 ch2l2_02 ch3l1_01 ch3l3_01 ch3l3_02 ch4l3_01 ch4l3_02 SCRIPTS_IN_DIR := $(GAME_DATA_DIR)/scripts diff --git a/source/enemy/nsdart.cpp b/source/enemy/nsdart.cpp index fd40f9fdb..41742e03d 100644 --- a/source/enemy/nsdart.cpp +++ b/source/enemy/nsdart.cpp @@ -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 ); diff --git a/source/enemy/nsdart.h b/source/enemy/nsdart.h index 7500a52fc..e933d287d 100644 --- a/source/enemy/nsdart.h +++ b/source/enemy/nsdart.h @@ -14,11 +14,15 @@ #ifndef __ENEMY_NSDART_H__ #define __ENEMY_NSDART_H__ +#ifndef __SPR_SPRITES_H__ +#include +#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 );} }; diff --git a/source/enemy/nsjfish.cpp b/source/enemy/nsjfish.cpp index 9fd441523..f7e69bd60 100644 --- a/source/enemy/nsjfish.cpp +++ b/source/enemy/nsjfish.cpp @@ -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 diff --git a/source/enemy/nsjfish.h b/source/enemy/nsjfish.h index 5de1f710b..d0b3f04df 100644 --- a/source/enemy/nsjfish.h +++ b/source/enemy/nsjfish.h @@ -18,11 +18,15 @@ #include "enemy\npc.h" #endif +#ifndef __SPR_SPRITES_H__ +#include +#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(); diff --git a/source/friend/fdata.cpp b/source/friend/fdata.cpp index 4413864b4..8ab966a1f 100644 --- a/source/friend/fdata.cpp +++ b/source/friend/fdata.cpp @@ -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, }; diff --git a/source/friend/fkrusty.cpp b/source/friend/fkrusty.cpp index 9a8bf5a3c..a2fe7c816 100644 --- a/source/friend/fkrusty.cpp +++ b/source/friend/fkrusty.cpp @@ -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; } } } diff --git a/source/friend/fpatrick.cpp b/source/friend/fpatrick.cpp index 1889bb48b..d87c98a30 100644 --- a/source/friend/fpatrick.cpp +++ b/source/friend/fpatrick.cpp @@ -23,6 +23,10 @@ #include "game\convo.h" #endif +#ifndef __LEVEL_LEVEL_H__ +#include "level\level.h" +#endif + #ifndef __ANIM_PATRICK_HEADER__ #include #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; + } } } } \ No newline at end of file diff --git a/source/friend/fplnkton.cpp b/source/friend/fplnkton.cpp index cea14ac60..44b6082ea 100644 --- a/source/friend/fplnkton.cpp +++ b/source/friend/fplnkton.cpp @@ -31,6 +31,10 @@ #include #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 ); + } } \ No newline at end of file diff --git a/source/friend/fplnkton.h b/source/friend/fplnkton.h index 1f889979e..6cf8b6bfd 100644 --- a/source/friend/fplnkton.h +++ b/source/friend/fplnkton.h @@ -26,6 +26,7 @@ public: virtual void think(int _frames); virtual void shutdown(); protected: + virtual void startConderversation(); SpriteBank *m_spriteBank; }; diff --git a/source/friend/friend.cpp b/source/friend/friend.cpp index c266387f4..f74d8a798 100644 --- a/source/friend/friend.cpp +++ b/source/friend/friend.cpp @@ -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); diff --git a/source/friend/friend.h b/source/friend/friend.h index 390a63610..e67e5ec5f 100644 --- a/source/friend/friend.h +++ b/source/friend/friend.h @@ -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; diff --git a/source/friend/fsandy.cpp b/source/friend/fsandy.cpp index 619f09ee2..fdd3fa712 100644 --- a/source/friend/fsandy.cpp +++ b/source/friend/fsandy.cpp @@ -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 ); } } \ No newline at end of file diff --git a/source/friend/fsquid.cpp b/source/friend/fsquid.cpp index 9de090d85..0fb565773 100644 --- a/source/friend/fsquid.cpp +++ b/source/friend/fsquid.cpp @@ -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; } } } \ No newline at end of file diff --git a/source/game/convo.cpp b/source/game/convo.cpp index be46a1b67..46540d8ba 100644 --- a/source/game/convo.cpp +++ b/source/game/convo.cpp @@ -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; } diff --git a/tools/MapEdit/actor.ini b/tools/MapEdit/actor.ini index 15964b770..883bf9e01 100644 --- a/tools/MapEdit/actor.ini +++ b/tools/MapEdit/actor.ini @@ -84,14 +84,14 @@ Collision=0 Health=0 AttackStrength=0 -#[Plankton] -#Gfx=..\..\graphics\characters\ -#WayPoints=0 -#Speed=0 -#TurnRate=0 -#Collision=0 -#Health=0 -#AttackStrength=0 +[Plankton] +Gfx=..\..\graphics\characters\plankton\render\psx\plankton_static00.bmp +WayPoints=0 +Speed=0 +TurnRate=0 +Collision=0 +Health=0 +AttackStrength=0 ################################################ # Enemies diff --git a/users/paul/spongebob project/spongebob project.dsp b/users/paul/spongebob project/spongebob project.dsp index b07023459..243c15a4d 100644 --- a/users/paul/spongebob project/spongebob project.dsp +++ b/users/paul/spongebob project/spongebob project.dsp @@ -437,6 +437,14 @@ SOURCE=..\..\..\source\friend\fpatrick.h # End Source File # Begin Source File +SOURCE=..\..\..\source\friend\fplnkton.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\..\source\friend\fplnkton.h +# End Source File +# Begin Source File + SOURCE=..\..\..\source\friend\friend.cpp # End Source File # Begin Source File @@ -1757,6 +1765,10 @@ SOURCE=..\..\..\data\Scripts\ch2l2_02.scr # End Source File # Begin Source File +SOURCE=..\..\..\data\Scripts\ch3l1_01.scr +# End Source File +# Begin Source File + SOURCE=..\..\..\data\Scripts\ch3l3_01.scr # End Source File # Begin Source File