This commit is contained in:
Paul 2001-06-27 19:50:35 +00:00
parent 180ba21ecb
commit 7853274fe5
14 changed files with 70 additions and 145 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Before After
Before After

View file

@ -254,6 +254,7 @@ pickups_src := pickup \
pballoon \ pballoon \
pblower \ pblower \
pbubmix \ pbubmix \
pglove \
phelmet \ phelmet \
pjlammo \ pjlammo \
pkelp \ pkelp \

View file

@ -185,7 +185,7 @@ PICKUP_GFX_DIR := $(GRAF_DIR)/pickups
PICKUP_GFX := +spatula +token +pants +glint1 +glint2 +glint3 +glint4 \ PICKUP_GFX := +spatula +token +pants +glint1 +glint2 +glint3 +glint4 \
+questitemstar1 +questitemstar2 +questitemstar3 \ +questitemstar1 +questitemstar2 +questitemstar3 \
+jellyammo +bubblemixture +bubblewand +shoe +balloon +balloonburst +helmet \ +jellyammo +bubblemixture +bubblewand +shoe +balloon +balloonburst +helmet \
+blower +launcher +net \ +blower +launcher +net +glove \
+c1_l1_quest_item +c1_l2_quest_item +c1_l3_quest_item +c1_l4_quest_item \ +c1_l1_quest_item +c1_l2_quest_item +c1_l3_quest_item +c1_l4_quest_item \
+c2_l1_quest_item +c2_l2_quest_item +c2_l3_quest_item +c2_l4_quest_item \ +c2_l1_quest_item +c2_l2_quest_item +c2_l3_quest_item +c2_l4_quest_item \
+c3_l1_quest_item +c3_l2_quest_item +c3_l3_quest_item +c3_l4_quest_item \ +c3_l1_quest_item +c3_l2_quest_item +c3_l3_quest_item +c3_l4_quest_item \

View file

@ -77,6 +77,10 @@
#include "pickups\pkelp.h" #include "pickups\pkelp.h"
#endif #endif
#ifndef __PICKUPS_PGLOVE_H__
#include "pickups\pglove.h"
#endif
#include "game/game.h" #include "game/game.h"
/* Std Lib /* Std Lib
@ -364,7 +368,7 @@ void CBaseWeaponSimplePickup::init()
CBaseWeaponPickup::init(); CBaseWeaponPickup::init();
fh=CGameScene::getSpriteBank()->getFrameHeader(FRM__NET); fh=CGameScene::getSpriteBank()->getFrameHeader(getWeaponSpriteFrame());
setCollisionSize(fh->W,fh->H); setCollisionSize(fh->W,fh->H);
} }
@ -407,51 +411,6 @@ void CBaseWeaponSimplePickup::renderPickup(DVECTOR *_pos)
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
void CBaseBouncingPickup::init()
{
CBasePickup::init();
m_timeTillVanish=TIME_TILL_VANISH;
}
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
void CBaseBouncingPickup::render()
{
if(m_timeTillVanish>FRAMES_TO_FLASH||m_timeTillVanish&3)
{
DVECTOR ofs,pos;
int visibilityRadius;
CPickupThing::render();
if (canRender())
{
DVECTOR &renderPos=getRenderPos();
renderPickup(&renderPos);
}
}
}
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
void CBaseBouncingPickup::collidedWith(CThing *_thisThing)
{
}
@ -537,8 +496,8 @@ return NULL;
pickup=new ("KelpTokenPickup") CKelpTokenPickup(); pickup=new ("KelpTokenPickup") CKelpTokenPickup();
break; break;
case PICKUP__BOUNCING_SPATULA: case PICKUP__GLOVE:
pickup=new ("BouncingSpatulaPickup") CBouncingSpatulaPickup(); pickup=new ("GlovePickup") CGlovePickup();
break; break;
default: default:

View file

@ -54,8 +54,7 @@ typedef enum
PICKUP__BALLOON_AND_SPATULA, PICKUP__BALLOON_AND_SPATULA,
PICKUP__JELLY_LAUNCHER, PICKUP__JELLY_LAUNCHER,
PICKUP__KELP_TOKEN, PICKUP__KELP_TOKEN,
PICKUP__GLOVE,
PICKUP__BOUNCING_SPATULA,
PICKUP__MAX PICKUP__MAX
} }
@ -152,28 +151,6 @@ protected:
}; };
class CBaseBouncingPickup : public CBasePickup
{
public:
virtual void init();
virtual void render();
protected:
enum
{
TIME_TILL_VANISH=5*55,
FRAMES_TO_FLASH=2*55,
};
virtual void renderPickup(DVECTOR *_pos)=0;
virtual void collidedWith(CThing *_thisThing);
int m_timeTillVanish;
};
/*---------------------------------------------------------------------- /*----------------------------------------------------------------------
Globals Globals
------- */ ------- */

View file

