-
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
4 changed files
with
101 additions
and
0 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,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; | ||
} | ||
} | ||
} |
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,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(); | ||
} | ||
} |
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