com.megacrit.cardcrawl.actions.common.DrawCardAction Java Examples

The following examples show how to use com.megacrit.cardcrawl.actions.common.DrawCardAction. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: Transference.java    From FruityMod-StS with MIT License 5 votes vote down vote up
@Override
public void use(AbstractPlayer p, AbstractMonster m) {
    int powerCount = GetPowerCount(p, "Weakened");
    if (powerCount > 0) {
        AbstractDungeon.actionManager.addToBottom(new RemoveSpecificPowerAction(p, p, "Weakened"));
        AbstractDungeon.actionManager.addToBottom(new ApplyPowerAction(m, p, new WeakPower(m, powerCount, false), powerCount));
    }
    powerCount = GetPowerCount(p, "Vulnerable");
    if (powerCount > 0) {
        AbstractDungeon.actionManager.addToBottom(new RemoveSpecificPowerAction(p, p, "Vulnerable"));
        AbstractDungeon.actionManager.addToBottom(new ApplyPowerAction(m, p, new VulnerablePower(m, powerCount, false), powerCount));
    }
    AbstractDungeon.actionManager.addToBottom(new DrawCardAction(p, this.magicNumber));
}
 
Example #2
Source File: TroublePower.java    From jorbs-spire-mod with MIT License 5 votes vote down vote up
@Override
public void onCardDraw(AbstractCard card) {
    if (card.type == AbstractCard.CardType.CURSE) {
        this.flash();
        AbstractDungeon.actionManager.addToBottom(new DrawCardAction(owner, amount));
    }
}
 
Example #3
Source File: Mania.java    From jorbs-spire-mod with MIT License 5 votes vote down vote up
@Override
public void use(AbstractPlayer p, AbstractMonster m) {
    addToBot(new DamageAction(m, new DamageInfo(p, damage), AttackEffect.SLASH_VERTICAL));

    if (isEligibleForExtraEffect()) {
        addToBot(new GainEnergyAction(metaMagicNumber));
        addToBot(new DrawCardAction(p, urMagicNumber));
    }
}
 
Example #4
Source File: FranticMind.java    From jorbs-spire-mod with MIT License 5 votes vote down vote up
@Override
public void use(AbstractPlayer p, AbstractMonster abstractMonster) {
    if (magicNumber > 0) {
        addToBot(new DiscardAction(p, p, magicNumber, false));
        addToBot(new DrawCardAction(magicNumber));
    }
}
 
Example #5
Source File: SeekerMod.java    From FruityMod-StS with MIT License 5 votes vote down vote up
@Override
public void receivePostDraw(AbstractCard c) {
    if (c instanceof Convergence) {
        c.superFlash();
        if (c.upgraded) {
            AbstractDungeon.actionManager.addToTop(new DrawCardAction(AbstractDungeon.player, 1));
        }
        AbstractDungeon.actionManager.addToBottom(new WaitAction(Settings.ACTION_DUR_FAST));
        AbstractDungeon.actionManager.addToBottom(new ConvergenceAction(c.upgraded));
    }
}
 
Example #6
Source File: HypothesisAction.java    From FruityMod-StS with MIT License 5 votes vote down vote up
@Override
public void update() {
    this.listening = true;
    AbstractDungeon.actionManager.addToTop(new DrawCardAction(
            AbstractDungeon.player, this.initialDraw));
    this.isDone = true;
}
 
Example #7
Source File: RefuseToForget.java    From jorbs-spire-mod with MIT License 5 votes vote down vote up
@Override
public void use(AbstractPlayer p, AbstractMonster m) {
    MemoryManager mm = MemoryManager.forPlayer(p);
    if (mm != null && mm.currentMemory != null && !mm.currentMemory.isClarified) {
        addToBot(new ApplyPowerAction(p, p, new MustClarifyBeforeRememberingNewMemoriesPower(p, mm.currentMemory.ID)));
    }

    addToBot(new DrawCardAction(p, magicNumber));
    addToBot(new ApplyPowerAction(p, p, new NoDrawPower(p)));
}
 
