Add new stuff/compendium

This commit is contained in:
2021-01-21 17:16:01 +01:00
parent 8c5b6e9c82
commit 934e959dfb
58 changed files with 510 additions and 116 deletions

View File

@ -53,27 +53,53 @@ export class SoSCardDeck {
}
/* -------------------------------------------- */
drawEdge() {
this.data.cardEdge.push( this.data.deck.pop() );
this.data.cardEdge.push( this.data.deck.pop() );
console.log("DRAW EDGE", this.data.cardEdge);
drawEdge( edgeNumber ) {
for (let i=0; i<edgeNumber; i++) {
this.data.cardEdge.push( this.data.deck.pop() );
console.log("DRAW EDGE", this.data.cardEdge);
}
}
/* -------------------------------------------- */
cleanCardList() {
this.data.discard = []; // Reinit discard pile
this.data.deck = [];
this.data.cardEdge = [];
for (let i = 0; i < NB_POKER_CARD; i++) {
this.data.cardState[i] = false;
}
}
/* -------------------------------------------- */
doFlipStat( statData ) {
doFlipFromDeck( ) {
let card = this.data.deck.pop();
this.data.discard.push( card );
console.log("CARD IS : ", card, this.data.deck.length );
}
/* -------------------------------------------- */
getDeckHTML( ) {
return "<img class='view-deck flip-card' src='systems/foundryvtt-shadows-over-sol/img/cards/card_back.webp' />";
}
/* -------------------------------------------- */
getEdgeHTML( ) {
let html = "";
for (let edge of this.data.cardEdge) {
html += `<img class='view-discard flip-card' src='systems/foundryvtt-shadows-over-sol/img/cards/${edge.cardName}.webp' />`
}
return html;
}
/* -------------------------------------------- */
getDiscardTopHTML( ) {
let html = "";
console.log( "DISCARD: ", this.data.discard );
if ( this.data.discard.length > 0) {
let card = this.data.discard[this.data.discard.length-1];
html = `<img class='view-discard flip-card' src='systems/foundryvtt-shadows-over-sol/img/cards/${card.cardName}.webp' />`;
}
return html;
}
}