diff --git a/Adventures in Lestoria/Player.cpp b/Adventures in Lestoria/Player.cpp index e3113e10..8c516c33 100644 --- a/Adventures in Lestoria/Player.cpp +++ b/Adventures in Lestoria/Player.cpp @@ -1275,6 +1275,7 @@ const vf2d Player::GetWorldAimingLocation(){ const vf2d Player::GetAimingLocation(){ if(Input::UsingGamepad()){ float xAxis=0.f,yAxis=0.f; + #pragma region Manual Aiming for(GamePad*gamepad:GamePad::getGamepads()){ if(gamepad->stillConnected){ if(fabs(gamepad->getAxis(GPAxes::RX))>0.f){ @@ -1294,10 +1295,27 @@ const vf2d Player::GetAimingLocation(){ if(xAxis!=0.f||yAxis!=0.f)break; //Found a controller, so we're good to break. } } + #pragma endregion if(xAxis!=0.f||yAxis!=0.f){ return {(game->ScreenWidth()*xAxis)/2+game->ScreenWidth()/2,(game->ScreenHeight()*yAxis)/2+game->ScreenHeight()/2}; }else{ - return game->GetScreenSize()/2+vf2d{"Player.Aiming Cursor Max Distance"_F/100*24.f,aimingAngle.y}.cart(); + //Find the closest monster target. + vf2d closestPoint={std::numeric_limits::max(),std::numeric_limits::max()}; + for(Monster&m:MONSTER_LIST){ + if(m.IsAlive()){ + float distToMonster=geom2d::line(GetPos(),m.GetPos()).length(); + geom2d::lineaimingLine=geom2d::line(GetPos(),m.GetPos()); + vf2d aimingPoint=aimingLine.rpoint(operator""_Pixels("Player.Aiming Cursor Max Distance"_F)); + float distToClosestPoint=geom2d::line(GetPos(),closestPoint).length(); + if(distToClosestPoint>distToMonster&&distToMonster<=operator""_Pixels("Player.Auto Aim Detection Distance"_F)){ + closestPoint=aimingPoint; + } + } + } + if(closestPoint!=vf2d{std::numeric_limits::max(),std::numeric_limits::max()}){ + return game->GetScreenSize()/2+closestPoint-GetPos(); + }else + return game->GetScreenSize()/2+vf2d{float(operator""_Pixels("Player.Aiming Cursor Max Distance"_F)),aimingAngle.y}.cart(); } }else{ return game->GetMousePos(); diff --git a/Adventures in Lestoria/TODO.txt b/Adventures in Lestoria/TODO.txt index 07ffbf9a..9161200e 100644 --- a/Adventures in Lestoria/TODO.txt +++ b/Adventures in Lestoria/TODO.txt @@ -12,6 +12,8 @@ Settings Menu - Fix Stage Completed screen, item displays can hit the scrollbar. +- Stage Loot Config + January 31st ============ Make new unlocked nodes more obvious, made neighboring nodes more obvious diff --git a/Adventures in Lestoria/Version.h b/Adventures in Lestoria/Version.h index 56b61b81..ed92f8e4 100644 --- a/Adventures in Lestoria/Version.h +++ b/Adventures in Lestoria/Version.h @@ -39,7 +39,7 @@ All rights reserved. #define VERSION_MAJOR 0 #define VERSION_MINOR 3 #define VERSION_PATCH 0 -#define VERSION_BUILD 6190 +#define VERSION_BUILD 6200 #define stringify(a) stringify_(a) #define stringify_(a) #a diff --git a/Adventures in Lestoria/assets/config/Player.txt b/Adventures in Lestoria/assets/config/Player.txt index 97226d5c..40dc5bfa 100644 --- a/Adventures in Lestoria/assets/config/Player.txt +++ b/Adventures in Lestoria/assets/config/Player.txt @@ -32,6 +32,9 @@ Player # Distance the aiming cursor may be aimed at in controller aiming mode. Aiming Cursor Max Distance = 600 + # Distance the auto aim will try and find a target in. + Auto Aim Detection Distance = 1000 + # How long the rumble lasts when getting hit by a monster. Hurt Rumble Time = 0.1s