This commit is contained in:
Daveo 2001-05-30 22:05:41 +00:00
parent 1f699b27eb
commit ebda143270
10 changed files with 90 additions and 81 deletions

View file

@ -155,6 +155,7 @@ hazard_src := hazard \
fx_src := fx \ fx_src := fx \
fxbaseanim \ fxbaseanim \
fxbasetrail \ fxbasetrail \
fxnrgbar \
fxjfish \ fxjfish \
fxfallingtile \ fxfallingtile \
fxsteam \ fxsteam \

View file

@ -191,12 +191,12 @@ PICKUP_GFX := +spatula +token +pants +health100 +health50 +health25 +glint1 +
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_DIR := $(GRAF_DIR)/ingamefx INGAMEFX_GFX_DIR := $(GRAF_DIR)/ingamefx
INGAMEFX_GFX_TRANS := +bubble_1 +bubble_2 +bubble_3 +tentacle\ INGAMEFX_GFX_TRANS := +health_full_1 +health_full_2 +health_full_3 +health_full_4 +health_full_5 \
+health_full_1 +health_full_2 +health_full_3 +health_full_4 +health_full_5 \
+health_empty_1 +health_empty_2 +health_empty_3 +health_empty_4 +health_empty_5 \ +health_empty_1 +health_empty_2 +health_empty_3 +health_empty_4 +health_empty_5 \
+watermeter +waterhilight +netblob \ +watermeter +waterhilight +netblob \
+spike +spike
INGAMEFX_GFX_TRANS_NONROT_NONCLIP := +water +aim_arrow INGAMEFX_GFX_TRANS_NONROT_NONCLIP := +bubble_1 +bubble_2 +bubble_3 \
+water +aim_arrow
INGAMEFX_GFX_TRANS_IN := $(foreach FILE,$(INGAMEFX_GFX_TRANS),$(INGAMEFX_GFX_DIR)/$(FILE).bmp) INGAMEFX_GFX_TRANS_IN := $(foreach FILE,$(INGAMEFX_GFX_TRANS),$(INGAMEFX_GFX_DIR)/$(FILE).bmp)
INGAMEFX_GFX_TRANS_NONROT_NONCLIP_IN := $(foreach FILE,$(INGAMEFX_GFX_TRANS_NONROT_NONCLIP),$(INGAMEFX_GFX_DIR)/$(FILE).bmp) INGAMEFX_GFX_TRANS_NONROT_NONCLIP_IN := $(foreach FILE,$(INGAMEFX_GFX_TRANS_NONROT_NONCLIP),$(INGAMEFX_GFX_DIR)/$(FILE).bmp)

View file

