com.megacrit.cardcrawl.powers.DexterityPower Java Examples

The following examples show how to use com.megacrit.cardcrawl.powers.DexterityPower. 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: FlowPower.java    From FruityMod-StS with MIT License 6 votes vote down vote up
@Override
public void onAfterUseCard(AbstractCard card, UseCardAction action) {
    super.onAfterUseCard(card, action);
    if (
            (owner.hasPower("Tranquil_AttunedAttackPower") && card.type == AbstractCard.CardType.ATTACK)
        //|| (owner.hasPower("Tranquil_AttunedSkillPower") && card.type == AbstractCard.CardType.SKILL)
    ) {
        this.amount++;
        AbstractDungeon.actionManager.addToBottom(new ApplyPowerAction(owner, owner,
                new StrengthPower(owner, 1), 1));
        AbstractDungeon.actionManager.addToBottom(new ApplyPowerAction(owner, owner,
                new DexterityPower(owner, 1), 1));
    } else {
        AbstractDungeon.actionManager.addToBottom(new ApplyPowerAction(owner, owner,
                new StrengthPower(owner, -1 * amount), -1 * amount));
        AbstractDungeon.actionManager.addToBottom(new ApplyPowerAction(owner, owner,
                new DexterityPower(owner, -1 * amount), -1 * amount));
        AbstractDungeon.actionManager.addToBottom(new RemoveSpecificPowerAction(owner, owner, this));
    }
}
 
Example #2
Source File: ChastityMemory.java    From jorbs-spire-mod with MIT License 5 votes vote down vote up
@Override
public void onRemember() {
    AbstractDungeon.actionManager.addToBottom(
            new ApplyPowerAction(owner, owner, new DexterityPower(owner, DEXTERITY_ON_REMEMBER), DEXTERITY_ON_REMEMBER));

    if (!AbstractDungeon.getMonsters().areMonstersBasicallyDead()) {
        for (AbstractMonster monster : AbstractDungeon.getMonsters().monsters) {
            if (!monster.halfDead && !monster.isDead && !monster.isDying) {
                AbstractDungeon.actionManager.addToTop(
                        new ApplyPowerAction(monster, owner, new WeakPower(monster, WEAK_ON_REMEMBER, false), WEAK_ON_REMEMBER));
            }
        }
    }
}
 
Example #3
Source File: ChastityMemory.java    From jorbs-spire-mod with MIT License 5 votes vote down vote up
@Override
public void atEndOfTurnPreEndTurnCards() {
    if (isPassiveEffectActive()) {
        AbstractDungeon.actionManager.addToBottom(
                // It's important to apply a negative dex power rather than reducing an existing dex power
                //   1. reducing the existing power doesn't work if the player currently has no dex
                //   2. we want it to be blockable by Artifact, which ApplyPowerAction is and ReducePowerAction isn't
                new ApplyPowerAction(owner, owner, new DexterityPower(this.owner, -DEXTERITY_LOSS_PER_TURN)));
        AbstractDungeon.actionManager.addToBottom(
                new GainBlockAction(owner, owner, BLOCK_PER_TURN));
    }
}
 
Example #4
Source File: SeekerMod.java    From FruityMod-StS with MIT License 5 votes vote down vote up
@Override
public void receivePowersModified() {
    AbstractPlayer p = AbstractDungeon.player;

    if (p != null && p.hasRelic("PaperPengwin")) {
        if (moreThanXStacks(p, "Weakened", PaperPengwin.MIN_STACKS) ||
                moreThanXStacks(p, "Vulnerable", PaperPengwin.MIN_STACKS) ||
                moreThanXStacks(p, "Frail", PaperPengwin.MIN_STACKS)) {
            if (!isApplyingPaperPengwin) {
                AbstractDungeon.actionManager.addToTop(
                        new ApplyPowerAction(p, p, new DexterityPower(p, PaperPengwin.MIN_STACKS), PaperPengwin.MIN_STACKS));
                AbstractDungeon.actionManager.addToTop(
                        new ApplyPowerAction(p, p, new StrengthPower(p, PaperPengwin.MIN_STACKS), PaperPengwin.MIN_STACKS));
                isApplyingPaperPengwin = true;
                p.getRelic("PaperPengwin").flash();
                ((PaperPengwin) p.getRelic("PaperPengwin")).setPulse(true);
            }
        } else {
            if (isApplyingPaperPengwin) {
                AbstractDungeon.actionManager.addToTop(
                        new ApplyPowerAction(p, p, new DexterityPower(p, -1 * PaperPengwin.MIN_STACKS), -1 * PaperPengwin.MIN_STACKS));
                AbstractDungeon.actionManager.addToTop(
                        new ApplyPowerAction(p, p, new StrengthPower(p, -1 * PaperPengwin.MIN_STACKS), -1 * PaperPengwin.MIN_STACKS));
                isApplyingPaperPengwin = false;
                ((PaperPengwin) p.getRelic("PaperPengwin")).setPulse(false);
            }
        }
    }
}
 
