com.megacrit.cardcrawl.actions.animations.VFXAction Java Examples

The following examples show how to use com.megacrit.cardcrawl.actions.animations.VFXAction. 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: GhostPoisonPotion.java    From jorbs-spire-mod with MIT License 6 votes vote down vote up
@Override
public void use(AbstractCreature target) {
    int liveMonsterCount = 0;

    for (AbstractMonster m : (AbstractDungeon.getCurrRoom()).monsters.monsters) {
        // This makes sure that all Darklings in the fight actually die, regardless of their halfDead state
        if (m instanceof Darkling) {
            if (m.halfDead) {
                m.halfDead = false;
            }
            // This makes combat against Darklings able to end
            AbstractDungeon.getCurrRoom().cannotLose = false;
        }
        if (!m.isDeadOrEscaped()) {
            ++liveMonsterCount;
            addToBot(new VFXAction(new SmokeBombEffect(m.hb.cX, m.hb.cY)));
            m.die();
        }
    }
        addToBot(new IncreaseManifestAction(liveMonsterCount));

    if ((AbstractDungeon.getCurrRoom()).phase == AbstractRoom.RoomPhase.COMBAT) {
        AbstractDungeon.player.hideHealthBar();
        AbstractDungeon.overlayMenu.endTurnButton.disable();
    }
}
 
Example #2
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 #3
Source File: Vacuum.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 RemoveSpecificPowerAction(p, p, "Weakened"));
    AbstractDungeon.actionManager.addToBottom(new RemoveSpecificPowerAction(p, p, "Frail"));
    AbstractDungeon.actionManager.addToBottom(new RemoveSpecificPowerAction(p, p, "Vulnerable"));

    if (m != null) {
        AbstractDungeon.actionManager.addToBottom(new VFXAction(new VerticalImpactEffect(m.hb.cX + m.hb.width / 4.0f, m.hb.cY - m.hb.height / 4.0f)));
    }

    AbstractDungeon.actionManager.addToBottom(
            new DamageAction(m, new DamageInfo(p, this.damage, this.damageTypeForTurn), AbstractGameAction.AttackEffect.BLUNT_HEAVY));

    this.rawDescription = (this.isEthereal ? "Ethereal. NL " : "") + DESCRIPTION;
    initializeDescription();
}
 
Example #4
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 #5
Source File: DefaultClickableRelic.java    From StS-DefaultModBase with MIT License 5 votes vote down vote up
@Override
public void onRightClick() {// On right click
    if (!isObtained || usedThisTurn || !isPlayerTurn) {
        // If it has been used this turn, the player doesn't actually have the relic (i.e. it's on display in the shop room), or it's the enemy's turn
        return; // Don't do anything.
    }
    
    if (AbstractDungeon.getCurrRoom() != null && AbstractDungeon.getCurrRoom().phase == AbstractRoom.RoomPhase.COMBAT) { // Only if you're in combat
        usedThisTurn = true; // Set relic as "Used this turn"
        flash(); // Flash
        stopPulse(); // And stop the pulsing animation (which is started in atPreBattle() below)

        AbstractDungeon.actionManager.addToBottom(new TalkAction(true, DESCRIPTIONS[1], 4.0f, 2.0f)); // Player speech bubble saying "YOU ARE MINE!" (See relic strings)
        AbstractDungeon.actionManager.addToBottom(new SFXAction("MONSTER_COLLECTOR_DEBUFF")); // Sound Effect Action of The Collector Nails
        AbstractDungeon.actionManager.addToBottom(new VFXAction( // Visual Effect Action of the nails applies on a random monster's position.
                new CollectorCurseEffect(AbstractDungeon.getRandomMonster().hb.cX, AbstractDungeon.getRandomMonster().hb.cY), 2.0F));

        AbstractDungeon.actionManager.addToBottom(new EvokeOrbAction(1)); // Evoke your rightmost orb
    }
    // See that talk action? It has DESCRIPTIONS[1] instead of just hard-coding "You are mine" inside.
    // DO NOT HARDCODE YOUR STRINGS ANYWHERE, 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. If you ever want to change a string
     * you don't have to go through all your files individually/pray that a mass-replace doesn't screw something up.
     *
     * 3. Without hardcoded strings, editing a string doesn't require a compile, saving you time (unless you clean+package).
     *
     */
}
 
