diff --git a/Adventures in Lestoria/Animation.cpp b/Adventures in Lestoria/Animation.cpp index be155f05..e8e07798 100644 --- a/Adventures in Lestoria/Animation.cpp +++ b/Adventures in Lestoria/Animation.cpp @@ -410,7 +410,7 @@ void sig::Animation::InitializeAnimations(){ CreateHorizontalAnimationSequence("bear_trap.png",3,{24,24},AnimationData{.frameDuration{0.1f},.style{Animate2D::Style::PingPong}}); CreateHorizontalAnimationSequence("explosive_trap.png",4,{48,48},AnimationData{.frameDuration{0.06f},.style{Animate2D::Style::PingPong}}); - CreateHorizontalAnimationSequence("explosionframes.png",21,{24,24},AnimationData{.frameDuration{0.05f},.style{Animate2D::Style::OneShot}}); + CreateHorizontalAnimationSequence("explosionframes.png",21,{24,24},AnimationData{.frameDuration{0.02f},.style{Animate2D::Style::OneShot}}); for(auto&dat:GFX){ std::string imgFile=dat.first; diff --git a/Adventures in Lestoria/BearTrap.cpp b/Adventures in Lestoria/BearTrap.cpp index e3a3fe84..83863e74 100644 --- a/Adventures in Lestoria/BearTrap.cpp +++ b/Adventures in Lestoria/BearTrap.cpp @@ -72,5 +72,9 @@ BulletDestroyState BearTrap::MonsterHit(Monster&monster,const uint8_t markStacks monster.ApplyMark("Trapper.Ability 2.Marked Target Reset Time"_F,numberOfStacksToReplenish); monster.AddBuff(BuffRestorationType::OVER_TIME,BuffOverTimeType::HP_DAMAGE_OVER_TIME,bleedDuration,bleedDamage,timeBetweenTicks); } + + monster.AddBuff(BuffType::SLOWDOWN,"Trapper.Ability 2.Slowdown Time"_F,"Trapper.Ability 2.Slowdown Amount"_F/100.f); + monster.Knockup("Trapper.Ability 2.Knockup Amount"_F); + return BulletDestroyState::KEEP_ALIVE; } \ No newline at end of file diff --git a/Adventures in Lestoria/BulletTypes.h b/Adventures in Lestoria/BulletTypes.h index 68268f4b..2d684c71 100644 --- a/Adventures in Lestoria/BulletTypes.h +++ b/Adventures in Lestoria/BulletTypes.h @@ -316,6 +316,7 @@ private: float automaticDetonationTime{}; float activationWaitTime{}; float lastBeepTime{}; + uint8_t beepCount{1U}; }; struct PurpleEnergyBall:public Bullet{ diff --git a/Adventures in Lestoria/Effect.cpp b/Adventures in Lestoria/Effect.cpp index ed498e2c..8846f431 100644 --- a/Adventures in Lestoria/Effect.cpp +++ b/Adventures in Lestoria/Effect.cpp @@ -73,6 +73,7 @@ bool Effect::Update(float fElapsedTime){ } } rotation+=rotationSpd*fElapsedTime; + size+=scaleSpd*fElapsedTime; pos+=spd*fElapsedTime; animation.UpdateState(internal_animState,fElapsedTime); return true; @@ -80,14 +81,16 @@ bool Effect::Update(float fElapsedTime){ void Effect::Draw()const{ if(additiveBlending)game->SetDecalMode(DecalMode::ADDITIVE); - if(fadeout==0&&fadein==original_fadeInTime){ - game->view.DrawPartialRotatedDecal(pos,GetFrame().GetSourceImage()->Decal(),rotation,GetFrame().GetSourceRect().size/2,GetFrame().GetSourceRect().pos,GetFrame().GetSourceRect().size,size,col); - }else - if(fadein==original_fadeInTime){ + const bool FadeInFinished{original_fadeInTime==0||fadein==original_fadeInTime}; + const bool HasFadeout{fadeout>0}; + + [[unlikely]]if(!FadeInFinished){ game->view.DrawPartialRotatedDecal(pos,GetFrame().GetSourceImage()->Decal(),rotation,GetFrame().GetSourceRect().size/2,GetFrame().GetSourceRect().pos,GetFrame().GetSourceRect().size,size,{col.r,col.g,col.b,uint8_t(fadein/original_fadeInTime*col.a)}); }else - if(fadeout==0){ + [[likely]]if(HasFadeout){ game->view.DrawPartialRotatedDecal(pos,GetFrame().GetSourceImage()->Decal(),rotation,GetFrame().GetSourceRect().size/2,GetFrame().GetSourceRect().pos,GetFrame().GetSourceRect().size,size,{col.r,col.g,col.b,uint8_t(fadeout/original_fadeOutTime*col.a)}); + }else{ + game->view.DrawPartialRotatedDecal(pos,GetFrame().GetSourceImage()->Decal(),rotation,GetFrame().GetSourceRect().size/2,GetFrame().GetSourceRect().pos,GetFrame().GetSourceRect().size,size,col); } game->SetDecalMode(DecalMode::NORMAL); } diff --git a/Adventures in Lestoria/Effect.h b/Adventures in Lestoria/Effect.h index b8c700e4..1858afa1 100644 --- a/Adventures in Lestoria/Effect.h +++ b/Adventures in Lestoria/Effect.h @@ -54,12 +54,13 @@ struct Effect{ vf2d pos={0,0}; float lifetime=0; float fadeout=0; - float fadein=0; + float fadein{0.f}; vf2d size={1,1}; Pixel col=WHITE; vf2d spd={}; float rotation=0; float rotationSpd=0; + vf2d scaleSpd{}; bool additiveBlending=false; private: bool dead=false; diff --git a/Adventures in Lestoria/ExplosiveTrap.cpp b/Adventures in Lestoria/ExplosiveTrap.cpp index a10dba8e..acfbddb9 100644 --- a/Adventures in Lestoria/ExplosiveTrap.cpp +++ b/Adventures in Lestoria/ExplosiveTrap.cpp @@ -56,19 +56,23 @@ ExplosiveTrap::ExplosiveTrap(vf2d pos,float radius,float explosionRadius,float a void ExplosiveTrap::Update(float fElapsedTime){ const bool trapActivated{radius==activationRadius}; + if(IsDeactivated())return; + if(!trapActivated){ activationWaitTime-=fElapsedTime; if(activationWaitTime<=0.f){ radius=activationRadius; animation.ChangeState(internal_animState,"explosive_trap.png"); - SoundEffect::PlaySFX("Beep",pos); + beepCount=std::min(4U,beepCount+1U); + SoundEffect::PlaySFX(std::format("Beep {}",beepCount),pos); lastBeepTime=1.f; } }else{ automaticDetonationTime-=fElapsedTime; lastBeepTime-=fElapsedTime; if(lastBeepTime<=0.f){ - SoundEffect::PlaySFX("Beep",pos); + beepCount=std::min(4U,beepCount+1U); + SoundEffect::PlaySFX(std::format("Beep {}",beepCount),pos); lastBeepTime=1.f; } if(IsActivated()&&automaticDetonationTime<=0.f)Detonate(); @@ -89,14 +93,16 @@ void ExplosiveTrap::Detonate(){ const HurtList list{game->HurtNotHit(pos,"Trapper.Ability 3.Explosion Radius"_F/100.f*24,damage,hitList,OnUpperLevel(),GetZ(),HurtType::MONSTER,HurtFlag::PLAYER_ABILITY)}; for(const auto&[targetPtr,wasHit]:list){ if(wasHit){ - std::get(targetPtr)->ProximityKnockback(pos,"Trapper.Ability 3.Explosion Knockup Amount"_F); - std::get(targetPtr)->Knockup("Trapper.Ability 3.Explosion Knockup Amount"_F); std::get(targetPtr)->ApplyMark("Trapper.Ability 3.Explosion Mark Stack Time"_F,"Trapper.Ability 3.Explosion Mark Stack Increase"_I); + std::get(targetPtr)->ProximityKnockback(pos,"Trapper.Ability 3.Explosion Knockback Amount"_F); + std::get(targetPtr)->Knockup("Trapper.Ability 3.Explosion Knockup Amount"_F); } } - game->AddEffect(std::make_unique(pos,ANIMATION_DATA["explosionframes.png"].GetTotalAnimationDuration()-0.2f,"explosionframes.png",OnUpperLevel(),scale*2.f,0.2f,vf2d{},WHITE,util::random(2*PI),0.f)); - + std::unique_ptrexplodeEffect{std::make_unique(pos,ANIMATION_DATA["explosionframes.png"].GetTotalAnimationDuration()-0.2f,"explosionframes.png",OnUpperLevel(),scale*2.f,0.2f,vf2d{0,-6.f},WHITE,util::random(2*PI),0.f)}; + explodeEffect->scaleSpd={0.125f,0.125f}; + game->AddEffect(std::move(explodeEffect)); + SoundEffect::PlaySFX("Explosion",pos); Deactivate(); } @@ -105,7 +111,7 @@ BulletDestroyState ExplosiveTrap::MonsterHit(Monster&monster,const uint8_t markS monster.Hurt(0,monster.OnUpperLevel(),monster.GetZ(),HurtFlag::PLAYER_ABILITY);//Triggers mark multiple times after the first mark. } - monster.ProximityKnockback(pos,"Trapper.Ability 3.Explosion Knockup Amount"_F); + monster.ProximityKnockback(pos,"Trapper.Ability 3.Explosion Knockback Amount"_F); monster.Knockup("Trapper.Ability 3.Explosion Knockup Amount"_F); Detonate(); diff --git a/Adventures in Lestoria/Monster.cpp b/Adventures in Lestoria/Monster.cpp index e5a232da..989eec73 100644 --- a/Adventures in Lestoria/Monster.cpp +++ b/Adventures in Lestoria/Monster.cpp @@ -364,7 +364,7 @@ bool Monster::Update(float fElapsedTime){ if(GetState()==State::NORMAL){ UpdateFacingDirection(game->GetPlayer()->GetPos()); } - if(!game->TestingModeEnabled())Monster::STRATEGY::RUN_STRATEGY(*this,fElapsedTime); + if(!game->TestingModeEnabled()&&CanMove())Monster::STRATEGY::RUN_STRATEGY(*this,fElapsedTime); } if(!IsAlive()){ deathTimer+=fElapsedTime; @@ -1298,4 +1298,8 @@ const bool Monster::InUndamageableState(const bool onUpperLevel,const float z)co void Monster::AddBuff(BuffRestorationType type,BuffOverTimeType::BuffOverTimeType overTimeType,float duration,float intensity,float timeBetweenTicks){ buffList.push_back(Buff{this,type,overTimeType,duration,intensity,timeBetweenTicks}); +} + +const bool Monster::CanMove()const{ + return knockUpTimer==0.f&&IsAlive(); } \ No newline at end of file diff --git a/Adventures in Lestoria/Monster.h b/Adventures in Lestoria/Monster.h index af1f0f10..229c9c20 100644 --- a/Adventures in Lestoria/Monster.h +++ b/Adventures in Lestoria/Monster.h @@ -206,6 +206,7 @@ public: //Gets the nearest target that can be immediately targeted static std::optionalGetNearestMonster(const vf2d point,const float maxDistance,const bool onUpperLevel,const float z); const bool InUndamageableState(const bool onUpperLevel,const float z)const; + const bool CanMove()const; private: //NOTE: Marking a monster for deletion does not trigger any death events. It just simply removes the monster from the field!! // The way this works is that monsters marked for deletion will cause the monster update loop to detect there's at least one or more monsters that must be deleted and will call erase_if on the list at the end of the iteration loop. diff --git a/Adventures in Lestoria/PurpleEnergyBall.cpp b/Adventures in Lestoria/PurpleEnergyBall.cpp index 82aea0f4..bc77f198 100644 --- a/Adventures in Lestoria/PurpleEnergyBall.cpp +++ b/Adventures in Lestoria/PurpleEnergyBall.cpp @@ -50,6 +50,7 @@ void PurpleEnergyBall::Update(float fElapsedTime){ void PurpleEnergyBall::Draw(const Pixel blendCol)const{ const vf2d lightOrbScale{initialScale.lerp(initialScale/2.f,sin(12*PI*game->GetRunTime())/2.f+0.5f)}; game->SetDecalMode(DecalMode::ADDITIVE); - + game->DrawPartialDecal(pos,initialScale+0.2f,animation.GetFrame(internal_animState).GetSourceImage()->Decal(),animation.GetFrame(internal_animState).GetSourceRect().pos,animation.GetFrame(internal_animState).GetSourceRect().size); + game->SetDecalMode(DecalMode::NORMAL); Bullet::Draw(blendCol); } \ No newline at end of file diff --git a/Adventures in Lestoria/Version.h b/Adventures in Lestoria/Version.h index 6d2db50b..9d6aeb6d 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 10308 +#define VERSION_BUILD 10324 #define stringify(a) stringify_(a) #define stringify_(a) #a diff --git a/Adventures in Lestoria/Witch.cpp b/Adventures in Lestoria/Witch.cpp index 475e92f8..aaf5d4ce 100644 --- a/Adventures in Lestoria/Witch.cpp +++ b/Adventures in Lestoria/Witch.cpp @@ -48,14 +48,14 @@ INCLUDE_game void Witch::Initialize(){ READFROMCONFIG(Witch,WITCH); - Witch::idle_n="WARRIOR_IDLE_N"; - Witch::idle_e="WARRIOR_IDLE_E"; - Witch::idle_s="WARRIOR_IDLE_S"; - Witch::idle_w="WARRIOR_IDLE_W"; - Witch::walk_n="WARRIOR_WALK_N"; - Witch::walk_e="WARRIOR_WALK_E"; - Witch::walk_s="WARRIOR_WALK_S"; - Witch::walk_w="WARRIOR_WALK_W"; + Witch::idle_n="WITCH_IDLE_N"; + Witch::idle_e="WITCH_IDLE_E"; + Witch::idle_s="WITCH_IDLE_S"; + Witch::idle_w="WITCH_IDLE_W"; + Witch::walk_n="WITCH_WALK_N"; + Witch::walk_e="WITCH_WALK_E"; + Witch::walk_s="WITCH_WALK_S"; + Witch::walk_w="WITCH_WALK_W"; } SETUP_CLASS(Witch) diff --git a/Adventures in Lestoria/assets/config/audio/events.txt b/Adventures in Lestoria/assets/config/audio/events.txt index 23345730..cbdbba6a 100644 --- a/Adventures in Lestoria/assets/config/audio/events.txt +++ b/Adventures in Lestoria/assets/config/audio/events.txt @@ -19,11 +19,29 @@ Events # Specify file names, followed by volume %. Optional min and max pitch adjustment (Defaults are 90%,110%) File[0] = bear_slam.ogg, 70% } - Beep + Beep 1 { CombatSound = True # Specify file names, followed by volume %. Optional min and max pitch adjustment (Defaults are 90%,110%) - File[0] = beep.ogg, 100% + File[0] = beep.ogg, 100%, 70%, 70% + } + Beep 2 + { + CombatSound = True + # Specify file names, followed by volume %. Optional min and max pitch adjustment (Defaults are 90%,110%) + File[0] = beep.ogg, 100%, 90%, 90% + } + Beep 3 + { + CombatSound = True + # Specify file names, followed by volume %. Optional min and max pitch adjustment (Defaults are 90%,110%) + File[0] = beep.ogg, 100%, 110%, 110% + } + Beep 4 + { + CombatSound = True + # Specify file names, followed by volume %. Optional min and max pitch adjustment (Defaults are 90%,110%) + File[0] = beep.ogg, 100%, 130%, 130% } Bomb Explode { @@ -101,6 +119,11 @@ Events # Specify file names, followed by volume %. Optional min and max pitch adjustment (Defaults are 90%,110%) File[0] = equip_ring.ogg, 100% } + Explosion + { + # Specify file names, followed by volume %. Optional min and max pitch adjustment (Defaults are 90%,110%) + File[0] = explosion.ogg, 80% + } Footstep { # Specify file names, followed by volume %. Optional min and max pitch adjustment (Defaults are 90%,110%) @@ -166,7 +189,7 @@ Events { CombatSound = True # Specify file names, followed by volume %. Optional min and max pitch adjustment (Defaults are 90%,110%) - File[0] = lockon.ogg, 100% + File[0] = lockon.ogg, 100%, 140%, 140% } Menu Navigate { diff --git a/Adventures in Lestoria/assets/config/classes/Trapper.txt b/Adventures in Lestoria/assets/config/classes/Trapper.txt index f18027f8..f8ed027f 100644 --- a/Adventures in Lestoria/assets/config/classes/Trapper.txt +++ b/Adventures in Lestoria/assets/config/classes/Trapper.txt @@ -88,6 +88,9 @@ Trapper # % of Attack, Duration, Time per tick Marked Target Bleed = 10%, 10s, 1s Trap Radius = 11px + Knockup Amount = 0.3s + Slowdown Amount = 100% + Slowdown Time = 0.6s #RGB Values. Color 1 is the circle at full cooldown, Color 2 is the color at empty cooldown. Cooldown Bar Color 1 = 64, 0, 0, 192 @@ -120,7 +123,7 @@ Trapper Trap Radius = 17px - Explosion Knockback Amount = 250 + Explosion Knockback Amount = 200 Explosion Knockup Amount = 0.6s #RGB Values. Color 1 is the circle at full cooldown, Color 2 is the color at empty cooldown. diff --git a/Adventures in Lestoria/assets/sounds/explosion.ogg b/Adventures in Lestoria/assets/sounds/explosion.ogg new file mode 100644 index 00000000..d813d5e9 Binary files /dev/null and b/Adventures in Lestoria/assets/sounds/explosion.ogg differ diff --git a/x64/Release/Adventures in Lestoria.exe b/x64/Release/Adventures in Lestoria.exe index c793707f..39c1f51d 100644 Binary files a/x64/Release/Adventures in Lestoria.exe and b/x64/Release/Adventures in Lestoria.exe differ