Example #1
0
        public override void helpTo(Warriors we)
        {
            if (CDTime.isCoolDown())
            {
                return;
            }

            Warrior target = this;
            int     min    = this.attackDistance;

            for (int i = we.size() - 1; i >= 0; --i)
            {
                if (we.At(i) is Rescue)
                {
                    continue;
                }
                if (we.At(i).fullHP())
                {
                    continue;
                }
                if (this.distance(we.At(i)) <= min)
                {
                    min    = this.distance(we.At(i));
                    target = we.At(i);
                }
            }

            target.addHP(this.power);
            CDTime.record();
        }
        private void gameTimer_Tick(object sender, EventArgs e)
        {
            if (GameHaveWinner)
            {
                return;
            }

            Const.gameTime.clock();

            ClearImage();
            mainLine.nextStep();
            UpdateBattleImage();

            _Status.Text = (A.size() - 1).ToString() + " : " + (B.size() - 1).ToString();
            _Status.Left = (Const.AStartPoint + Const.BStartPoint) / 2 - (_Status.Width / 2);

            if (mainLine.isGameOver())
            {
                gameOver();
            }
            else
            {
                AI.auto();
                if (isAuto)
                {
                    Player.auto(buttonWarrior(select));
                    if (!mouseDown)
                    {
                        _rescueLine.Left = Player.group.rescueLine.value - 20;
                    }
                }
            }
        }
Example #3
0
        public override void attackTo(Warriors they)
        {
            if (they.size() <= 1)
            {
                this.beKill();
                return;
            }

            if (this.distance(they.frontLine()) <= 0)
            {
                for (int i = 0; i < they.size(); ++i)
                {
                    if (distance(they.At(i)) < this.attackDistance)
                    {
                        they.At(i).beAttackFrom(this);
                    }
                }
            }
        }
Example #4
0
//attack to warriors
        public virtual void attackTo(Warriors they)
        {
            if (CDTime.isCoolDown() || they.size() == 0)
            {
                return;
            }

            if (this.distance(they.frontLine()) <= this.attackDistance)
            {
                changeStatusTo((int)Status.attack);
                they.frontGroup()[0].beAttackFrom(this);
                CDTime.record();
            }
        }
Example #5
0
        public override void attackTo(Warriors they)
        {
            if (CDTime.isCoolDown() || they.size() == 0)
            {
                return;
            }

            if (this.distance(they.frontLine()) <= this.attackDistance)
            {
                img.Image = myRealStatus[(int)Status.attack];
                attackGroup(they.frontGroup());
                CDTime.record();
            }
        }