com.megacrit.cardcrawl.actions.common.DamageAllEnemiesAction Java Examples

The following examples show how to use com.megacrit.cardcrawl.actions.common.DamageAllEnemiesAction. 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: MindGlassRelic.java    From jorbs-spire-mod with MIT License 6 votes vote down vote up
@Override
public void onGainClarity(String id) {
    ++this.counter;
    this.flash();
    if (this.counter == 10) {
        this.stopPulse();
    } else if (this.counter == 9) {
        AbstractDungeon.actionManager.addToBottom(new RelicAboveCreatureAction(AbstractDungeon.player, this));
        AbstractDungeon.actionManager.addToBottom(
                new ApplyPowerAction(
                        AbstractDungeon.player,
                        AbstractDungeon.player,
                        new MindGlassPower(AbstractDungeon.player, TEN_CLARITY_DAMAGE),
                        1,
                        true));
    }
    AbstractDungeon.actionManager.addToBottom(
            new DamageAllEnemiesAction(
                    null,
                    DamageInfo.createDamageMatrix(ONE_CLARITY_DAMAGE, true),
                    DamageInfo.DamageType.NORMAL,
                    // TODO: More impactful and relevant FX. See FlashAtkImgEffect.loadImage() and
                    //  FlashAtkImgEffect.playSound() for usage of AttackEffect in base game.
                    AbstractGameAction.AttackEffect.BLUNT_LIGHT));
}
 
Example #2
Source File: Starburst.java    From FruityMod-StS with MIT License 6 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, DamageInfo.DamageType.NORMAL), AbstractGameAction.AttackEffect.BLUNT_HEAVY));

    AbstractRoom room = AbstractDungeon.currMapNode.room;
    int numMonsters = room.monsters.monsters.size();

    this.multiDamage = new int[numMonsters];
    for (int i = 0; i < multiDamage.length; i++) {
        this.multiDamage[i] = this.damage;
    }

    AbstractDungeon.actionManager.addToBottom(new VFXAction(AbstractDungeon.player, new CleaveEffect(), 0.0F));
    AbstractDungeon.actionManager.addToBottom(new DamageAllEnemiesAction(p, this.multiDamage, this.damageTypeForTurn,
            AbstractGameAction.AttackEffect.NONE));
}
 
Example #3
Source File: IntrospectionPower.java    From jorbs-spire-mod with MIT License 6 votes vote down vote up
@Override
public void atEndOfTurn(boolean isPlayerTurn) {
    if (isPlayerTurn) {
        LoseHPAction loseHPAction = new LoseHPAction(this.owner, this.owner, amount2);
        // In practice, the main way this LoseHPAction can end up on the action queue when
        // the fight ends is if a *different* power that runs its atEndOfTurn first ends
        // the fight (eg, Arcane Weapon, see #398). Since such an effect would feel to
        // the player like it should be completing "before" this action happens, we think
        // it's more friendly for this action to be affected by clearPostCombatActions.
        loseHPAction.actionType = AbstractGameAction.ActionType.WAIT;
        AbstractDungeon.actionManager.addToBottom(loseHPAction);

        int[] damageMatrix = DamageInfo.createDamageMatrix(amount, true);
        AbstractDungeon.actionManager.addToBottom(new DamageAllEnemiesAction(owner, damageMatrix, DamageType.THORNS, AttackEffect.FIRE));
    }
}
 
Example #4
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 #5
Source File: ColorSpray.java    From jorbs-spire-mod with MIT License 5 votes vote down vote up
@Override
public void use(AbstractPlayer p, AbstractMonster monster) {
    addToBot(new DamageAllEnemiesAction(p, multiDamage, damageTypeForTurn, AttackEffect.FIRE));

    for(AbstractMonster m : AbstractDungeon.getCurrRoom().monsters.monsters) {
        final AbstractPower randomDebuff = generateRandomDebuff(p, m);
        AbstractDungeon.actionManager.addToBottom(new ApplyPowerAction(m, p, randomDebuff, randomDebuff.amount, true, AttackEffect.NONE));
    }

    addToBot(new RememberSpecificMemoryAction(p, EnvyMemory.STATIC.ID));
}
 
Example #6
Source File: CoilPower.java    From jorbs-spire-mod with MIT License 5 votes vote down vote up
private void consumeCoilForDamage() {
    this.flash();

    if (!AbstractDungeon.getMonsters().areMonstersBasicallyDead()) {
        AbstractDungeon.actionManager.addToBottom(
                new DamageAllEnemiesAction(owner, DamageInfo.createDamageMatrix(calculateDamage(), true), DamageInfo.DamageType.THORNS, AttackEffect.SLASH_HORIZONTAL));
        AbstractDungeon.actionManager.addToBottom(
                new RemoveSpecificPowerAction(owner, owner, CoilPower.POWER_ID));
    }
}
 