Example #6
Source File: ArcaneWeaponAction.java    From jorbs-spire-mod with MIT License 5 votes vote down vote up
@Override
public void update() {
    target = CombatUtils.getRandomAliveMonster(AbstractDungeon.getMonsters(), m -> !m.hasPower(BanishedPower.POWER_ID), AbstractDungeon.cardRandomRng);
    if (this.target != null) {
        card.calculateCardDamage((AbstractMonster) target);

        // Add to top in reverse order so VFX starts/waits before the damage effect happens.
        AbstractDungeon.actionManager.addToTop(new DamageAction(target, new DamageInfo(AbstractDungeon.player, card.damage, card.damageTypeForTurn), AttackEffect.SLASH_DIAGONAL));
        AbstractDungeon.actionManager.addToTop(new VFXAction(new ArcaneWeaponEffect(target.hb.x, target.hb.cY + target.hb.height / 12.0F), 0.5F));
    }

    isDone = true;
}
 
Example #7
Source File: DefaultRareAttack.java    From StS-DefaultModBase with MIT License 5 votes vote down vote up
@Override
public void use(AbstractPlayer p, AbstractMonster m) {
    if (m != null) {
        AbstractDungeon.actionManager.addToBottom(new VFXAction(new WeightyImpactEffect(m.hb.cX, m.hb.cY)));
    }
    AbstractDungeon.actionManager.addToBottom(
            new DamageAction(m, new DamageInfo(p, damage, damageTypeForTurn),
                    AbstractGameAction.AttackEffect.NONE));

}
 
Example #8
Source File: DefaultOrb.java    From StS-DefaultModBase with MIT License 5 votes vote down vote up
@Override
public void onStartOfTurn() {// 1.At the start of your turn.
    AbstractDungeon.actionManager.addToBottom(// 2.This orb will have a flare effect
            new VFXAction(new OrbFlareEffect(this, OrbFlareEffect.OrbFlareColor.FROST), 0.1f));

    AbstractDungeon.actionManager.addToBottom(// 3. And draw you cards.
            new DrawCardAction(AbstractDungeon.player, passiveAmount));
}
 
Example #9
Source File: Singularity.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 GainBlockAction(p, p, this.block));
    AbstractDungeon.actionManager.addToBottom(new WaitAction(0.1f));
    if (p != null && m != null) {
        AbstractDungeon.actionManager.addToBottom(new VFXAction(new IronWaveEffect(p.hb.cX, p.hb.cY, m.hb.cX), 0.5f));
    }
    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 EnergizedPower(p, this.magicNumber), this.magicNumber));
}
 
Example #10
Source File: Flux.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 GainBlockAction(p, p, this.block));
    AbstractDungeon.actionManager.addToBottom(new WaitAction(0.1f));
    if (p != null && m != null) {
        AbstractDungeon.actionManager
                .addToBottom(new VFXAction(new IronWaveEffect(p.hb.cX, p.hb.cY, m.hb.cX), 0.5f));
    }
    AbstractDungeon.actionManager.addToBottom(
            new DamageAction((AbstractCreature) m, new DamageInfo(p, this.damage, this.damageTypeForTurn),
                    AbstractGameAction.AttackEffect.SLASH_VERTICAL));
}
 
Example #11
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 #12
Source File: Comet.java    From FruityMod-StS with MIT License 5 votes vote down vote up
@Override
public void use(AbstractPlayer p, AbstractMonster m) {
    if (m != null) {
        AbstractDungeon.actionManager.addToBottom(new VFXAction(new WeightyImpactEffect(m.hb.cX, m.hb.cY)));
    }
    AbstractDungeon.actionManager.addToBottom(new WaitAction(0.8f));
    AbstractDungeon.actionManager.addToBottom(new DamageAction((AbstractCreature) m, new DamageInfo(p, this.damage, DamageInfo.DamageType.NORMAL), AbstractGameAction.AttackEffect.NONE));
}
 
