-
Notifications
You must be signed in to change notification settings - Fork 0
/
Welc.pas
311 lines (290 loc) · 10.9 KB
/
Welc.pas
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
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
unit Welc;
interface
uses
Windows, Forms, SysUtils, jpeg, param, ComCtrls, StdCtrls, Controls, Classes, ExtCtrls,
Dialogs, ExtDlgs, inifiles;
type
TWelcome = class(TForm)
GroupBox1: TGroupBox;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Button1: TButton;
Button2: TButton;
Label5: TLabel;
Edit2: TEdit;
UpDown1: TUpDown;
Label4: TLabel;
Edit1: TComboBox;
Label6: TLabel;
Edit3: TEdit;
UpDown2: TUpDown;
Label7: TLabel;
Image1: TImage;
Label8: TLabel;
Button3: TButton;
Label9: TLabel;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure Edit1Enter(Sender: TObject);
procedure Edit1KeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
procedure Edit1Click(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure Edit3Change(Sender: TObject);
procedure Edit2Change(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
procedure LoadUserConfig(FileName: shortstring);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Welcome: TWelcome;
Temp: TForm;
implementation
uses Main;
{$R *.dfm}
procedure TWelcome.Button1Click(Sender: TObject);
var
i:smallint;
Exists:boolean;
Quest:textfile;
TempString:string;
begin
GamesList:=TStringList.Create;
Exists:=false;
UserName:=Edit1.Text;
Vozrast:=StrToInt(Edit2.Text);
asm
mov Month, 1
mov day, 1
end;
Rating:=0;
GameSpeed:=UpDown2.Position;
Temp.Free;
If Edit1.Items.Count<>0 then
Edit1.Items.Delete(Edit1.Items.Count-1);
If (Edit1.Text<>'Ââåäèòå ñâî¸ èìÿ...') and (Edit1.Text<>'') then begin
for i:=1 to Edit1.Items.Count do
If Edit1.Items.Strings[i-1]=Edit1.Text then Exists:=true;
If not Exists then
Edit1.Items.Add(Edit1.Text);
end;
If FileExists(dir+'\Saves\'+Edit1.Text+'.evs') and MainForm.LoadGame(dir+'\Saves\'+Edit1.Text+'.evs') then
ShowHelp:=false
else
begin
If vozrast<21 then begin
Assignfile(Quest,dir+'\Start\Young\Message.inf');
LoadUserConfig(dir+'\Start\Young\Config.ini');
end;
If (vozrast>=21) and (vozrast<30) then begin
Assignfile(Quest,dir+'\Start\Adult\Message.inf');
LoadUserConfig(dir+'\Start\Adult\Config.ini');
end;
If vozrast>=30 then begin
Assignfile(Quest,dir+'\Start\Old\Message.inf');
LoadUserConfig(dir+'\Start\Old\Config.ini');
end;
Reset(Quest);
ReadLn(Quest,TempString);
Application.MessageBox(PChar(TempString),'Ïîìîùü!',MB_ICONINFORMATION);
If (random(10)=4) and (vozrast>15) then begin
Application.MessageBox(' ñâÿçè ñ íåêîòîðûìè áàíêîâñêèìè íåóðÿäèöàìè íà âàøåì ñ÷åòó ÷óäåñíûì îáðàçîì îêàçàëîñü 750 ä.å.!','Ïîìîùü!',MB_ICONINFORMATION);
vklad:=vklad+750;
vkladp:=random(20);
end;
end;
Edit1.Items.SaveToFile(dir+'\Inf\Players.inf');
close;
end;
procedure TWelcome.Button2Click(Sender: TObject);
begin
If Application.MessageBox('Âû äåéñòâèòåëüíî õîòèòå âûéòè èç ïðîãðàììû?','Âûéòè?',MB_YESNO+MB_ICONINFORMATION)=IDYES then begin
ShowHelp:=false;
Application.Terminate;
end;
end;
procedure TWelcome.FormCreate(Sender: TObject);
Begin
Edit1.Items.LoadFromFile(dir+'\Inf\Players.inf');
If Edit1.Items.Count<>0 then
Edit1.Items.Add('- Î÷èñòèòü ñïèñîê -');
Welcome.BringToFront;
end;
procedure TWelcome.Edit1Enter(Sender: TObject);
begin
Edit1.Text:='';
end;
procedure TWelcome.Edit1KeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
If key=VK_RETURN then
Button1.OnClick(self);
end;
procedure TWelcome.Edit1Click(Sender: TObject);
begin
If Edit1.ItemIndex=Edit1.Items.Count-1 then
Edit1.Items.Clear;
end;
procedure TWelcome.FormShow(Sender: TObject);
begin
If DebugVersion then
Application.MessageBox('Äàííàÿ âåðñèÿ èãðû ÿâëÿåòñÿ ïðåäâàðèòåëüíîé. Îíà ìîæåò ñîäåðæàòü îøèáêè èëè ðàáîòàòü íåñòàáèëüíî. Îáî âñåõ íàéäåííûõ îøèáêàõ ñîîáùàéòå ìíå íà e-mail.','Ïîìîùü!',MB_ICONWARNING);
end;
procedure TWelcome.Edit3Change(Sender: TObject);
begin
If (UpDown2.Position=1) or (UpDown2.Position=21) then
Label7.Caption:='- ÷àñ â ñåêóíäó'
else
If (UpDown2.Position>4) and (UpDown2.Position<21) then
Label7.Caption:='- ÷àñîâ â ñåêóíäó'
else
If ((UpDown2.Position>1) and (UpDown2.Position<5)) or (UpDown2.Position>21) then
Label7.Caption:='- ÷àñà â ñåêóíäó';
end;
procedure TWelcome.Edit2Change(Sender: TObject);
begin
If (UpDown1.Position>5) and (UpDown1.Position<21) then
Label8.Caption:='- ëåò'
else
If (UpDown1.Position mod 10 = 1) then
Label8.Caption:='- ãîä'
else
If (UpDown1.Position div 10 > 1) then
If (UpDown1.Position mod 10 > 1) and (UpDown1.Position mod 10 < 5) then
Label8.Caption:='- ãîäà';
If (UpDown1.Position mod 10 > 4) and (UpDown1.Position mod 10 < 10) or (UpDown1.Position mod 10 = 0) then
Label8.Caption:='- ëåò';
end;
procedure TWelcome.Button3Click(Sender: TObject);
begin
If MainForm.OpenPictureDialog1.Execute then begin
Photo:=MainForm.OpenPictureDialog1.FileName;
MainForm.Image13.Picture.LoadFromFile(Photo);
MainForm.N29.Caption:='Óäàëèòü ôîòîãðàôèþ...';
MainForm.N7.Enabled:=true;
end;
end;
procedure TWelcome.FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
If (key=VK_ESCAPE) then
Button2.OnClick(self);
end;
procedure TWelcome.LoadUserConfig(FileName: shortstring);
var
UserConfig: Tinifile;
begin
UserConfig:=Tinifile.Create(FileName);
{=====Îáùèå ïàðàìåòðû=====}
Nastr:=UserConfig.ReadInteger('Common','Mood',40);
Money:=UserConfig.ReadInteger('Common','Money',3000)+random(500);
Rating:=UserConfig.ReadFloat('Common','Rating',0);
StatusValue:=UserConfig.ReadInteger('Common','Status',0);
Vlasti:=UserConfig.ReadInteger('Common','Police',100);
{=====Ðàáîòà=====}
MainForm.Label36.Caption:=UserConfig.ReadString('Work','Name','Íåò');
Zarpl:=UserConfig.ReadInteger('Work','Wage',0);
{=====Êâàðòèðà=====}
Flat:=UserConfig.ReadString('Flat','Name','');
FlatPay:=UserConfig.ReadInteger('Flat','Pay',0);
FlatComfort:=UserConfig.ReadInteger('Flat','Comfort',0);;
{=====Ïðîöåññîð=====}
MainForm.Label22.Caption:=UserConfig.ReadString('Processor','Name','Íåò');
CPUspeed:=UserConfig.ReadInteger('Processor','Score',0);
cpumnozh:=UserConfig.ReadInteger('Processor','Multiplier',0);
ocpumnozh:=cpumnozh;
cpufsb:=UserConfig.ReadInteger('Processor','FSB',0);
ocpufsb:=cpufsb;
cpuvolt:=UserConfig.ReadFloat('Processor','Voltage',0);
ocpuvolt:=cpuvolt;
cpupercent:=UserConfig.ReadInteger('Processor','Overclock',0);
Temperature:=UserConfig.ReadInteger('Processor','Temperature',0);
{=====Ìàòåðèíêà=====}
MainForm.Label23.Caption:=UserConfig.ReadString('Motherboard','Name','Íåò');
chipset:=UserConfig.ReadString('Motherboard','Chipset','');
videochipset:=UserConfig.ReadString('Motherboard','SupportVideoBus','');
RamType:=UserConfig.ReadString('Motherboard','SupportRAMType','');
If UserConfig.ReadBool('Motherboard','ChangeFSB',False) then
MainForm.Label99.Caption:='Äîñòóïíî'
else
MainForm.Label99.Caption:='Íåäîñòóïíî';
If UserConfig.ReadBool('Motherboard','ChangeVoltage',False) then
MainForm.Label121.Caption:='Äîñòóïíî'
else
MainForm.Label121.Caption:='Íåäîñòóïíî';
If UserConfig.ReadBool('Motherboard','ChangeMultiplier',False) then
MainForm.Label101.Caption:='Ìåíÿåòñÿ'
else
MainForm.Label101.Caption:='Áëîêèðîâàí';
{=====Âèäåîêàðòà=====}
Mainform.Label76.Caption:=UserConfig.ReadString('Videocard','Name','Íåò');
VideoChip:=UserConfig.ReadString('Videocard','Chip','');
VideoSpeed:=UserConfig.ReadInteger('Videocard','Score',0);
VideoMem:=UserConfig.ReadInteger('Videocard','MemoryClock',0);
oVideoMem:=VideoMem;
VideoCore:=UserConfig.ReadInteger('Videocard','CoreClock',0);
oVideoCore:=VideoCore;
VideoShina:=UserConfig.ReadString('Videocard','Bus','');
VideoPercent:=UserConfig.ReadInteger('Videocard','Overclock',0);
VideoTemp:=UserConfig.ReadInteger('Videocard','Temperature',0);
{=====Êóëåð=====}
Mainform.Label73.Caption:=UserConfig.ReadString('Cooler','Name','Íåò');
CoolerSpeed:=UserConfig.ReadInteger('Cooler','Speed',0);
{=====Îïåðàòèâà=====}
MainForm.Label24.Caption:=UserConfig.ReadString('RAM','Name','Íåò');
ozycapacity:=UserConfig.ReadInteger('RAM','Capacity',0);
ramspeed:=UserConfig.ReadInteger('RAM','Speed',0);
ramtype:=UserConfig.ReadString('RAM','Type','Íåò');
{=====Âèíò=====}
If UserCOnfig.ValueExists('HDD','PartitionList') then begin
MainForm.Label25.Caption:=UserConfig.ReadString('HDD','Name','Íåò');
defragspeed:=random(4000);
HardSpace:=UserConfig.ReadInteger('HDD','Capacity',0);
HardSpeed:=UserConfig.ReadInteger('HDD','Speed',0);
LoadDiskStructure(dir+'\Start\Young\'+UserConfig.ReadString('HDD','PartitionList',''));
end;
{=====Ìîíèòîð=====}
MainForm.Label27.Caption:=UserConfig.ReadString('Monitor','Name','Íåò');
safety:=UserConfig.ReadInteger('Monitor','Safety',0);
MonitorDiag:=UserConfig.ReadInteger('Monitor','Diagonal',0);
{=====CD-ROM=====}
MainForm.Label28.Caption:=UserConfig.ReadString('CD-ROM','Name','Íåò');
CDSpeed:=UserConfig.ReadInteger('CD-ROM','CDSpeed',0);
CDRSpeed:=UserConfig.ReadInteger('CD-ROM','CDRSpeed',0);
CDRWSpeed:=UserConfig.ReadInteger('CD-ROM','CDRWSpeed',0);
DVDRSpeed:=UserConfig.ReadInteger('CD-ROM','DVDRSpeed',0);
DVDRWSpeed:=UserConfig.ReadInteger('CD-ROM','DVDRWSpeed',0);
{=====Ìîäåì=====}
MainForm.Label29.Caption:=UserConfig.ReadString('Modem','Name','Íåò');
InetSpeed:=UserConfig.ReadInteger('Modem','Speed',0);
InetTraffic:=UserConfig.ReadInteger('Modem','Traffic',0);
{=====ÈÁÏ=====}
MainForm.Label38.Caption:=UserConfig.ReadString('UPS','Name','Íåò');
Nadeg:=UserConfig.ReadInteger('UPS','Reliability',0);
{=====Ïðèíòåð=====}
MainForm.Label74.Caption:=UserConfig.ReadString('Printer','Name','Íåò');
Printing:=UserConfig.ReadInteger('Printer','Speed',0);
{=====Ñêàíåð=====}
MainForm.Label75.Caption:=UserConfig.ReadString('Scanner','Name','Íåò');
Scanning:=UserConfig.ReadInteger('Scanner','Speed',0);
{=====Ïåðèôåðèÿ=====}
MainForm.Label69.Caption:=UserConfig.ReadString('Peripherals','Keyboard','Íåò');
MainForm.Label70.Caption:=UserConfig.ReadString('Peripherals','Mouse','Íåò');
MainForm.Label71.Caption:=UserConfig.ReadString('Peripherals','Speakers','Íåò');
Mainform.Label26.Caption:=UserConfig.ReadString('Peripherals','Soundcard','Íåò');
{=====Êîðïóñ=====}
MainForm.Label72.Caption:=UserConfig.ReadString('Peripherals','Tower','Íåò');
MainForm.Label77.Caption:=UserConfig.ReadString('Peripherals','PowerSupply','Íåò');
{=====Áàíê=====}
Vklad:=UserConfig.ReadInteger('Bank','Deposit',0);
Vkladp:=UserConfig.ReadInteger('Bank','Percent',0);
{==================}
end;
end.