Drop/Render: Add card quality

Assign random card quality on drop
Render different border colors based on quality
This commit is contained in:
2022-08-28 22:52:52 +02:00
parent dea943bee4
commit 566a9c5818
4 changed files with 13 additions and 4 deletions

View File

@@ -28,11 +28,11 @@ module.exports = {
//get number of characters in database
const characterId = Math.floor(Math.random() * await CardUtils.getCharacterCount()) + 1;
console.log(`characterId: ${characterId}`);
//random number between 1 and 6
let newCard = await Card.create({
characterId: characterId,
identifier: CardUtils.generateIdentifier(),
quality: 1,
quality: Math.floor(Math.random() * 6) + 1,
printNr: await CardUtils.getNextPrintNumber(characterId),
});