Skip to content

Commit

Permalink
UPDATE LOCKON TEXT
Browse files Browse the repository at this point in the history
  • Loading branch information
Jedi515 authored Dec 21, 2018
1 parent 20a43d7 commit 01fd220
Show file tree
Hide file tree
Showing 4 changed files with 101 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/jedi.java
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ public void receiveEditRelics()

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

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

Expand Down
66 changes: 66 additions & 0 deletions src/mod/jedi/patches/PaperLockOnPatch.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
package mod.jedi.patches;

import com.evacipated.cardcrawl.modthespire.lib.SpireInsertPatch;
import com.evacipated.cardcrawl.modthespire.lib.SpirePatch;
import com.evacipated.cardcrawl.modthespire.lib.SpirePostfixPatch;
import com.evacipated.cardcrawl.modthespire.lib.SpireReturn;
import com.megacrit.cardcrawl.cards.DamageInfo;
import com.megacrit.cardcrawl.core.AbstractCreature;
import com.megacrit.cardcrawl.dungeons.AbstractDungeon;
import com.megacrit.cardcrawl.monsters.AbstractMonster;
import com.megacrit.cardcrawl.orbs.AbstractOrb;
import com.megacrit.cardcrawl.powers.LockOnPower;
import mod.jedi.relics.PaperFaux;

public class PaperLockOnPatch
{

@SpirePatch(clz= AbstractOrb.class, method = "applyLockOn")
public static class SingleTarget {
@SpireInsertPatch(rloc = 1)
public static SpireReturn<Integer> Insert(AbstractCreature target, int dmg) {
int retValPatch;
if (AbstractDungeon.player.hasRelic(PaperFaux.ID) && target.hasPower(LockOnPower.POWER_ID)) {
retValPatch = (int) (dmg * 1.75F);
return SpireReturn.Return(retValPatch);
} else {
return SpireReturn.Continue();
}
}
}
@SpirePatch(
clz = DamageInfo.class,
method = "createDamageMatrix",
paramtypez = {int.class, boolean.class, boolean.class})
public static class ElectroTarget
{
@SpirePostfixPatch
public static int[] Postfix(int[] __result, int baseDamage, boolean isPureDamage, boolean isOrbDamage)
{
if (!AbstractDungeon.player.hasRelic(PaperFaux.ID))
{
return __result;
}
int[] retValMultiPatch = new int[AbstractDungeon.getMonsters().monsters.size()];

for(int i = 0; i < retValMultiPatch.length; ++i) {
DamageInfo info = new DamageInfo(AbstractDungeon.player, baseDamage);
if (isOrbDamage && ((AbstractMonster)AbstractDungeon.getMonsters().monsters.get(i)).hasPower(LockOnPower.POWER_ID))
{
if (AbstractDungeon.player.hasRelic(PaperFaux.ID))
{
info.output = (int)((float)info.base * 1.75F);
}
else
{
info.output = (int) ((float) info.base * 1.5F);
}
}

retValMultiPatch[i] = info.output;
}

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

import basemod.abstracts.CustomRelic;
import com.badlogic.gdx.graphics.Texture;
import com.megacrit.cardcrawl.relics.AbstractRelic;

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

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

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

public AbstractRelic makeCopy()
{
return new PaperFaux();
}
}
8 changes: 8 additions & 0 deletions src/resources/localization/relicStrings.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,5 +80,13 @@
"DESCRIPTIONS": [
"The first #ySkill played each turn that costs #b2 or more is played twice."
]
},
"jedi:papereegle":
{
"NAME": "Paper Eegle",
"FLAVOR": "Sharp eyes brought to you by Garrus Calibrations Inc.",
"DESCRIPTIONS": [
"Enemies with Lock-On take #b75% more damage rather than #b50%."
]
}
}

0 comments on commit 01fd220

Please sign in to comment.