Example #7
Source File: OverkillPower.java    From jorbs-spire-mod with MIT License 5 votes vote down vote up
@Override
public void onAttack(DamageInfo info, int damageAmount, AbstractCreature target) {
    if(damageAmount > target.currentHealth){
        int overkillDamage = damageAmount - target.currentHealth;
        addToBot(new DamageAllEnemiesAction(this.owner,
                DamageInfo.createDamageMatrix(overkillDamage + this.amount, true),
                DamageInfo.DamageType.THORNS, AbstractGameAction.AttackEffect.SLASH_HORIZONTAL, true));
    }
}
 
Example #8
Source File: WastingFormPower.java    From jorbs-spire-mod with MIT License 5 votes vote down vote up
@Override
public void onCardDraw(AbstractCard card) {
    if (card.type == AbstractCard.CardType.CURSE) {
        this.flash();
        AbstractDungeon.actionManager.addToBottom(new DamageAllEnemiesAction(this.owner, DamageInfo.createDamageMatrix(this.amount, true), DamageInfo.DamageType.THORNS, AbstractGameAction.AttackEffect.POISON, true));
    }
}
 
Example #9
Source File: MindGlassPower.java    From jorbs-spire-mod with MIT License 5 votes vote down vote up
@Override
public void onGainClarity(String id) {
    AbstractDungeon.actionManager.addToBottom(
            new DamageAllEnemiesAction(
                    null,
                    DamageInfo.createDamageMatrix(damage, true),
                    DamageInfo.DamageType.NORMAL,
                    // TODO: More impactful and relevant FX. See FlashAtkImgEffect.loadImage() and
                    //  FlashAtkImgEffect.playSound() for usage of AttackEffect in base game.
                    AbstractGameAction.AttackEffect.BLUNT_HEAVY));
    AbstractDungeon.actionManager.addToBottom(
            new RemoveSpecificPowerAction(this.owner, this.owner, MindGlassPower.POWER_ID));
}
 
Example #10
Source File: PhantasmPower.java    From jorbs-spire-mod with MIT License 5 votes vote down vote up
@Override
public boolean onReceivePowerToCancel(AbstractPower power, AbstractCreature source) {
    if (power.ID.equals(IntangiblePlayerPower.POWER_ID) && power.owner == this.owner) {
        this.flash();
        AbstractDungeon.actionManager.addToBottom(new DamageAllEnemiesAction(this.owner, DamageInfo.createDamageMatrix(this.amount, true), DamageInfo.DamageType.THORNS, AbstractGameAction.AttackEffect.POISON, true));
    }
    return false;
}
 
Example #11
Source File: SeekerMod.java    From FruityMod-StS with MIT License 5 votes vote down vote up
@Override
public void receiveCardUsed(AbstractCard c) {
    AbstractPlayer p = AbstractDungeon.player;
    if (p.hasPower("EnigmaPower") && c.cardID.equals("Dazed")) {
        AbstractDungeon.actionManager.addToTop(new GainBlockAction(p, p, c.block));
        AbstractDungeon.actionManager.addToTop(new DamageAllEnemiesAction(AbstractDungeon.player,
                c.multiDamage,
                DamageInfo.DamageType.NORMAL, AbstractGameAction.AttackEffect.FIRE, true));
        c.exhaustOnUseOnce = false;
    }
}
 
Example #12
Source File: Fireball.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, LustMemory.STATIC.ID));
    addToBot(new DamageAllEnemiesAction(p, multiDamage, damageTypeForTurn, AttackEffect.FIRE));
    if(magicNumber > 0) {
        for (AbstractMonster mo : AbstractDungeon.getCurrRoom().monsters.monsters) {
            addToBot(new ApplyPowerAction(mo, p, new BurningPower(mo, p, this.magicNumber)));
        }
    }
}
 
Example #13
Source File: Apparate.java    From jorbs-spire-mod with MIT License 5 votes vote down vote up
@Override
public void use(AbstractPlayer p, AbstractMonster abstractMonster) {
    addToBot(new ApplyPowerAction(p, p, new VulnerablePower(p, urMagicNumber, false)));
    addToBot(new VFXAction(new CleaveEffect()));
    this.addToBot(new DamageAllEnemiesAction(p, this.multiDamage, this.damageTypeForTurn, AbstractGameAction.AttackEffect.NONE));
    for (AbstractMonster m : AbstractDungeon.getMonsters().monsters) {
        addToBot(new ApplyPowerAction(m, p, new VulnerablePower(m, magicNumber, false)));
    }
}
 
