Jump targeting lock-on time implemented for Slime King script.

Slime King third jump delay increased from 0.6s -> 0.7s. Jump targeting speed increased from 400 -> 1900. Jump target lock-on time set to 0.5 seconds.

Release Build 8084.
mac-build
sigonasr2 9 months ago
parent a020f42285
commit 931f1db470
  1. 1
      Adventures in Lestoria/MonsterAttribute.h
  2. 21
      Adventures in Lestoria/SlimeKing.cpp
  3. 2
      Adventures in Lestoria/Version.h
  4. 14
      Adventures in Lestoria/assets/config/MonsterStrategies.txt
  5. BIN
      x64/Release/Adventures in Lestoria.exe

@ -106,4 +106,5 @@ enum class Attribute{
ITEM_USE_COUNT,
LAST_JUMP_TIMER,
INITIALIZED,
JUMP_MOVE_TO_TARGET_TIMER,
};

@ -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,6 +176,7 @@ void Monster::STRATEGY::SLIMEKING(Monster&m,float fElapsedTime,std::string strat
if(m.B(A::JUMP_TOWARDS_PLAYER)){
jumpTargetPos=game->GetPlayer()->GetPos();
}
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
@ -185,6 +189,7 @@ void Monster::STRATEGY::SLIMEKING(Monster&m,float fElapsedTime,std::string strat
if(m.GetPos().y<jumpTargetPos.y){
m.SetY(std::min(jumpTargetPos.y,m.GetPos().y+m.F(A::JUMP_MOVE_SPD)*game->GetElapsedTime()));
}
}
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));
}else{
@ -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)++;

@ -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

@ -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
{

Loading…
Cancel
Save