diff --git a/Adventures in Lestoria/BulletTypes.h b/Adventures in Lestoria/BulletTypes.h index c9818378..c1a14147 100644 --- a/Adventures in Lestoria/BulletTypes.h +++ b/Adventures in Lestoria/BulletTypes.h @@ -114,10 +114,11 @@ enum class HorizontalFlip{ struct DaggerStab:public Bullet{ struct DirectionOffsets{ std::unordered_mapoffsets; - DirectionOffsets(const vf2d upOffset,const vf2d downOffset,const vf2d leftOffset){ + DirectionOffsets(const vf2d upOffset,const vf2d downOffset,const vf2d rightOffset,const vf2d leftOffset){ offsets[Direction::NORTH]=upOffset; offsets[Direction::SOUTH]=downOffset; - offsets[Direction::EAST]=offsets[Direction::WEST]=leftOffset; //Both east and west use one offset because the sprite flipping system will handle flipping the position of the dagger for the other side. + offsets[Direction::EAST]=rightOffset; + offsets[Direction::WEST]=leftOffset; } }; @@ -127,8 +128,7 @@ struct DaggerStab:public Bullet{ float daggerStabDistance; float knockbackAmt; DirectionOffsets daggerPositionOffsets; - HorizontalFlip horizontalFlip; - DaggerStab(Monster&sourceMonster,float radius,int damage,const float knockbackAmt,bool upperLevel,const Direction facingDir,const float daggerFrameDuration,const float daggerStabDistance,const HorizontalFlip horizontalFlip,const DirectionOffsets offsets,bool friendly=false,Pixel col=WHITE); + DaggerStab(Monster&sourceMonster,float radius,int damage,const float knockbackAmt,bool upperLevel,const Direction facingDir,const float daggerFrameDuration,const float daggerStabDistance,const DirectionOffsets offsets,bool friendly=false,Pixel col=WHITE); void Update(float fElapsedTime)override; bool PlayerHit(Player*player)override; bool MonsterHit(Monster&monster)override; @@ -141,8 +141,7 @@ struct DaggerSlash:public Bullet{ float frameDuration; float daggerSlashDistance; float knockbackAmt; - HorizontalFlip horizontalFlip; - DaggerSlash(Monster&sourceMonster,float radius,int damage,const float knockbackAmt,bool upperLevel,const Direction facingDir,const float daggerFrameDuration,const float daggerSlashDistance,const HorizontalFlip horizontalFlip,bool friendly=false,Pixel col=WHITE); + DaggerSlash(Monster&sourceMonster,float radius,int damage,const float knockbackAmt,bool upperLevel,const Direction facingDir,const float daggerFrameDuration,const float daggerSlashDistance,bool friendly=false,Pixel col=WHITE); void Update(float fElapsedTime)override; bool PlayerHit(Player*player)override; bool MonsterHit(Monster&monster)override; diff --git a/Adventures in Lestoria/DaggerSlash.cpp b/Adventures in Lestoria/DaggerSlash.cpp index 695a101b..180076f2 100644 --- a/Adventures in Lestoria/DaggerSlash.cpp +++ b/Adventures in Lestoria/DaggerSlash.cpp @@ -45,9 +45,9 @@ All rights reserved. INCLUDE_game INCLUDE_ANIMATION_DATA -DaggerSlash::DaggerSlash(Monster&sourceMonster,float radius,int damage,const float knockbackAmt,bool upperLevel,const Direction facingDir,const float daggerFrameDuration,const float daggerSlashDistance,const HorizontalFlip horizontalFlip,bool friendly,Pixel col) +DaggerSlash::DaggerSlash(Monster&sourceMonster,float radius,int damage,const float knockbackAmt,bool upperLevel,const Direction facingDir,const float daggerFrameDuration,const float daggerSlashDistance,bool friendly,Pixel col) :Bullet(sourceMonster.GetPos(),{},radius,damage,"goblin_sword_slash.png",upperLevel,false,daggerFrameDuration*ANIMATION_DATA["goblin_sword_slash.png"].GetFrameCountBasedOnAnimationStyle(),true,friendly,col), - sourceMonster(sourceMonster),frameDuration(daggerFrameDuration),daggerSlashDistance(daggerSlashDistance),facingDir(facingDir),horizontalFlip(horizontalFlip),knockbackAmt(knockbackAmt){} + sourceMonster(sourceMonster),frameDuration(daggerFrameDuration),daggerSlashDistance(daggerSlashDistance),facingDir(facingDir),knockbackAmt(knockbackAmt){} void DaggerSlash::Update(float fElapsedTime){ ANIMATION_DATA["goblin_sword_slash.png"].ChangeFrameDuration(frameDuration); pos=sourceMonster.GetPos(); diff --git a/Adventures in Lestoria/DaggerStab.cpp b/Adventures in Lestoria/DaggerStab.cpp index 899cf02c..cd4f8d02 100644 --- a/Adventures in Lestoria/DaggerStab.cpp +++ b/Adventures in Lestoria/DaggerStab.cpp @@ -45,14 +45,13 @@ All rights reserved. INCLUDE_game INCLUDE_ANIMATION_DATA -DaggerStab::DaggerStab(Monster&sourceMonster,float radius,int damage,const float knockbackAmt,bool upperLevel,const Direction facingDir,const float daggerFrameDuration,const float daggerStabDistance,const HorizontalFlip horizontalFlip,const DirectionOffsets offsets,bool friendly,Pixel col) +DaggerStab::DaggerStab(Monster&sourceMonster,float radius,int damage,const float knockbackAmt,bool upperLevel,const Direction facingDir,const float daggerFrameDuration,const float daggerStabDistance,const DirectionOffsets offsets,bool friendly,Pixel col) :Bullet(sourceMonster.GetPos(),{},radius,damage,"dagger_stab.png",upperLevel,false,daggerFrameDuration*ANIMATION_DATA["dagger_stab.png"].GetFrameCountBasedOnAnimationStyle(),true,friendly,col), - sourceMonster(sourceMonster),frameDuration(daggerFrameDuration),daggerStabDistance(daggerStabDistance),facingDir(facingDir),daggerPositionOffsets(offsets),horizontalFlip(horizontalFlip),knockbackAmt(knockbackAmt){} + sourceMonster(sourceMonster),frameDuration(daggerFrameDuration),daggerStabDistance(daggerStabDistance),facingDir(facingDir),daggerPositionOffsets(offsets),knockbackAmt(knockbackAmt){} void DaggerStab::Update(float fElapsedTime){ ANIMATION_DATA["dagger_stab.png"].ChangeFrameDuration(frameDuration); #pragma region Dagger Position Offset vf2d daggerOffset=daggerPositionOffsets.offsets[facingDir]; - if(horizontalFlip==HorizontalFlip::FLIPPED)daggerOffset.x*=-1; pos=sourceMonster.GetPos()+daggerOffset; #pragma endregion #pragma region Dagger stabbing diff --git a/Adventures in Lestoria/Goblin_Dagger.cpp b/Adventures in Lestoria/Goblin_Dagger.cpp index b08e4a4a..52eaa654 100644 --- a/Adventures in Lestoria/Goblin_Dagger.cpp +++ b/Adventures in Lestoria/Goblin_Dagger.cpp @@ -66,15 +66,6 @@ void Monster::STRATEGY::GOBLIN_DAGGER(Monster&m,float fElapsedTime,std::string s SLASH }; - enum class ANIMATION_OFFSET{ - STAB_WINDUP_ANIMATION=0, - STAB_ANIMATION=4, - SLASH_WINDUP_ANIMATION=8, - SLASH_ANIMATION=12, - IDLE_ANIMATION=16, - }; - - using enum ANIMATION_OFFSET; switch(m.phase){ case MOVE:{ float distToPlayer=m.GetDistanceFrom(game->GetPlayer()->GetPos()); @@ -104,13 +95,13 @@ void Monster::STRATEGY::GOBLIN_DAGGER(Monster&m,float fElapsedTime,std::string s case STAB:{ vf2d stabTarget=game->GetPlayer()->GetPos(); m.PerformAnimation("STABBING",m.GetFacingDirectionToTarget(game->GetPlayer()->GetPos())); - CreateBullet(DaggerStab)(m,ConfigFloat("Dagger Hit Radius"),m.GetAttack(),ConfigFloat("Dagger Stab Knockback"),m.OnUpperLevel(),m.GetFacingDirectionToTarget(stabTarget),ConfigFloat("Dagger Frame Duration"),ConfigFloat("Dagger Stab Distance"),HorizontalFlip::NONE, - DaggerStab::DirectionOffsets{ConfigVec("Dagger Up Offset"),ConfigVec("Dagger Down Offset"),ConfigVec("Dagger Left Offset")})EndBullet; + CreateBullet(DaggerStab)(m,ConfigFloat("Dagger Hit Radius"),m.GetAttack(),ConfigFloat("Dagger Stab Knockback"),m.OnUpperLevel(),m.GetFacingDirectionToTarget(stabTarget),ConfigFloat("Dagger Frame Duration"),ConfigFloat("Dagger Stab Distance"), + DaggerStab::DirectionOffsets{ConfigVec("Dagger Up Offset"),ConfigVec("Dagger Down Offset"),ConfigVec("Dagger Right Offset"),ConfigVec("Dagger Left Offset")})EndBullet; }break; case SLASH:{ vf2d slashTarget=game->GetPlayer()->GetPos(); m.PerformAnimation("SLASHING",m.GetFacingDirectionToTarget(game->GetPlayer()->GetPos())); - CreateBullet(DaggerSlash)(m,ConfigFloat("Dagger Hit Radius"),m.GetAttack(),ConfigFloat("Dagger Slash Knockback"),m.OnUpperLevel(),m.GetFacingDirectionToTarget(slashTarget),ConfigFloat("Dagger Frame Duration"),ConfigFloat("Dagger Slash Distance"),HorizontalFlip::NONE)EndBullet; + CreateBullet(DaggerSlash)(m,ConfigFloat("Dagger Hit Radius"),m.GetAttack(),ConfigFloat("Dagger Slash Knockback"),m.OnUpperLevel(),m.GetFacingDirectionToTarget(slashTarget),ConfigFloat("Dagger Frame Duration"),ConfigFloat("Dagger Slash Distance"))EndBullet; }break; default:ERR(std::format("WARNING! Invalid Attack type {} provided. THIS SHOULD NOT BE HAPPENING!",m.I(A::ATTACK_TYPE))); } diff --git a/Adventures in Lestoria/Version.h b/Adventures in Lestoria/Version.h index 2ef9244d..676d5b09 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 9177 +#define VERSION_BUILD 9180 #define stringify(a) stringify_(a) #define stringify_(a) #a diff --git a/Adventures in Lestoria/assets/Campaigns/2_1.tmx b/Adventures in Lestoria/assets/Campaigns/2_1.tmx index 60c8302d..7b1f0856 100644 --- a/Adventures in Lestoria/assets/Campaigns/2_1.tmx +++ b/Adventures in Lestoria/assets/Campaigns/2_1.tmx @@ -1,5 +1,5 @@ - + @@ -1881,18 +1881,18 @@ - + + - - + - + diff --git a/Adventures in Lestoria/assets/config/MonsterStrategies.txt b/Adventures in Lestoria/assets/config/MonsterStrategies.txt index 1ab31ec5..a36dfd34 100644 --- a/Adventures in Lestoria/assets/config/MonsterStrategies.txt +++ b/Adventures in Lestoria/assets/config/MonsterStrategies.txt @@ -583,10 +583,10 @@ MonsterStrategy Dagger Slash Knockback = 75 # Offset for the dagger stab effect per direction from the monster's center. - # NOTE: Right is missing because left and right get mirrored by the game engine. - Dagger Up Offset = 6,-5 - Dagger Down Offset = -5,11 - Dagger Left Offset = -10,6 + Dagger Up Offset = 5,-4 + Dagger Down Offset = -5,5 + Dagger Right Offset = 4,4 + Dagger Left Offset = -2,4 } Goblin Bow { diff --git a/Adventures in Lestoria/assets/config/Monsters.txt b/Adventures in Lestoria/assets/config/Monsters.txt index 09705cf0..2d3a3e76 100644 --- a/Adventures in Lestoria/assets/config/Monsters.txt +++ b/Adventures in Lestoria/assets/config/Monsters.txt @@ -548,7 +548,7 @@ Monsters # Frame Count, Frame Speed (s), Frame Cycling (Repeat,OneShot,PingPong,Reverse) # Animations must be defined in the same order as they are in their sprite sheets # The First Four animations must represent a standing, walking, attack, and death animation. Their names are up to the creator. - IDLE = 2, 0.1, Repeat + IDLE = 2, 0.6, Repeat WALK = 4, 0.15, Repeat STABBING = 4, 0.075, OneShot DEATH = 4, 0.15, OneShot diff --git a/Adventures in Lestoria/assets/dagger_stab.png b/Adventures in Lestoria/assets/dagger_stab.png index 368cbd46..f143daa4 100644 Binary files a/Adventures in Lestoria/assets/dagger_stab.png and b/Adventures in Lestoria/assets/dagger_stab.png differ diff --git a/Adventures in Lestoria/assets/gamepack.pak b/Adventures in Lestoria/assets/gamepack.pak index aa461125..481122fd 100644 Binary files a/Adventures in Lestoria/assets/gamepack.pak and b/Adventures in Lestoria/assets/gamepack.pak differ diff --git a/x64/Release/Adventures in Lestoria.exe b/x64/Release/Adventures in Lestoria.exe index 51a3a3d1..a0c37167 100644 Binary files a/x64/Release/Adventures in Lestoria.exe and b/x64/Release/Adventures in Lestoria.exe differ