Example #8
Source File: HypothesisAction.java    From FruityMod-StS with MIT License 5 votes vote down vote up
@Override
public void receivePostDraw(AbstractCard c) {
    if (listening) {
        this.listening = false;
        if (c.isEthereal) {
            //AbstractDungeon.actionManager.addToTop(new MakeTempCardInHandAction(new Dazed(), 1, true));
            AbstractDungeon.actionManager.addToTop(new DrawCardAction(AbstractDungeon.player, this.amount));
        }
        /*
         *  calling unsubscribeFromPostBattle inside the callback
         *  for receivePostBattle means that when we're calling it
         *  there is currently an iterator going over the list
         *  of subscribers and calling receivePostBattle on each of
         *  them therefore if we immediately try to remove the this
         *  callback from the post battle subscriber list it will
         *  throw a concurrent modification exception in the iterator
         *
         *  for now we just add a delay - yes this is an atrocious solution
         *  PLEASE someone with a better idea replace it
         */
        Thread delayed = new Thread(() -> {
            try {
                Thread.sleep(200);
            } catch (Exception e) {
                System.out.println("could not delay unsubscribe to avoid ConcurrentModificationException");
                e.printStackTrace();
            }
            BaseMod.unsubscribe(this);
        });
        delayed.start();
    }
}
 
Example #9
Source File: Vortex.java    From FruityMod-StS with MIT License 5 votes vote down vote up
@Override
public void use(AbstractPlayer p, AbstractMonster m) {
    int draw = 10 - AbstractDungeon.player.hand.size();
    if (draw > 0) {
        AbstractDungeon.actionManager.addToTop(new DrawCardAction(p, draw));
        AbstractDungeon.actionManager.addToBottom(new MakeTempCardInDrawPileAction(new Dazed(), 4, false, false));
    }
}
 
Example #10
Source File: UnseenServant.java    From jorbs-spire-mod with MIT License 5 votes vote down vote up
@Override
public void use(AbstractPlayer p, AbstractMonster m) {
    addToBot(new RememberSpecificMemoryAction(p, SlothMemory.STATIC.ID));
    addToBot(new CardsToTopOfDeckAction(p, p.discardPile, this.magicNumber, false));
    if (metaMagicNumber > 0) {
        addToBot(new DrawCardAction(p, metaMagicNumber));
    }
}
 
Example #11
Source File: PrismaticSphere.java    From FruityMod-StS with MIT License 5 votes vote down vote up
@Override
public void use(AbstractPlayer p, AbstractMonster m) {
    AbstractDungeon.actionManager.addToBottom(new DamageAction((AbstractCreature) m, new DamageInfo(p, this.damage, this.damageTypeForTurn), AbstractGameAction.AttackEffect.SLASH_VERTICAL));
    if (AbstractDungeon.player.drawPile.isEmpty()) {
        AbstractDungeon.actionManager.addToBottom(new EmptyDeckShuffleAction());
    }
    AbstractDungeon.actionManager.addToBottom(new DrawCardAction(p, this.magicNumber));
}
 
Example #12
Source File: Genesis.java    From FruityMod-StS with MIT License 5 votes vote down vote up
@Override
public void use(AbstractPlayer p, AbstractMonster m) {
    AbstractDungeon.actionManager.addToBottom(new GainBlockAction(p, p, this.block));
    if (AbstractDungeon.player.drawPile.isEmpty()) {
        AbstractDungeon.actionManager.addToBottom(new EmptyDeckShuffleAction());
    }
    AbstractDungeon.actionManager.addToBottom(new DrawCardAction(p, this.magicNumber));
}
 
