diff --git a/Adventures in Lestoria/Bullet.cpp b/Adventures in Lestoria/Bullet.cpp index bc6e08b2..4a509099 100644 --- a/Adventures in Lestoria/Bullet.cpp +++ b/Adventures in Lestoria/Bullet.cpp @@ -59,8 +59,7 @@ Bullet::Bullet(vf2d pos,vf2d vel,float radius,int damage,std::string animation,b Animate2D::Frame Bullet::GetFrame()const{ return animation.GetFrame(internal_animState); } -void Bullet::UpdateFadeTime(float fElapsedTime) -{ +void Bullet::UpdateFadeTime(float fElapsedTime){ aliveTime+=fElapsedTime; if(fadeInTime>0){ if(fadeInTimer0){ iterations--; + if(IsPlayerAutoAttackProjectile()){pos+=(game->GetWindSpeed()*game->GetElapsedTime())/float(totalIterations);} pos+=(vel*fElapsedTime)/float(totalIterations); if(!CollisionCheck()){ - return; + goto DeadBulletCheck; } } pos=finalBulletPos; if(!CollisionCheck()){ - return; + goto DeadBulletCheck; } }else{ + if(IsPlayerAutoAttackProjectile()){pos+=game->GetWindSpeed()*game->GetElapsedTime();} pos+=vel*fElapsedTime; } - if(IsPlayerAutoAttackProjectile()){pos+=game->GetWindSpeed()*game->GetElapsedTime();} + + DeadBulletCheck: if(/*World size in PIXELS!*/vi2d worldSize=game->GetCurrentMapData().MapSize*game->GetCurrentMapData().TileSize;pos.x+radius<-WINDOW_SIZE.x||pos.x-radius>worldSize.x+WINDOW_SIZE.x||pos.y+radius<-WINDOW_SIZE.y||pos.y-radius>worldSize.y+WINDOW_SIZE.y){ dead=true; return; @@ -194,11 +196,11 @@ BulletDestroyState Bullet::_MonsterHit(Monster&monster){ return destroyBullet; } BulletDestroyState Bullet::PlayerHit(Player*player){ - fadeOutTime=0.25f; + if(!hitsMultiple)fadeOutTime=0.1f; return BulletDestroyState::KEEP_ALIVE; } BulletDestroyState Bullet::MonsterHit(Monster&monster){ - fadeOutTime=0.25f; + if(!hitsMultiple)fadeOutTime=0.1f; return BulletDestroyState::KEEP_ALIVE; } bool Bullet::OnUpperLevel(){return upperLevel;} diff --git a/Adventures in Lestoria/Bullet.h b/Adventures in Lestoria/Bullet.h index ba575564..5c41d821 100644 --- a/Adventures in Lestoria/Bullet.h +++ b/Adventures in Lestoria/Bullet.h @@ -63,7 +63,7 @@ struct Bullet{ bool hitsMultiple=false; bool rotates=false; bool animated=false; - float fadeOutTime=0; //Setting the fade out time causes the bullet's lifetime to be set to the fadeout time as well, as that's when the bullet's alpha will reach 0, so it dies. + float fadeOutTime=0.f; //Setting the fade out time causes the bullet's lifetime to be set to the fadeout time as well, as that's when the bullet's alpha will reach 0, so it dies. bool friendly=false; //Whether or not it's a player bullet or enemy bullet. bool upperLevel=false; bool alwaysOnTop=false; diff --git a/Adventures in Lestoria/DaggerSlash.cpp b/Adventures in Lestoria/DaggerSlash.cpp index 2994df25..b902c997 100644 --- a/Adventures in Lestoria/DaggerSlash.cpp +++ b/Adventures in Lestoria/DaggerSlash.cpp @@ -89,10 +89,12 @@ void DaggerSlash::Update(float fElapsedTime){ BulletDestroyState DaggerSlash::PlayerHit(Player*player){ game->AddEffect(std::make_unique(pos,0,"lightning_splash_effect.png",upperLevel,player->GetSizeMult()*0.25f,0.25,vf2d{})); player->Knockback(util::pointTo(sourceMonster.GetPos(),player->GetPos())*knockbackAmt); + Deactivate(); return BulletDestroyState::KEEP_ALIVE; } BulletDestroyState DaggerSlash::MonsterHit(Monster&monster){ game->AddEffect(std::make_unique(pos,0,"lightning_splash_effect.png",upperLevel,monster.GetSizeMult()*0.25f,0.25,vf2d{})); monster.Knockback(util::pointTo(sourceMonster.GetPos(),monster.GetPos())*knockbackAmt); + Deactivate(); return BulletDestroyState::KEEP_ALIVE; } \ No newline at end of file diff --git a/Adventures in Lestoria/DaggerStab.cpp b/Adventures in Lestoria/DaggerStab.cpp index fc68ac58..f46dfc32 100644 --- a/Adventures in Lestoria/DaggerStab.cpp +++ b/Adventures in Lestoria/DaggerStab.cpp @@ -95,10 +95,12 @@ void DaggerStab::Update(float fElapsedTime){ BulletDestroyState DaggerStab::PlayerHit(Player*player){ game->AddEffect(std::make_unique(pos,0,"lightning_splash_effect.png",upperLevel,player->GetSizeMult()*0.25f,0.25,vf2d{})); player->Knockback(util::pointTo(sourceMonster.GetPos(),player->GetPos())*knockbackAmt); + Deactivate(); return BulletDestroyState::KEEP_ALIVE; } BulletDestroyState DaggerStab::MonsterHit(Monster&monster){ game->AddEffect(std::make_unique(pos,0,"lightning_splash_effect.png",upperLevel,monster.GetSizeMult()*0.25f,0.25,vf2d{})); monster.Knockback(util::pointTo(sourceMonster.GetPos(),monster.GetPos())*knockbackAmt); + Deactivate(); return BulletDestroyState::KEEP_ALIVE; } \ No newline at end of file diff --git a/Adventures in Lestoria/Effect.h b/Adventures in Lestoria/Effect.h index b4173d8c..664eaca6 100644 --- a/Adventures in Lestoria/Effect.h +++ b/Adventures in Lestoria/Effect.h @@ -50,7 +50,7 @@ enum class EffectType{ struct Effect{ friend class AiL; - friend class FallingStone; + friend struct FallingStone; vf2d pos={0,0}; float lifetime=0; float fadeout=0; diff --git a/Adventures in Lestoria/Version.h b/Adventures in Lestoria/Version.h index 849704a0..a0dae699 100644 --- a/Adventures in Lestoria/Version.h +++ b/Adventures in Lestoria/Version.h @@ -39,7 +39,7 @@ All rights reserved. #define VERSION_MAJOR 1 #define VERSION_MINOR 2 #define VERSION_PATCH 3 -#define VERSION_BUILD 10015 +#define VERSION_BUILD 10024 #define stringify(a) stringify_(a) #define stringify_(a) #a diff --git a/x64/Release/Adventures in Lestoria.exe b/x64/Release/Adventures in Lestoria.exe index 73561f59..ba65ad6d 100644 Binary files a/x64/Release/Adventures in Lestoria.exe and b/x64/Release/Adventures in Lestoria.exe differ