Microsoft Small Basic

Program Listing: WXS427
'2014.10.1 开始制作
'更新步骤:
GraphicsWindow.Width=700
GraphicsWindow.Height=530
GraphicsWindow.Left=(Desktop.Width-GraphicsWindow.Width)/2-50
GraphicsWindow.Top=(Desktop.Height-GraphicsWindow.Height)/2-50
GraphicsWindow.Title="Island Craft"
Controls.ButtonClicked=buttonclicked
GraphicsWindow.KeyDown=keydown
GraphicsWindow.MouseDown=mousedown
screen=1
check=1
gameload=0
path="E:\Island Craft1" '默认打开方式 标准:E:\Island Craft1 , E:\编程\LOCK\LOCK2\lock\文件\Island Craft1
baginformation()
typerinformation()
drawscreen()
worldwidth=100
worldlength=worldwidth
Sub drawscreen
If screen=1 Then
GraphicsWindow.Clear()
GraphicsWindow.BrushColor="Black"
GraphicsWindow.FontSize=36
GraphicsWindow.DrawText(50,50,"Island Craft岛屿生存")
GraphicsWindow.FontSize=25
GraphicsWindow.DrawText(50,165,"输入存档路径:")
enterkeypath=Controls.AddTextBox(50,200)
Controls.SetSize(enterkeypath,500,40)
Controls.SetTextBoxText(enterkeypath,path)
startplaygame=Controls.AddButton("PLAY",580,200)
Controls.SetSize(startplaygame,80,40)
ElseIf screen=2 Then
GraphicsWindow.Clear()
firstgameload=0
GraphicsWindow.DrawText(200,150,"第一次进入此存档需要加载")
GraphicsWindow.DrawText(280,190,"请耐心等候")
showfirstgameload=Shapes.AddText("已加载"+firstgameload+"%")
Shapes.Move(showfirstgameload,270,230)
mex=Math.Floor(worldwidth/2)+1
mey=Math.Floor(worldlength/2)+1
For i=1 To worldlength
For j=1 To worldwidth
If i=mex And j=mey Then
thing[i][j]=120
ElseIf i=mex-1 And j=mey Then
thing[i][j]=120
ElseIf i=mex-2 And j=mey Then
thing[i][j]=120
Else
thing[i][j]=Math.GetRandomNumber(120)
EndIf
' The following line could be harmful and has been automatically commented.
' File.WriteLine(path,(i-1)*worldwidth+j+1,thing[i][j])
firstgameload=Math.Round((i*100+j)/worldlength-1)/2
Shapes.SetText(showfirstgameload,"已加载"+firstgameload+"%")
EndFor
EndFor
For i=1 To allcheck
' The following line could be harmful and has been automatically commented.
' File.WriteLine(path,worldlength*worldwidth+1+i,0)
firstgameload=50+Math.Round(50/allcheck)*i-1
Shapes.SetText(showfirstgameload,"已加载"+firstgameload+"%")
EndFor
For i=1 To 6
' The following line could be harmful and has been automatically commented.
' File.WriteLine(path,worldlength*worldwidth+1+allcheck+i,0)
EndFor
' The following line could be harmful and has been automatically commented.
' File.WriteLine(path,worldlength*worldwidth+8+allcheck,1)
' The following line could be harmful and has been automatically commented.
' File.WriteLine(path,worldlength*worldwidth+9+allcheck,mex)
' The following line could be harmful and has been automatically commented.
' File.WriteLine(path,worldlength*worldwidth+10+allcheck,mey)
For i=1 To 12
' The following line could be harmful and has been automatically commented.
' File.WriteLine(path,worldlength*worldwidth+10+allcheck+i,0)
EndFor
' The following line could be harmful and has been automatically commented.
' File.WriteLine(path,worldlength*worldwidth+23+allcheck,10)
' The following line could be harmful and has been automatically commented.
' File.WriteLine(path,worldlength*worldwidth+24+allcheck,10)
' The following line could be harmful and has been automatically commented.
' File.WriteLine(path,worldlength*worldwidth+25+allcheck,0)
' The following line could be harmful and has been automatically commented.
' File.WriteLine(path,worldlength*worldwidth+26+allcheck,0)
firstgameload=100
Shapes.SetText(showfirstgameload,"已加载"+firstgameload+"%")
screen=4
drawscreen()
ElseIf screen=3 Then
GraphicsWindow.Clear()
willgetthing=0
gameload=0
GraphicsWindow.PenWidth=4
GraphicsWindow.DrawLine(0,451,700,451)
GraphicsWindow.DrawLine(451,0,451,451)
GraphicsWindow.PenWidth=4
GraphicsWindow.FontSize=14
GraphicsWindow.BrushColor="Black"
seesight=Shapes.AddRectangle(450,450)
exchangerdaytime=daytime-300
If exchangerdaytime>0 Then
exchangerdaytime=Math.Abs(exchangerdaytime-150)/150*90
Else
exchangerdaytime=0
EndIf
Shapes.SetOpacity(seesight,90-exchangerdaytime)
For i=1 To 6
If holdeasybag=i Then
GraphicsWindow.PenColor="Red"
showholdeasybag1=Shapes.AddRectangle(2,40)
showholdeasybag2=Shapes.AddRectangle(2,40)
showholdeasybag3=Shapes.AddRectangle(60,2)
showholdeasybag4=Shapes.AddRectangle(60,2)
Shapes.Move(showholdeasybag1,19+(i-1)*70,486)
Shapes.Move(showholdeasybag2,80+(i-1)*70,486)
Shapes.Move(showholdeasybag3,20+(i-1)*70,485)
Shapes.Move(showholdeasybag4,20+(i-1)*70,526)
GraphicsWindow.PenColor="Black"
EndIf
GraphicsWindow.DrawRectangle(20+(i-1)*70,486,60,40)
GraphicsWindow.DrawText(22+(i-1)*70,486,bagthing[easybag[i]])
GraphicsWindow.DrawText(22+(i-1)*70,506,"x"+bagnum[easybag[i]])
EndFor
GraphicsWindow.PenWidth=2
GraphicsWindow.FontSize=22
GraphicsWindow.DrawText(10,456,"血量值:"+exchangerblood[blood])
GraphicsWindow.DrawText(300,456,"饥饿值:"+exchangerhung[hunger])
For i=mex-4 To mex+4
For j=mey-4 To mey+4
instead=thing[i][j]
If instead<=18 Then '水
GraphicsWindow.BrushColor="CornFlowerBlue"
GraphicsWindow.FillRectangle((i-mex+4)*50,(j-mey+4)*50,50,50)
Else
GraphicsWindow.BrushColor="ForestGreen"
GraphicsWindow.FillRectangle((i-mex+4)*50,(j-mey+4)*50,50,50)
EndIf
If instead>18 And instead<=28 Then '树木
GraphicsWindow.BrushColor="DarkGreen"
GraphicsWindow.FillRectangle((i-mex+4)*50+12.5,(j-mey+4)*50,25,50)
GraphicsWindow.FillRectangle((i-mex+4)*50,(j-mey+4)*50+12.5,50,25)
ElseIf instead>30 And instead<=35 Then '石头
GraphicsWindow.BrushColor="Gray"
GraphicsWindow.FillRectangle((i-mex+4)*50+15,(j-mey+4)*50+15,20,20)
ElseIf instead=30 Then '蘑菇
GraphicsWindow.BrushColor="Purple"
GraphicsWindow.FillEllipse((i-mex+4)*50+19,(j-mey+4)*50+12,12,12)
GraphicsWindow.FillRectangle((i-mex+4)*50+21.5,(j-mey+4)*50+22,7,10)
ElseIf instead=29 Then '南瓜
GraphicsWindow.BrushColor="Gold"
GraphicsWindow.FillRectangle((i-mex+4)*50+20,(j-mey+4)*50+15,10,8)
GraphicsWindow.FillEllipse((i-mex+4)*50+15,(j-mey+4)*50+22,20,20)
ElseIf instead=46 Then '猪
GraphicsWindow.BrushColor="PeachPuff"
GraphicsWindow.FillRectangle((i-mex+4)*50+18,(j-mey+4)*50+10,14,20)
GraphicsWindow.FillRectangle((i-mex+4)*50+21,(j-mey+4)*50+30,8,8)
ElseIf instead=47 Then '牛
GraphicsWindow.BrushColor="Peru"
GraphicsWindow.FillRectangle((i-mex+4)*50+18,(j-mey+4)*50+10,14,20)
GraphicsWindow.FillRectangle((i-mex+4)*50+21,(j-mey+4)*50+30,8,8)
EndIf
If i=mex And j=mey Then '我
GraphicsWindow.BrushColor="SaddleBrown"
GraphicsWindow.FillRectangle((i-mex+4)*50+20,(j-mey+4)*50+10,10,10)
GraphicsWindow.BrushColor="Blue"
GraphicsWindow.FillRectangle((i-mex+4)*50+20,(j-mey+4)*50+20,10,18)
EndIf
EndFor
EndFor
ElseIf screen=4 Then
GraphicsWindow.Clear()
GraphicsWindow.FontSize=25
GraphicsWindow.DrawText(240,150,"正在载入游戏......")
GraphicsWindow.DrawText(280,190,"请耐心等候")
showfirstgameload=Shapes.AddText("已加载"+firstgameload+"%")
Shapes.Move(showfirstgameload,270,230)
' The following line could be harmful and has been automatically commented.
' mex=File.ReadLine(path,worldlength*worldwidth+9+allcheck)
' The following line could be harmful and has been automatically commented.
' mey=File.ReadLine(path,worldlength*worldwidth+10+allcheck)
For i=1 To worldlength
For j=1 To worldwidth
' The following line could be harmful and has been automatically commented.
' thing[i][j]=File.ReadLine(path,(i-1)*worldwidth+j+1)
If thing[i][j]>=46 And thing[i][j]<=49 Then
aniblood[i][j]=haveblood[thing[i][j]]
EndIf
firstgameload=Math.Round((i*100+j)/worldlength-1)/2
Shapes.SetText(showfirstgameload,"已加载"+firstgameload+"%")
EndFor
EndFor
For i=1 To allcheck
' The following line could be harmful and has been automatically commented.
' bagnum[i]=File.ReadLine(path,worldlength*worldwidth+1+i)
firstgameload=50+Math.Round(50/allcheck)*i-1
Shapes.SetText(showfirstgameload,"已加载"+firstgameload+"%")
EndFor
For i=1 To 12
' The following line could be harmful and has been automatically commented.
' baglong[i+13]=File.ReadLine(path,worldlength*worldwidth+10+allcheck+i)
EndFor
For i=1 To 6
' The following line could be harmful and has been automatically commented.
' easybag[i]=File.ReadLine(path,worldlength*worldwidth+1+allcheck+i)
EndFor
' The following line could be harmful and has been automatically commented.
' holdeasybag=File.ReadLine(path,worldlength*worldwidth+8+allcheck)
' The following line could be harmful and has been automatically commented.
' blood=File.ReadLine(path,worldlength*worldwidth+23+allcheck)
' The following line could be harmful and has been automatically commented.
' hunger=File.ReadLine(path,worldlength*worldwidth+24+allcheck)
' The following line could be harmful and has been automatically commented.
' nofood=File.ReadLine(path,worldlength*worldwidth+25+allcheck)
' The following line could be harmful and has been automatically commented.
' daytime=File.ReadLine(path,worldlength*worldwidth+26+allcheck)
firstgameload=100
Shapes.SetText(showfirstgameload,"已加载"+firstgameload+"%")
screen=3
Timer.Tick=timecounter
Timer.Interval=1000
drawscreen()
ElseIf screen=5 Then
GraphicsWindow.Clear()
GraphicsWindow.BrushColor="Black"
GraphicsWindow.FontSize=25
GraphicsWindow.DrawRectangle(20,20,660,490)
GraphicsWindow.DrawText(30,30,"背包物品:"+bagthing[check])
GraphicsWindow.DrawText(30,60,"物品编号:"+check)
GraphicsWindow.DrawText(30,90,"物品数量:"+bagnum[check])
GraphicsWindow.DrawText(30,130,"放入快捷包:")
GraphicsWindow.FontSize=22
For i=1 To 6
putinto[i]=Controls.AddButton(i+"号",30+(i-1)*85,160)
Controls.SetSize(putinto[i],80,35)
EndFor
GraphicsWindow.DrawText(30,220,"制作材料1:"+bagthing[bagmake1[check]]+" X"+bagmake1num[check]+" , 拥有"+bagnum[bagmake1[check]])
GraphicsWindow.DrawText(30,250,"制作材料2:"+bagthing[bagmake2[check]]+" X"+bagmake2num[check]+" , 拥有"+bagnum[bagmake2[check]])
GraphicsWindow.DrawText(30,280,"制作材料3:"+bagthing[bagmake3[check]]+" X"+bagmake3num[check]+" , 拥有"+bagnum[bagmake3[check]])
GraphicsWindow.DrawText(30,320,"制作后可得到:"+bagthing[check]+" X"+bagmakeget[check])
makething=Controls.AddButton("制作1个",30,350)
If check>=14 And check<=25 Then
GraphicsWindow.DrawText(30,400,"剩余耐久度:"+baglong[check])
EndIf
findinbagwri=Controls.AddTextBox(380,28)
Controls.SetSize(findinbagwri,180,40)
findinbagbut=Controls.AddButton("查找",570,28)
Controls.SetSize(findinbagbut,80,40)
If bagblood[check]>0 Or baghunger[check]>0 Then
bageat=Controls.AddButton("食用1个",30,400)
EndIf
EndIf
EndSub


