-
Notifications
You must be signed in to change notification settings - Fork 29
/
Copy pathCheat.h
162 lines (146 loc) · 2.97 KB
/
Cheat.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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
#pragma once
#include "Misc.h"
#include <vector>
#include <map>
#include "Config.h"
struct Color
{
int r;
int g;
int b;
int a;
Color()
{
this->r = 0;
this->g = 0;
this->b = 0;
this->a = 255;
}
Color(int r, int g, int b)
{
this->r = r;
this->g = g;
this->b = b;
this->a = 255;
}
Color(int r, int g, int b, int a)
{
this->r = r;
this->g = g;
this->b = b;
this->a = a;
}
Color operator / (float div)
{
Color color = *this;
color.r = color.r / div;
color.g = color.g / div;
color.b = color.b / div;
return color;
}
Color& operator /= (float div)
{
Color& color = *this;
color.r /= div;
color.g /= div;
color.b /= div;
return color;
}
Color& operator *= (float coeff)
{
Color& color = *this;
color.r *= coeff;
color.g *= coeff;
color.b *= coeff;
return color;
}
static Color FromHSB(float hue, float saturation, float brightness)
{
float h = hue == 1.0f ? 0 : hue * 6.0f;
float f = h - (int)h;
float p = brightness * (1.0f - saturation);
float q = brightness * (1.0f - saturation * f);
float t = brightness * (1.0f - (saturation * (1.0f - f)));
if (h < 1)
{
return Color(
(unsigned char)(brightness * 255),
(unsigned char)(t * 255),
(unsigned char)(p * 255)
);
}
else if (h < 2)
{
return Color(
(unsigned char)(q * 255),
(unsigned char)(brightness * 255),
(unsigned char)(p * 255)
);
}
else if (h < 3)
{
return Color(
(unsigned char)(p * 255),
(unsigned char)(brightness * 255),
(unsigned char)(t * 255)
);
}
else if (h < 4)
{
return Color(
(unsigned char)(p * 255),
(unsigned char)(q * 255),
(unsigned char)(brightness * 255)
);
}
else if (h < 5)
{
return Color(
(unsigned char)(t * 255),
(unsigned char)(p * 255),
(unsigned char)(brightness * 255)
);
}
else
{
return Color(
(unsigned char)(brightness * 255),
(unsigned char)(p * 255),
(unsigned char)(q * 255)
);
}
}
};
struct TeamMate
{
std::string PlayerName;
};
struct Team
{
Color color;
std::string teamName;
std::vector<TeamMate> Players;
};
class cCheat
{
public:
std::vector<Team>Crews;
bool bAnimals, bShips, bPlayers, bTreasure, bObjects, bLegend;
public:
void readData();
void DrawString(const char * szString, float X, float Y, Color COLOR, bool Centered, std::string name);
void DrawString(const wchar_t * szString, float X, float Y, Color COLOR, bool Centered, std::string name);
void DrawHealthBar(int health, float maxhealth, int x, int y, int width, int height);
void DrawBox(int x, int y, int width, int height, Color color);
void DrawCircle(int x, int y, int radius, int numSides, Color color);
void DrawLine(float X, float Y, float X2, float Y2, Color color);
private:
uintptr_t baseModule, baseSize,
GWorld, tempGNames, GNames, GObjects,
UWorld, persistentLevel;
std::map<int, std::string> Names;
private:
std::string getNameFromIDmem(int ID);
std::string getNameFromIDmap(int ID);
};
extern cCheat* Cheat;