Fix gameWin

develop
Nathan Steel 1 year ago
parent 03e68b9a8c
commit 3ed1be6bc8

@ -76,14 +76,14 @@ class Board{
this.drawCardsECS(); // Atop most everything atm for testing this.drawCardsECS(); // Atop most everything atm for testing
if(this.checkGameWin == true){ if(this.checkGameWin() == true){
this.drawWin(); this.drawWin();
} }
} }
checkGameWin(){ checkGameWin(){
// TODO: Change logic to ECSey, and move into main loop (for other win-cons besides direct attack) // If opponent shield is 0 then you win TODO: Otherwincons, check w/l for each player
//if(opponentShield.length <= 0){return true; if(this.remainingShieldCount(1) <= 0){return true;}
return false; return false;
} }
@ -758,6 +758,9 @@ class Board{
cardStatus[itemKey] = 'tapped'; cardStatus[itemKey] = 'tapped';
// Do any other 'on tap' effects, etc. in the future // Do any other 'on tap' effects, etc. in the future
} }
remainingShieldCount(playerId){
return getCurrentPositionAndLength('shield', playerId)[1];
}
} }
// TODO: TEMP!! Replace soon // TODO: TEMP!! Replace soon

Loading…
Cancel
Save