This commit is contained in:
parent
027484747a
commit
e71271653f
4 changed files with 100 additions and 52 deletions
|
@ -153,6 +153,7 @@ int CGameScene::s_levelFinished;
|
||||||
int CGameScene::s_skipToNextLevel;
|
int CGameScene::s_skipToNextLevel;
|
||||||
#endif
|
#endif
|
||||||
int CGameScene::s_restartLevel;
|
int CGameScene::s_restartLevel;
|
||||||
|
int CGameScene::s_bossHasBeenKilled;
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
@ -393,11 +394,14 @@ void CGameScene::initLevel()
|
||||||
CPlayer::CameraBox camBox={0,0,mapSize.vx<<4,mapSize.vy<<4};
|
CPlayer::CameraBox camBox={0,0,mapSize.vx<<4,mapSize.vy<<4};
|
||||||
m_player->setCameraBox(camBox);
|
m_player->setCameraBox(camBox);
|
||||||
|
|
||||||
|
s_bossHasBeenKilled=false;
|
||||||
|
|
||||||
// Song is loaded/dumped by the level, and played from here. This just gives some
|
// Song is loaded/dumped by the level, and played from here. This just gives some
|
||||||
// better timing over when it starts (pkg)
|
// better timing over when it starts (pkg)
|
||||||
CSoundMediator::playSong();
|
CSoundMediator::playSong();
|
||||||
CActorPool::SetUpCache();
|
CActorPool::SetUpCache();
|
||||||
SYSTEM_DBGMSG("InitLevelDone\n");
|
SYSTEM_DBGMSG("InitLevelDone\n");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -56,6 +56,9 @@ static void restartlevel() {s_restartLevel=true;}
|
||||||
// static MATRIX &GetCamMtx() {return(CamMtx);}
|
// static MATRIX &GetCamMtx() {return(CamMtx);}
|
||||||
static ACTOR_TYPE getActorType( int actorNum ) {return actorType[actorNum];}
|
static ACTOR_TYPE getActorType( int actorNum ) {return actorType[actorNum];}
|
||||||
|
|
||||||
|
static void setBossHasBeenKilled() {s_bossHasBeenKilled=true;}
|
||||||
|
static int getBossHasBeenKilled() {return s_bossHasBeenKilled;}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
void initLevel();
|
void initLevel();
|
||||||
|
@ -88,6 +91,7 @@ static CLayerCollision *getCollision() {return(s_GlobalCollision);}
|
||||||
|
|
||||||
static SpriteBank *s_GlobalSpritebank;
|
static SpriteBank *s_GlobalSpritebank;
|
||||||
static CLayerCollision *s_GlobalCollision;
|
static CLayerCollision *s_GlobalCollision;
|
||||||
|
static int s_bossHasBeenKilled;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -37,7 +37,6 @@
|
||||||
#include "game\game.h"
|
#include "game\game.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "game/game.h"
|
|
||||||
|
|
||||||
/* Std Lib
|
/* Std Lib
|
||||||
------- */
|
------- */
|
||||||
|
@ -133,6 +132,15 @@ void CQuestItemPickup::init()
|
||||||
|
|
||||||
fh=CGameScene::getSpriteBank()->getFrameHeader(m_gfxFrame);
|
fh=CGameScene::getSpriteBank()->getFrameHeader(m_gfxFrame);
|
||||||
setCollisionSize(fh->W,fh->H);
|
setCollisionSize(fh->W,fh->H);
|
||||||
|
|
||||||
|
if(level==5-1)
|
||||||
|
{
|
||||||
|
m_hiddenUntilBossDead=true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_hiddenUntilBossDead=false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*----------------------------------------------------------------------
|
/*----------------------------------------------------------------------
|
||||||
|
@ -164,6 +172,22 @@ void CQuestItemPickup::collect(class CPlayer *_player)
|
||||||
CBasePickup::collect(_player);
|
CBasePickup::collect(_player);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*----------------------------------------------------------------------
|
||||||
|
Function:
|
||||||
|
Purpose:
|
||||||
|
Params:
|
||||||
|
Returns:
|
||||||
|
---------------------------------------------------------------------- */
|
||||||
|
void CQuestItemPickup::collidedWith(CThing *_thisThing)
|
||||||
|
{
|
||||||
|
if(!m_hiddenUntilBossDead)
|
||||||
|
{
|
||||||
|
CBasePickup::collidedWith(_thisThing);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int quest_pingframes=50;
|
int quest_pingframes=50;
|
||||||
int quest_pingwaitframes=100;
|
int quest_pingwaitframes=100;
|
||||||
int quest_pingsize=100;
|
int quest_pingsize=100;
|
||||||
|
@ -191,12 +215,19 @@ int CQuestItemPickup::getVisibilityRadius()
|
||||||
---------------------------------------------------------------------- */
|
---------------------------------------------------------------------- */
|
||||||
void CQuestItemPickup::thinkPickup(int _frames)
|
void CQuestItemPickup::thinkPickup(int _frames)
|
||||||
{
|
{
|
||||||
|
if(!m_hiddenUntilBossDead)
|
||||||
|
{
|
||||||
m_pingFrame+=_frames;
|
m_pingFrame+=_frames;
|
||||||
if(m_pingFrame>(quest_pingframes+quest_pingwaitframes))
|
if(m_pingFrame>(quest_pingframes+quest_pingwaitframes))
|
||||||
{
|
{
|
||||||
// Do sound too.. (pkg)
|
// Do sound too.. (pkg)
|
||||||
m_pingFrame=0;
|
m_pingFrame=0;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else if(GameScene.getBossHasBeenKilled())
|
||||||
|
{
|
||||||
|
m_hiddenUntilBossDead=false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*----------------------------------------------------------------------
|
/*----------------------------------------------------------------------
|
||||||
|
@ -207,6 +238,8 @@ void CQuestItemPickup::thinkPickup(int _frames)
|
||||||
---------------------------------------------------------------------- */
|
---------------------------------------------------------------------- */
|
||||||
void CQuestItemPickup::renderPickup(DVECTOR *_pos)
|
void CQuestItemPickup::renderPickup(DVECTOR *_pos)
|
||||||
{
|
{
|
||||||
|
if(!m_hiddenUntilBossDead)
|
||||||
|
{
|
||||||
SpriteBank *sprites;
|
SpriteBank *sprites;
|
||||||
sFrameHdr *fh;
|
sFrameHdr *fh;
|
||||||
int x,y;
|
int x,y;
|
||||||
|
@ -260,6 +293,7 @@ void CQuestItemPickup::renderPickup(DVECTOR *_pos)
|
||||||
setXY3(ft3,512,512,512,512,512,512);
|
setXY3(ft3,512,512,512,512,512,512);
|
||||||
AddPrimToList(ft3,OTPOS__PICKUP_POS+1);
|
AddPrimToList(ft3,OTPOS__PICKUP_POS+1);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -42,6 +42,11 @@ public:
|
||||||
virtual DVECTOR getSizeForPlacement();
|
virtual DVECTOR getSizeForPlacement();
|
||||||
virtual void collect(class CPlayer *_player);
|
virtual void collect(class CPlayer *_player);
|
||||||
|
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual void collidedWith(CThing *_thisThing);
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
virtual int getVisibilityRadius();
|
virtual int getVisibilityRadius();
|
||||||
|
|
||||||
|
@ -50,6 +55,7 @@ private:
|
||||||
|
|
||||||
virtual CSoundMediator::SFXID sfxToPlayWhenCollected(){return CSoundMediator::SFX_ITEM__LEVEL_ITEM;}
|
virtual CSoundMediator::SFXID sfxToPlayWhenCollected(){return CSoundMediator::SFX_ITEM__LEVEL_ITEM;}
|
||||||
|
|
||||||
|
int m_hiddenUntilBossDead;
|
||||||
int m_pingFrame;
|
int m_pingFrame;
|
||||||
int m_gfxFrame;
|
int m_gfxFrame;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue