Skip to content

Commit 813e4de

Browse files
committed
Implement FXList nuggets
1 parent f18391c commit 813e4de

File tree

2 files changed

+81
-3
lines changed

2 files changed

+81
-3
lines changed

src/game/client/fxlist.cpp

+28
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ static const FieldParse s_theFXListFieldParse[] = {
4747
{ "TerrainScorch", reinterpret_cast<inifieldparse_t>(PICK_ADDRESS(0x004CAC80, 0x00760F20)) /*&TerrainScorchFXNugget::Parse */, nullptr, 0 },
4848
{ "ParticleSystem", reinterpret_cast<inifieldparse_t>(PICK_ADDRESS(0x004CAE10, 0x00761350)) /*&ParticleSystemFXNugget::Parse */, nullptr, 0 },
4949
{ "FXListAtBonePos", reinterpret_cast<inifieldparse_t>(PICK_ADDRESS(0x004CB8E0, 0x00761D00)) /*&FXListAtBonePosFXNugget::Parse */, nullptr, 0 },
50+
#else
51+
{ "ParticleSystem", &ParticleSystemFXNugget::Parse, nullptr, 0 },
5052
#endif
5153
{ nullptr, nullptr, nullptr, 0 },
5254
};
@@ -132,3 +134,29 @@ void SoundFXNugget::Parse(INI *ini, void *formal, void *, const void *)
132134
ini->Init_From_INI(nugget, _fieldParse);
133135
reinterpret_cast<FXList *>(formal)->Add_FXNugget(nugget);
134136
}
137+
138+
void ParticleSystemFXNugget::Do_FX_Pos(
139+
const Coord3D *primary, const Matrix3D *primary_mtx, float primary_speed, const Coord3D *secondary, float radius) const
140+
{
141+
captainslog_dbgassert(false, "ParticleSystemFXNugget::Do_FX_Pos not implemented!");
142+
}
143+
144+
void ParticleSystemFXNugget::Do_FX_Obj(const Object *primary, const Object *secondary) const
145+
{
146+
captainslog_dbgassert(false, "ParticleSystemFXNugget::Do_FX_Obj not implemented!");
147+
}
148+
149+
void ParticleSystemFXNugget::Parse(INI *ini, void *formal, void *, const void *)
150+
{
151+
static const FieldParse _fieldParse[] = {
152+
{ "Name", INI::Parse_AsciiString, nullptr, offsetof(ParticleSystemFXNugget, m_sysName) },
153+
{ "Height", &GameClientRandomVariable::Parse, nullptr, offsetof(ParticleSystemFXNugget, m_height) },
154+
{ "OrientToObject", INI::Parse_Bool, nullptr, offsetof(ParticleSystemFXNugget, m_orientToObject) },
155+
{ "Ricochet", INI::Parse_Bool, nullptr, offsetof(ParticleSystemFXNugget, m_ricochet) },
156+
{ nullptr, nullptr, nullptr, 0 },
157+
};
158+
159+
ParticleSystemFXNugget *nugget = new ParticleSystemFXNugget{};
160+
ini->Init_From_INI(nugget, _fieldParse);
161+
reinterpret_cast<FXList *>(formal)->Add_FXNugget(nugget);
162+
}

src/game/client/fxlist.h

+53-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@
1515
#pragma once
1616

1717
#include "always.h"
18+
#include "color.h"
1819
#include "namekeygenerator.h"
20+
#include "randomvalue.h"
1921
#include "rtsutils.h"
2022
#include "subsysteminterface.h"
2123
#include <list>
@@ -36,7 +38,7 @@ class FXNugget : public MemoryPoolObject
3638
IMPLEMENT_ABSTRACT_POOL(FXNugget);
3739

3840
public:
39-
virtual ~FXNugget(){};
41+
virtual ~FXNugget() {};
4042
virtual void Do_FX_Pos(const Coord3D *primary,
4143
const Matrix3D *primary_mtx,
4244
float primary_speed,
@@ -103,8 +105,8 @@ class SoundFXNugget : public FXNugget
103105
IMPLEMENT_POOL(SoundFXNugget);
104106

105107
public:
106-
SoundFXNugget(){};
107-
virtual ~SoundFXNugget() override{};
108+
SoundFXNugget() {};
109+
virtual ~SoundFXNugget() override {};
108110

109111
virtual void Do_FX_Pos(const Coord3D *primary,
110112
const Matrix3D *primary_mtx,
@@ -118,3 +120,51 @@ class SoundFXNugget : public FXNugget
118120
private:
119121
Utf8String m_soundName;
120122
};
123+
124+
class LightPulseFXNugget : public FXNugget
125+
{
126+
IMPLEMENT_POOL(LightPulseFXNugget);
127+
128+
public:
129+
LightPulseFXNugget() {};
130+
virtual ~LightPulseFXNugget() override {};
131+
132+
virtual void Do_FX_Pos(const Coord3D *primary,
133+
const Matrix3D *primary_mtx,
134+
float primary_speed,
135+
const Coord3D *secondary,
136+
float radius) const override;
137+
virtual void Do_FX_Obj(const Object *primary, const Object *secondary) const override;
138+
139+
static void Parse(INI *ini, void *formal, void *, const void *);
140+
141+
private:
142+
RGBColor m_color;
143+
int m_radius;
144+
int m_increaseTime;
145+
int m_decreaseTime;
146+
};
147+
148+
class ParticleSystemFXNugget : public FXNugget
149+
{
150+
IMPLEMENT_POOL(ParticleSystemFXNugget);
151+
152+
public:
153+
ParticleSystemFXNugget() {};
154+
virtual ~ParticleSystemFXNugget() override {};
155+
156+
virtual void Do_FX_Pos(const Coord3D *primary,
157+
const Matrix3D *primary_mtx,
158+
float primary_speed,
159+
const Coord3D *secondary,
160+
float radius) const override;
161+
virtual void Do_FX_Obj(const Object *primary, const Object *secondary) const override;
162+
163+
static void Parse(INI *ini, void *formal, void *, const void *);
164+
165+
private:
166+
Utf8String m_sysName;
167+
GameClientRandomVariable m_height;
168+
bool m_orientToObject;
169+
bool m_ricochet;
170+
};

0 commit comments

Comments
 (0)