This commit is contained in:
parent
8db11f1e0f
commit
2f2da8d1e7
@ -12,8 +12,11 @@
|
|||||||
|
|
||||||
#include "FX\FXSteam.h"
|
#include "FX\FXSteam.h"
|
||||||
|
|
||||||
static const s16 SteamSize=4;
|
static const int Size=2;
|
||||||
static const s16 SteamAngleInc=999;
|
static const int AngleInc=999;
|
||||||
|
static const int ShadeBase=255;
|
||||||
|
static const int ShadeDec=8;
|
||||||
|
static const int ShadeDieDec=24;
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
@ -22,11 +25,11 @@ void CFXSteam::init(DVECTOR const &_Pos)
|
|||||||
{
|
{
|
||||||
CFXTrail::init(_Pos);
|
CFXTrail::init(_Pos);
|
||||||
|
|
||||||
ColBase=255;
|
Angle=0;
|
||||||
ColInc=-8;
|
|
||||||
Trans=3;
|
Trans=3;
|
||||||
|
ShadeDec=ShadeDec;
|
||||||
DieOut=false;
|
DieOut=false;
|
||||||
SetSize(SteamSize);
|
SetSize(Size);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
@ -39,7 +42,6 @@ void CFXSteam::shutdown()
|
|||||||
void CFXSteam::SetSize(int Size)
|
void CFXSteam::SetSize(int Size)
|
||||||
{
|
{
|
||||||
ScaleInc=(4096/LIST_SIZE)*Size;
|
ScaleInc=(4096/LIST_SIZE)*Size;
|
||||||
AngleInc=SteamAngleInc;
|
|
||||||
BaseVel.vx=0;
|
BaseVel.vx=0;
|
||||||
BaseVel.vy=-Size;
|
BaseVel.vy=-Size;
|
||||||
}
|
}
|
||||||
@ -49,11 +51,12 @@ void CFXSteam::setDie()
|
|||||||
{
|
{
|
||||||
CFXTrail::setDie();
|
CFXTrail::setDie();
|
||||||
for (int i=0; i<LIST_SIZE; i++)
|
for (int i=0; i<LIST_SIZE; i++)
|
||||||
{
|
{ // Set drift off
|
||||||
sList &ThisElem=List[i];
|
sList &ThisElem=List[i];
|
||||||
ThisElem.Vel.vx+=getRndRange(9)-4; // give is x motion
|
ThisElem.Vel.vx+=getRndRange(9)-4; // give it x motion
|
||||||
ThisElem.Vel.vy+=getRndRange(ThisElem.Vel.vy/2); // Slow down y Inc
|
|
||||||
}
|
}
|
||||||
|
ShadeDec=ShadeDieDec;
|
||||||
|
ScaleInc=0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
@ -61,11 +64,29 @@ void CFXSteam::setDie()
|
|||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
void CFXSteam::think(int _frames)
|
void CFXSteam::think(int _frames)
|
||||||
{
|
{
|
||||||
|
int TotalLife=0;
|
||||||
|
|
||||||
CFX::think(_frames);
|
CFX::think(_frames);
|
||||||
|
|
||||||
|
Angle+=AngleInc;
|
||||||
|
Angle&=4095;
|
||||||
|
if (!DieOut)
|
||||||
|
{ // Replace Head
|
||||||
|
DVECTOR Vel=BaseVel;
|
||||||
|
Vel.vx+=getRndRange(3)-1;
|
||||||
|
|
||||||
|
sList &Head=moveHead();
|
||||||
|
Head.Ofs=Vel;
|
||||||
|
Head.Vel=Vel;
|
||||||
|
Head.Frame=FRM__SMOKE;
|
||||||
|
Head.Shade=ShadeBase;
|
||||||
|
Head.Scale=ScaleInc;
|
||||||
|
Head.Angle=getRndRange(ONE);
|
||||||
|
}
|
||||||
|
|
||||||
// Move em all
|
// Move em all
|
||||||
int Head=HeadIdx;
|
int Head=HeadIdx;
|
||||||
for (int i=0; i<LIST_SIZE; i++)
|
for (int i=0; i<ListCount; i++)
|
||||||
{
|
{
|
||||||
sList &ThisElem=List[Head];
|
sList &ThisElem=List[Head];
|
||||||
Head++;
|
Head++;
|
||||||
@ -73,22 +94,20 @@ int Head=HeadIdx;
|
|||||||
|
|
||||||
ThisElem.Ofs.vx+=ThisElem.Vel.vx;
|
ThisElem.Ofs.vx+=ThisElem.Vel.vx;
|
||||||
ThisElem.Ofs.vy+=ThisElem.Vel.vy;
|
ThisElem.Ofs.vy+=ThisElem.Vel.vy;
|
||||||
|
|
||||||
|
ThisElem.Angle+=AngleInc;
|
||||||
|
ThisElem.Angle&=4095;
|
||||||
|
ThisElem.Scale+=ScaleInc;
|
||||||
|
if (ThisElem.Scale>ONE*2) ThisElem.Scale=ONE*2;
|
||||||
|
|
||||||
|
ThisElem.Shade-=ShadeDec;
|
||||||
|
if (ThisElem.Shade<0) ThisElem.Shade=0;
|
||||||
|
TotalLife+=ThisElem.Shade;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (DieOut)
|
if (DieOut && TotalLife==0)
|
||||||
{
|
{
|
||||||
int Col;
|
setToShutdown();
|
||||||
Col=ColBase-16;
|
|
||||||
if (Col<0) Col=0;
|
|
||||||
ColBase=Col;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
DVECTOR Vel=BaseVel;
|
|
||||||
Vel.vx+=getRndRange(3)-1;
|
|
||||||
|
|
||||||
setHead(Vel,Vel,FRM__SMOKE,1);
|
|
||||||
if (ListCount<LIST_SIZE) ListCount++;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -21,6 +21,10 @@ virtual void setDie();
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
DVECTOR BaseVel;
|
DVECTOR BaseVel;
|
||||||
|
s16 Angle;
|
||||||
|
s16 ScaleInc;
|
||||||
|
s16 ShadeDec;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -124,7 +124,7 @@
|
|||||||
#include <ACTOR_SPONGEBOB_GLOVE_Anim.h>
|
#include <ACTOR_SPONGEBOB_GLOVE_Anim.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include "fx\fx.h"
|
||||||
/*----------------------------------------------------------------------
|
/*----------------------------------------------------------------------
|
||||||
Tyepdefs && Defines
|
Tyepdefs && Defines
|
||||||
------------------- */
|
------------------- */
|
||||||
@ -672,6 +672,13 @@ void CPlayer::think(int _frames)
|
|||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
#ifdef __USER_daveo__
|
||||||
|
if(PadGetDown(0)&PAD_R1)
|
||||||
|
{
|
||||||
|
TestFX(getPos());
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
if(PadGetDown(0)&PAD_L1&&m_currentMode!=PLAYER_MODE_DEAD)
|
if(PadGetDown(0)&PAD_L1&&m_currentMode!=PLAYER_MODE_DEAD)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user