2001-02-21 16:03:08 +01:00
|
|
|
/*=========================================================================
|
|
|
|
|
|
|
|
pshoes.cpp
|
|
|
|
|
|
|
|
Author: PKG
|
|
|
|
Created:
|
|
|
|
Project: Spongebob
|
|
|
|
Purpose:
|
|
|
|
|
|
|
|
Copyright (c) 2001 Climax Development Ltd
|
|
|
|
|
|
|
|
===========================================================================*/
|
|
|
|
|
|
|
|
/*----------------------------------------------------------------------
|
|
|
|
Includes
|
|
|
|
-------- */
|
|
|
|
|
|
|
|
#ifndef __GFX_SPRBANK_H__
|
|
|
|
#include "gfx\sprbank.h" // Damnit.. include order! :( (pkg)
|
|
|
|
#endif
|
|
|
|
|
2001-02-21 18:13:37 +01:00
|
|
|
#include "pickups\pshoes.h"
|
2001-02-21 16:03:08 +01:00
|
|
|
|
|
|
|
#ifndef __MATHTABLE_HEADER__
|
|
|
|
#include "utils\mathtab.h"
|
|
|
|
#endif
|
|
|
|
|
2001-02-27 23:06:24 +01:00
|
|
|
#ifndef __PLAYER_PLAYER_H__
|
|
|
|
#include "player\player.h"
|
|
|
|
#endif
|
|
|
|
|
2001-02-21 16:03:08 +01:00
|
|
|
|
|
|
|
/* Std Lib
|
|
|
|
------- */
|
|
|
|
|
|
|
|
/* Data
|
|
|
|
---- */
|
|
|
|
|
|
|
|
#ifndef __SPR_INGAMEFX_H__
|
|
|
|
#include <ingamefx.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
/*----------------------------------------------------------------------
|
|
|
|
Tyepdefs && Defines
|
|
|
|
------------------- */
|
|
|
|
|
|
|
|
/*----------------------------------------------------------------------
|
|
|
|
Structure defintions
|
|
|
|
-------------------- */
|
|
|
|
|
|
|
|
/*----------------------------------------------------------------------
|
|
|
|
Function Prototypes
|
|
|
|
------------------- */
|
|
|
|
|
|
|
|
/*----------------------------------------------------------------------
|
|
|
|
Vars
|
|
|
|
---- */
|
|
|
|
|
|
|
|
/*----------------------------------------------------------------------
|
|
|
|
Function:
|
|
|
|
Purpose:
|
|
|
|
Params:
|
|
|
|
Returns:
|
|
|
|
---------------------------------------------------------------------- */
|
2001-02-21 18:13:37 +01:00
|
|
|
void CShoesPickup::init()
|
2001-02-21 16:03:08 +01:00
|
|
|
{
|
2001-02-27 23:06:24 +01:00
|
|
|
CBaseRespawningPickup::init();
|
2001-02-21 16:03:08 +01:00
|
|
|
m_sin=0;
|
|
|
|
}
|
|
|
|
|
2001-02-21 23:33:17 +01:00
|
|
|
/*----------------------------------------------------------------------
|
|
|
|
Function:
|
|
|
|
Purpose:
|
|
|
|
Params:
|
|
|
|
Returns:
|
|
|
|
---------------------------------------------------------------------- */
|
|
|
|
void CShoesPickup::collect(class CPlayer *_player)
|
|
|
|
{
|
2001-03-02 17:02:30 +01:00
|
|
|
_player->giveSqueakyBoots();
|
2001-03-01 21:06:46 +01:00
|
|
|
CBaseRespawningPickup::collect(_player);
|
2001-02-27 23:06:24 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*----------------------------------------------------------------------
|
|
|
|
Function:
|
|
|
|
Purpose:
|
|
|
|
Params:
|
|
|
|
Returns:
|
|
|
|
---------------------------------------------------------------------- */
|
|
|
|
int CShoesPickup::getRespawnTime()
|
|
|
|
{
|
|
|
|
return 60*30;
|
2001-02-21 23:33:17 +01:00
|
|
|
}
|
|
|
|
|
2001-02-21 16:03:08 +01:00
|
|
|
/*----------------------------------------------------------------------
|
|
|
|
Function:
|
|
|
|
Purpose:
|
|
|
|
Params:
|
|
|
|
Returns:
|
|
|
|
---------------------------------------------------------------------- */
|
2001-02-21 18:13:37 +01:00
|
|
|
int shoes_bobspeed=100;
|
|
|
|
int shoes_bobscale=2;
|
|
|
|
int shoes_seperation=4;
|
2001-02-21 23:33:17 +01:00
|
|
|
void CShoesPickup::thinkPickup(int _frames)
|
2001-02-21 16:03:08 +01:00
|
|
|
{
|
2001-02-21 18:13:37 +01:00
|
|
|
m_sin=(m_sin+(_frames*shoes_bobspeed))&4095;
|
2001-02-21 16:03:08 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*----------------------------------------------------------------------
|
|
|
|
Function:
|
|
|
|
Purpose:
|
|
|
|
Params:
|
|
|
|
Returns:
|
|
|
|
---------------------------------------------------------------------- */
|
2001-02-21 23:33:17 +01:00
|
|
|
void CShoesPickup::renderPickup(DVECTOR *_pos)
|
2001-02-21 16:03:08 +01:00
|
|
|
{
|
|
|
|
SpriteBank *sprites;
|
|
|
|
sFrameHdr *fh;
|
2001-02-21 18:13:37 +01:00
|
|
|
int x,y,yoff;
|
2001-02-21 16:03:08 +01:00
|
|
|
|
|
|
|
sprites=getSpriteBank();
|
2001-02-21 18:13:37 +01:00
|
|
|
fh=sprites->getFrameHeader(FRM__SHOE);
|
2001-02-21 23:33:17 +01:00
|
|
|
x=_pos->vx-(fh->W/2);
|
|
|
|
y=_pos->vy-(fh->H/2);
|
2001-02-21 18:13:37 +01:00
|
|
|
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);
|
2001-02-21 16:03:08 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/*===========================================================================
|
|
|
|
end */
|