150 lines
3.7 KiB
C++
150 lines
3.7 KiB
C++
#pragma once
|
|
|
|
namespace aim
|
|
{
|
|
struct find_context_t
|
|
{
|
|
respawn::c_player* me;
|
|
|
|
size_t viable_targets;
|
|
|
|
float maximum_distance;
|
|
float maximum_fov;
|
|
|
|
float closest_distance;
|
|
float closest_fov;
|
|
|
|
math::Vector3 my_position;
|
|
math::Vector3 my_view;
|
|
math::Angle3 my_angle;
|
|
|
|
math::Vector3 aim_pos;
|
|
|
|
struct
|
|
{
|
|
math::Vector3 velocity;
|
|
} target_info;
|
|
};
|
|
|
|
extern respawn::bone_id get_optimal_bone_id(const cache::player_t& player);
|
|
|
|
extern bool is_target_viable(cache::entry_t& entity, aim::find_context_t& ctx);
|
|
|
|
extern void psilent(respawn::c_player* me, respawn::c_weapon* weapon);
|
|
}
|
|
|
|
namespace features
|
|
{
|
|
enum HEIRLOOM_INDEXES
|
|
{
|
|
HEIRLOOM_IDX_WRAITH = 0,
|
|
HEIRLOOM_IDX_BLOODHOUND = 1,
|
|
HEIRLOOM_IDX_LIFELINE = 2,
|
|
HEIRLOOM_IDX_PATHFINDER_GLOVES = 3,
|
|
HEIRLOOM_IDX_OCTANE_KNIFE = 4,
|
|
HEIRLOOM_IDX_MIRAGE = 5,
|
|
HEIRLOOM_IDX_GIBRALTAR = 7,
|
|
HEIRLOOM_IDX_BANGALORE = 8,
|
|
};
|
|
|
|
class c_base
|
|
{
|
|
public:
|
|
virtual void cl_move(respawn::c_player* me) { __noop(); }
|
|
virtual void create_move(respawn::c_player* me, respawn::user_cmd_t* cmd) { __noop(); }
|
|
virtual void paint() { __noop(); }
|
|
private:
|
|
};
|
|
|
|
class c_movement : public c_base
|
|
{
|
|
public:
|
|
void create_move(respawn::c_player* me, respawn::user_cmd_t* cmd) override;
|
|
|
|
bool m_hopping;
|
|
private:
|
|
};
|
|
|
|
class c_glow : public c_base
|
|
{
|
|
public:
|
|
respawn::color_t get_color(const cache::player_t& player);
|
|
|
|
void create_move(respawn::c_player* me, respawn::user_cmd_t* cmd) override;
|
|
private:
|
|
};
|
|
|
|
class c_aim : public c_base
|
|
{
|
|
public:
|
|
bool is_weapon_compatible(respawn::c_weapon* wpn) noexcept;
|
|
bool find_target(respawn::c_player* me, cache::entry_t* result, aim::find_context_t& ctx);
|
|
void create_move(respawn::c_player* me, respawn::user_cmd_t* cmd) override;
|
|
void cl_move(respawn::c_player* me) override;
|
|
void draw_range();
|
|
void paint() override;
|
|
|
|
bool is_aiming;
|
|
bool writecmd_silent;
|
|
float effective_max_fov_;
|
|
math::Vector3 target_pos_;
|
|
math::Angle3 wish_angle;
|
|
private:
|
|
};
|
|
|
|
class c_skin_changer : public c_base
|
|
{
|
|
public:
|
|
void create_move(respawn::c_player* me, respawn::user_cmd_t* cmd) override;
|
|
void frame_stage_notify(int stage, respawn::c_player* me);
|
|
private:
|
|
};
|
|
|
|
class c_esp : public c_base
|
|
{
|
|
public:
|
|
void draw_bar(respawn::color_t color, FLOAT flX, FLOAT flY, FLOAT flW, FLOAT flH, int current, const int max);
|
|
void draw_outline(respawn::color_t color, int opacity, math::Vector3 scr_origin, float bw, float bh);
|
|
|
|
void show_debug_ents();
|
|
|
|
void process_player(int index, const cache::entry_t& entry, const cache::player_t& player);
|
|
void process_prowler(int index, const cache::entry_t& entry, const cache::npc_t& npc);
|
|
void process_loot(int index, const cache::entry_t& entry, const cache::loot_t& loot);
|
|
|
|
void overlay_hud();
|
|
void info_panel();
|
|
|
|
void draw_bone_identifiers(const cache::player_t& player);
|
|
|
|
void paint() override;
|
|
private:
|
|
};
|
|
|
|
class c_logger : public c_base
|
|
{
|
|
public:
|
|
struct field_t
|
|
{
|
|
char m_text[256];
|
|
float m_duration;
|
|
float m_time_registered;
|
|
respawn::color_t m_color;
|
|
};
|
|
|
|
void draw_messages();
|
|
void paint() override;
|
|
|
|
void add_message(float duration, respawn::color_t color, const char* fmt, ...);
|
|
private:
|
|
stl::spinlock m_lock;
|
|
stl::c_linked_list<field_t> m_fields;
|
|
};
|
|
}
|
|
|
|
#define LOGGER_MSG_INTERNAL(DURATION, COLOR, FMT, ...) f::logger.add_message(DURATION, COLOR, _XS(FMT), __VA_ARGS__)
|
|
|
|
#define LOGGER_MSG_INFO(DURATION, FMT, ...) LOGGER_MSG_INTERNAL(DURATION, respawn::colors::white, FMT, __VA_ARGS__)
|
|
#define LOGGER_MSG_WARN(DURATION, FMT, ...) LOGGER_MSG_INTERNAL(DURATION, respawn::colors::yellow, FMT, __VA_ARGS__)
|
|
#define LOGGER_MSG_CRITICAL(DURATION, FMT, ...) LOGGER_MSG_INTERNAL(DURATION, respawn::colors::red, FMT, __VA_ARGS__)
|