Drop/Render: Add card quality

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

No files matched your search

+2 -2
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),
});