- unit particles now support minHp / mapHp tags

This commit is contained in:
SoftCoder
2014-11-18 21:38:46 -08:00
parent 04bc3b9f06
commit 3b3132ccce
12 changed files with 206 additions and 6 deletions

View File

@@ -58,6 +58,7 @@ public:
public:
Particle() {
speedUpRelative = 0;
size = 0;
energy = 0;
}
@@ -93,6 +94,20 @@ public:
virtual void logParticleInfo(string info)= 0;
};
class ParticleSystemTypeInterface {
public:
ParticleSystemTypeInterface() {};
virtual ~ParticleSystemTypeInterface() {};
virtual bool getMinmaxEnabled() const = 0;
virtual int getMinHp() const = 0;
virtual int getMaxHp() const = 0;
virtual bool getMinmaxIsPercent() const = 0;
};
// =====================================================
// class ParticleSystem
// =====================================================
@@ -344,12 +359,15 @@ private:
float startTime;
float endTime;
ParticleSystemTypeInterface *particleSystemType;
public:
enum Shape{
sLinear, // generated in a sphere, flying in direction
sSpherical, // generated in a sphere, flying away from center
sConical, // generated in a cone at angle from direction
};
bool relative;
bool relativeDirection;
bool fixed;
@@ -376,6 +394,13 @@ public:
virtual ParticleSystemType getParticleSystemType() const { return pst_UnitParticleSystem;}
ParticleSystemTypeInterface * getParticleType() const {
return particleSystemType;
}
void setParticleType(ParticleSystemTypeInterface *type) {
particleSystemType = type;
}
//virtual
virtual void initParticle(Particle *p, int particleIndex);
virtual void updateParticle(Particle *p);

View File

@@ -1009,6 +1009,8 @@ Vec3f UnitParticleSystem::lightColor=Vec3f(1.0f,1.0f,1.0f);
UnitParticleSystem::UnitParticleSystem(int particleCount) :
GameParticleSystem(particleCount), parent(NULL) {
particleSystemType = NULL;
radius= 0.5f;
speed= 0.01f;
windSpeed= Vec3f(0.0f);