Sub buttonclicked
If screen=1 And Controls.LastClickedButton=startplaygame Then
path=Controls.GetTextBoxText(enterkeypath)
' The following line could be harmful and has been automatically commented.
' If File.ReadLine(path,1)="" Then
' The following line could be harmful and has been automatically commented.
' File.WriteLine(path,1,1)
screen=2
drawscreen()
Else
screen=4
drawscreen()
EndIf
ElseIf screen=5 Then
If bagnum[check]>0 Then
For i=1 To 6
If Controls.LastClickedButton=putinto[i] Then
For j=1 To 6
If i<>j And easybag[j]=check Then
easybag[j]=0
' The following line could be harmful and has been automatically commented.
' File.WriteLine(path,worldlength*worldwidth+1+allcheck+i,check)
EndIf
EndFor
easybag[i]=check
' The following line could be harmful and has been automatically commented.
' File.WriteLine(path,worldlength*worldwidth+1+allcheck+i,check)
EndIf
EndFor
EndIf
If Controls.LastClickedButton=makething Then
If bagnum[bagmake1[check]]>=bagmake1num[check] And bagnum[bagmake2[check]]>=bagmake2num[check] Then
If bagnum[bagmake3[check]]>=bagmake3num[check] Then
bagnum[bagmake1[check]]=bagnum[bagmake1[check]]-bagmake1num[check]
bagnum[bagmake2[check]]=bagnum[bagmake2[check]]-bagmake2num[check]
bagnum[bagmake3[check]]=bagnum[bagmake3[check]]-bagmake3num[check]
bagnum[check]=bagnum[check]+bagmakeget[check]
If bagnum[bagmake1[check]]=0 Then
For i=1 To 6
If easybag[i]=bagmake1[check] Then
easybag[i]=0
' The following line could be harmful and has been automatically commented.
' File.WriteLine(path,worldlength*worldwidth+1+allcheck+i,0)
EndIf
EndFor
EndIf
If bagnum[bagmake2[check]]=0 Then
For i=1 To 6
If easybag[i]=bagmake2[check] Then
easybag[i]=0
' The following line could be harmful and has been automatically commented.
' File.WriteLine(path,worldlength*worldwidth+1+allcheck+i,0)
EndIf
EndFor
EndIf
If bagnum[bagmake3[check]]=0 Then
For i=1 To 6
If easybag[i]=bagmake3[check] Then
easybag[i]=0
' The following line could be harmful and has been automatically commented.
' File.WriteLine(path,worldlength*worldwidth+1+allcheck+i,0)
EndIf
EndFor
EndIf
' The following line could be harmful and has been automatically commented.
' File.WriteLine(path,worldlength*worldwidth+1+bagmake1[check],bagnum[bagmake1[check]])
' The following line could be harmful and has been automatically commented.
' File.WriteLine(path,worldlength*worldwidth+1+bagmake2[check],bagnum[bagmake2[check]])
' The following line could be harmful and has been automatically commented.
' File.WriteLine(path,worldlength*worldwidth+1+bagmake3[check],bagnum[bagmake3[check]])
' The following line could be harmful and has been automatically commented.
' File.WriteLine(path,worldlength*worldwidth+1+check,bagnum[check])
If check>=14 And check<=25 And bagnum[check]=1 Then
baglong[check]=baghavelong[check]
' The following line could be harmful and has been automatically commented.
' File.WriteLine(path,worldlength*worldwidth+10+allcheck+easybag[holdeasybag],baglong[easybag[holdeasybag]])
EndIf
EndIf
EndIf
drawscreen()
ElseIf Controls.LastClickedButton=findinbagbut Then
findinbagname=Controls.GetTextBoxText(findinbagwri)
For i=1 To allcheck
If findinbagname=bagthing[i] Or i=findinbagname Then
check=i
EndIf
EndFor
drawscreen()
ElseIf Controls.LastClickedButton=bageat Then
bagnum[check]=bagnum[check]-1
blood=blood+bagblood[check]
hunger=hunger+baghunger[check]
If blood>10 Then
blood=10
EndIf
If hunger>10 Then
hunger=10
EndIf
' The following line could be harmful and has been automatically commented.
' File.WriteLine(path,worldlength*worldwidth+24+allcheck,hunger)
' The following line could be harmful and has been automatically commented.
' File.WriteLine(path,worldlength*worldwidth+1+check,bagnum[check])
drawscreen()
EndIf
EndIf
EndSub


