diff --git a/Adventures in Lestoria/MonsterAttribute.h b/Adventures in Lestoria/MonsterAttribute.h index f8b73d07..dd91afc2 100644 --- a/Adventures in Lestoria/MonsterAttribute.h +++ b/Adventures in Lestoria/MonsterAttribute.h @@ -106,4 +106,5 @@ enum class Attribute{ ITEM_USE_COUNT, LAST_JUMP_TIMER, INITIALIZED, + JUMP_MOVE_TO_TARGET_TIMER, }; \ No newline at end of file diff --git a/Adventures in Lestoria/SlimeKing.cpp b/Adventures in Lestoria/SlimeKing.cpp index da66f030..46b56edd 100644 --- a/Adventures in Lestoria/SlimeKing.cpp +++ b/Adventures in Lestoria/SlimeKing.cpp @@ -116,20 +116,22 @@ void Monster::STRATEGY::SLIMEKING(Monster&m,float fElapsedTime,std::string strat } }; - const auto StartJumpTowardsPlayer=[&](float jumpDuration,float recoveryTime,float jumpMoveSpd){ + const auto StartJumpTowardsPlayer=[&](float jumpDuration,float recoveryTime,float jumpMoveSpd,float moveTowardsTargetLockinTime){ m.F(A::JUMP_ORIGINAL_LANDING_TIMER)=m.F(A::JUMP_LANDING_TIMER)=jumpDuration; m.B(A::JUMP_TOWARDS_PLAYER)=true; m.F(A::RECOVERY_TIME)=recoveryTime; m.F(A::JUMP_MOVE_SPD)=jumpMoveSpd; + m.F(A::JUMP_MOVE_TO_TARGET_TIMER)=moveTowardsTargetLockinTime; m.SetState(State::JUMP); }; - const auto StartJump=[&](float jumpDuration,vf2d targetPos,float recoveryTime,float jumpMoveSpd){ + const auto StartJump=[&](float jumpDuration,vf2d targetPos,float recoveryTime,float jumpMoveSpd,float moveTowardsTargetLockinTime){ m.F(A::JUMP_ORIGINAL_LANDING_TIMER)=m.F(A::JUMP_LANDING_TIMER)=jumpDuration; m.V(A::JUMP_TARGET_POS)=targetPos; m.B(A::JUMP_TOWARDS_PLAYER)=false; m.F(A::RECOVERY_TIME)=recoveryTime; m.F(A::JUMP_MOVE_SPD)=jumpMoveSpd; + m.F(A::JUMP_MOVE_TO_TARGET_TIMER)=moveTowardsTargetLockinTime; m.SetState(State::JUMP); }; @@ -142,7 +144,8 @@ void Monster::STRATEGY::SLIMEKING(Monster&m,float fElapsedTime,std::string strat m.I(A::JUMP_COUNT)++; float jumpTime=ConfigFloatArr("Phase2.Jump["+std::to_string(m.I(A::JUMP_COUNT))+"]",0); float jumpSpd=ConfigFloatArr("Phase2.Jump["+std::to_string(m.I(A::JUMP_COUNT))+"]",1); - StartJumpTowardsPlayer(jumpTime,0.2f,jumpSpd); + float lockedInTargetTime=ConfigFloatArr("Phase2.Jump["+std::to_string(m.I(A::JUMP_COUNT))+"]",2); + StartJumpTowardsPlayer(jumpTime,0.2f,jumpSpd,lockedInTargetTime); }break; default:{ m.PerformIdleAnimation(); @@ -173,17 +176,19 @@ void Monster::STRATEGY::SLIMEKING(Monster&m,float fElapsedTime,std::string strat if(m.B(A::JUMP_TOWARDS_PLAYER)){ jumpTargetPos=game->GetPlayer()->GetPos(); } - if(m.GetPos().x>jumpTargetPos.x){ - m.SetX(std::max(jumpTargetPos.x,m.GetPos().x-m.F(A::JUMP_MOVE_SPD)*game->GetElapsedTime())); - } else - if(m.GetPos().xGetElapsedTime())); - } - if(m.GetPos().y>jumpTargetPos.y){ - m.SetY(std::max(jumpTargetPos.y,m.GetPos().y-m.F(A::JUMP_MOVE_SPD)*game->GetElapsedTime())); - } else - if(m.GetPos().yGetElapsedTime())); + if(m.F(A::JUMP_LANDING_TIMER)>m.F(A::JUMP_MOVE_TO_TARGET_TIMER)){ + if(m.GetPos().x>jumpTargetPos.x){ + m.SetX(std::max(jumpTargetPos.x,m.GetPos().x-m.F(A::JUMP_MOVE_SPD)*game->GetElapsedTime())); + } else + if(m.GetPos().xGetElapsedTime())); + } + if(m.GetPos().y>jumpTargetPos.y){ + m.SetY(std::max(jumpTargetPos.y,m.GetPos().y-m.F(A::JUMP_MOVE_SPD)*game->GetElapsedTime())); + } else + if(m.GetPos().yGetElapsedTime())); + } } if(m.F(A::JUMP_LANDING_TIMER)>=m.F(A::JUMP_ORIGINAL_LANDING_TIMER)/2){ m.SetZ(util::lerp(0,float(ConfigInt("JumpHeight")),1-jumpLandingTimerRatio)); @@ -230,7 +235,8 @@ void Monster::STRATEGY::SLIMEKING(Monster&m,float fElapsedTime,std::string strat m.I(A::JUMP_COUNT)++; float jumpTime=ConfigFloatArr("Phase2.Jump["+std::to_string(m.I(A::JUMP_COUNT))+"]",0); float jumpSpd=ConfigFloatArr("Phase2.Jump["+std::to_string(m.I(A::JUMP_COUNT))+"]",1); - StartJumpTowardsPlayer(jumpTime,0.2f,jumpSpd); + float lockedInTargetTime=ConfigFloatArr("Phase2.Jump["+std::to_string(m.I(A::JUMP_COUNT))+"]",2); + StartJumpTowardsPlayer(jumpTime,0.2f,jumpSpd,lockedInTargetTime); } return; } @@ -252,7 +258,7 @@ void Monster::STRATEGY::SLIMEKING(Monster&m,float fElapsedTime,std::string strat } if(m.F(A::SHOOT_RING_TIMER)==0){ if(m.I(A::PATTERN_REPEAT_COUNT)>=ConfigInt("Phase1.JumpAfter")){ - StartJumpTowardsPlayer(ConfigFloat("Phase1.AirborneTime"),ConfigFloat("Phase1.LandingRecoveryTime"),ConfigFloat("JumpMoveSpd")); + StartJumpTowardsPlayer(ConfigFloat("Phase1.AirborneTime"),ConfigFloat("Phase1.LandingRecoveryTime"),ConfigFloat("JumpMoveSpd"),ConfigFloat("Phase1.JumpLockinTargetTime")); m.I(A::PATTERN_REPEAT_COUNT)=0; return; } @@ -313,7 +319,7 @@ void Monster::STRATEGY::SLIMEKING(Monster&m,float fElapsedTime,std::string strat return; } if(m.I(A::PATTERN_REPEAT_COUNT)==0){ - StartJumpTowardsPlayer(ConfigFloat("Phase3.JumpDelayTime"),ConfigFloat("Phase3.JumpRecoveryTime"),ConfigFloat("Phase3.JumpMoveSpd")); + StartJumpTowardsPlayer(ConfigFloat("Phase3.JumpDelayTime"),ConfigFloat("Phase3.JumpRecoveryTime"),ConfigFloat("Phase3.JumpMoveSpd"),ConfigFloat("Phase3.JumpLockinTargetTime")); m.I(A::PATTERN_REPEAT_COUNT)++; }else if(m.I(A::PATTERN_REPEAT_COUNT)<4&&m.F(A::SHOOT_TIMER)==0){ @@ -346,7 +352,8 @@ void Monster::STRATEGY::SLIMEKING(Monster&m,float fElapsedTime,std::string strat float jumpAngle=util::angleTo(m.GetPos(),game->GetCurrentMapData().MapSize*game->GetCurrentMapData().tilewidth/2); //We jump towards the center to keep the player from constantly dealing with a stuck boss. float jumpDistance=ConfigFloat("Phase4.JumpDistance")/100*game->GetCurrentMapData().tilewidth; float jumpSpd=jumpDistance/ConfigFloat("Phase4.JumpDuration"); - StartJump(ConfigFloat("Phase4.JumpDuration"),m.GetPos()+vf2d{cos(jumpAngle)*jumpDistance,sin(jumpAngle)*jumpDistance},0,jumpSpd); + float lockedInTargetTime=jumpDistance/ConfigFloat("Phase4.JumpLockinTargetTime"); + StartJump(ConfigFloat("Phase4.JumpDuration"),m.GetPos()+vf2d{cos(jumpAngle)*jumpDistance,sin(jumpAngle)*jumpDistance},0,jumpSpd,lockedInTargetTime); }else if(m.I(A::PATTERN_REPEAT_COUNT)<5&&m.F(A::SHOOT_TIMER)==0){ m.I(A::PATTERN_REPEAT_COUNT)++; diff --git a/Adventures in Lestoria/Version.h b/Adventures in Lestoria/Version.h index c38c7e16..afe192b0 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 5 #define VERSION_PATCH 1 -#define VERSION_BUILD 8083 +#define VERSION_BUILD 8084 #define stringify(a) stringify_(a) #define stringify_(a) #a diff --git a/Adventures in Lestoria/assets/config/MonsterStrategies.txt b/Adventures in Lestoria/assets/config/MonsterStrategies.txt index 91b7b48b..6972fb50 100644 --- a/Adventures in Lestoria/assets/config/MonsterStrategies.txt +++ b/Adventures in Lestoria/assets/config/MonsterStrategies.txt @@ -117,6 +117,8 @@ MonsterStrategy JumpAfter = 4 shots AirborneTime = 3.0 LandingRecoveryTime = 2.0 + # How much time remaining for the jump target being locked into place. + JumpLockinTargetTime = 0.0 } Phase2 { @@ -134,10 +136,11 @@ MonsterStrategy # Argument 0 is jump time. # Argument 1 is move speed. + # Argument 2 is locked-in target time. - Jump[1] = 1.8, 45 - Jump[2] = 1.2, 70 - Jump[3] = 0.6, 400 + Jump[1] = 1.8, 45, 0.0 + Jump[2] = 1.2, 70, 0.0 + Jump[3] = 0.7, 1900, 0.5 } Phase3 { @@ -154,6 +157,8 @@ MonsterStrategy JumpMoveSpd = 80 JumpDelayTime = 1.2 JumpRecoveryTime = 2.0 + # How much time remaining for the jump target being locked into place. + JumpLockinTargetTime = 0.0 } Phase4 { @@ -171,6 +176,9 @@ MonsterStrategy JumpDuration = 3.0 JumpDistance = 1000 + + # How much time remaining for the jump target being locked into place. + JumpLockinTargetTime = 0.0 } Phase5 { diff --git a/x64/Release/Adventures in Lestoria.exe b/x64/Release/Adventures in Lestoria.exe index 3806d3cd..84bb0f2d 100644 Binary files a/x64/Release/Adventures in Lestoria.exe and b/x64/Release/Adventures in Lestoria.exe differ