@ -305,7 +305,9 @@ State::State Player::GetState(){
}
}
void Player : : Knockback ( vf2d vel ) {
void Player : : Knockback ( vf2d vel ) {
this - > vel + = vel ;
if ( ! HasIframes ( ) ) {
this - > vel + = vel ;
}
}
}
void Player : : Update ( float fElapsedTime ) {
void Player : : Update ( float fElapsedTime ) {
@ -678,7 +680,7 @@ void Player::Update(float fElapsedTime){
vf2d extendedLine = pointTowardsCursor . upoint ( 1.1f ) ;
vf2d extendedLine = pointTowardsCursor . upoint ( 1.1f ) ;
float angleToCursor = atan2 ( extendedLine . y - GetPos ( ) . y , extendedLine . x - GetPos ( ) . x ) ;
float angleToCursor = atan2 ( extendedLine . y - GetPos ( ) . y , extendedLine . x - GetPos ( ) . x ) ;
attack_cooldown_timer = ARROW_ATTACK_COOLDOWN ;
attack_cooldown_timer = ARROW_ATTACK_COOLDOWN ;
BULLET_LIST . push_back ( std : : make_unique < Arrow > ( Arrow ( GetPos ( ) , extendedLine , vf2d { cos ( angleToCursor ) * " Ranger.Ability 1.ArrowSpd " _F , float ( sin ( angleToCursor ) * " Ranger.Ability 1.ArrowSpd " _F - PI / 8 * " Ranger.Ability 1.ArrowSpd " _F ) } + movementVelocity / 1.5f , 12 * " Ranger.Ability 1.ArrowRadius " _F / 100 , int ( GetAttack ( ) * " Ranger.Ability 1.DamageMult " _F ) , OnUpperLevel ( ) , true ) ) ) ;
BULLET_LIST . push_back ( std : : make_unique < Arrow > ( Arrow ( GetPos ( ) , extendedLine , vf2d { cos ( angleToCursor ) * " Ranger.Ability 1.ArrowSpd " _F , float ( sin ( angleToCursor ) * " Ranger.Ability 1.ArrowSpd " _F - PI / 8 * " Ranger.Ability 1.ArrowSpd " _F ) } + movementVelocity / 1.5f , PI / 2 * " Ranger.Auto Attack.ArrowSpd " _F , 12 * " Ranger.Ability 1.ArrowRadius " _F / 100 , int ( GetAttack ( ) * " Ranger.Ability 1.DamageMult " _F ) , OnUpperLevel ( ) , true ) ) ) ;
SetAnimationBasedOnTargetingDirection ( angleToCursor ) ;
SetAnimationBasedOnTargetingDirection ( angleToCursor ) ;
rapidFireTimer = RAPID_FIRE_SHOOT_DELAY ;
rapidFireTimer = RAPID_FIRE_SHOOT_DELAY ;
} else {
} else {