Sub keydown
If GraphicsWindow.LastKey="Escape" Then
' The following line could be harmful and has been automatically commented.
' File.WriteLine(path,worldlength*worldwidth+26+allcheck,daytime)
' The following line could be harmful and has been automatically commented.
' File.WriteLine(path,worldlength*worldwidth+25+allcheck,nofood)
' The following line could be harmful and has been automatically commented.
' File.WriteLine(path,worldlength*worldwidth+23+allcheck,blood)
' The following line could be harmful and has been automatically commented.
' File.WriteLine(path,worldlength*worldwidth+9+allcheck,mex)
' The following line could be harmful and has been automatically commented.
' File.WriteLine(path,worldlength*worldwidth+10+allcheck,mey)
Program.End()
EndIf
If screen=3 Then
If GraphicsWindow.LastKey="W" Or GraphicsWindow.LastKey="Up" Then
If mey>1 And thing[mex][mey-1]>29 And thing[mex][mey-1]<=45 Then
mey=mey-1
drawscreen()
EndIf
If mey>1 And thing[mex][mey-1]>47 Then
mey=mey-1
drawscreen()
EndIf
ElseIf GraphicsWindow.LastKey="A" Or GraphicsWindow.LastKey="Left" Then
If mex>1 And thing[mex-1][mey]>29 And thing[mex-1][mey]<=45 Then
mex=mex-1
drawscreen()
EndIf
If mex>1 And thing[mex-1][mey]>47 Then
mex=mex-1
drawscreen()
EndIf
ElseIf GraphicsWindow.LastKey="S" Or GraphicsWindow.LastKey="Down" Then
If mey29 And thing[mex][mey+1]<=45 Then
mey=mey+1
drawscreen()
EndIf
If mey47 Then
mey=mey+1
drawscreen()
EndIf
ElseIf GraphicsWindow.LastKey="D" Or GraphicsWindow.LastKey="Right" Then
If mex29 And thing[mex+1][mey]<=45 Then
mex=mex+1
drawscreen()
EndIf
If mex47 Then
mex=mex+1
drawscreen()
EndIf
ElseIf GraphicsWindow.LastKey="E" Then
screen=5
drawscreen()
EndIf
For i=1 To 6
If GraphicsWindow.LastKey="D"+i Then
holdeasybag=i
Shapes.Move(showholdeasybag1,19+(i-1)*70,486)
Shapes.Move(showholdeasybag2,80+(i-1)*70,486)
Shapes.Move(showholdeasybag3,20+(i-1)*70,485)
Shapes.Move(showholdeasybag4,20+(i-1)*70,526)
' The following line could be harmful and has been automatically commented.
' File.WriteLine(path,worldlength*worldwidth+8+allcheck,holdeasybag)
EndIf
EndFor
ElseIf screen=5 Then
If GraphicsWindow.LastKey="W" Or GraphicsWindow.LastKey="Up" Then
If check>1 Then
check=check-1
Else
check=allcheck
EndIf
drawscreen()
ElseIf GraphicsWindow.LastKey="S" Or GraphicsWindow.LastKey="Down" Then
If check check=check+1
Else
check=1
EndIf
drawscreen()
ElseIf GraphicsWindow.LastKey="E" Then
screen=3
drawscreen()
EndIf
EndIf
EndSub


