Java Code Examples for com.evacipated.cardcrawl.modthespire.lib.SpireReturn#Continue

The following examples show how to use com.evacipated.cardcrawl.modthespire.lib.SpireReturn#Continue . 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: CardLegendaryFramePatch.java    From jorbs-spire-mod with MIT License 6 votes vote down vote up
@SpirePrefixPatch
public static SpireReturn Prefix(AbstractCard __this, SpriteBatch sb, float x, float y) {
    if (__this.hasTag(LEGENDARY)) {
        RenderUtils.renderAtlasRegionCenteredAt(
                sb,
                legendaryFrameImg512,
                x,
                y,
                __this.drawScale * Settings.scale,
                ReflectionUtils.getPrivateField(__this, AbstractCard.class, "renderColor"),
                __this.angle);

        return SpireReturn.Return(null);
    }
    return SpireReturn.Continue();
}
 
Example 2
Source File: OnLoseBlockPatch.java    From StSLib with MIT License 6 votes vote down vote up
public static SpireReturn<Integer> Prefix(AbstractCreature __instance, DamageInfo info, @ByRef int[] damageAmount)
{
    if (info.type != DamageInfo.DamageType.HP_LOSS && __instance.currentBlock > 0) {
        for (AbstractPower power : __instance.powers) {
            if (power instanceof OnLoseBlockPower) {
                damageAmount[0] = ((OnLoseBlockPower) power).onLoseBlock(info, damageAmount[0]);
            }
        }
        if (__instance.isPlayer) {
            for (AbstractRelic relic : AbstractDungeon.player.relics) {
                if (relic instanceof OnLoseBlockRelic) {
                    damageAmount[0] = ((OnLoseBlockRelic) relic).onLoseBlock(info, damageAmount[0]);
                }
            }
        }
    }

    return SpireReturn.Continue();
}
 
Example 3
Source File: WristBladeShouldOnlyApplyToAttacksPatch.java    From jorbs-spire-mod with MIT License 5 votes vote down vote up
@SpirePrefixPatch
public static SpireReturn<Float> prefix(WristBlade __this, float damage, AbstractCard c) {
    if (c.type != AbstractCard.CardType.ATTACK) {
        return SpireReturn.Return(damage);
    }
    return SpireReturn.Continue();
}
 
Example 4
Source File: CoffeeDripperThirstPatch.java    From jorbs-spire-mod with MIT License 5 votes vote down vote up
@SpirePrefixPatch
public static SpireReturn<Boolean> prefix(CoffeeDripper __this, AbstractCampfireOption option) {
    if(AbstractDungeon.player instanceof Cull) {
        if (option instanceof ThirstOption && option.getClass().getName().equals(ThirstOption.class.getName())) {
            return SpireReturn.Return(false);
        }
    }
    return SpireReturn.Continue();
}
 
Example 5
Source File: TinyCardColorPatch.java    From jorbs-spire-mod with MIT License 5 votes vote down vote up
@SpirePrefixPatch
public static SpireReturn<Color> Prefix(TinyCard __this, AbstractCard card) {
    if (card.color == Wanderer.Enums.WANDERER_CARD_COLOR) {
        return SpireReturn.Return(Wanderer.ColorInfo.CHARACTER_COLOR.cpy());
    } else if (card.color == Cull.Enums.CULL_CARD_COLOR) {
        return SpireReturn.Return(Cull.ColorInfo.CHARACTER_COLOR.cpy());
    } /* TODO: uncomment me: else if (card.color == Explorer.Enums.EXPLORER_CARD_COLOR) {
        return SpireReturn.Return(Explorer.ColorInfo.CHARACTER_COLOR.cpy());
    } */ else {
        return SpireReturn.Continue();
    }
}
 
Example 6
Source File: TinyCardColorPatch.java    From jorbs-spire-mod with MIT License 5 votes vote down vote up
@SpirePrefixPatch
public static SpireReturn<Color> Prefix(TinyCard __this, AbstractCard card) {
    if (card.color == Wanderer.Enums.WANDERER_CARD_COLOR) {
        return SpireReturn.Return(Color.GRAY.cpy());
    } else if (card.color == Cull.Enums.CULL_CARD_COLOR) {
        return SpireReturn.Return(Color.GRAY.cpy());
    } /* TODO: uncomment me: else if (card.color == Explorer.Enums.EXPLORER_CARD_COLOR) {
        return SpireReturn.Return(Color.GRAY);
    } */ else {
        return SpireReturn.Continue();
    }
}
 
Example 7
Source File: BanishPatch.java    From jorbs-spire-mod with MIT License 5 votes vote down vote up
@SpirePrefixPatch
public static SpireReturn prefix(AbstractPower __this) {
    if (__this.owner.hasPower(BanishedPower.POWER_ID)) {
        return SpireReturn.Return(null);
    }
    return SpireReturn.Continue();
}
 
Example 8
Source File: TrueDamagePatch.java    From jorbs-spire-mod with MIT License 5 votes vote down vote up
@SpirePrefixPatch
public static SpireReturn<Integer> patch(AbstractCreature __this, DamageInfo info, int damageAmount) {
    if (isTrueDamage(info)) {
        return SpireReturn.Return(damageAmount);
    }
    return SpireReturn.Continue();
}
 
Example 9
Source File: CardLegendaryFramePatch.java    From jorbs-spire-mod with MIT License 5 votes vote down vote up
@SpirePrefixPatch
public static SpireReturn Prefix(SingleCardViewPopup __this, SpriteBatch sb) {
    AbstractCard card = ReflectionUtils.getPrivateField(__this, SingleCardViewPopup.class, "card");
    if (card.hasTag(LEGENDARY)) {
        RenderUtils.renderAtlasRegionCenteredAt(
                sb,
                legendaryFrameImg1024,
                (float)Settings.WIDTH / 2.0F,
                (float)Settings.HEIGHT / 2.0F);

        return SpireReturn.Return(null);
    }
    return SpireReturn.Continue();
}
 
Example 10
Source File: OnDamageToRedirectPatch.java    From jorbs-spire-mod with MIT License 5 votes vote down vote up
@SpirePrefixPatch
public static SpireReturn patch(AbstractPlayer __this, DamageInfo info) {
    for (AbstractPower p : __this.powers) {
        if (p instanceof OnDamageToRedirectSubscriber) {
            if (((OnDamageToRedirectSubscriber)p).onDamageToRedirect(__this, info, DEFAULT_ATTACK_EFFECT)) {
                return SpireReturn.Return(null);
            }
        }
    }
    return SpireReturn.Continue();
}
 
Example 11
Source File: CullBlockPatch.java    From jorbs-spire-mod with MIT License 5 votes vote down vote up
@SpirePrefixPatch
public static SpireReturn patch(AbstractCreature __instance, int blockAmount) {
    if(!(__instance instanceof Cull)) { return SpireReturn.Continue(); }
    AbstractDungeon.actionManager.addToBottom(
            new DamageRandomEnemyAction(
                    new DamageInfo(__instance, blockAmount, DamageInfo.DamageType.THORNS),
                    AbstractGameAction.AttackEffect.SLASH_HORIZONTAL)
    );
    return SpireReturn.Return(null);
}
 
Example 12
Source File: StunMonsterPatch.java    From StSLib with MIT License 5 votes vote down vote up
public static SpireReturn<Void> Prefix(AbstractMonster __instance) {
    if (__instance.hasPower(StunMonsterPower.POWER_ID)) {
        return SpireReturn.Return(null);
    } else {
        return SpireReturn.Continue();
    }
}