This commit is contained in:
parent
d9de1e680f
commit
d27bae5fd0
25 changed files with 392 additions and 190 deletions
|
@ -145,9 +145,11 @@ paul_src := paul \
|
||||||
scenesel
|
scenesel
|
||||||
|
|
||||||
pickups_src := pickup \
|
pickups_src := pickup \
|
||||||
|
pballoon \
|
||||||
pbubmix \
|
pbubmix \
|
||||||
pglasses \
|
pglasses \
|
||||||
phealth \
|
phealth \
|
||||||
|
phelmet \
|
||||||
pjlammo \
|
pjlammo \
|
||||||
plife \
|
plife \
|
||||||
pquest \
|
pquest \
|
||||||
|
|
|
@ -313,7 +313,8 @@ INGAMEFX_GFX_NONTRANS_IN := $(foreach FILE,$(INGAMEFX_GFX_NONTRANS),$(INGAMEFX_N
|
||||||
|
|
||||||
PICKUP_GFX_DIR := $(GRAF_DIR)/pickups
|
PICKUP_GFX_DIR := $(GRAF_DIR)/pickups
|
||||||
PICKUP_GFX := +spatula +pants +health100 +health50 +health25 +glint1 +glint2 +glint3 +glint4 \
|
PICKUP_GFX := +spatula +pants +health100 +health50 +health25 +glint1 +glint2 +glint3 +glint4 \
|
||||||
+jellyammo +bubblemixture +glasses +shoe +teeth
|
+jellyammo +bubblemixture +glasses +shoe +balloon +helmet \
|
||||||
|
+teeth
|
||||||
PICKUP_GFX_IN := $(foreach FILE,$(PICKUP_GFX),$(PICKUP_GFX_DIR)/$(FILE).bmp)
|
PICKUP_GFX_IN := $(foreach FILE,$(PICKUP_GFX),$(PICKUP_GFX_DIR)/$(FILE).bmp)
|
||||||
|
|
||||||
INGAMEFX_GFX_TRANS := +bubble_1 +bubble_2 +bubble_3
|
INGAMEFX_GFX_TRANS := +bubble_1 +bubble_2 +bubble_3
|
||||||
|
|
|
@ -115,6 +115,8 @@ void CGameScene::init()
|
||||||
pos.vx+=32; createPickup(PICKUP__BUBBLE_MIXTURE,&pos);
|
pos.vx+=32; createPickup(PICKUP__BUBBLE_MIXTURE,&pos);
|
||||||
pos.vx+=32; createPickup(PICKUP__GLASSES,&pos);
|
pos.vx+=32; createPickup(PICKUP__GLASSES,&pos);
|
||||||
pos.vx+=32; createPickup(PICKUP__SQUEAKY_SHOES,&pos);
|
pos.vx+=32; createPickup(PICKUP__SQUEAKY_SHOES,&pos);
|
||||||
|
pos.vx+=32; createPickup(PICKUP__BALLOON,&pos);
|
||||||
|
pos.vx+=32; createPickup(PICKUP__HELMET,&pos);
|
||||||
pos.vx+=32; createPickup(PICKUP__QUEST_ITEM__TEST,&pos);
|
pos.vx+=32; createPickup(PICKUP__QUEST_ITEM__TEST,&pos);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -21,6 +21,22 @@
|
||||||
|
|
||||||
#include "pickups\pballoon.h"
|
#include "pickups\pballoon.h"
|
||||||
|
|
||||||
|
#ifndef __LEVEL_LEVEL_H__
|
||||||
|
#include "level\level.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef __LAYER_COLLISION_H__
|
||||||
|
#include "layer\collision.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef __PRIM_HEADER__
|
||||||
|
#include "gfx\prim.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef __MATHTABLE_HEADER__
|
||||||
|
#include "utils\mathtab.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/* Std Lib
|
/* Std Lib
|
||||||
------- */
|
------- */
|
||||||
|
@ -49,6 +65,18 @@
|
||||||
Vars
|
Vars
|
||||||
---- */
|
---- */
|
||||||
|
|
||||||
|
/*----------------------------------------------------------------------
|
||||||
|
Function:
|
||||||
|
Purpose:
|
||||||
|
Params:
|
||||||
|
Returns:
|
||||||
|
---------------------------------------------------------------------- */
|
||||||
|
void CBalloonPickup::init()
|
||||||
|
{
|
||||||
|
CBaseRespawningPickup::init();
|
||||||
|
m_sin=0;
|
||||||
|
}
|
||||||
|
|
||||||
/*----------------------------------------------------------------------
|
/*----------------------------------------------------------------------
|
||||||
Function:
|
Function:
|
||||||
Purpose:
|
Purpose:
|
||||||
|
@ -57,7 +85,49 @@
|
||||||
---------------------------------------------------------------------- */
|
---------------------------------------------------------------------- */
|
||||||
void CBalloonPickup::collect(class CPlayer *_player)
|
void CBalloonPickup::collect(class CPlayer *_player)
|
||||||
{
|
{
|
||||||
CBasePickup::collect(_player);
|
CBaseRespawningPickup::collect(_player);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*----------------------------------------------------------------------
|
||||||
|
Function:
|
||||||
|
Purpose:
|
||||||
|
Params:
|
||||||
|
Returns:
|
||||||
|
---------------------------------------------------------------------- */
|
||||||
|
int balloon_height=30;
|
||||||
|
int balloon_r=180;
|
||||||
|
int balloon_g=180;
|
||||||
|
int balloon_b=180;
|
||||||
|
int balloon_speed=25;
|
||||||
|
int balloon_scale1=5;
|
||||||
|
int balloon_scale2=2;
|
||||||
|
int balloon_phase=1024;
|
||||||
|
int balloon_vissize=40;
|
||||||
|
int CBalloonPickup::getVisibilityRadius()
|
||||||
|
{
|
||||||
|
return balloon_vissize;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*----------------------------------------------------------------------
|
||||||
|
Function:
|
||||||
|
Purpose:
|
||||||
|
Params:
|
||||||
|
Returns:
|
||||||
|
---------------------------------------------------------------------- */
|
||||||
|
int CBalloonPickup::getRespawnTime()
|
||||||
|
{
|
||||||
|
return 60*10;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*----------------------------------------------------------------------
|
||||||
|
Function:
|
||||||
|
Purpose:
|
||||||
|
Params:
|
||||||
|
Returns:
|
||||||
|
---------------------------------------------------------------------- */
|
||||||
|
void CBalloonPickup::thinkPickup(int _frames)
|
||||||
|
{
|
||||||
|
m_sin=(m_sin+(_frames*balloon_speed))&4095;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*----------------------------------------------------------------------
|
/*----------------------------------------------------------------------
|
||||||
|
@ -70,13 +140,21 @@ void CBalloonPickup::renderPickup(DVECTOR *_pos)
|
||||||
{
|
{
|
||||||
SpriteBank *sprites;
|
SpriteBank *sprites;
|
||||||
sFrameHdr *fh;
|
sFrameHdr *fh;
|
||||||
|
int xo1,xo2;
|
||||||
int x,y;
|
int x,y;
|
||||||
|
|
||||||
sprites=getSpriteBank();
|
sprites=getSpriteBank();
|
||||||
fh=sprites->getFrameHeader(FRM__GLASSES);
|
fh=sprites->getFrameHeader(FRM__BALLOON);
|
||||||
|
|
||||||
|
xo1=((msin((m_sin+balloon_phase)&4095)*balloon_scale1)>>12);
|
||||||
|
xo2=((msin(m_sin)*balloon_scale2)>>12);
|
||||||
x=_pos->vx-(fh->W/2);
|
x=_pos->vx-(fh->W/2);
|
||||||
y=_pos->vy-(fh->H/2);
|
y=_pos->vy-(fh->H/2);
|
||||||
sprites->printFT4(fh,x,y,0,0,PICKUPS_OT_POS);
|
sprites->printFT4(fh,x+xo1,y,0,0,PICKUPS_OT_POS);
|
||||||
|
|
||||||
|
x=_pos->vx;
|
||||||
|
y=_pos->vy+(fh->H/2);
|
||||||
|
DrawLine(x+xo1,y,x+xo2,y+balloon_height,balloon_r,balloon_g,balloon_b,PICKUPS_OT_POS);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*===========================================================================
|
/*===========================================================================
|
||||||
|
|
|
@ -34,14 +34,23 @@
|
||||||
Structure defintions
|
Structure defintions
|
||||||
-------------------- */
|
-------------------- */
|
||||||
|
|
||||||
class CBalloonPickup : public CBasePickup
|
class CBalloonPickup : public CBaseRespawningPickup
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
virtual void init();
|
||||||
|
|
||||||
virtual void collect(class CPlayer *_player);
|
virtual void collect(class CPlayer *_player);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
virtual int getVisibilityRadius();
|
||||||
|
virtual int getRespawnTime();
|
||||||
|
|
||||||
|
virtual void thinkPickup(int _frames);
|
||||||
virtual void renderPickup(DVECTOR *_pos);
|
virtual void renderPickup(DVECTOR *_pos);
|
||||||
|
|
||||||
|
private:
|
||||||
|
int m_sin;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -76,6 +76,17 @@ void CBubbleMixturePickup::shutdown()
|
||||||
CBasePickup::shutdown();
|
CBasePickup::shutdown();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*----------------------------------------------------------------------
|
||||||
|
Function:
|
||||||
|
Purpose:
|
||||||
|
Params:
|
||||||
|
Returns:
|
||||||
|
---------------------------------------------------------------------- */
|
||||||
|
void CBubbleMixturePickup::collect(class CPlayer *_player)
|
||||||
|
{
|
||||||
|
CBasePickup::collect(_player);
|
||||||
|
}
|
||||||
|
|
||||||
/*----------------------------------------------------------------------
|
/*----------------------------------------------------------------------
|
||||||
Function:
|
Function:
|
||||||
Purpose:
|
Purpose:
|
||||||
|
@ -84,9 +95,8 @@ void CBubbleMixturePickup::shutdown()
|
||||||
---------------------------------------------------------------------- */
|
---------------------------------------------------------------------- */
|
||||||
int bubmix_bobspeed=10;
|
int bubmix_bobspeed=10;
|
||||||
int bubmix_bobscale=3;
|
int bubmix_bobscale=3;
|
||||||
void CBubbleMixturePickup::think(int _frames)
|
void CBubbleMixturePickup::thinkPickup(int _frames)
|
||||||
{
|
{
|
||||||
CBasePickup::think(_frames);
|
|
||||||
m_sin=(m_sin+(_frames*bubmix_bobspeed))&4095;
|
m_sin=(m_sin+(_frames*bubmix_bobspeed))&4095;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -96,32 +106,17 @@ void CBubbleMixturePickup::think(int _frames)
|
||||||
Params:
|
Params:
|
||||||
Returns:
|
Returns:
|
||||||
---------------------------------------------------------------------- */
|
---------------------------------------------------------------------- */
|
||||||
void CBubbleMixturePickup::render()
|
void CBubbleMixturePickup::renderPickup(DVECTOR *_pos)
|
||||||
{
|
{
|
||||||
DVECTOR ofs;
|
|
||||||
SpriteBank *sprites;
|
SpriteBank *sprites;
|
||||||
sFrameHdr *fh;
|
sFrameHdr *fh;
|
||||||
int x,y;
|
int x,y;
|
||||||
|
|
||||||
ofs=getRenderOffset();
|
|
||||||
sprites=getSpriteBank();
|
sprites=getSpriteBank();
|
||||||
fh=sprites->getFrameHeader(FRM__BUBBLEMIXTURE);
|
fh=sprites->getFrameHeader(FRM__BUBBLEMIXTURE);
|
||||||
x=Pos.vx-ofs.vx-(fh->W/2);
|
x=_pos->vx-(fh->W/2);
|
||||||
y=Pos.vy-ofs.vy-(fh->H/2)+((msin(m_sin)*bubmix_bobscale)>>12);
|
y=_pos->vy-(fh->H/2)+((msin(m_sin)*bubmix_bobscale)>>12);
|
||||||
sprites->printFT4(fh,x,y,0,0,PICKUPS_OT_POS);
|
sprites->printFT4(fh,x,y,0,0,PICKUPS_OT_POS);
|
||||||
|
|
||||||
CBasePickup::render();
|
|
||||||
}
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------
|
|
||||||
Function:
|
|
||||||
Purpose:
|
|
||||||
Params:
|
|
||||||
Returns:
|
|
||||||
---------------------------------------------------------------------- */
|
|
||||||
void CBubbleMixturePickup::collect(class CPlayer *_player)
|
|
||||||
{
|
|
||||||
CBasePickup::collect(_player);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*===========================================================================
|
/*===========================================================================
|
||||||
|
|
|
@ -39,13 +39,16 @@ class CBubbleMixturePickup : public CBasePickup
|
||||||
public:
|
public:
|
||||||
virtual void init();
|
virtual void init();
|
||||||
virtual void shutdown();
|
virtual void shutdown();
|
||||||
virtual void think(int _frames);
|
|
||||||
virtual void render();
|
|
||||||
|
|
||||||
virtual void collect(class CPlayer *_player);
|
virtual void collect(class CPlayer *_player);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual void thinkPickup(int _frames);
|
||||||
|
virtual void renderPickup(DVECTOR *_pos);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int m_sin;
|
int m_sin;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -55,21 +55,9 @@
|
||||||
Params:
|
Params:
|
||||||
Returns:
|
Returns:
|
||||||
---------------------------------------------------------------------- */
|
---------------------------------------------------------------------- */
|
||||||
void CGlassesPickup::render()
|
void CGlassesPickup::collect(class CPlayer *_player)
|
||||||
{
|
{
|
||||||
DVECTOR ofs;
|
CBasePickup::collect(_player);
|
||||||
SpriteBank *sprites;
|
|
||||||
sFrameHdr *fh;
|
|
||||||
int x,y;
|
|
||||||
|
|
||||||
ofs=getRenderOffset();
|
|
||||||
sprites=getSpriteBank();
|
|
||||||
fh=sprites->getFrameHeader(FRM__GLASSES);
|
|
||||||
x=Pos.vx-ofs.vx-(fh->W/2);
|
|
||||||
y=Pos.vy-ofs.vy-(fh->H/2);
|
|
||||||
sprites->printFT4(fh,x,y,0,0,PICKUPS_OT_POS);
|
|
||||||
|
|
||||||
CBasePickup::render();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*----------------------------------------------------------------------
|
/*----------------------------------------------------------------------
|
||||||
|
@ -78,9 +66,17 @@ void CGlassesPickup::render()
|
||||||
Params:
|
Params:
|
||||||
Returns:
|
Returns:
|
||||||
---------------------------------------------------------------------- */
|
---------------------------------------------------------------------- */
|
||||||
void CGlassesPickup::collect(class CPlayer *_player)
|
void CGlassesPickup::renderPickup(DVECTOR *_pos)
|
||||||
{
|
{
|
||||||
CBasePickup::collect(_player);
|
SpriteBank *sprites;
|
||||||
|
sFrameHdr *fh;
|
||||||
|
int x,y;
|
||||||
|
|
||||||
|
sprites=getSpriteBank();
|
||||||
|
fh=sprites->getFrameHeader(FRM__GLASSES);
|
||||||
|
x=_pos->vx-(fh->W/2);
|
||||||
|
y=_pos->vy-(fh->H/2);
|
||||||
|
sprites->printFT4(fh,x,y,0,0,PICKUPS_OT_POS);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*===========================================================================
|
/*===========================================================================
|
||||||
|
|
|
@ -37,10 +37,11 @@
|
||||||
class CGlassesPickup : public CBasePickup
|
class CGlassesPickup : public CBasePickup
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual void render();
|
|
||||||
|
|
||||||
virtual void collect(class CPlayer *_player);
|
virtual void collect(class CPlayer *_player);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual void renderPickup(DVECTOR *_pos);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -76,6 +76,17 @@ void CBaseHealthPickup::shutdown()
|
||||||
CBasePickup::shutdown();
|
CBasePickup::shutdown();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*----------------------------------------------------------------------
|
||||||
|
Function:
|
||||||
|
Purpose:
|
||||||
|
Params:
|
||||||
|
Returns:
|
||||||
|
---------------------------------------------------------------------- */
|
||||||
|
void CBaseHealthPickup::collect(class CPlayer *_player)
|
||||||
|
{
|
||||||
|
CBasePickup::collect(_player);
|
||||||
|
}
|
||||||
|
|
||||||
/*----------------------------------------------------------------------
|
/*----------------------------------------------------------------------
|
||||||
Function:
|
Function:
|
||||||
Purpose:
|
Purpose:
|
||||||
|
@ -84,9 +95,8 @@ void CBaseHealthPickup::shutdown()
|
||||||
---------------------------------------------------------------------- */
|
---------------------------------------------------------------------- */
|
||||||
int health_rotatespeed=200;
|
int health_rotatespeed=200;
|
||||||
int health_rotatescale=200;
|
int health_rotatescale=200;
|
||||||
void CBaseHealthPickup::think(int _frames)
|
void CBaseHealthPickup::thinkPickup(int _frames)
|
||||||
{
|
{
|
||||||
CBasePickup::think(_frames);
|
|
||||||
m_sin=(m_sin+(_frames*health_rotatespeed))&4095;
|
m_sin=(m_sin+(_frames*health_rotatespeed))&4095;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -96,34 +106,16 @@ void CBaseHealthPickup::think(int _frames)
|
||||||
Params:
|
Params:
|
||||||
Returns:
|
Returns:
|
||||||
---------------------------------------------------------------------- */
|
---------------------------------------------------------------------- */
|
||||||
void CBaseHealthPickup::render()
|
void CBaseHealthPickup::renderPickup(DVECTOR *_pos)
|
||||||
{
|
{
|
||||||
DVECTOR ofs;
|
|
||||||
SpriteBank *sprites;
|
SpriteBank *sprites;
|
||||||
sFrameHdr *fh;
|
sFrameHdr *fh;
|
||||||
int x,y;
|
|
||||||
int angle;
|
int angle;
|
||||||
|
|
||||||
ofs=getRenderOffset();
|
|
||||||
sprites=getSpriteBank();
|
sprites=getSpriteBank();
|
||||||
fh=sprites->getFrameHeader(getFrameNumber());
|
fh=sprites->getFrameHeader(getFrameNumber());
|
||||||
x=Pos.vx-ofs.vx;
|
|
||||||
y=Pos.vy-ofs.vy;
|
|
||||||
angle=((msin(m_sin)*health_rotatescale)>>12)&4095;
|
angle=((msin(m_sin)*health_rotatescale)>>12)&4095;
|
||||||
sprites->printRotatedScaledSprite(fh,x,y,4096,4096,angle,PICKUPS_OT_POS);
|
sprites->printRotatedScaledSprite(fh,_pos->vx,_pos->vy,4096,4096,angle,PICKUPS_OT_POS);
|
||||||
|
|
||||||
CBasePickup::render();
|
|
||||||
}
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------
|
|
||||||
Function:
|
|
||||||
Purpose:
|
|
||||||
Params:
|
|
||||||
Returns:
|
|
||||||
---------------------------------------------------------------------- */
|
|
||||||
void CBaseHealthPickup::collect(class CPlayer *_player)
|
|
||||||
{
|
|
||||||
CBasePickup::collect(_player);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -39,12 +39,13 @@ class CBaseHealthPickup : public CBasePickup
|
||||||
public:
|
public:
|
||||||
virtual void init();
|
virtual void init();
|
||||||
virtual void shutdown();
|
virtual void shutdown();
|
||||||
virtual void think(int _frames);
|
|
||||||
virtual void render();
|
|
||||||
|
|
||||||
virtual void collect(class CPlayer *_player);
|
virtual void collect(class CPlayer *_player);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
virtual void thinkPickup(int _frames);
|
||||||
|
virtual void renderPickup(DVECTOR *_pos);
|
||||||
|
|
||||||
virtual int getHealthPoints()=0;
|
virtual int getHealthPoints()=0;
|
||||||
virtual int getFrameNumber()=0;
|
virtual int getFrameNumber()=0;
|
||||||
|
|
||||||
|
|
|
@ -55,7 +55,7 @@
|
||||||
Params:
|
Params:
|
||||||
Returns:
|
Returns:
|
||||||
---------------------------------------------------------------------- */
|
---------------------------------------------------------------------- */
|
||||||
void CGlassesPickup::collect(class CPlayer *_player)
|
void CHelmetPickup::collect(class CPlayer *_player)
|
||||||
{
|
{
|
||||||
CBasePickup::collect(_player);
|
CBasePickup::collect(_player);
|
||||||
}
|
}
|
||||||
|
@ -66,7 +66,7 @@ void CGlassesPickup::collect(class CPlayer *_player)
|
||||||
Params:
|
Params:
|
||||||
Returns:
|
Returns:
|
||||||
---------------------------------------------------------------------- */
|
---------------------------------------------------------------------- */
|
||||||
void CGlassesPickup::renderPickup(DVECTOR *_pos)
|
void CHelmetPickup::renderPickup(DVECTOR *_pos)
|
||||||
{
|
{
|
||||||
SpriteBank *sprites;
|
SpriteBank *sprites;
|
||||||
sFrameHdr *fh;
|
sFrameHdr *fh;
|
||||||
|
|
|
@ -55,6 +55,14 @@
|
||||||
#include "pickups\pshoes.h"
|
#include "pickups\pshoes.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef __PICKUPS_PBALLOON_H__
|
||||||
|
#include "pickups\pballoon.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef __PICKUPS_PHELMET_H__
|
||||||
|
#include "pickups\phelmet.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef __PICKUPS_PQUEST_H__
|
#ifndef __PICKUPS_PQUEST_H__
|
||||||
#include "pickups\pquest.h"
|
#include "pickups\pquest.h"
|
||||||
#endif
|
#endif
|
||||||
|
@ -119,9 +127,16 @@ void CBasePickup::shutdown()
|
||||||
Params:
|
Params:
|
||||||
Returns:
|
Returns:
|
||||||
---------------------------------------------------------------------- */
|
---------------------------------------------------------------------- */
|
||||||
|
#include "pad\pads.h"
|
||||||
void CBasePickup::think(int _frames)
|
void CBasePickup::think(int _frames)
|
||||||
{
|
{
|
||||||
CThing::think(_frames);
|
CThing::think(_frames);
|
||||||
|
thinkPickup(_frames);
|
||||||
|
|
||||||
|
if(PadGetDown(0)&PAD_L2)
|
||||||
|
{
|
||||||
|
collect(NULL);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*----------------------------------------------------------------------
|
/*----------------------------------------------------------------------
|
||||||
|
@ -132,6 +147,20 @@ void CBasePickup::think(int _frames)
|
||||||
---------------------------------------------------------------------- */
|
---------------------------------------------------------------------- */
|
||||||
void CBasePickup::render()
|
void CBasePickup::render()
|
||||||
{
|
{
|
||||||
|
DVECTOR ofs,pos;
|
||||||
|
int visibilityRadius;
|
||||||
|
|
||||||
|
CThing::render();
|
||||||
|
|
||||||
|
ofs=CLevel::getCameraPos();
|
||||||
|
pos.vx=Pos.vx-ofs.vx;
|
||||||
|
pos.vy=Pos.vy-ofs.vy;
|
||||||
|
visibilityRadius=getVisibilityRadius();
|
||||||
|
if(pos.vx>0-visibilityRadius&&pos.vx<512+visibilityRadius&&
|
||||||
|
pos.vy>0-visibilityRadius&&pos.vy<256+visibilityRadius)
|
||||||
|
{
|
||||||
|
renderPickup(&pos);
|
||||||
|
}
|
||||||
/*
|
/*
|
||||||
DVECTOR ofs;
|
DVECTOR ofs;
|
||||||
int x,y;
|
int x,y;
|
||||||
|
@ -167,15 +196,67 @@ void CBasePickup::collect(class CPlayer *_player)
|
||||||
delete this;
|
delete this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------
|
/*----------------------------------------------------------------------
|
||||||
Function:
|
Function:
|
||||||
Purpose:
|
Purpose:
|
||||||
Params:
|
Params:
|
||||||
Returns:
|
Returns:
|
||||||
---------------------------------------------------------------------- */
|
---------------------------------------------------------------------- */
|
||||||
DVECTOR CBasePickup::getRenderOffset()
|
void CBaseRespawningPickup::init()
|
||||||
{
|
{
|
||||||
return CLevel::getCameraPos();
|
CBasePickup::init();
|
||||||
|
m_respawnTime=0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*----------------------------------------------------------------------
|
||||||
|
Function:
|
||||||
|
Purpose:
|
||||||
|
Params:
|
||||||
|
Returns:
|
||||||
|
---------------------------------------------------------------------- */
|
||||||
|
void CBaseRespawningPickup::think(int _frames)
|
||||||
|
{
|
||||||
|
if(m_respawnTime==0)
|
||||||
|
{
|
||||||
|
CBasePickup::think(_frames);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_respawnTime-=_frames;
|
||||||
|
if(m_respawnTime<0)
|
||||||
|
{
|
||||||
|
m_respawnTime=0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*----------------------------------------------------------------------
|
||||||
|
Function:
|
||||||
|
Purpose:
|
||||||
|
Params:
|
||||||
|
Returns:
|
||||||
|
---------------------------------------------------------------------- */
|
||||||
|
void CBaseRespawningPickup::render()
|
||||||
|
{
|
||||||
|
if(m_respawnTime==0||
|
||||||
|
m_respawnTime<50&&!(m_respawnTime&3))
|
||||||
|
{
|
||||||
|
CBasePickup::render();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*----------------------------------------------------------------------
|
||||||
|
Function:
|
||||||
|
Purpose:
|
||||||
|
Params:
|
||||||
|
Returns:
|
||||||
|
---------------------------------------------------------------------- */
|
||||||
|
void CBaseRespawningPickup::collect(class CPlayer *_player)
|
||||||
|
{
|
||||||
|
m_respawnTime=getRespawnTime();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -227,13 +308,21 @@ CBasePickup *createPickup(const PICKUP_TYPE _type,const DVECTOR *_pos)
|
||||||
pickup=new ("ShoesPickup") CShoesPickup();
|
pickup=new ("ShoesPickup") CShoesPickup();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case PICKUP__BALLOON:
|
||||||
|
pickup=new ("BalloonPickup") CBalloonPickup();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case PICKUP__HELMET:
|
||||||
|
pickup=new ("HelmetPickup") CHelmetPickup();
|
||||||
|
break;
|
||||||
|
|
||||||
case PICKUP__QUEST_ITEM__TEST:
|
case PICKUP__QUEST_ITEM__TEST:
|
||||||
pickup=new ("QuestItemPickup") CTestQuestItemPickup();
|
pickup=new ("QuestItemPickup") CTestQuestItemPickup();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
ASSERT(!"UNKNOWN PICKUP TYPE");
|
ASSERT(!"UNKNOWN PICKUP TYPE");
|
||||||
pickup=new ("Pickup") CBasePickup();
|
pickup=NULL;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -41,6 +41,8 @@ typedef enum
|
||||||
PICKUP__BUBBLE_MIXTURE,
|
PICKUP__BUBBLE_MIXTURE,
|
||||||
PICKUP__GLASSES,
|
PICKUP__GLASSES,
|
||||||
PICKUP__SQUEAKY_SHOES,
|
PICKUP__SQUEAKY_SHOES,
|
||||||
|
PICKUP__BALLOON,
|
||||||
|
PICKUP__HELMET,
|
||||||
PICKUP__QUEST_ITEM__TEST, // Needs to be one of these for each quest item ( I think )
|
PICKUP__QUEST_ITEM__TEST, // Needs to be one of these for each quest item ( I think )
|
||||||
}
|
}
|
||||||
PICKUP_TYPE;
|
PICKUP_TYPE;
|
||||||
|
@ -65,10 +67,14 @@ protected:
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
PICKUPS_OT_POS=15,
|
PICKUPS_OT_POS=15,
|
||||||
|
DEFAULT_VISIBILITY_RADIUS=32,
|
||||||
};
|
};
|
||||||
|
|
||||||
class SpriteBank *getSpriteBank() {return m_spriteBank;}
|
class SpriteBank *getSpriteBank() {return m_spriteBank;}
|
||||||
DVECTOR getRenderOffset();
|
virtual int getVisibilityRadius() {return DEFAULT_VISIBILITY_RADIUS;}
|
||||||
|
|
||||||
|
virtual void thinkPickup(int _Frames) {;}
|
||||||
|
virtual void renderPickup(DVECTOR *_pos)=0;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
class SpriteBank *m_spriteBank;
|
class SpriteBank *m_spriteBank;
|
||||||
|
@ -76,6 +82,23 @@ private:
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
class CBaseRespawningPickup : public CBasePickup
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
virtual void init();
|
||||||
|
virtual void think(int _frames);
|
||||||
|
virtual void render();
|
||||||
|
|
||||||
|
virtual void collect(class CPlayer *_player);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual int getRespawnTime()=0;
|
||||||
|
|
||||||
|
private:
|
||||||
|
int m_respawnTime;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
/*----------------------------------------------------------------------
|
/*----------------------------------------------------------------------
|
||||||
Globals
|
Globals
|
||||||
------- */
|
------- */
|
||||||
|
|
|
@ -76,6 +76,17 @@ void CJellyLauncherAmmoPickup::shutdown()
|
||||||
CBasePickup::shutdown();
|
CBasePickup::shutdown();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*----------------------------------------------------------------------
|
||||||
|
Function:
|
||||||
|
Purpose:
|
||||||
|
Params:
|
||||||
|
Returns:
|
||||||
|
---------------------------------------------------------------------- */
|
||||||
|
void CJellyLauncherAmmoPickup::collect(class CPlayer *_player)
|
||||||
|
{
|
||||||
|
CBasePickup::collect(_player);
|
||||||
|
}
|
||||||
|
|
||||||
/*----------------------------------------------------------------------
|
/*----------------------------------------------------------------------
|
||||||
Function:
|
Function:
|
||||||
Purpose:
|
Purpose:
|
||||||
|
@ -86,9 +97,8 @@ int jlammo_rattlespeed=500;
|
||||||
int jlammo_rattlescale=90;
|
int jlammo_rattlescale=90;
|
||||||
int jlammo_rattlecount=5;
|
int jlammo_rattlecount=5;
|
||||||
int jlammo_waitcount=10;
|
int jlammo_waitcount=10;
|
||||||
void CJellyLauncherAmmoPickup::think(int _frames)
|
void CJellyLauncherAmmoPickup::thinkPickup(int _frames)
|
||||||
{
|
{
|
||||||
CBasePickup::think(_frames);
|
|
||||||
m_rattle+=jlammo_rattlespeed*_frames;
|
m_rattle+=jlammo_rattlespeed*_frames;
|
||||||
if(m_rattle>(jlammo_rattlecount+jlammo_waitcount)*4095)m_rattle=0;
|
if(m_rattle>(jlammo_rattlecount+jlammo_waitcount)*4095)m_rattle=0;
|
||||||
}
|
}
|
||||||
|
@ -99,19 +109,14 @@ void CJellyLauncherAmmoPickup::think(int _frames)
|
||||||
Params:
|
Params:
|
||||||
Returns:
|
Returns:
|
||||||
---------------------------------------------------------------------- */
|
---------------------------------------------------------------------- */
|
||||||
void CJellyLauncherAmmoPickup::render()
|
void CJellyLauncherAmmoPickup::renderPickup(DVECTOR *_pos)
|
||||||
{
|
{
|
||||||
DVECTOR ofs;
|
|
||||||
SpriteBank *sprites;
|
SpriteBank *sprites;
|
||||||
sFrameHdr *fh;
|
sFrameHdr *fh;
|
||||||
int x,y;
|
|
||||||
int angle;
|
int angle;
|
||||||
|
|
||||||
ofs=getRenderOffset();
|
|
||||||
sprites=getSpriteBank();
|
sprites=getSpriteBank();
|
||||||
fh=sprites->getFrameHeader(FRM__JELLYAMMO);
|
fh=sprites->getFrameHeader(FRM__JELLYAMMO);
|
||||||
x=Pos.vx-ofs.vx;
|
|
||||||
y=Pos.vy-ofs.vy;
|
|
||||||
if(m_rattle<=jlammo_rattlecount*4095)
|
if(m_rattle<=jlammo_rattlecount*4095)
|
||||||
{
|
{
|
||||||
angle=((msin(m_rattle&4095)*jlammo_rattlescale)>>12)&4095;
|
angle=((msin(m_rattle&4095)*jlammo_rattlescale)>>12)&4095;
|
||||||
|
@ -120,20 +125,7 @@ void CJellyLauncherAmmoPickup::render()
|
||||||
{
|
{
|
||||||
angle=0;
|
angle=0;
|
||||||
}
|
}
|
||||||
sprites->printRotatedScaledSprite(fh,x,y,4096,4096,angle,PICKUPS_OT_POS);
|
sprites->printRotatedScaledSprite(fh,_pos->vx,_pos->vy,4096,4096,angle,PICKUPS_OT_POS);
|
||||||
|
|
||||||
CBasePickup::render();
|
|
||||||
}
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------
|
|
||||||
Function:
|
|
||||||
Purpose:
|
|
||||||
Params:
|
|
||||||
Returns:
|
|
||||||
---------------------------------------------------------------------- */
|
|
||||||
void CJellyLauncherAmmoPickup::collect(class CPlayer *_player)
|
|
||||||
{
|
|
||||||
CBasePickup::collect(_player);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*===========================================================================
|
/*===========================================================================
|
||||||
|
|
|
@ -39,11 +39,13 @@ class CJellyLauncherAmmoPickup : public CBasePickup
|
||||||
public:
|
public:
|
||||||
virtual void init();
|
virtual void init();
|
||||||
virtual void shutdown();
|
virtual void shutdown();
|
||||||
virtual void think(int _frames);
|
|
||||||
virtual void render();
|
|
||||||
|
|
||||||
virtual void collect(class CPlayer *_player);
|
virtual void collect(class CPlayer *_player);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual void thinkPickup(int _frames);
|
||||||
|
virtual void renderPickup(DVECTOR *_pos);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int m_rattle;
|
int m_rattle;
|
||||||
};
|
};
|
||||||
|
|
|
@ -76,6 +76,17 @@ void CLifePickup::shutdown()
|
||||||
CBasePickup::shutdown();
|
CBasePickup::shutdown();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*----------------------------------------------------------------------
|
||||||
|
Function:
|
||||||
|
Purpose:
|
||||||
|
Params:
|
||||||
|
Returns:
|
||||||
|
---------------------------------------------------------------------- */
|
||||||
|
void CLifePickup::collect(class CPlayer *_player)
|
||||||
|
{
|
||||||
|
CBasePickup::collect(_player);
|
||||||
|
}
|
||||||
|
|
||||||
/*----------------------------------------------------------------------
|
/*----------------------------------------------------------------------
|
||||||
Function:
|
Function:
|
||||||
Purpose:
|
Purpose:
|
||||||
|
@ -84,9 +95,8 @@ void CLifePickup::shutdown()
|
||||||
---------------------------------------------------------------------- */
|
---------------------------------------------------------------------- */
|
||||||
int life_pulsespeed=205;
|
int life_pulsespeed=205;
|
||||||
int life_pulsescale=75;
|
int life_pulsescale=75;
|
||||||
void CLifePickup::think(int _frames)
|
void CLifePickup::thinkPickup(int _frames)
|
||||||
{
|
{
|
||||||
CBasePickup::think(_frames);
|
|
||||||
m_sin=(m_sin+(_frames*life_pulsespeed))&4095;
|
m_sin=(m_sin+(_frames*life_pulsespeed))&4095;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -96,34 +106,19 @@ void CLifePickup::think(int _frames)
|
||||||
Params:
|
Params:
|
||||||
Returns:
|
Returns:
|
||||||
---------------------------------------------------------------------- */
|
---------------------------------------------------------------------- */
|
||||||
void CLifePickup::render()
|
void CLifePickup::renderPickup(DVECTOR *_pos)
|
||||||
{
|
{
|
||||||
DVECTOR ofs;
|
|
||||||
SpriteBank *sprites;
|
SpriteBank *sprites;
|
||||||
sFrameHdr *fh;
|
sFrameHdr *fh;
|
||||||
int x,y;
|
int x,y;
|
||||||
int size;
|
int size;
|
||||||
|
|
||||||
ofs=getRenderOffset();
|
|
||||||
sprites=getSpriteBank();
|
sprites=getSpriteBank();
|
||||||
fh=sprites->getFrameHeader(FRM__PANTS);
|
fh=sprites->getFrameHeader(FRM__PANTS);
|
||||||
x=Pos.vx-ofs.vx-(fh->W/2);
|
x=_pos->vx-(fh->W/2);
|
||||||
y=Pos.vy-ofs.vy-(fh->H/2);
|
y=_pos->vy-(fh->H/2);
|
||||||
size=256+((msin(m_sin)*life_pulsescale)>>12);
|
size=256+((msin(m_sin)*life_pulsescale)>>12);
|
||||||
sprites->printFT4Scaled(fh,x,y,0,0,PICKUPS_OT_POS,size);
|
sprites->printFT4Scaled(fh,x,y,0,0,PICKUPS_OT_POS,size);
|
||||||
|
|
||||||
CBasePickup::render();
|
|
||||||
}
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------
|
|
||||||
Function:
|
|
||||||
Purpose:
|
|
||||||
Params:
|
|
||||||
Returns:
|
|
||||||
---------------------------------------------------------------------- */
|
|
||||||
void CLifePickup::collect(class CPlayer *_player)
|
|
||||||
{
|
|
||||||
CBasePickup::collect(_player);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*===========================================================================
|
/*===========================================================================
|
||||||
|
|
|
@ -39,11 +39,13 @@ class CLifePickup : public CBasePickup
|
||||||
public:
|
public:
|
||||||
virtual void init();
|
virtual void init();
|
||||||
virtual void shutdown();
|
virtual void shutdown();
|
||||||
virtual void think(int _frames);
|
|
||||||
virtual void render();
|
|
||||||
|
|
||||||
virtual void collect(class CPlayer *_player);
|
virtual void collect(class CPlayer *_player);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual void thinkPickup(int _frames);
|
||||||
|
virtual void renderPickup(DVECTOR *_pos);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int m_sin;
|
int m_sin;
|
||||||
|
|
||||||
|
|
|
@ -86,6 +86,11 @@ void CBaseQuestItemPickup::shutdown()
|
||||||
Params:
|
Params:
|
||||||
Returns:
|
Returns:
|
||||||
---------------------------------------------------------------------- */
|
---------------------------------------------------------------------- */
|
||||||
|
void CBaseQuestItemPickup::collect(class CPlayer *_player)
|
||||||
|
{
|
||||||
|
CBasePickup::collect(_player);
|
||||||
|
}
|
||||||
|
|
||||||
int quest_pingframes=50;
|
int quest_pingframes=50;
|
||||||
int quest_pingwaitframes=100;
|
int quest_pingwaitframes=100;
|
||||||
int quest_pingsize=100;
|
int quest_pingsize=100;
|
||||||
|
@ -94,9 +99,25 @@ int quest_pingg=255;
|
||||||
int quest_pingb=0;
|
int quest_pingb=0;
|
||||||
int quest_pingsegments=16;
|
int quest_pingsegments=16;
|
||||||
int quest_transmode=1;
|
int quest_transmode=1;
|
||||||
void CBaseQuestItemPickup::think(int _frames)
|
/*----------------------------------------------------------------------
|
||||||
|
Function:
|
||||||
|
Purpose:
|
||||||
|
Params:
|
||||||
|
Returns:
|
||||||
|
---------------------------------------------------------------------- */
|
||||||
|
int CBaseQuestItemPickup::getVisibilityRadius()
|
||||||
|
{
|
||||||
|
return quest_pingsize;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*----------------------------------------------------------------------
|
||||||
|
Function:
|
||||||
|
Purpose:
|
||||||
|
Params:
|
||||||
|
Returns:
|
||||||
|
---------------------------------------------------------------------- */
|
||||||
|
void CBaseQuestItemPickup::thinkPickup(int _frames)
|
||||||
{
|
{
|
||||||
CBasePickup::think(_frames);
|
|
||||||
m_pingFrame+=_frames;
|
m_pingFrame+=_frames;
|
||||||
if(m_pingFrame>(quest_pingframes+quest_pingwaitframes))
|
if(m_pingFrame>(quest_pingframes+quest_pingwaitframes))
|
||||||
{
|
{
|
||||||
|
@ -111,18 +132,16 @@ void CBaseQuestItemPickup::think(int _frames)
|
||||||
Params:
|
Params:
|
||||||
Returns:
|
Returns:
|
||||||
---------------------------------------------------------------------- */
|
---------------------------------------------------------------------- */
|
||||||
void CBaseQuestItemPickup::render()
|
void CBaseQuestItemPickup::renderPickup(DVECTOR *_pos)
|
||||||
{
|
{
|
||||||
DVECTOR ofs;
|
|
||||||
SpriteBank *sprites;
|
SpriteBank *sprites;
|
||||||
sFrameHdr *fh;
|
sFrameHdr *fh;
|
||||||
int x,y;
|
int x,y;
|
||||||
|
|
||||||
ofs=getRenderOffset();
|
|
||||||
sprites=getSpriteBank();
|
sprites=getSpriteBank();
|
||||||
fh=sprites->getFrameHeader(getFrameNumber());
|
fh=sprites->getFrameHeader(getFrameNumber());
|
||||||
x=Pos.vx-ofs.vx-(fh->W/2);
|
x=_pos->vx-(fh->W/2);
|
||||||
y=Pos.vy-ofs.vy-(fh->H/2);
|
y=_pos->vy-(fh->H/2);
|
||||||
sprites->printFT4(fh,x,y,0,0,PICKUPS_OT_POS);
|
sprites->printFT4(fh,x,y,0,0,PICKUPS_OT_POS);
|
||||||
|
|
||||||
if(m_pingFrame<quest_pingframes)
|
if(m_pingFrame<quest_pingframes)
|
||||||
|
@ -135,8 +154,8 @@ void CBaseQuestItemPickup::render()
|
||||||
POLY_G3 *g3;
|
POLY_G3 *g3;
|
||||||
POLY_FT3 *ft3;
|
POLY_FT3 *ft3;
|
||||||
|
|
||||||
x=Pos.vx-ofs.vx;
|
x=_pos->vx;
|
||||||
y=Pos.vy-ofs.vy;
|
y=_pos->vy;
|
||||||
radius=(quest_pingsize*m_pingFrame)/quest_pingframes;
|
radius=(quest_pingsize*m_pingFrame)/quest_pingframes;
|
||||||
endr=(quest_pingr*(quest_pingframes-m_pingFrame))/quest_pingframes;
|
endr=(quest_pingr*(quest_pingframes-m_pingFrame))/quest_pingframes;
|
||||||
endg=(quest_pingg*(quest_pingframes-m_pingFrame))/quest_pingframes;
|
endg=(quest_pingg*(quest_pingframes-m_pingFrame))/quest_pingframes;
|
||||||
|
@ -167,21 +186,7 @@ void CBaseQuestItemPickup::render()
|
||||||
ft3->tpage=(quest_transmode<<5);
|
ft3->tpage=(quest_transmode<<5);
|
||||||
setXY3(ft3,512,512,512,512,512,512);
|
setXY3(ft3,512,512,512,512,512,512);
|
||||||
AddPrimToList(ft3,PICKUPS_OT_POS+1);
|
AddPrimToList(ft3,PICKUPS_OT_POS+1);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
CBasePickup::render();
|
|
||||||
}
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------
|
|
||||||
Function:
|
|
||||||
Purpose:
|
|
||||||
Params:
|
|
||||||
Returns:
|
|
||||||
---------------------------------------------------------------------- */
|
|
||||||
void CBaseQuestItemPickup::collect(class CPlayer *_player)
|
|
||||||
{
|
|
||||||
CBasePickup::collect(_player);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -39,12 +39,15 @@ class CBaseQuestItemPickup : public CBasePickup
|
||||||
public:
|
public:
|
||||||
virtual void init();
|
virtual void init();
|
||||||
virtual void shutdown();
|
virtual void shutdown();
|
||||||
virtual void think(int _frames);
|
|
||||||
virtual void render();
|
|
||||||
|
|
||||||
virtual void collect(class CPlayer *_player);
|
virtual void collect(class CPlayer *_player);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
virtual int getVisibilityRadius();
|
||||||
|
|
||||||
|
virtual void thinkPickup(int _frames);
|
||||||
|
virtual void renderPickup(DVECTOR *_pos);
|
||||||
|
|
||||||
virtual int getFrameNumber()=0;
|
virtual int getFrameNumber()=0;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -76,6 +76,17 @@ void CShoesPickup::shutdown()
|
||||||
CBasePickup::shutdown();
|
CBasePickup::shutdown();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*----------------------------------------------------------------------
|
||||||
|
Function:
|
||||||
|
Purpose:
|
||||||
|
Params:
|
||||||
|
Returns:
|
||||||
|
---------------------------------------------------------------------- */
|
||||||
|
void CShoesPickup::collect(class CPlayer *_player)
|
||||||
|
{
|
||||||
|
CBasePickup::collect(_player);
|
||||||
|
}
|
||||||
|
|
||||||
/*----------------------------------------------------------------------
|
/*----------------------------------------------------------------------
|
||||||
Function:
|
Function:
|
||||||
Purpose:
|
Purpose:
|
||||||
|
@ -85,9 +96,8 @@ void CShoesPickup::shutdown()
|
||||||
int shoes_bobspeed=100;
|
int shoes_bobspeed=100;
|
||||||
int shoes_bobscale=2;
|
int shoes_bobscale=2;
|
||||||
int shoes_seperation=4;
|
int shoes_seperation=4;
|
||||||
void CShoesPickup::think(int _frames)
|
void CShoesPickup::thinkPickup(int _frames)
|
||||||
{
|
{
|
||||||
CBasePickup::think(_frames);
|
|
||||||
m_sin=(m_sin+(_frames*shoes_bobspeed))&4095;
|
m_sin=(m_sin+(_frames*shoes_bobspeed))&4095;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -97,34 +107,19 @@ void CShoesPickup::think(int _frames)
|
||||||
Params:
|
Params:
|
||||||
Returns:
|
Returns:
|
||||||
---------------------------------------------------------------------- */
|
---------------------------------------------------------------------- */
|
||||||
void CShoesPickup::render()
|
void CShoesPickup::renderPickup(DVECTOR *_pos)
|
||||||
{
|
{
|
||||||
DVECTOR ofs;
|
|
||||||
SpriteBank *sprites;
|
SpriteBank *sprites;
|
||||||
sFrameHdr *fh;
|
sFrameHdr *fh;
|
||||||
int x,y,yoff;
|
int x,y,yoff;
|
||||||
|
|
||||||
ofs=getRenderOffset();
|
|
||||||
sprites=getSpriteBank();
|
sprites=getSpriteBank();
|
||||||
fh=sprites->getFrameHeader(FRM__SHOE);
|
fh=sprites->getFrameHeader(FRM__SHOE);
|
||||||
x=Pos.vx-ofs.vx-(fh->W/2);
|
x=_pos->vx-(fh->W/2);
|
||||||
y=Pos.vy-ofs.vy-(fh->H/2);
|
y=_pos->vy-(fh->H/2);
|
||||||
yoff=((msin(m_sin)*shoes_bobscale)>>12);
|
yoff=((msin(m_sin)*shoes_bobscale)>>12);
|
||||||
sprites->printFT4(fh,x+shoes_seperation,y+yoff,0,0,PICKUPS_OT_POS);
|
sprites->printFT4(fh,x+shoes_seperation,y+yoff,0,0,PICKUPS_OT_POS);
|
||||||
sprites->printFT4(fh,x-shoes_seperation,y-yoff,0,0,PICKUPS_OT_POS);
|
sprites->printFT4(fh,x-shoes_seperation,y-yoff,0,0,PICKUPS_OT_POS);
|
||||||
|
|
||||||
CBasePickup::render();
|
|
||||||
}
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------
|
|
||||||
Function:
|
|
||||||
Purpose:
|
|
||||||
Params:
|
|
||||||
Returns:
|
|
||||||
---------------------------------------------------------------------- */
|
|
||||||
void CShoesPickup::collect(class CPlayer *_player)
|
|
||||||
{
|
|
||||||
CBasePickup::collect(_player);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*===========================================================================
|
/*===========================================================================
|
||||||
|
|
|
@ -39,13 +39,16 @@ class CShoesPickup : public CBasePickup
|
||||||
public:
|
public:
|
||||||
virtual void init();
|
virtual void init();
|
||||||
virtual void shutdown();
|
virtual void shutdown();
|
||||||
virtual void think(int _frames);
|
|
||||||
virtual void render();
|
|
||||||
|
|
||||||
virtual void collect(class CPlayer *_player);
|
virtual void collect(class CPlayer *_player);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual void thinkPickup(int _frames);
|
||||||
|
virtual void renderPickup(DVECTOR *_pos);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int m_sin;
|
int m_sin;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -72,6 +72,17 @@ void CSpatulaPickup::shutdown()
|
||||||
CBasePickup::shutdown();
|
CBasePickup::shutdown();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*----------------------------------------------------------------------
|
||||||
|
Function:
|
||||||
|
Purpose:
|
||||||
|
Params:
|
||||||
|
Returns:
|
||||||
|
---------------------------------------------------------------------- */
|
||||||
|
void CSpatulaPickup::collect(class CPlayer *_player)
|
||||||
|
{
|
||||||
|
CBasePickup::collect(_player);
|
||||||
|
}
|
||||||
|
|
||||||
/*----------------------------------------------------------------------
|
/*----------------------------------------------------------------------
|
||||||
Function:
|
Function:
|
||||||
Purpose:
|
Purpose:
|
||||||
|
@ -83,9 +94,8 @@ int spat_maxglint=600;
|
||||||
DVECTOR spat_gxy1={-5,30};
|
DVECTOR spat_gxy1={-5,30};
|
||||||
DVECTOR spat_gxy2={10,-5};
|
DVECTOR spat_gxy2={10,-5};
|
||||||
int spat_glintFrames[]={FRM__GLINT1,FRM__GLINT2,FRM__GLINT3,FRM__GLINT4};
|
int spat_glintFrames[]={FRM__GLINT1,FRM__GLINT2,FRM__GLINT3,FRM__GLINT4};
|
||||||
void CSpatulaPickup::think(int _frames)
|
void CSpatulaPickup::thinkPickup(int _frames)
|
||||||
{
|
{
|
||||||
CBasePickup::think(_frames);
|
|
||||||
m_glint+=_frames*spat_glintspeed;
|
m_glint+=_frames*spat_glintspeed;
|
||||||
if(m_glint>spat_maxglint)m_glint-=spat_maxglint;
|
if(m_glint>spat_maxglint)m_glint-=spat_maxglint;
|
||||||
}
|
}
|
||||||
|
@ -96,18 +106,16 @@ void CSpatulaPickup::think(int _frames)
|
||||||
Params:
|
Params:
|
||||||
Returns:
|
Returns:
|
||||||
---------------------------------------------------------------------- */
|
---------------------------------------------------------------------- */
|
||||||
void CSpatulaPickup::render()
|
void CSpatulaPickup::renderPickup(DVECTOR *_pos)
|
||||||
{
|
{
|
||||||
DVECTOR ofs;
|
|
||||||
SpriteBank *sprites;
|
SpriteBank *sprites;
|
||||||
sFrameHdr *fh;
|
sFrameHdr *fh;
|
||||||
int x,y;
|
int x,y;
|
||||||
|
|
||||||
ofs=getRenderOffset();
|
|
||||||
sprites=getSpriteBank();
|
sprites=getSpriteBank();
|
||||||
fh=sprites->getFrameHeader(FRM__SPATULA);
|
fh=sprites->getFrameHeader(FRM__SPATULA);
|
||||||
x=Pos.vx-ofs.vx-(fh->W/2);
|
x=_pos->vx-(fh->W/2);
|
||||||
y=Pos.vy-ofs.vy-(fh->H/2);
|
y=_pos->vy-(fh->H/2);
|
||||||
sprites->printFT4(fh,x,y,0,0,PICKUPS_OT_POS);
|
sprites->printFT4(fh,x,y,0,0,PICKUPS_OT_POS);
|
||||||
|
|
||||||
if(m_glint<=255)
|
if(m_glint<=255)
|
||||||
|
@ -117,19 +125,6 @@ void CSpatulaPickup::render()
|
||||||
y=y+(((spat_gxy2.vy-spat_gxy1.vy)*m_glint)>>8)+spat_gxy1.vy;
|
y=y+(((spat_gxy2.vy-spat_gxy1.vy)*m_glint)>>8)+spat_gxy1.vy;
|
||||||
sprites->printFT4(fh,x,y,0,0,PICKUPS_OT_POS-1);
|
sprites->printFT4(fh,x,y,0,0,PICKUPS_OT_POS-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
CBasePickup::render();
|
|
||||||
}
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------
|
|
||||||
Function:
|
|
||||||
Purpose:
|
|
||||||
Params:
|
|
||||||
Returns:
|
|
||||||
---------------------------------------------------------------------- */
|
|
||||||
void CSpatulaPickup::collect(class CPlayer *_player)
|
|
||||||
{
|
|
||||||
CBasePickup::collect(_player);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*===========================================================================
|
/*===========================================================================
|
||||||
|
|
|
@ -39,11 +39,13 @@ class CSpatulaPickup : public CBasePickup
|
||||||
public:
|
public:
|
||||||
virtual void init();
|
virtual void init();
|
||||||
virtual void shutdown();
|
virtual void shutdown();
|
||||||
virtual void think(int _frames);
|
|
||||||
virtual void render();
|
|
||||||
|
|
||||||
virtual void collect(class CPlayer *_player);
|
virtual void collect(class CPlayer *_player);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual void thinkPickup(int _frames);
|
||||||
|
virtual void renderPickup(DVECTOR *_pos);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int m_glint;
|
int m_glint;
|
||||||
};
|
};
|
||||||
|
|
|
@ -685,6 +685,14 @@ SOURCE=..\..\..\source\paul\scenesel.h
|
||||||
# PROP Default_Filter ""
|
# PROP Default_Filter ""
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=..\..\..\source\pickups\pballoon.cpp
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=..\..\..\source\pickups\pballoon.h
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
SOURCE=..\..\..\source\pickups\pbubmix.cpp
|
SOURCE=..\..\..\source\pickups\pbubmix.cpp
|
||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
@ -709,6 +717,14 @@ SOURCE=..\..\..\source\pickups\phealth.h
|
||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=..\..\..\source\pickups\phelmet.cpp
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=..\..\..\source\pickups\phelmet.h
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
SOURCE=..\..\..\source\pickups\pickup.cpp
|
SOURCE=..\..\..\source\pickups\pickup.cpp
|
||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|
Loading…
Add table
Reference in a new issue