Beispiel #1
0
        public void ataqueperson1()
        {
            if (personagem1 == "Militar")
            {
                Militar mili = new Militar();
                if ("Fuzil" == armap1)
                {
                    mili.setArma(new Fuzil());
                    ataquep1.Text = mili.Arma();
                }
                if ("Sniper" == armap1)
                {
                    mili.setArma(new Sniper());
                    ataquep1.Text = mili.Arma();
                }
                if ("Lança Foguetes" == armap1)
                {
                    mili.setArma(new Lança_Foguetes());
                    ataquep1.Text = mili.Arma();
                }
                if ("Espingarda" == armap1)
                {
                    mili.setArma(new Espingarda());
                    ataquep1.Text = mili.Arma();
                }
            }
            if (personagem1 == "Mago")
            {
                Mago mag = new Mago();
                if ("Fogo" == armap1)
                {
                    mag.setMagia(new Fogo());
                    ataquep1.Text = mag.Magia();
                }
                if ("Trevas" == armap1)
                {
                    mag.setMagia(new Trevas());
                    ataquep1.Text = mag.Magia();
                }
                if ("Água" == armap1)
                {
                    mag.setMagia(new Agua());
                    ataquep1.Text = mag.Magia();
                }
                if ("Gelo" == armap1)
                {
                    mag.setMagia(new Gelo());
                    ataquep1.Text = mag.Magia();
                }
            }
            if (personagem1 == "Dragão")
            {
                Dragao drag = new Dragao();

                if ("Fogo" == armap1)
                {
                    drag.setMagia(new Fogo());
                    ataquep1.Text = drag.Magia();
                }
                if ("Trevas" == armap1)
                {
                    drag.setMagia(new Trevas());
                    ataquep1.Text = drag.Magia();
                }
                if ("Eletrico" == armap1)
                {
                    drag.setMagia(new Agua());
                    ataquep1.Text = drag.Magia();
                }
                if ("Gelo" == armap1)
                {
                    drag.setMagia(new Gelo());
                    ataquep1.Text = drag.Magia();
                }
            }
            if (personagem1 == "Samurai")
            {
                Samurai samu = new Samurai();
                if ("Semehada" == armap1)
                {
                    samu.setArma(new Semehada());
                    ataquep1.Text = samu.Arma();
                }
                if ("Cutelo" == armap1)
                {
                    samu.setArma(new Cutelo());
                    ataquep1.Text = samu.Arma();
                }
                if ("Katana" == armap1)
                {
                    samu.setArma(new Katana());
                    ataquep1.Text = samu.Arma();
                }
                if ("Lamina do Dragão" == armap1)
                {
                    samu.setArma(new Lamina_do_Dragao());
                    ataquep1.Text = samu.Arma();
                }
            }
        }