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); }
private bool SlotDamageCard(int index, DamageCard card) { // If slot already has a damage card, discard the old one if (cards[index].Count > 0) { if (cards[index].PeekTop() is DamageCard) { GameMaster.Instance.damageCardDeck.DiscardCard(cards[index].PopTop() as DamageCard); } } cards[index].AddTop(card); return(true); }
void Update() { if (!inputEnabled) { return; } // Move single if (Input.GetKeyDown(KeyCode.RightArrow)) { Move(Tools.Direction.East); } if (Input.GetKeyDown(KeyCode.LeftArrow)) { Move(Tools.Direction.West); } if (Input.GetKeyDown(KeyCode.UpArrow)) { Move(Tools.Direction.North); } if (Input.GetKeyDown(KeyCode.DownArrow)) { Move(Tools.Direction.South); } // Move multiple if (Input.GetKeyDown(KeyCode.Keypad6)) { MoveMultiple(Tools.Direction.East); } if (Input.GetKeyDown(KeyCode.Keypad4)) { MoveMultiple(Tools.Direction.West); } if (Input.GetKeyDown(KeyCode.Keypad8)) { MoveMultiple(Tools.Direction.North); } if (Input.GetKeyDown(KeyCode.Keypad2)) { MoveMultiple(Tools.Direction.South); } // Turn if (Input.GetKeyDown(KeyCode.D)) { Rotate(Tools.Direction.East); } if (Input.GetKeyDown(KeyCode.A)) { Rotate(Tools.Direction.West); } if (Input.GetKeyDown(KeyCode.W)) { Rotate(Tools.Direction.North); } if (Input.GetKeyDown(KeyCode.S)) { Rotate(Tools.Direction.South); } // Complex commands if (Input.GetKeyDown(KeyCode.Alpha1)) { MoveAndRotate(Tools.Direction.South, Tools.Direction.South, Tools.Direction.East); } if (Input.GetKeyDown(KeyCode.Alpha0)) { DamageCard dmg = GameMaster.Instance.damageCardDeck.DrawCard(); dmg.ExecuteCard(); GameMaster.Instance.damageCardDeck.DiscardCard(dmg); } if (Input.GetKeyDown(KeyCode.Alpha3)) { Card drawnDamage = GameMaster.Instance.damageCardDeck.DrawCard(); GameMaster.Instance.currentPlayer.commandLine.SlotCard(2, drawnDamage); UIMaster.Instance.cardSlots[2].SlotCard(drawnDamage); } if (Input.GetKeyDown(KeyCode.KeypadMinus)) { KillAllMinions(); } }