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");
|
const hasChanceUpEffect = await EffectHelper.HasEffect(interaction.user.id, "unclaimed");
|
||||||
|
|
||||||
|
console.log(hasChanceUpEffect);
|
||||||
|
|
||||||
if (hasChanceUpEffect && Math.random() <= CardConstants.UnusedChanceUpChance) {
|
if (hasChanceUpEffect && Math.random() <= CardConstants.UnusedChanceUpChance) {
|
||||||
randomCard = await CardDropHelperMetadata.GetRandomCardUnclaimed(interaction.user.id);
|
randomCard = await CardDropHelperMetadata.GetRandomCardUnclaimed(interaction.user.id);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -37,16 +37,19 @@ export default class EffectHelper {
|
||||||
const now = new Date();
|
const now = new Date();
|
||||||
|
|
||||||
if (!effect || effect.Unused == 0) {
|
if (!effect || effect.Unused == 0) {
|
||||||
|
console.log(1);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
const effectDetail = EffectDetails.get(effect.Id);
|
const effectDetail = EffectDetails.get(effect.Name);
|
||||||
|
|
||||||
if (!effectDetail) {
|
if (!effectDetail) {
|
||||||
|
console.log(2);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (effect.WhenExpires && now < new Date(effect.WhenExpires.getMilliseconds() + effectDetail.cooldown)) {
|
if (effect.WhenExpires && now < new Date(effect.WhenExpires.getMilliseconds() + effectDetail.cooldown)) {
|
||||||
|
console.log(3);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue