Exemple #1
0
 public void ShuffleDiscardIntoDeck()
 {
     enemyDeck = FindObjectOfType <EnemyDeck>();
     enemyDeck.AddCardToDeck(cards);
     enemyDeck.ShuffleDeck();
     cards.Clear();
 }
Exemple #2
0
    void Start()
    {
        enemy = GameObject.FindGameObjectWithTag ("Enemy");
        enemyDeck = GameObject.FindGameObjectWithTag ("GameController").GetComponent<EnemyDeck> ();
        //enemyHand = enemyDeck.handEnemy;

        enemyAttack = enemy.GetComponent<EnemyAttack> ();
        enemyHealth = enemy.GetComponent<EnemyHealth> ();
        enemyMoney = enemy.GetComponent<EnemyMoney> ();

        EnemyOffensePanel = GameObject.FindGameObjectWithTag ("EnemyOffense");
        EnemyDefensePanel = GameObject.FindGameObjectWithTag ("EnemyDefense");
    }
    //public static EnemyLogic _enemyThink;


    public void StartThinking()
    {
        Player   _player   = GameObject.FindGameObjectWithTag("Player").GetComponent <Player>();
        Creature _creature = GameObject.FindGameObjectWithTag("Enemy").GetComponent <Creature>();

        _eDeck        = GameObject.FindGameObjectWithTag("Enemy").GetComponent <EnemyDeck>();
        _logicDisplay = GameObject.Find("CurrentAIAction").GetComponent <TextMeshProUGUI>();

        _playerHealth   = _player._health;
        _currentHealth  = _creature._currentHealth;
        _idealHealth    = _creature._idealHealth;
        _currentDefense = _creature._currentDefense;
        Choose();
    }
Exemple #4
0
    public void DrawInitialHand(int handSize)
    {
        handSize += handBuff;
        handSize += FindObjectOfType <Enemy>().GetPermaBuffAmount(StatusEffect.PermaBuffType.HandSize);
        // minimum hand size is 1, debuffs shouldn't prevent them from every playing anything
        handSize = Mathf.Clamp(handSize - FindObjectOfType <BattleData>().GetEnemyHandSizeDebuff(), 1, 999999);
        handBuff = 0;

        playingCards = false;
        enemyDeck    = FindObjectOfType <EnemyDeck>();
        enemyDiscard = FindObjectOfType <EnemyDiscard>();
        Debug.Log("enemy handsize: " + handSize);
        StartCoroutine(DrawHandTimer(handSize));
    }
Exemple #5
0
    public void BattleSetup(float setupTimeInSeconds)
    {
        configData = FindObjectOfType <ConfigData>();
        configData.SetupPipManagers(this);
        healthPipManager = configData.GetEnemyHealthPipManager();
        energyPipManager = configData.GetEnemyEnergyPipManager();
        SetupHealthAndEnergyText();

        enemyDeck = FindObjectOfType <EnemyDeck>();
        enemyDeck.SetupDeck(shuffleDeck);

        enemyDiscard = FindObjectOfType <EnemyDiscard>();
        enemyHand    = FindObjectOfType <EnemyHand>();
    }
