Fix card not playing with mana cost reached

develop
Nathan Steel 1 year ago
parent 8ebabeaa9c
commit 5691411697

@ -688,7 +688,10 @@ class Board{
let mana = items[item];
if(this.isTapped(mana) || this.isSelected(mana)){
// Deselect the mana at the start to ensure it's not doopid
this.deselectCard(mana);
if(this.isTapped(mana)){
continue;
}
@ -737,20 +740,21 @@ class Board{
let mana = items[item];
if(itemCostRemaining <= 0){
break;
}
if(this.isTapped(mana) || this.isSelected(mana)){
continue;
}
if(itemCostRemaining > 0){
manaToTap.push(mana);
itemCostRemaining--;
}
}
}
if(itemCostRemaining > 0){
return false; // Didn't find another mana to tap so cost not satiated
if(cardData[itemToPayCost].cost - manaToTap.length > 0){
return 'itemCostRemaining: '+itemCostRemaining; // Didn't find another mana to tap so cost not satiated
}
// If the mana to tap has been satitated then tap the mana selected

Loading…
Cancel
Save