LOL this thing was a nightmare

  • (2 Pages)
  • +
  • 1
  • 2

16 Replies - 5077 Views - Last Post: 11 July 2014 - 10:40 AM Rate Topic: -----

#1 Drowjam  Icon User is offline

  • New D.I.C Head

Reputation: 3
  • View blog
  • Posts: 33
  • Joined: 16-October 12

LOL this thing was a nightmare

Posted 19 April 2013 - 05:16 AM

This is one of my first projects lol.
Somewhere in here there is a bug that cause player 1 to act for player2. i never found it.

Public Class P2Potions
    Public Pl2Health As Integer
    Public Pl1Health As Integer
    Public Pl2power As Integer
    Public pl1power As Integer
    Public Pl2Money As Integer
    Public pl1Money As Integer
    Public pl1potions As Integer
    Public pl2potions As Integer
    Public pl1powerpotions As Integer
    Public pl2powerpotions As Integer


    Public i As Boolean
    Public y As Boolean
    Public B As Boolean
    Public B1 As Boolean
    Public J As Boolean
    Public ice2 As Boolean
    Public Heal As Boolean
    Public heal2 As Boolean
    Public healcounter As Integer = 0
    Public healcounter2 As Integer = 0
    Public k As Integer = 0
    Public c As Integer = 0
    Public burncounter As Integer = 0
    Public burncounterp1 As Integer = 0
    Public gernadecount As Integer = 5
    Public gernadecount2 As Integer = 5
    Public Icecounter As Integer = 0
    Public icecounter2 As Integer

    Public turncounter As Integer
    Public P1action As Boolean
    Public p2action As Boolean



    Public Shared Sub Randomize()

    End Sub
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        BtnShoot.Enabled = False
        BtnGernade.Enabled = False
        BtnFire.Enabled = False
        BtnIce.Enabled = False
        BtnHeal.Enabled = False
        BtnHPower.Enabled = False
        BtnBpotion.Enabled = False
        BtnBPower.Enabled = False
        BtnBgernades.Enabled = False
        BtnSteal.Enabled = False

    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnShoot.Click
        Randomize()
        Dim shootdmg As Integer = (40 * (Rnd()) + 20)
        Dim bleeding As Integer = (100 * (Rnd()) + 1)
        Dim Burndmg As Integer = (15 * (Rnd()) + 5)

        Pl2Health = Pl2Health - shootdmg
        P2Health.Text = Pl2Health
        MessageBox.Show("You have done " & shootdmg & " Damage to player 2")

        If bleeding < 10 Then
            i = True
            k = 0
        End If
        P1action = True
        If P1action = True Then
            BtnShoot.Enabled = False
            BtnGernade.Enabled = False
            BtnFire.Enabled = False
            BtnIce.Enabled = False
            BtnSteal.Enabled = False
            BtnHeal.Enabled = False
            BtnHPower.Enabled = False
            BtnBpotion.Enabled = False
            BtnBPower.Enabled = False
            BtnBgernades.Enabled = False
        End If

    End Sub

    Private Sub Label6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label6.Click

    End Sub

    Private Sub Button11_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button11.Click
        Me.Close()
    End Sub

    Private Sub Label14_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles P2Health.Click

    End Sub

    Private Sub Button10_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button10.Click
        Pl2Health = 1000
        Pl1Health = 1000
        Pl2power = 250
        pl1power = 250
        Pl2Money = 500
        pl1Money = 500
        gernadecount = 5
        gernadecount2 = 5
        pl1potions = 10
        pl2potions = 10
        pl1powerpotions = 10
        pl2powerpotions = 10


        P1PowerPotions.Text = pl1powerpotions
        P2PowerPotion.Text = pl2powerpotions
        P1Potions.Text = pl1potions
        Potions.Text = pl2potions
        NumGernades.Text = gernadecount
        NumGernades2.Text = gernadecount2
        P2Health.Text = Pl2Health
        P1health.Text = Pl1Health
        P2Power.Text = Pl2power
        P1Power.Text = pl1power
        P2Money.Text = Pl2Money
        P1money.Text = pl1Money

        BtnShoot.Enabled = True
        BtnGernade.Enabled = True
        BtnFire.Enabled = True
        BtnIce.Enabled = True
        BtnHeal.Enabled = True
        BtnHPower.Enabled = True
        BtnBpotion.Enabled = True
        BtnBPower.Enabled = True
        BtnBgernades.Enabled = True
        BtnSteal.Enabled = True



    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnGernade.Click
        Randomize()
        Dim gernadedmg As Integer = (75 * (Rnd()) + 0)
        Dim wellplaced As Integer = (100 * (Rnd()) + 1)

        If gernadecount <= 0 Then gernadecount = 0


        gernadecount -= 1
        If gernadecount >= 0 Then
            Pl2Health = Pl2Health - gernadedmg
            P2Health.Text = Pl2Health
            NumGernades.Text = gernadecount
            MessageBox.Show("Player2 has taken " & gernadedmg & "Damage and you have " & gernadecount & " gernades left")
            If wellplaced < 5 Then
                Pl2Health = Pl2Health - 50
                P2Health.Text = Pl2Health
                MessageBox.Show("well placed gernade player 2 takes 50 damage")
            End If
        End If
        P1action = True
        If P1action = True Then
            BtnShoot.Enabled = False
            BtnGernade.Enabled = False
            BtnFire.Enabled = False
            BtnIce.Enabled = False
            BtnSteal.Enabled = False
            BtnHeal.Enabled = False
            BtnHPower.Enabled = False
            BtnBpotion.Enabled = False
            BtnBPower.Enabled = False
            BtnBgernades.Enabled = False
        End If

    End Sub

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnFire.Click
        Randomize()
        Dim FireDmg As Integer = (25 * (Rnd()) + 1)
        Dim fireEffect As Integer = (100 * (Rnd()) + 1)
        Dim Burndmg As Integer = (15 * (Rnd()) + 5)

        If pl1power < 25 Then MessageBox.Show(" not enought power")

        If pl1power >= 25 Then
            Pl2Health = Pl2Health - FireDmg
            P2Health.Text = Pl2Health
            pl1power = pl1power - 25
            P1Power.Text = pl1power
            MessageBox.Show("Cost 10 Power and Player 2 has taken " & FireDmg & " Damage")
        End If

        If fireEffect <= 33 Then
            B1 = True
            burncounterp1 = 0
        End If

        P1action = True
        If P1action = True Then
            BtnShoot.Enabled = False
            BtnGernade.Enabled = False
            BtnFire.Enabled = False
            BtnIce.Enabled = False
            BtnSteal.Enabled = False
            BtnHeal.Enabled = False
            BtnHPower.Enabled = False
            BtnBpotion.Enabled = False
            BtnBPower.Enabled = False
            BtnBgernades.Enabled = False


        End If
    End Sub

    Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnBpotion.Click
        P1action = True
        If P1action = True Then
            BtnShoot.Enabled = False
            BtnGernade.Enabled = False
            BtnFire.Enabled = False
            BtnIce.Enabled = False
            BtnSteal.Enabled = False
            BtnHeal.Enabled = False
            BtnHPower.Enabled = False
            BtnBpotion.Enabled = False
            BtnBPower.Enabled = False
            BtnBgernades.Enabled = False
        End If
    End Sub

    Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnBPower.Click
        P1action = True
        If P1action = True Then
            BtnShoot.Enabled = False
            BtnGernade.Enabled = False
            BtnFire.Enabled = False
            BtnIce.Enabled = False
            BtnSteal.Enabled = False
            BtnHeal.Enabled = False
            BtnHPower.Enabled = False
            BtnBpotion.Enabled = False
            BtnBPower.Enabled = False
            BtnBgernades.Enabled = False
        End If

    End Sub

    Private Sub Button20_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnBgernades.Click
        If pl1Money >= 50 Then
            gernadecount = gernadecount + 5
            NumGernades.Text = gernadecount
            pl1Money = pl1Money - 50
            P1money.Text = pl1Money
            MessageBox.Show("You have bought 5 gernades for 50 money")
        End If
        P1action = True
        If P1action = True Then
            BtnShoot.Enabled = False
            BtnGernade.Enabled = False
            BtnFire.Enabled = False
            BtnIce.Enabled = False
            BtnSteal.Enabled = False
            BtnHeal.Enabled = False
            BtnHPower.Enabled = False
            BtnBpotion.Enabled = False
            BtnBPower.Enabled = False
            BtnBgernades.Enabled = False
        End If

    End Sub

    Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnIce.Click
        Randomize()
        Dim IceDmg As Integer = (30 * (Rnd()) + 20)
        Dim IP As Integer = (100 * (Rnd()) + 1)

        If pl1power >= 10 Then
            Pl2Health = Pl2Health - IceDmg
            P2Health.Text = Pl2Health
            pl1power = pl1power - 10
            P1Power.Text = pl1power
            MessageBox.Show("Player 2 has taken" & IceDmg & "damage")
        End If

        If IP < 15 Then
            J = True
            Icecounter = 0
        End If
        P1action = True
        If P1action = True Then
            BtnShoot.Enabled = False
            BtnGernade.Enabled = False
            BtnFire.Enabled = False
            BtnIce.Enabled = False
            BtnSteal.Enabled = False
            BtnHeal.Enabled = False
            BtnHPower.Enabled = False
            BtnBpotion.Enabled = False
            BtnBPower.Enabled = False
            BtnBgernades.Enabled = False
        End If

    End Sub

    Private Sub Button21_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnSteal.Click
        Randomize()
        Dim StealOdds As Integer = (100 * (Rnd()) + 1)
        Dim Moneysteal As Integer = (50 * (Rnd()) + 1)
        Dim extrasteal As Integer = (100 * (Rnd()) + 1)
        If StealOdds <= 10 Then
            gernadecount = gernadecount + 1
            NumGernades.Text = gernadecount
            MessageBox.Show("You have stolen 1 gernade from player 2")
        End If
        If StealOdds >= 20 And StealOdds <= 30 Then
            pl1potions = pl1potions + 1
            P1Potions.Text = pl1potions
            MessageBox.Show("you have stolen 1 potion from player 2")
        End If
        If StealOdds >= 50 And StealOdds <= 60 Then
            If Pl2Money < Moneysteal Then
                pl1Money = pl1Money + Pl2Money
                P1money.Text = pl1Money
                Pl2Money = 0
                P2Money.Text = Pl2Money
                MessageBox.Show("you have stolen all of player 2's money")
            Else
                pl1Money = pl1Money + Moneysteal
                P1money.Text = pl1Money
                Pl2Money = Pl2Money - Moneysteal
                P2Money.Text = Pl2Money
                MessageBox.Show("You Have stolen " & Moneysteal & " money from player 2")
            End If
        End If
        If StealOdds >= 90 Then
            pl1powerpotions = pl1powerpotions + 1
            P1PowerPotions.Text = pl1powerpotions + 1
            MessageBox.Show("You have stolen 1 Power potion from player 2")

        End If
        If extrasteal <= 2 Then
            gernadecount = gernadecount + 1
            NumGernades.Text = gernadecount
            MessageBox.Show("You have stolen 1 extra gernade from player 2")

        End If
        If extrasteal >= 10 And extrasteal <= 12 Then
            pl1potions = pl1potions + 1
            P1Potions.Text = pl1potions
            MessageBox.Show("you have stolen 1 extra potion from player 2")
        End If
        If extrasteal >= 25 And extrasteal <= 27 Then
            If Pl2Money < Moneysteal Then
                pl1Money = pl1Money + Pl2Money
                P1money.Text = pl1Money
                Pl2Money = 0
                P2Money.Text = Pl2Money
                MessageBox.Show("you have stolen all of player 2's money")
            Else
                pl1Money = pl1Money + Moneysteal
                P1money.Text = pl1Money
                Pl2Money = Pl2Money - Moneysteal
                P2Money.Text = Pl2Money
                MessageBox.Show("You Have stolen " & Moneysteal & " money extra from player 2")
            End If
        End If
        If extrasteal > 98 Then
            pl1powerpotions = pl1powerpotions + 1
            P1PowerPotions.Text = pl1powerpotions + 1
            MessageBox.Show("You have stolen 1 Power potion from player 2")

        End If
        P1action = True
        If P1action = True Then
            BtnShoot.Enabled = False
            BtnGernade.Enabled = False
            BtnFire.Enabled = False
            BtnIce.Enabled = False
            BtnSteal.Enabled = False
            BtnHeal.Enabled = False
            BtnHPower.Enabled = False
            BtnBpotion.Enabled = False
            BtnBPower.Enabled = False
            BtnBgernades.Enabled = False
        End If

    End Sub

    Private Sub BtnHeal_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnHeal.Click
        Randomize()
        Dim Healing As Integer = (100 * (Rnd()) + 1)
        Dim healingeffect As Integer = (100 * (Rnd()) + 0)
        Dim specialheal As Integer = (20 * (Rnd()) + 1)


        If pl1potions > 0 Then
            Pl1Health = Pl1Health + Healing
            pl1potions = pl1potions - 1
            P1Potions.Text = pl1potions
            P1health.Text = Pl1Health
        End If
        If healingeffect < 10 Then
            Heal = True
            healcounter = 0
        End If

        If Heal = True Then
            Pl1Health = Pl1Health + specialheal
            P1health.Text = Pl1Health
            healcounter += 1
            If healcounter = 5 Then Heal = False
        End If
        P1action = True
        If P1action = True Then
            BtnShoot.Enabled = False
            BtnGernade.Enabled = False
            BtnFire.Enabled = False
            BtnIce.Enabled = False
            BtnSteal.Enabled = False
            BtnHeal.Enabled = False
            BtnHPower.Enabled = False
            BtnBpotion.Enabled = False
            BtnBPower.Enabled = False
            BtnBgernades.Enabled = False
        End If
    End Sub

    Private Sub Button16_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnFire2.Click

    End Sub

    Private Sub Button12_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnShoot2.Click
        Randomize()
        Dim shootdmg As Integer = (40 * (Rnd()) + 20)
        Dim bleeding As Integer = (100 * (Rnd()) + 1)
        Dim Burndmg As Integer = (15 * (Rnd()) + 5)


        Pl1Health = Pl1Health - shootdmg
        P1health.Text = Pl1Health
        MessageBox.Show("You have done " & shootdmg & " Damage to player 1")
        If bleeding < 10 Then
            y = True
            c = 0
        End If

        If y = True And c < 5 Then
            Pl1Health = Pl1Health - 5
            c = c + 1
            P1health.Text = Pl1Health
            MessageBox.Show("Player 1 has been bleeding for " & c & " Turns and Loses 5 health")
            If c = 5 Then y = False
        End If
        If B = True And burncounter < 10 Then
            Pl2Health = Pl2Health - Burndmg
            P2Health.Text = Pl2Health
            burncounter = burncounter + 1
            MessageBox.Show("Player 2 has been burnt for " & burncounter & " Turns and has taken " & Burndmg & " damage")
        End If

    End Sub

    Private Sub Button14_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnGernades2.Click
        Randomize()
        Dim gernadedmg As Integer = (75 * (Rnd()) + 0)
        Dim wellplaced As Integer = (100 * (Rnd()) + 1)
        Dim Burndmg As Integer = (15 * (Rnd()) + 5)
        If gernadecount2 <= 0 Then gernadecount2 = 0


        gernadecount2 -= 1
        If gernadecount2 >= 0 Then
            Pl1Health = Pl1Health - gernadedmg
            P1health.Text = Pl1Health
            NumGernades2.Text = gernadecount2
            MessageBox.Show("Player2 has taken " & gernadedmg & "Damage and you have " & gernadecount2 & " gernades left")
            If wellplaced < 5 Then
                Pl1Health = Pl1Health - 50
                P1health.Text = Pl1Health
                MessageBox.Show("well placed gernade player 2 takes 50 damage")
            End If
        End If
    End Sub

    Private Sub Button1_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnEndTurn.Click
        Dim Burndmg As Integer = (15 * (Rnd()) + 5)
        Dim Iceeffect As Integer = (3 * (Rnd()) + 0)
        If i = True And k < 5 Then
            Pl2Health = Pl2Health - 5
            k = k + 1
            P2Health.Text = Pl2Health
            MessageBox.Show("has been bleeding for " & k & " Turns and Loses 1 health")
            If k = 5 Then i = False
        End If

        If B = True And burncounter <= 10 Then
            Pl2Health = Pl2Health - Burndmg
            P2Health.Text = Pl2Health
            burncounter = burncounter + 1
            MessageBox.Show("Player 2 has been burnt for " & burncounter & " Turns and has taken " & Burndmg & " damage")
            If burncounter = 10 Then B = False
        End If

        If J = True Then
            Pl2power = Pl2power - Iceeffect
            P2Power.Text = Pl2power
            Icecounter += 1
            MessageBox.Show("Player 2 has been frost bitten for " & Icecounter & " turns and has lost " & Iceeffect & " power")
            If Icecounter = 7 Then J = False
        End If

        If P1action = False Then MessageBox.Show("You have not taken any actions please select a action before you end your turn")
        If P1action = True Then
            BtnShoot.Enabled = False
            BtnGernade.Enabled = False
            BtnFire.Enabled = False
            BtnIce.Enabled = False
            BtnSteal.Enabled = False
            BtnHeal.Enabled = False
            BtnHPower.Enabled = False
            BtnBpotion.Enabled = False
            BtnBPower.Enabled = False
            BtnBgernades.Enabled = False
            BtnEndTurn.Enabled = False
            BtnendTurn2.enabled = True
        End If
        p2action = False

    End Sub

    Private Sub BtnHPower_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnHPower.Click
        P1action = True
        If P1action = True Then
            BtnShoot.Enabled = False
            BtnGernade.Enabled = False
            BtnFire.Enabled = False
            BtnIce.Enabled = False
            BtnSteal.Enabled = False
            BtnHeal.Enabled = False
            BtnHPower.Enabled = False
            BtnBpotion.Enabled = False
            BtnBPower.Enabled = False
            BtnBgernades.Enabled = False
        End If
    End Sub

    Private Sub SimP2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SimP2.Click
        Randomize()
        Dim above750 As Integer = (100 * (Rnd()) + 0)
        Dim Between750n500 As Integer = (100 * (Rnd()) + 0)
        Dim between500n250 As Integer = (100 * (Rnd()) + 0)
        Dim below250 As Integer = (100 * (Rnd()) + 0)
        Dim shootdmg As Integer = (40 * (Rnd()) + 20)
        Dim bleeding As Integer = (100 * (Rnd()) + 1)
        Dim gernadedmg As Integer = (75 * (Rnd()) + 0)
        Dim wellplaced As Integer = (100 * (Rnd()) + 1)
        Dim FireDmg As Integer = (25 * (Rnd()) + 1)
        Dim fireEffect As Integer = (100 * (Rnd()) + 1)
        Dim Burndmg As Integer = (15 * (Rnd()) + 5)
        Dim IceDmg As Integer = (30 * (Rnd()) + 20)
        Dim IP As Integer = (100 * (Rnd()) + 1)
        Dim Iceeffect As Integer = (3 * (Rnd()) + 0)
        Dim StealOdds As Integer = (100 * (Rnd()) + 1)
        Dim Moneysteal As Integer = (50 * (Rnd()) + 1)
        Dim extrasteal As Integer = (100 * (Rnd()) + 1)
        Dim potionsbuy As Integer = ((pl2potions / 2) * (Rnd()) + 0)
        Dim Healing As Integer = (100 * (Rnd()) + 1)
        Dim healingeffect As Integer = (100 * (Rnd()) + 0)
        Dim specialheal As Integer = (20 * (Rnd()) + 1)

        If Pl2Health >= 750 Then

            If above750 < 40 Then
                Pl1Health = Pl1Health - shootdmg
                P1health.Text = Pl1Health
                MessageBox.Show("Player 2 shot you for " & shootdmg & " Damage")
                If bleeding < 10 Then
                    y = True
                    c = 0
                End If
            End If

            If above750 >= 40 And above750 < 60 And gernadecount2 >= 0 Then

                If gernadecount2 < 0 Then gernadecount2 = 0

                If gernadecount2 > 0 Then
                    gernadecount2 = gernadecount2 - 1
                    Pl1Health = Pl1Health - gernadedmg
                    P1health.Text = Pl1Health
                    NumGernades2.Text = gernadecount2
                    MessageBox.Show("Player2 has taken " & gernadedmg & "Damage and you have " & gernadecount2 & " gernades left")
                    If wellplaced < 5 Then
                        Pl1Health = Pl1Health - 50
                        P1health.Text = Pl1Health
                        MessageBox.Show("well placed gernade player 1 takes 50 damage")
                    End If
                Else
                    If gernadecount2 = 0 Then
                        If Pl2Money >= 50 And gernadecount2 = 0 Then
                            gernadecount2 = gernadecount2 + 5
                            NumGernades2.Text = gernadecount2
                            Pl2Money = Pl2Money - 50
                            P2Money.Text = Pl2Money
                            MessageBox.Show("player2 bought 5 gernades for 50 money")
                        Else
                            Pl1Health = Pl1Health - shootdmg
                            P1health.Text = Pl1Health
                            MessageBox.Show("shot you")
                            If bleeding < 10 Then
                                y = True
                                c = 0
                            End If
                        End If
                    End If

                End If
            End If


            If above750 >= 60 And above750 < 75 Then
                If Pl2power >= 25 Then
                    Pl1Health = Pl1Health - FireDmg
                    P1health.Text = Pl1Health
                    Pl2power = Pl2power - 25
                    P2Power.Text = Pl2power
                    MessageBox.Show("Cost 10 Power and Player 1 has taken " & FireDmg & " Damage")
                    If fireEffect <= 33 Then
                        B = True
                        burncounter = 0
                    End If
                Else
                    If Pl2power <= 25 And pl2powerpotions > 0 Then
                        Pl2power = Pl2power + 50
                        P2Power.Text = Pl2power
                        pl2powerpotions = pl2powerpotions - 1
                        P2PowerPotion.Text = pl2powerpotions
                        MessageBox.Show("player 2 used a Powerpotion to restore 50 power f ")
                    Else
                        If Pl2Money >= 25 Then
                            pl2powerpotions = pl2powerpotions + 1
                            P2PowerPotion.Text = pl2powerpotions
                            Pl2Money = Pl2Money - 25
                            P2Money.Text = Pl2Money
                            MessageBox.Show("Player 2 bought 1 power potion for 25 money")
                        Else
                            Pl1Health = Pl1Health - shootdmg
                            P1health.Text = Pl1Health
                            MessageBox.Show("shot you")
                            If bleeding < 10 Then
                                y = True
                                c = 0

                            End If
                        End If
                    End If
                End If
            End If



            If above750 >= 75 And above750 < 90 Then
                If Pl2power >= 10 Then
                    Pl1Health = Pl1Health - IceDmg
                    P1health.Text = Pl1Health
                    Pl2power = Pl2power - 10
                    P2Power.Text = Pl2power
                    MessageBox.Show("Player 2 has used Ice and you have taken " & IceDmg & "damage")
                    If IP < 15 Then
                        ice2 = True
                        icecounter2 = 0
                    End If
                Else
                    If Pl2power <= 10 And pl2powerpotions > 0 Then
                        Pl2power = Pl2power + 50
                        P2Power.Text = Pl2power
                        pl2powerpotions = pl2powerpotions - 1
                        P2PowerPotion.Text = pl2powerpotions
                        MessageBox.Show("player 2 used a Powerpotion to restore 50 power I ")
                    Else
                        If Pl2Money >= 25 Then
                            pl2powerpotions = pl2powerpotions + 1
                            P2PowerPotion.Text = pl2powerpotions
                            Pl2Money = Pl2Money - 25
                            P2Money.Text = Pl2Money
                            MessageBox.Show("Player 2 bought 1 power potion for 25 money")
                        Else
                            Pl1Health = Pl1Health - shootdmg
                            P1health.Text = Pl1Health
                            MessageBox.Show("shot you")
                            If bleeding < 10 Then
                                y = True
                                c = 0
                            End If
                        End If
                    End If
                End If
            End If
            If above750 >= 90 And above750 < 95 Then
                If StealOdds > 10 And StealOdds < 20 Then
                    MessageBox.Show("Player 2 tried to steal from you and failed")
                End If
                If StealOdds > 30 And StealOdds < 40 Then
                    MessageBox.Show("Player 2 tried to steal from you and failed")
                End If
                If StealOdds > 60 And StealOdds < 90 Then
                    MessageBox.Show("Player 2 tried to steal from you and failed")
                End If
                If StealOdds <= 10 Then
                    If gernadecount > 0 Then
                        gernadecount2 = gernadecount2 + 1
                        NumGernades2.Text = gernadecount2
                        gernadecount = gernadecount - 1
                        NumGernades.Text = gernadecount
                        MessageBox.Show("Player 2 has stolen a gernade from you")
                    Else
                        MessageBox.Show("Player 2 tried to steal a gernade from you but you didnt have any")
                    End If
                End If

                If StealOdds >= 20 And StealOdds <= 30 Then
                    If pl1potions > 0 Then
                        pl2potions = pl2potions + 1
                        Potions.Text = pl2potions
                        pl1potions = pl1potions - 1
                        P1Potions.Text = pl1potions
                        MessageBox.Show("Player 2 has stolen a potion from you")
                    Else
                        MessageBox.Show("Player 2 tried to steal a Potion from you but you didnt have any")
                    End If
                End If

                If StealOdds >= 40 And StealOdds <= 60 Then
                    If Pl2Money < Moneysteal Then
                        Pl2Money = Pl2Money + pl1Money
                        P2Money.Text = Pl2Money
                        pl1Money = 0
                        P1money.Text = pl1Money
                        MessageBox.Show("Warning Player 2 has stolen all of your money")
                    Else
                        Pl2Money = Pl2Money + Moneysteal
                        P2Money.Text = Pl2Money
                        pl1Money = pl1Money - Moneysteal
                        P1money.Text = pl1Money
                        MessageBox.Show("Player 2 has stolen " & Moneysteal & " money from you")
                    End If
                End If

                If StealOdds >= 90 Then
                    If pl1powerpotions > 0 Then
                        pl2powerpotions = pl2powerpotions + 1
                        P2PowerPotion.Text = pl2powerpotions + 1
                        pl1powerpotions = pl1powerpotions - 1
                        P1PowerPotions.Text = pl1powerpotions
                        MessageBox.Show("You have stolen 1 Power potion from player 2")
                    Else
                        MessageBox.Show("Player 2 tried to steal a power potion for you but you dont have any")
                    End If
                End If

                If extrasteal <= 2 Then
                    If gernadecount > 0 Then
                        gernadecount2 = gernadecount2 + 1
                        NumGernades2.Text = gernadecount2
                        gernadecount = gernadecount - 1
                        NumGernades.Text = gernadecount
                        MessageBox.Show("Player 2 has stolen a extra gernade from you")
                    Else
                        MessageBox.Show("Player 2 tried to steal a extra gernade from you but you didnt have any")
                    End If
                End If
                If extrasteal >= 10 And extrasteal <= 12 Then
                    If pl1potions > 0 Then
                        pl2potions = pl2potions + 1
                        Potions.Text = pl2potions
                        pl1potions = pl1potions - 1
                        P1Potions.Text = pl1potions
                        MessageBox.Show("Player 2 has stolen a potion from you")
                    Else
                        MessageBox.Show("Player 2 tried to steal a gernade from you but you didnt have any")
                    End If
                End If
                If extrasteal >= 25 And extrasteal <= 27 Then
                    If Pl2Money < Moneysteal Then
                        pl1Money = pl1Money + Pl2Money
                        P1money.Text = pl1Money
                        Pl2Money = 0
                        P2Money.Text = Pl2Money
                        MessageBox.Show("you have stolen all of player 2's money")
                    Else
                        pl1Money = pl1Money + Moneysteal
                        P1money.Text = pl1Money
                        Pl2Money = Pl2Money - Moneysteal
                        P2Money.Text = Pl2Money
                        MessageBox.Show("You Have stolen " & Moneysteal & " money extra from player 2")
                    End If
                End If
                If extrasteal > 98 Then
                    If pl1powerpotions > 0 Then
                        pl2powerpotions = pl2powerpotions + 1
                        P2PowerPotion.Text = pl2powerpotions + 1
                        pl1powerpotions = pl1powerpotions - 1
                        P1PowerPotions.Text = pl1powerpotions
                        MessageBox.Show("You have stolen 1 Power potion from player 2")
                    Else
                        MessageBox.Show("Player 2 tried to steal a power potion for you but you dont have any")
                    End If
                End If
            End If

            If above750 >= 95 Then
                If pl2potions >= 5 Then


                    Pl2Health = Pl2Health + Healing
                    pl2potions = pl2potions - 1
                    Potions.Text = pl2potions
                    P2Health.Text = Pl2Health
                    MessageBox.Show("Player 2 used a potion to heal " & Healing & " Health")
                    If healingeffect < 30 Then
                        heal2 = True
                        healcounter2 = 0
                    End If
                Else
                    If pl2potions <= 5 And Pl2Money > 25 Then
                        pl2potions = pl2potions + 1
                        Potions.Text = pl2potions
                        Pl2Money = Pl2Money - 25
                        MessageBox.Show("Player 2 bought a potion for 25 money")
                    Else
                        Pl1Health = Pl1Health - shootdmg
                        P1health.Text = Pl1Health
                        MessageBox.Show("shot you")
                        If bleeding < 10 Then
                            y = True
                            c = 0
                        End If
                    End If
                End If
            End If
        End If
        'START OF AI FOR  HEALTH BETWEEN 750 AND 500
        If Pl2Health >= 500 And Pl2Health < 750 Then
            If Between750n500 < 50 Then
                Pl1Health = Pl1Health - shootdmg
                P1health.Text = Pl1Health
                MessageBox.Show("Player 2 shot you for " & shootdmg & " Damage")
                If bleeding < 10 Then
                    y = True
                    c = 0
                End If
            End If


            If Between750n500 >= 50 And Between750n500 < 55 Then
                If gernadecount2 < 0 Then gernadecount2 = 0

                If gernadecount2 > 0 Then
                    gernadecount2 = gernadecount2 - 1
                    Pl1Health = Pl1Health - gernadedmg
                    P1health.Text = Pl1Health
                    NumGernades2.Text = gernadecount2
                    MessageBox.Show("Player2 has taken " & gernadedmg & "Damage and you have " & gernadecount2 & " gernades left")
                    If wellplaced < 5 Then
                        Pl1Health = Pl1Health - 50
                        P1health.Text = Pl1Health
                        MessageBox.Show("well placed gernade player 1 takes 50 damage")
                    End If
                Else
                    If gernadecount2 = 0 Then
                        If Pl2Money >= 50 And gernadecount2 = 0 Then
                            gernadecount2 = gernadecount2 + 5
                            NumGernades2.Text = gernadecount2
                            Pl2Money = Pl2Money - 50
                            P2Money.Text = Pl2Money
                            MessageBox.Show("player2 bought 5 gernades for 50 money")
                        Else
                            Pl1Health = Pl1Health - shootdmg
                            P1health.Text = Pl1Health
                            MessageBox.Show("shot you")
                            If bleeding < 10 Then
                                y = True
                                c = 0
                            End If
                        End If
                    End If

                End If
            End If
            If Between750n500 >= 55 And Between750n500 < 60 Then
                If Pl2power >= 25 Then
                    Pl1Health = Pl1Health - FireDmg
                    P1health.Text = Pl1Health
                    Pl2power = Pl2power - 25
                    P2Power.Text = Pl2power
                    MessageBox.Show("Cost 10 Power and Player 1 has taken " & FireDmg & " Damage")
                    If fireEffect <= 33 Then
                        B = True
                        burncounter = 0
                    End If
                Else
                    If Pl2power <= 25 And pl2powerpotions > 0 Then
                        Pl2power = Pl2power + 50
                        P2Power.Text = Pl2power
                        pl2powerpotions = pl2powerpotions - 1
                        P2PowerPotion.Text = pl2powerpotions
                        MessageBox.Show("player 2 used a Powerpotion to restore 50 power f ")
                    Else
                        If Pl2Money >= 25 Then
                            pl2powerpotions = pl2powerpotions + 1
                            P2PowerPotion.Text = pl2powerpotions
                            Pl2Money = Pl2Money - 25
                            P2Money.Text = Pl2Money
                            MessageBox.Show("Player 2 bought 1 power potion for 25 money")
                        Else
                            Pl1Health = Pl1Health - shootdmg
                            P1health.Text = Pl1Health
                            MessageBox.Show("shot you")
                            If bleeding < 10 Then
                                y = True
                                c = 0

                            End If
                        End If
                    End If
                End If
            End If
            If Between750n500 >= 60 And Between750n500 < 65 Then
                If Pl2power >= 10 Then
                    Pl1Health = Pl1Health - IceDmg
                    P1health.Text = Pl1Health
                    Pl2power = Pl2power - 10
                    P2Power.Text = Pl2power
                    MessageBox.Show("Player 2 has used Ice and you have taken " & IceDmg & "damage")
                    If IP < 15 Then
                        ice2 = True
                        icecounter2 = 0
                    End If
                Else
                    If Pl2power <= 10 And pl2powerpotions > 0 Then
                        Pl2power = Pl2power + 50
                        P2Power.Text = Pl2power
                        pl2powerpotions = pl2powerpotions - 1
                        P2PowerPotion.Text = pl2powerpotions
                        MessageBox.Show("player 2 used a Powerpotion to restore 50 power I ")
                    Else
                        If Pl2Money >= 25 Then
                            pl2powerpotions = pl2powerpotions + 1
                            P2PowerPotion.Text = pl2powerpotions
                            Pl2Money = Pl2Money - 25
                            P2Money.Text = Pl2Money
                            MessageBox.Show("Player 2 bought 1 power potion for 25 money")
                        Else
                            Pl1Health = Pl1Health - shootdmg
                            P1health.Text = Pl1Health
                            MessageBox.Show("shot you")
                            If bleeding < 10 Then
                                y = True
                                c = 0
                            End If
                        End If
                    End If
                End If
            End If
            If Between750n500 >= 65 And Between750n500 < 95 Then
                If StealOdds > 10 And StealOdds < 20 Then
                    MessageBox.Show("Player 2 tried to steal from you and failed")
                End If
                If StealOdds > 30 And StealOdds < 40 Then
                    MessageBox.Show("Player 2 tried to steal from you and failed")
                End If
                If StealOdds > 60 And StealOdds < 90 Then
                    MessageBox.Show("Player 2 tried to steal from you and failed")
                End If
                If StealOdds <= 10 Then
                    If gernadecount > 0 Then
                        gernadecount2 = gernadecount2 + 1
                        NumGernades2.Text = gernadecount2
                        gernadecount = gernadecount - 1
                        NumGernades.Text = gernadecount
                        MessageBox.Show("Player 2 has stolen a gernade from you")
                    Else
                        MessageBox.Show("Player 2 tried to steal a gernade from you but you didnt have any")
                    End If
                End If

                If StealOdds >= 20 And StealOdds <= 30 Then
                    If pl1potions > 0 Then
                        pl2potions = pl2potions + 1
                        Potions.Text = pl2potions
                        pl1potions = pl1potions - 1
                        P1Potions.Text = pl1potions
                        MessageBox.Show("Player 2 has stolen a potion from you")
                    Else
                        MessageBox.Show("Player 2 tried to steal a Potion from you but you didnt have any")
                    End If
                End If

                If StealOdds >= 40 And StealOdds <= 60 Then
                    If Pl2Money < Moneysteal Then
                        Pl2Money = Pl2Money + pl1Money
                        P2Money.Text = Pl2Money
                        pl1Money = 0
                        P1money.Text = pl1Money
                        MessageBox.Show("Warning Player 2 has stolen all of your money")
                    Else
                        Pl2Money = Pl2Money + Moneysteal
                        P2Money.Text = Pl2Money
                        pl1Money = pl1Money - Moneysteal
                        P1money.Text = pl1Money
                        MessageBox.Show("Player 2 has stolen " & Moneysteal & " money from you")
                    End If
                End If

                If StealOdds >= 90 Then
                    If pl1powerpotions > 0 Then
                        pl2powerpotions = pl2powerpotions + 1
                        P2PowerPotion.Text = pl2powerpotions + 1
                        pl1powerpotions = pl1powerpotions - 1
                        P1PowerPotions.Text = pl1powerpotions
                        MessageBox.Show("You have stolen 1 Power potion from player 2")
                    Else
                        MessageBox.Show("Player 2 tried to steal a power potion for you but you dont have any")
                    End If
                End If

                If extrasteal <= 2 Then
                    If gernadecount > 0 Then
                        gernadecount2 = gernadecount2 + 1
                        NumGernades2.Text = gernadecount2
                        gernadecount = gernadecount - 1
                        NumGernades.Text = gernadecount
                        MessageBox.Show("Player 2 has stolen a extra gernade from you")
                    Else
                        MessageBox.Show("Player 2 tried to steal a extra gernade from you but you didnt have any")
                    End If
                End If
                If extrasteal >= 10 And extrasteal <= 12 Then
                    If pl1potions > 0 Then
                        pl2potions = pl2potions + 1
                        Potions.Text = pl2potions
                        pl1potions = pl1potions - 1
                        P1Potions.Text = pl1potions
                        MessageBox.Show("Player 2 has stolen a potion from you")
                    Else
                        MessageBox.Show("Player 2 tried to steal a gernade from you but you didnt have any")
                    End If
                End If
                If extrasteal >= 25 And extrasteal <= 27 Then
                    If Pl2Money < Moneysteal Then
                        pl1Money = pl1Money + Pl2Money
                        P1money.Text = pl1Money
                        Pl2Money = 0
                        P2Money.Text = Pl2Money
                        MessageBox.Show("you have stolen all of player 2's money")
                    Else
                        pl1Money = pl1Money + Moneysteal
                        P1money.Text = pl1Money
                        Pl2Money = Pl2Money - Moneysteal
                        P2Money.Text = Pl2Money
                        MessageBox.Show("You Have stolen " & Moneysteal & " money extra from player 2")
                    End If
                End If
                If extrasteal > 98 Then
                    If pl1powerpotions > 0 Then
                        pl2powerpotions = pl2powerpotions + 1
                        P2PowerPotion.Text = pl2powerpotions + 1
                        pl1powerpotions = pl1powerpotions - 1
                        P1PowerPotions.Text = pl1powerpotions
                        MessageBox.Show("You have stolen 1 Power potion from player 2")
                    Else
                        MessageBox.Show("Player 2 tried to steal a power potion for you but you dont have any")
                    End If
                End If
            End If
            If Between750n500 >= 95 Then
                If pl2potions >= 5 Then


                    Pl2Health = Pl2Health + Healing
                    pl2potions = pl2potions - 1
                    Potions.Text = pl2potions
                    P2Health.Text = Pl2Health
                    MessageBox.Show("Player 2 used a potion to heal " & Healing & " Health")
                    If healingeffect < 30 Then
                        heal2 = True
                        healcounter2 = 0
                    End If
                Else
                    If pl2potions <= 5 And Pl2Money > 25 Then
                        pl2potions = pl2potions + 1
                        Potions.Text = pl2potions
                        Pl2Money = Pl2Money - 25
                        MessageBox.Show("Player 2 bought a potion for 25 money")
                    Else
                        Pl1Health = Pl1Health - shootdmg
                        P1health.Text = Pl1Health
                        MessageBox.Show("shot you")
                        If bleeding < 10 Then
                            y = True
                            c = 0
                        End If
                    End If
                End If
            End If

        End If
        If Pl2Health >= 250 And Pl2Health < 500 Then
            If between500n250 < 15 Then
                Pl1Health = Pl1Health - shootdmg
                P1health.Text = Pl1Health
                MessageBox.Show("Player 2 shot you for " & shootdmg & " Damage")
                If bleeding < 10 Then
                    y = True
                    c = 0
                End If
            End If


            If between500n250 >= 15 And between500n250 < 25 Then
                If gernadecount2 < 0 Then gernadecount2 = 0

                If gernadecount2 > 0 Then
                    gernadecount2 = gernadecount2 - 1
                    Pl1Health = Pl1Health - gernadedmg
                    P1health.Text = Pl1Health
                    NumGernades2.Text = gernadecount2
                    MessageBox.Show("Player2 has taken " & gernadedmg & "Damage and you have " & gernadecount2 & " gernades left")
                    If wellplaced < 5 Then
                        Pl1Health = Pl1Health - 50
                        P1health.Text = Pl1Health
                        MessageBox.Show("well placed gernade player 1 takes 50 damage")
                    End If
                Else
                    If gernadecount2 = 0 Then
                        If Pl2Money >= 50 And gernadecount2 = 0 Then
                            gernadecount2 = gernadecount2 + 5
                            NumGernades2.Text = gernadecount2
                            Pl2Money = Pl2Money - 50
                            P2Money.Text = Pl2Money
                            MessageBox.Show("player2 bought 5 gernades for 50 money")
                        Else
                            Pl1Health = Pl1Health - shootdmg
                            P1health.Text = Pl1Health
                            MessageBox.Show("shot you")
                            If bleeding < 10 Then
                                y = True
                                c = 0
                            End If
                        End If
                    End If

                End If
            End If
            If between500n250 >= 25 And between500n250 < 40 Then
                If Pl2power >= 25 Then
                    Pl1Health = Pl1Health - FireDmg
                    P1health.Text = Pl1Health
                    Pl2power = Pl2power - 25
                    P2Power.Text = Pl2power
                    MessageBox.Show("Cost 10 Power and Player 1 has taken " & FireDmg & " Damage")
                    If fireEffect <= 33 Then
                        B = True
                        burncounter = 0
                    End If
                Else
                    If Pl2power <= 25 And pl2powerpotions > 0 Then
                        Pl2power = Pl2power + 50
                        P2Power.Text = Pl2power
                        pl2powerpotions = pl2powerpotions - 1
                        P2PowerPotion.Text = pl2powerpotions
                        MessageBox.Show("player 2 used a Powerpotion to restore 50 power f ")
                    Else
                        If Pl2Money >= 25 Then
                            pl2powerpotions = pl2powerpotions + 1
                            P2PowerPotion.Text = pl2powerpotions
                            Pl2Money = Pl2Money - 25
                            P2Money.Text = Pl2Money
                            MessageBox.Show("Player 2 bought 1 power potion for 25 money")
                        Else
                            Pl1Health = Pl1Health - shootdmg
                            P1health.Text = Pl1Health
                            MessageBox.Show("shot you")
                            If bleeding < 10 Then
                                y = True
                                c = 0

                            End If
                        End If
                    End If
                End If
            End If
            If between500n250 >= 40 And between500n250 < 50 Then
                If Pl2power >= 10 Then
                    Pl1Health = Pl1Health - IceDmg
                    P1health.Text = Pl1Health
                    Pl2power = Pl2power - 10
                    P2Power.Text = Pl2power
                    MessageBox.Show("Player 2 has used Ice and you have taken " & IceDmg & "damage")
                    If IP < 15 Then
                        ice2 = True
                        icecounter2 = 0
                    End If
                Else
                    If Pl2power <= 10 And pl2powerpotions > 0 Then
                        Pl2power = Pl2power + 50
                        P2Power.Text = Pl2power
                        pl2powerpotions = pl2powerpotions - 1
                        P2PowerPotion.Text = pl2powerpotions
                        MessageBox.Show("player 2 used a Powerpotion to restore 50 power I ")
                    Else
                        If Pl2Money >= 25 Then
                            pl2powerpotions = pl2powerpotions + 1
                            P2PowerPotion.Text = pl2powerpotions
                            Pl2Money = Pl2Money - 25
                            P2Money.Text = Pl2Money
                            MessageBox.Show("Player 2 bought 1 power potion for 25 money")
                        Else
                            Pl1Health = Pl1Health - shootdmg
                            P1health.Text = Pl1Health
                            MessageBox.Show("shot you")
                            If bleeding < 10 Then
                                y = True
                                c = 0
                            End If
                        End If
                    End If
                End If
            End If
            If between500n250 >= 50 And between500n250 < 70 Then
                If StealOdds > 10 And StealOdds < 20 Then
                    MessageBox.Show("Player 2 tried to steal from you and failed")
                End If
                If StealOdds > 30 And StealOdds < 40 Then
                    MessageBox.Show("Player 2 tried to steal from you and failed")
                End If
                If StealOdds > 60 And StealOdds < 90 Then
                    MessageBox.Show("Player 2 tried to steal from you and failed")
                End If
                If StealOdds <= 10 Then
                    If gernadecount > 0 Then
                        gernadecount2 = gernadecount2 + 1
                        NumGernades2.Text = gernadecount2
                        gernadecount = gernadecount - 1
                        NumGernades.Text = gernadecount
                        MessageBox.Show("Player 2 has stolen a gernade from you")
                    Else
                        MessageBox.Show("Player 2 tried to steal a gernade from you but you didnt have any")
                    End If
                End If

                If StealOdds >= 20 And StealOdds <= 30 Then
                    If pl1potions > 0 Then
                        pl2potions = pl2potions + 1
                        Potions.Text = pl2potions
                        pl1potions = pl1potions - 1
                        P1Potions.Text = pl1potions
                        MessageBox.Show("Player 2 has stolen a potion from you")
                    Else
                        MessageBox.Show("Player 2 tried to steal a Potion from you but you didnt have any")
                    End If
                End If

                If StealOdds >= 40 And StealOdds <= 60 Then
                    If Pl2Money < Moneysteal Then
                        Pl2Money = Pl2Money + pl1Money
                        P2Money.Text = Pl2Money
                        pl1Money = 0
                        P1money.Text = pl1Money
                        MessageBox.Show("Warning Player 2 has stolen all of your money")
                    Else
                        Pl2Money = Pl2Money + Moneysteal
                        P2Money.Text = Pl2Money
                        pl1Money = pl1Money - Moneysteal
                        P1money.Text = pl1Money
                        MessageBox.Show("Player 2 has stolen " & Moneysteal & " money from you")
                    End If
                End If

                If StealOdds >= 90 Then
                    If pl1powerpotions > 0 Then
                        pl2powerpotions = pl2powerpotions + 1
                        P2PowerPotion.Text = pl2powerpotions + 1
                        pl1powerpotions = pl1powerpotions - 1
                        P1PowerPotions.Text = pl1powerpotions
                        MessageBox.Show("You have stolen 1 Power potion from player 2")
                    Else
                        MessageBox.Show("Player 2 tried to steal a power potion for you but you dont have any")
                    End If
                End If

                If extrasteal <= 2 Then
                    If gernadecount > 0 Then
                        gernadecount2 = gernadecount2 + 1
                        NumGernades2.Text = gernadecount2
                        gernadecount = gernadecount - 1
                        NumGernades.Text = gernadecount
                        MessageBox.Show("Player 2 has stolen a extra gernade from you")
                    Else
                        MessageBox.Show("Player 2 tried to steal a extra gernade from you but you didnt have any")
                    End If
                End If
                If extrasteal >= 10 And extrasteal <= 12 Then
                    If pl1potions > 0 Then
                        pl2potions = pl2potions + 1
                        Potions.Text = pl2potions
                        pl1potions = pl1potions - 1
                        P1Potions.Text = pl1potions
                        MessageBox.Show("Player 2 has stolen a potion from you")
                    Else
                        MessageBox.Show("Player 2 tried to steal a gernade from you but you didnt have any")
                    End If
                End If
                If extrasteal >= 25 And extrasteal <= 27 Then
                    If Pl2Money < Moneysteal Then
                        pl1Money = pl1Money + Pl2Money
                        P1money.Text = pl1Money
                        Pl2Money = 0
                        P2Money.Text = Pl2Money
                        MessageBox.Show("you have stolen all of player 2's money")
                    Else
                        pl1Money = pl1Money + Moneysteal
                        P1money.Text = pl1Money
                        Pl2Money = Pl2Money - Moneysteal
                        P2Money.Text = Pl2Money
                        MessageBox.Show("You Have stolen " & Moneysteal & " money extra from player 2")
                    End If
                End If
                If extrasteal > 98 Then
                    If pl1powerpotions > 0 Then
                        pl2powerpotions = pl2powerpotions + 1
                        P2PowerPotion.Text = pl2powerpotions + 1
                        pl1powerpotions = pl1powerpotions - 1
                        P1PowerPotions.Text = pl1powerpotions
                        MessageBox.Show("You have stolen 1 Power potion from player 2")
                    Else
                        MessageBox.Show("Player 2 tried to steal a power potion for you but you dont have any")
                    End If
                End If
            End If
            If between500n250 >= 70 Then
                If pl2potions >= 0 Then


                    Pl2Health = Pl2Health + Healing
                    pl2potions = pl2potions - 1
                    Potions.Text = pl2potions
                    P2Health.Text = Pl2Health
                    MessageBox.Show("Player 2 used a potion to heal " & Healing & " Health")
                    If healingeffect < 100 Then
                        heal2 = True
                        healcounter2 = 0
                    End If
                Else
                    If pl2potions <= 5 And Pl2Money > 25 Then
                        pl2potions = pl2potions + 1
                        Potions.Text = pl2potions
                        Pl2Money = Pl2Money - 25
                        MessageBox.Show("Player 2 bought a potion for 25 money")
                    Else
                        Pl1Health = Pl1Health - shootdmg
                        P1health.Text = Pl1Health
                        MessageBox.Show("shot you")
                        If bleeding < 10 Then
                            y = True
                            c = 0
                        End If
                    End If
                End If
            End If

        End If

        If Pl2Health <= 250 Then
            If below250 < 27 Then
                Pl1Health = Pl1Health - shootdmg
                P1health.Text = Pl1Health
                MessageBox.Show("Player 2 shot you for " & shootdmg & " Damage")
                If bleeding < 10 Then
                    y = True
                    c = 0
                End If
            End If


            If below250 >= 27 And below250 < 35 Then
                If gernadecount2 < 0 Then gernadecount2 = 0

                If gernadecount2 > 0 Then
                    gernadecount2 = gernadecount2 - 1
                    Pl1Health = Pl1Health - gernadedmg
                    P1health.Text = Pl1Health
                    NumGernades2.Text = gernadecount2
                    MessageBox.Show("Player2 has taken " & gernadedmg & "Damage and you have " & gernadecount2 & " gernades left")
                    If wellplaced < 5 Then
                        Pl1Health = Pl1Health - 50
                        P1health.Text = Pl1Health
                        MessageBox.Show("well placed gernade player 1 takes 50 damage")
                    End If
                Else
                    If gernadecount2 = 0 Then
                        If Pl2Money >= 50 And gernadecount2 = 0 Then
                            gernadecount2 = gernadecount2 + 5
                            NumGernades2.Text = gernadecount2
                            Pl2Money = Pl2Money - 50
                            P2Money.Text = Pl2Money
                            MessageBox.Show("player2 bought 5 gernades for 50 money")
                        Else
                            Pl1Health = Pl1Health - shootdmg
                            P1health.Text = Pl1Health
                            MessageBox.Show("shot you")
                            If bleeding < 10 Then
                                y = True
                                c = 0
                            End If
                        End If
                    End If

                End If
            End If
            If below250 >= 35 And below250 < 40 Then
                If Pl2power >= 25 Then
                    Pl1Health = Pl1Health - FireDmg
                    P1health.Text = Pl1Health
                    Pl2power = Pl2power - 25
                    P2Power.Text = Pl2power
                    MessageBox.Show("Cost 10 Power and Player 1 has taken " & FireDmg & " Damage")
                    If fireEffect <= 33 Then
                        B = True
                        burncounter = 0
                    End If
                Else
                    If Pl2power <= 25 And pl2powerpotions > 0 Then
                        Pl2power = Pl2power + 50
                        P2Power.Text = Pl2power
                        pl2powerpotions = pl2powerpotions - 1
                        P2PowerPotion.Text = pl2powerpotions
                        MessageBox.Show("player 2 used a Powerpotion to restore 50 power f ")
                    Else
                        If Pl2Money >= 25 Then
                            pl2powerpotions = pl2powerpotions + 1
                            P2PowerPotion.Text = pl2powerpotions
                            Pl2Money = Pl2Money - 25
                            P2Money.Text = Pl2Money
                            MessageBox.Show("Player 2 bought 1 power potion for 25 money")
                        Else
                            Pl1Health = Pl1Health - shootdmg
                            P1health.Text = Pl1Health
                            MessageBox.Show("shot you")
                            If bleeding < 10 Then
                                y = True
                                c = 0

                            End If
                        End If
                    End If
                End If
            End If
            If below250 >= 40 And below250 < 55 Then
                If Pl2power >= 10 Then
                    Pl1Health = Pl1Health - IceDmg
                    P1health.Text = Pl1Health
                    Pl2power = Pl2power - 10
                    P2Power.Text = Pl2power
                    MessageBox.Show("Player 2 has used Ice and you have taken " & IceDmg & "damage")
                    If IP < 15 Then
                        ice2 = True
                        icecounter2 = 0
                    End If
                Else
                    If Pl2power <= 10 And pl2powerpotions > 0 Then
                        Pl2power = Pl2power + 50
                        P2Power.Text = Pl2power
                        pl2powerpotions = pl2powerpotions - 1
                        P2PowerPotion.Text = pl2powerpotions
                        MessageBox.Show("player 2 used a Powerpotion to restore 50 power I ")
                    Else
                        If Pl2Money >= 25 Then
                            pl2powerpotions = pl2powerpotions + 1
                            P2PowerPotion.Text = pl2powerpotions
                            Pl2Money = Pl2Money - 25
                            P2Money.Text = Pl2Money
                            MessageBox.Show("Player 2 bought 1 power potion for 25 money")
                        Else
                            Pl1Health = Pl1Health - shootdmg
                            P1health.Text = Pl1Health
                            MessageBox.Show("shot you")
                            If bleeding < 10 Then
                                y = True
                                c = 0
                            End If
                        End If
                    End If
                End If
            End If
            If below250 >= 65 And below250 < 95 Then
                If StealOdds > 10 And StealOdds < 20 Then
                    MessageBox.Show("Player 2 tried to steal from you and failed")
                End If
                If StealOdds > 30 And StealOdds < 40 Then
                    MessageBox.Show("Player 2 tried to steal from you and failed")
                End If
                If StealOdds > 60 And StealOdds < 90 Then
                    MessageBox.Show("Player 2 tried to steal from you and failed")
                End If
                If StealOdds <= 10 Then
                    If gernadecount > 0 Then
                        gernadecount2 = gernadecount2 + 1
                        NumGernades2.Text = gernadecount2
                        gernadecount = gernadecount - 1
                        NumGernades.Text = gernadecount
                        MessageBox.Show("Player 2 has stolen a gernade from you")
                    Else
                        MessageBox.Show("Player 2 tried to steal a gernade from you but you didnt have any")
                    End If
                End If

                If StealOdds >= 55 And StealOdds <= 60 Then
                    If pl1potions > 0 Then
                        pl2potions = pl2potions + 1
                        Potions.Text = pl2potions
                        pl1potions = pl1potions - 1
                        P1Potions.Text = pl1potions
                        MessageBox.Show("Player 2 has stolen a potion from you")
                    Else
                        MessageBox.Show("Player 2 tried to steal a Potion from you but you didnt have any")
                    End If
                End If

                If StealOdds >= 40 And StealOdds <= 60 Then
                    If Pl2Money < Moneysteal Then
                        Pl2Money = Pl2Money + pl1Money
                        P2Money.Text = Pl2Money
                        pl1Money = 0
                        P1money.Text = pl1Money
                        MessageBox.Show("Warning Player 2 has stolen all of your money")
                    Else
                        Pl2Money = Pl2Money + Moneysteal
                        P2Money.Text = Pl2Money
                        pl1Money = pl1Money - Moneysteal
                        P1money.Text = pl1Money
                        MessageBox.Show("Player 2 has stolen " & Moneysteal & " money from you")
                    End If
                End If

                If StealOdds >= 90 Then
                    If pl1powerpotions > 0 Then
                        pl2powerpotions = pl2powerpotions + 1
                        P2PowerPotion.Text = pl2powerpotions + 1
                        pl1powerpotions = pl1powerpotions - 1
                        P1PowerPotions.Text = pl1powerpotions
                        MessageBox.Show("You have stolen 1 Power potion from player 2")
                    Else
                        MessageBox.Show("Player 2 tried to steal a power potion for you but you dont have any")
                    End If
                End If

                If extrasteal <= 2 Then
                    If gernadecount > 0 Then
                        gernadecount2 = gernadecount2 + 1
                        NumGernades2.Text = gernadecount2
                        gernadecount = gernadecount - 1
                        NumGernades.Text = gernadecount
                        MessageBox.Show("Player 2 has stolen a extra gernade from you")
                    Else
                        MessageBox.Show("Player 2 tried to steal a extra gernade from you but you didnt have any")
                    End If
                End If
                If extrasteal >= 10 And extrasteal <= 12 Then
                    If pl1potions > 0 Then
                        pl2potions = pl2potions + 1
                        Potions.Text = pl2potions
                        pl1potions = pl1potions - 1
                        P1Potions.Text = pl1potions
                        MessageBox.Show("Player 2 has stolen a potion from you")
                    Else
                        MessageBox.Show("Player 2 tried to steal a gernade from you but you didnt have any")
                    End If
                End If
                If extrasteal >= 25 And extrasteal <= 27 Then
                    If Pl2Money < Moneysteal Then
                        pl1Money = pl1Money + Pl2Money
                        P1money.Text = pl1Money
                        Pl2Money = 0
                        P2Money.Text = Pl2Money
                        MessageBox.Show("you have stolen all of player 2's money")
                    Else
                        pl1Money = pl1Money + Moneysteal
                        P1money.Text = pl1Money
                        Pl2Money = Pl2Money - Moneysteal
                        P2Money.Text = Pl2Money
                        MessageBox.Show("You Have stolen " & Moneysteal & " money extra from player 2")
                    End If
                End If
                If extrasteal > 98 Then
                    If pl1powerpotions > 0 Then
                        pl2powerpotions = pl2powerpotions + 1
                        P2PowerPotion.Text = pl2powerpotions + 1
                        pl1powerpotions = pl1powerpotions - 1
                        P1PowerPotions.Text = pl1powerpotions
                        MessageBox.Show("You have stolen 1 Power potion from player 2")
                    Else
                        MessageBox.Show("Player 2 tried to steal a power potion for you but you dont have any")
                    End If
                End If
            End If
            If below250 >= 60 Then
                If pl2potions >= 0 Then


                    Pl2Health = Pl2Health + Healing
                    pl2potions = pl2potions - 1
                    Potions.Text = pl2potions
                    P2Health.Text = Pl2Health
                    MessageBox.Show("Player 2 used a potion to heal " & Healing & " Health")
                    If healingeffect < 100 Then
                        heal2 = True
                        healcounter2 = 0
                    End If
                Else
                    If pl2potions <= 5 And Pl2Money > 25 Then
                        pl2potions = pl2potions + 1
                        Potions.Text = pl2potions
                        Pl2Money = Pl2Money - 25
                        MessageBox.Show("Player 2 bought a potion for 25 money")
                    Else
                        Pl1Health = Pl1Health - shootdmg
                        P1health.Text = Pl1Health
                        MessageBox.Show("shot you")
                        If bleeding < 10 Then
                            y = True
                            c = 0
                        End If
                    End If
                End If
            End If

        End If




        If heal2 = True Then
            Pl2Health = Pl2Health + specialheal
            P2Health.Text = Pl2Health
            healcounter2 += 1
            If healcounter2 = 5 Then heal2 = False
            MessageBox.Show("Player 2 has had a regen for " & healcounter2 & " Turns an heals " & specialheal & " health")
        End If

        If ice2 = True Then
            Pl2power = Pl2power - Iceeffect
            P2Power.Text = Pl2power
            Icecounter += 1
            MessageBox.Show("Player 2 has been frost bitten for " & Icecounter & " turns and has lost " & Iceeffect & " power")
            If icecounter2 = 7 Then J = False
        End If

        If B = True And burncounter <= 10 Then
            Pl2Health = Pl2Health - Burndmg
            P2Health.Text = Pl2Health
            burncounter = burncounter + 1
            MessageBox.Show("Player 2 has been burnt for " & burncounter & " Turns and has taken " & Burndmg & " damage")
            If burncounter = 10 Then B = False
        End If

        If y = True And c < 5 Then
            Pl2Health = Pl2Health - 5
            c = c + 1
            P2Health.Text = Pl2Health
            MessageBox.Show("Player 1 has been bleeding for " & c & " Turns and Loses 5 health")
            If c = 5 Then y = False
        End If
        Pl2Money = Pl2Money + 10
        P2Money.Text = Pl2Money

    End Sub

    Private Sub BtnIce2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnIce2.Click

    End Sub

    Private Sub BTnBPower2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BTnBPower2.Click
        Dim fuckaround As Integer = (pl2potions / 2) * (pl1potions / 2) * (Rnd() + 0)
        P2PowerPotion.Text = fuckaround
    End Sub

    Private Sub Potions_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Potions.Click

    End Sub

    Private Sub BtnBPotion2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnBPotion2.Click

    End Sub

    Private Sub Button1_Click_2(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        ' SIM PLAYER 1
        Randomize()
        Dim above750 As Integer = (100 * (Rnd()) + 0)
        Dim Between750n500 As Integer = (100 * (Rnd()) + 0)
        Dim between500n250 As Integer = (100 * (Rnd()) + 0)
        Dim below250 As Integer = (100 * (Rnd()) + 0)
        Dim shootdmg As Integer = (40 * (Rnd()) + 20)
        Dim bleeding As Integer = (100 * (Rnd()) + 1)
        Dim gernadedmg As Integer = (75 * (Rnd()) + 0)
        Dim wellplaced As Integer = (100 * (Rnd()) + 1)
        Dim FireDmg As Integer = (25 * (Rnd()) + 1)
        Dim fireEffect As Integer = (100 * (Rnd()) + 1)
        Dim Burndmg As Integer = (15 * (Rnd()) + 5)
        Dim IceDmg As Integer = (30 * (Rnd()) + 20)
        Dim IP As Integer = (100 * (Rnd()) + 1)
        Dim Iceeffect As Integer = (3 * (Rnd()) + 0)
        Dim StealOdds As Integer = (100 * (Rnd()) + 1)
        Dim Moneysteal As Integer = (50 * (Rnd()) + 1)
        Dim extrasteal As Integer = (100 * (Rnd()) + 1)
        Dim potionsbuy As Integer = ((pl2potions / 2) * (Rnd()) + 0)
        Dim Healing As Integer = (100 * (Rnd()) + 1)
        Dim healingeffect As Integer = (100 * (Rnd()) + 0)
        Dim specialheal As Integer = (20 * (Rnd()) + 1)

        If Pl2Health >= 750 Then

            If above750 < 40 Then
                Pl2Health = Pl2Health - shootdmg
                P2Health.Text = Pl2Health
                MessageBox.Show("Player 1 shot you for " & shootdmg & " Damage")
                If bleeding < 10 Then
                    i = True
                    k = 0
                End If
            End If

            If above750 >= 40 And above750 < 60 And gernadecount >= 0 Then

                If gernadecount < 0 Then gernadecount = 0

                If gernadecount > 0 Then
                    gernadecount = gernadecount - 1
                    Pl2Health = Pl2Health - gernadedmg
                    P2Health.Text = Pl2Health
                    NumGernades.Text = gernadecount
                    MessageBox.Show("Player2 has taken " & gernadedmg & "Damage and you have " & gernadecount & " gernades left")
                    If wellplaced < 5 Then
                        Pl2Health = Pl2Health - 50
                        P2Health.Text = Pl2Health
                        MessageBox.Show("well placed gernade player 2 takes 50 damage")
                    End If
                Else
                    If gernadecount = 0 Then
                        If pl1Money >= 50 And gernadecount = 0 Then
                            gernadecount = gernadecount + 5
                            NumGernades.Text = gernadecount
                            pl1Money = pl1Money - 50
                            P1money.Text = pl1Money
                            MessageBox.Show("player2 bought 5 gernades for 50 money")
                        Else
                            Pl2Health = Pl2Health - shootdmg
                            P2Health.Text = Pl2Health
                            MessageBox.Show("shot you")
                            If bleeding < 10 Then
                                i = True
                                k = 0
                            End If
                        End If
                    End If

                End If
            End If


            If above750 >= 60 And above750 < 75 Then
                If Pl2power >= 25 Then
                    Pl2Health = Pl2Health - FireDmg
                    P2Health.Text = Pl2Health
                    pl1power = pl1power - 25
                    P1Power.Text = pl1power
                    MessageBox.Show("Cost 10 Power and Player 2 has taken " & FireDmg & " Damage")

                    If fireEffect <= 33 Then
                        B1 = True
                        burncounterp1 = 0
                    End If
                Else
                    If pl1power <= 25 And pl1powerpotions > 0 Then
                        pl1power = pl1power + 50
                        P1Power.Text = pl1power
                        pl1powerpotions = pl1powerpotions - 1
                        P1PowerPotions.Text = pl1powerpotions
                        MessageBox.Show("player 1 used a Powerpotion to restore 50 power f ")
                    Else
                        If pl1Money >= 25 Then
                            pl1powerpotions = pl1powerpotions + 1
                            P1PowerPotions.Text = pl1powerpotions
                            pl1Money = pl1Money - 25
                            P1money.Text = pl1Money
                            MessageBox.Show("Player 1 bought 1 power potion for 25 money")
                        Else
                            Pl1Health = Pl1Health - shootdmg
                            P1health.Text = Pl1Health
                            MessageBox.Show("shot you")
                            If bleeding < 10 Then
                                i = True
                                k = 0

                            End If
                        End If
                    End If
                End If
            End If


            'Im here __________________________________________________________
            If above750 >= 75 And above750 < 90 Then
                If pl1power >= 10 Then
                    Pl2Health = Pl2Health - IceDmg
                    P2Health.Text = Pl2Health
                    pl1power = pl1power - 10
                    P1Power.Text = pl1power
                    MessageBox.Show("Player 1 has used Ice and you have taken " & IceDmg & "damage")
                    If IP < 15 Then
                        J = True
                        Icecounter = 0
                    End If
                Else
                    If pl1power <= 10 And pl1powerpotions > 0 Then
                        pl1power = pl1power + 50
                        P1Power.Text = pl1power
                        pl1powerpotions = pl1powerpotions - 1
                        P1PowerPotions.Text = pl1powerpotions
                        MessageBox.Show("player 1 used a Powerpotion to restore 50 power I ")
                    Else
                        If pl1Money >= 25 Then
                            pl1powerpotions = pl1powerpotions + 1
                            P1PowerPotions.Text = pl1powerpotions
                            pl1Money = pl1Money - 25
                            P1money.Text = pl1Money
                            MessageBox.Show("Player 1 bought 1 power potion for 25 money")
                        Else
                            Pl2Health = Pl2Health - shootdmg
                            P2Health.Text = Pl2Health
                            MessageBox.Show("shot you")
                            If bleeding < 10 Then
                                i = True
                                k = 0
                            End If
                        End If
                    End If
                End If
            End If
            'Im here===============================================================++++++
            If above750 >= 90 And above750 < 95 Then
                If StealOdds > 10 And StealOdds < 20 Then
                    MessageBox.Show("Player 1 tried to steal from you and failed")
                End If
                If StealOdds > 30 And StealOdds < 40 Then
                    MessageBox.Show("Player 1 tried to steal from you and failed")
                End If
                If StealOdds > 60 And StealOdds < 90 Then
                    MessageBox.Show("Player 1 tried to steal from you and failed")
                End If
                If StealOdds <= 10 Then
                    If gernadecount2 > 0 Then
                        gernadecount = gernadecount + 1
                        NumGernades.Text = gernadecount
                        gernadecount2 = gernadecount2 - 1
                        NumGernades2.Text = gernadecount2
                        MessageBox.Show("Player 1 has stolen a gernade from you")
                    Else
                        MessageBox.Show("Player 1 tried to steal a gernade from you but you didnt have any")
                    End If
                End If

                If StealOdds >= 20 And StealOdds <= 30 Then
                    If pl2potions > 0 Then
                        pl1potions = pl1potions + 1
                        P1Potions.Text = pl1potions
                        pl2potions = pl2potions - 1
                        Potions.Text = pl2potions
                        MessageBox.Show("Player 1 has stolen a potion from you")
                    Else
                        MessageBox.Show("Player 1 tried to steal a Potion from you but you didnt have any")
                    End If
                End If

                If StealOdds >= 40 And StealOdds <= 60 Then
                    If Pl2Money < Moneysteal Then
                        pl1Money = pl1Money + Pl2Money
                        P1money.Text = pl1Money
                        Pl2Money = 0
                        P2Money.Text = Pl2Money
                        MessageBox.Show("Warning Player 1 has stolen all of your money")
                    Else
                        pl1Money = pl1Money + Moneysteal
                        P1money.Text = pl1Money
                        Pl2Money = Pl2Money - Moneysteal
                        P2Money.Text = Pl2Money
                        MessageBox.Show("Player 1 has stolen " & Moneysteal & " money from you")
                    End If
                End If
                'Im Here)))))))))))))))))))))))))))))))))))))))))))
                If StealOdds >= 90 Then
                    If pl2powerpotions > 0 Then
                        pl1powerpotions = pl1powerpotions + 1
                        P1PowerPotions.Text = pl1powerpotions
                        pl2powerpotions = pl2powerpotions - 1
                        P2PowerPotion.Text = pl2powerpotions
                        MessageBox.Show("You have stolen 1 Power potion from player 2")
                    Else
                        MessageBox.Show("Player 1 tried to steal a power potion for you but you dont have any")
                    End If
                End If

                If extrasteal <= 2 Then
                    If gernadecount2 > 0 Then
                        gernadecount = gernadecount + 1
                        NumGernades.Text = gernadecount
                        gernadecount2 = gernadecount2 - 1
                        NumGernades2.Text = gernadecount2
                        MessageBox.Show("Player 1 has stolen a extra gernade from you")
                    Else
                        MessageBox.Show("Player 1 tried to steal a extra gernade from you but you didnt have any")
                    End If
                End If
                If extrasteal >= 10 And extrasteal <= 12 Then
                    If pl2potions > 0 Then
                        pl1potions = pl1potions + 1
                        P1Potions.Text = pl1potions
                        pl2potions = pl2potions - 1
                        Potions.Text = pl2potions
                        MessageBox.Show("Player 1 has stolen a potion from you")
                    Else
                        MessageBox.Show("Player 1 tried to steal a gernade from you but you didnt have any")
                    End If
                End If
                If extrasteal >= 25 And extrasteal <= 27 Then
                    If Pl2Money < Moneysteal Then
                        pl1Money = pl1Money + Pl2Money
                        P1money.Text = pl1Money
                        Pl2Money = 0
                        P2Money.Text = Pl2Money
                        MessageBox.Show("you have stolen all of player 2's money")
                    Else
                        pl1Money = pl1Money + Moneysteal
                        P1money.Text = pl1Money
                        Pl2Money = Pl2Money - Moneysteal
                        P2Money.Text = Pl2Money
                        MessageBox.Show("You Have stolen " & Moneysteal & " money extra from player 2")
                    End If
                End If
                'Im here ???????????????????????????????????????????????????????????????????
                If extrasteal > 98 Then
                    If pl2powerpotions > 0 Then
                        pl1powerpotions = pl1powerpotions + 1
                        P1PowerPotions.Text = pl1powerpotions
                        pl2powerpotions = pl2powerpotions - 1
                        P2PowerPotion.Text = pl2powerpotions
                        MessageBox.Show("You have stolen 1 Power potion from player 2")
                    Else
                        MessageBox.Show("Player 1 tried to steal a power potion for you but you dont have any")
                    End If
                End If
            End If

            If above750 >= 95 Then
                If pl2potions >= 5 Then


                    Pl1Health = Pl1Health + Healing
                    pl1potions = pl1potions - 1
                    P1Potions.Text = pl1potions
                    P1health.Text = Pl1Health
                    MessageBox.Show("Player 1 used a potion to heal " & Healing & " Health")
                    If healingeffect < 30 Then
                        Heal = True
                        healcounter = 0
                    End If
                Else
                    If pl1potions <= 5 And pl1Money > 25 Then
                        pl1potions = pl1potions + 1
                        P1Potions.Text = pl1potions
                        pl1Money = pl1Money - 25
                        P1money.Text = pl1Money
                        MessageBox.Show("Player 1 bought a potion for 25 money")
                    Else
                        Pl1Health = Pl1Health - shootdmg
                        P1health.Text = Pl1Health
                        MessageBox.Show("shot you")
                        If bleeding < 10 Then
                            i = True
                            k = 0
                        End If
                    End If
                End If
            End If
        End If
        'START OF AI FOR  HEALTH BETWEEN 750 AND 500
        If Pl1Health >= 500 And Pl1Health < 750 Then
            If Between750n500 < 50 Then
                Pl1Health = Pl1Health - shootdmg
                P1health.Text = Pl1Health
                MessageBox.Show("Player 1 shot you for " & shootdmg & " Damage")
                If bleeding < 10 Then
                    i = True
                    k = 0
                End If
            End If


            If Between750n500 >= 50 And Between750n500 < 55 Then
                If gernadecount < 0 Then gernadecount = 0

                If gernadecount > 0 Then
                    gernadecount = gernadecount - 1
                    Pl2Health = Pl2Health - gernadedmg
                    P2Health.Text = Pl2Health
                    NumGernades.Text = gernadecount
                    MessageBox.Show("Player 2 has taken " & gernadedmg & "Damage and you have " & gernadecount2 & " gernades left")
                    If wellplaced < 5 Then
                        Pl2Health = Pl2Health - 50
                        P2Health.Text = Pl2Health
                        MessageBox.Show("well placed gernade player 2 takes 50 damage")
                    End If
                Else
                    If gernadecount = 0 Then
                        If pl1Money >= 50 And gernadecount = 0 Then
                            gernadecount = gernadecount + 5
                            NumGernades.Text = gernadecount
                            pl1Money = pl1Money - 50
                            P1money.Text = pl1Money
                            MessageBox.Show("player 1 bought 5 gernades for 50 money")
                        Else
                            Pl2Health = Pl2Health - shootdmg
                            P2Health.Text = Pl2Health
                            MessageBox.Show("shot you")
                            If bleeding < 10 Then
                                i = True
                                k = 0
                            End If
                        End If
                    End If

                End If
            End If
            'HEEEEEEEEEEEEEEEEEEERRRRRRRRRRRREEEEEEEEEEEEEEEEE
            If Between750n500 >= 55 And Between750n500 < 60 Then
                If pl1power >= 25 Then
                    Pl2Health = Pl2Health - FireDmg
                    P2Health.Text = Pl2Health
                    pl1power = pl1power - 25
                    P1Power.Text = pl1power
                    MessageBox.Show("Cost 10 Power and Player 2 has taken " & FireDmg & " Damage")
                    If fireEffect <= 33 Then
                        B1 = True
                        burncounterp1 = 0
                    End If
                Else
                    If pl1power <= 25 And pl1powerpotions > 0 Then
                        pl1power = pl1power + 50
                        P1Power.Text = pl1power
                        pl1powerpotions = pl1powerpotions - 1
                        P1PowerPotions.Text = pl1powerpotions
                        MessageBox.Show("player 1 used a Powerpotion to restore 50 power f ")
                    Else
                        If pl1Money >= 25 Then
                            pl1powerpotions = pl1powerpotions + 1
                            P1PowerPotions.Text = pl1powerpotions
                            pl1Money = pl1Money - 25
                            P1money.Text = pl1Money
                            MessageBox.Show("Player 1 bought 1 power potion for 25 money")
                        Else
                            Pl2Health = Pl2Health - shootdmg
                            P2Health.Text = Pl2Health
                            MessageBox.Show("shot you")
                            If bleeding < 10 Then
                                i = True
                                k = 0

                            End If
                        End If
                    End If
                End If
            End If
            If Between750n500 >= 60 And Between750n500 < 65 Then
                If pl1power >= 10 Then
                    Pl2Health = Pl2Health - IceDmg
                    P2Health.Text = Pl2Health
                    pl1power = pl1power - 10
                    P1Power.Text = pl1power
                    MessageBox.Show("Player 1 has used Ice and you have taken " & IceDmg & "damage")
                    If IP < 15 Then
                        J = True
                        Icecounter = 0
                    End If
                Else
                    If pl1power <= 10 And pl1powerpotions > 0 Then
                        pl1power = pl1power + 50
                        P1Power.Text = pl1power
                        pl1powerpotions = pl1powerpotions - 1
                        P1PowerPotions.Text = pl1powerpotions
                        MessageBox.Show("player 1 used a Powerpotion to restore 50 power I ")
                    Else
                        If pl1Money >= 25 Then
                            pl1powerpotions = pl1powerpotions + 1
                            P1PowerPotions.Text = pl1powerpotions
                            pl1Money = pl1Money - 25
                            P1money.Text = pl1Money
                            MessageBox.Show("Player 1 bought 1 power potion for 25 money")
                        Else
                            Pl2Health = Pl2Health - shootdmg
                            P2Health.Text = Pl2Health
                            MessageBox.Show("shot you")
                            If bleeding < 10 Then
                                i = True
                                k = 0
                            End If
                        End If
                    End If
                End If
            End If
            If Between750n500 >= 65 And Between750n500 < 95 Then
                If StealOdds > 10 And StealOdds < 20 Then
                    MessageBox.Show("Player 1 tried to steal from you and failed")
                End If
                If StealOdds > 30 And StealOdds < 40 Then
                    MessageBox.Show("Player 1 tried to steal from you and failed")
                End If
                If StealOdds > 60 And StealOdds < 90 Then
                    MessageBox.Show("Player 1 tried to steal from you and failed")
                End If
                ')))))))))))))))))))))))((((((((((((((((((((((((((
                If StealOdds <= 10 Then
                    If gernadecount > 0 Then
                        gernadecount = gernadecount + 1
                        NumGernades.Text = gernadecount
                        gernadecount2 = gernadecount2 - 1
                        NumGernades2.Text = gernadecount2
                        MessageBox.Show("Player 1 has stolen a gernade from you")
                    Else
                        MessageBox.Show("Player 1 tried to steal a gernade from you but you didnt have any")
                    End If
                End If

                If StealOdds >= 20 And StealOdds <= 30 Then
                    If pl2potions > 0 Then
                        pl1potions = pl1potions + 1
                        P1Potions.Text = pl1potions
                        pl2potions = pl2potions - 1
                        Potions.Text = pl2potions
                        MessageBox.Show("Player 1 has stolen a potion from you")
                    Else
                        MessageBox.Show("Player 1 tried to steal a Potion from you but you didnt have any")
                    End If
                End If
                'I AM HERE>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
                If StealOdds >= 40 And StealOdds <= 60 Then
                    If Pl2Money < Moneysteal Then
                        pl1Money = pl1Money + Pl2Money
                        P1money.Text = pl1Money
                        Pl2Money = 0
                        P2Money.Text = Pl2Money
                        MessageBox.Show("Warning Player 1 has stolen all of your money")
                    Else
                        pl1Money = pl1Money + Moneysteal
                        P1money.Text = pl1Money
                        Pl2Money = Pl2Money - Moneysteal
                        P2Money.Text = Pl2Money
                        MessageBox.Show("Player 1 has stolen " & Moneysteal & " money from you")
                    End If
                End If

                If StealOdds >= 90 Then
                    If pl2powerpotions > 0 Then
                        pl1powerpotions = pl1powerpotions + 1
                        P1PowerPotions.Text = pl1powerpotions
                        pl2powerpotions = pl2powerpotions - 1
                        P2PowerPotion.Text = pl2powerpotions
                        MessageBox.Show("You have stolen 1 Power potion from player 2")
                    Else
                        MessageBox.Show("Player 1 tried to steal a power potion for you but you dont have any")
                    End If
                End If

                If extrasteal <= 2 Then
                    If gernadecount2 > 0 Then
                        gernadecount = gernadecount + 1
                        NumGernades.Text = gernadecount
                        gernadecount2 = gernadecount2 - 1
                        NumGernades2.Text = gernadecount2
                        MessageBox.Show("Player 1 has stolen a extra gernade from you")
                    Else
                        MessageBox.Show("Player 1 tried to steal a extra gernade from you but you didnt have any")
                    End If
                End If
                If extrasteal >= 10 And extrasteal <= 12 Then
                    If pl2potions > 0 Then
                        pl1potions = pl1potions + 1
                        P1Potions.Text = pl1potions
                        pl2potions = pl2potions - 1
                        Potions.Text = pl2potions
                        MessageBox.Show("Player 1 has stolen a potion from you")
                    Else
                        MessageBox.Show("Player 1 tried to steal a gernade from you but you didnt have any")
                    End If
                End If
                If extrasteal >= 25 And extrasteal <= 27 Then
                    If Pl2Money < Moneysteal Then
                        pl1Money = pl1Money + Pl2Money
                        P1money.Text = pl1Money
                        Pl2Money = 0
                        P2Money.Text = Pl2Money
                        MessageBox.Show("you have stolen all of player 2's money")
                    Else
                        pl1Money = pl1Money + Moneysteal
                        P1money.Text = pl1Money
                        Pl2Money = Pl2Money - Moneysteal
                        P2Money.Text = Pl2Money
                        MessageBox.Show("You Have stolen " & Moneysteal & " money extra from player 2")
                    End If
                End If
                If extrasteal > 98 Then
                    If pl1powerpotions > 0 Then
                        pl2powerpotions = pl2powerpotions + 1
                        P2PowerPotion.Text = pl2powerpotions
                        pl1powerpotions = pl1powerpotions - 1
                        P1PowerPotions.Text = pl1powerpotions
                        MessageBox.Show("You have stolen 1 Power potion from player 2")
                    Else
                        MessageBox.Show("Player 2 tried to steal a power potion for you but you dont have any")
                    End If
                End If
            End If
            If Between750n500 >= 95 Then
                If pl1potions >= 5 Then


                    Pl1Health = Pl1Health + Healing
                    pl1potions = pl1potions - 1
                    P1Potions.Text = pl1potions
                    P1health.Text = Pl1Health
                    MessageBox.Show("Player 1 used a potion to heal " & Healing & " Health")
                    If healingeffect < 30 Then
                        Heal = True
                        healcounter = 0
                    End If
                Else
                    If pl1potions <= 5 And Pl2Money > 25 Then
                        pl1potions = pl1potions + 1
                        P1Potions.Text = pl1potions
                        pl1Money = pl1Money - 25
                        MessageBox.Show("Player 1 bought a potion for 25 money")
                    Else
                        Pl2Health = Pl2Health - shootdmg
                        P2Health.Text = Pl2Health
                        MessageBox.Show("shot you")
                        If bleeding < 10 Then
                            i = True
                            k = 0
                        End If
                    End If
                End If
            End If

        End If
        If Pl1Health >= 250 And Pl1Health < 500 Then
            If between500n250 < 15 Then
                Pl2Health = Pl2Health - shootdmg
                P2Health.Text = Pl2Health
                MessageBox.Show("Player 1 shot you for " & shootdmg & " Damage")
                If bleeding < 10 Then
                    i = True
                    k = 0
                End If
            End If


            If between500n250 >= 15 And between500n250 < 25 Then
                If gernadecount < 0 Then gernadecount = 0

                If gernadecount > 0 Then
                    gernadecount = gernadecount - 1
                    Pl2Health = Pl2Health - gernadedmg
                    P2Health.Text = Pl2Health
                    NumGernades.Text = gernadecount
                    MessageBox.Show("Player 2 has taken " & gernadedmg & "Damage and you have " & gernadecount2 & " gernades left")
                    If wellplaced < 5 Then
                        Pl2Health = Pl2Health - 50
                        P2Health.Text = Pl2Health
                        MessageBox.Show("well placed gernade player 2 takes 50 damage")
                    End If
                Else
                    If gernadecount = 0 Then
                        If pl1Money >= 50 And gernadecount = 0 Then
                            gernadecount = gernadecount + 5
                            NumGernades.Text = gernadecount
                            pl1Money = pl1Money - 50
                            P1money.Text = pl1Money
                            MessageBox.Show("player 1 bought 5 gernades for 50 money")
                        Else
                            Pl2Health = Pl2Health - shootdmg
                            P2Health.Text = Pl2Health
                            MessageBox.Show("shot you")
                            If bleeding < 10 Then
                                i = True
                                k = 0
                            End If
                        End If
                    End If

                End If
            End If
            ' HHHHHHEHEHEHEHEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMMMMMMMMMMMMMMMMMMMMMMMMM
            If between500n250 >= 25 And between500n250 < 40 Then
                If pl1power >= 25 Then
                    Pl2Health = Pl2Health - FireDmg
                    P2Health.Text = Pl2Health
                    pl1power = pl1power - 25
                    P1Power.Text = pl1power
                    MessageBox.Show("Cost 10 Power and Player 2 has taken " & FireDmg & " Damage")
                    If fireEffect <= 33 Then
                        B1 = True
                        burncounterp1 = 0
                    End If
                Else
                    If pl1power <= 25 And pl1powerpotions > 0 Then
                        pl1power = pl1power + 50
                        P1Power.Text = pl1power
                        pl1powerpotions = pl1powerpotions - 1
                        P1PowerPotions.Text = pl1powerpotions
                        MessageBox.Show("player 1 used a Powerpotion to restore 50 power f ")
                    Else
                        If pl1Money >= 25 Then
                            pl1powerpotions = pl1powerpotions + 1
                            P1PowerPotions.Text = pl1powerpotions
                            pl1Money = pl1Money - 25
                            P1money.Text = pl1Money
                            MessageBox.Show("Player 1 bought 1 power potion for 25 money")
                        Else
                            Pl2Health = Pl2Health - shootdmg
                            P2Health.Text = Pl2Health
                            MessageBox.Show("shot you")
                            If bleeding < 10 Then
                                i = True
                                k = 0

                            End If
                        End If
                    End If
                End If
            End If
            If between500n250 >= 40 And between500n250 < 50 Then
                If pl1power >= 10 Then
                    Pl2Health = Pl2Health - IceDmg
                    P2Health.Text = Pl2Health
                    pl1power = pl1power - 10
                    P1Power.Text = pl1power
                    MessageBox.Show("Player 1 has used Ice and you have taken " & IceDmg & "damage")
                    If IP < 15 Then
                        J = True
                        Icecounter = 0
                    End If
                Else
                    If pl1power <= 10 And pl1powerpotions > 0 Then
                        pl1power = pl1power + 50
                        P1Power.Text = pl1power
                        pl1powerpotions = pl1powerpotions - 1
                        P1PowerPotions.Text = pl1powerpotions
                        MessageBox.Show("player 1 used a Powerpotion to restore 50 power I ")
                    Else
                        If pl1Money >= 25 Then
                            pl1powerpotions = pl1powerpotions + 1
                            P1PowerPotions.Text = pl1powerpotions
                            pl1Money = pl1Money - 25
                            P1money.Text = pl1Money
                            MessageBox.Show("Player 1 bought 1 power potion for 25 money")
                        Else
                            Pl2Health = Pl2Health - shootdmg
                            P2Health.Text = Pl2Health
                            MessageBox.Show("shot you")
                            If bleeding < 10 Then
                                i = True
                                k = 0
                            End If
                        End If
                    End If
                End If
            End If
            If between500n250 >= 50 And between500n250 < 70 Then
                If StealOdds > 10 And StealOdds < 20 Then
                    MessageBox.Show("Player 1 tried to steal from you and failed")
                End If
                If StealOdds > 30 And StealOdds < 40 Then
                    MessageBox.Show("Player 1 tried to steal from you and failed")
                End If
                If StealOdds > 60 And StealOdds < 90 Then
                    MessageBox.Show("Player 1 tried to steal from you and failed")
                End If
                If StealOdds <= 10 Then
                    If gernadecount2 > 0 Then
                        gernadecount = gernadecount + 1
                        NumGernades.Text = gernadecount
                        gernadecount2 = gernadecount2 - 1
                        NumGernades2.Text = gernadecount2
                        MessageBox.Show("Player 1 has stolen a gernade from you")
                    Else
                        MessageBox.Show("Player 1 tried to steal a gernade from you but you didnt have any")
                    End If
                End If
                '______________________________________________------------------------------------------''' 
                If StealOdds >= 20 And StealOdds <= 30 Then
                    If pl1potions > 0 Then
                        pl2potions = pl2potions + 1
                        Potions.Text = pl2potions
                        pl1potions = pl1potions - 1
                        P1Potions.Text = pl1potions
                        MessageBox.Show("Player 2 has stolen a potion from you")
                    Else
                        MessageBox.Show("Player 2 tried to steal a Potion from you but you didnt have any")
                    End If
                End If

                If StealOdds >= 40 And StealOdds <= 60 Then
                    If Pl2Money < Moneysteal Then
                        Pl2Money = Pl2Money + pl1Money
                        P2Money.Text = Pl2Money
                        pl1Money = 0
                        P1money.Text = pl1Money
                        MessageBox.Show("Warning Player 2 has stolen all of your money")
                    Else
                        Pl2Money = Pl2Money + Moneysteal
                        P2Money.Text = Pl2Money
                        pl1Money = pl1Money - Moneysteal
                        P1money.Text = pl1Money
                        MessageBox.Show("Player 2 has stolen " & Moneysteal & " money from you")
                    End If
                End If

                If StealOdds >= 90 Then
                    If pl1powerpotions > 0 Then
                        pl2powerpotions = pl2powerpotions + 1
                        P2PowerPotion.Text = pl2powerpotions + 1
                        pl1powerpotions = pl1powerpotions - 1
                        P1PowerPotions.Text = pl1powerpotions
                        MessageBox.Show("You have stolen 1 Power potion from player 2")
                    Else
                        MessageBox.Show("Player 2 tried to steal a power potion for you but you dont have any")
                    End If
                End If

                If extrasteal <= 2 Then
                    If gernadecount > 0 Then
                        gernadecount2 = gernadecount2 + 1
                        NumGernades2.Text = gernadecount2
                        gernadecount = gernadecount - 1
                        NumGernades.Text = gernadecount
                        MessageBox.Show("Player 2 has stolen a extra gernade from you")
                    Else
                        MessageBox.Show("Player 2 tried to steal a extra gernade from you but you didnt have any")
                    End If
                End If
                If extrasteal >= 10 And extrasteal <= 12 Then
                    If pl1potions > 0 Then
                        pl2potions = pl2potions + 1
                        Potions.Text = pl2potions
                        pl1potions = pl1potions - 1
                        P1Potions.Text = pl1potions
                        MessageBox.Show("Player 2 has stolen a potion from you")
                    Else
                        MessageBox.Show("Player 2 tried to steal a gernade from you but you didnt have any")
                    End If
                End If
                If extrasteal >= 25 And extrasteal <= 27 Then
                    If Pl2Money < Moneysteal Then
                        pl1Money = pl1Money + Pl2Money
                        P1money.Text = pl1Money
                        Pl2Money = 0
                        P2Money.Text = Pl2Money
                        MessageBox.Show("you have stolen all of player 2's money")
                    Else
                        pl1Money = pl1Money + Moneysteal
                        P1money.Text = pl1Money
                        Pl2Money = Pl2Money - Moneysteal
                        P2Money.Text = Pl2Money
                        MessageBox.Show("You Have stolen " & Moneysteal & " money extra from player 2")
                    End If
                End If
                If extrasteal > 98 Then
                    If pl1powerpotions > 0 Then
                        pl2powerpotions = pl2powerpotions + 1
                        P2PowerPotion.Text = pl2powerpotions + 1
                        pl1powerpotions = pl1powerpotions - 1
                        P1PowerPotions.Text = pl1powerpotions
                        MessageBox.Show("You have stolen 1 Power potion from player 2")
                    Else
                        MessageBox.Show("Player 2 tried to steal a power potion for you but you dont have any")
                    End If
                End If
            End If
            If between500n250 >= 70 Then
                If pl2potions >= 0 Then


                    Pl2Health = Pl2Health + Healing
                    pl2potions = pl2potions - 1
                    Potions.Text = pl2potions
                    P2Health.Text = Pl2Health
                    MessageBox.Show("Player 2 used a potion to heal " & Healing & " Health")
                    If healingeffect < 100 Then
                        heal2 = True
                        healcounter2 = 0
                    End If
                Else
                    If pl2potions <= 5 And Pl2Money > 25 Then
                        pl2potions = pl2potions + 1
                        Potions.Text = pl2potions
                        Pl2Money = Pl2Money - 25
                        MessageBox.Show("Player 2 bought a potion for 25 money")
                    Else
                        Pl1Health = Pl1Health - shootdmg
                        P1health.Text = Pl1Health
                        MessageBox.Show("shot you")
                        If bleeding < 10 Then
                            y = True
                            c = 0
                        End If
                    End If
                End If
            End If

        End If

        If Pl2Health <= 250 Then
            If below250 < 27 Then
                Pl1Health = Pl1Health - shootdmg
                P1health.Text = Pl1Health
                MessageBox.Show("Player 2 shot you for " & shootdmg & " Damage")
                If bleeding < 10 Then
                    y = True
                    c = 0
                End If
            End If


            If below250 >= 27 And below250 < 35 Then
                If gernadecount2 < 0 Then gernadecount2 = 0

                If gernadecount2 > 0 Then
                    gernadecount2 = gernadecount2 - 1
                    Pl1Health = Pl1Health - gernadedmg
                    P1health.Text = Pl1Health
                    NumGernades2.Text = gernadecount2
                    MessageBox.Show("Player2 has taken " & gernadedmg & "Damage and you have " & gernadecount2 & " gernades left")
                    If wellplaced < 5 Then
                        Pl1Health = Pl1Health - 50
                        P1health.Text = Pl1Health
                        MessageBox.Show("well placed gernade player 1 takes 50 damage")
                    End If
                Else
                    If gernadecount2 = 0 Then
                        If Pl2Money >= 50 And gernadecount2 = 0 Then
                            gernadecount2 = gernadecount2 + 5
                            NumGernades2.Text = gernadecount2
                            Pl2Money = Pl2Money - 50
                            P2Money.Text = Pl2Money
                            MessageBox.Show("player2 bought 5 gernades for 50 money")
                        Else
                            Pl1Health = Pl1Health - shootdmg
                            P1health.Text = Pl1Health
                            MessageBox.Show("shot you")
                            If bleeding < 10 Then
                                y = True
                                c = 0
                            End If
                        End If
                    End If

                End If
            End If
            If below250 >= 35 And below250 < 40 Then
                If Pl2power >= 25 Then
                    Pl1Health = Pl1Health - FireDmg
                    P1health.Text = Pl1Health
                    Pl2power = Pl2power - 25
                    P2Power.Text = Pl2power
                    MessageBox.Show("Cost 10 Power and Player 1 has taken " & FireDmg & " Damage")
                    If fireEffect <= 33 Then
                        B = True
                        burncounter = 0
                    End If
                Else
                    If Pl2power <= 25 And pl2powerpotions > 0 Then
                        Pl2power = Pl2power + 50
                        P2Power.Text = Pl2power
                        pl2powerpotions = pl2powerpotions - 1
                        P2PowerPotion.Text = pl2powerpotions
                        MessageBox.Show("player 2 used a Powerpotion to restore 50 power f ")
                    Else
                        If Pl2Money >= 25 Then
                            pl2powerpotions = pl2powerpotions + 1
                            P2PowerPotion.Text = pl2powerpotions
                            Pl2Money = Pl2Money - 25
                            P2Money.Text = Pl2Money
                            MessageBox.Show("Player 2 bought 1 power potion for 25 money")
                        Else
                            Pl1Health = Pl1Health - shootdmg
                            P1health.Text = Pl1Health
                            MessageBox.Show("shot you")
                            If bleeding < 10 Then
                                y = True
                                c = 0

                            End If
                        End If
                    End If
                End If
            End If
            If below250 >= 40 And below250 < 55 Then
                If Pl2power >= 10 Then
                    Pl1Health = Pl1Health - IceDmg
                    P1health.Text = Pl1Health
                    Pl2power = Pl2power - 10
                    P2Power.Text = Pl2power
                    MessageBox.Show("Player 2 has used Ice and you have taken " & IceDmg & "damage")
                    If IP < 15 Then
                        ice2 = True
                        icecounter2 = 0
                    End If
                Else
                    If Pl2power <= 10 And pl2powerpotions > 0 Then
                        Pl2power = Pl2power + 50
                        P2Power.Text = Pl2power
                        pl2powerpotions = pl2powerpotions - 1
                        P2PowerPotion.Text = pl2powerpotions
                        MessageBox.Show("player 2 used a Powerpotion to restore 50 power I ")
                    Else
                        If Pl2Money >= 25 Then
                            pl2powerpotions = pl2powerpotions + 1
                            P2PowerPotion.Text = pl2powerpotions
                            Pl2Money = Pl2Money - 25
                            P2Money.Text = Pl2Money
                            MessageBox.Show("Player 2 bought 1 power potion for 25 money")
                        Else
                            Pl1Health = Pl1Health - shootdmg
                            P1health.Text = Pl1Health
                            MessageBox.Show("shot you")
                            If bleeding < 10 Then
                                y = True
                                c = 0
                            End If
                        End If
                    End If
                End If
            End If
            If below250 >= 65 And below250 < 95 Then
                If StealOdds > 10 And StealOdds < 20 Then
                    MessageBox.Show("Player 2 tried to steal from you and failed")
                End If
                If StealOdds > 30 And StealOdds < 40 Then
                    MessageBox.Show("Player 2 tried to steal from you and failed")
                End If
                If StealOdds > 60 And StealOdds < 90 Then
                    MessageBox.Show("Player 2 tried to steal from you and failed")
                End If
                If StealOdds <= 10 Then
                    If gernadecount > 0 Then
                        gernadecount2 = gernadecount2 + 1
                        NumGernades2.Text = gernadecount2
                        gernadecount = gernadecount - 1
                        NumGernades.Text = gernadecount
                        MessageBox.Show("Player 2 has stolen a gernade from you")
                    Else
                        MessageBox.Show("Player 2 tried to steal a gernade from you but you didnt have any")
                    End If
                End If

                If StealOdds >= 55 And StealOdds <= 60 Then
                    If pl1potions > 0 Then
                        pl2potions = pl2potions + 1
                        Potions.Text = pl2potions
                        pl1potions = pl1potions - 1
                        P1Potions.Text = pl1potions
                        MessageBox.Show("Player 2 has stolen a potion from you")
                    Else
                        MessageBox.Show("Player 2 tried to steal a Potion from you but you didnt have any")
                    End If
                End If

                If StealOdds >= 40 And StealOdds <= 60 Then
                    If Pl2Money < Moneysteal Then
                        Pl2Money = Pl2Money + pl1Money
                        P2Money.Text = Pl2Money
                        pl1Money = 0
                        P1money.Text = pl1Money
                        MessageBox.Show("Warning Player 2 has stolen all of your money")
                    Else
                        Pl2Money = Pl2Money + Moneysteal
                        P2Money.Text = Pl2Money
                        pl1Money = pl1Money - Moneysteal
                        P1money.Text = pl1Money
                        MessageBox.Show("Player 2 has stolen " & Moneysteal & " money from you")
                    End If
                End If

                If StealOdds >= 90 Then
                    If pl1powerpotions > 0 Then
                        pl2powerpotions = pl2powerpotions + 1
                        P2PowerPotion.Text = pl2powerpotions + 1
                        pl1powerpotions = pl1powerpotions - 1
                        P1PowerPotions.Text = pl1powerpotions
                        MessageBox.Show("You have stolen 1 Power potion from player 2")
                    Else
                        MessageBox.Show("Player 2 tried to steal a power potion for you but you dont have any")
                    End If
                End If

                If extrasteal <= 2 Then
                    If gernadecount > 0 Then
                        gernadecount2 = gernadecount2 + 1
                        NumGernades2.Text = gernadecount2
                        gernadecount = gernadecount - 1
                        NumGernades.Text = gernadecount
                        MessageBox.Show("Player 2 has stolen a extra gernade from you")
                    Else
                        MessageBox.Show("Player 2 tried to steal a extra gernade from you but you didnt have any")
                    End If
                End If
                If extrasteal >= 10 And extrasteal <= 12 Then
                    If pl1potions > 0 Then
                        pl2potions = pl2potions + 1
                        Potions.Text = pl2potions
                        pl1potions = pl1potions - 1
                        P1Potions.Text = pl1potions
                        MessageBox.Show("Player 2 has stolen a potion from you")
                    Else
                        MessageBox.Show("Player 2 tried to steal a gernade from you but you didnt have any")
                    End If
                End If
                If extrasteal >= 25 And extrasteal <= 27 Then
                    If Pl2Money < Moneysteal Then
                        pl1Money = pl1Money + Pl2Money
                        P1money.Text = pl1Money
                        Pl2Money = 0
                        P2Money.Text = Pl2Money
                        MessageBox.Show("you have stolen all of player 2's money")
                    Else
                        pl1Money = pl1Money + Moneysteal
                        P1money.Text = pl1Money
                        Pl2Money = Pl2Money - Moneysteal
                        P2Money.Text = Pl2Money
                        MessageBox.Show("You Have stolen " & Moneysteal & " money extra from player 2")
                    End If
                End If
                If extrasteal > 98 Then
                    If pl1powerpotions > 0 Then
                        pl2powerpotions = pl2powerpotions + 1
                        P2PowerPotion.Text = pl2powerpotions + 1
                        pl1powerpotions = pl1powerpotions - 1
                        P1PowerPotions.Text = pl1powerpotions
                        MessageBox.Show("You have stolen 1 Power potion from player 2")
                    Else
                        MessageBox.Show("Player 2 tried to steal a power potion for you but you dont have any")
                    End If
                End If
            End If
            If below250 >= 60 Then
                If pl2potions >= 0 Then


                    Pl2Health = Pl2Health + Healing
                    pl2potions = pl2potions - 1
                    Potions.Text = pl2potions
                    P2Health.Text = Pl2Health
                    MessageBox.Show("Player 2 used a potion to heal " & Healing & " Health")
                    If healingeffect < 100 Then
                        heal2 = True
                        healcounter2 = 0
                    End If
                Else
                    If pl2potions <= 5 And Pl2Money > 25 Then
                        pl2potions = pl2potions + 1
                        Potions.Text = pl2potions
                        Pl2Money = Pl2Money - 25
                        MessageBox.Show("Player 2 bought a potion for 25 money")
                    Else
                        Pl1Health = Pl1Health - shootdmg
                        P1health.Text = Pl1Health
                        MessageBox.Show("shot you")
                        If bleeding < 10 Then
                            y = True
                            c = 0
                        End If
                    End If
                End If
            End If

        End If




        If heal2 = True Then
            Pl2Health = Pl2Health + specialheal
            P2Health.Text = Pl2Health
            healcounter2 += 1
            If healcounter2 = 5 Then heal2 = False
            MessageBox.Show("Player 2 has had a regen for " & healcounter2 & " Turns an heals " & specialheal & " health")
        End If

        If ice2 = True Then
            pl1power = pl1power - Iceeffect
            P1Power.Text = pl1power
            Icecounter += 1
            MessageBox.Show("Player 2 has been frost bitten for " & Icecounter & " turns and has lost " & Iceeffect & " power")
            If icecounter2 = 7 Then J = False
        End If

        If B = True And burncounter <= 10 Then
            Pl1Health = Pl1Health - Burndmg
            P1health.Text = Pl1Health
            burncounter = burncounter + 1
            MessageBox.Show("Player 2 has been burnt for " & burncounter & " Turns and has taken " & Burndmg & " damage")
            If burncounter = 10 Then B = False
        End If

        If y = True And c < 5 Then
            Pl1Health = Pl1Health - 5
            c = c + 1
            P1health.Text = Pl1Health
            MessageBox.Show("Player 1 has been bleeding for " & c & " Turns and Loses 5 health")
            If c = 5 Then y = False
        End If
        Pl2Money = Pl2Money + 10
        P2Money.Text = Pl2Money
    End Sub

    Private Sub Label10_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label10.Click

    End Sub
End Class



Is This A Good Question/Topic? 2
  • +

Replies To: LOL this thing was a nightmare

#2 e_i_pi  Icon User is offline

  • = -1
  • member icon

Reputation: 795
  • View blog
  • Posts: 1,681
  • Joined: 30-January 09

Re: LOL this thing was a nightmare

Posted 19 April 2013 - 06:21 AM

*
POPULAR

Ermahgerd! Gernades!
Was This Post Helpful? 5
  • +
  • -

#3 creativecoding  Icon User is offline

  • Hash != Encryption
  • member icon


Reputation: 926
  • View blog
  • Posts: 3,205
  • Joined: 19-January 10

Re: LOL this thing was a nightmare

Posted 03 May 2013 - 02:17 AM

Quote

Somewhere in here there is a bug that cause player 1 to act for player2. i never found it.


I don't blame you.

The code however, I do.
Was This Post Helpful? 0
  • +
  • -

#4 Maplestory  Icon User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 16
  • Joined: 26-June 13

Re: LOL this thing was a nightmare

Posted 18 July 2013 - 05:24 PM

I read like 70 lines of code. Then I saw it was 3000 lines long so I was like....Fk that XD
Was This Post Helpful? 2
  • +
  • -

#5 MentalFloss  Icon User is offline

  • "ADDICTED"[2:5]
  • member icon

Reputation: 526
  • View blog
  • Posts: 1,397
  • Joined: 02-September 09

Re: LOL this thing was a nightmare

Posted 05 October 2013 - 03:02 PM

I'm surprised the dic editor could choke that down and process it.
Was This Post Helpful? 0
  • +
  • -

#6 AdamSpeight2008  Icon User is offline

  • MrCupOfT
  • member icon


Reputation: 2262
  • View blog
  • Posts: 9,466
  • Joined: 29-May 08

Re: LOL this thing was a nightmare

Posted 06 October 2013 - 12:58 AM

When you started to write similar looking code wouldn't that signal to you? Here is an opportunity to write a function?
It over complex because game logic and GUI logic are intermingled.

Theres a lot of scope in that code to drastically reduce the line counts.
If you use classes and methods

You have two players that have the same properties, then to me it suggests a player class should defined.
Imports System.Runtime.CompilerServices 
Imports WindowsApplication6.Player.Stat 
Public Class Player
  Implements System.ComponentModel.INotifyPropertyChanged 

  Public Enum Stat As Integer
    Grenades
    Health
    Power
    Money
    Potions
    PowerPotions
    Heal
    HealCounter
    Ice
    IceCounter
    Burn
    BurnCounter
    Bleeding
    BleedCounter
  End Enum

  Private _Name As String
  Private _Stats As  Dictionary(Of Stat, Integer)

  Public Sub New(Name As String)
    _Name = Name
    _Stats = New Dictionary(Of Stat,Integer) From {{Stat.Grenades, 5},
                                                   {Stat.Health,1000},
                                                   {Stat.Power , 250},
                                                   {Stat.Money,  500},
                                                   {Stat.Potions, 10},
                                                   {Stat.PowerPotions,10},
                                                   {Stat.Heal,1},
                                                   {Stat.HealCounter,0},
                                                   {Stat.Ice,1},
                                                   {Stat.IceCounter,0},
                                                   {Stat.Burn,1},
                                                   {Stat.BurnCounter,0},
                                                   {Stat.Bleeding,1},
                                                   {Stat.BleedCounter,0}
                                                  }
  End Sub
 
 Public ReadOnly Property Name As String
    Get
      Return _Name 
    End Get
  End Property

  Public Default Property Items(ByVal Item As stat) As Integer
    Get
      Dim value As Integer
      If _Stats.TryGetValue(Item,value) Then Return value
      Throw New KeyNotFoundException(Item)
    End Get
    Set(value As Integer)
            Dim oldvalue As Integer
      If _Stats.tryGetValue(Item,oldvalue) =False Then Throw New KeyNotFoundException(Item)
      _Stats(Item)=value 
      RaiseEvent PropertyChanged(Me,New System.ComponentModel.PropertyChangedEventArgs(Item.ToString))
    End Set
  End Property

  Public Function Has(Stat As Player.Stat) As Boolean
    Return Me(stat)>0
  End Function

  Public Event PropertyChanged(sender As Object, e As System.ComponentModel.PropertyChangedEventArgs) Implements System.ComponentModel.INotifyPropertyChanged.PropertyChanged
End Class

<HideModuleName>
Public Module PlayerExts
  <Extension>  Public Sub ThrowGranade(Who As Player, Damage As Integer, At As Player, WellPlaced As Boolean)
    Who(Player.Stat.Grenades) -= 1
    At(Player.Stat.Health) -= (Damage + If(WellPlaced, 50, 0))
    MessageBox.Show(String.Format("{0} has taken {1} Damage and you have {2} gernades left",At.Name,Damage,Who(Grenades)))
  End Sub

 <Extension> Public Sub Buys(who As Player, item As Player.Stat)
    Dim cost = 0,amount =1
    Select Case item
      Case Potions,PowerPotions :  cost = 25
      Case Grenades             :  cost = 50 :  amount = 5
      Case Else
        Exit Sub
    End Select
    who(item) += amount
    who(Money) -= cost
 MessageBox.Show(String.Format("{0} bought {1} for {2} money ",who.Name,item.ToString,cost ))
  End Sub

 <Extension> Public Sub Shots( Shooter As Player,Who As Player,od As OddsAndDamage)
    Who(Health) -= od.ShootDamage
        MessageBox.Show(String.Format("{0} shot you for {1} Damage",Shooter.Name,od.ShootDamage ))
    Who.StartBleeding(od)
  End Sub

  <Extension>    Public Sub IceDamage(Attacker As Player,od As OddsAndDamage,  Defender As Player)
    If Attacker(Power) >= 10 Then
      Defender(Health) -= od.IceDmg
      Attacker(Power) -= 10
      MessageBox.Show("Player 1 has used Ice and you have taken " & od.IceDmg & "damage")
      If od.IP < 15 Then Defender.StartIcing 
    ElseIf Attacker(Power) < 10 And Attacker.Has(PowerPotions) Then
      Attacker.Uses( PowerPotions,od)
    ElseIf Attacker(Money) >= 25 Then
      Buys(Attacker, PowerPotions)
    Else
      Defender.Shots(Attacker,od)
    End If
  End Sub

  <Extension> Public Sub Uses(Who As Player, Item As Player.Stat,od As OddsAndDamage)
    Dim effect=0
    Dim does =""
    Dim what =""
    Dim effects As Player.Stat
    Select Case Item
      Case Potions
        effects= Player.Stat.Health
        effect = od.Healing 
        does = "heals"
        what = "health"
      Case PowerPotions
        effects = Player.Stat.Power 
        effect = 50 
       does="restores"
        what="power"
      Case Else
        Exit Sub
    End Select
    Who(effects) += Effect
    Who(Item) -= 1
    MessageBox.Show(String.Format("{0} used a {1} to {3} {2} {4}",Who.Name,Item.ToString,Effect,does,What ))

  End Sub

  <Extension>
  Public Sub StartBleeding(P As Player, od As OddsAndDamage)
    If od.Bleeding < 10 Then
      P(Bleeding)=1
      P(BleedCounter)=0
    End If
  End Sub

  <Extension>
  Public Sub StartBurning(P As Player)
    P(Burn)=1
    P(BurnCounter)=0
  End Sub

  <Extension>
  Public Sub StartIcing(P As Player)
    P(Ice)=1
    P(IceCounter)=0
  End Sub

 <Extension> Public Sub StartHealing(P As Player)
    P(Heal)=1
    P(HealCounter)=0
  End Sub

End Module


Another class to hold the generated odd and damages.
Public Class OddsAndDamage
  Private Shared RNG As New Random
  Private Shared Function RND_0To100() As Integer
    Return RNG.Next(0, 101)
  End Function
  Public ReadOnly above750 As Integer = RND_0To100
  Public ReadOnly Between750n500 As Integer = RND_0To100
  Public ReadOnly between500n250 As Integer = RND_0To100
  Public ReadOnly below250 As Integer = RND_0To100
  Public ReadOnly ShootDamage As Integer = RNG.Next(20, 41)
  Public ReadOnly Bleeding As Integer = RND_0To100
  Public ReadOnly BleedDamage As Integer = 5
  Public ReadOnly GrenadeDamage As Integer = RNG.Next(0, 75)
  Public ReadOnly WellPlaced As Integer = RND_0To100
  Public ReadOnly FireDmg As Integer = RNG.Next(1, 26)
  Public ReadOnly FireEffect As Integer = RND_0To100
  Public ReadOnly BurnDamage As Integer = RNG.Next(5, 26)
  Public ReadOnly IceDmg As Integer = RNG.Next(20, 51)
  Public ReadOnly IP As Integer = RND_0To100 
  Public ReadOnly IceEffect As Integer = RNG.Next(0, 4)
  Public ReadOnly StealOdds As Integer = RND_0To100
  Public ReadOnly MoneySteal As Integer = RNG.Next(1, 51)
  Public ReadOnly ExtraSteal As Integer = RND_0To100
  Public ReadOnly PotionsBuy As Integer
  Public ReadOnly Healing As Integer = RND_0To100
  Public ReadOnly HealingEffect As Integer = RND_0To100
  Public ReadOnly SpecialHeal As Integer = Rng.Next(1,21)

  Public Sub New(potions As Integer)
    PotionsBuy = RNG.Next(0, (potions \ 2))
  End Sub

End Class



I've got part of it down to ~600 LoC, I think the rest of the code was copy and paste.
Option Strict On
Imports WindowsApplication6.Player.Stat
Imports WindowsApplication6.Exts

Public Class Form1
  Dim WithEvents pl1 As Player
  Dim WithEvents pl2 As Player

  Dim CurrentPlayer As Player

  Private Sub Button1_Click_2(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    ' SIM PLAYER 1
    DoStuff(pl1, pl2)
  End Sub

  Public Sub SpecialHeal(od As OddsAndDamage, P As Player)
    P(Health) += od.specialheal
    P(HealCounter) += 1
    If P(HealCounter) = 5 Then P(Heal) = 0
      MessageBox.Show(String.Format("{0} has had a regen for {1} Turns an heals {2} health",P.Name,P(HealCounter),od.specialheal))
  End Sub

  Public Sub IceEffect(od As OddsAndDamage, P As Player)
    P(Power) -= od.IceEffect
    P(IceCounter) += 1
      MessageBox.Show(String.Format("{0} has been frost bitten for {1} turns and has lost {2} power",P.Name,P(IceCounter),od.Iceeffect))
    If P(IceCounter) = 7 Then P(Ice) = 1
  End Sub

  Public Sub BurnEffect(Od As OddsAndDamage, P As Player)
    P(Health) -= Od.BurnDamage
    P(BurnCounter) += 1
    MessageBox.Show(String.Format("{0} has been burnt for {1} Turns and has taken {2} damage", P.Name, P(BurnCounter), Od.BurnDamage))
    If P( BurnCounter) = 10 Then P(Burn) = 0
  End Sub

  Public Sub BleedEffect(od As OddsAndDamage, P As Player)
    P(Health) -= od.BleedDamage
    P(BleedCounter) += 1
      MessageBox.Show(String.Format("{0} has been bleeding for {1} Turns and Loses {2} health",P.Name,P(BleedCounter),od.BleedDamage))
    If P(BleedCounter) = 5 Then P(Bleeding) = 0
  End Sub

  Public Sub DoStuff(Attacker As Player, Defender As Player)
    Dim od As New OddsAndDamage(Defender(Potions))
    Select Case Defender(Health)
      Case Is >= 750 : Above750Stuff(od, Attacker, Defender)
      Case 500 To 749 : Between500And750Stuff(od,Attacker,Defender)
      Case 250 To 499 : Between250And500Stuff(od,Attacker,Defender) 
      Case Is < 250 : Below250Stuff(od, Attacker, Defender)
    End Select
    If Defender(Heal) = 1 Then SpecialHeal(od,Defender)
    If Defender(Ice) = 1 Then IceEffect(od,Defender)
    If Defender(Burn) = 1 AndAlso Defender(BurnCounter) <= 10 Then
    If Attacker(Bleeding) = 1 AndAlso Attacker(BleedCounter) <= 5 Then BleedEffect(od, Attacker)
      Defender(Money) += 10
    End If
  End Sub

  Public Sub TryStealing(By As Player, Who As Player, Item As Player.Stat, Optional Amount As Integer = 1, Optional extra As Boolean = False)
    Dim succesful As Boolean = True
    Select Case Item
      Case Grenades, PowerPotions : succesful = Who.Has(Item)
      Case Money
        succesful = Who.Has(Money)
        If succesful AndAlso (Who(Money) < Amount) Then Amount = Who(Money)
      Case Else
        Exit Sub
    End Select
    If succesful Then
      By(Item) += Amount
      Who(Item) -= Amount
    End If
    MessageBox.Show(
      String.Format(
        If(succesful, "{0} has stolen {3}{2} {1} from you",
                     "{0} tried to steal {3}{2},{1} from you but you didnt have any"), By.Name, Item.ToString, Amount, If(extra, "an extra ", "")))
  End Sub

  Public Sub StealingStuff(od As OddsAndDamage, Attacker As Player, Defender As Player,Optional Extra As Integer =0)
    Select Case od.StealOdds
      Case 11 To 19, 31 To 39, 61 To 89 : MessageBox.Show(String.Format("{0} tried to steal from you and failed",Attacker.Name ))
      Case Is<=10   : TryStealing(Attacker, Defender, Grenades)
      Case 20 To 30 : TryStealing(Attacker, Defender, Potions)
      Case 40 To 60 : TryStealing(Attacker, Defender, Money, od.MoneySteal)
      Case Is>=90   : TryStealing(Attacker, Defender, PowerPotions)
    End Select
    ExtraStealing(od,Attacker,Defender)
  End Sub

  Public Sub ExtraStealing(od As OddsAndDamage, Attacker As Player, Defender As Player)
    Select Case od.ExtraSteal
      Case Is <=10  : TryStealing(Attacker, Defender, Grenades, , True)
      Case 10 To 12 : TryStealing(Attacker, Defender, Potions, , True)
      Case 25 To 27 : TryStealing(Attacker, Defender, Money, od.MoneySteal, True)
      Case Is>98    : TryStealing(Attacker, Defender, PowerPotions, , True)
    End Select
  End Sub

  Public Sub HealthStuff(Od As OddsAndDamage, Attacker As Player, Defender As Player)
    Select Case Od.Between750n500
      Case Is<50 :  Defender.Shots(Attacker, Od)
      Case 50 To 54
        If Attacker.Has(Grenades) Then
          Attacker.ThrowGranade(Od.GrenadeDamage, Defender, Od.WellPlaced < 5)
        ElseIf Attacker(Money) >= 50 Then
          Attacker.Buys(Grenades)
        Else
          Defender.Shots(Attacker, Od)
        End If
      Case 55 To 59  
        If Attacker(Power) >= 25 Then
           FireDamage(Od,Attacker,Defender)
        ElseIf Attacker(Power)<=25 AndAlso Attacker.Has(PowerPotions) Then
          If Attacker(Money)>=25 then
            Attacker.Buys(PowerPotions)
          else
            Defender.Shots(Attacker,Od)
          End If
        End If
    End Select
  End Sub

  Public Sub FireDamage(od As OddsAndDamage, Attacker As Player, Defender As Player)
    If Attacker(Power) >= 25 Then
      Defender(Health) -= od.FireDmg
      Attacker(Power) -= 25
      MessageBox.Show(String.Format("Cost {0} Power and {1} has take {0}, Damage", (25).ToString, Defender.Name, od.FireDmg))
      If od.FireEffect <= 33 Then Defender.StartBurning()
    ElseIf Attacker(Power) <= 25 AndAlso Attacker.Has(PowerPotions) Then
      Attacker.Uses(PowerPotions,od)
    ElseIf Attacker(Money) >= 25 Then
      Attacker.Buys(PowerPotions)
    Else
      Defender.Shots(Attacker, od)
    End If
  End Sub

  Public Sub Above750Stuff(Od As OddsAndDamage, Attacker As Player, Defender As Player)
    If Od.above750 < 40 Then
      Defender.Shots(Attacker, Od)
    ElseIf Od.above750.IsBetween(40, 60) Then
      If Attacker.Has(Grenades) Then
        Attacker.ThrowGranade(Od.GrenadeDamage, Defender, Od.WellPlaced < 5)
      ElseIf Attacker(Money) >= 50 Then
        Attacker.Buys(Grenades)
      Else
        Defender.Shots(Attacker, Od)
      End If
    ElseIf Od.above750.IsBetween(60, 75) Then
      If Defender(Power) >= 25 Then FireDamage(Od, Attacker, Defender)
      If Od.fireEffect <= 33 Then Defender.StartBurning()
    ElseIf Attacker(Power) <= 25 Then
      If Attacker.Has(PowerPotions) Then
        Attacker.Uses(PowerPotions,Od)
      ElseIf Attacker(Money) >= 25 Then
        Attacker.Buys(PowerPotions)
      Else
        Defender.Shots(Attacker, Od)
      End If
    ElseIf Od.above750.IsBetween(75, 90) Then
      If Attacker(Power) >= 10 Then IceDamage(Attacker, Od, Defender)
    ElseIf Attacker(Power) <= 10 Then
      If Attacker.Has(PowerPotions) Then
        Attacker.Uses(PowerPotions,od)
      Else
        If Attacker(Money) >= 25 Then
          Attacker.Buys(PowerPotions)
        Else
          Defender.Shots(Attacker,  Od)
        End If
      End If
    ElseIf Od.above750.IsBetween(90, 95) Then
      StealingStuff(Od, Attacker, Defender)
    ElseIf Od.above750 >= 95 Then
      If Attacker(Potions) >= 5 Then
        Attacker.Uses(Potions,od)
        If Od.healingeffect < 30 Then Attacker.StartHealing()
      ElseIf Attacker(Potions) <= 5 And Attacker(Money) >= 25 Then
        Attacker.Buys(Potions)
      Else
        Defender.Shots(Attacker, Od)
      End If
    End If
  End Sub

  Public Sub Between500And750Stuff(Od As OddsAndDamage, Attacker As Player, Defender As Player)
    HealthStuff(Od, Attacker, Defender)
    If Od.Between750n500.IsBetween(55, 60) Then
      FireDamage(Od, Attacker, Defender)
    ElseIf Od.Between750n500.IsBetween(60, 65) Then
      Attacker.IceDamage(Od, Defender)
    ElseIf Od.Between750n500.IsBetween(65, 95) Then
      StealingStuff(Od, Attacker, Defender)
    ElseIf od.Between750n500  >= 95 Then
      If Attacker(Potions) >= 5 Then
        Attacker.Uses(Potions,od)
        If od.healingeffect < 30 Then Attacker.StartHealing()
      ElseIf Attacker(Potions) <= 5 And Defender(Money) > 25 Then
        Attacker.Buys(Potions)
      Else
        Defender.Shots(Attacker, Od)
      End If
    End If
  End Sub

  Public Sub Between250And500Stuff(od As OddsAndDamage, Attacker As Player, Defender As Player)
    If od.between500n250 < 15 Then
      Attacker.Shots(Defender, od)
    ElseIf od.between500n250.IsBetween(15, 25) Then
      If Attacker( Grenades) > 0 Then
        Attacker.ThrowGranade(od.GrenadeDamage, Defender, od.WellPlaced < 5)
      Else
        If Attacker(Money) >= 50 Then
          Attacker.Buys(Grenades)
        Else
          Attacker.Shots(Defender, od)
        End If
      End If
    ElseIf od.between500n250.IsBetween(25, 40) Then
      If Attacker(Power) >= 25 Then
        FireDamage(od, Attacker, Defender)
      ElseIf Attacker(Power) <= 25 And Attacker.Has(PowerPotions) Then
        Attacker.Uses(PowerPotions,od)
      ElseIf Attacker(Money) >= 25 Then
        Attacker.Buys(PowerPotions)
      Else
        Attacker.Shots(Defender, od)
      End If
    ElseIf od.between500n250.IsBetween(40, 50) Then
      If Attacker(Power) >= 10 Then
        Defender. IceDamage(od, Attacker)
      ElseIf Attacker(Power) <= 10 And Attacker.Has(PowerPotions) Then
        If Attacker(Power) <= 10 And Attacker.Has(PowerPotions) Then
          Attacker.Uses(PowerPotions,od)
        ElseIf Attacker(Money) >= 25 Then
          Attacker.Buys(PowerPotions)
        Else
          Attacker.Shots(Defender, od)
        End If
      End If
    ElseIf od.between500n250.IsBetween(50, 70) Then
      StealingStuff(od, Attacker, Defender)
    ElseIf od.between500n250 >= 70 Then
      If Attacker.Has(Potions) Then
        Attacker.Uses(Potions, od)
        If od.HealingEffect < 100 Then Attacker.StartHealing()
      Elseif Defender(potions)<=5 andalso Defender(Money)>=25 Then
        Defender.Buys(Potions)
      Else
        Defender.Shots(Attacker, od)
      End If
    End If
  End Sub

  Public Sub Below250Stuff(od As OddsAndDamage, Attacker As Player, Defender As Player)
    If od.below250 < 27 Then
      Defender.Shots(Attacker, od)
    ElseIf od.below250.IsBetween(27, 35) Then
      If Defender.Has(Grenades) Then
        Defender.ThrowGranade(od.GrenadeDamage, Attacker, od.WellPlaced < 5)
      ElseIf Defender(Money) >= 50 Then
        Defender.Buys(Grenades)
      Else
        Defender.Shots(Attacker, od)
      End If
    ElseIf od.below250.IsBetween(35, 40) Then
      If Defender(Power) >= 25 Then
        FireDamage(od, Attacker, Defender)
      ElseIf Defender(Power) <= 25 AndAlso Defender.Has(PowerPotions) Then
        Defender.Uses( PowerPotions,od)
      ElseIf Defender(Money) >= 25 Then
        Defender.Buys(PowerPotions)
      Else
        Defender.Shots(Attacker, od)
      End If
    ElseIf od.below250.IsBetween(40, 55) Then
      If Defender(Power) >= 10 Then
        Attacker.IceDamage(od, Defender)
      ElseIf Defender(Power) <= 10 AndAlso Defender.Has(PowerPotions) Then
        Defender.Uses(PowerPotions, od)
      ElseIf Defender(Money) >= 25 Then
        Defender.Buys(PowerPotions)
      Else
        Defender.Shots(Attacker, od)
      End If
    ElseIf od.below250.IsBetween(65, 95) Then
      StealingStuff(od, Attacker, Defender)
    ElseIf od.below250 >= 60 Then
      If Defender.Has(Potions) Then
        Defender.Uses(Potions, od)
        If od.healingeffect < 100 Then Defender.StartHealing()
      ElseIf Defender(Potions) <= 5 AndAlso Defender(Money) > 25 Then
        Defender.Buys(Potions)
      Else
        Defender.Shots(Attacker, od)
      End If
    End If
  End Sub

End Class



It be a good exercise in refactoring.

This post has been edited by AdamSpeight2008: 06 October 2013 - 01:29 AM

Was This Post Helpful? 0
  • +
  • -

#7 jon.kiparsky  Icon User is online

  • Pancakes!
  • member icon


Reputation: 7746
  • View blog
  • Posts: 13,103
  • Joined: 19-March 11

Re: LOL this thing was a nightmare

Posted 09 October 2013 - 10:38 PM

You forgot the first rule of refactoring: get it out of VB. :)
Was This Post Helpful? 3
  • +
  • -

#8 Geckoscraps  Icon User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 21
  • Joined: 27-February 14

Re: LOL this thing was a nightmare

Posted 13 March 2014 - 09:37 PM

I must say... wtf did I just read...? If I had done that and had seen the work a delete button would be imminent, followed by a trashing of my hard drive so no one would see it.
Was This Post Helpful? 0
  • +
  • -

#9 SlonCHL  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 19
  • Joined: 26-May 14

Re: LOL this thing was a nightmare

Posted 11 June 2014 - 07:33 AM

A game with Visual Basic? How do you even do it lol. Can you tell me a bit please? I always anted to make a game but no idea how
Was This Post Helpful? 0
  • +
  • -

#10 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 9204
  • View blog
  • Posts: 34,581
  • Joined: 12-June 08

Re: LOL this thing was a nightmare

Posted 11 June 2014 - 07:37 AM

@slon - There a whole mess of different ways you can do that.

Example:
http://www.dreaminco...-basics-part-1/
Was This Post Helpful? 0
  • +
  • -

#11 DarenR  Icon User is offline

  • D.I.C Lover

Reputation: 462
  • View blog
  • Posts: 3,166
  • Joined: 12-January 10

Re: LOL this thing was a nightmare

Posted 11 June 2014 - 07:44 AM

i got tired after line 2 of all those declared ints......you need to learn classes
Was This Post Helpful? 0
  • +
  • -

#12 SlonCHL  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 19
  • Joined: 26-May 14

Re: LOL this thing was a nightmare

Posted 14 June 2014 - 12:20 AM

View Postmodi123_1, on 11 June 2014 - 07:37 AM, said:

@slon - There a whole mess of different ways you can do that.

Example:
http://www.dreaminco...-basics-part-1/


Haha ok, it isn't possible to make advanced video games just with VB eh? Like an FPS?
Was This Post Helpful? 0
  • +
  • -

#13 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 9204
  • View blog
  • Posts: 34,581
  • Joined: 12-June 08

Re: LOL this thing was a nightmare

Posted 14 June 2014 - 10:03 AM

In theory - yeah.. you can, but there are large gaping issues doing so and not, say, using an existing game engine.
Was This Post Helpful? 0
  • +
  • -

#14 DickHead  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 08-July 14

Re: LOL this thing was a nightmare

Posted 08 July 2014 - 06:03 AM

I beleive there is an error in the logic @ line 1496

Heop this helps.
Was This Post Helpful? 0
  • +
  • -

#15 SarumanTheWhite  Icon User is offline

  • D.I.C Regular

Reputation: 73
  • View blog
  • Posts: 352
  • Joined: 04-November 08

Re: LOL this thing was a nightmare

Posted 08 July 2014 - 10:24 AM

I'm a little concerned that you even bothered to debug that code.
Was This Post Helpful? 2
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2