예제 #1
0
        public bool ShootArrow(PictureBox heroFloor, PictureBox enemyPictureBox, Enum HeroMotionStatus)
        {
            bool shootSuccessHit = false;
            //==Generate The weapon Movement BEGIN====
            int   hitCounter = 0;
            Point p          = new Point();

            if ((Player.PlayerMotionState)HeroMotionStatus == Player.PlayerMotionState.MovingRight)
            {
                WeaponPictureFloor.Image = Properties.Resources.arrowPointingRight;
                p.X = heroFloor.Location.X + 50;
                p.Y = heroFloor.Location.Y - 5;
                WeaponPictureFloor.Location = p;
                WeaponPictureFloor.Refresh();
                WeaponPictureFloor.Visible = true;
                while (p.X < 1100)
                {
                    p.X += 15;
                    p.Y  = p.Y;

                    WeaponPictureFloor.Location = p;

                    bool result = Attack(enemyPictureBox);
                    if (result)
                    {
                        hitCounter++;
                    }
                }
            }

            if ((Player.PlayerMotionState)HeroMotionStatus == Player.PlayerMotionState.MovingLeft)
            {
                WeaponPictureFloor.Image = Properties.Resources.arrowPointingLeft;

                p.X = heroFloor.Location.X + 50;
                p.Y = heroFloor.Location.Y - 5;
                WeaponPictureFloor.Location = p;
                WeaponPictureFloor.Refresh();
                WeaponPictureFloor.Visible = true;
                while (p.X > 50)

                {
                    p.X -= 15;
                    p.Y  = p.Y;

                    WeaponPictureFloor.Location = p;

                    bool result = Attack(enemyPictureBox);
                    if (result)
                    {
                        hitCounter++;
                    }
                }
            }

            WeaponPictureFloor.Image = Properties.Resources.bowFacingDownTranspBknd;

            p.X = heroFloor.Location.X - 40;
            p.Y = heroFloor.Location.Y - 10;
            WeaponPictureFloor.Location = p;
            WeaponPictureFloor.Refresh();
            WeaponPictureFloor.Visible = true;

            if (hitCounter > 0)
            {
                shootSuccessHit = true;
            }
            return(shootSuccessHit);
            //==Generate The weapon Movement END====
        }
예제 #2
0
        public bool SwingSword(PictureBox heroFloor, PictureBox enemyPictureBox)
        {
            bool swingSuccessHit = false;
            //==Generate The weapon Movement BEGIN====
            int   hitCounter = 0;
            Point p          = new Point();

            for (int i = 0; i <= 10; i++)
            {
                WeaponPictureFloor.Image = Properties.Resources.swordPointingUpRightTranspBknd;
                WeaponPictureFloor.Refresh();
                WeaponPictureFloor.Visible = true;
                p.X = heroFloor.Location.X + 50;
                p.Y = heroFloor.Location.Y - 10;
                WeaponPictureFloor.Location = p;
                bool result = Attack(enemyPictureBox);
                if (result)
                {
                    hitCounter++;
                }

                p.X = heroFloor.Location.X + 48;
                p.Y = heroFloor.Location.Y - 30;
                WeaponPictureFloor.Location = p;
                result = Attack(enemyPictureBox);
                if (result)
                {
                    hitCounter++;
                }

                p.X = heroFloor.Location.X + 25;
                p.Y = heroFloor.Location.Y - 40;
                WeaponPictureFloor.Location = p;
                result = Attack(enemyPictureBox);
                if (result)
                {
                    hitCounter++;
                }

                p.X = heroFloor.Location.X + 5;
                p.Y = heroFloor.Location.Y - 40;
                WeaponPictureFloor.Location = p;
                result = Attack(enemyPictureBox);
                if (result)
                {
                    hitCounter++;
                }

                p.X = heroFloor.Location.X - 20;
                p.Y = heroFloor.Location.Y - 40;
                WeaponPictureFloor.Location = p;
                result = Attack(enemyPictureBox);
                if (result)
                {
                    hitCounter++;
                }
                WeaponPictureFloor.Image = Properties.Resources.swordPointingUpLeftTranspBknd;
                WeaponPictureFloor.Refresh();
                WeaponPictureFloor.Visible = true;

                p.X = (heroFloor.Location.X - 30);
                p.Y = (heroFloor.Location.Y - 25);
                WeaponPictureFloor.Location = p;
                result = Attack(enemyPictureBox);
                if (result)
                {
                    hitCounter++;
                }

                p.X = (heroFloor.Location.X - 40);
                p.Y = (heroFloor.Location.Y - 10);
                WeaponPictureFloor.Location = p;
                result = Attack(enemyPictureBox);
                if (result)
                {
                    hitCounter++;
                }
            }
            if (hitCounter > 0)
            {
                swingSuccessHit = true;
            }
            return(swingSuccessHit);
            //==Generate The weapon Movement END====
        }