Sub mousedown
mx=GraphicsWindow.MouseX
my=GraphicsWindow.MouseY
If Mouse.IsLeftButtonDown="True" Then
If mx<450 And my<450 Then
mx=Math.Floor(mx/50)-4+mex
my=Math.Floor(my/50)-4+mey
If Math.Abs(mex-mx)<=1 And Math.Abs(mey-my)<=1 And gameload=0 Then
If thing[mx][my]=30 Then '蘑菇
gameload=2
If easybag[holdeasybag]>=14 And easybag[holdeasybag]<=19 Then
gameload=gameload-bagspeed[easybag[holdeasybag]]
If gameload<=0 Then
gameload=1
EndIf
EndIf
GraphicsWindow.BrushColor="Black"
GraphicsWindow.FontSize=25
showpickcomplete=Shapes.AddText("采集剩余时间:"+gameload+"秒")
Shapes.Move(showpickcomplete,460,10)
willgetthing=7
ElseIf thing[mx][my]>18 And thing[mx][my]<29 Then '树木
gameload=10
If easybag[holdeasybag]>=14 And easybag[holdeasybag]<=19 Then
gameload=gameload-bagspeed[easybag[holdeasybag]]
If gameload<=0 Then
gameload=1
EndIf
EndIf
GraphicsWindow.BrushColor="Black"
GraphicsWindow.FontSize=25
showpickcomplete=Shapes.AddText("采集剩余时间:"+gameload+"秒")
Shapes.Move(showpickcomplete,460,10)
willgetthing=1
ElseIf thing[mx][my]>=31 And thing[mx][my]<=35 Then '石头
If easybag[holdeasybag]>=14 And easybag[holdeasybag]<=19 Then
gameload=5
gameload=gameload-bagspeed[easybag[holdeasybag]]
If gameload<=0 Then
gameload=1
EndIf
GraphicsWindow.BrushColor="Black"
GraphicsWindow.FontSize=25
showpickcomplete=Shapes.AddText("采集剩余时间:"+gameload+"秒")
Shapes.Move(showpickcomplete,460,10)
willgetthing=4
Else
GraphicsWindow.BrushColor="Black"
GraphicsWindow.FontSize=25
showmessage=Shapes.AddText("太硬了,挖不动")
Shapes.Move(showmessage,460,70)
EndIf
ElseIf thing[mx][my]>=36 And thing[mx][my]<=38 Then '铁
If easybag[holdeasybag]>=15 And easybag[holdeasybag]<=19 Then
gameload=6
gameload=gameload-bagspeed[easybag[holdeasybag]]
If gameload<=0 Then
gameload=1
EndIf
GraphicsWindow.BrushColor="Black"
GraphicsWindow.FontSize=25
showpickcomplete=Shapes.AddText("采集剩余时间:"+gameload+"秒")
Shapes.Move(showpickcomplete,460,10)
willgetthing=10
Else
GraphicsWindow.BrushColor="Black"
GraphicsWindow.FontSize=25
showmessage=Shapes.AddText("太硬了,挖不动")
Shapes.Move(showmessage,460,70)
EndIf
ElseIf thing[mx][my]>38 And thing[mx][my]<41 Then '黄金
If easybag[holdeasybag]>=16 And easybag[holdeasybag]<=19 Then
gameload=6
gameload=gameload-bagspeed[easybag[holdeasybag]]
If gameload<=0 Then
gameload=1
EndIf
GraphicsWindow.BrushColor="Black"
GraphicsWindow.FontSize=25
showpickcomplete=Shapes.AddText("采集剩余时间:"+gameload+"秒")
Shapes.Move(showpickcomplete,460,10)
willgetthing=11
Else
GraphicsWindow.BrushColor="Black"
GraphicsWindow.FontSize=25
showmessage=Shapes.AddText("太硬了,挖不动")
Shapes.Move(showmessage,460,70)
EndIf
ElseIf thing[mx][my]=41 Then '钻石
If easybag[holdeasybag]>=17 And easybag[holdeasybag]<=19 Then
gameload=8
gameload=gameload-bagspeed[easybag[holdeasybag]]
If gameload<=0 Then
gameload=1
EndIf
GraphicsWindow.BrushColor="Black"
GraphicsWindow.FontSize=25
showpickcomplete=Shapes.AddText("采集剩余时间:"+gameload+"秒")
Shapes.Move(showpickcomplete,460,10)
willgetthing=12
Else
GraphicsWindow.BrushColor="Black"
GraphicsWindow.FontSize=25
showmessage=Shapes.AddText("太硬了,挖不动")
Shapes.Move(showmessage,460,70)
EndIf
ElseIf thing[mx][my]=42 Then '黑曜石
If easybag[holdeasybag]>=18 And easybag[holdeasybag]<=19 Then
gameload=9
gameload=gameload-bagspeed[easybag[holdeasybag]]
If gameload<=0 Then
gameload=1
EndIf
GraphicsWindow.BrushColor="Black"
GraphicsWindow.FontSize=25
showpickcomplete=Shapes.AddText("采集剩余时间:"+gameload+"秒")
Shapes.Move(showpickcomplete,460,10)
willgetthing=13
Else
GraphicsWindow.BrushColor="Black"
GraphicsWindow.FontSize=25
showmessage=Shapes.AddText("太硬了,挖不动")
Shapes.Move(showmessage,460,70)
EndIf
ElseIf thing[mx][my]>=43 And thing[mx][my]<=45 Then '煤
If easybag[holdeasybag]>=14 And easybag[holdeasybag]<=19 Then
gameload=4
gameload=gameload-bagspeed[easybag[holdeasybag]]
If gameload<=0 Then
gameload=1
EndIf
GraphicsWindow.BrushColor="Black"
GraphicsWindow.FontSize=25
showpickcomplete=Shapes.AddText("采集剩余时间:"+gameload+"秒")
Shapes.Move(showpickcomplete,460,10)
willgetthing=9
Else
GraphicsWindow.BrushColor="Black"
GraphicsWindow.FontSize=25
showmessage=Shapes.AddText("太硬了,挖不动")
Shapes.Move(showmessage,460,70)
EndIf
ElseIf thing[mx][my]=29 Then '南瓜
If easybag[holdeasybag]>=14 And easybag[holdeasybag]<=19 Then
gameload=6
gameload=gameload-bagspeed[easybag[holdeasybag]]
If gameload<=0 Then
gameload=1
EndIf
GraphicsWindow.BrushColor="Black"
GraphicsWindow.FontSize=25
showpickcomplete=Shapes.AddText("采集剩余时间:"+gameload+"秒")
Shapes.Move(showpickcomplete,460,10)
willgetthing=8
Else
GraphicsWindow.BrushColor="Black"
GraphicsWindow.FontSize=25
showmessage=Shapes.AddText("太硬了,挖不动")
Shapes.Move(showmessage,460,70)
EndIf
ElseIf thing[mx][my]=46 Then '猪
hard=2
do2()
Sound.PlayClick()
If aniblood[mx][my]<=0 Then
bagnum[26]=bagnum[26]+Math.GetRandomNumber(2)
' The following line could be harmful and has been automatically commented.
' File.WriteLine(path,worldlength*worldwidth+27,bagnum[26])
GraphicsWindow.BrushColor="Black"
GraphicsWindow.FontSize=25
showgetbagthing=Shapes.AddText("获得物品:生猪肉")
ElseIf Math.GetRandomNumber(8)=1 Then
blood=blood-1
drawscreen()
GraphicsWindow.BrushColor="Black"
GraphicsWindow.FontSize=25
showmessage2=Shapes.AddText("遭到反抗,扣了血")
Shapes.Move(showmessage2,460,100)
EndIf
ElseIf thing[mx][my]=47 Then '牛
hard=3
do2()
Sound.PlayClick()
If aniblood[mx][my]<=0 Then
bagnum[28]=bagnum[28]+Math.GetRandomNumber(2)
' The following line could be harmful and has been automatically commented.
' File.WriteLine(path,worldlength*worldwidth+29,bagnum[28])
GraphicsWindow.BrushColor="Black"
GraphicsWindow.FontSize=25
showgetbagthing=Shapes.AddText("获得物品:生牛肉")
ElseIf Math.GetRandomNumber(5)=1 Then
blood=blood-1
drawscreen()
GraphicsWindow.BrushColor="Black"
GraphicsWindow.FontSize=25
showmessage2=Shapes.AddText("遭到反抗,扣了血")
Shapes.Move(showmessage2,460,100)
EndIf
If Math.GetRandomNumber(5)=1 Then
blood=blood-1
drawscreen()
GraphicsWindow.BrushColor="Black"
GraphicsWindow.FontSize=25
showmessage2=Shapes.AddText("遭到反抗,扣了血")
Shapes.Move(showmessage2,460,100)
EndIf
EndIf
If thing[mx][my]>=46 And thing[mx][my]<=49 Then
If broken=1 Then
GraphicsWindow.BrushColor="Black"
GraphicsWindow.FontSize=25
showmessage=Shapes.AddText("攻击损坏了工具")
Shapes.Move(showmessage,460,70)
EndIf
broken=0
Shapes.Move(showgetbagthing,460,40)
EndIf
EndIf
EndIf
ElseIf Mouse.IsRightButtonDown="True" Then
If mx<450 And my<450 Then
mx=Math.Floor(mx/50)-4+mex
my=Math.Floor(my/50)-4+mey
If Math.Abs(mex-mx)<=1 And Math.Abs(mey-my)<=1 Then
EndIf
EndIf
EndIf
EndSub