Exemple #6
0
        /// <summary>
        /// Immediately cleans-up the match, destroying all cards in hands, decks and boards.
        /// Prepares everything for new match.
        /// </summary>
        public void CleanUpMatch()
        {
            GameQueue.CleanUp();

            PlayerHand.CleanUp();
            EnemyHand.CleanUp();

            PlayerDeck.CleanUp();
            EnemyDeck.CleanUp();

            CardManager.CleanUp();

            MatchInfo       = null;
            PlayerTurnCount = 0;
            EnemyTurnCount  = 0;
        }
    public void SetupCard(int count)
    {
        // do something with sprite layers (over everything including player hand)
        // save the card image and replace it with nothing (back of card)
        GetComponent <Animator>().Play("CardSpin");
        SpriteRenderer imageComponent = GetImageComponentByName("CardImage");

        // Rework this if more than one canvas is ever on the card
        cardText = GetComponentInChildren <TextMeshProUGUI>();
        cardText.gameObject.SetActive(false);

        cardImage             = imageComponent.sprite;
        imageComponent.sprite = null;
        SetSpriteLayers(count);

        enemyDeck    = FindObjectOfType <EnemyDeck>();
        enemyDiscard = FindObjectOfType <EnemyDiscard>();
        xPos         = transform.position.x;
        yPos         = transform.position.y;
    }
    void Start()
    {
        EnemyDeck   = GetComponent <EnemyDeck>();
        CardsInHand = EnemyDeck.Deck.Take(AmountOfCardsToDraw).ToList();
        EnemyDeck.Deck.RemoveAll(x => CardsInHand.Any(y => y.ID == x.ID));
        UpdateHandLabel();
        EnemyDeck.UpdateDeckLabel();
        CardsInHand.ForEach(enemyCard => Debug.Log("!!!ENEMY!!! " + enemyCard));

        scorchUnitCards   = new List <ScorchUnit>();
        spyCards          = new List <SpyUnit>();
        moraleBoostCards  = new List <MoraleBoostUnit>();
        tightBondCards    = new List <TightBondUnit>();
        musterCards       = new List <MusterUnit>();
        medicCards        = new List <MedicUnit>();
        normalUnitCards   = new List <NormalUnit>();
        weatherMagicCards = new List <Weather>();
        heroCards         = new List <HeroUnit>();
        clearSkiesCards   = new List <ClearSkies>();

        RefreshMemory();
    }
Exemple #9
0
        /// <summary>
        /// Starts a match. Creates all necessary game objects and cards.
        /// </summary>
        /// <param name="matchInfo">Information about initial state of the match. See MatchInfo.</param>
        public void StartMatch(MatchInfo matchInfo)
        {
            MatchInfo = matchInfo;

            CreateBoardObjects();
            PlayerDeck.FillWithCards(matchInfo.PlayerDeckCards);
            EnemyDeck.FillWithCards(matchInfo.EnemyDeckCards);
            PlayerHand.FillWithCards(matchInfo.PlayerStartingHandCards);
            EnemyHand.FillWithCards(matchInfo.EnemyStartingHandCards);

            PlayerHero.MaxHealth = PlayerHero.CurrentHealth = matchInfo.PlayerHealth;
            EnemyHero.MaxHealth  = EnemyHero.CurrentHealth = matchInfo.EnemyHealth;

            PlayerResources.Init(matchInfo.PlayerStartingResource);
            EnemyResources.Init(matchInfo.EnemyStartingResource);


            if (matchInfo.PlayerAmountOfCardDrawBeforeGame > 0)
            {
                PlayerHand.ImmidiatelyTakeCardsFromDeck(PlayerDeck, matchInfo.PlayerAmountOfCardDrawBeforeGame);
            }

            if (matchInfo.EnemyAmountOfCardDrawBeforeGame > 0)
            {
                EnemyHand.ImmidiatelyTakeCardsFromDeck(EnemyDeck, matchInfo.EnemyAmountOfCardDrawBeforeGame);
            }

            if (matchInfo.PlayerGoesFirst)
            {
                StartPlayerTurn();
            }
            else
            {
                StartEnemyTurn();
            }
        }
Exemple #10
0
 void Awake()
 {
     instance = this;
 }
 private void LoadEnemyDeck()
 {
     enemyDeck = new EnemyDeck();
     GameObject[] go = GameObject.FindGameObjectsWithTag("EnemyCard");
     for(int i = 0; i < 50; i++)
     {
         enemyDeck.AddCard(new Card(), false);
         enemyDeck.linkGameObjectToCard(go[i], (HandleEnemyMouse)go[i].GetComponent("HandleEnemyMouse"), i);
     }
     enemyDeck.SetDeckPosition();
 }