예제 #3
0
        public bool SwingMaze(PictureBox heroFloor, PictureBox enemyPictureBox)
        {
            bool swingSuccessHit = false;
            //==Generate The weapon Movement BEGIN====
            int   hitCounter = 0;
            Point p          = new Point();

            for (int i = 0; i <= 10; i++)
            {
                WeaponPictureFloor.Image  = Properties.Resources.FlailPointingRightTranspBkgr;
                WeaponPictureFloor.Width  = 100;
                WeaponPictureFloor.Height = 50;
                p.X = heroFloor.Location.X + 50;
                p.Y = heroFloor.Location.Y - 10;
                WeaponPictureFloor.Location = p;
                WeaponPictureFloor.Refresh();
                WeaponPictureFloor.Visible = true;


                bool result = Attack(enemyPictureBox);
                if (result)
                {
                    hitCounter++;
                }

                WeaponPictureFloor.Image  = Properties.Resources.FlailPointingAngleRightTranspBackgr;
                WeaponPictureFloor.Width  = 96;
                WeaponPictureFloor.Height = 86;
                p.X = heroFloor.Location.X + 48;
                p.Y = heroFloor.Location.Y - 60;
                WeaponPictureFloor.Location = p;
                WeaponPictureFloor.Refresh();
                WeaponPictureFloor.Visible = true;

                result = Attack(enemyPictureBox);
                if (result)
                {
                    hitCounter++;
                }

                p.X = heroFloor.Location.X + 55;
                p.Y = heroFloor.Location.Y - 80;
                WeaponPictureFloor.Location = p;
                WeaponPictureFloor.Refresh();
                result = Attack(enemyPictureBox);
                if (result)
                {
                    hitCounter++;
                }
                WeaponPictureFloor.Image  = Properties.Resources.FlailPointingUpTranspBkgr;
                WeaponPictureFloor.Width  = 44;
                WeaponPictureFloor.Height = 98;
                p.X = heroFloor.Location.X + 10;
                p.Y = heroFloor.Location.Y - 80;
                WeaponPictureFloor.Location = p;
                WeaponPictureFloor.Refresh();
                WeaponPictureFloor.Visible = true;

                result = Attack(enemyPictureBox);
                if (result)
                {
                    hitCounter++;
                }
                WeaponPictureFloor.Image  = Properties.Resources.FlailPointingAngleLeftTranspBackgr;
                WeaponPictureFloor.Width  = 88;
                WeaponPictureFloor.Height = 98;
                p.X = heroFloor.Location.X - 75;
                p.Y = heroFloor.Location.Y - 70;
                WeaponPictureFloor.Location = p;
                WeaponPictureFloor.Refresh();
                WeaponPictureFloor.Visible = true;

                result = Attack(enemyPictureBox);
                if (result)
                {
                    hitCounter++;
                }

                p.X = (heroFloor.Location.X - 85);
                p.Y = (heroFloor.Location.Y - 75);
                WeaponPictureFloor.Refresh();
                WeaponPictureFloor.Location = p;
                result = Attack(enemyPictureBox);
                if (result)
                {
                    hitCounter++;
                }

                WeaponPictureFloor.Image  = Properties.Resources.FlailPointingLeftTranspBkgr;
                WeaponPictureFloor.Width  = 100;
                WeaponPictureFloor.Height = 50;
                p.X = (heroFloor.Location.X - 115);
                p.Y = (heroFloor.Location.Y - 20);
                WeaponPictureFloor.Location = p;
                WeaponPictureFloor.Refresh();
                WeaponPictureFloor.Visible = true;

                result = Attack(enemyPictureBox);
                if (result)
                {
                    hitCounter++;
                }

                WeaponPictureFloor.Image  = Properties.Resources.mace;
                WeaponPictureFloor.Width  = 50;
                WeaponPictureFloor.Height = 50;
                p.X = (heroFloor.Location.X + 40);
                p.Y = (heroFloor.Location.Y - 30);
                WeaponPictureFloor.Location = p;
                WeaponPictureFloor.Refresh();
                WeaponPictureFloor.Visible = true;
            }

            if (hitCounter > 0)
            {
                swingSuccessHit = true;
            }

            return(swingSuccessHit);
            //==Generate The weapon Movement END====
        }