Java Code Examples for com.megacrit.cardcrawl.ui.panels.EnergyPanel#totalCount()

The following examples show how to use com.megacrit.cardcrawl.ui.panels.EnergyPanel#totalCount() . 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: Cyclone.java    From jorbs-spire-mod with MIT License 6 votes vote down vote up
@Override
public void use(AbstractPlayer p, AbstractMonster m) {
    Runnable onKillEffect = () -> addToBot(new GainEnergyAction(this.magicNumber));

    int effect = EnergyPanel.totalCount;
    if (this.energyOnUse != -1) {
        effect = this.energyOnUse;
    }

    if (AbstractDungeon.player.hasRelic(ChemicalX.ID)) {
        effect += 2;
        AbstractDungeon.player.getRelic(ChemicalX.ID).flash();
    }

    for (int i = 0; i < effect; i++) {
        this.addToBot(new DamageAllEnemiesWithOnKillEffectAction(p, this.multiDamage, this.damageType, AbstractGameAction.AttackEffect.SLASH_HORIZONTAL, onKillEffect, true));
    }

    if (!this.freeToPlayOnce) {
        p.energy.use(EnergyPanel.totalCount);
    }

}
 
Example 2
Source File: DrainLife.java    From jorbs-spire-mod with MIT License 6 votes vote down vote up
@Override
public int calculateBonusBaseDamage() {
    int effect = EnergyPanel.totalCount;
    if (this.energyOnUse != -1) {
        effect = this.energyOnUse;
    }

    if (AbstractDungeon.player.hasRelic(ChemicalX.ID)) {
        effect += 2;
    }

    if (this.upgraded) {
        effect += 1;
    }

    return effect;
}
 
Example 3
Source File: PlasmaWaveAction.java    From FruityMod-StS with MIT License 6 votes vote down vote up
@Override
public void update() {
    int effect = EnergyPanel.totalCount;
    if (this.energyOnUse != -1) {
        effect = this.energyOnUse;
    }
    if (this.p.hasRelic("Chemical X")) {
        effect += 2;
        this.p.getRelic("Chemical X").flash();
    }
    if (effect > 0) {
        for (int i = 0; i < effect; ++i) {
            AbstractDungeon.actionManager.addToBottom(new SFXAction("ATTACK_HEAVY"));
            AbstractDungeon.actionManager.addToBottom(new VFXAction(this.p, new CleaveEffect(), 0.0f));
            AbstractDungeon.actionManager.addToBottom(new DamageAllEnemiesAction(p, this.multiDamage, this.damageType, AbstractGameAction.AttackEffect.NONE, true));
        }
        if (!this.freeToPlayOnce) {
            this.p.energy.use(EnergyPanel.totalCount);
        }
    }
    this.isDone = true;
}
 
Example 4
Source File: PerformXAction.java    From FruityMod-StS with MIT License 6 votes vote down vote up
@Override
public void update() {
    int effect = EnergyPanel.totalCount;
    if (this.baseValue != -1) {
        effect = this.baseValue;
    }

    if (this.p.hasRelic(ChemicalX.ID)) {
        effect += 2;
        this.p.getRelic(ChemicalX.ID).flash();
    }

    XAction.initialize(effect);
    if (XAction.amount > 0) {
        AbstractDungeon.actionManager.addToTop(XAction);
    }

    if (!this.freeToPlayOnce) {
        this.p.energy.use(EnergyPanel.totalCount);
    }
    isDone = true;
}
 