Sub timecounter
nofood=nofood+1
If nofood=200 Then
nofood=0
hunger=hunger-1
' The following line could be harmful and has been automatically commented.
' File.WriteLine(path,worldlength*worldwidth+24+allcheck,hunger)
drawscreen()
EndIf
daytime=daytime+1
If daytime=600 Then
daytime=0
EndIf
If Math.Remainder(daytime,60)=0 And screen=3 And gameload=0 Then
drawscreen()
EndIf
digger()
EndSub


Sub digger
If gameload>0 Then
gameload=gameload-1
Shapes.SetText(showpickcomplete,"采集剩余时间:"+gameload+"秒")
EndIf
If gameload=0 Then
If willgetthing=7 Then
Shapes.HideShape(showpickcomplete)
bagnum[7]=bagnum[7]+1
' The following line could be harmful and has been automatically commented.
' File.WriteLine(path,worldwidth*worldlength+8,bagnum[7])
hard=1
do1()
showgetbagthing=Shapes.AddText("获得物品:蘑菇")
ElseIf willgetthing=1 Then
Shapes.HideShape(showpickcomplete)
bagnum[1]=bagnum[1]+Math.GetRandomNumber(2)+2
' The following line could be harmful and has been automatically commented.
' File.WriteLine(path,worldwidth*worldlength+2,bagnum[1])
bagnum[3]=bagnum[3]+Math.GetRandomNumber(3)
' The following line could be harmful and has been automatically commented.
' File.WriteLine(path,worldwidth*worldlength+4,bagnum[3])
hard=10
do1()
showgetbagthing=Shapes.AddText("获得物品:树叶、木块")
ElseIf willgetthing=4 Then
Shapes.HideShape(showpickcomplete)
bagnum[4]=bagnum[4]+Math.GetRandomNumber(2)
' The following line could be harmful and has been automatically commented.
' File.WriteLine(path,worldwidth*worldlength+5,bagnum[4])
hard=3
do1()
showgetbagthing=Shapes.AddText("获得物品:石头")
ElseIf willgetthing=10 Then
Shapes.HideShape(showpickcomplete)
bagnum[10]=bagnum[10]+1
' The following line could be harmful and has been automatically commented.
' File.WriteLine(path,worldwidth*worldlength+11,bagnum[10])
hard=5
do1()
showgetbagthing=Shapes.AddText("获得物品:铁")
ElseIf willgetthing=11 Then
Shapes.HideShape(showpickcomplete)
bagnum[11]=bagnum[11]+1
' The following line could be harmful and has been automatically commented.
' File.WriteLine(path,worldwidth*worldlength+12,bagnum[11])
hard=5
do1()
showgetbagthing=Shapes.AddText("获得物品:黄金")
ElseIf willgetthing=12 Then
Shapes.HideShape(showpickcomplete)
bagnum[12]=bagnum[12]+1
' The following line could be harmful and has been automatically commented.
' File.WriteLine(path,worldwidth*worldlength+13,bagnum[12])
hard=7
do1()
showgetbagthing=Shapes.AddText("获得物品:钻石")
ElseIf willgetthing=13 Then
Shapes.HideShape(showpickcomplete)
bagnum[13]=bagnum[13]+1
' The following line could be harmful and has been automatically commented.
' File.WriteLine(path,worldwidth*worldlength+14,bagnum[13])
hard=8
do1()
showgetbagthing=Shapes.AddText("获得物品:黑曜石")
ElseIf willgetthing=9 Then
Shapes.HideShape(showpickcomplete)
bagnum[9]=bagnum[9]+Math.GetRandomNumber(2)
' The following line could be harmful and has been automatically commented.
' File.WriteLine(path,worldwidth*worldlength+10,bagnum[9])
hard=3
do1()
showgetbagthing=Shapes.AddText("获得物品:煤炭")
ElseIf willgetthing=8 Then
Shapes.HideShape(showpickcomplete)
bagnum[8]=bagnum[8]+1
' The following line could be harmful and has been automatically commented.
' File.WriteLine(path,worldwidth*worldlength+9,bagnum[8])
hard=5
do1()
showgetbagthing=Shapes.AddText("获得物品:南瓜")
EndIf
willgetthing=0
If broken=1 Then
showmessage=Shapes.AddText("挖掘损坏了工具")
Shapes.Move(showmessage,460,70)
EndIf
broken=0
Shapes.Move(showgetbagthing,460,40)
EndIf
EndSub


