Skip to content

Commit

Permalink
UPDATE BODY TEXT
Browse files Browse the repository at this point in the history
  • Loading branch information
Jedi515 committed Dec 20, 2018
1 parent d07ae62 commit 20a43d7
Show file tree
Hide file tree
Showing 6 changed files with 170 additions and 9 deletions.
16 changes: 10 additions & 6 deletions src/jedi.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import com.megacrit.cardcrawl.cards.CardGroup;
import com.megacrit.cardcrawl.characters.AbstractPlayer;
import com.megacrit.cardcrawl.dungeons.AbstractDungeon;
import com.megacrit.cardcrawl.dungeons.Exordium;
import com.megacrit.cardcrawl.dungeons.TheCity;
import com.megacrit.cardcrawl.helpers.CardLibrary;
import com.megacrit.cardcrawl.localization.*;
Expand Down Expand Up @@ -43,7 +42,7 @@ public class jedi
public static void initialize()
{
BaseMod.subscribe(new jedi());
isReplayLoaded = Loader.isModLoaded("ReplayTheSpireMod"); // this String is the modid from ModTheSpire.json of the mod you want to find
isReplayLoaded = Loader.isModLoaded("ReplayTheSpireMod");

}

Expand Down Expand Up @@ -94,13 +93,18 @@ public void receiveEditCards()
@Override
public void receiveEditRelics()
{
BaseMod.addRelic(new Matchstick(), RelicType.SHARED);
BaseMod.addRelic(new HotPepper(), RelicType.SHARED);
BaseMod.addRelic(new LaserPointer(), RelicType.BLUE);
BaseMod.addRelic(new FakeMustache(), RelicType.SHARED);
BaseMod.addRelic(new Endoplasm(), RelicType.SHARED);
BaseMod.addRelic(new Superconductor(), RelicType.BLUE);
BaseMod.addRelic(new Matchstick(), RelicType.SHARED);
BaseMod.addRelic(new LeadLinedBottle(), RelicType.SHARED);
BaseMod.addRelic(new FakeMustache(), RelicType.SHARED);

BaseMod.addRelic(new LaserPointer(), RelicType.BLUE);
BaseMod.addRelic(new Superconductor(), RelicType.BLUE);

BaseMod.addRelic(new ScrapMetal(), RelicType.GREEN);

BaseMod.addRelic(new Zontanonomicon(), RelicType.SHARED);

// if (isReplayLoaded) {
// BaseMod.addRelic(new OtherSneckoEye(), RelicType.SHARED);
Expand Down
24 changes: 24 additions & 0 deletions src/mod/jedi/patches/CursedTomePatch.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package mod.jedi.patches;

import com.evacipated.cardcrawl.modthespire.lib.ByRef;
import com.evacipated.cardcrawl.modthespire.lib.SpireInsertPatch;
import com.evacipated.cardcrawl.modthespire.lib.SpirePatch;
import com.megacrit.cardcrawl.dungeons.AbstractDungeon;
import com.megacrit.cardcrawl.events.city.CursedTome;
import com.megacrit.cardcrawl.helpers.RelicLibrary;
import com.megacrit.cardcrawl.relics.AbstractRelic;
import mod.jedi.relics.Zontanonomicon;

import java.util.ArrayList;

@SpirePatch(clz = CursedTome.class, method = "randomBook")
public class CursedTomePatch
{
@SpireInsertPatch(rloc = 1, localvars = {"possibleBooks"})
public static void Insert(CursedTome __instance, @ByRef ArrayList<AbstractRelic>[] possibleBooks)
{
if (!AbstractDungeon.player.hasRelic(Zontanonomicon.ID)) {
possibleBooks[0].add(RelicLibrary.getRelic(Zontanonomicon.ID).makeCopy());
}
}
}
6 changes: 4 additions & 2 deletions src/mod/jedi/relics/LeadLinedBottle.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import basemod.abstracts.CustomRelic;
import basemod.abstracts.CustomSavable;
import com.badlogic.gdx.graphics.Texture;
import com.megacrit.cardcrawl.actions.common.DrawCardAction;
import mod.jedi.patches.LeadLinedBottleField;
import com.megacrit.cardcrawl.actions.common.RelicAboveCreatureAction;
import com.megacrit.cardcrawl.cards.AbstractCard;
Expand Down Expand Up @@ -41,9 +42,10 @@ public LeadLinedBottle() {
public void atPreBattle() {
this.flash();
AbstractDungeon.player.drawPile.removeCard(card.cardID);
AbstractDungeon.player.drawPile.moveToBottomOfDeck(card); //.makeSameInstanceOf()
AbstractDungeon.player.drawPile.moveToBottomOfDeck(card);
//Don't ask me why i have to remove the card first and then add it back if it's "move" and not "add", i don't know how it works either. but it does. mostly.
AbstractDungeon.actionManager.addToBottom(new RelicAboveCreatureAction(AbstractDungeon.player, this));
// AbstractDungeon.player.hand.refreshHandLayout();
AbstractDungeon.player.hand.refreshHandLayout();
}

@Override
Expand Down
48 changes: 48 additions & 0 deletions src/mod/jedi/relics/ScrapMetal.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
package mod.jedi.relics;

import basemod.abstracts.CustomRelic;
import com.badlogic.gdx.graphics.Texture;
import com.megacrit.cardcrawl.actions.common.MakeTempCardInHandAction;
import com.megacrit.cardcrawl.cards.AbstractCard;
import com.megacrit.cardcrawl.cards.colorless.Shiv;
import com.megacrit.cardcrawl.dungeons.AbstractDungeon;
import com.megacrit.cardcrawl.monsters.AbstractMonster;
import com.megacrit.cardcrawl.relics.AbstractRelic;

public class ScrapMetal
extends CustomRelic
{
public static final String ID = "jedi:scrapmetal";
public static final String IMG_PATH = "resources/images/relics/beta_rock.png";

public ScrapMetal() {
super(ID, new Texture(IMG_PATH), RelicTier.UNCOMMON, LandingSound.CLINK);
this.counter = 0;
}

public void onPlayCard(AbstractCard c, AbstractMonster m)
{
if (c instanceof Shiv)
{
this.counter++;
}

if (this.counter == 15)
{
this.flash();
this.counter = 0;
AbstractDungeon.actionManager.addToBottom(new MakeTempCardInHandAction(new Shiv(), 1));
}
}

public String getUpdatedDescription()
{
return this.DESCRIPTIONS[0];
}

public AbstractRelic makeCopy()
{
return new ScrapMetal();
}

}
67 changes: 67 additions & 0 deletions src/mod/jedi/relics/Zontanonomicon.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
package mod.jedi.relics;

import basemod.abstracts.CustomRelic;
import com.badlogic.gdx.graphics.Texture;
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.CardQueueItem;
import com.megacrit.cardcrawl.core.Settings;
import com.megacrit.cardcrawl.dungeons.AbstractDungeon;
import com.megacrit.cardcrawl.monsters.AbstractMonster;
import com.megacrit.cardcrawl.relics.AbstractRelic;

public class Zontanonomicon
extends CustomRelic
{
public static final String ID = "jedi:zontanonomicon";
public static final String IMG_PATH = "resources/images/relics/beta_rock.png";
private boolean activated = true;

public Zontanonomicon() {
super(ID, new Texture(IMG_PATH), RelicTier.SPECIAL, LandingSound.CLINK);
}

public String getUpdatedDescription()
{
return this.DESCRIPTIONS[0];
}

public void onUseCard(AbstractCard card, UseCardAction action) {
if (card.type == AbstractCard.CardType.SKILL && (card.costForTurn >= 2 || card.cost == -1 && card.energyOnUse >= 2) && this.activated) {
this.activated = false;
this.flash();
AbstractMonster m = null;
if (action.target != null) {
m = (AbstractMonster)action.target;
}

AbstractDungeon.actionManager.addToTop(new RelicAboveCreatureAction(AbstractDungeon.player, this));
AbstractCard tmp = card.makeSameInstanceOf();
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;
tmp.applyPowers();
tmp.purgeOnUse = true;
AbstractDungeon.actionManager.cardQueue.add(new CardQueueItem(tmp, m));
this.pulse = false;
}

}

public void atTurnStart() {
this.activated = true;
}

public boolean checkTrigger() {
return this.activated;
}

public AbstractRelic makeCopy()
{
return new Zontanonomicon();
}

}
18 changes: 17 additions & 1 deletion src/resources/localization/relicStrings.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"NAME": "Matchstick",
"FLAVOR": "The match is struck. A blazing star is born!",
"DESCRIPTIONS": [
"NL [#2aecd7]Usable [#2aecd7]once [#2aecd7]per [#2aecd7]combat. NL Gain [E] [E] ."
" NL [#2aecd7]Usable [#2aecd7]once [#2aecd7]per [#2aecd7]combat. NL Gain [E] [E] ."
]
},
"jedi:hotpepper":
Expand Down Expand Up @@ -64,5 +64,21 @@
"Choose a card for ",
"Start each combat with "," at the bottom of your draw pile."
]
},
"jedi:scrapmetal":
{
"NAME": "Scrap Metal",
"FLAVOR": "Nothing should go to waste.",
"DESCRIPTIONS": [
"For every #b15 #yShivs played, add a #yShiv to your hand."
]
},
"jedi:zontanonomicon":
{
"NAME": "Zontanonomicon",
"FLAVOR": "You feel invigorated just by holding this Book of Living.",
"DESCRIPTIONS": [
"The first #ySkill played each turn that costs #b2 or more is played twice."
]
}
}

0 comments on commit 20a43d7

Please sign in to comment.