com.megacrit.cardcrawl.powers.StrengthPower Java Examples

The following examples show how to use com.megacrit.cardcrawl.powers.StrengthPower. 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: CharityMemory.java    From jorbs-spire-mod with MIT License 6 votes vote down vote up
private void updateAppliedStrength() {
    int newStrength = calculateBonusDamage();

    // We intentionally set this to the calculated value even if we aren't applying the passive effect
    setDescriptionPlaceholder("!S!", newStrength);

    if (!isPassiveEffectActive()) {
        newStrength = 0;
    }

    int strengthDelta = newStrength - strengthAlreadyApplied;
    if (strengthDelta != 0) {
        // It is by design that strength decreases can be blocked by artifact.
        AbstractDungeon.actionManager.addToBottom(new ApplyPowerAction(owner, owner, new StrengthPower(owner, strengthDelta), strengthDelta));
        flashWithoutSound();
        strengthAlreadyApplied = newStrength;
    }
}
 
Example #2
Source File: TemperanceMemory.java    From jorbs-spire-mod with MIT License 6 votes vote down vote up
private void updateAppliedStrength() {
    int newStrength = calculateBonusDamage();

    // We intentionally set this to the calculated value even if we aren't applying the passive effect
    setDescriptionPlaceholder("!S!", newStrength);

    if (!isPassiveEffectActive()) {
        newStrength = 0;
    }

    int strengthDelta = newStrength - strengthAlreadyApplied;
    if (strengthDelta != 0) {
        // It is by design that strength decreases can be blocked by artifact.
        AbstractDungeon.actionManager.addToBottom(new ApplyPowerAction(owner, owner, new StrengthPower(owner, strengthDelta), strengthDelta));
        flashWithoutSound();
        strengthAlreadyApplied = newStrength;
    }
}
 
Example #3
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 #4
Source File: Strife.java    From jorbs-spire-mod with MIT License 5 votes vote down vote up
@Override
public void use(AbstractPlayer p, AbstractMonster abstractMonster) {
    for (int i = 0; i < urMagicNumber; ++i) {
        AbstractCard c = AbstractDungeon.returnRandomCurse();
        addToBot(new MakeTempCardInDiscardAction(c, 1));
    }
    addToBot(new ApplyPowerAction(p, p, new StrengthPower(p, magicNumber)));
}
 
Example #5
Source File: GatheringEvil.java    From jorbs-spire-mod with MIT License 5 votes vote down vote up
@Override
public void use(AbstractPlayer p, AbstractMonster m) {
    if (magicNumber > 0) {
        addToBot(new ApplyPowerAction(p, p, new StrengthPower(p, magicNumber * metaMagicNumber)));
        addToBot(new ApplyPowerAction(p, p, new VulnerablePower(p, magicNumber * urMagicNumber, false)));
    }
}
 
Example #6
Source File: HoldMonster.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, KindnessMemory.STATIC.ID));

    ApplyPowerAction applyStrengthDownAction = new ApplyPowerAction(m, p, new StrengthPower(m, -this.magicNumber), -this.magicNumber);
    Runnable setupStrengthToBeRestoredAtEndOfTurn = () -> addToBot(new ApplyPowerAction(m, p, new GainStrengthPower(m, this.magicNumber), this.magicNumber));
    addToBot(new ApplyTemporaryDebuffAction(applyStrengthDownAction, setupStrengthToBeRestoredAtEndOfTurn));
}
 
Example #7
Source File: KindnessMemory.java    From jorbs-spire-mod with MIT License 5 votes vote down vote up
@Override
public void onGainPassiveEffect() {
    this.restoreStrengthActions = new ArrayList<>();

    for (AbstractMonster mo : AbstractDungeon.getCurrRoom().monsters.monsters) {
        ApplyPowerAction applyStrengthDownAction = new ApplyPowerAction(mo, owner, new StrengthPower(mo, -ENEMY_STRENGTH_REDUCTION), -ENEMY_STRENGTH_REDUCTION, true, AbstractGameAction.AttackEffect.NONE);
        Runnable setupStrengthToBeRestoredOnForget = () -> this.restoreStrengthActions.add(
                new ApplyPowerAction(mo, owner, new StrengthPower(mo, +ENEMY_STRENGTH_REDUCTION), +ENEMY_STRENGTH_REDUCTION, true, AbstractGameAction.AttackEffect.NONE));

        // addToTop is required for correct ordering with Hold Monster against enemies with 1 Artifact
        AbstractDungeon.actionManager.addToTop(new ApplyTemporaryDebuffAction(applyStrengthDownAction, setupStrengthToBeRestoredOnForget));
    }
}
 
