-
Notifications
You must be signed in to change notification settings - Fork 0
/
BonusIForm.vb
120 lines (76 loc) · 3.24 KB
/
BonusIForm.vb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
Public Class BonusIForm
'Variable to count buttons selected
Dim intButtonSelect As Integer = 0
Private Sub btnWeapon_Click(sender As Object, e As EventArgs) Handles btnWeapon.Click
'Change backround color when selected
btnWeapon.BackColor = Color.LightBlue
'When weapon button is selected, disable armor button
btnArmor.Enabled = False
'Call SimpleAdd to add 1 to ButtonSelect
SimpleAdd(intButtonSelect, 1)
End Sub
Private Sub btnArmor_Click(sender As Object, e As EventArgs) Handles btnArmor.Click
'Change selected button color
btnArmor.BackColor = Color.LightBlue
'When armor button is selected, disable weapon button
btnWeapon.Enabled = False
'Call SimpleAdd to add 1 to ButtonSelect
SimpleAdd(intButtonSelect, 1)
End Sub
Private Sub btnLightning_Click(sender As Object, e As EventArgs) Handles btnLightning.Click
'Change backround color when selected
btnLightning.BackColor = Color.LightBlue
'When thunder button is selected, disable heal button
btnHeal.Enabled = False
'Call SimpleAdd to add 1 to ButtonSelect
SimpleAdd(intButtonSelect, 1)
End Sub
Private Sub btnHeal_Click(sender As Object, e As EventArgs) Handles btnHeal.Click
'Change selected button color
btnHeal.BackColor = Color.LightBlue
'When heal button is selected, disable thunder button
btnLightning.Enabled = False
'Call SimpleAdd to add 1 to ButtonSelect
SimpleAdd(intButtonSelect, 1)
End Sub
Private Sub btnProceed_Click(sender As Object, e As EventArgs) Handles btnProceed.Click
If intButtonSelect = 2 Then
'If two buttons have been selected then..
If btnWeapon.Enabled = True Then
'If Weapon button is selected, set AtkBonus bool to true
blnAtkBonus = True
ElseIf btnArmor.Enabled = True Then
'If Armor button is selected, set HPBonus bool to true
blnHPBonus = True
End If
If btnLightning.Enabled = True Then
'If Thunder button is selected, set Thunder bool to true
blnThunder = True
ElseIf btnHeal.Enabled = True Then
'If Heal button is selected, set Heal bool to true
blnHeal = True
End If
'Open BattleForm
LoadBattleForm()
'Close this form
Me.Close()
Else
MessageBox.Show("Please select either 'Weapon' or 'Armor', " &
"as well as 'Heal' or 'Lightning'")
End If
End Sub
Private Sub btnCancel_Click(sender As Object, e As EventArgs) Handles btnCancel.Click
'Enable all buttons
btnWeapon.Enabled = True
btnArmor.Enabled = True
btnLightning.Enabled = True
btnHeal.Enabled = True
'Restore buttons to default color
btnWeapon.BackColor = DefaultBackColor
btnArmor.BackColor = DefaultBackColor
btnLightning.BackColor = DefaultBackColor
btnHeal.BackColor = DefaultBackColor
'Reset ButtonSelect
intButtonSelect = 0
End Sub
End Class