我在尝试为我和另一个人正在从事的项目编写简单的战斗模拟时遇到问题。
模块模块1
Dim Player_Vitality As Integer
Dim PlayerReiatsu As Integer
Dim PlayerZanjustu As Integer
Dim PlayerHakuda As Integer
Dim PlayerHoho As Integer
Dim PlayerKido As Integer
Dim PlayerAbility As Integer
Dim Player_Physical_Damage As Integer
Dim Player_Spirit_Damage As Integer
Dim Player_Critical_Chance As Integer
Dim Player_Critical_Damage As Integer
Sub Main()
Call Shuhei()
End Sub
Sub Shuhei()
Dim Shuhei_reiatsu As Integer
Dim Shuhei_Vitality_TurnStart As Integer
Dim Shuhei_Vitality_TurnEnd As Integer
Dim Attack As String
Dim Kido As Integer
Dim Sword As Integer
Dim Shuhei_Temp As Integer
PlayerZanjustu = 40
PlayerHakuda = 50
PlayerKido = 50
PlayerAbility = 75
Shuhei_reiatsu = 80
Kido = Player_Spirit_Damage
Sword = Player_Physical_Damage
'Player_Vitality = 100
Shuhei_Vitality_TurnStart = 1000
Console.WriteLine("FIGHT 1")
Console.ReadLine()
Do While Shuhei_Vitality_TurnStart > 0
Player_Physical_Damage = ((PlayerZanjustu + PlayerHakuda) - Shuhei_reiatsu)
Player_Spirit_Damage = ((PlayerKido + PlayerAbility) - Shuhei_reiatsu)
'Player_Critical_Chance = ((PlayerZanjustu + PlayerHoho) - Shuhei_reiatsu) / 100
'Player_Critical_Damage = (PlayerZanjustu + PlayerHakuda) * 10
Shuhei_Temp = Shuhei_Vitality_TurnStart
Console.WriteLine("Shuhei has " & Shuhei_Temp & "Hp")
Console.WriteLine("Which attack do you want to use?")
Attack = Console.ReadLine
If Attack = "Kido" Or Kido Then
Shuhei_Vitality_TurnEnd = ((Shuhei_Temp) - Player_Spirit_Damage)
ElseIf Attack = "Sword" Or Sword Then
Shuhei_Vitality_TurnEnd = Shuhei_Temp - Player_Physical_Damage
Else
Console.WriteLine("Please choose an attack")
End If
Shuhei_Vitality_TurnEnd = Shuhei_Vitality_TurnStart
If Shuhei_Vitality_TurnStart <= 0 Then
Call FightEnd()
End If
Loop
Console.ReadKey()
End Sub
Sub FightEnd()
Console.WriteLine("Shuhei has been defeated")
Console.ReadKey()
End Sub
这一切都被复制到一个新的子节点中,其中有一个没有目的的已停用垃圾,所以我怀疑这是问题所在,它只是战斗代码的骨架,但前面有 ' 来禁用它。然后在底部的 End Module 命令