?? unit1.pas
字號:
computer_step; //電腦走一步
show_cup; //檢查獎杯狀態
end;
procedure TForm1.RadioButton2Click(Sender: TObject);
begin
if RadioButton2.Checked then
check_asw(1);
end;
procedure TForm1.RadioButton3Click(Sender: TObject);
begin
if RadioButton3.Checked then
check_asw(2);
end;
procedure TForm1.prs_game_list2(const s: string);
var i: integer;
begin
if pos('加',s)> 0 then
begin
if not TryStrToInt(copy(s,pos('加',s)+2,9),i) then
i:= 0;
jit_caifu:= jit_caifu + i;
if checkbox7.Checked then
PlaySound(pchar(extractfilepath(application.ExeName)+'Chimes.wav'),0,SND_FILENAME or SND_ASYNC);
end else if pos('減',s)> 0 then
begin
if not TryStrToInt(copy(s,pos('減',s)+2,9),i) then
i:= 0;
jit_caifu:= jit_caifu -i;
end else if pos('進',s)> 0 then
begin
if not TryStrToInt(copy(s,pos('進',s)+2,9),i) then
i:= 1;
jit_dangqianbs:= jit_dangqianbs + i;
show_game_state; //顯示游戲狀態
end else if pos('退',s)> 0 then
begin
if not TryStrToInt(copy(s,pos('退',s)+2,9),i) then
i:= 1;
jit_dangqianbs:= jit_dangqianbs -i;
show_game_state; //顯示游戲狀態
end;
end;
procedure TForm1.computer_step;
var ss: string;
begin
if not groupbox4.Visible then
begin
jit_dangqianbs_dn:= jit_dangqianbs_dn mod listbox2.Items.Count;
prs_game_list2_dn(listbox2.Items.Strings[jit_dangqianbs_dn]); //處理游戲進程
end;
case jit_koucu_dn of
0..10000: ss:= '平民';
10001..25000:ss:= '村長';
25001..50000:ss:= '鄉長';
50001..80000: ss:= '縣令';
80001..125000:ss:= '知府';
125001..180000:ss:= '道臺';
180001..250000:ss:= '太守';
250001..350000:ss:= '都督';
350001..500000:ss:= '御史';
500001..700000:ss:= '巡按';
700001..1000000: ss:= '宰相';
1000001..3000000: ss:= '拜侯封王';
3000001..6000000: ss:= '嶗山尋道';
6000001..9000000: ss:= '東渡蓬萊';
9000001..15000000: ss:= '氣貫長虹';
15000001..20000000: ss:= '虛彌幻境';
20000001..25000000: ss:= '天長地久';
25000001..30000000: ss:= '偶得仙果';
30000001..35000000: ss:= '初入仙界';
35000001..40000000: ss:= '仙界一級';
45000001..50000000: ss:= '仙界二級';
55000001..60000000: ss:= '仙界三級';
65000001..70000000: ss:= '深入仙界';
70000001..80000000: ss:= '天人合一';
80000001..99000000: ss:= '大功告成';
end;
if listbox1.Items.Count< 3 then
begin
listbox1.Items.Add('玩家:電腦');
listbox1.Items.Add('頭銜:'+ ss);
listbox1.Items.Add('財富:'+FormatCurr('0.00',jit_caifu_dn));
listbox1.Items.Add('當前步數:'+ inttostr(jit_dangqianbs_dn));
listbox1.Items.Add(listbox2.Items.Strings[jit_dangqianbs_dn]);
end else begin
listbox1.Items.Strings[1]:='頭銜:'+ ss;
listbox1.Items.Strings[2]:='財富:'+FormatCurr('0.00',jit_caifu_dn);
if groupbox4.Visible then
begin
listbox1.Items.Strings[4]:= '進入賭錢狀態。';
end else begin
listbox1.Items.Strings[4]:= listbox2.Items.Strings[jit_dangqianbs_dn];
end;
end;
up_game_honor; //升級頭銜
end;
procedure TForm1.prs_game_list2_dn(const s: string);
var i: integer;
begin
if pos('加',s)> 0 then
begin
if not TryStrToInt(copy(s,pos('加',s)+2,9),i) then
i:= 0;
jit_caifu_dn:= jit_caifu_dn + i;
end else if pos('減',s)> 0 then
begin
if not TryStrToInt(copy(s,pos('減',s)+2,9),i) then
i:= 0;
jit_caifu_dn:= jit_caifu_dn -i;
end else if pos('進',s)> 0 then
begin
if not TryStrToInt(copy(s,pos('進',s)+2,9),i) then
i:= 1;
jit_dangqianbs_dn:= jit_dangqianbs_dn + i;
computer_step; //顯示游戲狀態
end else if pos('退',s)> 0 then
begin
if not TryStrToInt(copy(s,pos('退',s)+2,9),i) then
i:= 1;
jit_dangqianbs_dn:= jit_dangqianbs_dn -i;
computer_step; //顯示游戲狀態
end;
end;
procedure TForm1.show_inst_game;
var ss: string;
begin
listbox3.items[3]:= inttostr(jit_dangqianbs); //顯示當前步數
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;
case jit_koucu_dn of
0..10000: ss:= '平民';
10001..25000:ss:= '村長';
25001..50000:ss:= '鄉長';
50001..80000: ss:= '縣令';
80001..125000:ss:= '知府';
125001..180000:ss:= '道臺';
180001..250000:ss:= '太守';
250001..350000:ss:= '都督';
350001..500000:ss:= '御史';
500001..700000:ss:= '巡按';
700001..1000000: ss:= '宰相';
1000001..3000000: ss:= '拜侯封王';
3000001..6000000: ss:= '嶗山尋道';
6000001..9000000: ss:= '東渡蓬萊';
9000001..15000000: ss:= '氣貫長虹';
15000001..20000000: ss:= '虛彌幻境';
20000001..25000000: ss:= '天長地久';
25000001..30000000: ss:= '偶得仙果';
30000001..35000000: ss:= '初入仙界';
35000001..40000000: ss:= '仙界一級';
45000001..50000000: ss:= '仙界二級';
55000001..60000000: ss:= '仙界三級';
65000001..70000000: ss:= '深入仙界';
70000001..80000000: ss:= '天人合一';
80000001..99000000: ss:= '大功告成';
end;
if listbox1.Items.Count< 3 then
begin
listbox1.Items.Add('玩家:電腦');
listbox1.Items.Add('頭銜:'+ ss);
listbox1.Items.Add('財富:'+FormatCurr('0.00',jit_caifu_dn));
listbox1.Items.Add('當前步數:'+ inttostr(jit_dangqianbs_dn));
listbox1.Items.Add('消息');
end else begin
listbox1.Items.Strings[1]:='頭銜:'+ ss;
listbox1.Items.Strings[2]:='財富:'+FormatCurr('0.00',jit_caifu_dn);
listbox1.Items.Strings[3]:='當前步數:'+ inttostr(jit_dangqianbs_dn);
listbox1.Items.Strings[4]:= listbox2.Items.Strings[jit_dangqianbs_dn];
end;
end;
procedure TForm1.GroupBox3Click(Sender: TObject);
begin
button1click(groupbox3);
end;
procedure TForm1.up_game_honor;
var i: integer;
begin
i:= 0;
if jit_caifu > jit_koucu then
begin
case jit_caifu of
10001..25000:begin
jit_koucu:= 25000;
i:= 1001;
end;
25001..50000:begin
jit_koucu:= 50000;
i:= 25001;
end;
50001..80000: begin
jit_koucu:= 80000;
i:= 50001;
end;
80001..125000:begin
jit_koucu:= 125000;
i:= 80001;
end;
125001..180000:begin
jit_koucu:= 180000;
i:= 125001;
end;
180001..250000:begin
jit_koucu:= 250000;
i:= 180001;
end;
250001..350000:begin
jit_koucu:= 350000;
i:= 250001;
end;
350001..500000:begin
jit_koucu:= 500000;
i:= 350001;
end;
500001..700000:begin
jit_koucu:= 700000;
i:= 500001;
end;
700001..1000000: begin
jit_koucu:= 1000000;
i:= 700001;
end;
1000001..3000000: begin
jit_koucu:= 3000000;
i:= 1000001;
end;
3000001..6000000: begin
jit_koucu:= 6000000;
i:= 3000001;
end;
6000001..9000000: begin
jit_koucu:= 9000000;
i:= 6000001;
end;
9000001..15000000: begin
jit_koucu:= 15000000;
i:= 9000001;
end;
15000001..20000000: begin
jit_koucu:= 20000000;
i:= 15000001;
end;
20000001..25000000: begin
jit_koucu:= 25000000;
i:= 20000001;
end;
25000001..30000000: begin
jit_koucu:= 30000000;
i:= 25000001;
end;
30000001..35000000: begin
jit_koucu:= 35000000;
i:= 30000001;
end;
35000001..40000000: begin
jit_koucu:= 40000000;
i:= 35000001;
end;
45000001..50000000: begin
jit_koucu:= 50000000;
i:= 45000001;
end;
55000001..60000000: begin
jit_koucu:= 60000000;
i:= 55000001;
end;
65000001..70000000: begin
jit_koucu:= 70000000;
i:= 65000001;
end;
70000001..80000000: begin
jit_koucu:= 80000000;
i:= 70000001;
end;
80000001..99000000: begin
jit_koucu:= 99000000;
i:= 80000001;
end;
end;
if (jit_koucu > 0) then
begin
jit_caifu:= jit_caifu-i;
if checkbox7.Checked then
PlaySound(pchar(extractfilepath(application.ExeName)+'Joy118.wav'),0,SND_FILENAME or SND_ASYNC);
show_inst_game;
end;
end;
if jit_caifu_dn > jit_koucu_dn then
begin
case jit_caifu_dn of
10001..25000:begin
jit_koucu_dn:= 25000;
i:= 10001;
end;
25001..50000:begin
jit_koucu_dn:= 50000;
i:= 25001;
end;
50001..80000: begin
jit_koucu_dn:= 80000;
i:= 50001;
end;
80001..125000:begin
jit_koucu_dn:= 125000;
i:= 80001;
end;
125001..180000:begin
jit_koucu_dn:= 180000;
i:= 125001;
end;
180001..250000:begin
jit_koucu_dn:= 250000;
i:= 180001;
end;
250001..350000:begin
jit_koucu_dn:= 350000;
i:= 250001;
end;
350001..500000:begin
jit_koucu_dn:= 500000;
i:= 350001;
end;
500001..700000:begin
jit_koucu_dn:= 700000;
i:= 500001;
end;
700001..1000000: begin
jit_koucu_dn:= 1000000;
i:= 700001;
end;
1000001..3000000: begin
jit_koucu_dn:= 3000000;
i:= 1000001;
end;
3000001..6000000: begin
jit_koucu_dn:= 6000000;
i:= 3000001;
end;
6000001..9000000: begin
jit_koucu_dn:= 9000000;
i:= 6000001;
end;
9000001..15000000: begin
jit_koucu_dn:= 15000000;
i:= 9000001;
end;
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -