Add card and shield tapping

develop
Nathan Steel 1 year ago
parent 562535234a
commit 5b5b0bde86

@ -470,8 +470,18 @@ class Board{
if(name == 'opponentShield'){ if(name == 'opponentShield'){
// This should tap the card first, then after all shields // This should tap the card first, then after all shields
// are tapped, THEN attacking destroys them // are tapped, THEN attacking destroys them
array.splice(index, 1); if(array[index].tapped){
// Untap
array[index].tapped = false;
// Add to hand
opponentHand.push(array[index]); opponentHand.push(array[index]);
// Remove from shield zone
array.splice(index, 1);
}else{
array[index].tapped = true;
}
playerBoard[attackingCard[1]].tapped = true;
this.endAttack(); this.endAttack();
return 1; return 1;
} }
@ -721,7 +731,7 @@ canvas.addEventListener('click', function(event) {
if(attackingCard !== null && card == attackingCard[0]){ if(attackingCard !== null && card == attackingCard[0]){
board.endAttack(); board.endAttack();
} }
if(!specialEvent){ if(!specialEvent && card.tapped != true){
board.startAttack(index); board.startAttack(index);
} }
board.drawBoard(); board.drawBoard();
@ -812,5 +822,7 @@ function untap(array){
} }
function untapAll(){ function untapAll(){
untap(playerMana); untap(playerMana);
untap(playerBoard);
untap(opponentShield);
} }

Loading…
Cancel
Save