Example #13
Source File: EtherBlast.java    From FruityMod-StS with MIT License 5 votes vote down vote up
@Override
public void use(AbstractPlayer p, AbstractMonster m) {
    AbstractDungeon.actionManager.addToTop(new DamageAction(m, new DamageInfo(p, calculateDamage(), this.damageTypeForTurn), true));
    AbstractDungeon.actionManager.addToTop(new VFXAction(new ThrowDaggerEffect(m.hb.cX, m.hb.cY)));

    this.rawDescription = DESCRIPTION;
    initializeDescription();
}
 
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: 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 #16
Source File: RayOfFrost.java    From jorbs-spire-mod with MIT License 5 votes vote down vote up
@Override
public void use(AbstractPlayer p, AbstractMonster m) {
    addToBot(new VFXAction(new RayOfFrostEffect(p, m, damage)));
    addToBot(new DamageAction(m, new DamageInfo(p, damage), AbstractGameAction.AttackEffect.NONE));

    for (int i = 0; i < this.metaMagicNumber; ++i) {
        addToBot(new ApplyPowerAction(m, p, new WeakPower(m, this.magicNumber, false), this.magicNumber));
    }
}
 
Example #17
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 #18
Source File: ScorchingRayAction.java    From jorbs-spire-mod with MIT License 5 votes vote down vote up
@Override
public void update() {
    AbstractDungeon.actionManager.addToBottom(new SFXAction("ATTACK_MAGIC_BEAM_SHORT", 0.5F));
    AbstractDungeon.actionManager.addToBottom(new VFXAction(new BorderFlashEffect(Color.GOLDENROD.cpy())));
    AbstractDungeon.actionManager.addToBottom(new VFXAction(
            new ScalingLaserEffect(source.hb.cX, source.hb.cY, target.hb.cX, target.hb.cY, Color.ORANGE.cpy(), Color.RED.cpy(), amount), 0.1F));

    AbstractDungeon.actionManager.addToBottom(new ApplyPowerAction(target, source, new BurningPower(target, source, amount)));

    isDone = true;
}
 
Example #19
Source File: VoidRay.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 VFXAction(new MindblastEffect(p.dialogX, p.dialogY, false)));
    AbstractDungeon.actionManager.addToBottom(new DamageAction((AbstractCreature) m, new DamageInfo(p, this.damage, DamageInfo.DamageType.NORMAL), AbstractGameAction.AttackEffect.NONE));
    AbstractDungeon.actionManager.addToBottom(new MakeTempCardInDrawPileAction(new Dazed(), 1, true, true));
}
 
Example #20
Source File: FlameWard.java    From jorbs-spire-mod with MIT License 4 votes vote down vote up
@Override
public void use(AbstractPlayer p, AbstractMonster m) {
    // for now, use flame barrier's VFX, maybe we get something else later, but it looks pretty sweet anyways.
    AbstractDungeon.actionManager.addToBottom(new VFXAction(p, new FlameBarrierEffect(p.hb.cX, p.hb.cY), 0.5F));
    AbstractDungeon.actionManager.addToBottom(new ApplyPowerAction(p, m, new FlameWardPower(p, block, magicNumber)));
}
 
Example #21
Source File: ChainLightning.java    From jorbs-spire-mod with MIT License 4 votes vote down vote up
private void addLightningEffect(AbstractMonster monster, int multiplier) {
    float duration = (0.05F * multiplier);
    AbstractDungeon.actionManager.addToBottom(new SFXAction("THUNDERCLAP", duration));
    AbstractDungeon.actionManager.addToBottom(new VFXAction(new LightningEffect(monster.drawX, monster.drawY), duration));
}
 
Example #22
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 #23
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;
}