@ -163,57 +163,5 @@ void CSpatulaPickup::renderPickup(DVECTOR *_pos)
} }
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
DVECTOR CBouncingSpatulaPickup::getSizeForPlacement()
{
DVECTOR size;
sFrameHdr *fh;
fh=CGameScene::getSpriteBank()->getFrameHeader(FRM__SPATULA);
size.vx=fh->W;
size.vy=fh->H;
return size;
}
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
void CBouncingSpatulaPickup::renderPickup(DVECTOR *_pos)
{
SpriteBank *sprites;
sFrameHdr *fh;
int x,y;
sprites=CGameScene::getSpriteBank();
fh=sprites->getFrameHeader(FRM__SPATULA);
x=_pos->vx-(fh->W/2);
y=_pos->vy-(fh->H/2);
sprites->printFT4(fh,x,y,0,0,OTPOS__PICKUP_POS);
/*
if(m_glint<=spat_maxglint)
{
fh=sprites->getFrameHeader(spat_glintFrames[(m_glint>>spat_glintgrowspeed)&0x07]);
x=x+spat_gxy.vx;
y=y+spat_gxy.vy;
sprites->printRotatedScaledSprite(fh,x,y,4095,4095,m_glintRot,OTPOS__PICKUP_POS-1);
}
*/
}
/*=========================================================================== /*===========================================================================
end */ end */

View file

@ -61,18 +61,6 @@ private:
}; };
class CBouncingSpatulaPickup : public CBaseBouncingPickup
{
public:
virtual DVECTOR getSizeForPlacement();
protected:
virtual void renderPickup(DVECTOR *_pos);
};
/*---------------------------------------------------------------------- /*----------------------------------------------------------------------
Globals Globals
------- */ ------- */

View file

@ -626,7 +626,7 @@ m_animNo=0;
m_animFrame=0; m_animFrame=0;
setFacing(FACING_RIGHT); setFacing(FACING_RIGHT);
m_currentPlayerModeClass=NULL; m_currentPlayerModeClass=NULL;
m_lastModeBeforeDeath=PLAYER_MODE_FULLUNARMED; // Player will then respawn into this mode m_lastModeBeforeDeath=PLAYER_MODE_BASICUNARMED; // Player will then respawn into this mode
m_lives++;respawn(); m_lives++;respawn();
m_canExitLevel=false; m_canExitLevel=false;
@ -772,8 +772,7 @@ if(PadGetDown(0)&PAD_TRIANGLE)
updatePadInput(); updatePadInput();
// Weapon collect/drop/swap stuff.. // Weapon collect/drop/swap stuff..
if(m_currentMode==PLAYER_MODE_BASICUNARMED|| if(m_currentMode==PLAYER_MODE_BASICUNARMED)
m_currentMode==PLAYER_MODE_FULLUNARMED)
{ {
// Always trying to pickup weapon if unarmed... means that when SB walks // Always trying to pickup weapon if unarmed... means that when SB walks
// over an item whilst unarmed, he automatically picks it up // over an item whilst unarmed, he automatically picks it up
@ -786,7 +785,6 @@ if(PadGetDown(0)&PAD_TRIANGLE)
// If already armed then drop current weapon // If already armed then drop current weapon
if(m_currentMode!=PLAYER_MODE_BASICUNARMED&& if(m_currentMode!=PLAYER_MODE_BASICUNARMED&&
m_currentMode!=PLAYER_MODE_FULLUNARMED&&
m_currentMode!=PLAYER_MODE_DEAD) m_currentMode!=PLAYER_MODE_DEAD)
{ {
static const int s_pickupsToDrop[NUM_PLAYERMODES]= static const int s_pickupsToDrop[NUM_PLAYERMODES]=
@ -814,7 +812,7 @@ if(PadGetDown(0)&PAD_TRIANGLE)
pickup=createPickup((PICKUP_TYPE)pickupToDrop,&pickupPos); pickup=createPickup((PICKUP_TYPE)pickupToDrop,&pickupPos);
pickup->setPos(&pickupPos); pickup->setPos(&pickupPos);
} }
setMode(PLAYER_MODE_FULLUNARMED); setMode(PLAYER_MODE_BASICUNARMED);
} }
} }
@ -2055,7 +2053,7 @@ void CPlayer::takeDamage(DAMAGE_TYPE _damage,REACT_DIRECTION _reactDirection,CTh
if(m_currentMode==PLAYER_MODE_NET) if(m_currentMode==PLAYER_MODE_NET)
{ {
// Launch net pickup // Launch net pickup
setMode(PLAYER_MODE_FULLUNARMED); setMode(PLAYER_MODE_BASICUNARMED);
DVECTOR pickupPos; DVECTOR pickupPos;
CBasePickup *pickup; CBasePickup *pickup;
pickupPos.vx=Pos.vx; pickupPos.vx=Pos.vx;

View file

@ -104,7 +104,7 @@ void CPlayerModeBalloon::think()
{ {
CSoundMediator::playSfx(CSoundMediator::SFX_BALLOON_POP); CSoundMediator::playSfx(CSoundMediator::SFX_BALLOON_POP);
} }
m_player->setMode(PLAYER_MODE_FULLUNARMED); m_player->setMode(PLAYER_MODE_BASICUNARMED);
} }
} }

