public void executeAttack() { if (Cbase != null && Cbase.card != null && card.owner != Cbase.card.owner && attack(getBasePower(), Cbase.getBasePower())) { if (Cbase.conquer(card.owner)) { Cbase.executeAttack(); } } if (Cleft != null && Cleft.card != null && card.owner != Cleft.card.owner && attack(getLeftPower(), Cleft.getLeftPower())) { if (Cleft.conquer(card.owner)) { Cleft.executeAttack(); } } if (Cright != null && Cright.card != null && card.owner != Cright.card.owner && attack(getRightPower(), Cright.getRightPower())) { if (Cright.conquer(card.owner)) { Cright.executeAttack(); } } }
public void execute(Card attacker) { CardSpace cSpace = attacker.transform.parent.GetComponent <CardSpace>(); cSpace.executeAttack(); }