Add card and shield tapping

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

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

Loading…
Cancel
Save