Add in maximum ranges for energy bolt, fire bolt, and lightning bolt.

pull/35/head
sigonasr2 10 months ago
parent 99674ce6e1
commit 1814c52763
  1. 1
      Adventures in Lestoria/AdventuresInLestoria.cpp
  2. 1
      Adventures in Lestoria/Bullet.h
  3. 4
      Adventures in Lestoria/EnergyBolt.cpp
  4. 22
      Adventures in Lestoria/FireBolt.cpp
  5. 4
      Adventures in Lestoria/LightningBolt.cpp
  6. 2
      Adventures in Lestoria/Version.h
  7. 9
      Adventures in Lestoria/assets/config/classes/Wizard.txt
  8. BIN
      x64/Release/Adventures in Lestoria.exe

@ -664,6 +664,7 @@ void AiL::UpdateBullets(float fElapsedTime){
int iterations=int(std::max(1.f,(b->vel*fElapsedTime).mag()));
int totalIterations=iterations;
vf2d finalBulletPos=b->pos+b->vel*fElapsedTime;
b->distanceTraveled+=totalDistance/24.f*100.f;
const auto CollisionCheck=[&](){
if(b->friendly){
for(Monster&m:MONSTER_LIST){

@ -60,6 +60,7 @@ struct Bullet{
bool alwaysOnTop=false;
protected:
float fadeOutTimer=0;
float distanceTraveled=0.f;
private:
void UpdateFadeTime(float fElapsedTime);
vf2d scale={1,1};

@ -53,6 +53,10 @@ void EnergyBolt::Update(float fElapsedTime){
lastParticleSpawn="Wizard.Auto Attack.ParticleFrequency"_F;
game->AddEffect(std::make_unique<Effect>(pos,"Wizard.Auto Attack.ParticleLifetimeRange"_FRange,"energy_particle.png",upperLevel,"Wizard.Auto Attack.ParticleSizeRange"_FRange,"Wizard.Auto Attack.ParticleFadeoutTime"_F,vf2d{"Wizard.Auto Attack.ParticleSpeedRange"_FRange,"Wizard.Auto Attack.ParticleSpeedRange"_FRange}));
}
if(distanceTraveled>"Wizard.Auto Attack.Max Range"_F){
deactivated=true;
fadeOutTime="Wizard.Auto Attack.BulletHitFadeoutTime"_F;
}
}
bool EnergyBolt::PlayerHit(Player*player)

@ -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);

@ -72,6 +72,10 @@ void LightningBolt::Update(float fElapsedTime){
}break;
}
}
if(distanceTraveled>"Wizard.Ability 2.Max Range"_F){
deactivated=true;
fadeOutTime="Wizard.Ability 2.BulletFadeoutTime"_F;
}
}
bool LightningBolt::PlayerHit(Player*player)

@ -39,7 +39,7 @@ All rights reserved.
#define VERSION_MAJOR 0
#define VERSION_MINOR 3
#define VERSION_PATCH 0
#define VERSION_BUILD 6530
#define VERSION_BUILD 6532
#define stringify(a) stringify_(a)
#define stringify_(a) #a

@ -21,6 +21,9 @@ Wizard
# Whether or not this ability cancels casts.
CancelCast = 0
# Maximum distance this attack will travel before it becomes deactivated.
Max Range = 1000
# When bullet makes contact, how fast the bullet will fade out.
BulletHitFadeoutTime = 0.2
@ -86,6 +89,9 @@ Wizard
# Whether or not this ability cancels casts.
CancelCast = 0
# Maximum distance this attack will travel before it automatically detonates.
Max Range = 1000
Description = Shoots an explosive bolt of fire.
#RGB Values. Color 1 is the circle at full cooldown, Color 2 is the color at empty cooldown.
@ -154,6 +160,9 @@ Wizard
# Whether or not this ability cancels casts.
CancelCast = 0
# Maximum distance this attack will travel before it becomes deactivated.
Max Range = 1000
Description = Shoot an electrically charged bolt, spreads to two other targets upon impact.
#RGB Values. Color 1 is the circle at full cooldown, Color 2 is the color at empty cooldown.

Loading…
Cancel
Save