📄 unit1.pas
字号:
GameSave1.zhuangtai:= GameSave1.zhuangtai + 256;
end;
procedure TForm1.show_check(i: integer);
begin
checkbox1.Checked:= false;
checkbox2.Checked:= false;
checkbox3.Checked:= false;
checkbox4.Checked:= false;
checkbox5.Checked:= false;
checkbox6.Checked:= false;
checkbox7.Checked:= false;
checkbox8.Checked:= false;
if GameSave1.zhuangtai and 1 = 1 then
checkbox1.Checked:= true;
if GameSave1.zhuangtai and 2 = 2 then
checkbox2.Checked:= true;
if GameSave1.zhuangtai and 4 = 4 then
begin
checkbox2.Checked:= false;
checkbox2.Enabled:= false;
checkbox3.Checked:= true;
end;
if GameSave1.zhuangtai and 8 = 8 then
checkbox4.Checked:= true;
if GameSave1.zhuangtai and 16 = 16 then
checkbox5.Checked:= true;
if GameSave1.zhuangtai and 32 = 32 then
checkbox6.Checked:= true;
if GameSave1.zhuangtai and 64 = 64 then
checkbox7.Checked:= true;
if GameSave1.zhuangtai and 128 = 128 then
checkbox8.Checked:= true;
if GameSave1.zhuangtai and 256 = 256 then
checkbox9.Checked:= true;
end;
procedure TForm1.CheckBox4Click(Sender: TObject);
begin
if checkbox4.Checked then
begin
eciCopyVoice(jit_h, 9, 0 );
checkbox5.Checked:= false;
checkbox6.Checked:= false;
end;
end;
procedure TForm1.CheckBox5Click(Sender: TObject);
begin
if checkbox5.Checked then
begin
checkbox4.Checked:= false;
checkbox6.Checked:= false;
end;
end;
procedure TForm1.CheckBox6Click(Sender: TObject);
begin
if checkbox6.Checked then
begin
checkbox5.Checked:= false;
checkbox4.Checked:= false;
end;
end;
procedure TForm1.FormDestroy(Sender: TObject);
begin
wordlist1.Free;
gamesave1.leiji:= gamesave1.leiji + Trunc((now - jit_kssj) *24*60*60);
save_game_progress(extractfilepath(application.ExeName)+'save\default.sav');
if Assigned(jit_spk1) then
begin
jit_spk1.Terminate;
postthreadmessage(jit_spk1.ThreadID,um_quitthread,0,0);
jit_spk1.Free;
end;
Mcanvas.Free;
end;
procedure TForm1.ListBox3MeasureItem(Control: TWinControl; Index: Integer;
var Height: Integer);
begin
Height := ListBox2.Canvas.TextHeight('W') + 6;
end;
procedure TForm1.ListBox3DrawItem(Control: TWinControl; Index: Integer;
Rect: TRect; State: TOwnerDrawState);
var bmp: tbitmap;
begin
ListBox3.Canvas.FillRect(Rect);
case index mod 12 of
0: begin
imagelist1.Draw(ListBox3.Canvas,rect.left+1,rect.top,6);
ListBox3.Canvas.TextOut(Rect.Left+20, Rect.Top, ListBox3.Items[Index]);
if get_jb= 0 then
imagelist1.Draw(ListBox3.Canvas,140,rect.top,13);
end;
1: begin
imagelist1.Draw(ListBox3.Canvas,rect.left+1,rect.top,11);
ListBox3.Canvas.TextOut(Rect.Left+20, Rect.Top, '头衔:'+ListBox3.Items[Index]);
end;
2: begin
imagelist1.Draw(ListBox3.Canvas,rect.left+1,rect.top,10);
ListBox3.Canvas.TextOut(Rect.Left+20, Rect.Top, '财富:'+ListBox3.Items[Index]);
end;
3: begin
imagelist1.Draw(ListBox3.Canvas,rect.left+1,rect.top,12);
ListBox3.Canvas.TextOut(Rect.Left+20, Rect.Top, '当前步数:'+ListBox3.Items[Index]);
end;
4: begin
imagelist1.Draw(ListBox3.Canvas,rect.left+1,rect.top,4);
ListBox3.Canvas.TextOut(Rect.Left+20, Rect.Top, ListBox3.Items[Index]);
end;
pic_start..11: begin
// imagelist1.Draw(ListBox3.Canvas,rect.left+1,rect.top,4);
{根据内容绘图}
bmp := tbitmap.create;
if pos('幻界水晶',ListBox3.Items[Index])>0 then
imagelist2.getbitmap(0, bmp)
else if pos('2007小金猪',ListBox3.Items[Index])>0 then
imagelist2.getbitmap(1, bmp)
else if pos('魔力宝石',ListBox3.Items[Index])>0 then
imagelist2.getbitmap(2, bmp)
else if pos('上古神石',ListBox3.Items[Index])>0 then
imagelist2.getbitmap(3, bmp)
else if pos('传世玉佛',ListBox3.Items[Index])>0 then
imagelist2.getbitmap(4, bmp)
else if pos('极品七星珠',ListBox3.Items[Index])>0 then
imagelist2.getbitmap(5, bmp)
else if pos('混沌舍利',ListBox3.Items[Index])>0 then
imagelist2.getbitmap(6, bmp);
ListBox3.Canvas.CopyRect(classes.Rect(140,Rect.Top,156,Rect.Top+16),bmp.canvas, classes.rect(0, 0, 48, 48));
ListBox3.Canvas.TextOut(Rect.Left, Rect.Top, ListBox3.Items[Index]);
bmp.Free;
end;
end;
// ListBox3.Canvas.Font.Name := '宋体';
end;
procedure TForm1.Action6Execute(Sender: TObject);
begin
if groupbox4.Visible then
button11click(action6)
else
button1click(action6);
end;
procedure TForm1.jit_jewelry(i: integer);
begin
if jit_time= jit_num then
begin
inc(jit_total);
end else begin
if jit_total > 1 then
jit_draw_jewelry(jit_total);
jit_num:= jit_time;
jit_total:= 1;
end;
// jit_total: integer; //累计次数
// jit_num: integer; //上次数值
end;
procedure TForm1.jit_draw_jewelry(i: integer);
var
ACanvas: TCanvas;
procedure add_to_listbox(const s: string; q: integer);
var j: integer;
begin
for j:= pic_start to 11 do
begin
if (listbox3.Items.Count> j)and (pos(s,listbox3.Items[j])> 0) then
begin
listbox3.Items[j]:= s +':'+ inttostr(q)+ '颗';
break;
end else if (j= 11) or (listbox3.Items.Count<= j) then
begin
listbox3.Items.Add(s +':'+ inttostr(q)+ '颗');
break;
end;
end;
end;
begin
ACanvas := TCanvas.Create;
try
ACanvas.Handle := getdc(groupbox3.Handle);
ACanvas.Font.Name:= '宋体';
ACanvas.Font.Size:= 14;
{ ACanvas.CopyRect(Rect(0, 0, Screen.Width, Screen.Height),
ABmp.Canvas,
Rect(0, 0, ABmp.Width, ABmp.Height)); }
case i of
2: begin
// showmessage('幻界水晶一颗')
imagelist2.Draw(ACanvas,40,12,0);
ACanvas.TextOut(90,24,'得到幻界水晶一颗');
inc(gamesave1.tip1);
add_to_listbox('幻界水晶',gamesave1.tip1);
end;
3: begin
imagelist2.Draw(ACanvas,40,12,1);
ACanvas.TextOut(90,24,'得到2007小金猪一颗');
inc(gamesave1.tip2);
add_to_listbox('2007小金猪',gamesave1.tip2);
end;
4: begin
imagelist2.Draw(ACanvas,40,12,2);
ACanvas.TextOut(90,24,'得到魔力宝石一颗');
inc(gamesave1.tip3);
add_to_listbox('魔力宝石',gamesave1.tip3);
end;
5: begin
imagelist2.Draw(ACanvas,40,12,3);
ACanvas.TextOut(90,24,'得到上古神石一颗');
inc(gamesave1.tip4);
add_to_listbox('上古神石',gamesave1.tip4);
end;
6: begin
imagelist2.Draw(ACanvas,40,12,4);
ACanvas.TextOut(90,24,'得到传世玉佛一个');
inc(gamesave1.tip5);
add_to_listbox('传世玉佛',gamesave1.tip5);
end;
7: begin
imagelist2.Draw(ACanvas,40,12,5);
ACanvas.TextOut(90,24,'得到极品七星珠一颗');
inc(gamesave1.tip6);
add_to_listbox('极品七星珠',gamesave1.tip6);
end;
8: begin
imagelist2.Draw(ACanvas,40,12,6);
ACanvas.TextOut(90,24,'得到混沌舍利一颗');
inc(gamesave1.tip7);
add_to_listbox('混沌舍利',gamesave1.tip7);
end;
9: ACanvas.TextOut(90,24,'您可以许个心愿,很灵的,机会可遇不可求。');
end;
finally
ReleaseDC(0,ACanvas.Handle);
ACanvas.Free;
end;
if i= 9 then
begin
timer1.Enabled:= false;
messagebox(handle,'出现了九次相同的骰子点数,非常非常罕见的现象,您现在许下一个心愿,必将梦想成真!!试试吧。','天赐良机',mb_ok or MB_ICONINFORMATION);
timer1.Enabled:= true;
end;
end;
procedure TForm1.ListBox3MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
var
po: TPoint;
rect :TRect;
HintWindow: THintWindow;
bmp: tbitmap;
label pp;
begin
if (listbox3.ItemIndex >= pic_start) or (listbox3.ItemIndex = 0) then
begin
GetCursorPos(po);
rect.Left := po.x+15;
rect.Right := po.x+ 195;
rect.Top := po.y;
rect.Bottom := po.y+110;
HintWindow := THintWindow.Create(Self);
HintWindow.Canvas.Font.Name:= '宋体';
HintWindow.Canvas.Font.Size:= 12;
HintWindow.Canvas.Font.Style:=[fsBold];
HintWindow.Canvas.Font.Color:= clred;
HintWindow.ActivateHint(rect, '');//此处显示hint
bmp := tbitmap.create;
if listbox3.ItemIndex = 0 then
begin
if get_jb = 0 then
begin
imagelist2.getbitmap(7, bmp);
HintWindow.Canvas.TextOut(5,5,'大富翁奖杯');
HintWindow.Canvas.Font.Color:= clwindowtext;
HintWindow.Canvas.Font.Style:=[];
HintWindow.Canvas.Font.Size:= 10;
HintWindow.Canvas.TextOut(3,23,'智力创造价值的尊贵体现');
HintWindow.Canvas.TextOut(3,38,'金色的奖杯,钛合金制作。');
end else goto pp;
end else if pos('幻界水晶',ListBox3.Items[listbox3.ItemIndex])>0 then
begin
imagelist2.getbitmap(0, bmp);
HintWindow.Canvas.TextOut(5,5,'幻界水晶');
HintWindow.Canvas.Font.Color:= clwindowtext;
HintWindow.Canvas.Font.Style:=[];
HintWindow.Canvas.Font.Size:= 10;
HintWindow.Canvas.TextOut(3,23,'从仙界掉落的含有奇异能量');
HintWindow.Canvas.TextOut(3,38,'的蓝色水晶,用途不明。');
end else if pos('2007小金猪',ListBox3.Items[listbox3.ItemIndex])>0 then
begin
imagelist2.getbitmap(1, bmp);
HintWindow.Canvas.TextOut(5,5,'2007小金猪');
HintWindow.Canvas.Font.Color:= clwindowtext;
HintWindow.Canvas.Font.Style:=[];
HintWindow.Canvas.Font.Size:= 10;
HintWindow.Canvas.TextOut(3,23,'2007年生肖猪年的纪念品。');
HintWindow.Canvas.TextOut(3,38,'价值一万金币。');
end else if pos('魔力宝石',ListBox3.Items[listbox3.ItemIndex])>0 then
begin
imagelist2.getbitmap(2, bmp);
HintWindow.Canvas.TextOut(5,5,'魔力宝石');
HintWindow.Canvas.Font.Color:= clwindowtext;
HintWindow.Canvas.Font.Style:=[];
HintWindow.Canvas.Font.Size:= 10;
HintWindow.Canvas.TextOut(3,23,'来自魔界的神奇宝石。');
HintWindow.Canvas.TextOut(3,38,'蕴涵强大的黑暗力量。');
end else if pos('上古神石',ListBox3.Items[listbox3.ItemIndex])>0 then
begin
imagelist2.getbitmap(3, bmp);
HintWindow.Canvas.TextOut(5,5,'上古神石');
HintWindow.Canvas.Font.Color:= clwindowtext;
HintWindow.Canvas.Font.Style:=[];
HintWindow.Canvas.Font.Size:= 10;
HintWindow.Canvas.TextOut(3,23,'盘古开辟天地时遗落在世间。');
HintWindow.Canvas.TextOut(3,38,'其貌不扬,用途不明。');
end else if pos('传世玉佛',ListBox3.Items[listbox3.ItemIndex])>0 then
begin
imagelist2.getbitmap(4, bmp);
HintWindow.Canvas.TextOut(5,5,'传世玉佛');
HintWindow.Canvas.Font.Color:= clwindowtext;
HintWindow.Canvas.Font.Style:=[];
HintWindow.Canvas.Font.Size:= 10;
HintWindow.Canvas.TextOut(3,23,'珍贵的玉佛雕像。');
HintWindow.Canvas.TextOut(3,38,'价值10万金币。');
end else if pos('极品七星珠',ListBox3.Items[listbox3.ItemIndex])>0 then
begin
imagelist2.getbitmap(5, bmp);
HintWindow.Canvas.TextOut(5,5,'极品七星珠');
HintWindow.Canvas.Font.Color:= clwindowtext;
HintWindow.Canvas.Font.Style:=[];
HintWindow.Canvas.Font.Size:= 10;
HintWindow.Canvas.TextOut(3,23,'来自外太空的怪异珠子。');
HintWindow.Canvas.TextOut(3,38,'含有未破解的外太空智慧信息。');
end else if pos('混沌舍利',ListBox3.Items[listbox3.ItemIndex])>0 then
begin
imagelist2.getbitmap(6, bmp);
HintWindow.Canvas.TextOut(5,5,'混沌舍利');
HintWindow.Canvas.Font.Color:= clwindowtext;
HintWindow.Canvas.Font.Style:=[];
HintWindow.Canvas.Font.Size:= 10;
HintWindow.Canvas.TextOut(3,23,'宇宙初期生成的舍利。');
HintWindow.Canvas.TextOut(3,38,'具有摧毁世界的力量。');
end;
HintWindow.Canvas.CopyRect(classes.Rect(60,60,108,108),bmp.canvas, classes.rect(0, 0, 48, 48));
screen.Cursor:= crhourglass;
sleep(4000);
screen.Cursor:= crdefault;
pp: bmp.Free;
HintWindow.ReleaseHandle;//此处是关闭hint窗口,
HintWindow.Free;//释放
end;
end;
procedure TForm1.Action7Execute(Sender: TObject);
var ss: string;
i,j: integer;
begin
gamesave1.leiji:= gamesave1.leiji + Trunc((now - jit_kssj) *24*60*60); //更新时间
jit_kssj:= now; //保存新的起始时间点
i:= gamesave1.leiji div 86400;
ss:= inttostr(i) + '天 ';
j:= gamesave1.leiji - i * 86400; //一天内的秒数
i:= j div 3600;
ss:= ss + inttostr(i) + '小时:';
j:= j - i * 3600; //剩下的秒数
i:= j div 60;
ss:= ss + inttostr(i) + '分:';
j:= j- i * 6
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -