📄 frmbattle.frm
字号:
End Sub
Private Sub Timer1_Timer()
If SpeedBar.Value > 95 Then
SpeedBar.Value = 100
Timer1.Enabled = False
LblAttack.Enabled = True
LblMagic.Enabled = True
LblItem.Enabled = True
Else
SpeedBar.Value = Val(SpeedBar.Value) + 3
End If
End Sub
Private Sub Timer10_Timer()
Static g As Integer
If Item3.Caption < 0 Then
MsgBox "you don't have any"
Item3.Caption = "0"
Timer10.Enabled = False
LblAttack.Enabled = True
LblMagic.Enabled = True
LblItem.Enabled = True
Else
If g > 100 Or g < 1 Then
g = 1
End If
Select Case g
Case 1
FrmBattle.BackColor = RGB(0, 180, 0)
g = 2
Case 2
FrmBattle.BackColor = RGB(0, 0, 0)
g = 3
Case 3
FrmBattle.BackColor = RGB(0, 180, 0)
g = 4
Case 4
FrmBattle.BackColor = RGB(0, 0, 0)
g = 5
Case 5
BG.Visible = True
Lbl1.Caption = "your speed is up by 15%"
Timer1.Interval = 35
Item3.Caption = Val(Item3.Caption) - 1
Timer10.Interval = 3000
g = 6
Case 6
Lbl1.Caption = ""
BG.Visible = False
g = 200
Timer10.Interval = 25
Timer1.Enabled = True
Timer10.Enabled = False
End Select
End If
End Sub
Private Sub Timer2_Timer()
If GoodHP1.Caption > 147 Then
GoodHP1.Caption = "147"
End If
If GoodMP1.Caption > 45 Then
GoodMP1.Caption = "45"
End If
End Sub
Private Sub timer3_Timer()
Static i As Integer
If i > 100 Or i < 1 Then
i = 1
End If
Select Case i
Case 1
FrmBattle.BackColor = RGB(255, 255, 255)
i = 2
Case 2
FrmBattle.BackColor = RGB(0, 0, 0)
i = 3
Case 3
Dim att
att = 100 + Int(50 * Rnd)
BG.Visible = True
Lbl1.Caption = TxtName.Text + " attacked " + lblenemy.Caption + " with his Flame Sabre!"
Lbl2.Caption = att
BadHP1.Caption = Val(BadHP1.Caption) - Lbl2.Caption
timer3.Interval = 750
i = 4
Case 4
Lbl2.Caption = ""
timer3.Interval = 2000
i = 5
Case 5
Lbl1.Caption = ""
BG.Visible = False
timer3.Interval = 25
i = 200
Timer1.Enabled = True
timer3.Enabled = False
End Select
End Sub
Private Sub Timer4_Timer()
Randomize
mp = 50 + Int(150 * Rnd)
If GoodMP1.Caption < 0 Then
MsgBox "You don't have enough magic."
GoodMP1.Caption = "0"
Timer4.Enabled = False
LblAttack.Enabled = True
LblMagic.Enabled = True
LblItem.Enabled = True
Else
Static e As Integer
If e > 100 Or e < 1 Then
e = 1
End If
Select Case e
Case 1
FrmBattle.BackColor = RGB(255, 255, 0)
e = 2
Case 2
FrmBattle.BackColor = RGB(0, 0, 0)
e = 3
Case 3
mag = 200 + Int(100 * Rnd)
BG.Visible = True
Lbl1.Caption = TxtName.Text + " used the spell 'lightning' on " + lblenemy.Caption + " and smoked his ass!"
Lbl2.Caption = mag
BadHP1.Caption = Val(BadHP1.Caption) - Lbl2.Caption
GoodMP1.Caption = Val(GoodMP1.Caption) - 6
Timer4.Interval = 750
e = 4
Case 4
Lbl2.Caption = ""
Timer4.Interval = 2000
e = 5
Case 5
Lbl1.Caption = ""
BG.Visible = False
Timer4.Interval = 25
e = 200
Timer1.Enabled = True
Timer4.Enabled = False
End Select
End If
End Sub
Private Sub Timer5_Timer()
'win
If BadHP1.Caption < 1 Then
Timer6.Enabled = False
timer7.Enabled = False
Timer4.Enabled = False
timer3.Enabled = False
Timer1.Enabled = False
Timer8.Enabled = False
Lbl2.Caption = ""
BadHP1.Caption = 0
Bad1.Visible = False
bad2.Visible = False
Bad3.Visible = False
bad4.Visible = False
Bad5.Visible = False
bad6.Visible = False
MMControl1.FileName = "c:\fr0stbyte\media\midi\ffvii\mid00041.mid"
MMControl1.Command = "open"
MMControl1.Command = "play"
FrmBattle.Caption = "YOU WIN!"
Lbl1.Caption = "YOU WIN! Gained 1546 Exp. points and 2098 GP"
BG.Visible = True
Timer5.Enabled = False
'loose
ElseIf GoodHP1.Caption < 1 Then
Timer6.Enabled = False
timer7.Enabled = False
Timer4.Enabled = False
timer3.Enabled = False
Timer1.Enabled = False
Timer8.Enabled = False
Lbl2.Caption = ""
MMControl1.FileName = "c:\fr0stbyte\media\midi\ffvii\mid00018.mid"
MMControl1.Command = "open"
MMControl1.Command = "play"
FrmBattle.BackColor = RGB(180, 0, 0)
GoodHP1.Caption = 0
Bad1.Visible = False
bad2.Visible = False
Bad3.Visible = False
bad4.Visible = False
Bad5.Visible = False
bad6.Visible = False
FrmBattle.Caption = "Game Over"
Lbl1.Caption = "Your party died..."
BG.Visible = True
Timer5.Enabled = False
End If
End Sub
Private Sub Timer6_Timer()
If timer3.Enabled = True Or Timer4.Enabled = True Or Timer8.Enabled = True Then
timer7.Enabled = True
Timer6.Enabled = False
Else
LblAttack.Enabled = False
LblMagic.Enabled = False
LblItem.Enabled = False
Static b As Integer
If b > 100 Or b < 1 Then
b = 1
End If
Select Case b
Case 1
FrmBattle.BackColor = RGB(255, 255, 255)
Timer6.Interval = 25
b = 2
FrmBattle.BackColor = RGB(0, 0, 0)
'random fight
die = 1 + Int(8 * Rnd)
BG.Visible = True
Select Case die
Case 1
maga = 20 + Int(30 * Rnd)
Lbl1.Caption = lblenemy.Caption + " used the spell 'fart' on " + TxtName.Text + "!"
Lbl3.Caption = maga
GoodHP1.Caption = Val(GoodHP1.Caption) - Lbl3.Caption
BadMP1.Caption = Val(BadMP1.Caption) - 8
Timer6.Interval = 750
b = 3
Case Else
atta = 5 + Int(20 * Rnd)
Lbl1.Caption = lblenemy.Caption + " slashed " + TxtName.Text + "!"
Lbl3.Caption = atta
GoodHP1.Caption = Val(GoodHP1.Caption) - Lbl3.Caption
Timer6.Interval = 750
b = 3
End Select
Case 3
Timer6.Interval = 2000
Lbl3.Caption = ""
b = 4
Case 4
Lbl1.Caption = ""
BG.Visible = False
Timer6.Interval = 5000
If Timer1.Enabled = False Then
LblAttack.Enabled = True
LblMagic.Enabled = True
LblItem.Enabled = True
End If
b = 1
End Select
End If
End Sub
Private Sub timer7_Timer()
If timer3.Enabled = True Or Timer4.Enabled = True Or Timer8.Enabled = True Then
Timer6.Enabled = True
timer7.Enabled = False
Else
LblAttack.Enabled = False
LblMagic.Enabled = False
LblItem.Enabled = False
Static c As Integer
If c > 100 Or c < 1 Then
c = 1
End If
Select Case c
Case 1
FrmBattle.BackColor = RGB(255, 255, 255)
timer7.Interval = 25
c = 2
Case 2
FrmBattle.BackColor = RGB(0, 0, 0)
'random fight
die = 1 + Int(8 * Rnd)
BG.Visible = True
Select Case die
Case 1
maga = 20 + Int(30 * Rnd)
Lbl1.Caption = lblenemy.Caption + " used the spell 'fart' on " + TxtName.Text + "!"
Lbl3.Caption = maga
GoodHP1.Caption = Val(GoodHP1.Caption) - Lbl3.Caption
BadMP1.Caption = Val(BadMP1.Caption) - 8
timer7.Interval = 750
c = 3
Case Else
atta = 5 + Int(20 * Rnd)
Lbl1.Caption = lblenemy.Caption + " slashed " + TxtName.Text + "!"
Lbl3.Caption = atta
GoodHP1.Caption = Val(GoodHP1.Caption) - Lbl3.Caption
timer7.Interval = 750
c = 3
End Select
Case 3
Lbl3.Caption = ""
timer7.Interval = 2000
c = 4
Case 4
Lbl1.Caption = ""
BG.Visible = False
timer7.Interval = 2000
Timer6.Enabled = True
If Timer1.Enabled = False Then
LblAttack.Enabled = True
LblMagic.Enabled = True
LblItem.Enabled = True
End If
timer7.Enabled = False
c = 1356
End Select
End If
End Sub
Private Sub Timer8_Timer()
Static d As Integer
If Item1.Caption < 0 Then
MsgBox "you don't have any"
Item1.Caption = "0"
Timer8.Enabled = False
LblAttack.Enabled = True
LblMagic.Enabled = True
LblItem.Enabled = True
Else
If d > 100 Or d < 1 Then
d = 1
End If
Select Case d
Case 1
FrmBattle.BackColor = RGB(0, 180, 0)
d = 2
Case 2
FrmBattle.BackColor = RGB(0, 0, 0)
d = 3
Case 3
FrmBattle.BackColor = RGB(0, 180, 0)
d = 4
Case 4
FrmBattle.BackColor = RGB(0, 0, 0)
d = 5
Case 5
BG.Visible = True
Lbl1.Caption = "You have recovered you HP by 50 pts!"
GoodHP1.Caption = Val(GoodHP1.Caption) + 50
Item1.Caption = Val(Item1.Caption) - 1
Timer8.Interval = 3000
d = 6
Case 6
d = 200
BG.Visible = False
Lbl1.Caption = ""
Timer8.Interval = 25
Timer1.Enabled = True
Timer8.Enabled = False
End Select
End If
End Sub
Private Sub Timer9_Timer()
Static f As Integer
If Item2.Caption < 0 Then
MsgBox "you don't have any"
Item2.Caption = "0"
Timer9.Enabled = False
LblAttack.Enabled = True
LblMagic.Enabled = True
LblItem.Enabled = True
Else
If f > 100 Or f < 1 Then
f = 1
End If
Select Case f
Case 1
FrmBattle.BackColor = RGB(0, 180, 0)
f = 2
Case 2
FrmBattle.BackColor = RGB(0, 0, 0)
f = 3
Case 3
FrmBattle.BackColor = RGB(0, 180, 0)
f = 4
Case 4
FrmBattle.BackColor = RGB(0, 0, 0)
f = 5
Case 5
BG.Visible = True
Lbl1.Caption = "You have recovered you MP by 24 pts!"
GoodMP1.Caption = Val(GoodMP1.Caption) + 24
Item2.Caption = Val(Item2.Caption) - 1
Timer9.Interval = 3000
f = 6
Case 6
Lbl1.Caption = ""
BG.Visible = False
f = 200
Timer9.Interval = 25
Timer1.Enabled = True
Timer9.Enabled = False
End Select
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -