2001-07-02 22:20:15 +02:00
|
|
|
/*=========================================================================
|
|
|
|
|
|
|
|
psdance.cpp
|
|
|
|
|
|
|
|
Author: PKG
|
|
|
|
Created:
|
|
|
|
Project: Spongebob
|
|
|
|
Purpose:
|
|
|
|
|
|
|
|
Copyright (c) 2001 Climax Development Ltd
|
|
|
|
|
|
|
|
===========================================================================*/
|
|
|
|
|
|
|
|
|
|
|
|
/*----------------------------------------------------------------------
|
|
|
|
Includes
|
|
|
|
-------- */
|
|
|
|
|
|
|
|
#include "player\psdance.h"
|
|
|
|
|
|
|
|
#ifndef __PLAYER_PLAYER_H__
|
|
|
|
#include "player\player.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef __PLAYER_PMODES_H__
|
|
|
|
#include "player\pmodes.h"
|
|
|
|
#endif
|
|
|
|
|
2001-07-03 00:57:52 +02:00
|
|
|
#ifndef __GAME_CONVO_H__
|
|
|
|
#include "game\convo.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef __GAME_GAME_H__
|
|
|
|
#include "game\game.h"
|
|
|
|
#endif
|
|
|
|
|
2001-07-02 22:20:15 +02:00
|
|
|
|
|
|
|
/* Std Lib
|
|
|
|
------- */
|
|
|
|
|
|
|
|
/* Data
|
|
|
|
---- */
|
|
|
|
|
2001-07-03 00:57:52 +02:00
|
|
|
#ifndef __FILE_EQUATES_H__
|
|
|
|
#include <biglump.h>
|
|
|
|
#endif
|
|
|
|
|
2001-07-02 22:20:15 +02:00
|
|
|
#ifndef __ANIM_SPONGEBOB_HEADER__
|
|
|
|
#include <ACTOR_SPONGEBOB_ANIM.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
/*----------------------------------------------------------------------
|
|
|
|
Tyepdefs && Defines
|
|
|
|
------------------- */
|
|
|
|
|
|
|
|
/*----------------------------------------------------------------------
|
|
|
|
Structure defintions
|
|
|
|
-------------------- */
|
|
|
|
|
|
|
|
/*----------------------------------------------------------------------
|
|
|
|
Function Prototypes
|
|
|
|
------------------- */
|
|
|
|
|
|
|
|
/*----------------------------------------------------------------------
|
|
|
|
Vars
|
|
|
|
---- */
|
|
|
|
|
|
|
|
CPlayerStateDance s_stateDance;
|
|
|
|
|
|
|
|
|
2001-07-03 00:57:52 +02:00
|
|
|
|
|
|
|
static const FileEquate s_celebrationScripts[5][4]=
|
|
|
|
{
|
|
|
|
{ SCRIPTS_C1L1_CELEBRATE_DAT, SCRIPTS_C1L2_CELEBRATE_DAT, SCRIPTS_C1L3_CELEBRATE_DAT, SCRIPTS_C1L4_CELEBRATE_DAT },
|
|
|
|
{ SCRIPTS_C2L1_CELEBRATE_DAT, SCRIPTS_C2L2_CELEBRATE_DAT, SCRIPTS_C2L3_CELEBRATE_DAT, SCRIPTS_C2L4_CELEBRATE_DAT },
|
|
|
|
{ SCRIPTS_C3L1_CELEBRATE_DAT, SCRIPTS_C3L2_CELEBRATE_DAT, SCRIPTS_C3L3_CELEBRATE_DAT, SCRIPTS_C3L4_CELEBRATE_DAT },
|
|
|
|
{ SCRIPTS_C4L1_CELEBRATE_DAT, SCRIPTS_C4L2_CELEBRATE_DAT, SCRIPTS_C4L3_CELEBRATE_DAT, SCRIPTS_C4L4_CELEBRATE_DAT },
|
|
|
|
{ SCRIPTS_C5L1_CELEBRATE_DAT, SCRIPTS_C5L2_CELEBRATE_DAT, SCRIPTS_C5L3_CELEBRATE_DAT, SCRIPTS_C5L4_CELEBRATE_DAT },
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
2001-07-02 22:20:15 +02:00
|
|
|
/*----------------------------------------------------------------------
|
|
|
|
Function:
|
|
|
|
Purpose:
|
|
|
|
Params:
|
|
|
|
Returns:
|
|
|
|
---------------------------------------------------------------------- */
|
|
|
|
void CPlayerStateDance::enter(CPlayerModeBase *_playerMode)
|
|
|
|
{
|
2001-07-03 00:57:52 +02:00
|
|
|
_playerMode->setAnimNo(ANIM_SPONGEBOB_JUMP);
|
|
|
|
m_hitGround=false;
|
2001-07-02 22:20:15 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*----------------------------------------------------------------------
|
|
|
|
Function:
|
|
|
|
Purpose:
|
|
|
|
Params:
|
|
|
|
Returns:
|
|
|
|
---------------------------------------------------------------------- */
|
|
|
|
void CPlayerStateDance::think(CPlayerModeBase *_playerMode)
|
|
|
|
{
|
|
|
|
_playerMode->slowdown();
|
2001-07-03 00:57:52 +02:00
|
|
|
if(!m_hitGround)
|
|
|
|
{
|
|
|
|
if(_playerMode->getHeightFromGound()==0)
|
|
|
|
{
|
|
|
|
_playerMode->setAnimNo(ANIM_SPONGEBOB_CELEBRATE);
|
|
|
|
m_hitGround=true;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
_playerMode->fallToDance();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if(_playerMode->advanceAnimFrameAndCheckForEndOfAnim())
|
|
|
|
{
|
|
|
|
CConversation::trigger(s_celebrationScripts[GameScene.getChapterNumber()-1][GameScene.getLevelNumber()-1]);
|
|
|
|
// GameScene.getPlayer()->setCanExitLevelNow();
|
|
|
|
_playerMode->setState(STATE_IDLE);
|
|
|
|
}
|
|
|
|
}
|
2001-07-02 22:20:15 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*===========================================================================
|
|
|
|
end */
|