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

The following examples show how to use com.megacrit.cardcrawl.actions.common.GainBlockAction. 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: FracturedMind.java    From jorbs-spire-mod with MIT License 5 votes vote down vote up
@Override
public void use(AbstractPlayer p, AbstractMonster m) {
    AbstractMemory currentMemory = MemoryManager.forPlayer(p).currentMemory;
    boolean isSnapped = MemoryManager.forPlayer(p).isSnapped();
    boolean rememberingSin = currentMemory != null && currentMemory.memoryType == MemoryType.SIN;
    boolean rememberingVirtue = currentMemory != null && currentMemory.memoryType == MemoryType.VIRTUE;

    if (rememberingSin || isSnapped) {
        addToBot(new DamageAction(m, new DamageInfo(p, damage), AttackEffect.BLUNT_LIGHT));
    }

    if (rememberingVirtue || isSnapped) {
        addToBot(new GainBlockAction(p, p, block));
    }
}
 
Example #2
Source File: Umbra.java    From FruityMod-StS with MIT License 5 votes vote down vote up
@Override
public void use(AbstractPlayer p, AbstractMonster m) {
    if (p.hasPower(VulnerablePower.POWER_ID) || p.hasPower(FrailPower.POWER_ID)) {
        addToBot(new GainBlockAction(p, block));
    }
    if (p.hasPower(WeakPower.POWER_ID)) {
        addToBot(new DamageAction(m, new DamageInfo(p, damage, damageTypeForTurn), AbstractGameAction.AttackEffect.FIRE));
    }
}
 
Example #3
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 #4
Source File: FangedNecklace.java    From FruityMod-StS with MIT License 5 votes vote down vote up
@Override
public int onAttacked(DamageInfo damageInfo, int damageAmount) {
    AbstractDungeon.actionManager.addToBottom(
            new GainBlockAction(damageInfo.owner, AbstractDungeon.player, BLOCK_PER_ATTACK));
    this.flash();

    return damageAmount;
}
 
Example #5
Source File: ChastityMemory.java    From jorbs-spire-mod with MIT License 5 votes vote down vote up
@Override
public void atEndOfTurnPreEndTurnCards() {
    if (isPassiveEffectActive()) {
        AbstractDungeon.actionManager.addToBottom(
                // It's important to apply a negative dex power rather than reducing an existing dex power
                //   1. reducing the existing power doesn't work if the player currently has no dex
                //   2. we want it to be blockable by Artifact, which ApplyPowerAction is and ReducePowerAction isn't
                new ApplyPowerAction(owner, owner, new DexterityPower(this.owner, -DEXTERITY_LOSS_PER_TURN)));
        AbstractDungeon.actionManager.addToBottom(
                new GainBlockAction(owner, owner, BLOCK_PER_TURN));
    }
}
 
Example #6
Source File: BlockCommand.java    From jorbs-spire-mod with MIT License 5 votes vote down vote up
@Override
public void execute(String[] tokens, int depth) {
    String requiredBlockAmount = tokens.length > depth ? tokens[depth] : null;
    try {
        int amount = Integer.parseInt(requiredBlockAmount);
        ConsoleTargeting.applyToTargetCreature(c -> AbstractDungeon.actionManager.addToBottom(new GainBlockAction(c, amount)));
    } catch (NumberFormatException e) {
        this.errorMsg();
    }
}
 
Example #7
Source File: Channel.java    From jorbs-spire-mod with MIT License 5 votes vote down vote up
@Override
public void use(AbstractPlayer p, AbstractMonster m) {
    addToBot(new GainBlockAction(p, p, block));
    addToBot(new ApplyPowerAction(p, p, new EnergizedCustomPower(p, magicNumber)));
    if (metaMagicNumber > 0) {
        addToBot(new CardsToTopOfDeckAction(p, p.discardPile, this.metaMagicNumber, false));
    }
}
 
Example #8
Source File: Genesis.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));
    if (AbstractDungeon.player.drawPile.isEmpty()) {
        AbstractDungeon.actionManager.addToBottom(new EmptyDeckShuffleAction());
    }
    AbstractDungeon.actionManager.addToBottom(new DrawCardAction(p, this.magicNumber));
}
 
Example #9
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 #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: 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 #12
Source File: DoubleCheck.java    From jorbs-spire-mod with MIT License 5 votes vote down vote up
@Override
public void use(AbstractPlayer p, AbstractMonster m) {
    addToBot(new GainBlockAction(p, p, block));
    addToBot(new RememberSpecificMemoryAction(p, DiligenceMemory.STATIC.ID));
    if (upgraded) {
        addToBot(new ApplyPowerAction(p, p, new DoubleCheckPower(p)));
    }
}
 
Example #13
Source File: MindOverMatter.java    From FruityMod-StS with MIT License 5 votes vote down vote up
@Override
public void use(AbstractPlayer p, AbstractMonster m) {
    int frailCount = GetPowerCount(p, "Frail");
    int weakCount = GetPowerCount(p, "Weakened");
    int vulnCount = GetPowerCount(p, "Vulnerable");
    AbstractDungeon.actionManager.addToBottom(new RemoveSpecificPowerAction(p, p, "Frail"));
    AbstractDungeon.actionManager.addToBottom(new RemoveSpecificPowerAction(p, p, "Weakened"));
    AbstractDungeon.actionManager.addToBottom(new RemoveSpecificPowerAction(p, p, "Vulnerable"));
    AbstractDungeon.actionManager.addToBottom(new GainBlockAction(p, p, ((frailCount + weakCount + vulnCount) * this.magicNumber) + BLOCK_AMT));
}
 