Example #13
Source File: Overload.java    From FruityMod-StS with MIT License 5 votes vote down vote up
@Override
public void use(AbstractPlayer p, AbstractMonster m) {
    AbstractDungeon.actionManager.addToBottom(new GainEnergyAction(this.magicNumber));
    AbstractDungeon.actionManager.addToBottom(new DrawCardAction(p, this.magicNumber));
    AbstractDungeon.actionManager.addToBottom(new ApplyPowerAction(p, p, new VulnerablePower(p, DEBUFF_AMT, true), DEBUFF_AMT));
    AbstractDungeon.actionManager.addToBottom(new ApplyPowerAction(p, p, new WeakPower(p, DEBUFF_AMT, true), DEBUFF_AMT));
    AbstractDungeon.actionManager.addToBottom(new ApplyPowerAction(p, p, new FrailPower(p, DEBUFF_AMT, true), DEBUFF_AMT));
}
 
Example #14
Source File: ProdigalMemory.java    From jorbs-spire-mod with MIT License 5 votes vote down vote up
@Override
public void use(AbstractPlayer p, AbstractMonster abstractMonster) {
    if (this.dontTriggerOnUseCard) {
        SelfExertField.selfExert.set(this, true);
        addToBot(new ExhaustSpecificCardAction(this, AbstractDungeon.player.hand));
    }
    else {
        addToBot(new DrawCardAction(DRAW));
        addToBot(new DecreaseMaxHpAction(p, p, magicNumber, AbstractGameAction.AttackEffect.POISON));
    }
}
 
Example #15
Source File: Shake.java    From jorbs-spire-mod with MIT License 5 votes vote down vote up
@Override
public void use(AbstractPlayer p, AbstractMonster abstractMonster) {
    if (abstractMonster.hasPower(VulnerablePower.POWER_ID)) {
        addToBot(new DrawCardAction(p, magicNumber));
    }
    addToBot(new ApplyPowerAction(abstractMonster, p, new VulnerablePower(abstractMonster, urMagicNumber, false)));
}
 
Example #16
Source File: Anxiety.java    From jorbs-spire-mod with MIT License 5 votes vote down vote up
@Override
public void use(AbstractPlayer p, AbstractMonster abstractMonster) {
    addToBot(new DrawCardAction(this.misc));
    addToBot(new GainEnergyAction(this.urMagicNumber));
    if (this.misc > 0) {
        this.addToBot(new IncreaseMiscAction(this.uuid, this.misc, -this.magicNumber));
    }
}
 
Example #17
Source File: DefaultOrb.java    From StS-DefaultModBase with MIT License 5 votes vote down vote up
@Override
public void onStartOfTurn() {// 1.At the start of your turn.
    AbstractDungeon.actionManager.addToBottom(// 2.This orb will have a flare effect
            new VFXAction(new OrbFlareEffect(this, OrbFlareEffect.OrbFlareColor.FROST), 0.1f));

    AbstractDungeon.actionManager.addToBottom(// 3. And draw you cards.
            new DrawCardAction(AbstractDungeon.player, passiveAmount));
}
 
Example #18
Source File: Feast.java    From jorbs-spire-mod with MIT License 4 votes vote down vote up
@Override
public void use(AbstractPlayer p, AbstractMonster m) {
    addToBot(new RememberSpecificMemoryAction(p, GluttonyMemory.STATIC.ID));
    addToBot(new DrawCardAction(p, magicNumber, false));
}
 
Example #19
Source File: Eureka.java    From FruityMod-StS with MIT License 4 votes vote down vote up
@Override
public void use(AbstractPlayer p, AbstractMonster m) {
    AbstractDungeon.actionManager.addToBottom(new MakeTempCardInDrawPileAction(new Dazed(), DAZED_COUNT, true, true));
    AbstractDungeon.actionManager.addToBottom(new DrawCardAction(p, this.magicNumber));
    AbstractDungeon.actionManager.addToBottom(new GainEnergyAction(this.magicNumber));
}
 
