Java Code Examples for com.megacrit.cardcrawl.dungeons.AbstractDungeon#screen()

The following examples show how to use com.megacrit.cardcrawl.dungeons.AbstractDungeon#screen() . 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: BottledMemoryRelic.java    From jorbs-spire-mod with MIT License 6 votes vote down vote up
@Override
public void onEquip() {
    // follow same behavior as base game bottle relics. Maybe there's some mod that adds a bottle mechanic changing card using getPurgeableCards
    CardGroup rememberCards = CardUtils.getCardsForBottling(AbstractDungeon.player.masterDeck.getPurgeableCards());
    rememberCards.group.removeIf(c -> !c.hasTag(REMEMBER_MEMORY));
    if (rememberCards.size() > 0) {
        this.cardSelected = false;
        if (AbstractDungeon.isScreenUp) {
            AbstractDungeon.dynamicBanner.hide();
            AbstractDungeon.overlayMenu.cancelButton.hide();
            AbstractDungeon.previousScreen = AbstractDungeon.screen;
        }

        AbstractDungeon.getCurrRoom().phase = AbstractRoom.RoomPhase.INCOMPLETE;
        AbstractDungeon.gridSelectScreen.open(rememberCards, 1, this.DESCRIPTIONS[1] + this.name + LocalizedStrings.PERIOD, false, false, false, false);
    }
}
 
Example 2
Source File: BranchingUpgradesPatch.java    From StSLib with MIT License 6 votes vote down vote up
public static void Postfix(AbstractCard __instance) {
    if (AbstractDungeon.screen == AbstractDungeon.CurrentScreen.GRID && AbstractDungeon.gridSelectScreen.forUpgrade) {
        if (__instance.hb.hovered && InputHelper.justClickedLeft) {
            if (__instance.timesUpgraded < 0) {
                BranchSelectFields.isBranchUpgrading.set(AbstractDungeon.gridSelectScreen, true);
            } else {
                BranchSelectFields.isBranchUpgrading.set(AbstractDungeon.gridSelectScreen, false);
            }

            if (__instance instanceof BranchingUpgradesCard) {
                __instance.beginGlowing();
                cardList.forEach(c -> {
                    if (c != __instance) c.stopGlowing();
                });
            }

            BranchSelectFields.waitingForBranchUpgradeSelection.set(AbstractDungeon.gridSelectScreen, false);
        }
    }
}
 
Example 3
Source File: MemoryFtueTip.java    From jorbs-spire-mod with MIT License 5 votes vote down vote up
public static boolean shouldFakeBeingRemembered(AbstractMemory m) {
    return
            AbstractDungeon.screen == AbstractDungeon.CurrentScreen.FTUE &&
            AbstractDungeon.ftue != null &&
            AbstractDungeon.ftue instanceof MemoryFtueTip &&
            m.ID.equals(PatienceMemory.STATIC.ID);
}
 
Example 4
Source File: MemoryFtueTip.java    From jorbs-spire-mod with MIT License 5 votes vote down vote up
public static boolean shouldFakeBeingClarified(AbstractMemory m) {
    return
            AbstractDungeon.screen == AbstractDungeon.CurrentScreen.FTUE &&
            AbstractDungeon.ftue != null &&
            AbstractDungeon.ftue instanceof MemoryFtueTip &&
            (m.ID.equals(WrathMemory.STATIC.ID) || m.ID.equals(DiligenceMemory.STATIC.ID));
}
 
Example 5
Source File: CampfireThirstEffect.java    From jorbs-spire-mod with MIT License 5 votes vote down vote up
public void render(SpriteBatch sb) {
    sb.setColor(this.screenColor);
    sb.draw(ImageMaster.WHITE_SQUARE_IMG, 0.0F, 0.0F, (float) Settings.WIDTH, (float)Settings.HEIGHT);
    if (AbstractDungeon.screen == AbstractDungeon.CurrentScreen.GRID) {
        AbstractDungeon.gridSelectScreen.render(sb);
    }
}
 
Example 6
Source File: BottledPlaceholderRelic.java    From StS-DefaultModBase with MIT License 5 votes vote down vote up
@Override
public void onEquip() { // 1. When we acquire the relic
    cardSelected = false; // 2. Tell the relic that we haven't bottled the card yet
    if (AbstractDungeon.isScreenUp) { // 3. If the map is open - hide it.
        AbstractDungeon.dynamicBanner.hide();
        AbstractDungeon.overlayMenu.cancelButton.hide();
        AbstractDungeon.previousScreen = AbstractDungeon.screen;
    }
    AbstractDungeon.getCurrRoom().phase = AbstractRoom.RoomPhase.INCOMPLETE;
    // 4. Set the room to INCOMPLETE - don't allow us to use the map, etc.
    CardGroup group = CardGroup.getGroupWithoutBottledCards(AbstractDungeon.player.masterDeck); // 5. Get a card group of all currently unbottled cards
    AbstractDungeon.gridSelectScreen.open(group, 1, DESCRIPTIONS[3] + name + DESCRIPTIONS[2], false, false, false, false);
    // 6. Open the grid selection screen with the cards from the CardGroup we specified above. The description reads "Select a card to bottle for" + (relic name) + "."
}
 
Example 7
Source File: SnapFtueTip.java    From jorbs-spire-mod with MIT License 4 votes vote down vote up
public static boolean shouldFakeCurrentTurn() {
    return AbstractDungeon.screen == AbstractDungeon.CurrentScreen.FTUE && AbstractDungeon.ftue != null && AbstractDungeon.ftue instanceof SnapFtueTip;
}