Ejemplo n.º 1
0
		public SpellCastAction(IBrain owner, Unit target, Spell spell) : base(owner)
		{
			m_ownerBrain = owner;
			m_target = target;
			m_spell = spell;

			if (m_target != null)
				m_range = new AIRange(m_spell.Range.Min, m_spell.Range.Max);

			IsPrimary = true;
		}
Ejemplo n.º 2
0
		public MeleeAttackAction(IBrain owner)
			: base(owner)
		{
			var ownerUnit = owner.Owner;
			var mainWep = ownerUnit.MainWeapon;

			m_range = new AIRange(mainWep.MinRange, mainWep.MaxRange);

			m_target = ownerUnit.Target;

			IsPrimary = false;
		}
Ejemplo n.º 3
0
        public MeleeAttackAction(IBrain owner)
            : base(owner)
        {
            var ownerUnit = owner.Owner;
            var mainWep   = ownerUnit.MainWeapon;

            m_range = new AIRange(mainWep.MinRange, mainWep.MaxRange);

            m_target = ownerUnit.Target;

            IsPrimary = false;
        }
Ejemplo n.º 4
0
        public SpellCastAction(IBrain owner, Unit target, Spell spell) : base(owner)
        {
            m_ownerBrain = owner;
            m_target     = target;
            m_spell      = spell;

            if (m_target != null)
            {
                m_range = new AIRange(m_spell.Range.Min, m_spell.Range.Max);
            }

            IsPrimary = true;
        }
Ejemplo n.º 5
0
Archivo: myAI.cs Proyecto: uindou/Board
    private async static void FixedRandomAI()
    {
        List <GameObject> res = DataBase.FixedMyKoma(gameManage.turn, true);

        if (res == null)
        {
            aiPlaying = false;
            gameManage.Skip();
            aiPlaying = true;
            await Task.Delay(100);
        }
        else
        {
            System.Random     r1      = new System.Random();
            GameObject        obj     = res[r1.Next(0, res.Count() - 1)];
            List <(int, int)> AIRange = obj.GetComponent <interFace>().AIMovable();
            var(i, j) = AIRange[r1.Next(0, AIRange.Count() - 1)];
            GameObject obj1 = DataBase.objs[i, j];

            await Task.Delay(1000);

            gameManage.requestEnqueue(obj);

            await Task.Delay(1000);

            gameManage.requestEnqueue(obj1);
            await Task.Delay(100);
        }
        if (gameManage.receiveMode != gameManage.situation.attackselect)
        {
            return;
        }
        else
        {
            Debug.Log(3);
            System.Random     r1          = new System.Random();
            List <GameObject> res1        = DataBase.MyKoma(gameManage.turn, false);
            GameObject        obj2        = res1[r1.Next(0, res1.Count() - 1)];
            List <(int, int)> attackRange = obj2.GetComponent <interFace>().Attackable();
            System.Random     r2          = new System.Random();
            var(k, l) = attackRange[r2.Next(0, attackRange.Count() - 1)];
            GameObject obj3 = DataBase.objs[k, l];
            gameManage.requestEnqueue(obj2);
            await Task.Delay(1000);

            gameManage.requestEnqueue(obj3);
        }
    }