This commit is contained in:
parent
8e2367dc3e
commit
dc5e2ec8c4
5 changed files with 75 additions and 39 deletions
|
@ -140,8 +140,8 @@ hazard_src := hazard \
|
|||
hbbarrel
|
||||
|
||||
fx_src := fx \
|
||||
fxtrail \
|
||||
fxfallingtile \
|
||||
fxcloud \
|
||||
fxsteam
|
||||
|
||||
|
||||
|
|
|
@ -14,7 +14,6 @@
|
|||
#include "FX\FX.h"
|
||||
#include "FX\FXjfish.h"
|
||||
#include "FX\FXfallingTile.h"
|
||||
#include "FX\FXCloud.h"
|
||||
#include "FX\FXSteam.h"
|
||||
/* FX
|
||||
|
||||
|
@ -64,6 +63,21 @@ Level Effect Emitters
|
|||
|
||||
*/
|
||||
|
||||
/*****************************************************************************/
|
||||
CFXSteam *TestFXPtr=0;
|
||||
void TestFX(DVECTOR Pos)
|
||||
{
|
||||
if (!TestFXPtr)
|
||||
{
|
||||
TestFXPtr=(CFXSteam*)CFX::Create(CFX::FX_TYPE_STEAM,Pos);
|
||||
}
|
||||
else
|
||||
{
|
||||
TestFXPtr->setDie();
|
||||
TestFXPtr=0;
|
||||
}
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
CFX *CFX::Create(const FX_TYPE Type)
|
||||
{
|
||||
|
@ -74,9 +88,6 @@ CFX *NewFX;
|
|||
case FX_TYPE_FALLINGTILE:
|
||||
NewFX=new ("Falling Tile") CFXFallingTile();
|
||||
break;
|
||||
case FX_TYPE_CLOUD:
|
||||
NewFX=new ("Cloud ") CFXCloud();
|
||||
break;
|
||||
case FX_TYPE_STEAM:
|
||||
NewFX=new ("Steam") CFXSteam();
|
||||
break;
|
||||
|
@ -109,8 +120,8 @@ CFX *NewFX;
|
|||
case FX_TYPE_CASCADE:
|
||||
case FX_TYPE_CASCADE_SPLASH:
|
||||
case FX_TYPE_FIREBALL:
|
||||
case FX_TYPE_CLOUD_SMOKE:
|
||||
case FX_TYPE_CLOUD_GAS:
|
||||
case FX_TYPE_SMOKE:
|
||||
case FX_TYPE_GAS:
|
||||
case FX_TYPE_FLAMES:
|
||||
case FX_TYPE_EXPLODE:
|
||||
case FX_TYPE_DEBRIS:
|
||||
|
|
|
@ -41,10 +41,9 @@ public:
|
|||
FX_TYPE_CASCADE,
|
||||
FX_TYPE_CASCADE_SPLASH,
|
||||
FX_TYPE_FIREBALL,
|
||||
FX_TYPE_CLOUD,
|
||||
FX_TYPE_STEAM,
|
||||
FX_TYPE_CLOUD_SMOKE,
|
||||
FX_TYPE_CLOUD_GAS,
|
||||
FX_TYPE_SMOKE,
|
||||
FX_TYPE_GAS,
|
||||
FX_TYPE_FLAMES,
|
||||
FX_TYPE_EXPLODE,
|
||||
FX_TYPE_DEBRIS,
|
||||
|
@ -68,4 +67,9 @@ protected:
|
|||
s32 OtPos;
|
||||
};
|
||||
|
||||
/*****************************************************************************/
|
||||
/*****************************************************************************/
|
||||
/*****************************************************************************/
|
||||
void TestFX(DVECTOR Pos);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -12,29 +12,21 @@
|
|||
|
||||
#include "FX\FXSteam.h"
|
||||
|
||||
static s16 SteamSize=1;
|
||||
const s16 SteamAngleInc=1111;
|
||||
static const s16 SteamSize=4;
|
||||
static const s16 SteamAngleInc=999;
|
||||
|
||||
int SLife=64;
|
||||
/*****************************************************************************/
|
||||
/*****************************************************************************/
|
||||
/*****************************************************************************/
|
||||
void CFXSteam::init(DVECTOR const &_Pos)
|
||||
{
|
||||
CFXCloud::init(_Pos);
|
||||
Life=SLife;
|
||||
|
||||
RBase=255;
|
||||
GBase=255;
|
||||
BBase=255;
|
||||
RInc=-8;
|
||||
GInc=-8;
|
||||
BInc=-8;
|
||||
CFXTrail::init(_Pos);
|
||||
|
||||
ColBase=255;
|
||||
ColInc=-8;
|
||||
Trans=3;
|
||||
|
||||
DieOut=false;
|
||||
SetSize(SteamSize);
|
||||
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -48,27 +40,55 @@ void CFXSteam::SetSize(int Size)
|
|||
{
|
||||
ScaleInc=(4096/LIST_SIZE)*Size;
|
||||
AngleInc=SteamAngleInc;
|
||||
Vel.vx=0;
|
||||
Vel.vy=-Size;
|
||||
BaseVel.vx=0;
|
||||
BaseVel.vy=-Size;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
void CFXSteam::setDie()
|
||||
{
|
||||
CFXTrail::setDie();
|
||||
for (int i=0; i<LIST_SIZE; i++)
|
||||
{
|
||||
sList &ThisElem=List[i];
|
||||
ThisElem.Vel.vx+=getRndRange(9)-4; // give is x motion
|
||||
ThisElem.Vel.vy+=getRndRange(ThisElem.Vel.vy/2); // Slow down y Inc
|
||||
}
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/*** Think *******************************************************************/
|
||||
/*****************************************************************************/
|
||||
int LifeStart=32;
|
||||
|
||||
void CFXSteam::think(int _frames)
|
||||
{
|
||||
SetSize(SteamSize);
|
||||
CFXCloud::think(_frames);
|
||||
CFX::think(_frames);
|
||||
|
||||
if (!DieOut)
|
||||
// Move em all
|
||||
int Head=HeadIdx;
|
||||
for (int i=0; i<LIST_SIZE; i++)
|
||||
{
|
||||
setHead(Vel,Vel,LifeStart);
|
||||
sList &ThisElem=List[Head];
|
||||
Head++;
|
||||
Head&=LIST_SIZE-1;
|
||||
|
||||
ThisElem.Ofs.vx+=ThisElem.Vel.vx;
|
||||
ThisElem.Ofs.vy+=ThisElem.Vel.vy;
|
||||
}
|
||||
|
||||
Life--;
|
||||
if (!Life) DieOut=true;
|
||||
if (DieOut)
|
||||
{
|
||||
int Col;
|
||||
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++;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -6,10 +6,10 @@
|
|||
#define __FX_FX_STEAM_HEADER__
|
||||
|
||||
#include "fx/fx.h"
|
||||
#include "fx/fxcloud.h"
|
||||
#include "fx/fxtrail.h"
|
||||
|
||||
/*****************************************************************************/
|
||||
class CFXSteam : public CFXCloud
|
||||
class CFXSteam : public CFXTrail
|
||||
{
|
||||
public:
|
||||
virtual void init(DVECTOR const &Pos);
|
||||
|
@ -17,9 +17,10 @@ virtual void shutdown();
|
|||
virtual void think(int _frames);
|
||||
|
||||
void SetSize(int Size);
|
||||
virtual void setDie();
|
||||
|
||||
protected:
|
||||
int Life;
|
||||
DVECTOR Vel;
|
||||
DVECTOR BaseVel;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue