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 \
fxbaseanim \
fxbasetrail \
fxnrgbar \
fxjfish \
fxfallingtile \
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)
INGAMEFX_GFX_DIR := $(GRAF_DIR)/ingamefx
INGAMEFX_GFX_TRANS := +bubble_1 +bubble_2 +bubble_3 +tentacle\
+health_full_1 +health_full_2 +health_full_3 +health_full_4 +health_full_5 \
INGAMEFX_GFX_TRANS := +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 \
+watermeter +waterhilight +netblob \
+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_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\fxjfish.h"
#include "fx\fxnrgbar.h"
@ -50,6 +51,7 @@ void CNpcMotherJellyfishEnemy::postInit()
{
m_state = MOTHER_JELLYFISH_RETURN_TO_START_1;
m_spawnTimer = 0;
m_meterOn=false;
if ( CLevel::getIsBossRespawn() )
{
@ -371,6 +373,13 @@ void CNpcMotherJellyfishEnemy::render()
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();
SprFrame = m_actorGfx->Render(renderPos,m_animNo,( m_frame >> 8 ),false);

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,6 +1,6 @@
/**********************/
/*** JellyFish Legs ***/
/**********************/
/******************/
/*** Energy Bar ***/
/******************/
#include "system\global.h"
#include <DStructs.h>
@ -11,94 +11,84 @@
#include "level\level.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();
Pos=_Pos;
Ofs.vx=0; Ofs.vy=0;
Angle=getRnd();
AngleInc=LegAngleInc+getRndRange(3);
SpriteBank *SprBank=CGameScene::getSpriteBank();
GfxW=SprBank->getFrameWidth(FRM__BUBBLE_1);
GfxHalfW=GfxW/2;
DrawW=NRGW;
}
/*****************************************************************************/
void CFXJellyFishLegs::shutdown()
void CFXNRGBar::shutdown()
{
CFX::shutdown();
}
/*****************************************************************************/
void CFXJellyFishLegs::Setup(int XOfs,int YOfs,bool XFlip)
{
Ofs.vx=XOfs;
Ofs.vy=YOfs;
this->XFlip=XFlip;
}
/*****************************************************************************/
/*** Think *******************************************************************/
/*****************************************************************************/
void CFXJellyFishLegs::think(int _frames)
void CFXNRGBar::think(int _frames)
{
Pos=getParent()->getPos();
CFX::think(_frames);
Angle++; Angle&=CIRCLE_TAB_MASK;
AngleInc=LegAngleInc;
CNpcEnemy *P=(CNpcEnemy*)ParentThing;
int Health=P->getHealth();
CurrentW=((NRGW/MaxHealth)*Health);
int Diff=DrawW-CurrentW;
DrawW-=(Diff+1)>>1;
if (DrawW<=0 && Health==0)
{
setToShutdown();
}
}
/*****************************************************************************/
/*** Render ******************************************************************/
/*****************************************************************************/
void CFXJellyFishLegs::render()
void CFXNRGBar::render()
{
CFX::render();
if (!canRender()) return;
// CFX::render();
SpriteBank *SprBank=CGameScene::getSpriteBank();;
DVECTOR RenderPos=getRenderPos();
int WOfs=0;
int H;
int ThisAngle=Angle;
int LegHeight=SprBank->getFrameHeight(FRM__LEG)-4;
RenderPos.vx+=Ofs.vx;
RenderPos.vy+=Ofs.vy;
SpriteBank *SprBank=CGameScene::getSpriteBank();
POLY_FT4 *Ft4;
// Draw Start
Ft4=SprBank->printFT4(FRM__BUBBLE_1,NRGX,NRGY,0,0,0);
Ft4->x1-=GfxHalfW;
Ft4->x3-=GfxHalfW;
Ft4->u1-=GfxHalfW;
Ft4->u3-=GfxHalfW;
for (int i=0; i<LegCount; i++)
{
ThisAngle+=AngleInc;
ThisAngle&=CIRCLE_TAB_MASK;
H=LegHeight+(CircleTable[ThisAngle]>>5);
// Draw Start
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;
POLY_FT4 *Ft4=SprBank->printFT4(FRM__LEG,RenderPos.vx,RenderPos.vy,XFlip,0,OtPos*0);
// Draw End
Ft4=SprBank->printFT4(FRM__BUBBLE_1,NRGX+DrawW+GfxHalfW,NRGY,0,0,0);
Ft4->x1-=GfxHalfW;
Ft4->x3-=GfxHalfW;
Ft4->u0+=GfxHalfW;
Ft4->u2+=GfxHalfW;
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__
#define __FX_FX_JELLYFISH_LEGS_HEADER__
#ifndef __FX_FX_NRG_BAR_HEADER__
#define __FX_FX_NRG_BAR_HEADER__
#include "fx/fx.h"
/*****************************************************************************/
class CFXJellyFishLegs : public CFX
class CFXNRGBar : public CFX
{
public:
@ -17,14 +17,14 @@ virtual void shutdown();
virtual void think(int _frames);
virtual void render();
void Setup(int XOfs,int YOfs,bool XFlip);
void SetMax(int Max) {MaxHealth=Max-1;}
bool alwaysThink() {return(true);}
protected:
DVECTOR Ofs;
int Angle,AngleInc;
bool XFlip;
int GfxW,GfxHalfW;
int MaxHealth;
int CurrentW,DrawW;
};
#endif