1 (* Copyright (C) Doom 2D: Forever Developers
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, version 3 of the License ONLY.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 *
12 * You should have received a copy of the GNU General Public License
13 * along with this program. If not, see <http://www.gnu.org/licenses/>.
14 *)
15 {$INCLUDE ../shared/a_modes.inc}
18 interface
28 var
36 implementation
38 uses
39 {$INCLUDE ../nogl/noGLuses.inc}
40 {$IFDEF ENABLE_HOLMES}
42 {$ENDIF}
49 xparser;
52 var
56 var
58 {$IF not DEFINED(HEADLESS) and DEFINED(ENABLE_HOLMES)}
60 {$ENDIF}
61 begin
75 TMsgType.Notify
76 );
79 TMsgType.Notify
80 );
82 {$IFDEF HEADLESS}
84 {$ENDIF}
88 e_InitInput;
92 g_Console_SysInit;
94 //GetSystemDefaultLCID()
96 //e_WriteLog('Read language file', MSG_NOTIFY);
97 //g_Language_Load(DataDir + gLanguage + '.txt');
101 sys_Init;
103 {$IF not DEFINED(HEADLESS) and DEFINED(ENABLE_HOLMES)}
106 begin
109 try
116 begin
119 //raise;
121 else
122 begin
124 //raise;
128 begin
129 try
133 begin
135 //raise;
138 else
139 begin
140 //raise;
148 begin
154 {$ENDIF}
156 //g_Res_CreateDatabases(); // it will be done before connecting to the server for the first time
160 {$WARNINGS OFF}
162 {$WARNINGS ON}
164 {$IFDEF ENABLE_HOLMES}
166 {$ENDIF}
168 sys_Final;
172 var
174 begin
175 Randomize;
177 {$IFDEF HEADLESS}
178 {$IFDEF USE_SDLMIXER}
180 {$ELSE}
182 {$ENDIF}
183 {$ELSE}
185 {$ENDIF}
187 g_Touch_Init;
189 (*
190 if (e_JoysticksAvailable > 0) then
191 e_WriteLog('Input: Joysticks available.', TMsgType.Notify)
192 else
193 e_WriteLog('Input: No Joysticks.', TMsgType.Notify);
194 *)
197 begin
210 begin
218 begin
226 begin
232 begin
238 var
240 begin
243 begin
283 var
285 begin
290 result :=
295 {
296 if ct = I_GAME_CHEAT_JETPACK then
297 begin
298 e_WriteLog('ls1: ['+ls1+']', MSG_NOTIFY);
299 e_WriteLog('ls2: ['+ls2+']', MSG_NOTIFY);
300 e_WriteLog('bf0: ['+Copy(charbuff, 17-Length(ls1)-eofs, Length(ls1))+']', MSG_NOTIFY);
301 e_WriteLog('bf1: ['+Translit(Copy(charbuff, 17-Length(ls1)-eofs, Length(ls1)))+']', MSG_NOTIFY);
302 e_WriteLog('bf2: ['+Copy(charbuff, 17-Length(ls2)-eofs, Length(ls2))+']', MSG_NOTIFY);
303 e_WriteLog('bf3: ['+Translit(Copy(charbuff, 17-Length(ls2)-eofs, Length(ls2)))+']', MSG_NOTIFY);
304 end;
305 }
310 const
312 label
313 Cheated;
314 var
318 begin
319 {
320 if (not gGameOn) or (not gCheats) or ((gGameSettings.GameType <> GT_SINGLE) and
321 (gGameSettings.GameMode <> GM_COOP) and (not gDebugMode))
322 or g_Game_IsNet then Exit;
323 }
329 //
331 begin
336 // RAMBO
338 begin
343 // TANK
345 begin
350 // IDDQD
352 begin
358 //
360 begin
364 // GOODBYE
366 begin
370 begin
372 //g_Game_ExitLevel(gTriggers[a].Data.MapName);
374 Break;
378 //
380 if CheckCheat(I_GAME_CHEAT_CHANGEMAP, 2) and (s2[1] >= '0') and (s2[1] <= '9') and (s2[2] >= '0') and (s2[2] <= '9') then
381 begin
383 begin
389 //
391 begin
395 // BULLFROG
397 begin
401 // FORMULA1
403 begin
407 // CONDOM
409 begin
414 //
416 begin
421 // PURELOVE
423 begin
428 //
430 begin
435 // CASPER
437 begin
442 //
444 begin
449 // INFERNO
451 begin
457 begin
462 begin
466 Exit;
468 Cheated:
474 {$IFNDEF HEADLESS}
475 var
477 {$ENDIF}
478 begin
479 {$IFNDEF HEADLESS}
482 begin
484 begin
488 if (not g_Game_IsNet) and (g_ActiveWindow = nil) then g_Game_Pause(false); //Fn loves to do this
489 end
491 begin
493 begin
495 end
497 begin
499 begin
501 begin
503 g_Game_Free;
505 Exit;
517 begin
532 else
533 begin
536 begin
538 end
540 begin
544 end
546 begin
552 {$ENDIF}
557 var
560 begin
562 begin
564 end
566 begin
570 end
571 else
572 begin