Move damage numbers to be rendered on top of the HUD instead of below it. Add in boss indicators that appear while a boss is off-screen. Fix bugs with knockback buffs being applied in the wrong location, making them effectively useless. Fix bugs with player velocity being nan when standing directly on top of a monster spawn. Fix idle animation during stone elemental rock toss cast. Reduce enemy collision hitboxes to more sensible and playable numbers with new collision system. Release Build 9413.
This commit is contained in:
@@ -306,7 +306,10 @@ State::State Player::GetState(){
|
||||
|
||||
void Player::Knockback(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());
|
||||
if(vel==vf2d{})return;
|
||||
float maxVelThreshold;
|
||||
if(this->vel==vf2d{})maxVelThreshold=vel.mag();
|
||||
else maxVelThreshold=std::max(vel.mag(),this->vel.mag());
|
||||
this->vel+=vel;
|
||||
float newVelAngle=this->vel.polar().y;
|
||||
this->vel=vf2d{maxVelThreshold,newVelAngle}.cart();
|
||||
@@ -522,18 +525,27 @@ void Player::Update(float fElapsedTime){
|
||||
}
|
||||
geom2d::line line(pos,m->GetPos());
|
||||
float dist = line.length();
|
||||
while(dist<=0.001){
|
||||
line={pos+vf2d{util::random(0.2f)-0.1f,util::random(0.2f)-0.1f},m->GetPos()};
|
||||
dist=line.length();
|
||||
}
|
||||
if(!m->Immovable()){
|
||||
if(dist<=0.001){
|
||||
m->SetPos(m->GetPos()+vf2d{util::random(2)-1,util::random(2)-1});
|
||||
}else{
|
||||
m->SetPos(line.rpoint(dist*1.1f));
|
||||
}
|
||||
m->SetPos(line.rpoint(dist*1.1f));
|
||||
}
|
||||
if(m->IsAlive()&&!m->IsNPC()){ //Don't set the knockback if this monster is actually an NPC. Let's just push them around.
|
||||
Knockback(line.vector().norm()*-128.f);
|
||||
float knockbackStrength=1.f;
|
||||
std::vector<Buff>knockbackBuffs=m->GetBuffs(COLLISION_KNOCKBACK_STRENGTH);
|
||||
for(Buff&b:knockbackBuffs){
|
||||
knockbackStrength+=b.intensity;
|
||||
}
|
||||
Knockback(line.vector().norm()*-128.f*knockbackStrength);
|
||||
}
|
||||
}
|
||||
}
|
||||
if(!std::isfinite(vel.x)||!std::isfinite(vel.y)){
|
||||
ERR(std::format("WARNING! The velocity vector for the player is NOT normal! Current vel:{} . Attempting manual resetting of velocity.",vel.str()));
|
||||
vel={};
|
||||
}
|
||||
if(vel.x>0){
|
||||
vel.x=std::max(0.f,vel.x-friction*fElapsedTime);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user