-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
170 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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()); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters