Java Code Examples for com.megacrit.cardcrawl.core.Settings#ACTION_DUR_MED

The following examples show how to use com.megacrit.cardcrawl.core.Settings#ACTION_DUR_MED . 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: ToilAction.java    From jorbs-spire-mod with MIT License 5 votes vote down vote up
public void update() {
    if (duration == Settings.ACTION_DUR_MED && target != null) {
        AbstractDungeon.effectList.add(new FlashAtkImgEffect(target.hb.cX, target.hb.cY, AttackEffect.BLUNT_HEAVY));
        target.damage(info);
        if ((target.isDying || target.currentHealth <= 0) && !target.halfDead && !target.hasPower(MinionPower.POWER_ID)) {
            ArrayList<AbstractCard> possibleCards = new ArrayList<>();

            for(AbstractCard c : AbstractDungeon.player.masterDeck.group) {
                if (c.canUpgrade()) {
                    possibleCards.add(c);
                }
            }

            if (!possibleCards.isEmpty()) {
                theCard = possibleCards.get(AbstractDungeon.miscRng.random(0, possibleCards.size() - 1));
                theCard.upgrade();
                AbstractDungeon.player.bottledCardUpgradeCheck(theCard);
            }
        }

        if (AbstractDungeon.getCurrRoom().monsters.areMonstersBasicallyDead()) {
            AbstractDungeon.actionManager.clearPostCombatActions();
        }
    }

    tickDuration();
    if (isDone && theCard != null) {
        AbstractDungeon.effectsQueue.add(new UpgradeShineEffect((float) Settings.WIDTH / 2.0F, (float) Settings.HEIGHT / 2.0F));
        AbstractDungeon.topLevelEffectsQueue.add(new ShowCardBrieflyEffect(theCard.makeStatEquivalentCopy()));
        AbstractDungeon.actionManager.addToTop(new WaitAction(Settings.ACTION_DUR_MED));
    }

}
 
Example 2
Source File: PatronAction.java    From jorbs-spire-mod with MIT License 5 votes vote down vote up
public PatronAction(AbstractCreature target, DamageInfo info, AbstractCard card, Consumer<AbstractCard> updateCard, Consumer<AbstractCard> showEffect) {
    this.info = info;
    this.setValues(target, info);
    this.actionType = ActionType.DAMAGE;
    this.duration = baseDuration = Settings.ACTION_DUR_MED;
    this.card = card;
    this.updateCard = updateCard;
    this.showEffect = showEffect;
}
 
Example 3
Source File: MoveCardsAction.java    From StSLib with MIT License 5 votes vote down vote up
public MoveCardsAction(CardGroup destination, CardGroup source, Predicate<AbstractCard> predicate, int amount, Consumer<List<AbstractCard>> callback)
{
    p = AbstractDungeon.player;
    this.destination = destination;
    this.source = source;
    this.predicate = predicate;
    this.callback = callback;
    setValues(p, AbstractDungeon.player, amount);
    actionType = AbstractGameAction.ActionType.CARD_MANIPULATION;
    duration = Settings.ACTION_DUR_MED;
}
 
Example 4
Source File: ToilAction.java    From jorbs-spire-mod with MIT License 4 votes vote down vote up
public ToilAction(AbstractCreature target, DamageInfo info) {
    this.info = info;
    setValues(target, info);
    actionType = AbstractGameAction.ActionType.DAMAGE;
    duration = Settings.ACTION_DUR_MED;
}
 
Example 5
Source File: TelescopeAction.java    From FruityMod-StS with MIT License 4 votes vote down vote up
public TelescopeAction() {
    this.p = AbstractDungeon.player;
    this.duration = Settings.ACTION_DUR_MED;
    this.actionType = AbstractGameAction.ActionType.CARD_MANIPULATION;
}