From fee7809ddda83a306e524c46ba1b46d01253cbf2 Mon Sep 17 00:00:00 2001 From: The_Evil_Pickle Date: Mon, 1 Apr 2019 10:45:06 -0400 Subject: [PATCH] Card Filter Made settings for disabling certain cards. Easier than expected. --- README.md | 5 + .../cards/colorless/BasicMightCard.java | 2 +- .../replay/modifiers/HoneycakeModifier.java | 22 +++ .../replay/powers/WhispersOfEvilPower.java | 16 +- .../cardcrawl/mod/replay/relics/IronCore.java | 52 ++++- .../mod/replay/relics/M_BurningSludge.java | 47 ++--- .../mod/replay/relics/M_ByrdBlood.java | 71 ++++--- .../mod/replay/relics/M_GuardianBlood.java | 2 +- .../mod/replay/relics/M_IronSupplements.java | 66 +++---- .../mod/replay/relics/M_MistRelic.java | 23 ++- .../mod/replay/relics/M_RuneBlood.java | 2 +- .../mod/replay/relics/M_SeaBlood.java | 64 +++---- .../mod/replay/relics/M_SerpentRing.java | 47 ++--- .../mod/replay/relics/M_SlimeRing.java | 60 ++---- .../mod/replay/relics/M_SpellCore.java | 47 ++--- .../mod/replay/relics/M_TsuchinokoRing.java | 80 +++----- .../mod/replay/relics/SimpleRune.java | 116 ++++++------ .../mod/replay/relics/WantedPoster.java | 5 +- .../mod/replay/relics/m_ArcaneBlood.java | 50 ++--- .../mod/replay/relics/m_BookOfShivs.java | 47 ++--- .../mod/replay/relics/m_MercuryCore.java | 64 +++---- .../mod/replay/relics/m_ScarletBlood.java | 50 ++--- .../mod/replay/relics/m_SnakeCloak.java | 50 ++--- .../replayTheSpire/ReplayTheSpireMod.java | 177 +++++++++++++++--- .../panelUI/RelicSettingsButton.java | 14 ++ .../localization/ReplayRunModStrings.json | 4 + 26 files changed, 591 insertions(+), 592 deletions(-) create mode 100644 src/main/java/com/megacrit/cardcrawl/mod/replay/modifiers/HoneycakeModifier.java diff --git a/README.md b/README.md index 9077986c..9a175071 100644 --- a/README.md +++ b/README.md @@ -40,14 +40,17 @@ Gremlin Food | All | Common | Whenever you rest, **Upgrade** a random card. Grinning Jar | All | Common | On pickup, add a Grinning Jar card to your deck. Obtain another copy for every 12 cards added to your deck. King of Hearts | Ironclad | Common | When you lose HP during your turn, gain twice that much block. Lightbulb | All | Common | If you have leftover energy at the end of your turn, draw that many cards at the start of your next turn. +Mystery Machine | All | Common | Gains 1 charge each time you enter a ? room. Loses 1 charge each time you move between two non-? rooms. At the start of combat, randomly gain **Strength** and **Dexterity** equal to charges. Rune of Simplicity | All | Common | Strikes and Defends can be **Upgraded** any number of times. On pickup, **Upgrade** 2 randomly. Tag Bag | All | Common | Shops have all 3 kinds of sale tags. Sale tags can appear on colorless cards. On-sale cards are slightly cheaper Tiger Marble | All | Common | At the start of combat, add a random card that **Exhausts** to your hand. It costs 0 this turn. Pet Ghost | All | Common | At the start of each turn, add a Ghost Swipe, Ghost Defend, or Ghost Fetch to your hand (chosen randomly). Max hand size is increased by 1. Accelerometer | All | Uncommon | Can be used once per combat. Decrease your turn-based debuffs by 1, and increase all enemy turn-based debuffs by 1. Basket of Snakes | Silent | Uncommon | Every 5th **Attack** you play applies 2 **Necrotic** **Poison** upon dealing unblocked damage. +Bottled Eggs | All | Uncommon | On pick up, choose a card. **Upgrade** all copies of that card you have. When you add a new copy of that card to your deck, it is **Upgraded**. Bottled Flurry | All | Uncommon | On pick up, choose a card. You **Retain** that card at the end of your turn, or Discard it if it is **Ethereal.** Bottled Geyser | All | Uncommon | On pick up, choose a card. Each time you shuffle your deck, that card is placed on top. +Bottled Snecko | All | Uncommon | On pick up, you may choose a card. It gains **Snecko**. If you do not choose a card, you may choose one at a later rest site. Carrot | Defect | Uncommon | Gain 3 **Focus** at the start of combat, then lose 1 **Focus** on the next 3 turns. Chameleon Ring | All | Uncommon | Potions are ~50% more potent. You may brew 2 random potions at rest sites. Divine Protection | All | Uncommon | Gain 8 **Shielding** at the start of combat. @@ -145,6 +148,7 @@ Time Bomb | Blue | Uncommon | Skill | 1 | Gain 2 orb slots. **Channel** 2 **Glas Mirror Shield | Blue | Rare | Skill | 2 | **Channel** 1 **Crystal.** **Channel** 1 **Frost.** Gain 5(8) **Block.** Gain 1(2) **Reflection.** RNG | Blue | Rare | Skill | X | **Channel** X(+1) random orbs. Omega Cannon | Blue | Rare | Attack | 2 | Deal 7(6) damage to ALL enemies 4(5) times. Add 1 **Backfire** to your draw and discard piles. **Focus** increases damage." +Might | Colorless | Uncommon | Power | X | Your attacks deal 25% extra damage for X turns. **Refund** 1(2). Poisoned Strike | Colorless | Uncommon | Skill | 0 | Apply 3(4) **Poison**. Is affected by damage modifiers. Specialist | Colorless | Uncommon | Power | 0 | Lose 1 Focus. All non-attack damage you deal is increased by 2. (**Innate.**) Ssssshield | Colorless | Uncommon | Skill | ? | Gain 6 **Block**. Gain 6 **Shielding** for each energy this cost. (**Refund** 1). **Snecko**. **Exhaust**. @@ -379,6 +383,7 @@ Ring of Shattering | Dead Man's Rings (as Defect) | At the start of combat gain * If you have Honey Jar and Singing Bowl at the same time, using Singing Bowl's max hp gain option also picks a reward card at random. * Burning Branch can now be exchanged for a different relic at rest sites. * Fire Breathing now increases damage based on number of attacks played. + * If a Bottled card is removed from your deck, you may choose a new card to bottle at rest sites (free action). * You can never get Ectoplasm from Neow. diff --git a/src/main/java/com/megacrit/cardcrawl/mod/replay/cards/colorless/BasicMightCard.java b/src/main/java/com/megacrit/cardcrawl/mod/replay/cards/colorless/BasicMightCard.java index 5f1e1a4f..ff9ab1f1 100644 --- a/src/main/java/com/megacrit/cardcrawl/mod/replay/cards/colorless/BasicMightCard.java +++ b/src/main/java/com/megacrit/cardcrawl/mod/replay/cards/colorless/BasicMightCard.java @@ -22,7 +22,7 @@ public class BasicMightCard public BasicMightCard() { - super(ID, NAME, "cards/replay/replayBetaPower.png", BasicMightCard.COST, DESCRIPTION, AbstractCard.CardType.POWER, AbstractCard.CardColor.COLORLESS, AbstractCard.CardRarity.RARE, AbstractCard.CardTarget.NONE); + super(ID, NAME, "cards/replay/replayBetaPower.png", BasicMightCard.COST, DESCRIPTION, AbstractCard.CardType.POWER, AbstractCard.CardColor.COLORLESS, AbstractCard.CardRarity.UNCOMMON, AbstractCard.CardTarget.NONE); RefundVariable.setBaseValue(this, 1); } diff --git a/src/main/java/com/megacrit/cardcrawl/mod/replay/modifiers/HoneycakeModifier.java b/src/main/java/com/megacrit/cardcrawl/mod/replay/modifiers/HoneycakeModifier.java new file mode 100644 index 00000000..eb77411f --- /dev/null +++ b/src/main/java/com/megacrit/cardcrawl/mod/replay/modifiers/HoneycakeModifier.java @@ -0,0 +1,22 @@ +package com.megacrit.cardcrawl.mod.replay.modifiers; + +import com.megacrit.cardcrawl.core.CardCrawlGame; +import com.megacrit.cardcrawl.daily.mods.AbstractDailyMod; +import com.megacrit.cardcrawl.helpers.ImageMaster; +import com.megacrit.cardcrawl.localization.RunModStrings; +import com.megacrit.cardcrawl.mod.replay.relics.HoneyJar; + +import HalationCode.relics.ddlc.CatFaceCupcake; + +public class HoneycakeModifier extends AbstractDailyMod +{ + public static final String ID = "replay:honeycakes"; + private static final RunModStrings modStrings = CardCrawlGame.languagePack.getRunModString(ID); + public static final String NAME = modStrings.NAME; + public static final String DESC = modStrings.DESCRIPTION; + + public HoneycakeModifier() { + super(ID, NAME, DESC, null, true);//DESC.replaceAll("{A}", (new HoneyJar()).name).replaceAll("{B}", (new CatFaceCupcake()).name) + this.img = ImageMaster.loadImage("images/relics/cursedBlood.png"); + } +} \ No newline at end of file diff --git a/src/main/java/com/megacrit/cardcrawl/mod/replay/powers/WhispersOfEvilPower.java b/src/main/java/com/megacrit/cardcrawl/mod/replay/powers/WhispersOfEvilPower.java index 1604f443..2910b03f 100644 --- a/src/main/java/com/megacrit/cardcrawl/mod/replay/powers/WhispersOfEvilPower.java +++ b/src/main/java/com/megacrit/cardcrawl/mod/replay/powers/WhispersOfEvilPower.java @@ -1,12 +1,15 @@ package com.megacrit.cardcrawl.mod.replay.powers; import com.evacipated.cardcrawl.mod.stslib.fields.cards.AbstractCard.AlwaysRetainField; +import com.evacipated.cardcrawl.mod.stslib.fields.cards.AbstractCard.AutoplayField; +import com.evacipated.cardcrawl.mod.stslib.fields.cards.AbstractCard.FleetingField; import com.evacipated.cardcrawl.mod.stslib.fields.cards.AbstractCard.SoulboundField; import com.megacrit.cardcrawl.core.AbstractCreature; import com.megacrit.cardcrawl.core.CardCrawlGame; import com.megacrit.cardcrawl.dungeons.AbstractDungeon; import com.megacrit.cardcrawl.localization.PowerStrings; import com.megacrit.cardcrawl.mod.replay.actions.common.EchoToDrawAction; +import com.megacrit.cardcrawl.mod.replay.cards.curses.LoomingEvil; import com.megacrit.cardcrawl.powers.AbstractPower; import basemod.interfaces.CloneablePowerInterface; @@ -14,6 +17,7 @@ import com.megacrit.cardcrawl.actions.common.MakeTempCardInDrawPileAction; import com.megacrit.cardcrawl.actions.common.RemoveSpecificPowerAction; import com.megacrit.cardcrawl.cards.AbstractCard; +import com.megacrit.cardcrawl.cards.AbstractCard.CardType; public class WhispersOfEvilPower extends AbstractPower implements CloneablePowerInterface { @@ -59,12 +63,22 @@ public void updateDescription() this.description = DESCRIPTIONS[0] + this.amount + DESCRIPTIONS[1] + this.amount + DESCRIPTIONS[2]; } } + //ban certain types of curses + private boolean isCurseValid(AbstractCard card) { + if (FleetingField.fleeting.get(card) || SoulboundField.soulbound.get(card) || (AutoplayField.autoplay.get(card) && card.type != CardType.POWER) || card.cardID.equals("conspire:Blindness") || card.cardID.equals("hubris:Disease") || card.cardID.equals(LoomingEvil.ID)) + return false; + return true; + } + @Override public void atEndOfTurn(boolean isPlayer) { this.flash(); for (int i = 0; i < this.amount; i++) { - final AbstractCard card = AbstractDungeon.returnRandomCurse().makeStatEquivalentCopy(); + AbstractCard card = AbstractDungeon.returnRandomCurse().makeStatEquivalentCopy(); + while (!isCurseValid(card)) { + card = AbstractDungeon.returnRandomCurse().makeStatEquivalentCopy(); + } AbstractDungeon.actionManager.addToBottom(new EchoToDrawAction(card, 1)); } } diff --git a/src/main/java/com/megacrit/cardcrawl/mod/replay/relics/IronCore.java b/src/main/java/com/megacrit/cardcrawl/mod/replay/relics/IronCore.java index fc850fd4..2749e5ac 100644 --- a/src/main/java/com/megacrit/cardcrawl/mod/replay/relics/IronCore.java +++ b/src/main/java/com/megacrit/cardcrawl/mod/replay/relics/IronCore.java @@ -9,6 +9,7 @@ import com.megacrit.cardcrawl.actions.common.RelicAboveCreatureAction; import com.megacrit.cardcrawl.actions.defect.IncreaseMaxOrbAction; import com.megacrit.cardcrawl.cards.AbstractCard; +import com.megacrit.cardcrawl.cards.AbstractCard.CardColor; import com.megacrit.cardcrawl.cards.blue.BeamCell; import com.megacrit.cardcrawl.cards.blue.Capacitor; import com.megacrit.cardcrawl.cards.blue.Claw; @@ -44,7 +45,7 @@ import com.megacrit.cardcrawl.cards.red.Whirlwind; import com.megacrit.cardcrawl.characters.*; -public class IronCore extends AbstractRelic +public class IronCore extends M_MistRelic { public static final String ID = "Iron Core"; private boolean hasBlues; @@ -52,7 +53,7 @@ public class IronCore extends AbstractRelic private boolean firstTurn; public IronCore() { - super("Iron Core", "ironCoreOrb.png", RelicTier.STARTER, LandingSound.CLINK); + super("Iron Core", "ironCoreOrb.png", LandingSound.CLINK, CardColor.RED, CardColor.BLUE, 2); this.hasReds = false; this.hasBlues = false; this.firstTurn = true; @@ -106,7 +107,6 @@ public AbstractRelic makeCopy() { @Override public void onEquip() { - final long startTime = System.currentTimeMillis(); final ArrayList tmpPool = new ArrayList(); if (!(AbstractDungeon.player instanceof Ironclad)) { AbstractDungeon.rareRelicPool.add("Magic Flower"); @@ -184,4 +184,50 @@ public void onEquip() { } } } + + @Override + ArrayList getNewCards() { + final ArrayList tmpPool = new ArrayList(); + tmpPool.add(new Anger()); + tmpPool.add(new Barricade()); + tmpPool.add(new Clash()); + tmpPool.add(new DoubleTap()); + tmpPool.add(new DualWield()); + tmpPool.add(new FireBreathing()); + tmpPool.add(new Flex()); + tmpPool.add(new Headbutt()); + tmpPool.add(new HeavyBlade()); + tmpPool.add(new Inflame()); + tmpPool.add(new IronWave()); + tmpPool.add(new Juggernaut()); + tmpPool.add(new LimitBreak()); + tmpPool.add(new Offering()); + tmpPool.add(new Reaper()); + tmpPool.add(new SeeingRed()); + tmpPool.add(new Warcry()); + tmpPool.add(new Whirlwind()); + tmpPool.add(new MuscleTraining());tmpPool.add(new BeamCell()); + tmpPool.add(new Capacitor()); + tmpPool.add(new Claw()); + tmpPool.add(new ColdSnap()); + tmpPool.add(new Defragment()); + tmpPool.add(new FTL()); + tmpPool.add(new ForceField()); + tmpPool.add(new GeneticAlgorithm()); + tmpPool.add(new Glacier()); + tmpPool.add(new Hologram()); + tmpPool.add(new Overclock()); + tmpPool.add(new Rebound()); + tmpPool.add(new Recycle()); + tmpPool.add(new RipAndTear()); + tmpPool.add(new Turbo()); + tmpPool.add(new ReplayGoodbyeWorld()); + tmpPool.add(new ReplayRepulse()); + tmpPool.add(new MirrorShield()); + tmpPool.add(new SystemScan()); + tmpPool.add(new WeaponsOverheat()); + tmpPool.add(new IC_ScorchingBeam()); + tmpPool.add(new IC_FireWall()); + return tmpPool; + } } diff --git a/src/main/java/com/megacrit/cardcrawl/mod/replay/relics/M_BurningSludge.java b/src/main/java/com/megacrit/cardcrawl/mod/replay/relics/M_BurningSludge.java index bcfdb036..38686bb4 100644 --- a/src/main/java/com/megacrit/cardcrawl/mod/replay/relics/M_BurningSludge.java +++ b/src/main/java/com/megacrit/cardcrawl/mod/replay/relics/M_BurningSludge.java @@ -4,6 +4,7 @@ import com.megacrit.cardcrawl.actions.common.RelicAboveCreatureAction; import com.megacrit.cardcrawl.cards.AbstractCard; +import com.megacrit.cardcrawl.cards.AbstractCard.CardColor; import com.megacrit.cardcrawl.cards.red.*; import com.megacrit.cardcrawl.characters.AbstractPlayer; import com.megacrit.cardcrawl.dungeons.AbstractDungeon; @@ -13,12 +14,12 @@ import slimebound.orbs.SpawnedSlime; -public class M_BurningSludge extends AbstractRelic +public class M_BurningSludge extends M_MistRelic { public static final String ID = "m_BurningSludge"; public M_BurningSludge() { - super(ID, "burningBlood_green.png", RelicTier.STARTER, LandingSound.MAGICAL); + super(ID, "burningBlood_green.png", LandingSound.MAGICAL, slimebound.patches.AbstractCardEnum.SLIMEBOUND, CardColor.RED); } @Override @@ -39,9 +40,15 @@ public void onVictory() { p.heal(slimeCount * 2); } } + + @Override + public AbstractRelic makeCopy() { + return new M_BurningSludge(); + } + @Override - public void onEquip() { - final ArrayList tmpPool = new ArrayList(); + ArrayList getNewCards() { + final ArrayList tmpPool = new ArrayList(); tmpPool.add(new Offering()); tmpPool.add(new Hemogenesis()); tmpPool.add(new Pummel()); @@ -52,35 +59,7 @@ public void onEquip() { tmpPool.add(new BloodForBlood()); tmpPool.add(new Rupture()); tmpPool.add(new Evolve()); - for (final AbstractCard c : tmpPool) { - switch (c.rarity) { - case COMMON: { - AbstractDungeon.commonCardPool.addToTop(c); - AbstractDungeon.srcCommonCardPool.addToBottom(c); - continue; - } - case UNCOMMON: { - AbstractDungeon.uncommonCardPool.addToTop(c); - AbstractDungeon.srcUncommonCardPool.addToBottom(c); - continue; - } - case RARE: { - AbstractDungeon.rareCardPool.addToTop(c); - AbstractDungeon.srcRareCardPool.addToBottom(c); - continue; - } - default: { - AbstractDungeon.uncommonCardPool.addToTop(c); - AbstractDungeon.srcUncommonCardPool.addToBottom(c); - continue; - } - } - } - } - - @Override - public AbstractRelic makeCopy() { - return new M_BurningSludge(); - } + return tmpPool; + } } diff --git a/src/main/java/com/megacrit/cardcrawl/mod/replay/relics/M_ByrdBlood.java b/src/main/java/com/megacrit/cardcrawl/mod/replay/relics/M_ByrdBlood.java index d17e4ac6..b2167853 100644 --- a/src/main/java/com/megacrit/cardcrawl/mod/replay/relics/M_ByrdBlood.java +++ b/src/main/java/com/megacrit/cardcrawl/mod/replay/relics/M_ByrdBlood.java @@ -7,19 +7,23 @@ import com.megacrit.cardcrawl.actions.common.HealAction; import com.megacrit.cardcrawl.actions.common.RelicAboveCreatureAction; import com.megacrit.cardcrawl.cards.AbstractCard; +import com.megacrit.cardcrawl.cards.AbstractCard.CardColor; import com.megacrit.cardcrawl.cards.red.*; import com.megacrit.cardcrawl.rooms.*; + +import beaked.cards.*; + import com.megacrit.cardcrawl.characters.AbstractPlayer; import com.megacrit.cardcrawl.dungeons.AbstractDungeon; import com.megacrit.cardcrawl.mod.replay.cards.red.*; import com.megacrit.cardcrawl.relics.*; -public class M_ByrdBlood extends AbstractRelic +public class M_ByrdBlood extends M_MistRelic { public static final String ID = "m_ByrdBlood"; public M_ByrdBlood() { - super(ID, "burningBlood_yellow.png", RelicTier.STARTER, LandingSound.MAGICAL); + super(ID, "burningBlood_yellow.png", LandingSound.MAGICAL, beaked.patches.AbstractCardEnum.BEAKED_YELLOW, CardColor.RED); } @Override @@ -36,42 +40,7 @@ public void onGainStrength(ApplyPowerAction __instance) { @Override public void onEquip() { AbstractDungeon.rareRelicPool.add("Magic Flower"); - final long startTime = System.currentTimeMillis(); - final ArrayList tmpPool = new ArrayList(); - tmpPool.add(new Reaper()); - tmpPool.add(new Feed()); - tmpPool.add(new Hemogenesis()); - tmpPool.add(new Flex()); - tmpPool.add(new HeavyBlade()); - tmpPool.add(new Massacre()); - tmpPool.add(new Inflame()); - tmpPool.add(new SpotWeakness()); - tmpPool.add(new DemonForm()); - tmpPool.add(new MuscleTraining()); - for (final AbstractCard c : tmpPool) { - switch (c.rarity) { - case COMMON: { - AbstractDungeon.commonCardPool.addToTop(c); - AbstractDungeon.srcCommonCardPool.addToBottom(c); - continue; - } - case UNCOMMON: { - AbstractDungeon.uncommonCardPool.addToTop(c); - AbstractDungeon.srcUncommonCardPool.addToBottom(c); - continue; - } - case RARE: { - AbstractDungeon.rareCardPool.addToTop(c); - AbstractDungeon.srcRareCardPool.addToBottom(c); - continue; - } - default: { - AbstractDungeon.uncommonCardPool.addToTop(c); - AbstractDungeon.srcUncommonCardPool.addToBottom(c); - continue; - } - } - } + super.onEquip(); } @Override public int onPlayerHeal(final int healAmount) { @@ -95,5 +64,31 @@ public void onVictory() { public AbstractRelic makeCopy() { return new M_ByrdBlood(); } + + @Override + ArrayList getNewCards() { + final ArrayList tmpPool = new ArrayList(); + tmpPool.add(new Reaper()); + tmpPool.add(new Feed()); + tmpPool.add(new Hemogenesis()); + tmpPool.add(new Flex()); + tmpPool.add(new HeavyBlade()); + tmpPool.add(new Massacre()); + tmpPool.add(new Inflame()); + tmpPool.add(new SpotWeakness()); + tmpPool.add(new DemonForm()); + tmpPool.add(new MuscleTraining()); + + tmpPool.add(new BloodRitual()); + tmpPool.add(new WarriorEssence()); + tmpPool.add(new DesperateSwing()); + tmpPool.add(new Resilience()); + tmpPool.add(new SacrificialScars()); + tmpPool.add(new WildInstinct()); + tmpPool.add(new BloodForTheGods()); + tmpPool.add(new DigDeeper()); + tmpPool.add(new FeelMyPain()); + return tmpPool; + } } diff --git a/src/main/java/com/megacrit/cardcrawl/mod/replay/relics/M_GuardianBlood.java b/src/main/java/com/megacrit/cardcrawl/mod/replay/relics/M_GuardianBlood.java index 66c479d3..5830ffaa 100644 --- a/src/main/java/com/megacrit/cardcrawl/mod/replay/relics/M_GuardianBlood.java +++ b/src/main/java/com/megacrit/cardcrawl/mod/replay/relics/M_GuardianBlood.java @@ -17,7 +17,7 @@ public class M_GuardianBlood extends M_MistRelic public static final String ID = "m_GuardianBlood"; public M_GuardianBlood() { - super(ID, "burningBlood_orange.png", RelicTier.STARTER, LandingSound.MAGICAL, guardian.patches.AbstractCardEnum.GUARDIAN, CardColor.RED); + super(ID, "burningBlood_orange.png", LandingSound.MAGICAL, guardian.patches.AbstractCardEnum.GUARDIAN, CardColor.RED); } @Override diff --git a/src/main/java/com/megacrit/cardcrawl/mod/replay/relics/M_IronSupplements.java b/src/main/java/com/megacrit/cardcrawl/mod/replay/relics/M_IronSupplements.java index 894b2b27..ea080d68 100644 --- a/src/main/java/com/megacrit/cardcrawl/mod/replay/relics/M_IronSupplements.java +++ b/src/main/java/com/megacrit/cardcrawl/mod/replay/relics/M_IronSupplements.java @@ -4,6 +4,7 @@ import com.megacrit.cardcrawl.actions.common.RelicAboveCreatureAction; import com.megacrit.cardcrawl.cards.AbstractCard; +import com.megacrit.cardcrawl.cards.AbstractCard.CardColor; import com.megacrit.cardcrawl.cards.red.*; import com.megacrit.cardcrawl.characters.AbstractPlayer; import com.megacrit.cardcrawl.dungeons.AbstractDungeon; @@ -12,12 +13,12 @@ import blackrusemod.powers.*; -public class M_IronSupplements extends AbstractRelic +public class M_IronSupplements extends M_MistRelic { public static final String ID = "m_IronSupplements"; public M_IronSupplements() { - super(ID, "redPill.png", RelicTier.STARTER, LandingSound.FLAT); + super(ID, "redPill.png", LandingSound.FLAT, gluttonmod.patches.AbstractCardEnum.GLUTTON, CardColor.RED); } @Override @@ -26,9 +27,23 @@ public String getUpdatedDescription() { } @Override - public void onEquip() { - final long startTime = System.currentTimeMillis(); - final ArrayList tmpPool = new ArrayList(); + public void onVictory() { + this.flash(); + AbstractDungeon.actionManager.addToTop(new RelicAboveCreatureAction(AbstractDungeon.player, this)); + final AbstractPlayer p = AbstractDungeon.player; + if (p.currentHealth > 0) { + p.heal(6); + } + } + + @Override + public AbstractRelic makeCopy() { + return new M_IronSupplements(); + } + + @Override + ArrayList getNewCards() { + final ArrayList tmpPool = new ArrayList(); tmpPool.add(new Hemokinesis()); tmpPool.add(new Offering()); tmpPool.add(new Hemogenesis()); @@ -47,44 +62,7 @@ public void onEquip() { tmpPool.add(new Sentinel()); tmpPool.add(new Abandon()); tmpPool.add(new DefyDeath()); - for (final AbstractCard c : tmpPool) { - switch (c.rarity) { - case COMMON: { - AbstractDungeon.commonCardPool.addToTop(c); - AbstractDungeon.srcCommonCardPool.addToBottom(c); - continue; - } - case UNCOMMON: { - AbstractDungeon.uncommonCardPool.addToTop(c); - AbstractDungeon.srcUncommonCardPool.addToBottom(c); - continue; - } - case RARE: { - AbstractDungeon.rareCardPool.addToTop(c); - AbstractDungeon.srcRareCardPool.addToBottom(c); - continue; - } - default: { - AbstractDungeon.uncommonCardPool.addToTop(c); - AbstractDungeon.srcUncommonCardPool.addToBottom(c); - continue; - } - } - } - } - @Override - public void onVictory() { - this.flash(); - AbstractDungeon.actionManager.addToTop(new RelicAboveCreatureAction(AbstractDungeon.player, this)); - final AbstractPlayer p = AbstractDungeon.player; - if (p.currentHealth > 0) { - p.heal(6); - } - } - - @Override - public AbstractRelic makeCopy() { - return new M_IronSupplements(); - } + return tmpPool; + } } diff --git a/src/main/java/com/megacrit/cardcrawl/mod/replay/relics/M_MistRelic.java b/src/main/java/com/megacrit/cardcrawl/mod/replay/relics/M_MistRelic.java index a5104071..db11e1ff 100644 --- a/src/main/java/com/megacrit/cardcrawl/mod/replay/relics/M_MistRelic.java +++ b/src/main/java/com/megacrit/cardcrawl/mod/replay/relics/M_MistRelic.java @@ -2,21 +2,23 @@ import java.util.ArrayList; +import com.evacipated.cardcrawl.modthespire.lib.SpirePatch; import com.megacrit.cardcrawl.cards.*; import com.megacrit.cardcrawl.cards.AbstractCard.CardColor; import com.megacrit.cardcrawl.dungeons.AbstractDungeon; import com.megacrit.cardcrawl.relics.AbstractRelic; +import com.megacrit.cardcrawl.relics.AbstractRelic.RelicTier; public abstract class M_MistRelic extends AbstractRelic { CardColor mainColor; CardColor baseColor; int orbSlots; - public M_MistRelic(String setId, String imgName, RelicTier tier, LandingSound sfx, CardColor mainColor, CardColor baseColor) { - this(setId, imgName, tier, sfx, mainColor, baseColor, 0); + public M_MistRelic(String setId, String imgName, LandingSound sfx, CardColor mainColor, CardColor baseColor) { + this(setId, imgName, sfx, mainColor, baseColor, 0); } - public M_MistRelic(String setId, String imgName, RelicTier tier, LandingSound sfx, CardColor mainColor, CardColor baseColor, int orbSlots) { - super(setId, imgName, tier, sfx); + public M_MistRelic(String setId, String imgName, LandingSound sfx, CardColor mainColor, CardColor baseColor, int orbSlots) { + super(setId, imgName, RelicTier.STARTER, sfx); this.mainColor = mainColor; this.baseColor = baseColor; this.orbSlots = orbSlots; @@ -75,4 +77,17 @@ public void onEquip() { this.addCardsToPools(); AbstractDungeon.player.masterMaxOrbs = Math.max(this.orbSlots, AbstractDungeon.player.masterMaxOrbs); } + + @SpirePatch(cls = "com.megacrit.cardcrawl.helpers.CardLibrary", method = "initialize") + public static class PatchThisShit { + public static void Postfix() { + if (AbstractDungeon.player != null) { + for (AbstractRelic r : AbstractDungeon.player.relics) { + if (r instanceof M_MistRelic) { + ((M_MistRelic)r).addCardsToPools(); + } + } + } + } + } } \ No newline at end of file diff --git a/src/main/java/com/megacrit/cardcrawl/mod/replay/relics/M_RuneBlood.java b/src/main/java/com/megacrit/cardcrawl/mod/replay/relics/M_RuneBlood.java index 6ab5a5b3..63dae00e 100644 --- a/src/main/java/com/megacrit/cardcrawl/mod/replay/relics/M_RuneBlood.java +++ b/src/main/java/com/megacrit/cardcrawl/mod/replay/relics/M_RuneBlood.java @@ -23,7 +23,7 @@ public class M_RuneBlood extends M_MistRelic private static final int DAMAGE_AMT = 20; public M_RuneBlood() { - super(ID, "burningBlood_orange.png", RelicTier.STARTER, LandingSound.MAGICAL, runesmith.patches.AbstractCardEnum.RUNESMITH_BEIGE, CardColor.RED); + super(ID, "burningBlood_orange.png", LandingSound.MAGICAL, runesmith.patches.AbstractCardEnum.RUNESMITH_BEIGE, CardColor.RED); } @Override diff --git a/src/main/java/com/megacrit/cardcrawl/mod/replay/relics/M_SeaBlood.java b/src/main/java/com/megacrit/cardcrawl/mod/replay/relics/M_SeaBlood.java index 8c02ca17..863feac0 100644 --- a/src/main/java/com/megacrit/cardcrawl/mod/replay/relics/M_SeaBlood.java +++ b/src/main/java/com/megacrit/cardcrawl/mod/replay/relics/M_SeaBlood.java @@ -6,6 +6,7 @@ import com.megacrit.cardcrawl.actions.common.ApplyPowerAction; import com.megacrit.cardcrawl.actions.common.RelicAboveCreatureAction; import com.megacrit.cardcrawl.cards.AbstractCard; +import com.megacrit.cardcrawl.cards.AbstractCard.CardColor; import com.megacrit.cardcrawl.cards.red.*; import com.megacrit.cardcrawl.rooms.*; import com.megacrit.cardcrawl.characters.AbstractPlayer; @@ -17,12 +18,12 @@ import blackrusemod.powers.*; -public class M_SeaBlood extends AbstractRelic +public class M_SeaBlood extends M_MistRelic { public static final String ID = "m_SeaBlood"; public M_SeaBlood() { - super(ID, "burningBlood_blue.png", RelicTier.STARTER, LandingSound.MAGICAL); + super(ID, "burningBlood_blue.png", LandingSound.MAGICAL, blackbeard.enums.AbstractCardEnum.BLACKBEARD_BLACK, CardColor.RED); } @Override @@ -31,8 +32,22 @@ public String getUpdatedDescription() { } @Override - public void onEquip() { - final long startTime = System.currentTimeMillis(); + public void onVictory() { + this.flash(); + AbstractDungeon.actionManager.addToTop(new RelicAboveCreatureAction(AbstractDungeon.player, this)); + final AbstractPlayer p = AbstractDungeon.player; + if (p.currentHealth > 0) { + p.heal(6); + } + } + + @Override + public AbstractRelic makeCopy() { + return new M_SeaBlood(); + } + + @Override + ArrayList getNewCards() { final ArrayList tmpPool = new ArrayList(); tmpPool.add(new Hemokinesis()); tmpPool.add(new Offering()); @@ -48,44 +63,7 @@ public void onEquip() { tmpPool.add(new MuscleTraining()); tmpPool.add(new FireBreathing()); tmpPool.add(new Whirlwind()); - for (final AbstractCard c : tmpPool) { - switch (c.rarity) { - case COMMON: { - AbstractDungeon.commonCardPool.addToTop(c); - AbstractDungeon.srcCommonCardPool.addToBottom(c); - continue; - } - case UNCOMMON: { - AbstractDungeon.uncommonCardPool.addToTop(c); - AbstractDungeon.srcUncommonCardPool.addToBottom(c); - continue; - } - case RARE: { - AbstractDungeon.rareCardPool.addToTop(c); - AbstractDungeon.srcRareCardPool.addToBottom(c); - continue; - } - default: { - AbstractDungeon.uncommonCardPool.addToTop(c); - AbstractDungeon.srcUncommonCardPool.addToBottom(c); - continue; - } - } - } - } - @Override - public void onVictory() { - this.flash(); - AbstractDungeon.actionManager.addToTop(new RelicAboveCreatureAction(AbstractDungeon.player, this)); - final AbstractPlayer p = AbstractDungeon.player; - if (p.currentHealth > 0) { - p.heal(6); - } - } - - @Override - public AbstractRelic makeCopy() { - return new M_SeaBlood(); - } + return tmpPool; + } } diff --git a/src/main/java/com/megacrit/cardcrawl/mod/replay/relics/M_SerpentRing.java b/src/main/java/com/megacrit/cardcrawl/mod/replay/relics/M_SerpentRing.java index ec660109..a23ed64a 100644 --- a/src/main/java/com/megacrit/cardcrawl/mod/replay/relics/M_SerpentRing.java +++ b/src/main/java/com/megacrit/cardcrawl/mod/replay/relics/M_SerpentRing.java @@ -6,6 +6,7 @@ import com.megacrit.cardcrawl.actions.common.MakeTempCardInHandAction; import com.megacrit.cardcrawl.actions.common.RelicAboveCreatureAction; import com.megacrit.cardcrawl.cards.AbstractCard; +import com.megacrit.cardcrawl.cards.AbstractCard.CardColor; import com.megacrit.cardcrawl.cards.colorless.Shiv; import com.megacrit.cardcrawl.cards.green.*; import com.megacrit.cardcrawl.dungeons.AbstractDungeon; @@ -17,12 +18,12 @@ import com.megacrit.cardcrawl.relics.AbstractRelic.RelicTier; import com.megacrit.cardcrawl.relics.NinjaScroll; -public class M_SerpentRing extends AbstractRelic +public class M_SerpentRing extends M_MistRelic { public static final String ID = "m_SerpentRing"; public M_SerpentRing() { - super(ID, "snakeRing.png", RelicTier.STARTER, LandingSound.MAGICAL); + super(ID, "snakeRing.png", LandingSound.FLAT, blackbeard.enums.AbstractCardEnum.BLACKBEARD_BLACK, CardColor.GREEN); } @Override @@ -40,6 +41,16 @@ public void atBattleStart() { public void onEquip() { AbstractDungeon.bossRelicPool.add(WristBlade.ID); AbstractDungeon.uncommonRelicPool.add(NinjaScroll.ID); + super.onEquip(); + } + + @Override + public AbstractRelic makeCopy() { + return new M_SerpentRing(); + } + + @Override + ArrayList getNewCards() { final ArrayList tmpPool = new ArrayList(); tmpPool.add(new AThousandCuts()); tmpPool.add(new Adrenaline()); @@ -54,34 +65,6 @@ public void onEquip() { tmpPool.add(new HiddenBlade()); tmpPool.add(new CloakAndDagger()); tmpPool.add(new StormOfSteel()); - for (final AbstractCard c : tmpPool) { - switch (c.rarity) { - case COMMON: { - AbstractDungeon.commonCardPool.addToTop(c); - AbstractDungeon.srcCommonCardPool.addToBottom(c); - continue; - } - case UNCOMMON: { - AbstractDungeon.uncommonCardPool.addToTop(c); - AbstractDungeon.srcUncommonCardPool.addToBottom(c); - continue; - } - case RARE: { - AbstractDungeon.rareCardPool.addToTop(c); - AbstractDungeon.srcRareCardPool.addToBottom(c); - continue; - } - default: { - AbstractDungeon.uncommonCardPool.addToTop(c); - AbstractDungeon.srcUncommonCardPool.addToBottom(c); - continue; - } - } - } - } - - @Override - public AbstractRelic makeCopy() { - return new M_SerpentRing(); - } + return tmpPool; + } } diff --git a/src/main/java/com/megacrit/cardcrawl/mod/replay/relics/M_SlimeRing.java b/src/main/java/com/megacrit/cardcrawl/mod/replay/relics/M_SlimeRing.java index 3bb73e79..ca5ea337 100644 --- a/src/main/java/com/megacrit/cardcrawl/mod/replay/relics/M_SlimeRing.java +++ b/src/main/java/com/megacrit/cardcrawl/mod/replay/relics/M_SlimeRing.java @@ -6,6 +6,7 @@ import com.megacrit.cardcrawl.actions.common.MakeTempCardInHandAction; import com.megacrit.cardcrawl.actions.common.RelicAboveCreatureAction; import com.megacrit.cardcrawl.cards.AbstractCard; +import com.megacrit.cardcrawl.cards.AbstractCard.CardColor; import com.megacrit.cardcrawl.cards.colorless.Shiv; import com.megacrit.cardcrawl.cards.green.*; import com.megacrit.cardcrawl.characters.AbstractPlayer; @@ -22,12 +23,12 @@ import com.megacrit.cardcrawl.relics.NinjaScroll; -public class M_SlimeRing extends AbstractRelic +public class M_SlimeRing extends M_MistRelic { public static final String ID = "m_SlimeRing"; public M_SlimeRing() { - super(ID, "snakeRing.png", RelicTier.STARTER, LandingSound.MAGICAL); + super(ID, "snakeRing.png", LandingSound.MAGICAL, slimebound.patches.AbstractCardEnum.SLIMEBOUND, CardColor.GREEN); } @Override @@ -40,24 +41,15 @@ public void atBattleStart() { AbstractDungeon.actionManager.addToBottom(new RelicAboveCreatureAction(AbstractDungeon.player, this)); AbstractDungeon.actionManager.addToBottom(new DrawCardAction(AbstractDungeon.player, 2, false)); } + + @Override + public AbstractRelic makeCopy() { + return new M_SlimeRing(); + } - /*public void onVictory() { - this.flash(); - AbstractDungeon.actionManager.addToTop(new RelicAboveCreatureAction(AbstractDungeon.player, this)); - final AbstractPlayer p = AbstractDungeon.player; - int slimeCount = 0; - if (p.orbs.get(0) != null) { - for (final AbstractOrb o : AbstractDungeon.player.orbs) { - if (o instanceof SpawnedSlime) { - ++slimeCount; - } - } - p.heal(slimeCount * 3); - } - }*/ @Override - public void onEquip() { - final ArrayList tmpPool = new ArrayList(); + ArrayList getNewCards() { + final ArrayList tmpPool = new ArrayList(); tmpPool.add(new Bane()); tmpPool.add(new BouncingFlask()); tmpPool.add(new CripplingPoison()); @@ -67,34 +59,6 @@ public void onEquip() { tmpPool.add(new PoisonedStab()); tmpPool.add(new PoisonSmokescreen()); tmpPool.add(new Backstab()); - for (final AbstractCard c : tmpPool) { - switch (c.rarity) { - case COMMON: { - AbstractDungeon.commonCardPool.addToTop(c); - AbstractDungeon.srcCommonCardPool.addToBottom(c); - continue; - } - case UNCOMMON: { - AbstractDungeon.uncommonCardPool.addToTop(c); - AbstractDungeon.srcUncommonCardPool.addToBottom(c); - continue; - } - case RARE: { - AbstractDungeon.rareCardPool.addToTop(c); - AbstractDungeon.srcRareCardPool.addToBottom(c); - continue; - } - default: { - AbstractDungeon.uncommonCardPool.addToTop(c); - AbstractDungeon.srcUncommonCardPool.addToBottom(c); - continue; - } - } - } - } - - @Override - public AbstractRelic makeCopy() { - return new M_SlimeRing(); - } + return tmpPool; + } } diff --git a/src/main/java/com/megacrit/cardcrawl/mod/replay/relics/M_SpellCore.java b/src/main/java/com/megacrit/cardcrawl/mod/replay/relics/M_SpellCore.java index 4402d124..73c2f44c 100644 --- a/src/main/java/com/megacrit/cardcrawl/mod/replay/relics/M_SpellCore.java +++ b/src/main/java/com/megacrit/cardcrawl/mod/replay/relics/M_SpellCore.java @@ -8,6 +8,7 @@ import com.megacrit.cardcrawl.actions.defect.ChannelAction; import com.megacrit.cardcrawl.actions.defect.IncreaseMaxOrbAction; import com.megacrit.cardcrawl.cards.AbstractCard; +import com.megacrit.cardcrawl.cards.AbstractCard.CardColor; import com.megacrit.cardcrawl.cards.blue.*; import com.megacrit.cardcrawl.dungeons.AbstractDungeon; import com.megacrit.cardcrawl.helpers.FontHelper; @@ -25,12 +26,12 @@ import replayTheSpire.ReplayTheSpireMod; -public class M_SpellCore extends AbstractRelic +public class M_SpellCore extends M_MistRelic { public static final String ID = "m_SpellCore"; public M_SpellCore() { - super(ID, "crackedOrb.png", RelicTier.STARTER, LandingSound.CLINK); + super(ID, "crackedOrb.png", LandingSound.CLINK, ThMod.patches.AbstractCardEnum.MARISA_COLOR, CardColor.BLUE); } @Override @@ -47,10 +48,14 @@ public void atBattleStart() { AbstractDungeon.actionManager.addToTop(new ApplyPowerAction(AbstractDungeon.player, AbstractDungeon.player, new ChargeUpPower(AbstractDungeon.player, o.passiveAmount), o.passiveAmount)); } + @Override + public AbstractRelic makeCopy() { + return new M_SpellCore(); + } + @Override - public void onEquip() { - final long startTime = System.currentTimeMillis(); - final ArrayList tmpPool = new ArrayList(); + ArrayList getNewCards() { + final ArrayList tmpPool = new ArrayList(); tmpPool.add(new Aggregate()); tmpPool.add(new AllForOne()); tmpPool.add(new Barrage()); @@ -98,34 +103,6 @@ public void onEquip() { if (ReplayTheSpireMod.foundmod_conspire) { tmpPool.add(new DualPolarity()); } - for (final AbstractCard c : tmpPool) { - switch (c.rarity) { - case COMMON: { - AbstractDungeon.commonCardPool.addToTop(c); - AbstractDungeon.srcCommonCardPool.addToBottom(c); - continue; - } - case UNCOMMON: { - AbstractDungeon.uncommonCardPool.addToTop(c); - AbstractDungeon.srcUncommonCardPool.addToBottom(c); - continue; - } - case RARE: { - AbstractDungeon.rareCardPool.addToTop(c); - AbstractDungeon.srcRareCardPool.addToBottom(c); - continue; - } - default: { - AbstractDungeon.commonCardPool.addToTop(c); - AbstractDungeon.srcCommonCardPool.addToBottom(c); - continue; - } - } - } - } - - @Override - public AbstractRelic makeCopy() { - return new M_SpellCore(); - } + return tmpPool; + } } diff --git a/src/main/java/com/megacrit/cardcrawl/mod/replay/relics/M_TsuchinokoRing.java b/src/main/java/com/megacrit/cardcrawl/mod/replay/relics/M_TsuchinokoRing.java index df827735..daf6bf19 100644 --- a/src/main/java/com/megacrit/cardcrawl/mod/replay/relics/M_TsuchinokoRing.java +++ b/src/main/java/com/megacrit/cardcrawl/mod/replay/relics/M_TsuchinokoRing.java @@ -7,6 +7,7 @@ import com.megacrit.cardcrawl.actions.common.RelicAboveCreatureAction; import com.megacrit.cardcrawl.actions.utility.UseCardAction; import com.megacrit.cardcrawl.cards.AbstractCard; +import com.megacrit.cardcrawl.cards.AbstractCard.CardColor; import com.megacrit.cardcrawl.cards.green.*; import com.megacrit.cardcrawl.characters.AbstractPlayer; import com.megacrit.cardcrawl.dungeons.AbstractDungeon; @@ -16,12 +17,12 @@ import ThMod.powers.Marisa.ChargeUpPower; -public class M_TsuchinokoRing extends AbstractRelic +public class M_TsuchinokoRing extends M_MistRelic { public static final String ID = "m_TsuchinokoRing"; public M_TsuchinokoRing() { - super(ID, "snakeRing.png", RelicTier.STARTER, LandingSound.MAGICAL); + super(ID, "snakeRing.png", LandingSound.MAGICAL, ThMod.patches.AbstractCardEnum.MARISA_COLOR, CardColor.GREEN); } @Override @@ -34,12 +35,30 @@ public void atBattleStart() { AbstractDungeon.actionManager.addToBottom(new RelicAboveCreatureAction(AbstractDungeon.player, this)); AbstractDungeon.actionManager.addToBottom(new DrawCardAction(AbstractDungeon.player, 2)); } - + @Override + public void onUseCard(final AbstractCard card, final UseCardAction action) { + final AbstractPlayer p = AbstractDungeon.player; + final Boolean available = (card.type == AbstractCard.CardType.SKILL || card.costForTurn == 0 || card.freeToPlayOnce); + int div = 8; + if (p.hasRelic("SimpleLauncher")) { + div = 6; + } + if (available) { + this.flash(); + //ThMod.logger.info("MiniHakkero : Applying ChargeUpPower for using card : " + card.cardID); + AbstractDungeon.actionManager.addToTop(new ApplyPowerAction(AbstractDungeon.player, AbstractDungeon.player, new ChargeUpPower(AbstractDungeon.player, 1), 1)); + AbstractDungeon.actionManager.addToBottom(new RelicAboveCreatureAction(AbstractDungeon.player, this)); + } + } + + @Override + public AbstractRelic makeCopy() { + return new M_TsuchinokoRing(); + } + @Override - public void onEquip() { - AbstractDungeon.bossRelicPool.add(WristBlade.ID); - final long startTime = System.currentTimeMillis(); - final ArrayList tmpPool = new ArrayList(); + ArrayList getNewCards() { + final ArrayList tmpPool = new ArrayList(); tmpPool.add(new AThousandCuts()); tmpPool.add(new Accuracy()); tmpPool.add(new Adrenaline()); @@ -72,49 +91,6 @@ public void onEquip() { tmpPool.add(new StormOfSteel()); tmpPool.add(new ToolsOfTheTrade()); tmpPool.add(new WellLaidPlans()); - for (final AbstractCard c : tmpPool) { - switch (c.rarity) { - case COMMON: { - AbstractDungeon.commonCardPool.addToTop(c); - AbstractDungeon.srcCommonCardPool.addToBottom(c); - continue; - } - case UNCOMMON: { - AbstractDungeon.uncommonCardPool.addToTop(c); - AbstractDungeon.srcUncommonCardPool.addToBottom(c); - continue; - } - case RARE: { - AbstractDungeon.rareCardPool.addToTop(c); - AbstractDungeon.srcRareCardPool.addToBottom(c); - continue; - } - default: { - AbstractDungeon.uncommonCardPool.addToTop(c); - AbstractDungeon.srcUncommonCardPool.addToBottom(c); - continue; - } - } - } - } - @Override - public void onUseCard(final AbstractCard card, final UseCardAction action) { - final AbstractPlayer p = AbstractDungeon.player; - final Boolean available = (card.type == AbstractCard.CardType.SKILL || card.costForTurn == 0 || card.freeToPlayOnce); - int div = 8; - if (p.hasRelic("SimpleLauncher")) { - div = 6; - } - if (available) { - this.flash(); - //ThMod.logger.info("MiniHakkero : Applying ChargeUpPower for using card : " + card.cardID); - AbstractDungeon.actionManager.addToTop(new ApplyPowerAction(AbstractDungeon.player, AbstractDungeon.player, new ChargeUpPower(AbstractDungeon.player, 1), 1)); - AbstractDungeon.actionManager.addToBottom(new RelicAboveCreatureAction(AbstractDungeon.player, this)); - } - } - - @Override - public AbstractRelic makeCopy() { - return new M_TsuchinokoRing(); - } + return tmpPool; + } } diff --git a/src/main/java/com/megacrit/cardcrawl/mod/replay/relics/SimpleRune.java b/src/main/java/com/megacrit/cardcrawl/mod/replay/relics/SimpleRune.java index 33222a06..7476d953 100644 --- a/src/main/java/com/megacrit/cardcrawl/mod/replay/relics/SimpleRune.java +++ b/src/main/java/com/megacrit/cardcrawl/mod/replay/relics/SimpleRune.java @@ -6,6 +6,7 @@ import com.megacrit.cardcrawl.dungeons.AbstractDungeon; import com.megacrit.cardcrawl.mod.replay.cards.*; import com.megacrit.cardcrawl.relics.AbstractRelic; +import com.megacrit.cardcrawl.rooms.ShopRoom; import com.megacrit.cardcrawl.vfx.UpgradeShineEffect; import com.megacrit.cardcrawl.vfx.cardManip.ShowCardBrieflyEffect; @@ -14,61 +15,66 @@ import java.util.ArrayList; import java.util.Collections; -public class SimpleRune - extends AbstractRelic +public class SimpleRune extends AbstractRelic { - public static final String ID = "Simple Rune"; - - public SimpleRune() - { - super("Simple Rune", "simpleRune.png", AbstractRelic.RelicTier.COMMON, AbstractRelic.LandingSound.MAGICAL); - } - - public String getUpdatedDescription() - { - return this.DESCRIPTIONS[0] + 2 + this.DESCRIPTIONS[1]; - } - - public void onEquip() - { - ArrayList upgradableCards = new ArrayList(); - for (AbstractCard c : AbstractDungeon.player.masterDeck.group) { - //(c.cardID == "Strike_R" || c.cardID == "Strike_G" || c.cardID == "Strike_B" || c.cardID == "Defend_R" || c.cardID == "Defend_G" || c.cardID == "Defend_B" || - if ((c.cardID.toLowerCase().contains("strike") || c.cardID.toLowerCase().contains("defend") || c.hasTag(BaseModCardTags.BASIC_STRIKE) || c.hasTag(BaseModCardTags.BASIC_DEFEND)) && c.rarity == AbstractCard.CardRarity.BASIC){ - upgradableCards.add(c); - } - } - Collections.shuffle(upgradableCards, new java.util.Random(AbstractDungeon.miscRng.randomLong())); - if (!upgradableCards.isEmpty()) { - if (upgradableCards.size() == 1) - { - ((AbstractCard)upgradableCards.get(0)).upgrade(); - AbstractDungeon.player.bottledCardUpgradeCheck((AbstractCard)upgradableCards.get(0)); - AbstractDungeon.topLevelEffects.add(new ShowCardBrieflyEffect( - ((AbstractCard)upgradableCards.get(0)).makeStatEquivalentCopy())); - AbstractDungeon.topLevelEffects.add(new UpgradeShineEffect(Settings.WIDTH / 2.0F, Settings.HEIGHT / 2.0F)); - } - else - { - ((AbstractCard)upgradableCards.get(0)).upgrade(); - ((AbstractCard)upgradableCards.get(1)).upgrade(); - AbstractDungeon.player.bottledCardUpgradeCheck((AbstractCard)upgradableCards.get(0)); - AbstractDungeon.player.bottledCardUpgradeCheck((AbstractCard)upgradableCards.get(1)); - AbstractDungeon.topLevelEffects.add(new ShowCardBrieflyEffect( - - ((AbstractCard)upgradableCards.get(0)).makeStatEquivalentCopy(), Settings.WIDTH / 2.0F - AbstractCard.IMG_WIDTH / 2.0F - 20.0F * Settings.scale, Settings.HEIGHT / 2.0F)); - - AbstractDungeon.topLevelEffects.add(new ShowCardBrieflyEffect( - - ((AbstractCard)upgradableCards.get(1)).makeStatEquivalentCopy(), Settings.WIDTH / 2.0F + AbstractCard.IMG_WIDTH / 2.0F + 20.0F * Settings.scale, Settings.HEIGHT / 2.0F)); - - AbstractDungeon.topLevelEffects.add(new UpgradeShineEffect(Settings.WIDTH / 2.0F, Settings.HEIGHT / 2.0F)); - } + public static final String ID = "Simple Rune"; + + public SimpleRune() + { + super(ID, "simpleRune.png", AbstractRelic.RelicTier.COMMON, AbstractRelic.LandingSound.MAGICAL); + } + + public String getUpdatedDescription() + { + return this.DESCRIPTIONS[0] + 2 + this.DESCRIPTIONS[1]; + } + + public static boolean isUpgradable(AbstractCard c) { + return (c.hasTag(BaseModCardTags.BASIC_STRIKE) || c.hasTag(BaseModCardTags.BASIC_DEFEND) || ((c.cardID.toLowerCase().contains("strike") || c.cardID.toLowerCase().contains("defend")) && c.rarity == AbstractCard.CardRarity.BASIC)); + } + + public static ArrayList getUpgradableCards() { + ArrayList upgradableCards = new ArrayList(); + for (AbstractCard c : AbstractDungeon.player.masterDeck.group) { + if (c.hasTag(BaseModCardTags.BASIC_STRIKE) || c.hasTag(BaseModCardTags.BASIC_DEFEND) || ((c.cardID.toLowerCase().contains("strike") || c.cardID.toLowerCase().contains("defend")) && c.rarity == AbstractCard.CardRarity.BASIC)){ + upgradableCards.add(c); + } + } + return upgradableCards; + } + + @Override + public void onEquip() + { + ArrayList upgradableCards = getUpgradableCards(); + Collections.shuffle(upgradableCards, new java.util.Random(AbstractDungeon.miscRng.randomLong())); + if (!upgradableCards.isEmpty()) { + if (upgradableCards.size() == 1) + { + (upgradableCards.get(0)).upgrade(); + AbstractDungeon.player.bottledCardUpgradeCheck(upgradableCards.get(0)); + AbstractDungeon.topLevelEffects.add(new ShowCardBrieflyEffect((upgradableCards.get(0)).makeStatEquivalentCopy())); + AbstractDungeon.topLevelEffects.add(new UpgradeShineEffect(Settings.WIDTH / 2.0F, Settings.HEIGHT / 2.0F)); + } else { + (upgradableCards.get(0)).upgrade(); + (upgradableCards.get(1)).upgrade(); + AbstractDungeon.player.bottledCardUpgradeCheck(upgradableCards.get(0)); + AbstractDungeon.player.bottledCardUpgradeCheck(upgradableCards.get(1)); + AbstractDungeon.topLevelEffects.add(new ShowCardBrieflyEffect((upgradableCards.get(0)).makeStatEquivalentCopy(), Settings.WIDTH / 2.0F - AbstractCard.IMG_WIDTH / 2.0F - 20.0F * Settings.scale, Settings.HEIGHT / 2.0F)); + AbstractDungeon.topLevelEffects.add(new ShowCardBrieflyEffect((upgradableCards.get(1)).makeStatEquivalentCopy(), Settings.WIDTH / 2.0F + AbstractCard.IMG_WIDTH / 2.0F + 20.0F * Settings.scale, Settings.HEIGHT / 2.0F)); + AbstractDungeon.topLevelEffects.add(new UpgradeShineEffect(Settings.WIDTH / 2.0F, Settings.HEIGHT / 2.0F)); + } + } + } + + @Override + public boolean canSpawn() { + return (AbstractDungeon.player != null && getUpgradableCards().size() > 0); } - } - - public AbstractRelic makeCopy() - { - return new SimpleRune(); - } + + @Override + public AbstractRelic makeCopy() + { + return new SimpleRune(); + } } \ No newline at end of file diff --git a/src/main/java/com/megacrit/cardcrawl/mod/replay/relics/WantedPoster.java b/src/main/java/com/megacrit/cardcrawl/mod/replay/relics/WantedPoster.java index 4b698697..37d9957c 100644 --- a/src/main/java/com/megacrit/cardcrawl/mod/replay/relics/WantedPoster.java +++ b/src/main/java/com/megacrit/cardcrawl/mod/replay/relics/WantedPoster.java @@ -51,7 +51,7 @@ public void onUnequip() { } private void giveRandomBuff(AbstractMonster m) { - switch (AbstractDungeon.miscRng.random(15)) { + switch (AbstractDungeon.miscRng.random(16)) { case 0: case 1: case 2: @@ -99,6 +99,9 @@ private void giveRandomBuff(AbstractMonster m) { case 15: AbstractDungeon.actionManager.addToBottom(new ApplyPowerAction(m, AbstractDungeon.player, new CuriosityPower(m, 1), 1)); break; + case 16: + AbstractDungeon.actionManager.addToBottom(new ApplyPowerAction(m, AbstractDungeon.player, new MightPower(m, 2, false), 2)); + break; } } diff --git a/src/main/java/com/megacrit/cardcrawl/mod/replay/relics/m_ArcaneBlood.java b/src/main/java/com/megacrit/cardcrawl/mod/replay/relics/m_ArcaneBlood.java index cde49e27..cd1b66b4 100644 --- a/src/main/java/com/megacrit/cardcrawl/mod/replay/relics/m_ArcaneBlood.java +++ b/src/main/java/com/megacrit/cardcrawl/mod/replay/relics/m_ArcaneBlood.java @@ -5,6 +5,7 @@ import com.megacrit.cardcrawl.actions.AbstractGameAction; import com.megacrit.cardcrawl.actions.common.RelicAboveCreatureAction; import com.megacrit.cardcrawl.cards.AbstractCard; +import com.megacrit.cardcrawl.cards.AbstractCard.CardColor; import com.megacrit.cardcrawl.cards.red.Berserk; import com.megacrit.cardcrawl.cards.red.Brutality; import com.megacrit.cardcrawl.cards.red.Carnage; @@ -25,15 +26,16 @@ import com.megacrit.cardcrawl.relics.AbstractRelic.LandingSound; import com.megacrit.cardcrawl.relics.AbstractRelic.RelicTier; +import fruitymod.seeker.patches.AbstractCardEnum; import replayTheSpire.ReplayTheSpireMod; -public class m_ArcaneBlood extends AbstractRelic +public class m_ArcaneBlood extends M_MistRelic { public static final String ID = "m_ArcaneBlood"; private static final int HEALTH_AMT = 3; public m_ArcaneBlood() { - super(ID, "burningBlood_purple.png", RelicTier.STARTER, LandingSound.MAGICAL); + super(ID, "burningBlood_purple.png", LandingSound.MAGICAL, AbstractCardEnum.SEEKER_PURPLE, CardColor.RED); } @Override @@ -56,11 +58,15 @@ public void onVictory() { } } + + @Override + public AbstractRelic makeCopy() { + return new m_ArcaneBlood(); + } + @Override - public void onEquip() { - //AbstractDungeon.rareRelicPool.add("Magic Flower"); - final long startTime = System.currentTimeMillis(); - final ArrayList tmpPool = new ArrayList(); + ArrayList getNewCards() { + final ArrayList tmpPool = new ArrayList(); tmpPool.add(new Headbutt()); tmpPool.add(new Warcry()); tmpPool.add(new Carnage()); @@ -72,34 +78,6 @@ public void onEquip() { tmpPool.add(new DarkEmbrace()); tmpPool.add(new Exhume()); tmpPool.add(new Rampage()); - for (final AbstractCard c : tmpPool) { - switch (c.rarity) { - case COMMON: { - AbstractDungeon.commonCardPool.addToTop(c); - AbstractDungeon.srcCommonCardPool.addToBottom(c); - continue; - } - case UNCOMMON: { - AbstractDungeon.uncommonCardPool.addToTop(c); - AbstractDungeon.srcUncommonCardPool.addToBottom(c); - continue; - } - case RARE: { - AbstractDungeon.rareCardPool.addToTop(c); - AbstractDungeon.srcRareCardPool.addToBottom(c); - continue; - } - default: { - AbstractDungeon.uncommonCardPool.addToTop(c); - AbstractDungeon.srcUncommonCardPool.addToBottom(c); - continue; - } - } - } - } - - @Override - public AbstractRelic makeCopy() { - return new m_ArcaneBlood(); - } + return tmpPool; + } } diff --git a/src/main/java/com/megacrit/cardcrawl/mod/replay/relics/m_BookOfShivs.java b/src/main/java/com/megacrit/cardcrawl/mod/replay/relics/m_BookOfShivs.java index 4c5f7779..4d88c5aa 100644 --- a/src/main/java/com/megacrit/cardcrawl/mod/replay/relics/m_BookOfShivs.java +++ b/src/main/java/com/megacrit/cardcrawl/mod/replay/relics/m_BookOfShivs.java @@ -8,6 +8,7 @@ import com.megacrit.cardcrawl.actions.common.MakeTempCardInHandAction; import com.megacrit.cardcrawl.actions.common.RelicAboveCreatureAction; import com.megacrit.cardcrawl.cards.AbstractCard; +import com.megacrit.cardcrawl.cards.AbstractCard.CardColor; import com.megacrit.cardcrawl.cards.green.AThousandCuts; import com.megacrit.cardcrawl.cards.green.Acrobatics; import com.megacrit.cardcrawl.cards.green.Adrenaline; @@ -40,12 +41,12 @@ import mysticmod.MysticMod; import replayTheSpire.ReplayTheSpireMod; -public class m_BookOfShivs extends AbstractRelic +public class m_BookOfShivs extends M_MistRelic { public static final String ID = "m_BookOfShivs"; public m_BookOfShivs() { - super(ID, "m_snakebook.png", RelicTier.STARTER, LandingSound.MAGICAL); + super(ID, "m_snakebook.png", LandingSound.MAGICAL, mysticmod.patches.AbstractCardEnum.MYSTIC_PURPLE, CardColor.GREEN); } @Override @@ -64,6 +65,16 @@ public void atBattleStartPreDraw() { public void onEquip() { AbstractDungeon.bossRelicPool.add(WristBlade.ID); MysticMod.cantripsGroup.add(new BoundBlade()); + super.onEquip(); + } + + @Override + public AbstractRelic makeCopy() { + return new m_BookOfShivs(); + } + + @Override + ArrayList getNewCards() { final ArrayList tmpPool = new ArrayList(); tmpPool.add(new AThousandCuts()); tmpPool.add(new Adrenaline()); @@ -86,34 +97,6 @@ public void onEquip() { tmpPool.add(new ScrapShanks()); tmpPool.add(new TheWorks()); tmpPool.add(new HiddenBlade()); - for (final AbstractCard c : tmpPool) { - switch (c.rarity) { - case COMMON: { - AbstractDungeon.commonCardPool.addToTop(c); - AbstractDungeon.srcCommonCardPool.addToBottom(c); - continue; - } - case UNCOMMON: { - AbstractDungeon.uncommonCardPool.addToTop(c); - AbstractDungeon.srcUncommonCardPool.addToBottom(c); - continue; - } - case RARE: { - AbstractDungeon.rareCardPool.addToTop(c); - AbstractDungeon.srcRareCardPool.addToBottom(c); - continue; - } - default: { - AbstractDungeon.uncommonCardPool.addToTop(c); - AbstractDungeon.srcUncommonCardPool.addToBottom(c); - continue; - } - } - } - } - - @Override - public AbstractRelic makeCopy() { - return new m_BookOfShivs(); - } + return tmpPool; + } } diff --git a/src/main/java/com/megacrit/cardcrawl/mod/replay/relics/m_MercuryCore.java b/src/main/java/com/megacrit/cardcrawl/mod/replay/relics/m_MercuryCore.java index b84afe39..b6671bfe 100644 --- a/src/main/java/com/megacrit/cardcrawl/mod/replay/relics/m_MercuryCore.java +++ b/src/main/java/com/megacrit/cardcrawl/mod/replay/relics/m_MercuryCore.java @@ -5,6 +5,7 @@ import com.megacrit.cardcrawl.actions.common.DrawCardAction; import com.megacrit.cardcrawl.actions.common.RelicAboveCreatureAction; import com.megacrit.cardcrawl.cards.AbstractCard; +import com.megacrit.cardcrawl.cards.AbstractCard.CardColor; import com.megacrit.cardcrawl.cards.blue.Amplify; import com.megacrit.cardcrawl.cards.blue.CreativeAI; import com.megacrit.cardcrawl.cards.blue.FTL; @@ -23,14 +24,15 @@ import com.megacrit.cardcrawl.relics.AbstractRelic.RelicTier; import chronomuncher.actions.ChronoChannelAction; +import chronomuncher.cards.*; import chronomuncher.orbs.UnlockedMercury; -public class m_MercuryCore extends AbstractRelic +public class m_MercuryCore extends M_MistRelic { public static final String ID = "m_MercuryCore"; public m_MercuryCore() { - super(ID, "crackedOrb.png", RelicTier.STARTER, LandingSound.CLINK); + super(ID, "crackedOrb.png", LandingSound.CLINK, chronomuncher.patches.Enum.CHRONO_GOLD, CardColor.BLUE); this.tips.clear(); this.tips.add(new PowerTip(this.name, this.description)); //this.tips.add(new PowerTip("Replicate", "A #yReplica will float above your character, activating its effect every turn. When the countdown reaches 0, it will #yshatter and be removed.")); @@ -48,9 +50,14 @@ public void atBattleStart() { AbstractDungeon.actionManager.addToBottom(new ChronoChannelAction(new UnlockedMercury(false))); } + + @Override + public AbstractRelic makeCopy() { + return new m_MercuryCore(); + } + @Override - public void onEquip() { - final long startTime = System.currentTimeMillis(); + ArrayList getNewCards() { final ArrayList tmpPool = new ArrayList(); tmpPool.add(new Amplify()); tmpPool.add(new CreativeAI()); @@ -61,34 +68,23 @@ public void onEquip() { tmpPool.add(new Heatsinks()); tmpPool.add(new WhiteNoise()); tmpPool.add(new ForceField()); - for (final AbstractCard c : tmpPool) { - switch (c.rarity) { - case COMMON: { - AbstractDungeon.commonCardPool.addToTop(c); - AbstractDungeon.srcCommonCardPool.addToBottom(c); - continue; - } - case UNCOMMON: { - AbstractDungeon.uncommonCardPool.addToTop(c); - AbstractDungeon.srcUncommonCardPool.addToBottom(c); - continue; - } - case RARE: { - AbstractDungeon.rareCardPool.addToTop(c); - AbstractDungeon.srcRareCardPool.addToBottom(c); - continue; - } - default: { - AbstractDungeon.uncommonCardPool.addToTop(c); - AbstractDungeon.srcUncommonCardPool.addToBottom(c); - continue; - } - } - } - } - - @Override - public AbstractRelic makeCopy() { - return new m_MercuryCore(); - } + + + tmpPool.add(new MasterKey()); + tmpPool.add(new LockedMercury()); + tmpPool.add(new LockedIceCream()); + tmpPool.add(new LockedOrichalcum()); + tmpPool.add(new LockedUrn()); + tmpPool.add(new LockedBlood()); + tmpPool.add(new LockedFlame()); + tmpPool.add(new LockedLightning()); + tmpPool.add(new LockedTornado()); + tmpPool.add(new LockedMedicine()); + tmpPool.add(new LockedThread()); + tmpPool.add(new LockedWarPaint()); + tmpPool.add(new LockedWhetstone()); + tmpPool.add(new LockedScales()); + tmpPool.add(new Fragmentalize()); + return tmpPool; + } } diff --git a/src/main/java/com/megacrit/cardcrawl/mod/replay/relics/m_ScarletBlood.java b/src/main/java/com/megacrit/cardcrawl/mod/replay/relics/m_ScarletBlood.java index 53deb4ff..f77d009d 100644 --- a/src/main/java/com/megacrit/cardcrawl/mod/replay/relics/m_ScarletBlood.java +++ b/src/main/java/com/megacrit/cardcrawl/mod/replay/relics/m_ScarletBlood.java @@ -5,6 +5,7 @@ import com.megacrit.cardcrawl.actions.common.ApplyPowerAction; import com.megacrit.cardcrawl.actions.common.RelicAboveCreatureAction; import com.megacrit.cardcrawl.cards.AbstractCard; +import com.megacrit.cardcrawl.cards.AbstractCard.CardColor; import com.megacrit.cardcrawl.cards.red.DemonForm; import com.megacrit.cardcrawl.cards.red.DoubleTap; import com.megacrit.cardcrawl.cards.red.Flex; @@ -21,12 +22,12 @@ import blackrusemod.powers.*; -public class m_ScarletBlood extends AbstractRelic +public class m_ScarletBlood extends M_MistRelic { public static final String ID = "m_ScarletBlood"; public m_ScarletBlood() { - super(ID, "burningBlood.png", RelicTier.STARTER, LandingSound.MAGICAL); + super(ID, "burningBlood.png", LandingSound.MAGICAL, blackrusemod.patches.AbstractCardEnum.SILVER, CardColor.RED); } @Override @@ -44,8 +45,17 @@ public void onGainStrength(ApplyPowerAction __instance) { @Override public void onEquip() { AbstractDungeon.rareRelicPool.add("Red Skull"); - final long startTime = System.currentTimeMillis(); - final ArrayList tmpPool = new ArrayList(); + super.onEquip(); + } + + @Override + public AbstractRelic makeCopy() { + return new m_ScarletBlood(); + } + + @Override + ArrayList getNewCards() { + final ArrayList tmpPool = new ArrayList(); tmpPool.add(new Flex()); tmpPool.add(new HeavyBlade()); tmpPool.add(new Inflame()); @@ -55,35 +65,7 @@ public void onEquip() { tmpPool.add(new DoubleTap()); tmpPool.add(new LimitBreak()); tmpPool.add(new MuscleTraining()); - for (final AbstractCard c : tmpPool) { - switch (c.rarity) { - case COMMON: { - AbstractDungeon.commonCardPool.addToTop(c); - AbstractDungeon.srcCommonCardPool.addToBottom(c); - continue; - } - case UNCOMMON: { - AbstractDungeon.uncommonCardPool.addToTop(c); - AbstractDungeon.srcUncommonCardPool.addToBottom(c); - continue; - } - case RARE: { - AbstractDungeon.rareCardPool.addToTop(c); - AbstractDungeon.srcRareCardPool.addToBottom(c); - continue; - } - default: { - AbstractDungeon.uncommonCardPool.addToTop(c); - AbstractDungeon.srcUncommonCardPool.addToBottom(c); - continue; - } - } - } - } - - @Override - public AbstractRelic makeCopy() { - return new m_ScarletBlood(); - } + return tmpPool; + } } diff --git a/src/main/java/com/megacrit/cardcrawl/mod/replay/relics/m_SnakeCloak.java b/src/main/java/com/megacrit/cardcrawl/mod/replay/relics/m_SnakeCloak.java index 1dae2b5d..6979bd55 100644 --- a/src/main/java/com/megacrit/cardcrawl/mod/replay/relics/m_SnakeCloak.java +++ b/src/main/java/com/megacrit/cardcrawl/mod/replay/relics/m_SnakeCloak.java @@ -5,6 +5,7 @@ import com.megacrit.cardcrawl.actions.common.DrawCardAction; import com.megacrit.cardcrawl.actions.common.RelicAboveCreatureAction; import com.megacrit.cardcrawl.cards.AbstractCard; +import com.megacrit.cardcrawl.cards.AbstractCard.CardColor; import com.megacrit.cardcrawl.cards.green.Acrobatics; import com.megacrit.cardcrawl.cards.green.AllOutAttack; import com.megacrit.cardcrawl.cards.green.CalculatedGamble; @@ -22,12 +23,12 @@ import com.megacrit.cardcrawl.relics.AbstractRelic.LandingSound; import com.megacrit.cardcrawl.relics.AbstractRelic.RelicTier; -public class m_SnakeCloak extends AbstractRelic +public class m_SnakeCloak extends M_MistRelic { public static final String ID = "m_SnakeCloak"; public m_SnakeCloak() { - super(ID, "snakeRing.png", RelicTier.STARTER, LandingSound.MAGICAL); + super(ID, "snakeRing.png", LandingSound.MAGICAL, blackrusemod.patches.AbstractCardEnum.SILVER, CardColor.GREEN); } @Override @@ -45,8 +46,17 @@ public void atBattleStart() { public void onEquip() { AbstractDungeon.rareRelicPool.add("Tough Bandages"); AbstractDungeon.rareRelicPool.add("Tingsha"); - final long startTime = System.currentTimeMillis(); - final ArrayList tmpPool = new ArrayList(); + super.onEquip(); + } + + @Override + public AbstractRelic makeCopy() { + return new m_SnakeCloak(); + } + + @Override + ArrayList getNewCards() { + final ArrayList tmpPool = new ArrayList(); tmpPool.add(new Prepared()); tmpPool.add(new Acrobatics()); tmpPool.add(new AllOutAttack()); @@ -59,34 +69,6 @@ public void onEquip() { tmpPool.add(new ToolsOfTheTrade()); //tmpPool.add(new UnderhandedStrike()); tmpPool.add(new Unload()); - for (final AbstractCard c : tmpPool) { - switch (c.rarity) { - case COMMON: { - AbstractDungeon.commonCardPool.addToTop(c); - AbstractDungeon.srcCommonCardPool.addToBottom(c); - continue; - } - case UNCOMMON: { - AbstractDungeon.uncommonCardPool.addToTop(c); - AbstractDungeon.srcUncommonCardPool.addToBottom(c); - continue; - } - case RARE: { - AbstractDungeon.rareCardPool.addToTop(c); - AbstractDungeon.srcRareCardPool.addToBottom(c); - continue; - } - default: { - AbstractDungeon.uncommonCardPool.addToTop(c); - AbstractDungeon.srcUncommonCardPool.addToBottom(c); - continue; - } - } - } - } - - @Override - public AbstractRelic makeCopy() { - return new m_SnakeCloak(); - } + return tmpPool; + } } diff --git a/src/main/java/replayTheSpire/ReplayTheSpireMod.java b/src/main/java/replayTheSpire/ReplayTheSpireMod.java index 4dff932e..295725f9 100644 --- a/src/main/java/replayTheSpire/ReplayTheSpireMod.java +++ b/src/main/java/replayTheSpire/ReplayTheSpireMod.java @@ -40,6 +40,7 @@ import com.megacrit.cardcrawl.mod.replay.events.thecity.ReplayMapScoutEvent; import com.megacrit.cardcrawl.mod.replay.modifiers.ALWAYSwhaleModifier; import com.megacrit.cardcrawl.mod.replay.modifiers.ChaoticModifier; +import com.megacrit.cardcrawl.mod.replay.modifiers.HoneycakeModifier; import com.megacrit.cardcrawl.mod.replay.modifiers.LibraryLooterModifier; import com.megacrit.cardcrawl.mod.replay.modifiers.MistsModifier; import com.megacrit.cardcrawl.mod.replay.monsters.replay.CaptainAbe; @@ -841,8 +842,8 @@ public static void purgeBossToggle() { } public static HashMap ConfigSettings = new HashMap(); public static HashMap> RelicSettings = new HashMap>(); - static final float setting_start_x = 350.0f; - static final float setting_start_y = 550.0f; + public static final float setting_start_x = 350.0f; + public static final float setting_start_y = 550.0f; public static void BuildSettings(ReplayAbstractRelic relic) { ReplayTheSpireMod.RelicSettings.put(relic, relic.BuildRelicSettings()); for (ReplayRelicSetting setting : ReplayTheSpireMod.RelicSettings.get(relic)) { @@ -912,19 +913,52 @@ public void receivePostInitialize() { settingsPanel = new ModPanel(); final List settingsButtons = new ArrayList(); ArrayList settingElements = new ArrayList(); + + //CARD FILTER + settingsButtons.add(FILTER_BUTTONS.get(AbstractCard.CardColor.RED)); + settingsButtons.add(FILTER_BUTTONS.get(AbstractCard.CardColor.GREEN)); + settingsButtons.add(FILTER_BUTTONS.get(AbstractCard.CardColor.BLUE)); + settingsButtons.add(FILTER_BUTTONS.get(AbstractCard.CardColor.COLORLESS)); + settingsButtons.add(FILTER_BUTTONS.get(AbstractCard.CardColor.CURSE)); + + //BOSS FILTER + settingElements = new ArrayList(); + ArrayList roomSettings = new ArrayList(); + settingElements.add(new ModLabel("Disable Custom Bosses", setting_start_x + 500.0f, setting_start_y + 150f, settingsPanel, (me) -> {})); + HashMap> customBosses = (HashMap>)ReflectionHacks.getPrivateStatic(BaseMod.class, "customBosses"); + float ymod = 0f; + float xmod = 0f; + for (String dungeonid : customBosses.keySet()) { + ymod = 0f; + settingElements.add(new ModLabel(dungeonid + ":", setting_start_x + xmod + 150.0f, setting_start_y + ymod, settingsPanel, (me) -> {})); + ymod += -40f; + for (BossInfo boss : customBosses.get(dungeonid)) { + ReplayBooleanSetting bosssetting = addBossToggle(dungeonid, boss.id, boss.id); + settingElements.addAll(bosssetting.GenerateElements(setting_start_x + xmod, setting_start_y + ymod)); + ymod += -40f; + roomSettings.add(bosssetting); + } + xmod += 450f; + } + settingsButtons.add(new RelicSettingsButton(ImageMaster.loadImage("images/relics/test5.png"), ImageMaster.loadImage("images/relics/outline/test5.png"), RelicSettingsButton.DEFAULT_X, RelicSettingsButton.DEFAULT_Y, RelicSettingsButton.DEFAULT_W, RelicSettingsButton.DEFAULT_H, settingElements, roomSettings)); + for (String dungeonid : SETTING_BOSSTOGGLES.keySet()) { + for (ReplayBooleanSetting bosssetting : SETTING_BOSSTOGGLES.get(dungeonid)) { + ReplayTheSpireMod.ConfigSettings.put(bosssetting.settingsId, bosssetting); + } + } - + //ROOM SETTINGS settingElements.add(new ModLabel("Custom Room Settings", setting_start_x + 150.0f, setting_start_y, settingsPanel, (me) -> {})); settingElements.addAll(SETTING_ROOMS_BONFIRE.GenerateElements(setting_start_x, setting_start_y - 50.0f)); settingElements.addAll(SETTING_ROOMS_PORTAL.GenerateElements(setting_start_x, setting_start_y - 100.0f)); - ArrayList roomSettings = new ArrayList(); + roomSettings = new ArrayList(); roomSettings.add(SETTING_ROOMS_BONFIRE); roomSettings.add(SETTING_ROOMS_PORTAL); settingsButtons.add(new RelicSettingsButton(ImageMaster.loadImage("images/ui/map/replay_bonfire.png"), ImageMaster.loadImage("images/ui/map/replay_bonfire.png"), RelicSettingsButton.DEFAULT_X, RelicSettingsButton.DEFAULT_Y, RelicSettingsButton.DEFAULT_W, RelicSettingsButton.DEFAULT_H, settingElements, roomSettings)); ReplayTheSpireMod.ConfigSettings.put(SETTING_ROOMS_BONFIRE.settingsId, SETTING_ROOMS_BONFIRE); ReplayTheSpireMod.ConfigSettings.put(SETTING_ROOMS_PORTAL.settingsId, SETTING_ROOMS_PORTAL); - //settingElements = new ArrayList(); + //NEOW SETTINGS settingElements = new ArrayList(); settingElements.add(new ModLabel("Neow Reward Settings", setting_start_x + 150.0f, setting_start_y, settingsPanel, (me) -> {})); settingElements.addAll(NeowRewardPatches.SETTING_COLORLESS_OPTION.GenerateElements(setting_start_x, setting_start_y - 40.0f)); @@ -948,31 +982,8 @@ public void receivePostInitialize() { ReplayTheSpireMod.ConfigSettings.put(NeowRewardPatches.SETTING_SOULBOUND_CURSES.settingsId, NeowRewardPatches.SETTING_SOULBOUND_CURSES); ReplayTheSpireMod.ConfigSettings.put(NeowRewardPatches.SETTING_BOSS_OPTIONS_ENABLED.settingsId, NeowRewardPatches.SETTING_BOSS_OPTIONS_ENABLED); - settingElements = new ArrayList(); - roomSettings = new ArrayList(); - settingElements.add(new ModLabel("Disable Custom Bosses", setting_start_x + 500.0f, setting_start_y + 150f, settingsPanel, (me) -> {})); - HashMap> customBosses = (HashMap>)ReflectionHacks.getPrivateStatic(BaseMod.class, "customBosses"); - float ymod = 0f; - float xmod = 0f; - for (String dungeonid : customBosses.keySet()) { - ymod = 0f; - settingElements.add(new ModLabel(dungeonid + ":", setting_start_x + xmod + 150.0f, setting_start_y + ymod, settingsPanel, (me) -> {})); - ymod += -40f; - for (BossInfo boss : customBosses.get(dungeonid)) { - ReplayBooleanSetting bosssetting = addBossToggle(dungeonid, boss.id, boss.id); - settingElements.addAll(bosssetting.GenerateElements(setting_start_x + xmod, setting_start_y + ymod)); - ymod += -40f; - roomSettings.add(bosssetting); - } - xmod += 450f; - } - settingsButtons.add(new RelicSettingsButton(ImageMaster.loadImage("images/relics/test5.png"), ImageMaster.loadImage("images/relics/outline/test5.png"), RelicSettingsButton.DEFAULT_X, RelicSettingsButton.DEFAULT_Y, RelicSettingsButton.DEFAULT_W, RelicSettingsButton.DEFAULT_H, settingElements, roomSettings)); - for (String dungeonid : SETTING_BOSSTOGGLES.keySet()) { - for (ReplayBooleanSetting bosssetting : SETTING_BOSSTOGGLES.get(dungeonid)) { - ReplayTheSpireMod.ConfigSettings.put(bosssetting.settingsId, bosssetting); - } - } + ////RELIC SETTINGS BuildSettings(new RingOfChaos()); BuildSettings(new Ninjato()); BuildSettings(new TagBag()); @@ -1177,14 +1188,90 @@ public void receiveEditRelics() { logger.info("done editting relics"); } + public static HashMap> REPLAY_CARDS = new HashMap>(); + public static HashMap> CARD_FILTER = new HashMap>(); + public static HashMap FILTER_BUTTONS = new HashMap(); public static void AddAndUnlockCard(AbstractCard c) { + if (!REPLAY_CARDS.containsKey(c.color)) { + REPLAY_CARDS.put(c.color, new ArrayList()); + CARD_FILTER.put(c.color, new HashMap()); + } + REPLAY_CARDS.get(c.color).add(c); + if (c.rarity != AbstractCard.CardRarity.BASIC && c.rarity != AbstractCard.CardRarity.SPECIAL) { + ReplayBooleanSetting cardsetting = new ReplayBooleanSetting("ReplayCardFilter-"+c.cardID, c.name, true); + CARD_FILTER.get(c.color).put(c.cardID, cardsetting); + if (FILTER_BUTTONS.containsKey(c.color)) { + FILTER_BUTTONS.get(c.color).addSetting(cardsetting); + ReplayTheSpireMod.ConfigSettings.put(cardsetting.settingsId, cardsetting); + if (config.has(cardsetting.settingsId)) { + cardsetting.LoadFromData(config); + if (!cardsetting.value) { + if (Loader.isModLoaded("archetypeapi")) { + c.rarity = AbstractCard.CardRarity.SPECIAL; + } else { + return; + } + } + } + } + } + BaseMod.addCard(c); UnlockTracker.unlockCard(c.cardID); } + private void makeFilterButtons() { + + try { + config = new SpireConfig("ReplayTheSpireMod", "replaySettingsData"); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + RelicSettingsButton setbutt; + ArrayList settingElements; + ArrayList roomSettings; + + settingElements = new ArrayList(); + roomSettings = new ArrayList(); + settingElements.add(new ModLabel("Card Filter: Red", setting_start_x + 500.0f, setting_start_y + 150f, settingsPanel, (me) -> {})); + setbutt = new RelicSettingsButton(ImageMaster.loadImage("images/ui/run_mods/red.png"), ImageMaster.loadImage("images/ui/run_mods/red.png"), RelicSettingsButton.DEFAULT_X, RelicSettingsButton.DEFAULT_Y, RelicSettingsButton.DEFAULT_W, RelicSettingsButton.DEFAULT_H, settingElements, roomSettings); + FILTER_BUTTONS.put(AbstractCard.CardColor.RED, setbutt); + + settingElements = new ArrayList(); + roomSettings = new ArrayList(); + settingElements.add(new ModLabel("Card Filter: Blue", setting_start_x + 500.0f, setting_start_y + 150f, settingsPanel, (me) -> {})); + setbutt = new RelicSettingsButton(ImageMaster.loadImage("images/ui/run_mods/blue.png"), ImageMaster.loadImage("images/ui/run_mods/blue.png"), RelicSettingsButton.DEFAULT_X, RelicSettingsButton.DEFAULT_Y, RelicSettingsButton.DEFAULT_W, RelicSettingsButton.DEFAULT_H, settingElements, roomSettings); + FILTER_BUTTONS.put(AbstractCard.CardColor.BLUE, setbutt); + + settingElements = new ArrayList(); + roomSettings = new ArrayList(); + settingElements.add(new ModLabel("Card Filter: Green", setting_start_x + 500.0f, setting_start_y + 150f, settingsPanel, (me) -> {})); + setbutt = new RelicSettingsButton(ImageMaster.loadImage("images/ui/run_mods/green.png"), ImageMaster.loadImage("images/ui/run_mods/green.png"), RelicSettingsButton.DEFAULT_X, RelicSettingsButton.DEFAULT_Y, RelicSettingsButton.DEFAULT_W, RelicSettingsButton.DEFAULT_H, settingElements, roomSettings); + FILTER_BUTTONS.put(AbstractCard.CardColor.GREEN, setbutt); + + settingElements = new ArrayList(); + roomSettings = new ArrayList(); + settingElements.add(new ModLabel("Card Filter: Colorless", setting_start_x + 500.0f, setting_start_y + 150f, settingsPanel, (me) -> {})); + setbutt = new RelicSettingsButton(ImageMaster.loadImage("images/ui/run_mods/colorless.png"), ImageMaster.loadImage("images/ui/run_mods/colorless.png"), RelicSettingsButton.DEFAULT_X, RelicSettingsButton.DEFAULT_Y, RelicSettingsButton.DEFAULT_W, RelicSettingsButton.DEFAULT_H, settingElements, roomSettings); + FILTER_BUTTONS.put(AbstractCard.CardColor.COLORLESS, setbutt); + + settingElements = new ArrayList(); + roomSettings = new ArrayList(); + settingElements.add(new ModLabel("Card Filter: Curse", setting_start_x + 500.0f, setting_start_y + 150f, settingsPanel, (me) -> {})); + setbutt = new RelicSettingsButton(ImageMaster.loadImage("images/ui/run_mods/cursed_run.png"), ImageMaster.loadImage("images/ui/run_mods/cursed_run.png"), RelicSettingsButton.DEFAULT_X, RelicSettingsButton.DEFAULT_Y, RelicSettingsButton.DEFAULT_W, RelicSettingsButton.DEFAULT_H, settingElements, roomSettings); + FILTER_BUTTONS.put(AbstractCard.CardColor.CURSE, setbutt); + + } + @Override public void receiveEditCards() { + + makeFilterButtons(); + + BaseMod.addDynamicVariable(new MagicArithmatic.MagicMinusOne()); BaseMod.addDynamicVariable(new MagicArithmatic.MagicPlusOne()); BaseMod.addDynamicVariable(new MagicArithmatic.MagicPlusTwo()); @@ -1338,6 +1425,7 @@ public void receiveEditCards() { guardianbs.addCards(); } logger.info("done editting cards"); + //loadSettingsData(); } private void InitializeMonsters() { @@ -1791,9 +1879,28 @@ public void receiveCustomModeMods(List l) { l.add(new CustomMod(ChaoticModifier.ID, "b", true)); l.add(new CustomMod(MistsModifier.ID, "b", true)); l.add(new CustomMod(ALWAYSwhaleModifier.ID, "b", true)); + if (foundmod_halation) { + l.add(new CustomMod(HoneycakeModifier.ID, "g", true)); + } + } + + private void filterCards(AbstractCard.CardColor color) { + for (AbstractCard c : REPLAY_CARDS.get(color)) { + if (c != null && CARD_FILTER.get(color).containsKey(c.cardID)) { + if (!(CARD_FILTER.get(color).get(c.cardID)).value) { + BaseMod.removeCard(c.cardID, color); + } + } + } } + @Override public void receivePostDungeonInitialize() { + /*filterCards(AbstractCard.CardColor.RED); + filterCards(AbstractCard.CardColor.GREEN); + filterCards(AbstractCard.CardColor.BLUE); + filterCards(AbstractCard.CardColor.COLORLESS); + filterCards(AbstractCard.CardColor.CURSE);*/ if (CardCrawlGame.trial != null) { if( CardCrawlGame.trial.dailyModIDs().contains(ChaoticModifier.ID)) { RelicLibrary.getRelic(RingOfChaos.ID).makeCopy().instantObtain(); @@ -1810,6 +1917,18 @@ public void receivePostDungeonInitialize() { if( CardCrawlGame.trial.dailyModIDs().contains(MistsModifier.ID)) { MistsModifier.hasGottenEvent = false; } + if (foundmod_halation) { + if( CardCrawlGame.trial.dailyModIDs().contains(HoneycakeModifier.ID)) { + RelicLibrary.getRelic(HoneyJar.ID).makeCopy().instantObtain(); + RelicLibrary.getRelic("halation:CatFaceCupcake").makeCopy().instantObtain(); + for (AbstractRelic relicInBossPool : RelicLibrary.bossList) { + if (relicInBossPool.relicId.equals(HoneyJar.ID) || relicInBossPool.relicId.equals("halation:CatFaceCupcake")) { + RelicLibrary.bossList.remove(relicInBossPool); + break; + } + } + } + } } } public void receivePotionGet(final AbstractPotion p0) { diff --git a/src/main/java/replayTheSpire/panelUI/RelicSettingsButton.java b/src/main/java/replayTheSpire/panelUI/RelicSettingsButton.java index b2417761..34497aa5 100644 --- a/src/main/java/replayTheSpire/panelUI/RelicSettingsButton.java +++ b/src/main/java/replayTheSpire/panelUI/RelicSettingsButton.java @@ -126,4 +126,18 @@ public int renderLayer() { public int updateOrder() { return 1; } + + public void addSetting(ReplayRelicSetting setting) { + float ly = ReplayTheSpireMod.setting_start_y; + float lx = ReplayTheSpireMod.setting_start_x; + for (ReplayRelicSetting ls : this.settings) { + ly -= ls.elementHeight; + if (ly <= 0f) { + ly = ReplayTheSpireMod.setting_start_y + (lx >= 600.0f ? 80.0f : 0f); + lx += 300.0f; + } + } + settings.add(setting); + elements.addAll(setting.GenerateElements(lx, ly)); + } } diff --git a/src/main/resources/localization/ReplayRunModStrings.json b/src/main/resources/localization/ReplayRunModStrings.json index 9f108ff4..36b921e6 100644 --- a/src/main/resources/localization/ReplayRunModStrings.json +++ b/src/main/resources/localization/ReplayRunModStrings.json @@ -14,5 +14,9 @@ "replay:ALWAYS": { "NAME": "ALWAYS WHALE", "DESCRIPTION": "Neow shows up a lot." + }, + "replay:honeycakes": { + "NAME": "Honeycakes", + "DESCRIPTION": "Start with Honey Jar and Cat-Face Cupcake" } } \ No newline at end of file