diff --git a/Adventures in Lestoria/AdventuresInLestoria.cpp b/Adventures in Lestoria/AdventuresInLestoria.cpp index 494238bb..7112fd27 100644 --- a/Adventures in Lestoria/AdventuresInLestoria.cpp +++ b/Adventures in Lestoria/AdventuresInLestoria.cpp @@ -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){ diff --git a/Adventures in Lestoria/Bullet.h b/Adventures in Lestoria/Bullet.h index f0080acd..a6a3bd24 100644 --- a/Adventures in Lestoria/Bullet.h +++ b/Adventures in Lestoria/Bullet.h @@ -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}; diff --git a/Adventures in Lestoria/EnergyBolt.cpp b/Adventures in Lestoria/EnergyBolt.cpp index 8f5906d3..3497bbc5 100644 --- a/Adventures in Lestoria/EnergyBolt.cpp +++ b/Adventures in Lestoria/EnergyBolt.cpp @@ -53,6 +53,10 @@ void EnergyBolt::Update(float fElapsedTime){ lastParticleSpawn="Wizard.Auto Attack.ParticleFrequency"_F; game->AddEffect(std::make_unique(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) diff --git a/Adventures in Lestoria/FireBolt.cpp b/Adventures in Lestoria/FireBolt.cpp index 685e0c3f..e3c8ae4f 100644 --- a/Adventures in Lestoria/FireBolt.cpp +++ b/Adventures in Lestoria/FireBolt.cpp @@ -55,12 +55,34 @@ void FireBolt::Update(float fElapsedTime){ lastParticleSpawn="Wizard.Ability 1.ParticleFrequency"_F; game->AddEffect(std::make_unique(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(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{pos,"Wizard.Ability 1.BulletHitExplosionRange"_F/100*12},geom2d::circle{game->GetPlayer()->GetPos(),12.f})){ + game->GetPlayer()->Hurt(damage,OnUpperLevel(),0.f); + } + } + game->AddEffect(std::make_unique(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(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(player->GetPos(),0,"splash_effect.png",upperLevel,5,0.25,vf2d{},Pixel{240,120,60})); SoundEffect::PlaySFX("Wizard Fire Bolt Hit",pos); diff --git a/Adventures in Lestoria/LightningBolt.cpp b/Adventures in Lestoria/LightningBolt.cpp index 68c23caf..fb793197 100644 --- a/Adventures in Lestoria/LightningBolt.cpp +++ b/Adventures in Lestoria/LightningBolt.cpp @@ -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) diff --git a/Adventures in Lestoria/Version.h b/Adventures in Lestoria/Version.h index 35e4d26d..4d1f361c 100644 --- a/Adventures in Lestoria/Version.h +++ b/Adventures in Lestoria/Version.h @@ -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 diff --git a/Adventures in Lestoria/assets/config/classes/Wizard.txt b/Adventures in Lestoria/assets/config/classes/Wizard.txt index 8281e20d..b9e4a900 100644 --- a/Adventures in Lestoria/assets/config/classes/Wizard.txt +++ b/Adventures in Lestoria/assets/config/classes/Wizard.txt @@ -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. diff --git a/x64/Release/Adventures in Lestoria.exe b/x64/Release/Adventures in Lestoria.exe index d6aad754..eb708dd8 100644 Binary files a/x64/Release/Adventures in Lestoria.exe and b/x64/Release/Adventures in Lestoria.exe differ