View file

@ -17,6 +17,14 @@
#include "player\pmchop.h" #include "player\pmchop.h"
#ifndef __GFX_SPRBANK_H__
#include "gfx\sprbank.h"
#endif
#ifndef __GAME_GAME_H__
#include "game\game.h"
#endif
/* Std Lib /* Std Lib
------- */ ------- */
@ -28,6 +36,10 @@
#include <ACTOR_SPONGEBOB_ANIM.h> #include <ACTOR_SPONGEBOB_ANIM.h>
#endif #endif
#ifndef __SPR_SPRITES_H__
#include <sprites.h>
#endif
/*---------------------------------------------------------------------- /*----------------------------------------------------------------------
Tyepdefs && Defines Tyepdefs && Defines
@ -55,6 +67,7 @@ void CPlayerModeChop::enter()
{ {
CPlayerModeBase::enter(); CPlayerModeBase::enter();
m_chopping=false; m_chopping=false;
m_timer=0;
} }
/*---------------------------------------------------------------------- /*----------------------------------------------------------------------
@ -116,6 +129,31 @@ void CPlayerModeChop::think()
setPlayerCollisionSize(m_savedCSX,m_savedCSY,m_savedCSW,m_savedCSH); setPlayerCollisionSize(m_savedCSX,m_savedCSY,m_savedCSW,m_savedCSH);
} }
} }
if(++m_timer>CHOP_TIMEOUT)
{
m_player->setMode(PLAYER_MODE_BASICUNARMED);
}
}
/*----------------------------------------------------------------------
Function:
Purpose:
Params:
Returns:
---------------------------------------------------------------------- */
void CPlayerModeChop::renderModeUi()
{
if(m_timer<CHOP_TIMEOUT-CHOP_FLASH_TIME||m_timer&2)
{
SpriteBank *sb;
sFrameHdr *fh;
sb=CGameScene::getSpriteBank();
fh=sb->getFrameHeader(FRM__GLOVE);
sb->printFT4(fh,CPlayer::POWERUPUI_ICONX,CPlayer::POWERUPUI_ICONY,0,0,CPlayer::POWERUPUI_OT);
}
} }
/*---------------------------------------------------------------------- /*----------------------------------------------------------------------

View file

@ -39,6 +39,7 @@ class CPlayerModeChop : public CPlayerModeBase
public: public:
virtual void enter(); virtual void enter();
virtual void think(); virtual void think();
virtual void renderModeUi();
virtual void setAnimNo(int _animNo); virtual void setAnimNo(int _animNo);
virtual void setAnimFrame(int _animFrame); virtual void setAnimFrame(int _animFrame);
@ -52,6 +53,8 @@ private:
{ {
CHOP_ATTACK_START_FRAME=15, CHOP_ATTACK_START_FRAME=15,
CHOP_ATTACK_END_FRAME=21, CHOP_ATTACK_END_FRAME=21,
CHOP_TIMEOUT=10*60,
CHOP_FLASH_TIME=2*60,
}; };
@ -60,6 +63,7 @@ private:
int m_savedAnimNo,m_savedAnimFrame; int m_savedAnimNo,m_savedAnimFrame;
int m_chopFrame; int m_chopFrame;
int m_chopping; int m_chopping;
int m_timer;
int m_savedCSX,m_savedCSY,m_savedCSW,m_savedCSH; int m_savedCSX,m_savedCSY,m_savedCSW,m_savedCSH;

View file

@ -74,6 +74,7 @@ Quest_Item=14
# Balloon_Golden_Spatula=15 # Balloon_Golden_Spatula=15
Jelly_Launcher=16 Jelly_Launcher=16
Kelp_Token=17 Kelp_Token=17
Glove=18
################################################ ################################################

View file

@ -59,3 +59,6 @@ Gfx=..\..\graphics\pickups\+launcher.bmp
[Kelp_Token] [Kelp_Token]
Gfx=..\..\graphics\pickups\+token.bmp Gfx=..\..\graphics\pickups\+token.bmp
[Glove]
Gfx=..\..\graphics\pickups\+glove.bmp

View file

@ -1349,6 +1349,14 @@ SOURCE=..\..\..\source\pickups\pglasses.h
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=..\..\..\source\pickups\pglove.cpp
# End Source File
# Begin Source File
SOURCE=..\..\..\source\pickups\pglove.h
# End Source File
# Begin Source File
SOURCE=..\..\..\source\pickups\phealth.cpp SOURCE=..\..\..\source\pickups\phealth.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File