Update knockback logic and formula again. Release Build 9177.

This commit is contained in:
2024-05-03 07:49:20 -05:00
parent 365d66098e
commit cc3a95094a
4 changed files with 10 additions and 4 deletions
+4
View File
@@ -838,7 +838,11 @@ geom2d::circle<float>Monster::Hitbox(){
}
void Monster::Knockback(const vf2d&vel){
//A new angle will be applied, but will be constrained by whichever applied velocity is strongest (either the current velocity, or the new one). This prevents continuous uncapped velocities to knockbacks applied.
float maxVelThreshold=std::max(vel.mag(),this->vel.mag());
this->vel+=vel;
float newVelAngle=this->vel.polar().y;
this->vel=vf2d{maxVelThreshold,newVelAngle}.cart();
}
void Monster::Knockup(float duration){
+5 -3
View File
@@ -305,9 +305,11 @@ State::State Player::GetState(){
}
void Player::Knockback(vf2d vel){
if(!HasIframes()){
this->vel+=vel;
}
//A new angle will be applied, but will be constrained by whichever applied velocity is strongest (either the current velocity, or the new one). This prevents continuous uncapped velocities to knockbacks applied.
float maxVelThreshold=std::max(vel.mag(),this->vel.mag());
this->vel+=vel;
float newVelAngle=this->vel.polar().y;
this->vel=vf2d{maxVelThreshold,newVelAngle}.cart();
}
void Player::Update(float fElapsedTime){
+1 -1
View File
@@ -39,7 +39,7 @@ All rights reserved.
#define VERSION_MAJOR 1
#define VERSION_MINOR 2
#define VERSION_PATCH 0
#define VERSION_BUILD 9176
#define VERSION_BUILD 9177
#define stringify(a) stringify_(a)
#define stringify_(a) #a
Binary file not shown.