public override bool IsComplete() { PlayerHolder p = Settings.gameManager.currentPlayer; PlayerHolder e = Settings.gameManager.GetEnemyOf(p); if (p.atackingCards.Count == 0) { return(true); } for (int i = 0; i < p.atackingCards.Count; i++) { CardInstance inst = p.atackingCards[i]; Card c = inst.viz.card; CardProperties attack = c.GetProperty(attackElement); if (attack == null) { Debug.Log("You are attacking with a card that cannot attack"); continue; } p.DropCard(inst, false); p.currentHolder.SetCardDown(inst); inst.SetTapped(); e.DoDamage(attack.intValue); } p.atackingCards.Clear(); return(true); }
public void LoadCard(Card c) { if (c == null) { return; } card = c; card.cardType.OnSetType(this); CloseAll(); for (int i = 0; i < c.properties.Length; i++) { CardProperties cp = c.properties[i]; CardVizProperties p = GetProperty(cp.element); if (p == null) { continue; } if (cp.element is ElementInteger) { p.text.text = cp.intValue.ToString(); p.text.gameObject.SetActive(true); } if (cp.element is ElementText) { p.text.text = cp.stringValue; p.text.gameObject.SetActive(true); } else if (cp.element is ElementImage) { p.img.sprite = cp.sprite; p.img.gameObject.SetActive(true); } } }