-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use correct color for energized effect of Channel
- Loading branch information
Showing
4 changed files
with
66 additions
and
3 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
56 changes: 56 additions & 0 deletions
56
src/main/java/stsjorbsmod/powers/EnergizedCustomPower.java
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,56 @@ | ||
package stsjorbsmod.powers; | ||
|
||
import com.badlogic.gdx.graphics.Texture; | ||
import com.badlogic.gdx.graphics.g2d.TextureAtlas; | ||
import com.megacrit.cardcrawl.actions.common.RemoveSpecificPowerAction; | ||
import com.megacrit.cardcrawl.core.AbstractCreature; | ||
import com.megacrit.cardcrawl.core.CardCrawlGame; | ||
import com.megacrit.cardcrawl.dungeons.AbstractDungeon; | ||
import com.megacrit.cardcrawl.localization.PowerStrings; | ||
import com.megacrit.cardcrawl.powers.AbstractPower; | ||
import stsjorbsmod.JorbsMod; | ||
import stsjorbsmod.util.TextureLoader; | ||
|
||
import static stsjorbsmod.JorbsMod.makePowerPath; | ||
|
||
public class EnergizedCustomPower extends AbstractPower { | ||
public static final String POWER_ID = JorbsMod.makeID(EnergizedCustomPower.class.getSimpleName()); | ||
private static final PowerStrings powerStrings = CardCrawlGame.languagePack.getPowerStrings(POWER_ID); | ||
public static final String NAME = powerStrings.NAME; | ||
public static final String[] DESCRIPTIONS = powerStrings.DESCRIPTIONS; | ||
|
||
private static final Texture tex84 = TextureLoader.getTexture(makePowerPath("energized_custom_power84.png")); | ||
private static final Texture tex32 = TextureLoader.getTexture(makePowerPath("energized_custom_power32.png")); | ||
|
||
public EnergizedCustomPower(AbstractCreature owner, int energyAmt) { | ||
this.name = NAME; | ||
this.ID = POWER_ID; | ||
this.owner = owner; | ||
this.amount = energyAmt; | ||
if (this.amount >= 999) { | ||
this.amount = 999; | ||
} | ||
|
||
this.region128 = new TextureAtlas.AtlasRegion(tex84, 0, 0, 84, 84); | ||
this.region48 = new TextureAtlas.AtlasRegion(tex32, 0, 0, 32, 32); | ||
|
||
this.updateDescription(); | ||
} | ||
|
||
public void stackPower(int stackAmount) { | ||
super.stackPower(stackAmount); | ||
if (this.amount >= 999) { | ||
this.amount = 999; | ||
} | ||
} | ||
|
||
public void updateDescription() { | ||
this.description = DESCRIPTIONS[0] + this.amount + DESCRIPTIONS[1]; | ||
} | ||
|
||
public void onEnergyRecharge() { | ||
this.flash(); | ||
AbstractDungeon.player.gainEnergy(this.amount); | ||
AbstractDungeon.actionManager.addToBottom(new RemoveSpecificPowerAction(this.owner, this.owner, this.ID)); | ||
} | ||
} |
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