@ -75,7 +75,7 @@ bool Thief::AutoAttack(){
float closest_dist = 999999 ;
float closest_dist = 999999 ;
for ( std : : shared_ptr < Monster > & m : MONSTER_LIST ) {
for ( std : : shared_ptr < Monster > & m : MONSTER_LIST ) {
if ( m - > IsAlive ( ) & &
if ( m - > IsAlive ( ) & &
geom2d : : overlaps ( geom2d : : circle < float > ( GetPos ( ) , attack_range * GetSizeMult ( ) * 12 ) , geom2d : : circle < float > ( m - > GetPos ( ) , m - > GetSizeMult ( ) * 12 ) ) & &
geom2d : : overlaps ( geom2d : : circle < float > ( GetPos ( ) , GetAttackRange ( ) / 100.f * 12 ) , geom2d : : circle < float > ( m - > GetPos ( ) , m - > GetSizeMult ( ) * 12 ) ) & &
geom2d : : line < float > ( GetWorldAimingLocation ( ) , m - > GetPos ( ) ) . length ( ) < closest_dist ) {
geom2d : : line < float > ( GetWorldAimingLocation ( ) , m - > GetPos ( ) ) . length ( ) < closest_dist ) {
closest_dist = geom2d : : line < float > ( GetWorldAimingLocation ( ) , m - > GetPos ( ) ) . length ( ) ;
closest_dist = geom2d : : line < float > ( GetWorldAimingLocation ( ) , m - > GetPos ( ) ) . length ( ) ;
closest = & * m ;
closest = & * m ;
@ -170,7 +170,21 @@ void Thief::InitializeClassAbilities(){
Thief : : ability3 . action =
Thief : : ability3 . action =
[ ] ( Player * p , vf2d pos = { } ) {
[ ] ( Player * p , vf2d pos = { } ) {
SoundEffect : : PlaySFX ( " Adrenaline Rush " , SoundEffect : : CENTERED ) ;
SoundEffect : : PlaySFX ( " Adrenaline Rush " , SoundEffect : : CENTERED ) ;
p - > AddBuff ( BuffType : : ADRENALINE_RUSH , " Thief.Ability 3.Duration " _F , 0.f ) ;
float adrenalineRushDuration { " Thief.Ability 3.Duration " _F } ;
if ( p - > HasEnchant ( " Adrenaline Stim " ) ) adrenalineRushDuration = " Adrenaline Stim " _ENC [ " NEW ADRENALINE RUSH DURATION " ] ;
p - > AddBuff ( BuffType : : ADRENALINE_RUSH , adrenalineRushDuration , 0.f ) ;
p - > AddTimer ( TimerType : : ADRENALINE_STIM , Timer { " Adrenaline Stim Extra Sound Timer " , 0.3f , [ ] ( ) { SoundEffect : : PlaySFX ( " Adrenaline Rush High Pitch " , SoundEffect : : CENTERED ) ; } , Timer : : MANUAL } ) ;
int healthCost { } ;
if ( p - > HasEnchant ( " Adrenaline Stim " ) ) healthCost = p - > GetMaxHealth ( ) * ( " Adrenaline Stim " _ENC [ " HEALTH PCT COST " ] / 100.f ) ;
if ( healthCost > 0 ) {
if ( p - > GetHealth ( ) < healthCost ) healthCost = p - > GetHealth ( ) - 1 ;
p - > Hurt ( healthCost , p - > OnUpperLevel ( ) , p - > GetZ ( ) , TrueDamageFlag : : IGNORE_DAMAGE_RULES , HurtFlag : : PLAYER_ABILITY ) ;
}
for ( int i : std : : ranges : : iota_view ( 0 , 50 ) ) {
for ( int i : std : : ranges : : iota_view ( 0 , 50 ) ) {
float size { util : : random_range ( 0.4f , 0.8f ) } ;
float size { util : : random_range ( 0.4f , 0.8f ) } ;
game - > AddEffect ( std : : make_unique < Effect > ( p - > GetPos ( ) + vf2d { 8 , util : : random ( 2 * PI ) } . cart ( ) , util : : random_range ( 0.1f , 0.4f ) , " circle.png " , p - > OnUpperLevel ( ) , vf2d { size , size } , 0.3f , vf2d { util : : random_range ( - 6.f , 6.f ) , util : : random_range ( - 8.f , - 1.f ) } , PixelLerp ( WHITE , GREEN , util : : random ( 1 ) ) ) ) ;
game - > AddEffect ( std : : make_unique < Effect > ( p - > GetPos ( ) + vf2d { 8 , util : : random ( 2 * PI ) } . cart ( ) , util : : random_range ( 0.1f , 0.4f ) , " circle.png " , p - > OnUpperLevel ( ) , vf2d { size , size } , 0.3f , vf2d { util : : random_range ( - 6.f , 6.f ) , util : : random_range ( - 8.f , - 1.f ) } , PixelLerp ( WHITE , GREEN , util : : random ( 1 ) ) ) ) ;