예제 #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 PlayBoard(EnergyBar energy, Warriors group, int level, bool isMe = false)
        {
            this.isMe   = isMe;
            this.energy = energy;
            this.group  = group;
            this.level  = level;
            this.group.add(new Castle(this.level));

            this.fixValue = group.isReverse() ? 1 : -1;
            this.rand     = new Random();

            direct = rand.Next(0, level);
        }
예제 #3
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();
            }
        }
예제 #4
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();
            }
        }
예제 #5
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);
                    }
                }
            }
        }
예제 #6
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);
        }
예제 #7
0
//
//Initation
//
        public BattleForm()
        {
            rand = new Random();

            this.DoubleBuffered = true; //圖形移動不閃爍
            this.Opacity        = 0.9;  //透明度

            InitializeComponent();
            battlePictureInit();
            this.Width        = Const.BStartPoint + 100;
            pictureBox1.Width = this.Width;

            A           = new Warriors(new Point(Const.AStartPoint), this);
            B           = new Warriors(new Point(Const.BStartPoint), this, true);
            myEnergyBar = new EnergyBar(10);
            aiEnergyBar = new EnergyBar(10);
            AI          = new PlayBoard(aiEnergyBar, B, Program.AI.level);
            Player      = new PlayBoard(myEnergyBar, A, Program.player.level, true);

            mainLine = new BattleLine(AI, Player);

            _warriorButtonList = new List <Button>();
        }
예제 #8
0
 public void setEnemy(Warriors value)
 {
     this.enemy = value;
 }
예제 #9
0
//help to partner
        public virtual void helpTo(Warriors we)
        {
            ;
        }