Skip to content

Commit

Permalink
Use correct color for energized effect of Channel
Browse files Browse the repository at this point in the history
  • Loading branch information
dbjorge committed Oct 13, 2019
1 parent f931bba commit c0d15b8
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/main/java/stsjorbsmod/cards/Channel.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
import com.megacrit.cardcrawl.characters.AbstractPlayer;
import com.megacrit.cardcrawl.dungeons.AbstractDungeon;
import com.megacrit.cardcrawl.monsters.AbstractMonster;
import com.megacrit.cardcrawl.powers.EnergizedBluePower;
import stsjorbsmod.JorbsMod;
import stsjorbsmod.characters.Wanderer;
import stsjorbsmod.powers.EnergizedCustomPower;

import static stsjorbsmod.JorbsMod.makeCardPath;

Expand All @@ -34,7 +34,7 @@ public Channel() {
@Override
public void use(AbstractPlayer p, AbstractMonster m) {
AbstractDungeon.actionManager.addToBottom(new GainBlockAction(p, p, block));
AbstractDungeon.actionManager.addToBottom(new ApplyPowerAction(p, p, new EnergizedBluePower(p, magicNumber), magicNumber));
AbstractDungeon.actionManager.addToBottom(new ApplyPowerAction(p, p, new EnergizedCustomPower(p, magicNumber), magicNumber));
}

@Override
Expand Down
56 changes: 56 additions & 0 deletions src/main/java/stsjorbsmod/powers/EnergizedCustomPower.java
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));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,6 @@
},
"stsjorbsmod:Channel": {
"NAME": "Channel",
"DESCRIPTION": "Gain !B! Block. Gain !M! [E] next turn."
"DESCRIPTION": "Gain !B! Block. NL Gain !M! [E] next turn."
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@
" Damage to all enemies and lose all Coil."
]
},
"stsjorbsmod:EnergizedCustomPower": {
"NAME": "Energized",
"DESCRIPTIONS": [
"Gain #b",
" additional [E] next turn."
]
},
"stsjorbsmod:SnappedPower": {
"NAME": "Snapped",
"DESCRIPTIONS": [
Expand Down

0 comments on commit c0d15b8

Please sign in to comment.