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_spin"
"aa_roll"
"aa_edge"
"aa_no_clamp"
"Anti-Anti-AA" [
"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 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);
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" });
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 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 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 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
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
float edgeLeftDist = edgeDistance(edgeOrigYaw - 21);
edgeLeftDist = edgeLeftDist + edgeDistance(edgeOrigYaw - 27);
@ -218,37 +214,36 @@ void ProcessUserCmd(CUserCmd* cmd) {
float& y = cmd->viewangles.y;
static bool flip = false;
bool clamp = !no_clamping;
//Attemt to find an edge
if (findEdge(y)) {
//use the edge found
y = useEdge(y);
} else {
switch ((int)yaw_mode) {
case 1: // FIXED
y = (float)yaw;
break;
case 2: // JITTER
if (flip) y += 90;
else y -= 90;
break;
case 3: // BIGRANDOM
y = RandFloatRange(-65536.0f, 65536.0f);
clamp = false;
break;
case 4: // RANDOM
y = RandFloatRange(-180.0f, 180.0f);
break;
case 5: // SPIN
cur_yaw += (float)spin;
if (cur_yaw > 180) cur_yaw = -180;
if (cur_yaw < -180) cur_yaw = 180;
y = cur_yaw;
break;
case 6: // OFFSETKEEP
y += (float)yaw;
break;
}
switch ((int)yaw_mode) {
case 1: // FIXED
y = (float)yaw;
break;
case 2: // JITTER
if (flip) y += 90;
else y -= 90;
break;
case 3: // BIGRANDOM
y = RandFloatRange(-65536.0f, 65536.0f);
clamp = false;
break;
case 4: // RANDOM
y = RandFloatRange(-180.0f, 180.0f);
break;
case 5: // SPIN
cur_yaw += (float)spin;
if (cur_yaw > 180) cur_yaw = -180;
if (cur_yaw < -180) cur_yaw = 180;
y = cur_yaw;
break;
case 6: // OFFSETKEEP
y += (float)yaw;
break;
case 7: //Edge
//Attemt to find an edge and if found, edge
if (findEdge(y)) y = useEdge(y);
break;
}
switch ((int)pitch_mode) {
case 1:
p = (float)pitch;