package xyz.luxnk.mxmmod.cards;

import basemod.abstracts.CustomCard;
import com.megacrit.cardcrawl.cards.AbstractCard;
import com.megacrit.cardcrawl.characters.AbstractPlayer;
import com.megacrit.cardcrawl.core.CardCrawlGame;
import com.megacrit.cardcrawl.dungeons.AbstractDungeon;
import com.megacrit.cardcrawl.localization.CardStrings;
import com.megacrit.cardcrawl.monsters.AbstractMonster;
import xyz.luxnk.mxmmod.action.LuckyCatAction;
import xyz.luxnk.mxmmod.patches.AbstractCardEnum;

public class LuckyCat_MXM extends CustomCard {

    public static final String ID = "LuckyCat_MXM";
    private static final CardStrings cardStrings = CardCrawlGame.languagePack.getCardStrings(ID);
    public static final String NAME = cardStrings.NAME;
    public static final String DESCRIPTION = cardStrings.DESCRIPTION;
    public static final String DESCRIPTION_UPG = cardStrings.UPGRADE_DESCRIPTION;
    public static final String IMG_PATH = "img/cards/skill/lucky_cat.png";
    private static final int COST = 1;

    public LuckyCat_MXM() {
        super(
                ID,
                NAME,
                IMG_PATH,
                COST,
                DESCRIPTION,
                CardType.SKILL,
                AbstractCardEnum.MXM_COLOR,
                CardRarity.RARE,
                CardTarget.SELF
        );
        this.exhaust = true;
    }

    @Override
    public void use(AbstractPlayer abstractPlayer, AbstractMonster abstractMonster) {
        AbstractDungeon.actionManager.addToBottom(
                new LuckyCatAction(1)
        );
    }

    @Override
    public boolean canUse(AbstractPlayer p, AbstractMonster m) {
        if (p.drawPile.isEmpty()) {
            return false;
        }
        return true;
    }

    @Override
    public AbstractCard makeCopy() {
        return new LuckyCat_MXM();
    }

    @Override
    public void upgrade() {
        if (!this.upgraded) {
            upgradeName();
            upgradeBaseCost(0);
            this.rawDescription = DESCRIPTION_UPG;
        }
    }
}
