Exemplo n.º 1
0
        public bool UserBlock(string part)
        {
            switch (part)
            {
            case "Голова":
                user.SetBlock(BodyPart.Head);
                break;

            case "Корпус":
                user.SetBlock(BodyPart.Body);
                break;

            case "Ноги":
                user.SetBlock(BodyPart.Legs);
                break;
            }

            if (user.Hp != 0 && comp.Hp != 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemplo n.º 2
0
        private void buttonHead_Click(object sender, EventArgs e)
        {
            /*video = new Microsoft.DirectX.AudioVideoPlayback.Video(@"Jim.mp4");
             * video.Open(@"Jim.mp4");
             * video.Owner = panelVideo;
             * video.Play();*/
            // pictureBoxJim.Visible = true;
            if (yourmove)
            {
                switch ((sender as Button).Name)
                {
                case "buttonHead":
                    Comp.GetHit(PartOfBody.Head, damage[0]);
                    LetIshowsomething(@"images/Hit.gif");
                    break;

                case "buttonBody":
                    Comp.GetHit(PartOfBody.Body, damage[1]);
                    LetIshowsomething(@"images/Hit1.gif");
                    break;

                case "buttonLegs":
                    Comp.GetHit(PartOfBody.Legs, damage[2]);
                    LetIshowsomething(@"images/Hit2.gif");
                    break;
                }
            }
            else
            {
                switch ((sender as Button).Name)
                {
                case "buttonHead":
                    Player.SetBlock(PartOfBody.Head);
                    Player.GetHit(Comp.SetHit(), damage[0]);
                    LetIshowsomething(@"images/Hit7.gif");
                    break;

                case "buttonBody":
                    Player.SetBlock(PartOfBody.Body);
                    Player.GetHit(Comp.SetHit(), damage[1]);
                    LetIshowsomething(@"images/Jim.gif");
                    break;

                case "buttonLegs":
                    Player.SetBlock(PartOfBody.Legs);
                    Player.GetHit(Comp.SetHit(), damage[2]);
                    LetIshowsomething(@"images/Sad.gif");
                    break;
                }
            }
        }
Exemplo n.º 3
0
        void CompDefend()
        {
            Random rnd = new Random();
            int    i   = rnd.Next(0, 2);

            computer.SetBlock((BodyPart)i);

            if (user.Hp != 0 && computer.Hp != 0)
            {
                AttackPanel.Visible = false;
                defendPanel.Visible = true;
            }
        }
Exemplo n.º 4
0
        public void CompBlock()
        {
            int i = rnd.Next(0, 3);

            comp.SetBlock((BodyPart)i);
        }
Exemplo n.º 5
0
 private void headDefendButton_Click(object sender, EventArgs e)
 {
     user.SetBlock(BodyPart.Head);
     ComputerAttack();
 }