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

The following examples show how to use com.megacrit.cardcrawl.core.Settings#ACTION_DUR_XFAST . 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: DecreaseMaxHpAction.java    From jorbs-spire-mod with MIT License 6 votes vote down vote up
public DecreaseMaxHpAction(AbstractCreature target, AbstractCreature source, int amount, AttackEffect effect) {
    this.effect = effect;
    this.amount = amount;
    this.target = target;
    this.source = source;

    // This has the side effect of making the decrease still happen if an associated effect just recently ended combat.
    this.actionType = ActionType.DAMAGE;

    if (Settings.FAST_MODE) {
        this.startDuration = Settings.ACTION_DUR_XFAST;
    } else {
        this.startDuration = Settings.ACTION_DUR_FAST;
    }
    this.duration = this.startDuration;
}
 
Example 2
Source File: AbjureAction.java    From jorbs-spire-mod with MIT License 5 votes vote down vote up
public AbjureAction() {
    if (Settings.FAST_MODE) {
        this.startDuration = Settings.ACTION_DUR_XFAST;
    } else {
        this.startDuration = Settings.ACTION_DUR_FAST;
    }
    this.duration = this.startDuration;
}
 
Example 3
Source File: PlasmaWaveAction.java    From FruityMod-StS with MIT License 5 votes vote down vote up
public PlasmaWaveAction(AbstractPlayer p, int[] multiDamage, DamageInfo.DamageType damageType, boolean freeToPlayOnce, int energyOnUse) {
    this.multiDamage = multiDamage;
    this.damageType = damageType;
    this.p = p;
    this.freeToPlayOnce = freeToPlayOnce;
    if (freeToPlayOnce) {
        System.out.println("FREE TO PLAY");
    }
    this.duration = Settings.ACTION_DUR_XFAST;
    this.actionType = AbstractGameAction.ActionType.SPECIAL;
    this.energyOnUse = energyOnUse;
}
 
Example 4
Source File: ForceRippleAction.java    From FruityMod-StS with MIT License 5 votes vote down vote up
public ForceRippleAction(AbstractPlayer p, AbstractMonster m, int damage, DamageInfo.DamageType damageType,
                         boolean freeToPlayOnce, int energyOnUse) {
    this.damage = damage;
    this.damageType = damageType;
    this.p = p;
    this.m = m;
    this.freeToPlayOnce = freeToPlayOnce;
    if (freeToPlayOnce) {
        System.out.println("FREE TO PLAY");
    }
    this.duration = Settings.ACTION_DUR_XFAST;
    this.actionType = AbstractGameAction.ActionType.SPECIAL;
    this.energyOnUse = energyOnUse;
}
 
Example 5
Source File: DamageSomeEnemiesAction.java    From FruityMod-StS with MIT License 5 votes vote down vote up
public DamageSomeEnemiesAction(AbstractCreature source, boolean[] targets, int[] amount, DamageInfo.DamageType type, AbstractGameAction.AttackEffect effect, boolean isFast) {
    this.setValues(null, source, amount[0]);
    this.damage = amount;
    this.targets = targets;
    this.actionType = AbstractGameAction.ActionType.DAMAGE;
    this.damageType = type;
    this.attackEffect = effect;
    this.duration = isFast ? Settings.ACTION_DUR_XFAST : Settings.ACTION_DUR_FAST;

    int targetCount = 0;
    for (boolean target : targets) {
        if (target) ++targetCount;
    }
    this.targetsAll = targetCount == targets.length;
}
 
Example 6
Source File: FlowAction.java    From FruityMod-StS with MIT License 4 votes vote down vote up
public FlowAction(int bonusAmt) {
    this.bonusAmt = bonusAmt;
    this.duration = Settings.ACTION_DUR_XFAST;
    this.actionType = ActionType.SPECIAL;
}
 
Example 7
Source File: SelectCardsAction.java    From StSLib with MIT License 3 votes vote down vote up
/**
* @param group - ArrayList of cards to filter and select from.
* Example: AbstractDungeon.player.discardPile.group
* @param amount - maximum number of cards allowed for selectoin
* @param textForSelect - text that will be displayed on the grid select screen at the bottom. It will show just this text with nothing else added by itself.
* @param anyNumber - whether player has to select exact number of cards (amount) or any number up to, including 0.
* false for exact number.
* @param cardFilter - Filters the cards in the group.
* Example: if you want to display only skills, it would be c -> c.type == CardType.SKILL
* If you don't need the filter, set it as c -> true
* @param callback - What to do with cards selected. Accepts a list with cards selected. The list would only contain one element if it's "Select one card"
* Example: if you want to lose 1 hp and upgrade each card selected, it would look like
* list -> {
* addToBot(
* new LoseHPAction(player, player, list.size());
* list.forEach(c -> c.upgrade());
* )}
*
* if there's no callback the action will not trigger simply because you told player to "select cards to do nothing with them"
* */

public SelectCardsAction(ArrayList<AbstractCard> group, int amount, String textForSelect, boolean anyNumber, Predicate<AbstractCard> cardFilter, Consumer<List<AbstractCard>> callback)
{
    this.amount = amount;
    this.duration = this.startDuration = Settings.ACTION_DUR_XFAST;
    text = textForSelect;
    this.anyNumber = anyNumber;
    this.callback = callback;
    this.selectGroup = new CardGroup(CardGroup.CardGroupType.UNSPECIFIED);
    this.selectGroup.group.addAll(group.stream().distinct().filter(cardFilter).collect(Collectors.toList()));
    // It's distinct() because if i don't it may cause the infamous "jiggle" when you see a grid of cards with a same object in different locations.
}
 
Example 8
Source File: SelectCardsInHandAction.java    From StSLib with MIT License 3 votes vote down vote up
/**
* @param amount - max number of cards player can select
* @param textForSelect - text that will be displayed at the top of the screen. It will be automatically attached to base game "Select X card/s to " text
* @param anyNumber - whether player has to select exact number of cards or any number up to.
* false for exact number
* @param canPickZero - whether player can skip selection by picking zero cards.
* @param cardFilter - filter that will be applied to cards in hand.
* Example: if you want to display only skills, it would be c -> c.type == CardType.SKILL
* If you don't need the filter, set it as c -> true
* @param callback - What to do with cards selected.
* Example: if you want to lose 1 hp and upgrade each card selected, it would look like
* list -> {
* addToBot(
* new LoseHPAction(player, player, list.size());
* list.forEach(c -> c.upgrade());
* )}
*
* if there's no callback the action will not trigger simply because you told player to "select cards to do nothing with them"
* */

public SelectCardsInHandAction(int amount, String textForSelect, boolean anyNumber, boolean canPickZero, Predicate<AbstractCard> cardFilter, Consumer<List<AbstractCard>> callback)
{
    this.amount = amount;
    this.duration = this.startDuration = Settings.ACTION_DUR_XFAST;
    text = textForSelect;
    this.anyNumber = anyNumber;
    this.canPickZero = canPickZero;
    this.predicate = cardFilter;
    this.callback = callback;
    this.hand = AbstractDungeon.player.hand.group;
    tempHand = new ArrayList<>();
    tempHand.addAll(hand);
}