Skip to content
This repository has been archived by the owner on May 13, 2024. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
browntj16 committed Apr 9, 2024
2 parents a4b36f3 + 8b2f6cd commit c385a37
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions src/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,9 @@ export class Game {
}

playCard(card: Card) {

if (this.turnPhase != TurnPhases.Play){
return;
}
}
}

Expand Down Expand Up @@ -269,6 +271,7 @@ export class Card {
ability: Ability;
isReady: boolean;
ownerId: number | null = null;
board: BoardPOS | null = null;
getTargetEvent: GetTargetEvent | null;

constructor(name: string, flavorText: string, cardType: number, cost: number, landscapeType: string, ability: Ability) {
Expand Down Expand Up @@ -305,15 +308,18 @@ export class Card {
play(target: any) {
return false;
}

death(){
if(Game.instance.players[0].id==this.ownerId){
Game.instance.players[0].discardPile.push(this);
//Have to locate card here so we can pop it off the lane
//Will probably have to overload in each class to work properly
}
else{
Game.instance.players[1].discardPile.push(this);
//Have to locate card here so we can pop it off the lane
if(this.ownerId != null){
Game.instance.getPlayerById(this.ownerId).discard.push(this);
this.board.removeCreature();
}
}

returnToHand(){
if(this.ownerId != null){
Game.instance.getPlayerById(this.ownerId).hand.push(this);
this.board.removeCreature();
}
}
}
Expand Down

0 comments on commit c385a37

Please sign in to comment.