#include "BulletTypes.h" #include "Effect.h" #include "Crawler.h" #include "DEFINES.h" #include "utils.h" INCLUDE_game EnergyBolt::EnergyBolt(vf2d pos,vf2d vel,float radius,int damage,bool upperLevel,bool friendly,Pixel col) :Bullet(pos,vel,radius,damage, "ENERGY_BOLT",upperLevel,false,INFINITE,true,friendly,col){} void EnergyBolt::Update(float fElapsedTime){ lastParticleSpawn=std::max(0.f,lastParticleSpawn-fElapsedTime); if(lastParticleSpawn==0){ lastParticleSpawn="Wizard.Auto Attack.ParticleFrequency"_F; game->AddEffect(std::make_unique(pos,"Wizard.Auto Attack.ParticleLifetimeRange"_FRange,"ENERGY_PARTICLE",upperLevel,"Wizard.Auto Attack.ParticleSizeRange"_FRange,"Wizard.Auto Attack.ParticleFadeoutTime"_F,vf2d{"Wizard.Auto Attack.ParticleSpeedRange"_FRange,"Wizard.Auto Attack.ParticleSpeedRange"_FRange})); } } bool EnergyBolt::PlayerHit(Player*player) { deactivated=true; fadeOutTime="Wizard.Auto Attack.BulletHitFadeoutTime"_F; game->AddEffect(std::make_unique(player->GetPos(),0,"SPLASH_EFFECT",upperLevel,player->GetSizeMult(),"Wizard.Auto Attack.SplashEffectFadeoutTime"_F)); return false; } bool EnergyBolt::MonsterHit(Monster& monster) { deactivated=true; fadeOutTime="Wizard.Auto Attack.BulletHitFadeoutTime"_F; game->AddEffect(std::make_unique(monster.GetPos(),0,"SPLASH_EFFECT",upperLevel,monster.GetSizeMult(),"Wizard.Auto Attack.SplashEffectFadeoutTime"_F)); return false; }