-
Notifications
You must be signed in to change notification settings - Fork 0
/
Autowall.h
90 lines (80 loc) · 2.46 KB
/
Autowall.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#pragma once
#define DAMAGE_NO 0
#define DAMAGE_EVENTS_ONLY 1
#define DAMAGE_YES 2
#define DAMAGE_AIM 3
enum {
CHAR_TEX_ANTLION = 'A',
CHAR_TEX_BLOODYFLESH = 'B',
CHAR_TEX_CONCRETE = 'C',
CHAR_TEX_DIRT = 'D',
CHAR_TEX_EGGSHELL = 'E',
CHAR_TEX_FLESH = 'F',
CHAR_TEX_GRATE = 'G',
CHAR_TEX_ALIENFLESH = 'H',
CHAR_TEX_CLIP = 'I',
CHAR_TEX_PLASTIC = 'L',
CHAR_TEX_METAL = 'M',
CHAR_TEX_SAND = 'N',
CHAR_TEX_FOLIAGE = 'O',
CHAR_TEX_COMPUTER = 'P',
CHAR_TEX_SLOSH = 'S',
CHAR_TEX_TILE = 'T',
CHAR_TEX_CARDBOARD = 'U',
CHAR_TEX_VENT = 'V',
CHAR_TEX_WOOD = 'W',
CHAR_TEX_GLASS = 'Y',
CHAR_TEX_WARPSHIELD = 'Z',
};
struct ReturnInfo_t
{
int m_damage;
int m_hitgroup;
int m_penetration_count;
bool m_did_penetrate_wall;
float m_thickness;
Vector m_end;
IBasePlayer* m_hit_entity;
ReturnInfo_t(int damage, int hitgroup, int penetration_count, bool did_penetrate_wall, float thickness, IBasePlayer* hit_entity)
{
m_damage = damage;
m_hitgroup = hitgroup;
m_penetration_count = penetration_count;
m_did_penetrate_wall = did_penetrate_wall;
m_thickness = thickness;
m_hit_entity = hit_entity;
}
};
class CAutoWall
{
private:
struct FireBulletData_t
{
Vector m_start;
Vector m_end;
Vector m_current_position;
Vector m_direction;
CTraceFilter* m_filter;
CGameTrace m_enter_trace;
float m_current_damage;
int m_penetration_count;
};
void ScaleDamage(IBasePlayer* e, CCSWeaponInfo* weapon_info, int hitgroup, float& current_damage);
bool VectortoVectorVisible(Vector src, Vector point);
bool HandleBulletPenetration(CCSWeaponInfo* info, FireBulletData_t& data, bool extracheck = false, Vector point = Vector(0, 0, 0));
bool BreakableEntity(IBasePlayer* entity);
bool TraceToExit(CGameTrace& enterTrace, CGameTrace& exitTrace, Vector startPosition, Vector direction);
void TraceLine(Vector& start, Vector& end, unsigned int mask, IBasePlayer* ignore, CGameTrace* trace);
void ClipTrace(Vector& start, Vector& end, IBasePlayer* e, unsigned int mask, CTraceFilter* filter, CGameTrace* old_trace);
float HitgroupDamage(int iHitGroup);
bool IsArmored(IBasePlayer* player, int hitgroup);
public:
std::vector<float> scanned_damage;
std::vector<Vector> scanned_points;
void reset() {
scanned_damage.clear();
scanned_points.clear();
}
bool CanHitFloatingPoint(const Vector& point, const Vector& source);
ReturnInfo_t Think(Vector pos, IBasePlayer* target, int specific_hitgroup = -1, Vector eye_pos = csgo->eyepos, IBasePlayer* start_ent = csgo->local);
};