Example 5
Source File: UncommonPowerAction.java    From StS-DefaultModBase with MIT License 6 votes vote down vote up
@Override
public void update() {
    int effect = EnergyPanel.totalCount;
    if (energyOnUse != -1) {
        effect = energyOnUse;
    }
    if (p.hasRelic(ChemicalX.ID)) {
        effect += 2;
        p.getRelic(ChemicalX.ID).flash();
    }
    if (upgraded) {
        ++effect;
    }
    if (effect > 0) {
        for (int i = 0; i < effect; ++i) {
            
            AbstractDungeon.actionManager.addToBottom(new ApplyPowerAction(p, p,
                    new CommonPower(p, p, magicNumber), magicNumber,
                    AttackEffect.BLUNT_LIGHT));
        }
        if (!freeToPlayOnce) {
            p.energy.use(EnergyPanel.totalCount);
        }
    }
    isDone = true;
}
 
Example 6
Source File: ForceRippleAction.java    From FruityMod-StS with MIT License 5 votes vote down vote up
@Override
public void update() {
    int effect = EnergyPanel.totalCount;
    if (this.energyOnUse != -1) {
        effect = this.energyOnUse;
    }
    if (this.p.hasRelic("Chemical X")) {
        effect += 2;
        this.p.getRelic("Chemical X").flash();
    }
    if (effect > 0) {
        for (int i = 0; i < effect; i++) {
            AbstractDungeon.actionManager.addToBottom(new SFXAction("ATTACK_HEAVY"));
            AbstractDungeon.actionManager.addToBottom(new VFXAction(this.p, new CleaveEffect(), 0.0f));
            AbstractDungeon.actionManager.addToBottom(new DamageAction(this.m,
                    new DamageInfo(p, this.damage, this.damageType),
                    AbstractGameAction.AttackEffect.SLASH_DIAGONAL));
        }
        AbstractDungeon.actionManager.addToBottom(
                new ApplyPowerAction(p, p, new VulnerablePower(p, this.energyOnUse, false), this.energyOnUse, true, AbstractGameAction.AttackEffect.NONE));
        AbstractDungeon.actionManager.addToBottom(
                new ApplyPowerAction(p, p, new WeakPower(p, this.energyOnUse, false), this.energyOnUse, true, AbstractGameAction.AttackEffect.NONE));
        AbstractDungeon.actionManager.addToBottom(
                new ApplyPowerAction(p, p, new FrailPower(p, this.energyOnUse, false), this.energyOnUse, true, AbstractGameAction.AttackEffect.NONE));
        if (!this.freeToPlayOnce) {
            this.p.energy.use(EnergyPanel.totalCount);
        }
    }
    this.isDone = true;
}
 
Example 7
Source File: Flow.java    From FruityMod-StS with MIT License 5 votes vote down vote up
@Override
public void use(AbstractPlayer p, AbstractMonster m) {
    if (energyOnUse < EnergyPanel.totalCount) {
        energyOnUse = EnergyPanel.totalCount;
    }
    FlowAction r = new FlowAction(magicNumber);
    addToBot(new PerformXAction(r, p, energyOnUse, freeToPlayOnce));
}
 
Example 8
Source File: DefaultUncommonPower.java    From StS-DefaultModBase with MIT License 5 votes vote down vote up
@Override
public void use(final AbstractPlayer p, final AbstractMonster m) {
    if (energyOnUse < EnergyPanel.totalCount) {
        energyOnUse = EnergyPanel.totalCount;
    }
    AbstractDungeon.actionManager.addToBottom(new UncommonPowerAction(p, m, magicNumber,
            upgraded, damageTypeForTurn, freeToPlayOnce, energyOnUse));
}
 
Example 9
Source File: DefaultAttackWithVariable.java    From StS-DefaultModBase with MIT License 5 votes vote down vote up
@Override
public void use(AbstractPlayer p, AbstractMonster m) {
    // Create an int which equals to your current energy.
    int effect = EnergyPanel.totalCount;

    // For each energy, create 1 damage action.
    for (int i = 0; i < effect; i++) {
        AbstractDungeon.actionManager.addToBottom(
                new DamageAction(m, new DamageInfo(p, damage, damageTypeForTurn),
                        AbstractGameAction.AttackEffect.FIRE));
    }
}