@ -50,6 +50,7 @@ enum class EffectType{
SPELL_CIRCLE ,
SPELL_CIRCLE ,
MONSTER_SOUL ,
MONSTER_SOUL ,
BLINK_PORTAL ,
BLINK_PORTAL ,
TRAIL_OF_FIRE ,
} ;
} ;
struct Effect {
struct Effect {
@ -76,7 +77,8 @@ public:
Effect ( vf2d pos , float lifetime , const std : : string & imgFile , bool upperLevel , float fadein , float fadeout , vf2d size , vf2d spd , EffectType type , Pixel col = WHITE , float rotation = 0 , float rotationSpd = 0 , bool additiveBlending = false ) ;
Effect ( vf2d pos , float lifetime , const std : : string & imgFile , bool upperLevel , float fadein , float fadeout , vf2d size , vf2d spd , EffectType type , Pixel col = WHITE , float rotation = 0 , float rotationSpd = 0 , bool additiveBlending = false ) ;
virtual bool Update ( float fElapsedTime ) ;
virtual bool Update ( float fElapsedTime ) ;
Animate2D : : Frame GetFrame ( ) const ;
Animate2D : : Frame GetFrame ( ) const ;
virtual void Draw ( ) const ;
void _Draw ( ) const ;
virtual void Draw ( const Pixel blendCol ) const ;
bool OnUpperLevel ( ) ;
bool OnUpperLevel ( ) ;
const EffectType GetType ( ) const ;
const EffectType GetType ( ) const ;
const float GetZ ( ) const ;
const float GetZ ( ) const ;
@ -98,7 +100,7 @@ struct Meteor:Effect{
float startLifetime = 0 ;
float startLifetime = 0 ;
bool shakeField = false ;
bool shakeField = false ;
bool Update ( float fElapsedTime ) override ;
bool Update ( float fElapsedTime ) override ;
void Draw ( ) const override ;
void Draw ( const Pixel blendCol ) const override ;
} ;
} ;
struct PulsatingFire : Effect {
struct PulsatingFire : Effect {
@ -107,7 +109,7 @@ struct PulsatingFire:Effect{
float lastParticleTimer = 0 ;
float lastParticleTimer = 0 ;
float lastDamageTimer = 0 ;
float lastDamageTimer = 0 ;
bool Update ( float fElapsedTime ) override ;
bool Update ( float fElapsedTime ) override ;
void Draw ( ) const override ;
void Draw ( const Pixel blendCol ) const override ;
} ;
} ;
struct SwordSlash : Effect {
struct SwordSlash : Effect {
@ -123,7 +125,7 @@ private:
struct ForegroundEffect : Effect {
struct ForegroundEffect : Effect {
ForegroundEffect ( vf2d pos , float lifetime , std : : string imgFile , bool upperLevel , float size = 1.0f , float fadeout = 0.0f , vf2d spd = { } , Pixel col = WHITE , float rotation = 0 , float rotationSpd = 0 , bool additiveBlending = false ) ;
ForegroundEffect ( vf2d pos , float lifetime , std : : string imgFile , bool upperLevel , float size = 1.0f , float fadeout = 0.0f , vf2d spd = { } , Pixel col = WHITE , float rotation = 0 , float rotationSpd = 0 , bool additiveBlending = false ) ;
ForegroundEffect ( vf2d pos , float lifetime , std : : string imgFile , bool upperLevel , vf2d size = { 1 , 1 } , float fadeout = 0.0f , vf2d spd = { } , Pixel col = WHITE , float rotation = 0 , float rotationSpd = 0 , bool additiveBlending = false ) ;
ForegroundEffect ( vf2d pos , float lifetime , std : : string imgFile , bool upperLevel , vf2d size = { 1 , 1 } , float fadeout = 0.0f , vf2d spd = { } , Pixel col = WHITE , float rotation = 0 , float rotationSpd = 0 , bool additiveBlending = false ) ;
virtual void Draw ( ) const override final ;
virtual void Draw ( const Pixel blendCol ) const override final ;
} ;
} ;
struct SpellCircle : Effect {
struct SpellCircle : Effect {
@ -131,7 +133,7 @@ struct SpellCircle:Effect{
SpellCircle ( vf2d pos , float lifetime , std : : string imgFile , std : : string spellInsigniaFile , bool upperLevel , vf2d size = { 1 , 1 } , float fadeout = 0.0f , vf2d spd = { } , Pixel col = WHITE , float rotation = 0 , float rotationSpd = 0 , bool additiveBlending = false , vf2d insigniaSize = { 1 , 1 } , float insigniaFadeout = 0.0f , vf2d insigniaSpd = { } , Pixel insigniaCol = WHITE , float insigniaRotation = 0 , float insigniaRotationSpd = 0 , bool insigniaAdditiveBlending = false ) ;
SpellCircle ( vf2d pos , float lifetime , std : : string imgFile , std : : string spellInsigniaFile , bool upperLevel , vf2d size = { 1 , 1 } , float fadeout = 0.0f , vf2d spd = { } , Pixel col = WHITE , float rotation = 0 , float rotationSpd = 0 , bool additiveBlending = false , vf2d insigniaSize = { 1 , 1 } , float insigniaFadeout = 0.0f , vf2d insigniaSpd = { } , Pixel insigniaCol = WHITE , float insigniaRotation = 0 , float insigniaRotationSpd = 0 , bool insigniaAdditiveBlending = false ) ;
Effect spellInsignia { vf2d { } , 0.f , " spell_insignia.png " , false , { } } ;
Effect spellInsignia { vf2d { } , 0.f , " spell_insignia.png " , false , { } } ;
virtual bool Update ( float fElapsedTime ) override final ;
virtual bool Update ( float fElapsedTime ) override final ;
virtual void Draw ( ) const override final ;
virtual void Draw ( const Pixel blendCol ) const override final ;
} ;
} ;
struct RockLaunch : Effect {
struct RockLaunch : Effect {
@ -156,7 +158,7 @@ private:
struct MonsterSoul : Effect {
struct MonsterSoul : Effect {
MonsterSoul ( vf2d pos , float fadeoutTime , float size , vf2d spd , Pixel col , float rotation , float rotationSpd , bool additiveBlending = false ) ;
MonsterSoul ( vf2d pos , float fadeoutTime , float size , vf2d spd , Pixel col , float rotation , float rotationSpd , bool additiveBlending = false ) ;
virtual bool Update ( float fElapsedTime ) override final ;
virtual bool Update ( float fElapsedTime ) override final ;
virtual void Draw ( ) const override final ;
virtual void Draw ( const Pixel blendCol ) const override final ;
public :
public :
enum Phase {
enum Phase {
RISING ,
RISING ,
@ -175,7 +177,7 @@ struct FadeInOutEffect:Effect{
//A version with oscillators for position and colors, for extra animation effects!
//A version with oscillators for position and colors, for extra animation effects!
FadeInOutEffect ( Oscillator < vf2d > pos , const std : : string & img , float lifetime , bool onUpperLevel , Oscillator < vf2d > size , vf2d spd , Oscillator < Pixel > col , float rotation , float rotationSpd , bool additiveBlending = false , float particleSpawnFreq = 0.f , const std : : function < Effect ( const Effect & self ) > & particleGenerator = { } ) ;
FadeInOutEffect ( Oscillator < vf2d > pos , const std : : string & img , float lifetime , bool onUpperLevel , Oscillator < vf2d > size , vf2d spd , Oscillator < Pixel > col , float rotation , float rotationSpd , bool additiveBlending = false , float particleSpawnFreq = 0.f , const std : : function < Effect ( const Effect & self ) > & particleGenerator = { } ) ;
virtual bool Update ( float fElapsedTime ) override ;
virtual bool Update ( float fElapsedTime ) override ;
virtual void Draw ( ) const override ;
virtual void Draw ( const Pixel blendCol ) const override ;
std : : function < Effect ( const Effect & self ) > particleGenerator ;
std : : function < Effect ( const Effect & self ) > particleGenerator ;
const float particleSpawnFreq ;
const float particleSpawnFreq ;
Oscillator < vf2d > posOscillator ;
Oscillator < vf2d > posOscillator ;