Example #14
Source File: NullStorm.java    From FruityMod-StS with MIT License 5 votes vote down vote up
@Override
public void use(AbstractPlayer p, AbstractMonster m) {
    AbstractDungeon.actionManager.addToBottom(new SFXAction("THUNDERCLAP", 0.05f));
    for (AbstractMonster mo : AbstractDungeon.getCurrRoom().monsters.monsters) {
        if (mo.isDeadOrEscaped())
            continue;
        AbstractDungeon.actionManager.addToBottom(new VFXAction(new LightningEffect(mo.drawX, mo.drawY), 0.05f));
    }
    AbstractDungeon.actionManager.addToBottom(new DamageAllEnemiesAction(p, this.multiDamage,
            this.damageTypeForTurn, AbstractGameAction.AttackEffect.NONE));
    AbstractDungeon.actionManager.addToBottom(new MakeTempCardInDrawPileAction(new Dazed(), 1, true, true));
}
 
Example #15
Source File: Irradiate.java    From FruityMod-StS with MIT License 5 votes vote down vote up
@Override
public void use(AbstractPlayer p, AbstractMonster m) {
    /*AbstractDungeon.actionManager.addToBottom(new SFXAction("THUNDERCLAP", 0.05f));
    for (AbstractMonster mo : AbstractDungeon.getCurrRoom().monsters.monsters) {
        if (mo.isDeadOrEscaped()) continue;
        AbstractDungeon.actionManager.addToBottom(new VFXAction(new LightningEffect(mo.drawX, mo.drawY), 0.05f));
    }*/
    AbstractDungeon.actionManager.addToBottom(new DamageAllEnemiesAction(p, this.multiDamage, this.damageTypeForTurn, AbstractGameAction.AttackEffect.POISON));
    for (AbstractMonster mo : AbstractDungeon.getCurrRoom().monsters.monsters) {
        AbstractDungeon.actionManager.addToBottom(new ApplyPowerAction(mo, p, new WeakPower(mo, this.magicNumber, false), this.magicNumber, true, AbstractGameAction.AttackEffect.NONE));
        AbstractDungeon.actionManager.addToBottom(new ApplyPowerAction(mo, p, new VulnerablePower(mo, this.magicNumber, false), this.magicNumber, true, AbstractGameAction.AttackEffect.NONE));
    }
}
 
Example #16
Source File: Dazed_P.java    From FruityMod-StS with MIT License 5 votes vote down vote up
@Override
public void use(AbstractPlayer p, AbstractMonster m) {
    this.updateEnigmaValue();
    if (p != null) {
        if (block > 0)
            AbstractDungeon.actionManager.addToBottom(new GainBlockAction(p, p, this.block));
        //AbstractDungeon.actionManager.addToBottom(new WaitAction(0.1f));
        if (damage > 0) {
            AbstractDungeon.actionManager.addToBottom(new VFXAction(new ShockWaveEffect(p.hb.cX, p.hb.cY, Settings.BLUE_TEXT_COLOR, ShockWaveEffect.ShockWaveType.CHAOTIC), 0.50f));
            AbstractDungeon.actionManager.addToBottom(new DamageAllEnemiesAction(p, this.multiDamage, DamageInfo.DamageType.NORMAL, AbstractGameAction.AttackEffect.NONE, true));
        }
    }
}
 
Example #17
Source File: Frustration.java    From jorbs-spire-mod with MIT License 4 votes vote down vote up
@Override
public void onRetained() {
    this.addToBot(new DamageAllEnemiesAction(null, DamageInfo.createDamageMatrix(magicNumber, true), DamageInfo.DamageType.THORNS, AbstractGameAction.AttackEffect.FIRE));
}
 
Example #18
Source File: Nova.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 DamageAllEnemiesAction(p, this.multiDamage, this.damageTypeForTurn, AbstractGameAction.AttackEffect.SLASH_HEAVY));
    AbstractDungeon.actionManager.addToBottom(new MakeTempCardInDrawPileAction(new Dazed(), 1, true, true));
}
 
Example #19
Source File: SnakeOil.java    From jorbs-spire-mod with MIT License 4 votes vote down vote up
@Override
public void useMaterialComponent(AbstractPlayer p, AbstractMonster m) {
    addToBot(new RememberSpecificMemoryAction(p, PatienceMemory.STATIC.ID));
    addToBot(new DamageAllEnemiesAction(p, multiDamage, damageTypeForTurn, AbstractGameAction.AttackEffect.POISON));
}
 
Example #20
Source File: Trauma.java    From jorbs-spire-mod with MIT License 4 votes vote down vote up
@Override
public void use(AbstractPlayer p, AbstractMonster m) {
    addToBot(new SnapAction(p));
    addToBot(new DamageAllEnemiesAction(p, multiDamage, damageTypeForTurn, AttackEffect.BLUNT_HEAVY));
}
 
