Java Code Examples for com.megacrit.cardcrawl.core.Settings#WIDTH
The following examples show how to use
com.megacrit.cardcrawl.core.Settings#WIDTH .
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: CardMetaUtils.java From jorbs-spire-mod with MIT License | 6 votes |
public static void playCardAdditionalTime(AbstractCard card, AbstractMonster target) { AbstractCard tmp = card.makeSameInstanceOf(); AbstractDungeon.player.limbo.addToBottom(tmp); tmp.current_x = card.current_x; tmp.current_y = card.current_y; tmp.target_x = (float) Settings.WIDTH / 2.0F - 300.0F * Settings.scale; tmp.target_y = (float)Settings.HEIGHT / 2.0F; if (tmp.cost > 0) { tmp.freeToPlayOnce = true; } if (target != null) { tmp.calculateCardDamage(target); } tmp.purgeOnUse = true; AbstractDungeon.actionManager.addCardQueueItem(new CardQueueItem(tmp, target, card.energyOnUse, true, true), true); }
Example 2
Source File: EffectUtils.java From jorbs-spire-mod with MIT License | 6 votes |
public static void showDowngradeEffect(AbstractCard card) { AbstractDungeon.topLevelEffects.add(new ShowCardBrieflyEffect(card.makeStatEquivalentCopy())); float x = (float) Settings.WIDTH / 2.0F; float y = (float) Settings.HEIGHT / 2.0F; AbstractDungeon.topLevelEffects.add(new GradeChangeShineEffect( x, y, Settings.ACTION_DUR_LONG, () -> CardCrawlGame.sound.playAV("SCENE_TORCH_EXTINGUISH", -0.5F, 10.0F), // TODO: this effect needs to change to something more negative, but figuring out this many particles is a bit out of my brain capacity ATM. // TODO: somehow include the hammer effect too. () -> new UpgradeShineParticleEffect(x + MathUtils.random(-10.0F, 10.0F) * Settings.scale, y + MathUtils.random(-10.0F, 10.0F) * Settings.scale), Color.FIREBRICK.cpy(), true)); AbstractDungeon.actionManager.addToTop(new WaitAction(Settings.ACTION_DUR_LONG)); }
Example 3
Source File: PlayCardEffectAction.java From FruityMod-StS with MIT License | 6 votes |
@Override public void update() { AbstractCard tmp = card.makeStatEquivalentCopy(); AbstractDungeon.player.limbo.addToBottom(tmp); tmp.current_x = card.current_x; tmp.current_y = card.current_y; tmp.target_x = (float) Settings.WIDTH / 2.0f - 300.0f * Settings.scale; tmp.target_y = (float) Settings.HEIGHT / 2.0f; tmp.freeToPlayOnce = true; if (this.target != null) { tmp.calculateCardDamage((AbstractMonster) this.target); } tmp.purgeOnUse = true; AbstractDungeon.actionManager.cardQueue.add(new CardQueueItem(tmp, (AbstractMonster) this.target, card.energyOnUse)); this.isDone = true; }
Example 4
Source File: ReplayThisAction.java From FruityMod-StS with MIT License | 6 votes |
public void update() { if (this.duration == Settings.ACTION_DUR_FAST) {// 26 AbstractMonster m = AbstractDungeon.getRandomMonster(); AbstractCard tmp = funCard.makeSameInstanceOf();// 56 AbstractDungeon.player.limbo.addToBottom(tmp);// 57 tmp.current_x = funCard.current_x;// 58 tmp.current_y = funCard.current_y;// 59 tmp.target_x = (float) Settings.WIDTH / 2.0F - 300.0F * Settings.scale;// 60 tmp.target_y = (float) Settings.HEIGHT / 2.0F;// 61 tmp.applyPowers();// 68 if (tmp.cost > 0) {// 63 tmp.freeToPlayOnce = true;// 64 } if (m != null) {// 67 tmp.calculateCardDamage(m);// 68 } tmp.purgeOnUse = true;// 71 AbstractDungeon.actionManager.cardQueue.add(new CardQueueItem(tmp, m, funCard.energyOnUse, true)); } this.isDone = true;// 79 }
Example 5
Source File: EffectUtils.java From jorbs-spire-mod with MIT License | 5 votes |
public static void showDestroyEffect(AbstractCard card) { CardCrawlGame.sound.play("CARD_EXHAUST"); PurgeCardEffect purgeCardEffect = new PurgeCardEffect(card, (float) (Settings.WIDTH / 2), (float) (Settings.HEIGHT / 2)); float duration = Settings.FAST_MODE ? 0.75F : purgeCardEffect.startingDuration; purgeCardEffect.duration = purgeCardEffect.startingDuration = duration; AbstractDungeon.topLevelEffects.add(purgeCardEffect); AbstractDungeon.actionManager.addToTop(new WaitAction(duration)); }
Example 6
Source File: BranchingUpgradesPatch.java From StSLib with MIT License | 4 votes |
public static SpireReturn Do(GridCardSelectScreen __instance, SpriteBatch sb) { AbstractCard c = getHoveredCard(); if (__instance.forUpgrade && c instanceof BranchingUpgradesCard) { cardList.clear(); AbstractCard branchUpgradedCard = BranchSelectFields.branchUpgradePreviewCard.get(__instance); c.current_x = (Settings.WIDTH * 0.36F); c.current_y = (Settings.HEIGHT / 2.0F); c.target_x = (Settings.WIDTH * 0.36F); c.target_y = (Settings.HEIGHT / 2.0F); c.render(sb); c.updateHoverLogic(); c.hb.resize(0, 0); if (__instance.upgradePreviewCard.hb.hovered) { __instance.upgradePreviewCard.drawScale = 1; } else { __instance.upgradePreviewCard.drawScale = 0.9F; } __instance.upgradePreviewCard.current_x = (Settings.WIDTH * 0.63F); __instance.upgradePreviewCard.current_y = (Settings.HEIGHT * 0.75F - (50 * Settings.scale)); __instance.upgradePreviewCard.target_x = (Settings.WIDTH * 0.63F); __instance.upgradePreviewCard.target_y = (Settings.HEIGHT * 0.75F - (50 * Settings.scale)); __instance.upgradePreviewCard.render(sb); __instance.upgradePreviewCard.updateHoverLogic(); __instance.upgradePreviewCard.renderCardTip(sb); cardList.add(__instance.upgradePreviewCard); if (branchUpgradedCard.hb.hovered) { branchUpgradedCard.drawScale = 1; } else { branchUpgradedCard.drawScale = 0.9F; } branchUpgradedCard.current_x = (Settings.WIDTH * 0.63F); branchUpgradedCard.current_y = (Settings.HEIGHT / 4.0F + (50 * Settings.scale)); branchUpgradedCard.target_x = (Settings.WIDTH * 0.63F); branchUpgradedCard.target_y = (Settings.HEIGHT / 4.0F + (50 * Settings.scale)); branchUpgradedCard.render(sb); branchUpgradedCard.updateHoverLogic(); branchUpgradedCard.renderCardTip(sb); cardList.add(branchUpgradedCard); if ((__instance.forUpgrade) || (__instance.forTransform) || (__instance.forPurge) || (__instance.isJustForConfirming) || (__instance.anyNumber)) { __instance.confirmButton.render(sb); } CardGroup targetGroup = (CardGroup) ReflectionHacks.getPrivate(__instance, GridCardSelectScreen.class, "targetGroup"); String tipMsg = (String) ReflectionHacks.getPrivate(__instance, GridCardSelectScreen.class, "tipMsg"); if ((!__instance.isJustForConfirming) || (targetGroup.size() > 5)) { FontHelper.renderDeckViewTip(sb, tipMsg, 96.0F * Settings.scale, Settings.CREAM_COLOR); } return SpireReturn.Return(null); } return SpireReturn.Continue(); }