Sub do2
If easybag[holdeasybag]>=20 And easybag[holdeasybag]<=25 Then
aniblood[mx][my]=aniblood[mx][my]-baghurt[easybag[holdeasybag]]
baglong[easybag[holdeasybag]]=baglong[easybag[holdeasybag]]-hard
ElseIf easybag[holdeasybag]>=14 And easybag[holdeasybag]<=19 Then
aniblood[mx][my]=aniblood[mx][my]-1
baglong[easybag[holdeasybag]]=baglong[easybag[holdeasybag]]-hard*2
Else
aniblood[mx][my]=aniblood[mx][my]-1
EndIf
If baglong[easybag[holdeasybag]]<=0 And easybag[holdeasybag]>=14 And easybag[holdeasybag]<=25 Then
bagnum[easybag[holdeasybag]]=bagnum[easybag[holdeasybag]]-1
If bagnum[easybag[holdeasybag]]>0 Then
baglong[easybag[holdeasybag]]=baghavelong[easybag[holdeasybag]]
EndIf
broken=1
' The following line could be harmful and has been automatically commented.
' File.WriteLine(path,worldlength*worldwidth+1+easybag[holdeasybag],bagnum[easybag[holdeasybag]])
EndIf


redo2:
If aniblood[mx][my]<=0 Then
drawnewx=Math.GetRandomNumber(worldlength)
drawnewy=Math.GetRandomNumber(worldwidth)
If thing[drawnewx][drawnewy]>49 And thing[drawnewx][drawnewy]<=120 Then
thing[drawnewx][drawnewy]=thing[mx][my]
thing[mx][my]=120
' The following line could be harmful and has been automatically commented.
' File.WriteLine(path,(mx-1)*worldwidth+my+1,120)
' The following line could be harmful and has been automatically commented.
' File.WriteLine(path,(drawnewx-1)*worldwidth+drawnewy+1,thing[drawnewx][drawnewy])
Else
Goto redo2
EndIf
drawscreen()
EndIf
EndSub


