Manage GM cards
This commit is contained in:
@@ -54,8 +54,12 @@ export class SoSActor extends Actor {
|
||||
super.prepareData();
|
||||
|
||||
if ( !this.cardDeck ) {
|
||||
this.cardDeck = new SoSCardDeck();
|
||||
this.cardDeck.initCardDeck( this, this.data.data.internals.deck );
|
||||
if ( this.hasPlayerOwner) {
|
||||
this.cardDeck = new SoSCardDeck();
|
||||
this.cardDeck.initCardDeck( this, this.data.data.internals.deck );
|
||||
} else {
|
||||
this.cardDeck = game.system.sos.gmDeck;
|
||||
}
|
||||
}
|
||||
this.controlScores();
|
||||
}
|
||||
@@ -100,10 +104,14 @@ export class SoSActor extends Actor {
|
||||
/* -------------------------------------------- */
|
||||
saveDeck( ) {
|
||||
let deck = { deck: duplicate(this.cardDeck.data.deck),
|
||||
discard: duplicate(this.cardDeck.data.discard),
|
||||
cardEdge: duplicate(this.cardDeck.data.cardEdge)
|
||||
}
|
||||
this.update( { 'data.internals.deck': deck });
|
||||
discard: duplicate(this.cardDeck.data.discard),
|
||||
cardEdge: duplicate(this.cardDeck.data.cardEdge)
|
||||
}
|
||||
if ( this.hasPlayerOwner ) {
|
||||
this.update( { 'data.internals.deck': deck });
|
||||
} else {
|
||||
game.settings.set("foundryvtt-shadows-over-sol", "gmDeck", deck );
|
||||
}
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
|
||||
Reference in New Issue
Block a user