Example #21
Source File: Rebuke.java    From jorbs-spire-mod with MIT License 4 votes vote down vote up
@Override
public void use(AbstractPlayer p, AbstractMonster abstractMonster) {
    addToBot(new ApplyPowerAction(p, p, new IntangiblePlayerPower(p, urMagicNumber)));
    addToBot(new VFXAction(new CleaveEffect()));
    this.addToBot(new DamageAllEnemiesAction(p, this.multiDamage, this.damageTypeForTurn, AbstractGameAction.AttackEffect.NONE));
}
 
Example #22
Source File: TickingCurse.java    From jorbs-spire-mod with MIT License 4 votes vote down vote up
@Override
public void triggerOnExhaust() {
    this.addToBot(new DamageAllEnemiesAction(null, DamageInfo.createDamageMatrix(magicNumber, true), DamageInfo.DamageType.THORNS, AbstractGameAction.AttackEffect.FIRE));
}
 
Example #23
Source File: TickingCurse.java    From jorbs-spire-mod with MIT License 4 votes vote down vote up
@Override
public void use(AbstractPlayer p, AbstractMonster m) {
    this.addToBot(new DamageAllEnemiesAction(p, this.multiDamage, this.damageType, AbstractGameAction.AttackEffect.SLASH_HORIZONTAL));
}
 
Example #24
Source File: Frustration.java    From jorbs-spire-mod with MIT License 4 votes vote down vote up
@Override
public void use(AbstractPlayer p, AbstractMonster abstractMonster) {
    this.addToBot(new DamageAllEnemiesAction(p, this.multiDamage, this.damageTypeForTurn, AbstractGameAction.AttackEffect.SLASH_DIAGONAL));
}
 
Example #25
Source File: SnapAction.java    From jorbs-spire-mod with MIT License 4 votes vote down vote up
public void update() {
    if (MemoryManager.forPlayer(target) == null || target.hasPower(SnappedPower.POWER_ID)) {
        isDone = true;
        return;
    }
    if (CombatUtils.isCombatBasicallyVictory()) {
        isDone = true;
        return;
    }

    int numClarities = MemoryManager.forPlayer(target).countCurrentClarities();
    int enemyDamage = ENEMY_DAMAGE_PER_CLARITY * numClarities;
    int targetDamage = PLAYER_DAMAGE_PER_CLARITY * numClarities;

    // addToTop is important for Trauma effect ordering
    // Note that the group of addToTops actually executes in reverse order
    AbstractDungeon.actionManager.addToTop(
            new ApplyPowerAction(target, null, new SnappedPower(target)));
    AbstractDungeon.actionManager.addToTop(
            new LoseHPAction(target, target, targetDamage, AttackEffect.BLUNT_LIGHT));
    AbstractDungeon.actionManager.addToTop(
            new DamageAllEnemiesAction(target, DamageInfo.createDamageMatrix(enemyDamage, true), DamageInfo.DamageType.THORNS, AttackEffect.BLUNT_LIGHT));

    AbstractDungeon.actionManager.addToTop(new VFXAction(new BorderFlashEffect(Color.DARK_GRAY.cpy())));

    CardCrawlGame.sound.playA("MONSTER_SNECKO_GLARE", -0.3F);

    if (target instanceof Wanderer) {
        ((Wanderer) target).startSnapAnimation();
    }

    MemoryManager.forPlayer(target).snap();

    if (isEndOfTurn) {
        AbstractDungeon.actionManager.addToBottom(new ApplyPowerAction(target, target,
                new ExhumeAtStartOfTurnPower(target, SelfExhumeFields.selfExhumeOnSnap::get)));
    } else {
        AbstractDungeon.actionManager.addToBottom(new ExhumeCardsAction(SelfExhumeFields.selfExhumeOnSnap::get));
    }

    isDone = true;
}
 
Example #26
Source File: DefaultOrb.java    From StS-DefaultModBase with MIT License 3 votes vote down vote up
@Override
public void onEvoke() { // 1.On Orb Evoke

    AbstractDungeon.actionManager.addToBottom( // 2.Damage all enemies
            new DamageAllEnemiesAction(AbstractDungeon.player, DamageInfo.createDamageMatrix(evokeAmount, true, true), DamageInfo.DamageType.THORNS, AbstractGameAction.AttackEffect.NONE));
    // The damage matrix is how orb damage all enemies actions have to be assigned. For regular cards that do damage to everyone, check out cleave or whirlwind - they are a bit simpler.


    AbstractDungeon.actionManager.addToBottom(new SFXAction("TINGSHA")); // 3.And play a Jingle Sound.
    // For a list of sound effects you can use, look under com.megacrit.cardcrawl.audio.SoundMaster - you can see the list of keys you can use there. As far as previewing what they sound like, open desktop-1.0.jar with something like 7-Zip and go to audio. Reference the file names provided. (Thanks fiiiiilth)

}