Compare commits
3 commits
Author | SHA1 | Date | |
---|---|---|---|
fc3c98f1bb | |||
c9f7c443cf | |||
434f162a01 |
3 changed files with 6 additions and 7 deletions
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "card-drop",
|
||||
"version": "0.9.1",
|
||||
"version": "0.9.2",
|
||||
"main": "./dist/bot.js",
|
||||
"typings": "./dist",
|
||||
"scripts": {
|
||||
|
|
|
@ -39,12 +39,11 @@ export default class GetUnclaimedCardsHelper {
|
|||
const allCards = CoreClient.Cards
|
||||
.flatMap(x => x.cards)
|
||||
.filter(x => x.type == rarity)
|
||||
.filter(x => !claimedCards.find(y => y.CardNumber == x.id));
|
||||
.filter(x => !claimedCards.find(y => y.CardNumber == x.id && y.Quantity > 0));
|
||||
|
||||
if (!allCards) {
|
||||
AppLogger.LogError("CardDropHelperMetadata/GetRandomCardByRarityUnclaimed", `No cards found to randomise from, User Id: ${userId}, rarity: ${rarity}`);
|
||||
|
||||
return undefined;
|
||||
if (!allCards || allCards.length == 0) {
|
||||
// There is no card left unclaimed, fallback to any card
|
||||
return GetCardsHelper.GetRandomCardByRarity(rarity);
|
||||
};
|
||||
|
||||
const randomCardIndex = Math.floor(Math.random() * allCards.length);
|
||||
|
|
|
@ -151,7 +151,7 @@ export default class EffectHelper {
|
|||
AppLogger.LogInfo("EffectHelper", `Created initial user entity for : ${userId}`);
|
||||
}
|
||||
|
||||
if (user.Currency < totalCost) {
|
||||
if (!disabled && user.Currency < totalCost) {
|
||||
return `You don't have enough currency to buy this! You have \`${user.Currency} Currency\` and need \`${totalCost} Currency\`!`;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue