-
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
7 changed files
with
213 additions
and
13 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,59 @@ | ||
package mod.jedi.cards.curses; | ||
|
||
import basemod.abstracts.CustomCard; | ||
import com.megacrit.cardcrawl.actions.common.ApplyPowerAction; | ||
import com.megacrit.cardcrawl.actions.utility.UseCardAction; | ||
import com.megacrit.cardcrawl.cards.AbstractCard; | ||
import com.megacrit.cardcrawl.characters.AbstractPlayer; | ||
import com.megacrit.cardcrawl.core.CardCrawlGame; | ||
import com.megacrit.cardcrawl.dungeons.AbstractDungeon; | ||
import com.megacrit.cardcrawl.localization.CardStrings; | ||
import com.megacrit.cardcrawl.monsters.AbstractMonster; | ||
import com.megacrit.cardcrawl.powers.ArtifactPower; | ||
import com.megacrit.cardcrawl.powers.GainStrengthPower; | ||
import com.megacrit.cardcrawl.powers.StrengthPower; | ||
|
||
public class Frostbite | ||
extends CustomCard | ||
{ | ||
|
||
public static final String ID = "jedi:frostbite"; | ||
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 int COST = -2; | ||
public static final String IMG_PATH = "resources/images/cards/jedi_beta.png"; | ||
|
||
public Frostbite() | ||
{ | ||
super(ID, NAME, IMG_PATH, COST, DESCRIPTION, CardType.CURSE, CardColor.CURSE, CardRarity.CURSE, CardTarget.NONE); | ||
this.baseMagicNumber = 3; | ||
this.magicNumber = this.baseMagicNumber; | ||
} | ||
|
||
public void use(AbstractPlayer p, AbstractMonster m) { | ||
if (p.hasRelic("Blue Candle")) { | ||
this.useBlueCandle(p); | ||
} else { | ||
AbstractDungeon.actionManager.addToBottom(new UseCardAction(this)); | ||
} | ||
|
||
} | ||
|
||
public void triggerWhenDrawn() | ||
{ | ||
AbstractPlayer p = AbstractDungeon.player; | ||
if (p != null && !p.hasPower(ArtifactPower.POWER_ID)) | ||
{ | ||
AbstractDungeon.actionManager.addToBottom(new ApplyPowerAction(p, p, new GainStrengthPower(p, this.magicNumber), this.magicNumber)); | ||
} | ||
AbstractDungeon.actionManager.addToBottom(new ApplyPowerAction(p, p, new StrengthPower(p, -this.magicNumber), -this.magicNumber)); | ||
} | ||
|
||
public AbstractCard makeCopy() { | ||
return new Frostbite(); | ||
} | ||
|
||
public void upgrade() { | ||
} | ||
} |
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,106 @@ | ||
package mod.jedi.events; | ||
|
||
import com.megacrit.cardcrawl.cards.AbstractCard; | ||
import com.megacrit.cardcrawl.cards.CardGroup; | ||
import com.megacrit.cardcrawl.cards.curses.Pain; | ||
import com.megacrit.cardcrawl.cards.red.PerfectedStrike; | ||
import com.megacrit.cardcrawl.core.CardCrawlGame; | ||
import com.megacrit.cardcrawl.core.Settings; | ||
import com.megacrit.cardcrawl.dungeons.AbstractDungeon; | ||
import com.megacrit.cardcrawl.events.AbstractImageEvent; | ||
import com.megacrit.cardcrawl.helpers.CardLibrary; | ||
import com.megacrit.cardcrawl.localization.EventStrings; | ||
import com.megacrit.cardcrawl.relics.AbstractRelic; | ||
import com.megacrit.cardcrawl.rooms.AbstractRoom; | ||
import com.megacrit.cardcrawl.unlock.UnlockTracker; | ||
import com.megacrit.cardcrawl.vfx.cardManip.ShowCardAndObtainEffect; | ||
|
||
public class SwordDojo | ||
extends AbstractImageEvent | ||
{ | ||
// cardLibrary.getAllCards() | ||
// for (Map.Entry<String, AbstractCard> entrySetCard : CardLibrary.cards.entrySet()) { | ||
// AbstractCard card = entrySetCard.getValue(); | ||
// //check against card | ||
// } | ||
|
||
public static final String ID = "jedi:sworddojo"; | ||
public static final EventStrings eventStrings = CardCrawlGame.languagePack.getEventString(ID); | ||
public static final String[] OPTIONS = eventStrings.OPTIONS; | ||
public static final String[] DESCRIPTIONS = eventStrings.DESCRIPTIONS; | ||
public static final String NAME = eventStrings.NAME; | ||
private static int strikesAmount; | ||
private int screenNum = 0; | ||
|
||
|
||
public SwordDojo() | ||
{ | ||
super(NAME, DESCRIPTIONS[0], "resources/images/events/mausoleum.jpg"); | ||
if (AbstractDungeon.ascensionLevel >= 15) | ||
{ | ||
strikesAmount = 3; | ||
} | ||
else | ||
{ | ||
strikesAmount = 5; | ||
} | ||
this.imageEventText.setDialogOption(OPTIONS[0] + strikesAmount + OPTIONS[1]); | ||
this.imageEventText.setDialogOption(OPTIONS[2]); | ||
this.imageEventText.setDialogOption(OPTIONS[3]); | ||
} | ||
|
||
|
||
@Override | ||
protected void buttonEffect(int buttonPressed) { | ||
switch (this.screenNum) { | ||
case 0: | ||
switch (buttonPressed) { | ||
case 0: | ||
this.imageEventText.updateBodyText(DESCRIPTIONS[1]); | ||
screenNum = 1; | ||
CardGroup group = new CardGroup(CardGroup.CardGroupType.UNSPECIFIED); | ||
for (AbstractCard card : CardLibrary.getAllCards()) | ||
{ | ||
if ((card.hasTag(AbstractCard.CardTags.STRIKE) && (card.rarity != AbstractCard.CardRarity.BASIC))) | ||
{ | ||
group.addToBottom(card.makeCopy()); | ||
} | ||
} | ||
CardGroup GiveToPlayer = new CardGroup(CardGroup.CardGroupType.UNSPECIFIED); | ||
for (int i = 0; i < strikesAmount; i++) | ||
{ | ||
AbstractCard card = group.getRandomCard(true); | ||
GiveToPlayer.addToBottom(card.makeCopy()); | ||
UnlockTracker.markCardAsSeen(card.cardID); | ||
card.isSeen = true; | ||
} | ||
GiveToPlayer.addToBottom(new PerfectedStrike()); | ||
AbstractDungeon.gridSelectScreen.openConfirmationGrid(GiveToPlayer, this.DESCRIPTIONS[4]); | ||
this.imageEventText.updateDialogOption(0, OPTIONS[3]); | ||
this.imageEventText.clearRemainingOptions(); | ||
return; | ||
case 1: | ||
this.imageEventText.updateBodyText(DESCRIPTIONS[2]); | ||
screenNum = 1; | ||
AbstractDungeon.getCurrRoom().rewards.clear(); | ||
AbstractCard curse = AbstractDungeon.returnRandomCurse().makeCopy(); | ||
AbstractDungeon.effectList.add(new ShowCardAndObtainEffect(curse, (float)(Settings.WIDTH / 2), (float)(Settings.HEIGHT / 2))); | ||
AbstractRelic r = AbstractDungeon.returnRandomScreenlessRelic(AbstractDungeon.returnRandomRelicTier()); | ||
AbstractDungeon.getCurrRoom().addRelicToRewards(r); | ||
AbstractDungeon.getCurrRoom().phase = AbstractRoom.RoomPhase.COMPLETE; | ||
AbstractDungeon.combatRewardScreen.open(); | ||
this.imageEventText.updateDialogOption(0, OPTIONS[3]); | ||
this.imageEventText.clearRemainingOptions(); | ||
return; | ||
default: | ||
this.imageEventText.updateBodyText(DESCRIPTIONS[3]); | ||
screenNum = 1; | ||
this.imageEventText.updateDialogOption(0, OPTIONS[3]); | ||
this.imageEventText.clearRemainingOptions(); | ||
return; | ||
} | ||
default: | ||
this.openMap(); | ||
} | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,21 @@ | ||
{ | ||
"jedi:sworddojo" : | ||
{ | ||
"NAME" : "Sword Dojo", | ||
"DESCRIPTIONS" : | ||
[ | ||
"You come across an abandoned sword dojo. No living soul can be found anywhere. The hall you see has many praying mats in it, as well as a treasure chest in front of them.", | ||
"You decide to sit on a praying mat and meditate. Soon you start feeling sharp knowledge penetrating into your mind, giving you new mastery with the sword.", | ||
"You decide to open the chest. Inside you can see relics, most of them dusty and broken. You choose to take the most intact one. You feel #r~heavy~ #r~weight~ on your shoulders when you leave.", | ||
"Nothing interests you in this abandoned temple. You decide to not touch anything and leave.", | ||
"Striking knowledge..." | ||
], | ||
"OPTIONS" : | ||
[ | ||
"[Meditate] Obtain #y", | ||
" random #yStrike cards from ANY character and a #yPerfected #yStrike.", | ||
"[Chest] Obtain a random relic. Obtain a #rrandom curse.", | ||
"[Leave]" | ||
] | ||
} | ||
} |