public static void DropCreatureCard(Transform c, Transform p, CardInstance inst) { SetParentForCard(c, p); inst.SetFlatFooted(true); gameManager.currentPlayer.UseResourcesCard(inst.viz.card.cost); gameManager.currentPlayer.DropCard(inst); }
public override bool IsCompleted() { PlayerHolder p = Settings.gameManager.currentPlayer; PlayerHolder e = Settings.gameManager.EnemyOfPlayer(p); if (p.attackingCards.Count == 0) { //Debug.Log("No card Attack"); return(true); } Dictionary <CardInstance, BlockCardInstance> dictBlock = Settings.gameManager.GetBlockInstances(); for (int i = 0; i < p.attackingCards.Count; i++) { CardInstance inst = p.attackingCards[i]; Card c = inst.viz.card; CardProperties attack = c.GetProperty(elementAttack); if (attack == null) { //Debug.Log("Cant not attack with card"); continue; } int attackValue = attack.intValue; BlockCardInstance bi = GetBlockInstanceOfAttacker(inst, dictBlock); if (bi != null) { for (int j = 0; j < bi.blocker.Count; j++) { CardProperties def = c.GetProperty(elementDefence); if (def == null) { Debug.Log("Card No defence"); continue; } attackValue -= def.intValue; if (def.intValue <= attackValue) { // Card Die } } } if (attackValue <= 0) { attackValue = 0; inst.CardInstanceToGraveyard(); } p.DropCard(inst, false); p.currentHolder.SetCardOnDown(inst); inst.SetFlatFooted(true); e.DoDame(attack.intValue); } Settings.gameManager.ClearBlockCardInstance(); p.attackingCards.Clear(); return(true); }