Skip to content

Commit

Permalink
More relics.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jedi515 committed Dec 23, 2018
1 parent 01fd220 commit 2ec1f5d
Show file tree
Hide file tree
Showing 9 changed files with 177 additions and 6 deletions.
4 changes: 4 additions & 0 deletions src/jedi.java
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,17 @@ public void receiveEditRelics()
BaseMod.addRelic(new Matchstick(), RelicType.SHARED);
BaseMod.addRelic(new LeadLinedBottle(), RelicType.SHARED);
BaseMod.addRelic(new FakeMustache(), RelicType.SHARED);
BaseMod.addRelic(new FirstAidKit(), RelicType.SHARED);
BaseMod.addRelic(new CrownOfSimplicity(), RelicType.SHARED);

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

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

BaseMod.addRelic(new Leech(), RelicType.RED);

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

// if (isReplayLoaded) {
Expand Down
1 change: 1 addition & 0 deletions src/mod/jedi/cards/blue/Reiji.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public Reiji()
this.magicNumber = this.baseMagicNumber;
this.isInnate = true;
this.exhaust = true;
this.isEthereal= true;
}

@Override
Expand Down
2 changes: 1 addition & 1 deletion src/mod/jedi/events/SwordDojo.java
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,10 @@ protected void buttonEffect(int buttonPressed) {
case 1:
this.imageEventText.updateBodyText(DESCRIPTIONS[2]);
screenNum = 1;
AbstractDungeon.getCurrRoom().rewards.clear();
AbstractCard curse = AbstractDungeon.returnRandomCurse().makeCopy();
AbstractDungeon.effectList.add(new ShowCardAndObtainEffect(curse, (float)(Settings.WIDTH / 2), (float)(Settings.HEIGHT / 2)));
AbstractRelic r = AbstractDungeon.returnRandomScreenlessRelic(AbstractDungeon.returnRandomRelicTier());
AbstractDungeon.getCurrRoom().rewards.clear();
AbstractDungeon.getCurrRoom().addRelicToRewards(r);
AbstractDungeon.getCurrRoom().phase = AbstractRoom.RoomPhase.COMPLETE;
AbstractDungeon.combatRewardScreen.open();
Expand Down
2 changes: 1 addition & 1 deletion src/mod/jedi/patches/PaperLockOnPatch.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public static SpireReturn<Integer> Insert(AbstractCreature target, int dmg) {
@SpirePatch(
clz = DamageInfo.class,
method = "createDamageMatrix",
paramtypez = {int.class, boolean.class, boolean.class})
paramtypez = {int.class, boolean.class, boolean.class })
public static class ElectroTarget
{
@SpirePostfixPatch
Expand Down
59 changes: 59 additions & 0 deletions src/mod/jedi/relics/CrownOfSimplicity.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
package mod.jedi.relics;

import basemod.abstracts.CustomRelic;
import com.badlogic.gdx.graphics.Texture;
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;

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

public CrownOfSimplicity()
{
super(ID, new Texture(IMG_PATH), RelicTier.RARE, LandingSound.FLAT);
}


public void onUseCard(AbstractCard card, UseCardAction action)
{
if (card.rarity == AbstractCard.CardRarity.BASIC && !card.purgeOnUse)
{
this.flash();
AbstractMonster m = null;
if (action.target != null) {
m = (AbstractMonster)action.target;
}

AbstractCard tmp = card.makeSameInstanceOf();
AbstractDungeon.player.limbo.addToBottom(tmp);
tmp.current_x = card.current_x;
tmp.current_y = card.current_y;
tmp.target_x = (float) Settings.WIDTH / 2.0F - 300.0F * Settings.scale;
tmp.target_y = (float)Settings.HEIGHT / 2.0F;
tmp.freeToPlayOnce = true;
if (m != null) {
tmp.calculateCardDamage(m);
}

tmp.purgeOnUse = true;
AbstractDungeon.actionManager.cardQueue.add(new CardQueueItem(tmp, m, card.energyOnUse));
}
}

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

public CustomRelic makeCopy()
{
return new CrownOfSimplicity();
}
}
41 changes: 41 additions & 0 deletions src/mod/jedi/relics/FirstAidKit.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
package mod.jedi.relics;

import basemod.abstracts.CustomRelic;
import com.badlogic.gdx.graphics.Texture;
import com.megacrit.cardcrawl.actions.common.ApplyPowerAction;
import com.megacrit.cardcrawl.cards.DamageInfo;
import com.megacrit.cardcrawl.dungeons.AbstractDungeon;
import com.megacrit.cardcrawl.powers.RegenPower;

public class FirstAidKit
extends CustomRelic
{

public static final String ID = "jedi:firstaidkit";
public static final String IMG_PATH = "resources/images/relics/beta_rock.png";

public FirstAidKit()
{
super(ID, new Texture(IMG_PATH), RelicTier.RARE, LandingSound.FLAT);
}


public int onAttacked(DamageInfo info, int damageAmount)
{
if (info.type != DamageInfo.DamageType.THORNS && info.type != DamageInfo.DamageType.HP_LOSS && info.owner != null && info.owner != AbstractDungeon.player && damageAmount > 0 && !AbstractDungeon.player.hasPower("Buffer"))
{
AbstractDungeon.actionManager.addToBottom(new ApplyPowerAction(AbstractDungeon.player, AbstractDungeon.player, new RegenPower(AbstractDungeon.player, 2), 2));
}
return damageAmount;
}

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

public CustomRelic makeCopy()
{
return new FirstAidKit();
}
}
42 changes: 42 additions & 0 deletions src/mod/jedi/relics/Leech.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
package mod.jedi.relics;

import basemod.abstracts.CustomRelic;
import com.badlogic.gdx.graphics.Texture;
import com.evacipated.cardcrawl.mod.stslib.relics.BetterOnLoseHpRelic;
import com.megacrit.cardcrawl.cards.DamageInfo;

public class Leech
extends CustomRelic
implements BetterOnLoseHpRelic
{
public static final String ID = "jedi:leech";
public static final String IMG_PATH = "resources/images/relics/beta_rock.png";

public Leech()
{
super(ID, new Texture(IMG_PATH), RelicTier.UNCOMMON, LandingSound.FLAT);
}

@Override
public int betterOnLoseHp(DamageInfo damageInfo, int i)
{
if (damageInfo.type == DamageInfo.DamageType.HP_LOSS && i > 1)
{
return i-1;
}
else
{
return i;
}
}

public CustomRelic makeCopy()
{
return new Leech();
}

public String getUpdatedDescription()
{
return this.DESCRIPTIONS[0];
}
}
2 changes: 1 addition & 1 deletion src/mod/jedi/relics/PaperFaux.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
public class PaperFaux
extends CustomRelic
{
public static final String ID = "jedi:papereegle";
public static final String ID = "jedi:paperfaux";
public static final String IMG_PATH = "resources/images/relics/beta_rock.png";

public PaperFaux() {
Expand Down
30 changes: 27 additions & 3 deletions src/resources/localization/relicStrings.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,36 @@
"The first #ySkill played each turn that costs #b2 or more is played twice."
]
},
"jedi:papereegle":
"jedi:paperfaux":
{
"NAME": "Paper Eegle",
"FLAVOR": "Sharp eyes brought to you by Garrus Calibrations Inc.",
"NAME": "Paper Faux",
"FLAVOR": "What does it say?",
"DESCRIPTIONS": [
"Enemies with Lock-On take #b75% more damage rather than #b50%."
]
},
"jedi:firstaidkit":
{
"NAME": "First Aid Kit",
"FLAVOR": "Do you really need a bandage for every byrd peck?",
"DESCRIPTIONS": [
"Whenever you take unblocked attack damage, gain #b2 Regen."
]
},
"jedi:leech":
{
"NAME": "Leech",
"FLAVOR": "Craaawling iiin my craaaaaawl!",
"DESCRIPTIONS": [
"Reduce HP loss from cards and powers by #b1 to a minimum of #b1."
]
},
"jedi:crownofsimplicity":
{
"NAME": "Crown of Simplicity",
"FLAVOR": "Did you really have to remove that Bash?",
"DESCRIPTIONS": [
"#yStarter cards are played twice."
]
}
}

0 comments on commit 2ec1f5d

Please sign in to comment.