diff --git a/Adventures in Lestoria/Bullet.cpp b/Adventures in Lestoria/Bullet.cpp index 4d6c9d75..51532510 100644 --- a/Adventures in Lestoria/Bullet.cpp +++ b/Adventures in Lestoria/Bullet.cpp @@ -142,16 +142,24 @@ void Bullet::_Update(const float fElapsedTime){ } void Bullet::Draw()const{ + Pixel blendCol=col; + + blendCol.a=fadeOutTime==0?col.a:uint8_t(util::lerp(col.a,0,1-((fadeOutTime-fadeOutTimer)/fadeOutTime))); + if(GetZ()>0){ vf2d shadowScale=vf2d{8*scale.x/3.f,1}/std::max(1.f,GetZ()/8); game->view.DrawDecal(pos-vf2d{3,3}*shadowScale/2+vf2d{0,12*scale.y},GFX["circle.png"].Decal(),shadowScale,BLACK); } + if(game->GetPlayer()->HasIframes()||game->GetPlayer()->GetZ()>1){ + blendCol.a/=1.59f; //Comes from 255 divided by 160 which is roughly what we want the alpha to be when the bullet has full transparency. + } + if(animated){ - game->view.DrawPartialRotatedDecal(pos-vf2d{0,GetZ()},GetFrame().GetSourceImage()->Decal(),rotates?atan2(vel.y,vel.x)-PI/2:0,GetFrame().GetSourceRect().size/2,GetFrame().GetSourceRect().pos,GetFrame().GetSourceRect().size,scale,fadeOutTime==0?col:Pixel{col.r,col.g,col.b,uint8_t(util::lerp(col.a,0,1-((fadeOutTime-fadeOutTimer)/fadeOutTime)))}); + game->view.DrawPartialRotatedDecal(pos-vf2d{0,GetZ()},GetFrame().GetSourceImage()->Decal(),rotates?atan2(vel.y,vel.x)-PI/2:0,GetFrame().GetSourceRect().size/2,GetFrame().GetSourceRect().pos,GetFrame().GetSourceRect().size,scale,blendCol); }else{ - game->view.DrawDecal(pos-vf2d{0,GetZ()}-GFX["circle.png"].Sprite()->Size()*scale/2,GFX["circle.png"].Decal(),scale,fadeOutTime==0?col:Pixel{col.r,col.g,col.b,uint8_t(util::lerp(col.a,0,1-((fadeOutTime-fadeOutTimer)/fadeOutTime)))}); - game->view.DrawDecal(pos-vf2d{0,GetZ()}-GFX["circle.png"].Sprite()->Size()*scale/2,GFX["circle_outline.png"].Decal(),scale,fadeOutTime==0?WHITE:Pixel{WHITE.r,WHITE.g,WHITE.b,uint8_t(util::lerp(WHITE.a,0,1-((fadeOutTime-fadeOutTimer)/fadeOutTime)))}); + game->view.DrawDecal(pos-vf2d{0,GetZ()}-GFX["circle.png"].Sprite()->Size()*scale/2,GFX["circle.png"].Decal(),scale,blendCol); + game->view.DrawDecal(pos-vf2d{0,GetZ()}-GFX["circle.png"].Sprite()->Size()*scale/2,GFX["circle_outline.png"].Decal(),scale,Pixel{WHITE.r,WHITE.g,WHITE.b,blendCol.a}); } } diff --git a/Adventures in Lestoria/Monster.cpp b/Adventures in Lestoria/Monster.cpp index 8e68319c..9fc1578f 100644 --- a/Adventures in Lestoria/Monster.cpp +++ b/Adventures in Lestoria/Monster.cpp @@ -397,9 +397,9 @@ void Monster::Draw()const{ if(GetZ()>0){ vf2d shadowScale=vf2d{8*GetSizeMult()/3.f,1}/std::max(1.f,GetZ()/24); game->view.DrawDecal(GetPos()-vf2d{3,3}*shadowScale/2+vf2d{0,6*GetSizeMult()},GFX["circle.png"].Decal(),shadowScale,BLACK); - - blendCol.a=160; } + + if(game->GetPlayer()->HasIframes()||OnUpperLevel()!=game->GetPlayer()->OnUpperLevel()||abs(GetZ()-game->GetPlayer()->GetZ())>1)blendCol.a=160; game->view.DrawPartialRotatedDecal(GetPos()-vf2d{0,GetZ()},GetFrame().GetSourceImage()->Decal(),spriteRot,GetFrame().GetSourceRect().size/2,GetFrame().GetSourceRect().pos,GetFrame().GetSourceRect().size,vf2d(GetSizeMult()*(!HasFourWaySprites()&&GetFacingDirection()==Direction::EAST?-1:1),GetSizeMult()),blendCol); if(overlaySprite.length()!=0){ diff --git a/Adventures in Lestoria/Version.h b/Adventures in Lestoria/Version.h index 68b03a7f..cdb4b2d0 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 0 -#define VERSION_BUILD 9261 +#define VERSION_BUILD 9266 #define stringify(a) stringify_(a) #define stringify_(a) #a diff --git a/Adventures in Lestoria/assets/config/Monsters.txt b/Adventures in Lestoria/assets/config/Monsters.txt index 61702248..710087da 100644 --- a/Adventures in Lestoria/assets/config/Monsters.txt +++ b/Adventures in Lestoria/assets/config/Monsters.txt @@ -720,7 +720,7 @@ Monsters # The First Four animations must represent a standing, walking, attack, and death animation. Their names are up to the creator. IDLE = 1, 0.6, Repeat JUMP = 4, 0.2, Repeat - ATTACKING = 2, 0.2, OneShot + ATTACKING = 2, 0.2, Repeat DEATH = 3, 0.15, OneShot ATTACK = 4, 0.1, Repeat } diff --git a/x64/Release/Adventures in Lestoria.exe b/x64/Release/Adventures in Lestoria.exe index 143e3e29..44665c00 100644 Binary files a/x64/Release/Adventures in Lestoria.exe and b/x64/Release/Adventures in Lestoria.exe differ