Example #14
Source File: CoalescencePower.java    From FruityMod-StS with MIT License 5 votes vote down vote up
@Override
public void atEndOfTurn(boolean isPlayer) {
    if (isPlayer) {
        this.flash();
        AbstractDungeon.actionManager.addToBottom(
                new GainBlockAction(this.owner, this.owner, this.amount));
    }
}
 
Example #15
Source File: CoalescencePower.java    From FruityMod-StS with MIT License 5 votes vote down vote up
@Override
public void atEndOfTurn(boolean isPlayer) {
    int frailCount = GetPowerCount(this.owner, "Frail");
    int weakCount = GetPowerCount(this.owner, "Weakened");
    int vulnCount = GetPowerCount(this.owner, "Vulnerable");
    this.flash();
    AbstractDungeon.actionManager.addToBottom(new GainBlockAction(this.owner, this.owner, this.amount * (frailCount + weakCount + vulnCount)));
}
 
Example #16
Source File: Magnetize.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 GainBlockAction(p, p, this.block));
    AbstractDungeon.actionManager.addToBottom(new ApplyPowerAction(m, p, new WeakPower(m, this.magicNumber, false), this.magicNumber));
}
 
Example #17
Source File: Disperse.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 GainBlockAction(p, p, this.block));
    AbstractDungeon.actionManager.addToBottom(new ApplyPowerAction(p, p, new ArtifactPower(p, this.magicNumber), this.magicNumber));
}
 
Example #18
Source File: DefaultCommonSkill.java    From StS-DefaultModBase with MIT License 4 votes vote down vote up
@Override
public void use(AbstractPlayer p, AbstractMonster m) {
    AbstractDungeon.actionManager.addToBottom(new GainBlockAction(p, p, block));
}
 
Example #19
Source File: SiphonSpeed.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 GainBlockAction(p, p, this.block));
    AbstractDungeon.actionManager.addToBottom(new ApplyPowerAction(p, p, new DexterityPower(p, DEX_GAIN_AMT), DEX_GAIN_AMT));
    AbstractDungeon.actionManager.addToBottom(new ApplyPowerAction(m, p, new WeakPower(m, this.magicNumber, false), this.magicNumber));
}
 
Example #20
Source File: Defend_Purple.java    From FruityMod-StS with MIT License 4 votes vote down vote up
public void use(AbstractPlayer p, AbstractMonster m) {
    AbstractDungeon.actionManager.addToBottom(new GainBlockAction(p, p, this.block));
}
 
Example #21
Source File: Nebula.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 GainBlockAction(p, p, this.block));
    this.setDescription(false);
}
 
Example #22
Source File: ReflectionWard.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 ApplyPowerAction(p, p, new ReflectionWardPower(p, magicNumber), magicNumber));
    AbstractDungeon.actionManager.addToBottom(new GainBlockAction(p, p, this.block));
}
 
Example #23
Source File: ArcaneArmor.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 GainBlockAction(p, p, this.block));
}
 
Example #24
Source File: PulseBarrier.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 GainBlockAction(p, p, this.block));
    AbstractDungeon.actionManager.addToBottom(new ApplyPowerAction(p, p, new FrailPower(p, FRAIL_AMT, true), FRAIL_AMT));
}
 
Example #25
Source File: HedgeWizard.java    From jorbs-spire-mod with MIT License 4 votes vote down vote up
@Override
public void use(AbstractPlayer p, AbstractMonster m) {
    addToBot(new GainBlockAction(p, p, block));
    addToBot(new RememberSpecificMemoryAction(p, HumilityMemory.STATIC.ID));
}
 
Example #26
Source File: Shimmer.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 GainBlockAction(p, p, this.block));
    AbstractDungeon.actionManager.addToBottom(new EtherealizeAction());
}
 
Example #27
Source File: DisruptionField.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 GainBlockAction(p, p, this.block));
    AbstractDungeon.actionManager.addToBottom(new MakeTempCardInDrawPileAction(new Dazed(), DAZED_COUNT, true, true));
}
 
Example #28
Source File: Blockpocalypse.java    From FruityMod-StS with MIT License 4 votes vote down vote up
public void use(AbstractPlayer player, AbstractMonster monster) {
    for (int i = 0; i < magicNumber; i++) {
        AbstractDungeon.actionManager.addToBottom(new GainBlockAction(player, player, this.baseBlock));
    }
}
 
Example #29
Source File: Defend_Tan.java    From FruityMod-StS with MIT License 4 votes vote down vote up
public void use(AbstractPlayer p, AbstractMonster m) {
    AbstractDungeon.actionManager.addToBottom(new GainBlockAction(p, p, this.block));
}
 
Example #30
Source File: Prepare.java    From jorbs-spire-mod with MIT License 4 votes vote down vote up
@Override
public void use(AbstractPlayer p, AbstractMonster m) {
    addToBot(new GainBlockAction(p, p, block));
    addToBot(new ApplyPowerAction(p, p, new CoilPower(p, metaMagicNumber)));
}