-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGames.pas
More file actions
138 lines (124 loc) · 3.78 KB
/
Games.pas
File metadata and controls
138 lines (124 loc) · 3.78 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
unit Games;
interface
uses
Windows, Forms, SysUtils,
jpeg, param, Controls, StdCtrls, ExtCtrls, Classes;
type
TGame = class(TForm)
Label1: TLabel;
Label2: TLabel;
GroupBox1: TGroupBox;
Button1: TButton;
ComboBox1: TComboBox;
Button2: TButton;
Button3: TButton;
Image1: TImage;
Label3: TLabel;
Label4: TLabel;
procedure FormActivate(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Game: TGame;
implementation
uses Main, SoftSel;
{$R *.dfm}
procedure TGame.FormActivate(Sender: TObject);
var
i:shortint;
begin
ComboBox1.Clear;
If MainForm.Label76.Caption='Âñòðîåííàÿ' then
Label2.Caption:=MainForm.Label23.Caption
else
Label2.Caption:=MainForm.Label76.Caption;
for i:=0 to GamesList.Count-1 do
ComboBox1.Items.Add(copy(GamesList.Strings[i],1,pos(#9,GamesList.Strings[i])-1));
If GamesList.Count=0 then
Button2.Enabled:=false
else
begin
ComboBox1.ItemIndex:=0;
Button2.Enabled:=true;
end;
end;
procedure TGame.Button1Click(Sender: TObject);
begin
If mainform.Label28.Caption<>'Íåò' then begin
If MainForm.Label30.Caption<>'Íåò' then begin
assignfile(data,dir+'\Data\Games.dat');
dataprm:='Games';
SoftSelect.Caption:='Âûáîð èãð';
SoftSelect.Showmodal;
end
else
Application.MessageBox('Íåò îïåðàöèîííîé ñèñòåìû íà êîìïüþòåðå!','Ïîìîùü!',MB_ICONSTOP);
end
else
Application.MessageBox('Íåò CD-ROM!','Ïîìîùü!',mb_iconstop);
end;
procedure TGame.Button3Click(Sender: TObject);
begin
close;
end;
procedure TGame.Button2Click(Sender: TObject);
var
i:shortint;
Req:integer;
begin
If LastGame=ComboBox1.Items.Strings[ComboBox1.ItemIndex] then
toshn:=toshn+3
else
toshn:=0;
If (toshn>9) and (toshn<13) then begin
nastr:=nastr-5;
Application.MessageBox('Âàñ óæå íå òîøíèò îò ýòîé èãðû?','Ïîìîùü!',MB_ICONINFORMATION);
end
else
If toshn>14 then begin
nastr:=nastr-20;
Application.MessageBox('Âàñ ñòîøíèëî îò ýòîé èãðû...','Ïîìîùü!',MB_ICONINFORMATION);
end
else
begin
for i:=0 to GamesList.Count-1 do
If copy(GamesList.Strings[i],1,pos(#9,GamesList.Strings[i])-1)=ComboBox1.Items.Strings[ComboBox1.ItemIndex] then
Req:=StrToInt(copy(GamesList.Strings[i],pos(#9,GamesList.Strings[i])+1,255));
If Label2.Caption<>MainForm.Label23.Caption then begin
If (videospeed+videoclock)>=Req then begin
nastr:=nastr+3;
Application.MessageBox('Õîðîøî ïðîâåäÿ âðåìÿ çà èãðîé âàøå íàñòðîåíèå çàìåòíî óëó÷øèëîñü.','Ïîìîùü!',MB_ICONINFORMATION);
end
else
Application.MessageBox('Óæàñíûå òîðìîçà â èãðå âûâåëè âàñ èç ñåáÿ. Ìîæåò ñòîèò çàìåíèòü âèäåîêàðòó?','Ïîìîùü!',MB_ICONSTOP);
end
else
If ((cpuspeed+cpuclock+htt+ramspeed*10+hardspeed+defragspeed) div 4)>=Req then begin
nastr:=nastr+3;
Application.MessageBox('Õîðîøî ïðîâåäÿ âðåìÿ çà èãðîé âàøå íàñòðîåíèå çàìåòíî óëó÷øèëîñü.','Ïîìîùü!',MB_ICONINFORMATION);
end
else
Application.MessageBox('Óæàñíûå òîðìîçà â èãðå âûâåëè âàñ èç ñåáÿ. Ìîæåò ñòîèò çàìåíèòü âèäåîêàðòó?','Ïîìîùü!',MB_ICONSTOP);
end;
LastGame:=ComboBox1.Items.Strings[ComboBox1.ItemIndex];
end;
procedure TGame.FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
If (key=VK_ESCAPE) then
Button3.OnClick(self);
end;
procedure TGame.FormClose(Sender: TObject; var Action: TCloseAction);
begin
MainForm.Timer1.Enabled:=true;
end;
end.