Java Code Examples for com.megacrit.cardcrawl.cards.DamageInfo#DamageType

The following examples show how to use com.megacrit.cardcrawl.cards.DamageInfo#DamageType . 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: WitheringPatch.java    From jorbs-spire-mod with MIT License 5 votes vote down vote up
@SpirePrefixPatch
public static SpireReturn patch(IntangiblePlayerPower __instance, float dmg, DamageInfo.DamageType type) {
    AbstractPower maybeWithering = __instance.owner.getPower(WitheringPower.POWER_ID);
    if(maybeWithering != null)
    {
        return SpireReturn.Return(Math.min(dmg, maybeWithering.amount + 1));
    }
    return SpireReturn.Continue();
}
 
Example 2
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 3
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 4
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 5
Source File: FlickerPower.java    From FruityMod-StS with MIT License 5 votes vote down vote up
@Override
public float atDamageGive(float damage, DamageInfo.DamageType type) {
    if (type == DamageInfo.DamageType.NORMAL && this.owner.hasPower("Weakened")) {
        return damage * 1.67f;
    }
    return damage;
}
 
Example 6
Source File: FlickerPower.java    From FruityMod-StS with MIT License 5 votes vote down vote up
@Override
public float atDamageReceive(float damage, DamageInfo.DamageType damageType) {
    if (damageType == DamageInfo.DamageType.NORMAL && this.owner.hasPower("Vulnerable")) {
        if (AbstractDungeon.player.hasRelic("Odd Mushroom")) {
            return damage * 0.6f; // -25% (3/4) instead of +25% (5/4) damage 
        }
        return damage * 0.34f; // -50% (1/2) instead of +50% (3/2) damage
    }
    return damage;
}
 
Example 7
Source File: UncommonPowerAction.java    From StS-DefaultModBase with MIT License 5 votes vote down vote up
public UncommonPowerAction(final AbstractPlayer p, final AbstractMonster m,
                           final int magicNumber, final boolean upgraded,
                           final DamageInfo.DamageType damageTypeForTurn, final boolean freeToPlayOnce,
                           final int energyOnUse) {
    this.freeToPlayOnce = false;
    this.p = p;
    this.magicNumber = magicNumber;
    this.freeToPlayOnce = freeToPlayOnce;
    actionType = ActionType.SPECIAL;
    this.energyOnUse = energyOnUse;
    this.upgraded = upgraded;
}
 
Example 8
Source File: BanishedPower.java    From jorbs-spire-mod with MIT License 4 votes vote down vote up
@Override
public float atDamageFinalGive(float damage, DamageInfo.DamageType type) {
    return 0;
}
 
Example 9
Source File: BanishedPower.java    From jorbs-spire-mod with MIT License 4 votes vote down vote up
@Override
public float atDamageFinalReceive(float damage, DamageInfo.DamageType type) {
    return 0;
}
 
Example 10
Source File: DamageSomeEnemiesAction.java    From FruityMod-StS with MIT License 4 votes vote down vote up
public DamageSomeEnemiesAction(AbstractCreature source, boolean[] targets, int[] amount, DamageInfo.DamageType type, AbstractGameAction.AttackEffect effect) {
    this(source, targets, amount, type, effect, false);
}