The open source repository for the action RPG game in development by Sig Productions titled 'Adventures in Lestoria'! https://forums.lestoria.net
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
AdventuresInLestoria/Crawler/EnergyBolt.cpp

33 lines
1.1 KiB

#include "BulletTypes.h"
#include "Effect.h"
#include "Crawler.h"
#include "DEFINES.h"
INCLUDE_game
EnergyBolt::EnergyBolt(vf2d pos,vf2d vel,float radius,int damage,bool friendly,Pixel col)
:Bullet(pos,vel,radius,damage,AnimationState::ENERGY_BOLT,false,INFINITE,true,friendly,col){}
void EnergyBolt::Update(float fElapsedTime){
lastParticleSpawn=std::max(0.f,lastParticleSpawn-fElapsedTime);
if(lastParticleSpawn==0&&animation.GetFrame(internal_animState).GetSourceImage()==&game->GFX_EnergyBolt){
lastParticleSpawn=0.03;
game->AddEffect(Effect(pos,float(rand()%500)/500,AnimationState::ENERGY_PARTICLE,float(rand()%1000)/500,0.5,{float(rand()%60)-30,float(rand()%60)-30}));
}
}
bool EnergyBolt::PlayerHit(Player& player)
{
deactivated=true;
fadeOutTime=0.2f;
game->AddEffect(Effect(player.GetPos(),0,AnimationState::SPLASH_EFFECT,player.GetSizeMult(),0.25));
return false;
}
bool EnergyBolt::MonsterHit(Monster& monster)
{
deactivated=true;
fadeOutTime=0.2f;
game->AddEffect(Effect(monster.GetPos(),0,AnimationState::SPLASH_EFFECT,monster.GetSizeMult(),0.25));
return false;
}