|
|
|
@ -378,7 +378,22 @@ void Player::Update(float fElapsedTime){ |
|
|
|
|
spin_angle=0; |
|
|
|
|
z=0; |
|
|
|
|
float numb=4; |
|
|
|
|
game->HurtEnemies(pos,"Warrior.Ability 2.Range"_F/100*12,int(GetAttack()*"Warrior.Ability 2.DamageMult"_F),OnUpperLevel(),0); |
|
|
|
|
const MonsterHurtList&hitEnemies=game->HurtEnemies(pos,"Warrior.Ability 2.Range"_F/100*12,int(GetAttack()*"Warrior.Ability 2.DamageMult"_F),OnUpperLevel(),0); |
|
|
|
|
#pragma region Knockback effect |
|
|
|
|
for(auto&[monsterPtr,wasHurt]:hitEnemies){ |
|
|
|
|
float knockbackDir=0; |
|
|
|
|
float knockbackAmt=0; |
|
|
|
|
if(geom2d::line<float>(GetPos(),monsterPtr->GetPos()).length()<=0.001f){ |
|
|
|
|
knockbackDir=util::random(2*PI); |
|
|
|
|
knockbackAmt="Warrior.Ability 2.KnockbackAmt"_F; |
|
|
|
|
}else{ |
|
|
|
|
knockbackDir=geom2d::line<float>(GetPos(),monsterPtr->GetPos()).vector().norm().polar().y; |
|
|
|
|
knockbackAmt=std::clamp("Warrior.Ability 2.KnockbackAmt"_F-geom2d::line<float>(GetPos(),monsterPtr->GetPos()).length()*"Warrior.Ability 2.KnockbackReduction"_F,1.f,"Warrior.Ability 2.KnockbackAmt"_F); |
|
|
|
|
} |
|
|
|
|
knockbackAmt=std::max(1.f,knockbackAmt-"Warrior.Ability 2.KnockbackWeightFactor"_F*(monsterPtr->GetSizeMult()-1.f)); |
|
|
|
|
monsterPtr->Knockback(vf2d{knockbackAmt,knockbackDir}.cart()); |
|
|
|
|
} |
|
|
|
|
#pragma endregion |
|
|
|
|
game->AddEffect(std::make_unique<Effect>(GetPos(),"Warrior.Ability 2.EffectLifetime"_F,"ground-slam-attack-front.png",upperLevel,"Warrior.Ability 2.Range"_F/300*1.33f,"Warrior.Ability 2.EffectFadetime"_F),std::make_unique<Effect>(GetPos(),"Warrior.Ability 2.EffectLifetime"_F,"ground-slam-attack-back.png",upperLevel,"Warrior.Ability 2.Range"_F/300*1.33f,"Warrior.Ability 2.EffectFadetime"_F)); |
|
|
|
|
SoundEffect::PlaySFX("Warrior Ground Slam",SoundEffect::CENTERED); |
|
|
|
|
} |
|
|
|
|