@ -41,6 +41,7 @@
#include "fx\fx.h" #include "fx\fx.h"
#include "fx\fxjfish.h" #include "fx\fxjfish.h"
#include "fx\fxnrgbar.h"
@ -50,6 +51,7 @@ void CNpcMotherJellyfishEnemy::postInit()
{ {
m_state = MOTHER_JELLYFISH_RETURN_TO_START_1; m_state = MOTHER_JELLYFISH_RETURN_TO_START_1;
m_spawnTimer = 0; m_spawnTimer = 0;
m_meterOn=false;
if ( CLevel::getIsBossRespawn() ) if ( CLevel::getIsBossRespawn() )
{ {
@ -371,6 +373,13 @@ void CNpcMotherJellyfishEnemy::render()
if (canRender()) if (canRender())
{ {
if (!m_meterOn)
{
CFXNRGBar *T=(CFXNRGBar*)CFX::Create(CFX::FX_TYPE_NRG_BAR,this);
T->SetMax(m_health);
m_meterOn=true;
}
DVECTOR &renderPos=getRenderPos(); DVECTOR &renderPos=getRenderPos();
SprFrame = m_actorGfx->Render(renderPos,m_animNo,( m_frame >> 8 ),false); SprFrame = m_actorGfx->Render(renderPos,m_animNo,( m_frame >> 8 ),false);

View file

@ -44,6 +44,7 @@ protected:
s32 m_spawnTimer; s32 m_spawnTimer;
s32 m_cycleWidth; s32 m_cycleWidth;
s32 m_halfCycleWidth; s32 m_halfCycleWidth;
bool m_meterOn;
}; };
#endif #endif

View file

@ -127,6 +127,7 @@ public:
bool canBeSuckedUp(); bool canBeSuckedUp();
bool suckUp( DVECTOR *suckPos, int _frames ); bool suckUp( DVECTOR *suckPos, int _frames );
int getHealth() {return(m_health);}
protected: protected:
// NPC data structure definitions // // NPC data structure definitions //

View file

@ -22,6 +22,7 @@
#include "FX\FXSplashLava.h" #include "FX\FXSplashLava.h"
#include "FX\FXSplashOil.h" #include "FX\FXSplashOil.h"
#include "FX\FXExplode.h" #include "FX\FXExplode.h"
#include "FX\FXNrgBar.h"
/* FX /* FX
Jellyfish legs Jellyfish legs
@ -131,6 +132,10 @@ CFX *NewFX;
break; break;
case FX_TYPE_NRG_BAR:
NewFX=new ("NRG Bar") CFXNRGBar();
break;
case FX_TYPE_JELLYFISH_LEGS: case FX_TYPE_JELLYFISH_LEGS:
NewFX=new ("JellyFish Legs") CFXJellyFishLegs(); NewFX=new ("JellyFish Legs") CFXJellyFishLegs();
break; break;

View file

@ -46,6 +46,8 @@ public:
FX_TYPE_FLAMES, FX_TYPE_FLAMES,
FX_TYPE_EXPLODE, FX_TYPE_EXPLODE,
FX_TYPE_DEBRIS, FX_TYPE_DEBRIS,
FX_TYPE_NRG_BAR,
FX_TYPE_MAX FX_TYPE_MAX
}; };
enum enum

View file

@ -13,10 +13,10 @@
#include "FX\FXjfish.h" #include "FX\FXjfish.h"
int LegCount=3; static const int LegCount=3;
int LegWInc=32/LegCount; static const int LegWInc=32/LegCount;
int LegHInc=-4; static const int LegHInc=-4;
int LegAngleInc=7; static const int LegAngleInc=7;
/*****************************************************************************/ /*****************************************************************************/
/*****************************************************************************/ /*****************************************************************************/

View file

@ -1,6 +1,6 @@
/**********************/ /******************/
/*** JellyFish Legs ***/ /*** Energy Bar ***/
/**********************/ /******************/
#include "system\global.h" #include "system\global.h"
#include <DStructs.h> #include <DStructs.h>
@ -11,94 +11,84 @@
#include "level\level.h" #include "level\level.h"
#include "game\game.h" #include "game\game.h"
#include "FX\FXjfish.h" #include "FX\FXNRGBar.h"
#include "enemy\npc.h"
int NRGX=32;
int NRGY=188;
int NRGW=512-64;
int LegCount=3;
int LegWInc=32/LegCount;
int LegHInc=-4;
int LegAngleInc=7;
/*****************************************************************************/ /*****************************************************************************/
/*****************************************************************************/ /*****************************************************************************/
/*****************************************************************************/ /*****************************************************************************/
void CFXJellyFishLegs::init(DVECTOR const &_Pos) void CFXNRGBar::init(DVECTOR const &_Pos)
{ {
CFX::init(); CFX::init();
Pos=_Pos; SpriteBank *SprBank=CGameScene::getSpriteBank();
Ofs.vx=0; Ofs.vy=0; GfxW=SprBank->getFrameWidth(FRM__BUBBLE_1);
Angle=getRnd(); GfxHalfW=GfxW/2;
AngleInc=LegAngleInc+getRndRange(3); DrawW=NRGW;
} }
/*****************************************************************************/ /*****************************************************************************/
void CFXJellyFishLegs::shutdown() void CFXNRGBar::shutdown()
{ {
CFX::shutdown(); CFX::shutdown();
} }
/*****************************************************************************/
void CFXJellyFishLegs::Setup(int XOfs,int YOfs,bool XFlip)
{
Ofs.vx=XOfs;
Ofs.vy=YOfs;
this->XFlip=XFlip;
}
/*****************************************************************************/ /*****************************************************************************/
/*** Think *******************************************************************/ /*** Think *******************************************************************/
/*****************************************************************************/ /*****************************************************************************/
void CFXJellyFishLegs::think(int _frames) void CFXNRGBar::think(int _frames)
{ {
Pos=getParent()->getPos();
CFX::think(_frames); CNpcEnemy *P=(CNpcEnemy*)ParentThing;
Angle++; Angle&=CIRCLE_TAB_MASK; int Health=P->getHealth();
AngleInc=LegAngleInc; CurrentW=((NRGW/MaxHealth)*Health);
int Diff=DrawW-CurrentW;
DrawW-=(Diff+1)>>1;
if (DrawW<=0 && Health==0)
{
setToShutdown();
}
} }
/*****************************************************************************/ /*****************************************************************************/
/*** Render ******************************************************************/ /*** Render ******************************************************************/
/*****************************************************************************/ /*****************************************************************************/
void CFXJellyFishLegs::render() void CFXNRGBar::render()
{ {
CFX::render(); // CFX::render();
if (!canRender()) return;
SpriteBank *SprBank=CGameScene::getSpriteBank();; SpriteBank *SprBank=CGameScene::getSpriteBank();
DVECTOR RenderPos=getRenderPos(); POLY_FT4 *Ft4;
int WOfs=0; // Draw Start
int H; Ft4=SprBank->printFT4(FRM__BUBBLE_1,NRGX,NRGY,0,0,0);
int ThisAngle=Angle; Ft4->x1-=GfxHalfW;
int LegHeight=SprBank->getFrameHeight(FRM__LEG)-4; Ft4->x3-=GfxHalfW;
Ft4->u1-=GfxHalfW;
Ft4->u3-=GfxHalfW;
RenderPos.vx+=Ofs.vx; // Draw Start
RenderPos.vy+=Ofs.vy; Ft4=SprBank->printFT4(FRM__BUBBLE_1,NRGX+GfxHalfW,NRGY,0,0,0);
Ft4->x1+=DrawW-GfxW;
Ft4->x3+=DrawW-GfxW;
Ft4->u0+=GfxHalfW-1;
Ft4->u1-=GfxHalfW-1;
Ft4->u2+=GfxHalfW-1;
Ft4->u3-=GfxHalfW-1;
for (int i=0; i<LegCount; i++) // Draw End
{ Ft4=SprBank->printFT4(FRM__BUBBLE_1,NRGX+DrawW+GfxHalfW,NRGY,0,0,0);
ThisAngle+=AngleInc; Ft4->x1-=GfxHalfW;
ThisAngle&=CIRCLE_TAB_MASK; Ft4->x3-=GfxHalfW;
H=LegHeight+(CircleTable[ThisAngle]>>5); Ft4->u0+=GfxHalfW;
Ft4->u2+=GfxHalfW;
POLY_FT4 *Ft4=SprBank->printFT4(FRM__LEG,RenderPos.vx,RenderPos.vy,XFlip,0,OtPos*0);
if (!XFlip)
{
Ft4->x1-=WOfs;
Ft4->x3-=WOfs;
}
else
{
Ft4->x0+=WOfs;
Ft4->x2+=WOfs;
}
Ft4->y2=Ft4->y0+H;
Ft4->y3=Ft4->y1+H;
RenderPos.vy+=H+LegHInc;
WOfs+=LegWInc;
}
} }

View file

@ -1,14 +1,14 @@
/**********************/ /******************/
/*** JellyFish Legs ***/ /*** Energy Bar ***/
/**********************/ /******************/
#ifndef __FX_FX_JELLYFISH_LEGS_HEADER__ #ifndef __FX_FX_NRG_BAR_HEADER__
#define __FX_FX_JELLYFISH_LEGS_HEADER__ #define __FX_FX_NRG_BAR_HEADER__
#include "fx/fx.h" #include "fx/fx.h"
/*****************************************************************************/ /*****************************************************************************/
class CFXJellyFishLegs : public CFX class CFXNRGBar : public CFX
{ {
public: public:
@ -17,14 +17,14 @@ virtual void shutdown();
virtual void think(int _frames); virtual void think(int _frames);
virtual void render(); virtual void render();
void Setup(int XOfs,int YOfs,bool XFlip); void SetMax(int Max) {MaxHealth=Max-1;}
bool alwaysThink() {return(true);}
protected: protected:
DVECTOR Ofs; int GfxW,GfxHalfW;
int Angle,AngleInc;
bool XFlip;
int MaxHealth;
int CurrentW,DrawW;
}; };
#endif #endif