Java Code Examples for com.megacrit.cardcrawl.cards.AbstractCard#upgrade()

The following examples show how to use com.megacrit.cardcrawl.cards.AbstractCard#upgrade() . 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: PrideMemory.java    From jorbs-spire-mod with MIT License 6 votes vote down vote up
@Override
public void onVictory() {
    if (isPassiveEffectActive()) {
        CardGroup masterDeckCandidates = new CardGroup(CardGroup.CardGroupType.UNSPECIFIED);
        for (AbstractCard c : AbstractDungeon.player.masterDeck.group) {
            if (c.canUpgrade()) {
                masterDeckCandidates.addToBottom(c);
            }
        }

        if (!masterDeckCandidates.isEmpty()) {
            AbstractCard masterDeckCard = masterDeckCandidates.getRandomCard(AbstractDungeon.cardRandomRng);
            masterDeckCard.upgrade();
            masterDeckCard.superFlash();
            EffectUtils.addPermanentCardUpgradeEffect(masterDeckCard);
        }
    }
}
 
Example 2
Source File: MakeMaterialComponentsInHandAction.java    From jorbs-spire-mod with MIT License 5 votes vote down vote up
@Override
public void update() {
    for (int i = 0; i < this.amount; ++i) {
        AbstractCard newCard = MaterialComponentsDeck.drawRandomCard();
        if (upgraded) {
            newCard.upgrade();
        }
        int copiesToAdd = 1 + ExtraCopiesToAddWhenGeneratingCardField.field.get(newCard);
        AbstractDungeon.actionManager.addToTop(new MakeTempCardInHandAction(newCard, copiesToAdd, false));
    }
    isDone = true;
}
 
Example 3
Source File: RetrogradeUpgradedPower.java    From FruityMod-StS with MIT License 5 votes vote down vote up
@Override
public void atEndOfTurn(boolean isPlayer) {
    if (isPlayer)
        this.flash();
    AbstractCard toAdd = new Retrograde();
    toAdd.upgrade();
    AbstractDungeon.actionManager.addToBottom(new MakeTempCardInDrawPileAction(toAdd, this.amount, true, true));
    AbstractDungeon.actionManager.addToBottom(new RemoveSpecificPowerAction(AbstractDungeon.player, AbstractDungeon.player, "RetrogradeUpgradedPower"));
}
 
Example 4
Source File: SolarEgg.java    From FruityMod-StS with MIT License 4 votes vote down vote up
@Override
public void onObtainCard(AbstractCard c) {
    if (c.isEthereal && c.canUpgrade()) {
        c.upgrade();
    }
}