Public Class Form1 Dim monster, hero, A As String Dim mhp, mAtk, mdef, money, mexp, Def, Lv, monet, exp, hp, atk, mmoney, hurt, T, mhurt, H, O As Integer Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Button4.Enabled = False Button2.Enabled = False Button6.Enabled = False Button7.Enabled = False End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click hp = 10000 Label2.Text = hp atk = Int(Rnd() * 1000) + 200 Label3.Text = atk Def = Int(Rnd() * 1000) + 200 Label4.Text = Def exp = 0 Label5.Text = exp Lv = 1 Label7.Text = Lv monet = 0 Label6.Text = monet hero = InputBox("请输入'自己'") Label1.Text = hero Button1.Enabled = False Button4.Enabled = True Button2.Enabled = True Button6.Enabled = False Timer3.Enabled = True Button7.Enabled = True Label12.Text = Lv * 18888 End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click FileOpen(1, My.Computer.FileSystem.CurrentDirectory & "\save1.text", OpenMode.Output) Write(1, hero, hp, atk, Def, exp, monet, Lv) MsgBox("儲存成功了") FileClose(1) End Sub Private Sub PictureBox1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click FileOpen(1, My.Computer.FileSystem.CurrentDirectory & "\save1.text", OpenMode.Input) Input(1, hero) Input(1, hp) Input(1, atk) Input(1, Def) Input(1, exp) Input(1, monet) Input(1, Lv) Label1.Text = hero Label2.Text = hp Label3.Text = atk Label4.Text = Def Label5.Text = exp Label6.Text = money Label7.Text = Lv Button1.Enabled = False FileClose(1) Button4.Enabled = True Timer3.Enabled = True ListBox1.Items.Add("讀取成功") Label21.Text = Lv * 20000 End Sub Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click Randomize() A = Int(Rnd() * 10) + 1 Select Case A Case 1 monster = "准格尔翼龙" mAtk = Lv * 100 mdef = Lv * 100 mhp = 50000 mAtk = Int(Rnd() * 1000) + 100 mmoney = Int(Rnd() * 10000000) + 18 mexp = Lv * 100 + 18 Label8.Text = monster Label9.Text = mhp Case 2 monster = "龙" mAtk = Lv * 300 mdef = Lv * 200 mhp = 80000 mAtk = Int(Rnd() * 1000) + 258 mmoney = Int(Rnd() * 10000) + 18 mexp = Lv * 100 + 18 Label8.Text = monster Label9.Text = mhp Case 3 monster = "暴龙" mdef = Lv * 80 mhp = Lv * 1000 mAtk = Int(Rnd() * 188) + 118 mmoney = Int(Rnd() * 10000) + 18 mexp = Lv * 100 + 18 Label8.Text = monster Label9.Text = mhp Case 4 monster = "龙的傳人" mdef = Lv * 300 mhp = 29620 mAtk = Int(Rnd() * 1000) + 135 mmoney = Int(Rnd() * 10000) + 18 mexp = Lv * 100 + 18 Label8.Text = monster Label9.Text = mhp Case 5 monster = "翼龙" mdef = Lv * 250 mhp = 10000 mAtk = Int(Rnd() * 1000) + 789 mmoney = Int(Rnd() * 10000) + 18 mexp = Lv * 100 + 18 Label8.Text = monster Label9.Text = mhp Case 6 monster = "狂龙" mdef = Lv * 90 mhp = Lv * 1000 mAtk = Int(Rnd() * 1000) + 871 mmoney = Int(Rnd() * 10000) + 18 mexp = Lv * 100 + 18 Label8.Text = monster Label9.Text = mhp Case 7 monster = "大怪獸" mdef = Lv * 200 mhp = 100200 mAtk = Int(Rnd() * 1000) + 1568 mmoney = Int(Rnd() * 10000) + 18 mexp = Lv * 100 + 18 Label8.Text = monster Label9.Text = mhp Case 8 monster = "鴨嘴獸" mdef = Lv * 201.3 mhp = Lv * 0.2 * 5000 mAtk = Int(Rnd() * 1000) + 457 mmoney = Int(Rnd() * 80000000) + 18 mexp = Lv * 100 + 18 Label8.Text = monster Label9.Text = mhp Case 9 monster = "大螞蟻" mdef = Lv * 200 mhp = 400000 mAtk = Int(Rnd() * 1000) + 987 mmoney = Int(Rnd() * 10000) + 18 mexp = Lv * 100 + 18 Label8.Text = monster Label9.Text = mhp Case 10 monster = "祸牛" mdef = Lv * 70 mhp = hp * 0.8 mAtk = Int(Rnd() * 1000) + 333 mmoney = Int(Rnd() * 10000) + 18 mexp = Lv * 100 + 18 Label8.Text = monster Label9.Text = mhp End Select Button4.Enabled = False Button3.Enabled = False Label10.Text = mAtk Label11.Text = mdef Button2.Enabled = False Button6.Enabled = True Timer3.Enabled = False Button7.Enabled = True End Sub Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick T = T - 1 If T < 0 Then hp = hp - mAtk Label2.Text = hp T = T + 8 ListBox1.Items.Add("怪物打击,受到傷害") End If If mhp <= 0 Then monet = mmoney + monet exp = exp + mexp Label5.Text = exp Label6.Text = monet Label7.Text = Lv Timer1.Enabled = False Timer2.Enabled = False Button2.Enabled = True Button3.Enabled = True Button4.Enabled = True ListBox1.Items.Add("怪物死亡") ListBox1.Items.Add("獲得金錢!!!") ListBox1.Items.Add("獲得經驗值!!!!") Label9.Text = 0 Button5.Enabled = True Button6.Enabled = False If exp > 0.2 ^ Lv Then Lv = Lv + 1 hp = hp + Lv * 1 / 10 atk = atk + Lv ^ 1.001 - 2 * Lv Def = Def + Lv ^ 1.001 - 18 Label3.Text = atk Label4.Text = Def ListBox1.Items.Add("獲得升級!!!!") End If End If If hp < 0 Then hp = 0 Label2.Text = hp Button1.Enabled = True Button4.Enabled = False Button2.Enabled = False Button5.Enabled = False Button3.Enabled = True Button6.Enabled = False Timer2.Enabled = False Timer1.Enabled = False Timer3.Enabled = False hp = 0 Label2.Text = hp MsgBox("陣亡...") End If Label21.Text = Lv * 18888 End Sub Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick H = H - 1 If H < 0 Then Label9.Text = mhp H = H + 8 mhp = mhp - hurt ListBox1.Items.Add("打击了怪物") End If If hurt <= 0 Then hurt = hurt * -0.25 End If End Sub Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click If monet < Lv * 18888 Then MsgBox("余额不足,无法购买") End If If monet >= 20000 Then monet = monet - Lv * 18888 Label6.Text = monet Label2.Text = hp hp = hp + Lv * 18888 ListBox1.Items.Add("恢復大量血量") Button5.Enabled = False End If End Sub Private Sub Label1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label1.Click End Sub Private Sub Label7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label7.Click End Sub Private Sub Label12_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) End Sub Private Sub Label10_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label10.Click End Sub Private Sub Label17_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label17.Click End Sub Private Sub Label16_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label16.Click End Sub Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click Button7.Enabled = False Timer3.Enabled = True Button4.Enabled = False Button3.Enabled = False Button2.Enabled = False Button6.Enabled = False Timer1.Enabled = True Timer2.Enabled = True hurt = Int(atk * Rnd() - mdef * Rnd()) End Sub Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) End Sub Private Sub Timer3_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer3.Tick O = 9 O = O - 10 If O < 0 Then hp = hp + Lv * 1 Label2.Text = hp End If End Sub Private Sub Button7_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click Button4.Enabled = True Timer3.Enabled = True Button6.Enabled = False Button7.Enabled = False End Sub Private Sub Label12_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label12.Click End Sub End Class
8X_%PTB[[Y05Y~P@[][{YPM.png (79.17 KB, 下载次数: 17)
欢迎光临 Project1 (https://rpg.blue/) | Powered by Discuz! X3.1 |