Add option to stop autoshoot while disguised

This commit is contained in:
TotallyNotElite 2018-05-26 20:29:43 +02:00
parent 3ab2ea1a87
commit b87288ffdc
6 changed files with 16 additions and 3 deletions

2
TODO
View File

@ -27,7 +27,7 @@ MAX -> MIN priority // //
// // // //
Hunter Rifle? // // Hunter Rifle? // //
// // // //
No AutoShoot when disguised // // // //
Ambassador bodyshotting // // Ambassador bodyshotting // //
No Trigger Mediguns // // No Trigger Mediguns // //
More projectile weapons aimbot (wrap assassin, wrangler, stickybomb, airstrike) // // More projectile weapons aimbot (wrap assassin, wrangler, stickybomb, airstrike) // //

View File

@ -179,6 +179,8 @@ constexpr condition_data_s CreateConditionMask(ConditionList... conds)
// Should be either expanded or unused // Should be either expanded or unused
constexpr condition_data_s KInvisibilityMask = constexpr condition_data_s KInvisibilityMask =
CreateConditionMask(TFCond_Cloaked); CreateConditionMask(TFCond_Cloaked);
constexpr condition_data_s KDisguisedMask =
CreateConditionMask(TFCond_Disguised);
// Original name // Original name
constexpr condition_data_s KVisibilityMask = constexpr condition_data_s KVisibilityMask =
CreateConditionMask(TFCond_OnFire, TFCond_Jarated, TFCond_CloakFlicker, CreateConditionMask(TFCond_OnFire, TFCond_Jarated, TFCond_CloakFlicker,

View File

@ -52,6 +52,7 @@ void EndConVars();
bool IsPlayerInvulnerable(CachedEntity *player); bool IsPlayerInvulnerable(CachedEntity *player);
bool IsPlayerCritBoosted(CachedEntity *player); bool IsPlayerCritBoosted(CachedEntity *player);
bool IsPlayerInvisible(CachedEntity *player); bool IsPlayerInvisible(CachedEntity *player);
bool IsPlayerDisguised(CachedEntity *player);
const char *GetBuildingName(CachedEntity *ent); const char *GetBuildingName(CachedEntity *ent);
Vector GetBuildingPosition(CachedEntity *ent); Vector GetBuildingPosition(CachedEntity *ent);

View File

@ -33,6 +33,8 @@ static CatVar aimkey_mode(aimkey_modes_enum, "aimbot_aimkey_mode", "1",
static CatVar autoshoot(CV_SWITCH, "aimbot_autoshoot", "1", "Autoshoot", static CatVar autoshoot(CV_SWITCH, "aimbot_autoshoot", "1", "Autoshoot",
"Shoot automatically when the target is locked, isn't " "Shoot automatically when the target is locked, isn't "
"compatible with 'Enable when attacking'"); "compatible with 'Enable when attacking'");
static CatVar autoshoot_disguised(CV_SWITCH, "aimbot_autoshoot_disguised", "1", "Autoshoot while disguised",
"Shoot automatically if disguised.");
static CatVar multipoint(CV_SWITCH, "aimbot_multipoint", "0", "Multipoint", static CatVar multipoint(CV_SWITCH, "aimbot_multipoint", "0", "Multipoint",
"Multipoint aimbot"); "Multipoint aimbot");
static CatEnum hitbox_mode_enum({ "AUTO", "AUTO-CLOSEST", "STATIC" }); static CatEnum hitbox_mode_enum({ "AUTO", "AUTO-CLOSEST", "STATIC" });
@ -774,11 +776,11 @@ void Aim(CachedEntity *entity)
// A function to check whether player can autoshoot // A function to check whether player can autoshoot
void DoAutoshoot() void DoAutoshoot()
{ {
// Enable check // Enable check
if (!autoshoot) if (!autoshoot)
return; return;
if (IsPlayerDisguised(g_pLocalPlayer->entity) && !autoshoot_disguised)
return;
// Handle Compound bow // Handle Compound bow
if (g_pLocalPlayer->weapon()->m_iClassID() == CL_CLASS(CTFCompoundBow)) if (g_pLocalPlayer->weapon()->m_iClassID() == CL_CLASS(CTFCompoundBow))
{ {

View File

@ -855,6 +855,13 @@ bool IsPlayerInvisible(CachedEntity *player)
player); player);
} }
bool IsPlayerDisguised(CachedEntity *player)
{
return HasConditionMask<KDisguisedMask.cond_0, KDisguisedMask.cond_1,
KDisguisedMask.cond_2, KDisguisedMask.cond_3>(
player);
}
// F1 c&p // F1 c&p
Vector CalcAngle(Vector src, Vector dst) Vector CalcAngle(Vector src, Vector dst)
{ {

View File

@ -295,6 +295,7 @@ static const std::string list_tf2 = R"(
"aimbot_aimkey" "aimbot_aimkey"
"aimbot_aimkey_mode" "aimbot_aimkey_mode"
"aimbot_autoshoot" "aimbot_autoshoot"
"aimbot_autoshoot_disguised"
"aimbot_hitboxmode" "aimbot_hitboxmode"
"aimbot_fov" "aimbot_fov"
"aimbot_fov_draw" "aimbot_fov_draw"