Sub do1
If easybag[holdeasybag]>=14 And easybag[holdeasybag]<=19 Then
baglong[easybag[holdeasybag]]=baglong[easybag[holdeasybag]]-hard
ElseIf easybag[holdeasybag]>=20 And easybag[holdeasybag]<=25 Then
baglong[easybag[holdeasybag]]=baglong[easybag[holdeasybag]]-hard/2
EndIf
If baglong[easybag[holdeasybag]]<=0 And easybag[holdeasybag]>=14 And easybag[holdeasybag]<=25 Then
bagnum[easybag[holdeasybag]]=bagnum[easybag[holdeasybag]]-1
If bagnum[easybag[holdeasybag]]>0 Then
baglong[easybag[holdeasybag]]=baghavelong[easybag[holdeasybag]]
EndIf
broken=1
' The following line could be harmful and has been automatically commented.
' File.WriteLine(path,worldlength*worldwidth+1+easybag[holdeasybag],bagnum[easybag[holdeasybag]])
EndIf
' The following line could be harmful and has been automatically commented.
' File.WriteLine(path,worldlength*worldwidth-3+allcheck+easybag[holdeasybag],baglong[easybag[holdeasybag]])


redo1:
drawnewx=Math.GetRandomNumber(worldlength)
drawnewy=Math.GetRandomNumber(worldwidth)
If thing[drawnewx][drawnewy]>49 And thing[drawnewx][drawnewy]<=120 Then
thing[drawnewx][drawnewy]=thing[mx][my]
thing[mx][my]=120
' The following line could be harmful and has been automatically commented.
' File.WriteLine(path,(mex-1)*worldwidth+mey+1,120)
' The following line could be harmful and has been automatically commented.
' File.WriteLine(path,(drawnewx-1)*worldwidth+drawnewy+1,thing[drawnewx][drawnewy])
Else
Goto redo1
EndIf


drawscreen()
GraphicsWindow.BrushColor="Black"
GraphicsWindow.FontSize=25
EndSub


Sub baginformation
allcheck=33




