Exemple #1
0
 public override void TakeDamage(Tools.Color damageColor)
 {
     base.TakeDamage(damageColor);
     GameMaster.Instance.gearTracker.MinionKilled(this);
     mapSquare.unit = null;
     Destroy(gameObject);
 }
Exemple #2
0
 public void SetRuneOpen(Tools.Color runeColor, bool open)
 {
     if (!runes.ContainsKey(runeColor))
     {
         Debug.LogError("No correct rune color when setting RuneOpen!");
         return;
     }
     runes[runeColor] = open;
 }
Exemple #3
0
 public bool RuneOpen(Tools.Color runeColor)
 {
     if (!runes.ContainsKey(runeColor))
     {
         Debug.LogError("No correct rune color when getting RuneOpen!");
         return(false);
     }
     return(runes[runeColor]);
 }
        public override void TakeDamage(Tools.Color damageColor = Tools.Color.None)
        {
            DamageCard damage = GameMaster.Instance.damageCardDeck.DrawCard();

            Debug.Log("Champion taking damage! " + damage.ToString());
            damage.ExecuteCard();
            if (damage.slottable)
            {
                damage.SlotDamageCard();
            }
            GameMaster.Instance.damageCardDeck.DiscardCard(damage);
            base.TakeDamage(damageColor);
        }
Exemple #5
0
        // TODO: Cut into smaller pieces
        public void Scrap()
        {
            if (currentPlayer.currentCard == null)
            {
                return;
            }

            Tools.Color scrapColor = (currentPlayer.currentCard as CommandCard).cardColor;
            if (scrapColor == Tools.Color.Red || scrapColor == Tools.Color.Blue)
            {
                int damageOptions = 0;
                for (int i = 0; i < currentPlayer.commandLine.cards.Length; i++)
                {
                    if (currentPlayer.commandLine.cards[i].Count > 0 && currentPlayer.commandLine.cards[i].PeekTop() is DamageCard)
                    {
                        damageOptions++;
                    }
                }
                if (damageOptions > 0)
                {
                    UIMaster.Instance.state = UIMaster.UIState.ScrapRepair;
                    UIMaster.Instance.ToggleRepairScrap(currentPlayer, true);
                }
                else
                {
                    NoScrapEffect();
                }
            }

            else if (scrapColor == Tools.Color.Yellow || scrapColor == Tools.Color.Green)
            {
                int unDamagedSlots = 0;
                for (int i = 0; i < currentPlayer.commandLine.cards.Length; i++)
                {
                    if (currentPlayer.commandLine.cards[i].Count == 0 || !(currentPlayer.commandLine.cards[i].PeekTop() is DamageCard))
                    {
                        unDamagedSlots++;
                    }
                }

                if (unDamagedSlots > 1)
                {
                    UIMaster.Instance.state = UIMaster.UIState.ScrapSwap;
                    UIMaster.Instance.ToggleSwapScrap(currentPlayer, true);
                }
                else
                {
                    NoScrapEffect();
                }
            }
        }
Exemple #6
0
        protected virtual void ShowDamageEffect(Tools.Color damageColor)
        {
            switch (damageColor)
            {
            case Tools.Color.Blue:
                if (Prefabs.Instance.blueDamageEffect)
                {
                    Instantiate(Prefabs.Instance.blueDamageEffect, transform.position, Quaternion.identity);
                }
                return;

            case Tools.Color.Green:
                if (Prefabs.Instance.greenDamageEffect)
                {
                    Instantiate(Prefabs.Instance.greenDamageEffect, transform.position, Quaternion.identity);
                }
                return;

            case Tools.Color.Red:
                if (Prefabs.Instance.redDamageEffect)
                {
                    Instantiate(Prefabs.Instance.redDamageEffect, transform.position, Quaternion.identity);
                }
                return;

            case Tools.Color.Yellow:
                if (Prefabs.Instance.yellowDamageEffect)
                {
                    Instantiate(Prefabs.Instance.yellowDamageEffect, transform.position, Quaternion.identity);
                }
                return;

            case Tools.Color.None:
                if (Prefabs.Instance.colorlessDamageEffect)
                {
                    Instantiate(Prefabs.Instance.colorlessDamageEffect, transform.position, Quaternion.identity);
                }
                return;
            }
        }
Exemple #7
0
 public override void TakeDamage(Tools.Color damageColor)
 {
     base.TakeDamage(damageColor);
     GameMaster.Instance.scenario.CrystalDestroyed(this);
     Destroy(gameObject);
 }
Exemple #8
0
 public virtual void TakeDamage(Tools.Color damageColor = Tools.Color.None)
 {
     ShowDamageEffect(damageColor);
 }
Exemple #9
0
 public override void TakeDamage(Tools.Color damageColor = Tools.Color.None)
 {
     base.TakeDamage(damageColor);
     Debug.Log("Bomb took damage!");
 }
 public DamageAction(Unit dealingUnit, Tools.Color dmgColor, Unit receivingUnit)
 {
     unit        = dealingUnit;
     damageColor = dmgColor;
     target      = receivingUnit;
 }