예제 #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();
        }
예제 #2
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);
                    }
                }
            }
        }
예제 #3
0
        public BattleLine(PlayBoard ABoard, PlayBoard BBoard)
        {
            haveWinner = false;

            ABoard.mainLine = this;
            BBoard.mainLine = this;

            this.ABoard  = ABoard;
            this.BBoard  = BBoard;
            this.AEnergy = ABoard.energy;
            this.BEnergy = BBoard.energy;
            this.A       = ABoard.group;
            this.B       = BBoard.group;

            A.At(0).changeStatusTo((int)Status.move);
            B.At(0).changeStatusTo((int)Status.move);

            A.setEnemy(B);
            B.setEnemy(A);
        }