Example #5
Source File: CelerityPower.java    From FruityMod-StS with MIT License 5 votes vote down vote up
@Override
public void receivePostExhaust(AbstractCard c) {
    if (c.isEthereal) {
        this.flash();
        AbstractDungeon.actionManager.addToBottom(new ApplyPowerAction(
                this.owner, this.owner,
                new DexterityPower(this.owner, this.amount), this.amount));
    }
}
 
Example #6
Source File: CommonPower.java    From StS-DefaultModBase with MIT License 5 votes vote down vote up
@Override
public void atEndOfTurn(final boolean isPlayer) {
    int count = 0;
    for (final AbstractCard c : AbstractDungeon.actionManager.cardsPlayedThisTurn) {
        // This is how you iterate through arrays (like the one above) and card groups like
        // "AbstractDungeon.player.masterDeck.getAttacks().group" - every attack in your actual master deck.
        // Read up on java's enhanced for-each loops if you want to know more on how these work.

        ++count; // At the end of your turn, increase the count by 1 for each card played this turn.
    }

    if (count > 0) {
        flash(); // Makes the power icon flash.
        for (int i = 0; i < count; ++i) {
            AbstractDungeon.actionManager.addToBottom(
                    new ReducePowerAction(owner, owner, DexterityPower.POWER_ID, amount));
            // Reduce the power by 1 for each count - i.e. for each card played this turn.
            // DO NOT HARDCODE YOUR STRINGS ANYWHERE: i.e. don't write any Strings directly i.e. "Dexterity" for the power ID above.
            // Use the power/card/relic etc. and fetch it's ID like shown above. It's really bad practice to have "Strings" in your code:

            /*
             * 1. It's bad for if somebody likes your mod enough (or if you decide) to translate it.
             * Having only the JSON files for translation rather than 15 different instances of "Dexterity" in some random cards is A LOT easier.
             *
             * 2. You don't have a centralised file for all strings for easy proof-reading, and if you ever want to change a string
             * you now have to go through all your files individually.
             *
             * 3. Without hardcoded strings, editing a string doesn't require a compile, saving you time (unless you clean+package).
             *
             */
        }
    }

}
 
Example #7
Source File: Moss.java    From jorbs-spire-mod with MIT License 4 votes vote down vote up
@Override
public void useMaterialComponent(AbstractPlayer p, AbstractMonster m) {
    addToBot(new ApplyPowerAction(p, p, new DexterityPower(p, magicNumber), magicNumber));
    addToBot(new ApplyPowerAction(p, p, new LoseDexterityPower(p, magicNumber), magicNumber));
}
 
Example #8
Source File: OakLeaf.java    From jorbs-spire-mod with MIT License 4 votes vote down vote up
@Override
public void useMaterialComponent(AbstractPlayer p, AbstractMonster m) {
    addToBot(new ApplyPowerAction(p, p, new DexterityPower(p, magicNumber), magicNumber));
}
 
Example #9
Source File: PrideMemory.java    From jorbs-spire-mod with MIT License 4 votes vote down vote up
@Override
public void onGainPassiveEffect() {
    // It is by design that the dexterity decrease can be blocked by Artifact.
    AbstractDungeon.actionManager.addToBottom(new ApplyPowerAction(owner, owner, new DexterityPower(owner, PASSIVE_DEXTERITY_MODIFIER), PASSIVE_DEXTERITY_MODIFIER));
}
 
Example #10
Source File: PrideMemory.java    From jorbs-spire-mod with MIT License 4 votes vote down vote up
@Override
public void onLosePassiveEffect() {
    AbstractDungeon.actionManager.addToBottom(new ApplyPowerAction(owner, owner, new DexterityPower(owner, -PASSIVE_DEXTERITY_MODIFIER), -PASSIVE_DEXTERITY_MODIFIER));
}
 
Example #11
Source File: Premonitions.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 ApplyPowerAction(p, p, new DexterityPower(p, this.magicNumber), this.magicNumber));
    AbstractDungeon.actionManager.addToBottom(new ApplyPowerAction(p, p, new PremonitionsPower(p, 1), 1));
}
 
Example #12
Source File: SiphonSpeed.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 GainBlockAction(p, p, this.block));
    AbstractDungeon.actionManager.addToBottom(new ApplyPowerAction(p, p, new DexterityPower(p, DEX_GAIN_AMT), DEX_GAIN_AMT));
    AbstractDungeon.actionManager.addToBottom(new ApplyPowerAction(m, p, new WeakPower(m, this.magicNumber, false), this.magicNumber));
}
 
Example #13
Source File: CommonPower.java    From StS-DefaultModBase with MIT License 4 votes vote down vote up
@Override
public void onUseCard(final AbstractCard card, final UseCardAction action) {
    AbstractDungeon.actionManager.addToBottom(new ApplyPowerAction(owner, owner,
            new DexterityPower(owner, amount), amount));
}