Finished slime king jump attack, account for Z axis when determining damage validity.
This commit is contained in:
+15
-2
@@ -44,14 +44,27 @@ void Monster::STRATEGY::SLIMEKING(Monster&m,float fElapsedTime,int strategyNumbe
|
||||
|
||||
if(m.state==State::JUMP){
|
||||
float jumpLandingTimerRatio=m.F(A::JUMP_LANDING_TIMER)/m.F(A::JUMP_ORIGINAL_LANDING_TIMER);
|
||||
m.SetPos(m.V(A::JUMP_ORIGINAL_POS).lerp(m.V(A::JUMP_TARGET_POS),1-jumpLandingTimerRatio));
|
||||
vf2d moveVel;
|
||||
if(m.GetPos().x>game->GetPlayer()->GetPos().x){
|
||||
m.SetX(std::max(game->GetPlayer()->GetPos().x,m.GetPos().x-ConfigInt("JumpMoveSpd")*game->GetElapsedTime()));
|
||||
} else
|
||||
if(m.GetPos().x<game->GetPlayer()->GetPos().x){
|
||||
m.SetX(std::min(game->GetPlayer()->GetPos().x,m.GetPos().x+ConfigInt("JumpMoveSpd")*game->GetElapsedTime()));
|
||||
}
|
||||
if(m.GetPos().y>game->GetPlayer()->GetPos().y){
|
||||
m.SetY(std::max(game->GetPlayer()->GetPos().y,m.GetPos().y-ConfigInt("JumpMoveSpd")*game->GetElapsedTime()));
|
||||
} else
|
||||
if(m.GetPos().y<game->GetPlayer()->GetPos().y){
|
||||
m.SetY(std::min(game->GetPlayer()->GetPos().y,m.GetPos().y+ConfigInt("JumpMoveSpd")*game->GetElapsedTime()));
|
||||
}
|
||||
if(m.F(A::JUMP_LANDING_TIMER)>=m.F(A::JUMP_ORIGINAL_LANDING_TIMER)/2){
|
||||
m.SetZ(util::lerp(0,ConfigInt("JumpHeight"),1-jumpLandingTimerRatio*2));
|
||||
m.SetZ(util::lerp(0,ConfigInt("JumpHeight"),1-jumpLandingTimerRatio));
|
||||
}else{
|
||||
m.SetZ(util::lerp(0,ConfigInt("JumpHeight"),jumpLandingTimerRatio*2));
|
||||
}
|
||||
if(m.F(A::JUMP_LANDING_TIMER)==0){
|
||||
m.state=State::RECOVERY;
|
||||
game->SetupWorldShake(0.6);
|
||||
m.SetStrategyDrawFunction([](Crawler*game){});
|
||||
} else
|
||||
if(m.F(A::JUMP_LANDING_TIMER)<=ConfigFloat("JumpWarningIndicatorTime")){
|
||||
|
||||
Reference in New Issue
Block a user