Example #8
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 #9
Source File: PotencyPower.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 StrengthPower(this.owner, this.amount), this.amount));
    }
}
 
Example #10
Source File: PlaceholderPotion.java    From StS-DefaultModBase with MIT License 5 votes vote down vote up
@Override
public void use(AbstractCreature target) {
    target = AbstractDungeon.player;
    // If you are in combat, gain strength and the "lose strength at the end of your turn" power, equal to the potency of this potion.
    if (AbstractDungeon.getCurrRoom().phase == AbstractRoom.RoomPhase.COMBAT) {
        AbstractDungeon.actionManager.addToBottom(new ApplyPowerAction(target, AbstractDungeon.player, new StrengthPower(target, potency), potency));
        AbstractDungeon.actionManager.addToBottom(new ApplyPowerAction(target, AbstractDungeon.player, new LoseStrengthPower(target, potency), potency));
    }
}
 
Example #11
Source File: ScorchingRay.java    From jorbs-spire-mod with MIT License 4 votes vote down vote up
private void recalculateBurningAmount() {
    AbstractPower strengthPower = AbstractDungeon.player.getPower(StrengthPower.POWER_ID);
    int strength = strengthPower == null ? 0 : strengthPower.amount;
    metaMagicNumber = strength + baseMetaMagicNumber;
    isMetaMagicNumberModified = metaMagicNumber != baseMetaMagicNumber;
}
 
Example #12
Source File: StrengthNextTurnPower.java    From jorbs-spire-mod with MIT License 4 votes vote down vote up
@Override
public void atStartOfTurn() {
    flash();
    AbstractDungeon.actionManager.addToBottom(new ApplyPowerAction(owner, owner, new StrengthPower(owner, amount)));
    AbstractDungeon.actionManager.addToBottom(new RemoveSpecificPowerAction(owner, owner, this));
}
 
Example #13
Source File: LoseStrengthNextTurnPower.java    From jorbs-spire-mod with MIT License 4 votes vote down vote up
@Override
public void atStartOfTurn() {
    flash();
    AbstractDungeon.actionManager.addToBottom(new ApplyPowerAction(owner, owner, new StrengthPower(owner, -amount), -amount));
    AbstractDungeon.actionManager.addToBottom(new RemoveSpecificPowerAction(owner, owner, this));
}
 
Example #14
Source File: PowerOverwhelming.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 StrengthPower(p, this.magicNumber), this.magicNumber));
    AbstractDungeon.actionManager.addToBottom(new ApplyPowerAction(p, p, new PowerOverwhelmingPower(p, 1), 1));
}
 
Example #15
Source File: SiphonPower.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 DamageAction((AbstractCreature) m, new DamageInfo(p, this.damage, this.damageTypeForTurn), AbstractGameAction.AttackEffect.SLASH_VERTICAL));
    AbstractDungeon.actionManager.addToBottom(new ApplyPowerAction(p, p, new StrengthPower(p, STRENGTH_GAIN_AMT), STRENGTH_GAIN_AMT));
    AbstractDungeon.actionManager.addToBottom(new ApplyPowerAction(m, p, new VulnerablePower(m, this.magicNumber, false), this.magicNumber));
}
 
Example #16
Source File: PlaceholderRelic2.java    From StS-DefaultModBase with MIT License 4 votes vote down vote up
@Override
public void atBattleStart() {
    flash();
    AbstractDungeon.actionManager.addToTop(new ApplyPowerAction(AbstractDungeon.player, AbstractDungeon.player, new StrengthPower(AbstractDungeon.player, 1), 1));
    AbstractDungeon.actionManager.addToTop(new RelicAboveCreatureAction(AbstractDungeon.player, this));
}