Esempio n. 1
0
    private void СommitReserve(IBattelPerson enemy)
    {
        //Вывести карты на поле боя
        var cardsAttack = new List <string>();
        var cardReserv  = new List <string>();

        enemy.ReservCards.ForEach(x => cardReserv.Add(x.Combat.Name));

        int index = 0;

        foreach (var item in enemy.Cell)
        {
            if (item.IsExist == false)
            {
                cardsAttack.Add(enemy.ReservCards[index].Combat.Name);
                cardReserv.Remove(enemy.ReservCards[index].Combat.Name);
                index++;
            }
            else
            {
                cardsAttack.Add(item.Unit.Combat.Name);
            }
        }

        var count = cardReserv.Count;

        for (int i = count; i < 6; i++)
        {
            cardReserv.Add(enemy.DeckCards[i - count].Name);
        }

        enemy.Report = new PersonDATAREPORT(cardsAttack, cardReserv).GetJsonString();
        Debug.Log(enemy.Report);
    }
Esempio n. 2
0
    private string GetDataSTARTING_HAND(IBattelPerson player)
    {
        var cardReserv = new List <string>();

        player.ReservCards.ForEach(x => cardReserv.Add(x.Combat.Name));

        return(JsonConvert.SerializeObject(cardReserv));
    }
Esempio n. 3
0
    public IPersonsPanel Initialize(Transform parent, IBattelPerson player, IBattelPerson enemy)
    {
        personPlayer.Build(player);
        personEnemy.Build(enemy);

        transform.SetParent(parent, false);

        return(this);
    }
Esempio n. 4
0
 private void ReturnCardsToDeck(IBattelPerson person)
 {
     foreach (var attackCard in person.AttackCards)
     {
         person.DeckCards.Add(attackCard.Combat.CardData);
         attackCard.DestroyUI();
     }
     person.AttackCards.Clear();
     person.ShuffleCards(person.DeckCards); //Перетасовать
 }
Esempio n. 5
0
    private string GetDataTACTICS(IBattelPerson player)
    {
        var cards = new List <int>();

        foreach (var item in player.AttackCards)
        {
            cards.Add(item.Warrior.AttackTargetID);
        }
        return(JsonConvert.SerializeObject(cards));
    }
Esempio n. 6
0
    public void Build(IBattelPerson battelPerson)
    {
        this.battelPerson        = battelPerson;
        battelPerson.SetLive    += SetCountLive;
        battelPerson.SetFortune += SetFortune;

        textNamePeson.text = battelPerson.Name.ToString();
        textCountLive.text = battelPerson.Live.ToString();
        fortune.gameObject.SetActive(false);

        textFraction.SetKey(battelPerson.Fraction.Name);
    }
Esempio n. 7
0
    private void CreatStarteHand(IBattelPerson enemy)
    {
        var cardReserv = new List <string>();

        for (int i = 0; i < 6; i++)
        {
            cardReserv.Add(enemy.DeckCards[i].Name);
        }

        enemy.Report = JsonConvert.SerializeObject(cardReserv);
        enemy.NewStartingHand();
    }
Esempio n. 8
0
    public void CreatEnemyPerson(IBattelPerson enemy)
    {
        var listCards = new List <string>()
        {
            "CardScriptable 30", "CardScriptable 35", "CardScriptable 34", "CardScriptable 33", "CardScriptable 32", "CardScriptable 31",
            "CardScriptable 38", "CardScriptable 37", "CardScriptable 36", "CardScriptable 41", "CardScriptable 40", "CardScriptable 39",
            "CardScriptable 47", "CardScriptable 45", "CardScriptable 46", "CardScriptable 43", "CardScriptable 68", "CardScriptable 66",
            "CardScriptable 48", "CardScriptable 49", "CardScriptable 50", "CardScriptable 52", "CardScriptable 51", "CardScriptable 53"
        };

        enemy.Creat("Al_enemy", "horde", listCards, live: 1);
    }
Esempio n. 9
0
    private string GetDataRESERVE(IBattelPerson player)
    {
        var cardsAttack = new List <string>();

        player.AttackCards.ForEach(x => cardsAttack.Add(x.Combat.Name));

        var cardReserv = new List <string>();

        player.ReservCards.ForEach(x => cardReserv.Add(x.Combat.Name));

        return(new PersonDATAREPORT(cardsAttack, cardReserv).GetJsonString());
    }