?? unit1.pas
字號:
jit_dangqianbs:= GameSave1.dangqianbs;
jit_caifu:= GameSave1.caifu;
jit_dangqianbs_dn:= GameSave1.dangqianbs_dn;
jit_caifu_dn:= GameSave1.caifu_dn;
jit_koucu:= GameSave1.koucu;
jit_koucu_dn:= GameSave1.koucu_dn;
jit_leiji:= GameSave1.leiji;
end else begin
jit_dangqianbs:= 0;
jit_caifu:= 0;
jit_dangqianbs_dn:= 0;
jit_caifu_dn:= 0;
jit_koucu:= 0;
jit_koucu_dn:= 0;
jit_leiji:= 0;
GameSave1.zhuangtai:= 195;
GameSave1.index:= 0;
GameSave1.tip1:= 0;
GameSave1.tip2:= 0;
GameSave1.tip3:= 0;
GameSave1.tip4:= 0;
GameSave1.tip5:= 0;
GameSave1.tip6:= 0;
GameSave1.tip7:= 0;
GameSave1.zqbs:= 0;
GameSave1.cwbs:= 0;
end;
{初始化額外獲得物品的狀態}
if GameSave1.tip1> 0 then
listbox3.Items.Add('幻界水晶:'+ inttostr(GameSave1.tip1)+ '顆');
if GameSave1.tip2> 0 then
listbox3.Items.Add('2007小金豬:'+ inttostr(GameSave1.tip2)+ '顆');
if GameSave1.tip3> 0 then
listbox3.Items.Add('魔力寶石:'+ inttostr(GameSave1.tip3)+ '顆');
if GameSave1.tip4> 0 then
listbox3.Items.Add('上古神石:'+ inttostr(GameSave1.tip4)+ '顆');
if GameSave1.tip5> 0 then
listbox3.Items.Add('傳世玉佛:'+ inttostr(GameSave1.tip5)+ '顆');
if GameSave1.tip6> 0 then
listbox3.Items.Add('極品七星珠:'+ inttostr(GameSave1.tip6)+ '顆');
if GameSave1.tip7> 0 then
listbox3.Items.Add('混沌舍利:'+ inttostr(GameSave1.tip7)+ '顆');
jit_cup_int:= get_jb;
end;
procedure TForm1.show_game_state; //顯示游戲狀態
begin
if groupbox4.Visible then
begin
{賭錢狀態}
if ((strtoint(label9.Caption) > 3)and radiobutton4.Checked) or ((strtoint(label9.Caption) < 4)and radiobutton5.Checked) then
begin
jit_caifu:= jit_caifu + strtoint(edit1.Text);
jit_caifu_dn:= jit_caifu_dn - strtoint(edit1.Text);
listbox3.items[4]:='您贏了'+edit1.Text;
imagelist1.Draw(MCanvas,4,9,0);
end else begin
jit_caifu:= jit_caifu - strtoint(edit1.Text);
jit_caifu_dn:= jit_caifu_dn + strtoint(edit1.Text);
listbox3.items[4]:='您輸了'+edit1.Text;
imagelist1.Draw(MCanvas,4,9,1);
end;
if strtoint(edit1.Text)> jit_caifu then
edit1.Text:= inttostr(jit_caifu div 10);
end else begin
jit_dangqianbs:= jit_dangqianbs mod listbox2.Items.Count;
listbox2.ItemIndex:= jit_dangqianbs;
listbox3.items[4]:= listbox2.Items.Strings[jit_dangqianbs];
prs_game_list2(listbox2.Items.Strings[jit_dangqianbs]); //處理游戲進程
listbox3.items[3]:= inttostr(jit_dangqianbs); //顯示當前步數
end;
listbox3.items[2]:= FormatCurr('0.00',jit_caifu);
case jit_koucu of
0..10000: listbox3.items[1]:= '平民';
10001..25000:listbox3.items[1]:= '村長';
25001..50000:listbox3.items[1]:= '鄉長';
50001..80000: listbox3.items[1]:= '縣令';
80001..125000:listbox3.items[1]:= '知府';
125001..180000:listbox3.items[1]:= '道臺';
180001..250000:listbox3.items[1]:= '太守';
250001..350000:listbox3.items[1]:= '都督';
350001..500000:listbox3.items[1]:= '御史';
500001..700000:listbox3.items[1]:= '巡按';
700001..1000000: listbox3.items[1]:= '宰相';
1000001..3000000: listbox3.items[1]:= '拜侯封王';
3000001..6000000: listbox3.items[1]:= '嶗山尋道';
6000001..9000000: listbox3.items[1]:= '東渡蓬萊';
9000001..15000000: listbox3.items[1]:= '氣貫長虹';
15000001..20000000: listbox3.items[1]:= '虛彌幻境';
20000001..25000000: listbox3.items[1]:= '天長地久';
25000001..30000000: listbox3.items[1]:= '偶得仙果';
30000001..35000000: listbox3.items[1]:= '初入仙界';
35000001..40000000: listbox3.items[1]:= '仙界一級';
45000001..50000000: listbox3.items[1]:= '仙界二級';
55000001..60000000: listbox3.items[1]:= '仙界三級';
65000001..70000000: listbox3.items[1]:= '深入仙界';
70000001..80000000: listbox3.items[1]:= '天人合一';
80000001..99000000: listbox3.items[1]:= '大功告成';
end;
end;
procedure TForm1.save_game_progress(filename: string);
var File1: File Of TGameSave;
begin
GameSave1.dangqianbs:=jit_dangqianbs;
GameSave1.caifu:=jit_caifu;
GameSave1.dangqianbs_dn:=jit_dangqianbs_dn;
GameSave1.caifu_dn:=jit_caifu_dn;
GameSave1.koucu:=jit_koucu;
GameSave1.koucu_dn:=jit_koucu_dn;
// GameSave1.leiji:=jit_leiji;
GameSave1.index:= combobox1.ItemIndex;
if not DirectoryExists(ExtractFileDir(filename)) then
mkdir(ExtractFileDir(filename));
AssignFile(File1,filename);
Rewrite(File1);
try
write(File1,GameSave1);
finally
CloseFile(File1);
end;
end;
procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
save_check;
end;
procedure TForm1.Timer1Timer(Sender: TObject);
begin
if jit_time > -1 then
begin
inc(jit_time);
label9.Caption:= inttostr((jit_time mod 6)+1);
if checkbox8.Checked then
begin
if jit_time = jit_delay then
begin
radiobutton1.Font.Color:=clwindowtext;
radiobutton2.Font.Color:=clwindowtext;
radiobutton3.Font.Color:=clwindowtext;
end;
end;
end else begin
inc(jit_time,-1);
if not checkbox1.Checked then
begin
timer1.Enabled:= false;
end;
if jit_time <= -40 then
groupbox3.Visible:= false;
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
var ss: string;
begin
if checkbox2.Checked then
begin
if not Assigned(jit_spk1) then
begin
jit_spk1:= Tjit_spk.create('hello');
sleep(500);
end;
end;
if Assigned(form6) then
begin
if form6.Showing then
begin
postmessage(form6.Handle,form6_msg,0,cn_jit_game_star);
exit;
end;
end;
if jit_time < jit_delay then
jit_time:= jit_delay-1;
if Sender <> Action8 then
begin
if groupbox3.Visible and (radiobutton1.Checked= false) and (radiobutton2.Checked= false) and (radiobutton3.Checked= false) then
exit;
end;
if not jit_game_start then //載入游戲腳本
begin
screen.Cursor:= crhourglass;
listbox2.Items.Clear;
listbox2.Items.LoadFromFile(ExtractFilePath(application.ExeName)+'moneybags.dat');
jit_game_start:= true;
screen.Cursor:= crdefault;
end;
groupbox4.Visible:= false;
radiobutton1.Checked:= false;
radiobutton2.Checked:= false;
radiobutton3.Checked:= false;
jit_tmp_3:= Random(3);
jit_time:= 0;
if (checkbox3.Checked= false) and checkbox9.Checked then
begin
if jit_words_i< jit_words_i_c then
begin
inc(jit_word_p);
inc(jit_words_i);
end else begin
jit_words_i:= 0;
jit_word_p:= Random(wordlist1.Count);
end;
end else begin
jit_word_p:= Random(wordlist1.Count);
end;
if jit_word_p>= wordlist1.Count then
jit_word_p:= wordlist1.Count -1;
ss:= wordlist1.Strings[jit_word_p];
if ss='' then
begin
jit_word_p:= Random(wordlist1.Count);
ss:= wordlist1.Strings[jit_word_p];
end;
if ss= '' then
begin
messagebox(handle,'警告:單詞本內含有太多的空行,請刪除單詞本里的空行。','錯誤信息',MB_OK or MB_ICONERROR);
exit;
end else begin
if ss[1]= '[' then
begin
jit_word_p:= Random(wordlist1.Count);
ss:= wordlist1.Strings[jit_word_p];
end;
end;
if ss[1]= '[' then
begin
jit_word_p:= Random(wordlist1.Count);
ss:= wordlist1.Strings[jit_word_p];
end;
if checkbox3.Checked then
richedit1.Lines[0]:= copy(ss,pos('=',ss)+1,64) //反向學習
else
richedit1.Lines[0]:= copy(ss,1,pos('=',ss)-1);
if jit_tmp_3= 0 then
begin //111-------****
if checkbox3.Checked then
radiobutton1.Caption:= copy(ss,1,pos('=',ss)-1) //反向學習
else
radiobutton1.Caption:= copy(ss,pos('=',ss)+1,128);
ss:= wordlist1.Strings[Random(wordlist1.Count)];
if ss= radiobutton1.Caption then
ss:= wordlist1.Strings[Random(wordlist1.Count)];
if checkbox3.Checked then
radiobutton2.Caption:= copy(ss,1,pos('=',ss)-1)
else
radiobutton2.Caption:= copy(ss,pos('=',ss)+1,128);
ss:= wordlist1.Strings[Random(wordlist1.Count)];
if checkbox3.Checked then
radiobutton3.Caption:= copy(ss,1,pos('=',ss)-1)
else
radiobutton3.Caption:= copy(ss,pos('=',ss)+1,128);
end else if jit_tmp_3= 1 then begin //111 222 -------------- ****
if checkbox3.Checked then
radiobutton2.Caption:= copy(ss,1,pos('=',ss)-1) //反向學習
else
radiobutton2.Caption:= copy(ss,pos('=',ss)+1,128);
ss:= wordlist1.Strings[Random(wordlist1.Count)];
if ss= radiobutton2.Caption then
ss:= wordlist1.Strings[Random(wordlist1.Count)];
if checkbox3.Checked then
radiobutton1.Caption:= copy(ss,1,pos('=',ss)-1)
else
radiobutton1.Caption:= copy(ss,pos('=',ss)+1,128);
ss:= wordlist1.Strings[Random(wordlist1.Count)];
if checkbox3.Checked then
radiobutton3.Caption:= copy(ss,1,pos('=',ss)-1)
else
radiobutton3.Caption:= copy(ss,pos('=',ss)+1,128);
end else begin ///222 333 --------------- ************
if checkbox3.Checked then
radiobutton3.Caption:= copy(ss,1,pos('=',ss)-1) //反向學習
else
radiobutton3.Caption:= copy(ss,pos('=',ss)+1,128);
ss:= wordlist1.Strings[Random(wordlist1.Count)];
if ss= radiobutton3.Caption then
ss:= wordlist1.Strings[Random(wordlist1.Count)];
if checkbox3.Checked then
radiobutton1.Caption:= copy(ss,1,pos('=',ss)-1)
else
radiobutton1.Caption:= copy(ss,pos('=',ss)+1,128);
ss:= wordlist1.Strings[Random(wordlist1.Count)];
if checkbox3.Checked then
radiobutton2.Caption:= copy(ss,1,pos('=',ss)-1)
else
radiobutton2.Caption:= copy(ss,pos('=',ss)+1,128);
end; ///333
groupbox3.Visible:= true;
groupbox3.Refresh;
timer1.Enabled:= true;
// eciVolume
if checkbox5.Checked then
eciCopyVoice(jit_h, 2, 0 )
else if checkbox6.Checked then
eciCopyVoice(jit_h, 3, 0 );
// eciSetVoiceParam(jit_h, 0, 7, 90);
if checkbox2.Checked then
begin
jit_spk1.spk:= richedit1.Lines[0];
postthreadmessage(jit_spk1.ThreadID,um_ontimer,0,0);
end;
button1.SetFocus;
radiobutton1.Color:= clMedGray;
radiobutton2.Color:= clMedGray;
radiobutton3.Color:= clMedGray;
if checkbox8.Checked then
begin
radiobutton1.Font.Color:= clMedGray;
radiobutton2.Font.Color:= clMedGray;
radiobutton3.Font.Color:= clMedGray;
end else begin
radiobutton1.Font.Color:=clwindowtext;
radiobutton2.Font.Color:=clwindowtext;
radiobutton3.Font.Color:=clwindowtext;
end;
jit_chayifense; //差異分色顯示
end;
procedure TForm1.RadioButton1Click(Sender: TObject);
begin
if RadioButton1.Checked then
check_asw(0);
end;
procedure TForm1.check_asw(i: integer);
var int1:int64;
begin
if jit_tmp_3= -1 then
exit;
case jit_tmp_3 of
0: radiobutton1.Color:= clgreen;
1: radiobutton2.Color:= clgreen;
2: radiobutton3.Color:= clgreen;
end;
if i= jit_tmp_3 then
begin
QueryperformanceCounter(int1); //獲取cpu脈沖數
jit_time:= (int1 mod 6)+ 1; //取模
label9.Caption:= inttostr(jit_time);
inc(jit_dangqianbs,jit_time);
show_game_state; //顯示游戲狀態
jit_jewelry(jit_time);
jit_time:= -1;
inc(GameSave1.zqbs);
end else begin
jit_time:= -1;
jit_tmp_3:= -1;
listbox3.items[4]:= '選擇錯誤,步數為零。';
inc(GameSave1.cwbs);
if checkbox7.Checked then
PlaySound(pchar(extractfilepath(application.ExeName)+'Button15.wav'),0,SND_FILENAME or SND_ASYNC);
case i of
0: radiobutton1.Color:= clred;
1: radiobutton2.Color:= clred;
2: radiobutton3.Color:= clred;
end;
label9.Caption:= '0';
end;
if not groupbox4.Visible then
begin
jit_dangqianbs_dn:= jit_dangqianbs_dn + Random(7);
end;
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -