Changed edge to be a yaw_mode option

This commit is contained in:
Julian Rowe 2017-05-01 10:13:20 -05:00
parent 77ebecd879
commit 5ce592cfce
2 changed files with 30 additions and 36 deletions

View File

@ -481,7 +481,6 @@ static const std::string list_tf2 = R"(
"aa_yaw_mode" "aa_yaw_mode"
"aa_spin" "aa_spin"
"aa_roll" "aa_roll"
"aa_edge"
"aa_no_clamp" "aa_no_clamp"
"Anti-Anti-AA" [ "Anti-Anti-AA" [
"Anti-Anti-Anti-Aim Menu" "Anti-Anti-Anti-Aim Menu"

View File

@ -15,13 +15,12 @@ namespace hacks { namespace shared { namespace antiaim {
CatVar enabled(CV_SWITCH, "aa_enabled", "0", "Anti-Aim", "Master AntiAim switch"); CatVar enabled(CV_SWITCH, "aa_enabled", "0", "Anti-Aim", "Master AntiAim switch");
CatVar yaw(CV_FLOAT, "aa_yaw", "0.0", "Yaw", "Static yaw (left/right)", 360.0); CatVar yaw(CV_FLOAT, "aa_yaw", "0.0", "Yaw", "Static yaw (left/right)", 360.0);
CatVar pitch(CV_FLOAT, "aa_pitch", "-89.0", "Pitch", "Static pitch (up/down)", -89.0, 89.0); CatVar pitch(CV_FLOAT, "aa_pitch", "-89.0", "Pitch", "Static pitch (up/down)", -89.0, 89.0);
CatEnum yaw_mode_enum({ "KEEP", "STATIC", "JITTER", "BIGRANDOM", "RANDOM", "SPIN", "OFFSETKEEP" }); CatEnum yaw_mode_enum({ "KEEP", "STATIC", "JITTER", "BIGRANDOM", "RANDOM", "SPIN", "OFFSETKEEP", "EDGE" });
CatEnum pitch_mode_enum({ "KEEP", "STATIC", "JITTER", "RANDOM", "FLIP", "FAKEFLIP", "FAKEUP", "FAKEDOWN", "UP", "DOWN" }); CatEnum pitch_mode_enum({ "KEEP", "STATIC", "JITTER", "RANDOM", "FLIP", "FAKEFLIP", "FAKEUP", "FAKEDOWN", "UP", "DOWN" });
CatVar yaw_mode(yaw_mode_enum, "aa_yaw_mode", "0", "Yaw mode", "Yaw mode"); CatVar yaw_mode(yaw_mode_enum, "aa_yaw_mode", "0", "Yaw mode", "Yaw mode");
CatVar pitch_mode(pitch_mode_enum, "aa_pitch_mode", "0", "Pitch mode", "Pitch mode"); CatVar pitch_mode(pitch_mode_enum, "aa_pitch_mode", "0", "Pitch mode", "Pitch mode");
CatVar roll(CV_FLOAT, "aa_roll", "0", "Roll", "Roll angle (viewangles.z)", -180, 180); CatVar roll(CV_FLOAT, "aa_roll", "0", "Roll", "Roll angle (viewangles.z)", -180, 180);
CatVar no_clamping(CV_SWITCH, "aa_no_clamp", "0", "Don't clamp angles", "Use this with STATIC mode for unclamped manual angles"); CatVar no_clamping(CV_SWITCH, "aa_no_clamp", "0", "Don't clamp angles", "Use this with STATIC mode for unclamped manual angles");
CatVar edge(CV_SWITCH, "aa_edge", "0", "Edge", "Automaticly selects yaw for edging");
CatVar spin(CV_FLOAT, "aa_spin", "10.0", "Spin speed", "Spin speed (degrees/second)"); CatVar spin(CV_FLOAT, "aa_spin", "10.0", "Spin speed", "Spin speed (degrees/second)");
CatVar aaaa_enabled(CV_SWITCH, "aa_aaaa_enabled", "0", "Enable AAAA", "Enable Anti-Anti-Anti-Aim (Overrides AA Pitch)"); CatVar aaaa_enabled(CV_SWITCH, "aa_aaaa_enabled", "0", "Enable AAAA", "Enable Anti-Anti-Anti-Aim (Overrides AA Pitch)");
@ -154,9 +153,6 @@ float edgeDistance(float edgeRayYaw) {
//Function to Find an edge and report if one is found at all //Function to Find an edge and report if one is found at all
bool findEdge(float edgeOrigYaw) { bool findEdge(float edgeOrigYaw) {
//Stop the finstion and report that no edge has been found
if (!edge) return false;
//distance two vectors and report their combined distances //distance two vectors and report their combined distances
float edgeLeftDist = edgeDistance(edgeOrigYaw - 21); float edgeLeftDist = edgeDistance(edgeOrigYaw - 21);
edgeLeftDist = edgeLeftDist + edgeDistance(edgeOrigYaw - 27); edgeLeftDist = edgeLeftDist + edgeDistance(edgeOrigYaw - 27);
@ -218,37 +214,36 @@ void ProcessUserCmd(CUserCmd* cmd) {
float& y = cmd->viewangles.y; float& y = cmd->viewangles.y;
static bool flip = false; static bool flip = false;
bool clamp = !no_clamping; bool clamp = !no_clamping;
//Attemt to find an edge switch ((int)yaw_mode) {
if (findEdge(y)) { case 1: // FIXED
//use the edge found y = (float)yaw;
y = useEdge(y); break;
} else { case 2: // JITTER
switch ((int)yaw_mode) { if (flip) y += 90;
case 1: // FIXED else y -= 90;
y = (float)yaw; break;
break; case 3: // BIGRANDOM
case 2: // JITTER y = RandFloatRange(-65536.0f, 65536.0f);
if (flip) y += 90; clamp = false;
else y -= 90; break;
break; case 4: // RANDOM
case 3: // BIGRANDOM y = RandFloatRange(-180.0f, 180.0f);
y = RandFloatRange(-65536.0f, 65536.0f); break;
clamp = false; case 5: // SPIN
break; cur_yaw += (float)spin;
case 4: // RANDOM if (cur_yaw > 180) cur_yaw = -180;
y = RandFloatRange(-180.0f, 180.0f); if (cur_yaw < -180) cur_yaw = 180;
break; y = cur_yaw;
case 5: // SPIN break;
cur_yaw += (float)spin; case 6: // OFFSETKEEP
if (cur_yaw > 180) cur_yaw = -180; y += (float)yaw;
if (cur_yaw < -180) cur_yaw = 180; break;
y = cur_yaw; case 7: //Edge
break; //Attemt to find an edge and if found, edge
case 6: // OFFSETKEEP if (findEdge(y)) y = useEdge(y);
y += (float)yaw; break;
break;
}
} }
switch ((int)pitch_mode) { switch ((int)pitch_mode) {
case 1: case 1:
p = (float)pitch; p = (float)pitch;