-
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
11 changed files
with
145 additions
and
5 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,41 @@ | ||
package mod.jedi.actions; | ||
|
||
import com.megacrit.cardcrawl.actions.AbstractGameAction; | ||
import com.megacrit.cardcrawl.dungeons.AbstractDungeon; | ||
import com.megacrit.cardcrawl.monsters.AbstractMonster; | ||
|
||
public class ShrinkRayAction | ||
extends AbstractGameAction | ||
{ | ||
public float efficiency; | ||
|
||
public ShrinkRayAction(float efficiency) | ||
{ | ||
this.duration = this.startDuration = 0.1F; | ||
this.actionType = ActionType.SPECIAL; | ||
this.efficiency = efficiency; | ||
|
||
if (AbstractDungeon.getMonsters().areMonstersBasicallyDead()) { | ||
this.duration = 0.0F; | ||
this.startDuration = 0.0F; | ||
this.isDone = true; | ||
} | ||
} | ||
|
||
@Override | ||
public void update() | ||
{ | ||
|
||
for (AbstractMonster m : AbstractDungeon.getCurrRoom().monsters.monsters) | ||
{ | ||
if (!(m.type == AbstractMonster.EnemyType.BOSS)) { | ||
if (m.currentHealth > (int) ((float) m.maxHealth * (this.efficiency))) | ||
{ | ||
m.currentHealth -= (int) ((float) m.maxHealth * (this.efficiency)); | ||
m.healthBarUpdatedEvent(); | ||
} | ||
} | ||
} | ||
this.isDone = true; | ||
} | ||
} |
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
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
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,23 @@ | ||
package mod.jedi.patches; | ||
|
||
import com.evacipated.cardcrawl.modthespire.lib.ByRef; | ||
import com.evacipated.cardcrawl.modthespire.lib.SpirePatch; | ||
import com.megacrit.cardcrawl.core.AbstractCreature; | ||
import com.megacrit.cardcrawl.core.CardCrawlGame; | ||
import com.megacrit.cardcrawl.dungeons.AbstractDungeon; | ||
import mod.jedi.relics.ShrinkRay; | ||
|
||
@SpirePatch(clz = AbstractCreature.class, method = "loadAnimation") | ||
public class ShrinkRayPatch { | ||
public static void Prefix(AbstractCreature __instance, String atlasUrl, String skeletonUrl,@ByRef float[] scale) | ||
{ | ||
|
||
if (CardCrawlGame.dungeon != null && AbstractDungeon.player != null) | ||
{ | ||
if (AbstractDungeon.player.hasRelic(ShrinkRay.ID)) | ||
{ | ||
scale[0] += 0.2F; | ||
} | ||
} | ||
} | ||
} |
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,33 @@ | ||
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.dungeons.AbstractDungeon; | ||
import com.megacrit.cardcrawl.monsters.AbstractMonster; | ||
import mod.jedi.actions.ShrinkRayAction; | ||
|
||
//guess what, another patch on size | ||
public class ShrinkRay | ||
extends CustomRelic | ||
{ | ||
public static final String ID = "jedi:shrinkray"; | ||
public static final String IMG_PATH = "resources/images/relics/beta_rock.png"; | ||
private float MODIFIER_AMT = 0.1F; | ||
|
||
public ShrinkRay() { | ||
super(ID, new Texture(IMG_PATH), RelicTier.COMMON, LandingSound.CLINK); | ||
} | ||
|
||
public void atBattleStart() { | ||
this.flash(); | ||
AbstractDungeon.actionManager.addToTop(new RelicAboveCreatureAction(AbstractDungeon.player, this)); | ||
AbstractDungeon.actionManager.addToTop(new ShrinkRayAction(MODIFIER_AMT)); | ||
} | ||
|
||
|
||
public String getUpdatedDescription() | ||
{ | ||
return this.DESCRIPTIONS[0] + 10 + this.DESCRIPTIONS[1]; | ||
} | ||
} |
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