Example #20
Source File: Corona.java    From FruityMod-StS with MIT License 4 votes vote down vote up
@Override
public void use(AbstractPlayer p, AbstractMonster m) {
    AbstractDungeon.actionManager.addToBottom(new DrawCardAction(p, this.magicNumber));
}
 
Example #21
Source File: EclipsePower.java    From FruityMod-StS with MIT License 4 votes vote down vote up
public void onCardDraw(AbstractCard card) {
    if (card.isEthereal) {
        this.flash();
        AbstractDungeon.actionManager.addToBottom(new DrawCardAction(this.owner, this.amount));// 38
    }
}
 
Example #22
Source File: CreativityPower.java    From FruityMod-StS with MIT License 4 votes vote down vote up
@Override
public void atStartOfTurn() {
    this.flash();
    AbstractDungeon.actionManager.addToBottom(new MakeTempCardInDrawPileAction(new Dazed(), this.amount, true, true));
    AbstractDungeon.actionManager.addToBottom(new DrawCardAction(this.owner, this.amount));
}
 
Example #23
Source File: DiligenceMemory.java    From jorbs-spire-mod with MIT License 4 votes vote down vote up
@Override
public void onRemember() {
    AbstractDungeon.actionManager.addToBottom(new DrawCardAction(owner, CARDS_DRAWN_ON_ENTER));
}
 
Example #24
Source File: SiphonEnergy.java    From jorbs-spire-mod with MIT License 4 votes vote down vote up
@Override
public void use(AbstractPlayer p, AbstractMonster m) {
    addToBot(new DrawCardAction(p, metaMagicNumber));
    addToBot(new GainEnergyAction(magicNumber));
}
 
Example #25
Source File: LooseLeaf.java    From jorbs-spire-mod with MIT License 4 votes vote down vote up
@Override
public void useMaterialComponent(AbstractPlayer p, AbstractMonster m) {
    addToBot(new DrawCardAction(p, magicNumber));
}
 
Example #26
Source File: Index.java    From jorbs-spire-mod with MIT License 4 votes vote down vote up
@Override
public void use(AbstractPlayer p, AbstractMonster m) {
    addToBot(new DrawCardAction(p, this.magicNumber));
    addToBot(new CardsToTopOfDeckAction(p, p.hand, this.metaMagicNumber, true));
}
 
Example #27
Source File: IvoryTower.java    From jorbs-spire-mod with MIT License 4 votes vote down vote up
@Override
public void use(AbstractPlayer p, AbstractMonster m) {
    addToBot(new DrawCardAction(p, magicNumber, false));
    addToBot(new ExhaustCardsMatchingPredicateAction(p, p.hand,
            c -> c.type == CardType.CURSE || c.type == CardType.STATUS));
}
 
Example #28
Source File: MistyStep.java    From jorbs-spire-mod with MIT License 4 votes vote down vote up
@Override
public void use(AbstractPlayer p, AbstractMonster m) {
    addToBot(new GainBlockAction(p, p, block));
    addToBot(new DrawCardAction(p, magicNumber));
}
 
Example #29
Source File: ParryingBlow.java    From jorbs-spire-mod with MIT License 4 votes vote down vote up
@Override
public void use(AbstractPlayer p, AbstractMonster m) {
    addToBot(new RememberSpecificMemoryAction(p, PatienceMemory.STATIC.ID));
    addToBot(new DamageAction(m, new DamageInfo(p, damage), AttackEffect.SLASH_HORIZONTAL));
    addToBot(new DrawCardAction(magicNumber));
}
 
Example #30
Source File: GatherPower.java    From jorbs-spire-mod with MIT License 4 votes vote down vote up
@Override
public void use(AbstractPlayer p, AbstractMonster m) {
    addToBot(new DrawCardAction(p, magicNumber));
    addToBot(new ApplyPowerAction(p, p, new PlayNextAttackThisTurnAdditionalTimesPower(p, metaMagicNumber), metaMagicNumber));
}