public void attack(AbstractCard clicked, AbstractCard target, bool damageback) { calculateDirection(target.transform.position, true); //NetworkManager.Send (CardAttackProtocol.Prepare (GameManager.matchID, attack, fieldPosition), ProcessSummonCard); target.receiveAttack(dmg); if (damageback) { clicked.receiveAttack(target.dmg); } canAttackNow = false; }
public void attack(AbstractCard clicked, AbstractCard target, bool damageback) { calculateDirection (target.transform.position, true); //NetworkManager.Send (CardAttackProtocol.Prepare (GameManager.matchID, attack, fieldPosition), ProcessSummonCard); target.receiveAttack (dmg); if (damageback) { clicked.receiveAttack (target.dmg); } canAttackNow = false; }
public void attackWith(int attackerIndex, int attackedIndex) { GameObject attackerObj = (GameObject)GameManager.player2.cardsInPlay [attackerIndex]; AbstractCard attackerCard = attackerObj.GetComponent <AbstractCard> (); bool damageBack = false; GameObject attackedObj = (GameObject)GameManager.player1.cardsInPlay [attackedIndex]; AbstractCard attackedCard = attackedObj.GetComponent <AbstractCard> (); if (attackedCard.diet != AbstractCard.DIET.HERBIVORE) { damageBack = true; attackerCard.receiveAttack(attackedCard.dmg); } attackerCard.attack(attackerCard, attackedCard, damageBack); }