|
|
|
@ -55,12 +55,34 @@ void FireBolt::Update(float fElapsedTime){ |
|
|
|
|
lastParticleSpawn="Wizard.Ability 1.ParticleFrequency"_F; |
|
|
|
|
game->AddEffect(std::make_unique<Effect>(pos,"Wizard.Ability 1.ParticleLifetimeRange"_FRange,"energy_particle.png",upperLevel,"Wizard.Ability 1.ParticleSizeRange"_FRange,"Wizard.Ability 1.ParticleFadeoutTime"_F,vf2d{"Wizard.Ability 1.ParticleXSpeedRange"_FRange,"Wizard.Ability 1.ParticleYSpeedRange"_FRange},Pixel{uint8_t("Wizard.Ability 1.ParticleRedRange"_FRange),uint8_t("Wizard.Ability 1.ParticleGreenRange"_FRange),uint8_t("Wizard.Ability 1.ParticleBlueRange"_FRange),uint8_t("Wizard.Ability 1.ParticleAlphaRange"_FRange)})); |
|
|
|
|
} |
|
|
|
|
if(distanceTraveled>"Wizard.Ability 1.Max Range"_F){ |
|
|
|
|
deactivated=true; |
|
|
|
|
fadeOutTime="Wizard.Ability 1.BulletHitFadeoutTime"_F; |
|
|
|
|
for(int i=0;i<"Wizard.Ability 1.BulletHitExplosionParticleCount"_I;i++){ |
|
|
|
|
game->AddEffect(std::make_unique<Effect>(pos,"Wizard.Ability 1.BulletHitExplosionParticleLifetimeRange"_FRange,"circle.png",upperLevel,"Wizard.Ability 1.BulletHitExplosionParticleSizeRange"_FRange,"Wizard.Ability 1.BulletHitExplosionParticleFadeoutTimeRange"_FRange,vf2d{"Wizard.Ability 1.BulletHitExplosionParticleSpeedRange"_FRange,"Wizard.Ability 1.BulletHitExplosionParticleSpeedRange"_FRange},Pixel{uint8_t("Wizard.Ability 1.BulletHitExplosionParticleRedRange"_FRange),uint8_t("Wizard.Ability 1.BulletHitExplosionParticleGreenRange"_FRange),uint8_t("Wizard.Ability 1.BulletHitExplosionParticleBlueRange"_FRange),uint8_t("Wizard.Ability 1.BulletHitExplosionParticleAlphaRange"_FRange)})); |
|
|
|
|
} |
|
|
|
|
game->SetupWorldShake("Wizard.Ability 1.WorldShakeTime"_F); |
|
|
|
|
if(friendly){ |
|
|
|
|
game->HurtEnemies(pos,"Wizard.Ability 1.BulletHitExplosionRange"_F/100*12,int("Wizard.Ability 1.BulletHitExplosionDamageMult"_F*game->GetPlayer()->GetAttack()),OnUpperLevel(),0); |
|
|
|
|
}else{ |
|
|
|
|
if(geom2d::overlaps(geom2d::circle<float>{pos,"Wizard.Ability 1.BulletHitExplosionRange"_F/100*12},geom2d::circle<float>{game->GetPlayer()->GetPos(),12.f})){ |
|
|
|
|
game->GetPlayer()->Hurt(damage,OnUpperLevel(),0.f); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
game->AddEffect(std::make_unique<Effect>(pos,0,"splash_effect.png",upperLevel,"Wizard.Ability 1.BulletHitExplosionRange"_F/100*2,"Wizard.Ability 1.BulletHitExplosionFadeoutTime"_F,vf2d{},"Wizard.Ability 1.BulletHitExplosionColor"_Pixel)); |
|
|
|
|
|
|
|
|
|
SoundEffect::PlaySFX("Wizard Fire Bolt Hit",pos); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
bool FireBolt::PlayerHit(Player*player) |
|
|
|
|
{ |
|
|
|
|
deactivated=true; |
|
|
|
|
fadeOutTime="Wizard.Ability 1.BulletHitFadeoutTime"_F; |
|
|
|
|
for(int i=0;i<"Wizard.Ability 1.BulletHitExplosionParticleCount"_I;i++){ |
|
|
|
|
game->AddEffect(std::make_unique<Effect>(player->GetPos(),"Wizard.Ability 1.BulletHitExplosionParticleLifetimeRange"_FRange,"circle.png",upperLevel,"Wizard.Ability 1.BulletHitExplosionParticleSizeRange"_FRange,"Wizard.Ability 1.BulletHitExplosionParticleFadeoutTimeRange"_FRange,vf2d{"Wizard.Ability 1.BulletHitExplosionParticleSpeedRange"_FRange,"Wizard.Ability 1.BulletHitExplosionParticleSpeedRange"_FRange},Pixel{uint8_t("Wizard.Ability 1.BulletHitExplosionParticleRedRange"_FRange),uint8_t("Wizard.Ability 1.BulletHitExplosionParticleGreenRange"_FRange),uint8_t("Wizard.Ability 1.BulletHitExplosionParticleBlueRange"_FRange),uint8_t("Wizard.Ability 1.BulletHitExplosionParticleAlphaRange"_FRange)})); |
|
|
|
|
|
|
|
|
|
game->SetupWorldShake("Wizard.Ability 1.WorldShakeTime"_F);} |
|
|
|
|
game->AddEffect(std::make_unique<Effect>(player->GetPos(),0,"splash_effect.png",upperLevel,5,0.25,vf2d{},Pixel{240,120,60})); |
|
|
|
|
|
|
|
|
|
SoundEffect::PlaySFX("Wizard Fire Bolt Hit",pos); |
|
|
|
|