Create use effect command #419
2 changed files with 6 additions and 1 deletions
|
@ -53,6 +53,8 @@ export default class Drop extends Command {
|
|||
|
||||
const hasChanceUpEffect = await EffectHelper.HasEffect(interaction.user.id, "unclaimed");
|
||||
|
||||
console.log(hasChanceUpEffect);
|
||||
|
||||
if (hasChanceUpEffect && Math.random() <= CardConstants.UnusedChanceUpChance) {
|
||||
randomCard = await CardDropHelperMetadata.GetRandomCardUnclaimed(interaction.user.id);
|
||||
} else {
|
||||
|
|
|
@ -37,16 +37,19 @@ export default class EffectHelper {
|
|||
const now = new Date();
|
||||
|
||||
if (!effect || effect.Unused == 0) {
|
||||
console.log(1);
|
||||
return false;
|
||||
}
|
||||
|
||||
const effectDetail = EffectDetails.get(effect.Id);
|
||||
const effectDetail = EffectDetails.get(effect.Name);
|
||||
|
||||
if (!effectDetail) {
|
||||
console.log(2);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (effect.WhenExpires && now < new Date(effect.WhenExpires.getMilliseconds() + effectDetail.cooldown)) {
|
||||
console.log(3);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue