Create use effect command #419

Open
Vylpes wants to merge 23 commits from feature/380-use-effect into develop
2 changed files with 6 additions and 1 deletions
Showing only changes of commit a3f307d87e - Show all commits

View file

@ -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 {

View file

@ -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;
}