-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathConCommands.cpp
More file actions
295 lines (254 loc) · 9.72 KB
/
ConCommands.cpp
File metadata and controls
295 lines (254 loc) · 9.72 KB
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
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
/////////////////////////////////////////////////////////////////////
///////////////Original file by:Fyodor Zagumennov aka Sgw32//////////
///////////////Copyright(c) 2010 Fyodor Zagumennov //////////
/////////////////////////////////////////////////////////////////////
#include "ConCommands.h"
#include "Loader.h"
#include "NPCManager.h"
#include "Run3Benchmark.h"
template<> ConCommands *Singleton<ConCommands>::ms_Singleton=0;
ConCommands::ConCommands()
{
}
ConCommands::~ConCommands()
{
}
void ConCommands::init(Player* ply,Root* mRoot)
{
//play=ply;
/*Trigger* trig = new Trigger(mRoot);
AxisAlignedBox aab = AxisAlignedBox(Vector3(-7905,-100,-4250),Vector3(-7305,700,-3350));
trig->init(aab,ply);
trig->setcallback(Gluk);
trig->show_box(true);*/
}
void ConCommands::Compile()
{
//luaactivated=false;
OgreConsole::getSingleton().addCommand("noclip",this->Noclip);
OgreConsole::getSingleton().addCommand("fade",this->Fade);
OgreConsole::getSingleton().addCommand("select",this->Give);
//weapons
//HUD
OgreConsole::getSingleton().addCommand("setred",this->SetRed);
OgreConsole::getSingleton().addCommand("setgreen",this->SetGreen);
OgreConsole::getSingleton().addCommand("setblue",this->SetBlue);
OgreConsole::getSingleton().addCommand("a1gfdo4abfs",this->a1gfdo4abfs);
OgreConsole::getSingleton().addCommand("toggleoldtv",this->toggleOldTv);
OgreConsole::getSingleton().addCommand("togglenightvision",this->toggleNightvision);
OgreConsole::getSingleton().addCommand("changefov",this->changeFOV);
OgreConsole::getSingleton().addCommand("stats",this->printStats);
OgreConsole::getSingleton().addCommand("c64",this->Commodore);
OgreConsole::getSingleton().addCommand("testcompos",this->testCompos);
OgreConsole::getSingleton().addCommand("testcompos2",this->testCompos2);
OgreConsole::getSingleton().addCommand("drug1",this->drug1);
OgreConsole::getSingleton().addCommand("drug2",this->drug2);
OgreConsole::getSingleton().addCommand("drug3",this->drug3);
OgreConsole::getSingleton().addCommand("buyweapon",this->buyWeapon);
OgreConsole::getSingleton().addCommand("god",this->god);
OgreConsole::getSingleton().addCommand("timesh",this->timesh);
OgreConsole::getSingleton().addCommand("ts",this->ts);
OgreConsole::getSingleton().addCommand("dssao",this->disssao);
OgreConsole::getSingleton().addCommand("essao",this->enablessao);
OgreConsole::getSingleton().addCommand("spawnzom",this->spawnzom);
OgreConsole::getSingleton().addCommand("lua",this->lua);
OgreConsole::getSingleton().addCommand("benchmark",this->benchmark);
}
void ConCommands::buyWeapon(vector<String>& param)
{
CWeapon::getSingleton().addWeapon(param[1]);
}
void ConCommands::ts(vector<String>& param)
{
Timeshift::getSingleton().toggleTStop();
}
void ConCommands::benchmark(vector<String>& param)
{
Run3Benchmark::getSingleton().benchMarkMap(param[1]);
}
void ConCommands::spawnzom(vector<String>& param)
{
NPCSpawnProps prop;
prop.farFind=10000;
prop.health=30;
prop.mesh="marazm02.mesh";
prop.yShift=0;
prop.mName="";
prop.animated=true;
prop.rot=Quaternion::IDENTITY;
prop.spCPos=global::getSingleton().getPlayer()->getFObject()+Vector3(0,150,0);
prop.scale=Vector3(80,80,80);
prop.spCName="npc_enemy";
prop.velocity=98;
prop.stopAtDist=false;
prop.stopDist=1;
prop.physPosit=Vector3(0,-1.5f,0);
prop.physSize=Vector3(0.3f,0.4f,0.3f);
prop.angle=180;
prop.ax=Vector3(0,1,0);
prop.stupidsounds=false;
prop.attackAnimDist=105;
prop.headshot=true;
prop.headshotDist=20.0f;
prop.headMesh="marazm02_head.mesh";
prop.headBone="BMan0003-Head";
LogManager::getSingleton().logMessage("CC: npc passed, all data was got;ready for spawn");
NPCManager::getSingleton().npc_spawn(prop);
}
void ConCommands::Noclip(vector<String>& param)
{
/*Player* ply = play;
if (param[1] == "0")
{
ply->noclip=false;
}
else
{
ply->noclip=true;
}*/
}
void ConCommands::god(vector<String>& param)
{
global::getSingleton().getPlayer()->god=!global::getSingleton().getPlayer()->god;
if (global::getSingleton().getPlayer()->god)
{
OgreConsole::getSingleton().print("GOD MODE ON");
}
else
{
OgreConsole::getSingleton().print("GOD MODE OFF");
}
}
void ConCommands::timesh(vector<String>& param)
{
Timeshift::getSingleton().setTimeK(StringConverter::parseReal(param[1]));
}
void ConCommands::disssao(vector<String>& param)
{
Loader::getSingleton().disableSSAO();
}
void ConCommands::enablessao(vector<String>& param)
{
Loader::getSingleton().enaSSAO();
}
void ConCommands::a1gfdo4abfs(vector<String>& param)
{
OgreConsole::getSingleton().print("________________");
OgreConsole::getSingleton().print("OLOLOLOLO!");
OgreConsole::getSingleton().print("Helllooo, guys!");
OgreConsole::getSingleton().print("My name is Fyodor Zagumennov aka Sgw32!");
OgreConsole::getSingleton().print("This project is named Run3");
OgreConsole::getSingleton().print("________________");
OgreConsole::getSingleton().print("Pst!If somebody(not me) is going to say:");
OgreConsole::getSingleton().print("~Run3 is MY project! Sgw32 is not a programmer!~");
OgreConsole::getSingleton().print("And is going to sell it and register as a trademark,");
OgreConsole::getSingleton().print("REMEMBER!!!111!");
OgreConsole::getSingleton().print("Those people are idiots and they sucks!!!");
OgreConsole::getSingleton().print("This project is MY!");
OgreConsole::getSingleton().print("This source code is MY!");
OgreConsole::getSingleton().print("Luckily, this secret code is MY!");
OgreConsole::getSingleton().print("AND NOBODY CAN disprove IT!");
OgreConsole::getSingleton().print("Or they are absolutely idiots and");
OgreConsole::getSingleton().print("they are stupid fuckers!");
OgreConsole::getSingleton().print("________________");
}
void ConCommands::Commodore(vector<String>& param)
{
OgreConsole::getSingleton().print(" **** COMMODORE 64 BASIC V2 ****");
OgreConsole::getSingleton().print(" 64K RAM SYSTEM 38911 BASIC BYTES FREE");
OgreConsole::getSingleton().print(" READY ");
CompositorManager::getSingleton().addCompositor(global::getSingleton().getCamera()->getViewport(),"Commodore");
CompositorManager::getSingleton().setCompositorEnabled(global::getSingleton().getCamera()->getViewport(),"Commodore",true);
}
void ConCommands::testCompos(vector<String>& param)
{
CompositorManager::getSingleton().addCompositor(global::getSingleton().getCamera()->getViewport(),"TestRun3");
CompositorManager::getSingleton().setCompositorEnabled(global::getSingleton().getCamera()->getViewport(),"TestRun3",true);
}
void ConCommands::testCompos2(vector<String>& param)
{
CompositorManager::getSingleton().addCompositor(global::getSingleton().getCamera()->getViewport(),param[1]);
CompositorManager::getSingleton().setCompositorEnabled(global::getSingleton().getCamera()->getViewport(),param[1],true);
}
void ConCommands::drug1(vector<String>& param)
{
CompositorManager::getSingleton().addCompositor(global::getSingleton().getCamera()->getViewport(),"RunFX1");
CompositorManager::getSingleton().setCompositorEnabled(global::getSingleton().getCamera()->getViewport(),"RunFX1",true);
}
void ConCommands::drug2(vector<String>& param)
{
CompositorManager::getSingleton().addCompositor(global::getSingleton().getCamera()->getViewport(),"RunLSD");
CompositorManager::getSingleton().setCompositorEnabled(global::getSingleton().getCamera()->getViewport(),"RunLSD",true);
}
void ConCommands::drug3(vector<String>& param)
{
CompositorManager::getSingleton().addCompositor(global::getSingleton().getCamera()->getViewport(),"RunFX3");
CompositorManager::getSingleton().setCompositorEnabled(global::getSingleton().getCamera()->getViewport(),"RunFX3",true);
}
void ConCommands::lua(vector<String>& param)
{
//luaactivated=true;
if (param[1]=="1")
{
OgreConsole::getSingleton().activateLua(true);
LogManager::getSingleton().logMessage("Lua console functions activated!");
}
else
{
OgreConsole::getSingleton().activateLua(false);
LogManager::getSingleton().logMessage("Lua console functions deactivated!");
}
}
void ConCommands::printStats(vector<String>& param)
{
OgreConsole::getSingleton().print("FPS:" + StringConverter::toString(global::getSingleton().getWindow()->getLastFPS()));
OgreConsole::getSingleton().print("Average:"+StringConverter::toString(global::getSingleton().getWindow()->getAverageFPS()));
OgreConsole::getSingleton().print("Best:"+StringConverter::toString(global::getSingleton().getWindow()->getBestFPS()));
OgreConsole::getSingleton().print("Worst:" + StringConverter::toString(global::getSingleton().getWindow()->getWorstFPS()));
OgreConsole::getSingleton().print("Batch Count"+StringConverter::toString(global::getSingleton().getWindow()->getBatchCount()));
}
void ConCommands::toggleOldTv(vector<String>& param)
{
SuperFX::getSingleton().toggleOldTV();
}
void ConCommands::toggleNightvision(vector<String>& param)
{
SuperFX::getSingleton().toggleNightvision();
}
void ConCommands::Fade(vector<String>& param)
{
FadeListener::getSingleton().setDuration(3);
FadeListener::getSingleton().setDurationF(0.5);
if (param[1]=="in")
{
FadeListener::getSingleton().startIN();
}
if (param[1]=="out")
{
FadeListener::getSingleton().startOUT();
}
}
void ConCommands::Gluk()
{
HUD::getSingleton().SetGreenEnergy(0.4f);
}
void ConCommands::Give(vector<String>& param)
{
CWeapon::getSingleton().select(param[1]);
}
void ConCommands::changeFOV(vector<String>& param)
{
global::getSingleton().getPlayer()->changeFOV(StringConverter::parseReal(param[1]));
}
void ConCommands::SetRed(vector<String>& param)
{
HUD::getSingleton().SetRedEnergy(StringConverter::parseReal(param[1]));
}
void ConCommands::SetGreen(vector<String>& param)
{
HUD::getSingleton().SetGreenEnergy(StringConverter::parseReal(param[1]));
}
void ConCommands::SetBlue(vector<String>& param)
{
HUD::getSingleton().SetBlueEnergy(StringConverter::parseReal(param[1]));
}