-
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
9 changed files
with
280 additions
and
25 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
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,47 @@ | ||
package mod.jedi.actions; | ||
|
||
import com.megacrit.cardcrawl.actions.AbstractGameAction; | ||
import com.megacrit.cardcrawl.core.Settings; | ||
import com.megacrit.cardcrawl.dungeons.AbstractDungeon; | ||
import com.megacrit.cardcrawl.orbs.AbstractOrb; | ||
import com.megacrit.cardcrawl.orbs.EmptyOrbSlot; | ||
|
||
import java.util.Collections; | ||
|
||
public class RemoveSpecificOrbAction | ||
extends AbstractGameAction | ||
{ | ||
private AbstractOrb orb; | ||
|
||
public RemoveSpecificOrbAction(AbstractOrb orb) | ||
{ | ||
this.startDuration = this.duration = Settings.ACTION_DUR_FAST; | ||
this.orb = orb; | ||
this.actionType = ActionType.SPECIAL; | ||
} | ||
|
||
@Override | ||
public void update() | ||
{ | ||
if (this.duration == this.startDuration) | ||
{ | ||
int position = AbstractDungeon.player.orbs.indexOf(this.orb); | ||
if (position == -1) | ||
{ | ||
this.isDone = true; | ||
return; | ||
} | ||
for (int i = position + 1; i < AbstractDungeon.player.orbs.size(); ++i) { | ||
Collections.swap(AbstractDungeon.player.orbs, i, i - 1); | ||
} | ||
|
||
AbstractDungeon.player.orbs.set(AbstractDungeon.player.orbs.size() - 1, new EmptyOrbSlot()); | ||
|
||
for (int i = position; i < AbstractDungeon.player.orbs.size(); ++i) { | ||
((AbstractOrb) AbstractDungeon.player.orbs.get(i)).setSlot(i, AbstractDungeon.player.maxOrbs); | ||
} | ||
} | ||
this.tickDuration(); | ||
} | ||
|
||
} |
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,92 @@ | ||
package mod.jedi.actions; | ||
|
||
import com.evacipated.cardcrawl.mod.stslib.StSLib; | ||
import com.megacrit.cardcrawl.actions.AbstractGameAction; | ||
import com.megacrit.cardcrawl.cards.AbstractCard; | ||
import com.megacrit.cardcrawl.characters.AbstractPlayer; | ||
import com.megacrit.cardcrawl.core.Settings; | ||
import com.megacrit.cardcrawl.dungeons.AbstractDungeon; | ||
import mod.jedi.cards.red.UnlimitedPower; | ||
|
||
import java.util.ArrayList; | ||
|
||
public class SmithInCombatAction | ||
extends AbstractGameAction | ||
{ | ||
private ArrayList<AbstractCard> cannotUpgrade = new ArrayList(); | ||
private String updateBodyText = "Select a card for permanent upgrade"; | ||
|
||
public SmithInCombatAction() | ||
{ | ||
this.duration = Settings.ACTION_DUR_FAST; | ||
this.actionType = ActionType.SPECIAL; | ||
} | ||
|
||
@Override | ||
public void update() | ||
{ | ||
AbstractPlayer p = AbstractDungeon.player; | ||
//Checks on if cards in hand can have their master deck equivalent upgraded | ||
|
||
if (this.duration == Settings.ACTION_DUR_FAST) { | ||
for (AbstractCard c : p.hand.group) { | ||
AbstractCard masterC = StSLib.getMasterDeckEquivalent(c); | ||
if ((masterC == null) || (!masterC.canUpgrade()) || (c instanceof UnlimitedPower)) { | ||
this.cannotUpgrade.add(c); | ||
} | ||
} | ||
// if no cards in hand can have their master deck version upgraded | ||
if (this.cannotUpgrade.size() == p.hand.group.size()) { | ||
this.isDone = true; | ||
return; | ||
} | ||
// if only one can... | ||
if (p.hand.group.size() - this.cannotUpgrade.size() == 1) { | ||
for (AbstractCard c : p.hand.group) { | ||
AbstractCard masterC = StSLib.getMasterDeckEquivalent(c); | ||
if (masterC != null && masterC.canUpgrade()) { | ||
masterC.upgrade(); | ||
if (c.canUpgrade()) { | ||
c.upgrade(); | ||
} | ||
c.superFlash(); | ||
|
||
this.isDone = true; | ||
return; | ||
} | ||
} | ||
} | ||
// and now if there's more than one | ||
p.hand.group.removeAll(this.cannotUpgrade); | ||
AbstractDungeon.handCardSelectScreen.open(updateBodyText, 1, false, false, false, true); | ||
this.tickDuration(); | ||
return; | ||
} | ||
if (!AbstractDungeon.handCardSelectScreen.wereCardsRetrieved) | ||
{ | ||
for (AbstractCard c : AbstractDungeon.handCardSelectScreen.selectedCards.group) | ||
{ | ||
if (c.canUpgrade()) | ||
{ | ||
c.upgrade(); | ||
} | ||
p.hand.addToTop(c); | ||
c.superFlash(); | ||
AbstractCard cardToSmith = StSLib.getMasterDeckEquivalent(c); | ||
if (cardToSmith != null && cardToSmith.canUpgrade()) | ||
{ | ||
p.masterDeck.getSpecificCard(cardToSmith).upgrade(); | ||
} | ||
} | ||
for (AbstractCard c : this.cannotUpgrade) | ||
{ | ||
p.hand.addToTop(c); | ||
} | ||
p.hand.refreshHandLayout(); | ||
} | ||
|
||
AbstractDungeon.handCardSelectScreen.wereCardsRetrieved = true; | ||
AbstractDungeon.handCardSelectScreen.selectedCards.group.clear(); | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package mod.jedi.cards.green; | ||
|
||
public class StudyDiscard | ||
{ | ||
} |
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,43 @@ | ||
package mod.jedi.cards.green; | ||
|
||
import basemod.abstracts.CustomCard; | ||
import com.megacrit.cardcrawl.characters.AbstractPlayer; | ||
import com.megacrit.cardcrawl.core.CardCrawlGame; | ||
import com.megacrit.cardcrawl.helpers.GameDictionary; | ||
import com.megacrit.cardcrawl.localization.CardStrings; | ||
import com.megacrit.cardcrawl.monsters.AbstractMonster; | ||
|
||
//I'm just gonna wait till kio makes customdiscovery really. | ||
public class StudyPoison | ||
extends CustomCard | ||
{ | ||
public static final String ID = "jedi:studypoison"; | ||
private static final CardStrings cardStrings = CardCrawlGame.languagePack.getCardStrings(ID); | ||
public static final String NAME = cardStrings.NAME; | ||
public static final String DESCRIPTION = cardStrings.DESCRIPTION; | ||
public static final String UPGRADE_DESCRIPTION = cardStrings.UPGRADE_DESCRIPTION; | ||
public static final int COST = 1; | ||
public static final String IMG_PATH = "resources/jedi/images/cards/jedi_beta.png"; | ||
|
||
public StudyPoison() | ||
{ | ||
super(ID, NAME, IMG_PATH, COST, DESCRIPTION, CardType.SKILL, CardColor.GREEN, CardRarity.UNCOMMON, CardTarget.NONE); | ||
this.exhaust = true; | ||
} | ||
|
||
public void use(AbstractPlayer p, AbstractMonster m) | ||
{ | ||
// GameDictionary.POISON; | ||
} | ||
|
||
public void upgrade() | ||
{ | ||
if(!this.upgraded) | ||
{ | ||
upgradeName(); | ||
this.exhaust = false; | ||
this.rawDescription = UPGRADE_DESCRIPTION; | ||
initializeDescription(); | ||
} | ||
} | ||
} |
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,52 @@ | ||
package mod.jedi.cards.red; | ||
|
||
import basemod.abstracts.CustomCard; | ||
import com.megacrit.cardcrawl.actions.animations.VFXAction; | ||
import com.megacrit.cardcrawl.actions.common.LoseHPAction; | ||
import com.megacrit.cardcrawl.characters.AbstractPlayer; | ||
import com.megacrit.cardcrawl.core.CardCrawlGame; | ||
import com.megacrit.cardcrawl.core.Settings; | ||
import com.megacrit.cardcrawl.dungeons.AbstractDungeon; | ||
import com.megacrit.cardcrawl.localization.CardStrings; | ||
import com.megacrit.cardcrawl.monsters.AbstractMonster; | ||
import com.megacrit.cardcrawl.vfx.UpgradeShineEffect; | ||
import mod.jedi.actions.SmithInCombatAction; | ||
|
||
public class BloodyHammer | ||
extends CustomCard | ||
{ | ||
public static final String ID = "jedi:bloodyhammer"; | ||
private static final CardStrings cardStrings = CardCrawlGame.languagePack.getCardStrings(ID); | ||
public static final String NAME = cardStrings.NAME; | ||
public static final String DESCRIPTION = cardStrings.DESCRIPTION; | ||
public static final String UPGRADE_DESCRIPTION = cardStrings.UPGRADE_DESCRIPTION; | ||
public static final int COST = 1; | ||
public static final String IMG_PATH = "resources/jedi/images/cards/jedi_beta.png"; | ||
|
||
public BloodyHammer() | ||
{ | ||
super(ID, NAME, IMG_PATH, COST, DESCRIPTION, CardType.SKILL, CardColor.RED, CardRarity.RARE, CardTarget.NONE); | ||
this.magicNumber = this.baseMagicNumber = 8; | ||
this.purgeOnUse = true; | ||
this.exhaust = true; | ||
} | ||
|
||
public void use(AbstractPlayer p, AbstractMonster m) | ||
{ | ||
AbstractDungeon.actionManager.addToBottom(new LoseHPAction(p, p, this.magicNumber)); | ||
AbstractDungeon.actionManager.addToBottom(new SmithInCombatAction()); | ||
AbstractDungeon.actionManager.addToBottom(new VFXAction(new UpgradeShineEffect(Settings.WIDTH/2, Settings.HEIGHT/2))); | ||
} | ||
|
||
public void upgrade() | ||
{ | ||
if(!this.upgraded) | ||
{ | ||
upgradeName(); | ||
this.purgeOnUse = false; | ||
this.exhaust = true; | ||
this.rawDescription = UPGRADE_DESCRIPTION; | ||
initializeDescription(); | ||
} | ||
} | ||
} |
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