This commit is contained in:
Paul 2001-06-12 15:41:47 +00:00
parent 027484747a
commit e71271653f
4 changed files with 100 additions and 52 deletions

View File

@ -153,6 +153,7 @@ int CGameScene::s_levelFinished;
int CGameScene::s_skipToNextLevel;
#endif
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};
m_player->setCameraBox(camBox);
s_bossHasBeenKilled=false;
// Song is loaded/dumped by the level, and played from here. This just gives some
// better timing over when it starts (pkg)
CSoundMediator::playSong();
CActorPool::SetUpCache();
SYSTEM_DBGMSG("InitLevelDone\n");
}

View File

@ -56,6 +56,9 @@ static void restartlevel() {s_restartLevel=true;}
// static MATRIX &GetCamMtx() {return(CamMtx);}
static ACTOR_TYPE getActorType( int actorNum ) {return actorType[actorNum];}
static void setBossHasBeenKilled() {s_bossHasBeenKilled=true;}
static int getBossHasBeenKilled() {return s_bossHasBeenKilled;}
protected:
void initLevel();
@ -88,6 +91,7 @@ static CLayerCollision *getCollision() {return(s_GlobalCollision);}
static SpriteBank *s_GlobalSpritebank;
static CLayerCollision *s_GlobalCollision;
static int s_bossHasBeenKilled;
};

View File

@ -37,7 +37,6 @@
#include "game\game.h"
#endif
#include "game/game.h"
/* Std Lib
------- */
@ -133,6 +132,15 @@ void CQuestItemPickup::init()
fh=CGameScene::getSpriteBank()->getFrameHeader(m_gfxFrame);
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);
}
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
void CQuestItemPickup::collidedWith(CThing *_thisThing)
{
if(!m_hiddenUntilBossDead)
{
CBasePickup::collidedWith(_thisThing);
}
}
int quest_pingframes=50;
int quest_pingwaitframes=100;
int quest_pingsize=100;
@ -191,12 +215,19 @@ int CQuestItemPickup::getVisibilityRadius()
---------------------------------------------------------------------- */
void CQuestItemPickup::thinkPickup(int _frames)
{
if(!m_hiddenUntilBossDead)
{
m_pingFrame+=_frames;
if(m_pingFrame>(quest_pingframes+quest_pingwaitframes))
{
// Do sound too.. (pkg)
m_pingFrame=0;
}
}
else if(GameScene.getBossHasBeenKilled())
{
m_hiddenUntilBossDead=false;
}
}
/*----------------------------------------------------------------------
@ -207,6 +238,8 @@ void CQuestItemPickup::thinkPickup(int _frames)
---------------------------------------------------------------------- */
void CQuestItemPickup::renderPickup(DVECTOR *_pos)
{
if(!m_hiddenUntilBossDead)
{
SpriteBank *sprites;
sFrameHdr *fh;
int x,y;
@ -260,6 +293,7 @@ void CQuestItemPickup::renderPickup(DVECTOR *_pos)
setXY3(ft3,512,512,512,512,512,512);
AddPrimToList(ft3,OTPOS__PICKUP_POS+1);
}
}
}

View File

@ -42,6 +42,11 @@ public:
virtual DVECTOR getSizeForPlacement();
virtual void collect(class CPlayer *_player);
protected:
virtual void collidedWith(CThing *_thisThing);
private:
virtual int getVisibilityRadius();
@ -50,6 +55,7 @@ private:
virtual CSoundMediator::SFXID sfxToPlayWhenCollected(){return CSoundMediator::SFX_ITEM__LEVEL_ITEM;}
int m_hiddenUntilBossDead;
int m_pingFrame;
int m_gfxFrame;