First setup

This commit is contained in:
2021-01-19 22:54:53 +01:00
parent e78b2ac67d
commit 8c5b6e9c82
26 changed files with 199 additions and 61 deletions

View File

@ -42,7 +42,7 @@ export class SoSActor extends Actor {
if ( !this.cardDeck ) {
this.cardDeck = new SoSCardDeck();
this.cardDeck.initCardDeck( this );
this.cardDeck.initCardDeck( this, this.data.data.internals.deck );
}
this.controlScores();
}
@ -55,8 +55,19 @@ export class SoSActor extends Actor {
return edgesCard;
}
/* -------------------------------------------- */
drawEdge( ) {
resetDeck( ) {
this.cardDeck.shuffleDeck();
this.cardDeck.drawEdge();
this.saveDeck();
}
/* -------------------------------------------- */
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 });
}
/* -------------------------------------------- */
@ -79,7 +90,7 @@ export class SoSActor extends Actor {
}
/* -------------------------------------------- */
computeEdge( ) {
return Math.ceil( (this.data.data.stats.intelligence.value + this.data.data.stats.charisma.value) / 2);
return Math.ceil( (this.data.data.stats.intelligence.value + this.data.data.stats.charisma.value) / 2) + this.data.data.scores.edge.bonus;
}
/* -------------------------------------------- */
getShock( ) {