bagthing[1]="木块"
bagthing[2]="木板"
bagthing[3]="树叶"
bagthing[4]="石头"
bagthing[5]="石块"
bagthing[6]="木棍"
bagthing[7]="蘑菇"
bagthing[8]="南瓜"
bagthing[9]="煤炭"
bagthing[10]="铁"
bagthing[11]="黄金"
bagthing[12]="钻石"
bagthing[13]="黑曜石"
bagthing[14]="木镐"
bagthing[15]="石镐"
bagthing[16]="铁镐"
bagthing[17]="黄金镐"
bagthing[18]="钻石镐"
bagthing[19]="黑曜石镐"
bagthing[20]="木剑"
bagthing[21]="石剑"
bagthing[22]="铁剑"
bagthing[23]="黄金剑"
bagthing[24]="钻石剑"
bagthing[25]="黑曜石剑"
bagthing[26]="生猪肉"
bagthing[27]="熟猪肉"
bagthing[28]="生牛肉"
bagthing[29]="熟牛肉"
bagthing[30]="鸡蛋"
bagthing[31]="小麦"
bagthing[32]="牛奶"
bagthing[33]="蛋糕"



bagmake1[2]=1
bagmake1num[2]=1
bagmakeget[2]=4
bagmake1[5]=4
bagmake1num[5]=2
bagmakeget[5]=1
bagmake1[6]=2
bagmake1num[6]=2
bagmakeget[6]=4
bagmake1[14]=2
bagmake1num[14]=3
bagmake2[14]=6
bagmake2num[14]=2
bagmakeget[14]=1
bagmake1[15]=5
bagmake1num[15]=3
bagmake2[15]=6
bagmake2num[15]=2
bagmakeget[15]=1
bagmake1[16]=10
bagmake1num[16]=3
bagmake2[16]=6
bagmake2num[16]=2
bagmakeget[16]=1
bagmake1[17]=11
bagmake1num[17]=3
bagmake2[17]=6
bagmake2num[17]=2
bagmakeget[17]=1
bagmake1[18]=12
bagmake1num[18]=3
bagmake2[18]=6
bagmake2num[18]=2
bagmakeget[18]=1
bagmake1[19]=13
bagmake1num[19]=3
bagmake2[19]=6
bagmake2num[19]=2
bagmakeget[19]=1
bagmake1[20]=2
bagmake1num[20]=3
bagmake2[20]=6
bagmake2num[20]=2
bagmakeget[20]=1
bagmake1[21]=5
bagmake1num[21]=3
bagmake2[21]=6
bagmake2num[21]=2
bagmakeget[21]=1
bagmake1[22]=10
bagmake1num[22]=3
bagmake2[22]=6
bagmake2num[22]=2
bagmakeget[22]=1
bagmake1[23]=11
bagmake1num[23]=3
bagmake2[23]=6
bagmake2num[23]=2
bagmakeget[23]=1
bagmake1[24]=12
bagmake1num[24]=3
bagmake2[24]=6
bagmake2num[24]=2
bagmakeget[24]=1
bagmake1[25]=13
bagmake1num[25]=3
bagmake2[25]=6
bagmake2num[25]=2
bagmakeget[25]=1
bagmake1[27]=26
bagmake1num[27]=1
bagmake2[27]=9
bagmake2num[27]=2
bagmakeget[27]=1
bagmake1[29]=28
bagmake1num[29]=1
bagmake2[29]=9
bagmake2num[29]=2
bagmakeget[29]=1
bagmake1[33]=30
bagmake1num[33]=3
bagmake2[33]=31
bagmake2num[33]=3
bagmake3[33]=32
bagmake3num[33]=3
bagmakeget[33]=1



baghavelong[14]=60
baghavelong[15]=80
baghavelong[16]=140
baghavelong[17]=100
baghavelong[18]=160
baghavelong[19]=180
baghavelong[20]=25
baghavelong[21]=35
baghavelong[22]=45
baghavelong[23]=40
baghavelong[24]=60
baghavelong[25]=70


bagspeed[14]=1
bagspeed[15]=2
bagspeed[16]=2
bagspeed[17]=3
bagspeed[18]=4
bagspeed[19]=4

baghurt[20]=2
baghurt[21]=2.5
baghurt[22]=4
baghurt[23]=4.5
baghurt[24]=5
baghurt[25]=6

bagblood[7]=1
baghunger[7]=0
bagblood[8]=3
baghunger[8]=3
bagblood[26]=2
baghunger[26]=3
bagblood[27]=3
baghunger[27]=3
bagblood[28]=3
baghunger[28]=3
bagblood[29]=3
baghunger[29]=4
bagblood[30]=0
baghunger[30]=1
bagblood[33]=4
baghunger[33]=5
EndSub



Sub typerinformation
exchangerblood[1]= "❤"
exchangerblood[2]= "❤❤"
exchangerblood[3]= "❤❤❤"
exchangerblood[4]= "❤❤❤❤"
exchangerblood[5]= "❤❤❤❤❤"
exchangerblood[6]= "❤❤❤❤❤❤"
exchangerblood[7]= "❤❤❤❤❤❤❤"
exchangerblood[8]= "❤❤❤❤❤❤❤❤"
exchangerblood[9]= "❤❤❤❤❤❤❤❤❤"
exchangerblood[10]="❤❤❤❤❤❤❤❤❤❤"

exchangerhung[1]= "★"
exchangerhung[2]= "★★"
exchangerhung[3]= "★★★"
exchangerhung[4]= "★★★★"
exchangerhung[5]= "★★★★★"
exchangerhung[6]= "★★★★★★"
exchangerhung[7]= "★★★★★★★"
exchangerhung[8]= "★★★★★★★★"
exchangerhung[9]= "★★★★★★★★★"
exchangerhung[10]="★★★★★★★★★★"

haveblood[46]=6
haveblood[47]=8
haveblood[48]=6
haveblood[49]=10
EndSub


'地图分配
'1-18 水
'19-28 树木
'29 南瓜
'30 蘑菇
'31-35 石头
'36-38 铁
'39-40 黄金
'41 钻石
'42 黑曜石
'43-45 煤
'46 猪
'47 牛
'48 狼
'49 虎