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

The following examples show how to use com.megacrit.cardcrawl.cards.AbstractCard#makeStatEquivalentCopy() . 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: ArcaneWeaponPower.java    From jorbs-spire-mod with MIT License 6 votes vote down vote up
public ArcaneWeaponPower(final AbstractCreature owner, final AbstractCard backingCard) {
    super(STATIC);

    // This prevents the power from stacking with other instances of itself for different card instances.
    // This is the same strategy used by TheBombPower.
    //
    // StSLib provides a NonStackablePower interface with similar functionality, but we're intentionally not using
    // it because it is hackier than the ID thing.
    ID = POWER_ID + "__" + (++instanceCounter);

    this.type = PowerType.BUFF;
    this.owner = owner;
    this.backingCard = backingCard.makeStatEquivalentCopy();

    updateDescription();
}
 
Example 2
Source File: EffectUtils.java    From jorbs-spire-mod with MIT License 6 votes vote down vote up
public static void addWrathCardUpgradeEffect(AbstractCard cardToShowForVfx) {
    AbstractCard card = cardToShowForVfx.makeStatEquivalentCopy();
    ShowCardBrieflyEffect showCardBrieflyEffect = new ShowCardBrieflyEffect(card);
    float duration = Settings.FAST_MODE ? Settings.ACTION_DUR_XLONG : showCardBrieflyEffect.startingDuration;
    showCardBrieflyEffect.duration = showCardBrieflyEffect.startingDuration = duration;
    AbstractDungeon.topLevelEffects.add(showCardBrieflyEffect);
    AbstractDungeon.topLevelEffects.add(new GradeChangeShineEffect(
            (float) Settings.WIDTH / 2.0F,
            (float) Settings.HEIGHT / 2.0F,
            Settings.ACTION_DUR_MED,
            () -> CardCrawlGame.sound.playAV("CARD_BURN", -0.5F, 2.0F),
            () -> getWrathEffect(card),
            null,
            false));
    AbstractDungeon.actionManager.addToTop(new WaitAction(duration));
}
 
Example 3
Source File: BranchingUpgradesPatch.java    From StSLib with MIT License 5 votes vote down vote up
@SpireInsertPatch(
        locator = Locator.class
)
public static void Insert(GridCardSelectScreen __instance) {
    AbstractCard c = getHoveredCard();
    if (c instanceof BranchingUpgradesCard) {
        AbstractCard previewCard = c.makeStatEquivalentCopy();
        ((BranchingUpgradesCard) previewCard).doBranchUpgrade();
        previewCard.displayUpgrades();
        BranchSelectFields.branchUpgradePreviewCard.set(__instance, previewCard);
        BranchSelectFields.waitingForBranchUpgradeSelection.set(__instance, true);
    }
}
 
Example 4
Source File: BranchingUpgradesPatch.java    From StSLib with MIT License 5 votes vote down vote up
@SpireInsertPatch(
        locator = BranchLocator.class,
        localvars = {"copy"}
)
public static void InsertBranchPreview(SingleCardViewPopup __instance, SpriteBatch sb, AbstractCard ___card, @ByRef AbstractCard[] copy) {
    if (___card instanceof BranchingUpgradesCard) {
        if (BranchUpgradeButton.isViewingBranchUpgrade.get(__instance) && ((BranchingUpgradesCard) ___card).getUpgradeType() == BranchingUpgradesCard.UpgradeType.RANDOM_UPGRADE) {
            copy[0] = ___card.makeStatEquivalentCopy();
            ((BranchingUpgradesCard) ___card).doBranchUpgrade();
            ___card.displayUpgrades();
        }
    }
}