public static void Summon(UnitData data, FieldBlock block, UnitData data1, UnitData data2)
    {
        PlayerID id = PlayerID.Player1;

        if (data1.m_Owner != null)
        {
            id = data1.m_Owner.m_PlayerID;
            data1.m_Owner.m_Destroy.Destroy();
        }
        else
        {
            Debug.LogError("Spirit doesn't exist");
        }

        if (data2.m_Owner != null)
        {
            id = data1.m_Owner.m_PlayerID;
            data2.m_Owner.m_Destroy.Destroy();
        }
        else
        {
            Debug.LogError("Spirit doesn't exist");
        }

        CostMana(id, data);

        SummonManager.Summon(data, block, id);
    }
    public override void TakeEffect(AbilityInfo[] info)
    {
        base.TakeEffect(info);

        TargetInfo info1 = GetAbilityInfo <TargetInfo>();

        if (info1 == null)
        {
            return;
        }

        foreach (FieldBlock block in info1.m_Blocks)
        {
            if (block.m_Unit == null)
            {
                SummonManager.Summon(m_Unit, block, block.m_PlayerID);
            }
        }
    }
Esempio n. 3
0
            public static void Do(AIMove.UnitOption option)
            {
                Debug.Log("AI Summon Unit");

                UnitData data = option.data;

                if(AIView.Instance.EmptyFront != null && data.CanBeFrontline)
                {
                    int cost = data.GetStat(UnitStatsProperty.Cost);
                    AIView.Instance.AI.m_Mana.Cost(cost);

                    SummonManager.Summon(data.m_Owner, AIView.Instance.EmptyFront);
                }
                else if (AIView.Instance.EmptyBack != null && data.CanBeBackline)
                {
                    int cost = data.GetStat(UnitStatsProperty.Cost);
                    AIView.Instance.AI.m_Mana.Cost(cost);

                    SummonManager.Summon(data.m_Owner, AIView.Instance.EmptyBack);
                }
            }
Esempio n. 4
0
    protected virtual void TrySummon(GameEventData eventData)
    {
        SummonData data = eventData.CastDataType <SummonData>();

        if (data == null)
        {
            return;
        }

        Unit       unit  = data.m_Unit;
        FieldBlock block = data.m_Block;

        if (!CheckSummonAvaliability(data, unit, block))
        {
            return;
        }

        int cost = unit.m_Data.GetStat(UnitStatsProperty.Cost);

        m_Mana.Cost(cost);

        SummonManager.Summon(unit, block);
    }