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();
        }
Example #2
0
    //public float time2;

    // Use this for initialization
    void Start()
    {
        instance = this;
        cd       = new CDTime[2];
        cd[0]    = new CDTime(cd1);
        cd[1]    = new CDTime(cd2);
    }
Example #3
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();
            }
        }
Example #4
0
        public Rescue(bool isMe)
        {
            type = Warrior_Type.helper;

            myStatus     = Const.imageList[(int)WarriorList.Rescue];
            myRealStatus = myStatus[Const.Part.A];
            if (isMe)
            {
                setValueFrom(Program.playerData[6]);
            }
            else
            {
                setValueFrom(Program.AIData[6]);
            }

            CDTime.setCoolDownTime(15);

            img.Image = myRealStatus[(int)Status.move];
            img.Top   = Const.mainLineHeight - Const.warriorHeight;
        }
Example #5
0
        public Hatchet(bool isMe)
        {
            type = Warrior_Type.attacker;

            myStatus     = Const.imageList[(int)WarriorList.Hatchet];
            myRealStatus = myStatus[Const.Part.A];
            if (isMe)
            {
                setValueFrom(Program.playerData[3]);
            }
            else
            {
                setValueFrom(Program.AIData[3]);
            }

            setBonus(10);
            CDTime.setCoolDownTime(15);

            img.Image = myRealStatus[(int)Status.move];
            img.Top   = Const.mainLineHeight - Const.warriorHeight;
        }
Example #6
0
 void Awake()
 {
     cd = new CDTime(cdTime);
 }