Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import com.megacrit.cardcrawl.actions.common.ApplyPowerAction;
- import com.megacrit.cardcrawl.cards.AbstractCard;
- import com.megacrit.cardcrawl.characters.AbstractPlayer;
- import com.megacrit.cardcrawl.dungeons.AbstractDungeon;
- import com.megacrit.cardcrawl.monsters.AbstractMonster;
- import com.megacrit.cardcrawl.powers.AbstractPower;
- import basemod.abstracts.CustomCard;
- import java.util.ArrayList;
- import java.util.Iterator;
- public class SpellcraftCard
- extends CustomCard {
- public static final String ID = "Spellcraft";
- public static final String NAME = "Spellcraft";
- public static final String DESCRIPTION = "Play all cards from the Spellcraft-Pool. NL Other Skills this turn exhaust. Add Skills exhausted that way to the Spellcraft-Pool.";
- public static final String IMG_PATH = "img/my_card_img.png";
- private static final int COST = 2;
- private static final int POOL = 1;
- public SpellcraftCard() {
- super(ID, NAME, IMG_PATH, COST, DESCRIPTION,
- AbstractCard.CardType.ATTACK, CardColor.COLORLESS,
- AbstractCard.CardRarity.UNCOMMON, CardTarget.SELF, POOL);
- this.setBackgroundTexture("img/custom_background_small.png", "img/custom_background_large.png");
- this.setOrbTexture("img/custom_orb_small.png", "img/custom_orb_large.png");
- this.setBannerTexture("img/custom_banner_large.png", "img/custom_banner_large.png");
- }
- @Override
- public void use(AbstractPlayer p, AbstractMonster m) {
- boolean powerExists = false;
- Iterator var4 = p.powers.iterator();
- while (var4.hasNext()) {
- AbstractPower pow = (AbstractPower) var4.next();
- if (pow.ID.equals("SpellCraftPowerCast")) {
- ArrayList<AbstractCard> CastList = ((SpellcraftPowerCast)pow).getCast();
- for (AbstractCard card : CastList)
- {
- powerExists = true;
- card.use(p, AbstractDungeon.getRandomMonster());
- }
- }
- }
- if (!powerExists){
- AbstractDungeon.actionManager.addToBottom(new ApplyPowerAction(p, p, new SpellcraftPowerCast(p)));
- }
- while (var4.hasNext()) {
- AbstractPower pow = (AbstractPower) var4.next();
- if (pow.ID.equals("SpellCraftPowerExhaust")) {
- ArrayList<AbstractCard> CastList = ((SpellcraftPowerCast)pow).getCast();
- for (AbstractCard card : CastList)
- {
- powerExists = true;
- }
- }
- }
- if (!powerExists){
- AbstractDungeon.actionManager.addToBottom(new ApplyPowerAction(p, p, new SpellcraftPowerExhaust(p)));
- }
- }
- @Override
- public AbstractCard makeCopy(){
- return new SpellcraftCard();
- }
- @Override
- public void upgrade() {
- if (!this.upgraded) {
- }
- }
- }
- _______________________________________________________________________________________________________________________________________
- //
- // Source code recreated from a .class file by IntelliJ IDEA
- // (powered by Fernflower decompiler)
- //
- import com.megacrit.cardcrawl.actions.common.RemoveSpecificPowerAction;
- import com.megacrit.cardcrawl.actions.utility.UseCardAction;
- import com.megacrit.cardcrawl.cards.AbstractCard;
- import com.megacrit.cardcrawl.cards.AbstractCard.CardType;
- import com.megacrit.cardcrawl.core.AbstractCreature;
- import com.megacrit.cardcrawl.dungeons.AbstractDungeon;
- import com.megacrit.cardcrawl.powers.AbstractPower;
- import java.util.*;
- public class SpellcraftPowerExhaust extends AbstractPower {
- public static final String POWER_ID = "Corruption";
- public static final ArrayList<AbstractCard> Cast = new ArrayList<AbstractCard>();
- public SpellcraftPowerExhaust(AbstractCreature owner) {
- this.name = "Spellcraft Pool";
- this.ID = "SpellcraftPool";
- this.owner = owner;
- this.amount = -1;
- this.description = "You are Spellcrafting!";
- this.loadRegion("corruption");
- }
- public void updateDescription() {
- String CardsInPool = new String();
- for (AbstractCard card : Cast){
- CardsInPool = CardsInPool + " " + card.name;
- }
- this.description = "You are Spellcrafting! In the Pool are:" + " NL " + CardsInPool;
- }
- public void onUseCard(AbstractCard card, UseCardAction action) {
- if (card.type == CardType.SKILL) {
- this.flash();
- action.exhaustCard = true;
- }
- }
- public void atEndOfRound() {
- AbstractDungeon.actionManager.addToBottom(new RemoveSpecificPowerAction(this.owner, this.owner, "SpellcraftCast"));
- }
- }
- _______________________________________________________________________________________________________________________________________
- //
- // Source code recreated from a .class file by IntelliJ IDEA
- // (powered by Fernflower decompiler)
- //
- import com.megacrit.cardcrawl.actions.common.ReducePowerAction;
- import com.megacrit.cardcrawl.actions.common.RemoveSpecificPowerAction;
- import com.megacrit.cardcrawl.actions.utility.UseCardAction;
- import com.megacrit.cardcrawl.cards.AbstractCard;
- import com.megacrit.cardcrawl.cards.AbstractCard.CardType;
- import com.megacrit.cardcrawl.characters.AbstractPlayer;
- 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 java.util.*;
- public class SpellcraftPowerCast extends AbstractPower {
- public static final String POWER_ID = "Corruption";
- private static final PowerStrings powerStrings;
- public static final String NAME;
- public static final String[] DESCRIPTIONS;
- public static final ArrayList<AbstractCard> Cast = new ArrayList<AbstractCard>();
- public SpellcraftPowerCast(AbstractCreature owner) {
- this.name = NAME;
- this.ID = "SpellcraftPool";
- this.owner = owner;
- this.amount = -1;
- this.description = DESCRIPTIONS[0];
- this.loadRegion("corruption");
- }
- public void updateDescription() {
- this.description = DESCRIPTIONS[1];
- }
- public void onUseCard(AbstractCard card, UseCardAction action) {
- AbstractPlayer p = AbstractDungeon.player;
- boolean powerExists = false;
- Iterator var4 = p.powers.iterator();
- while (var4.hasNext()) {
- AbstractPower pow = (AbstractPower) var4.next();
- if (pow.ID.equals("SpellcraftExhaust")) {
- powerExists = true;
- break;
- }
- }
- if (card.type == CardType.SKILL && powerExists) {
- Cast.add(card);
- }
- }
- public ArrayList<AbstractCard> getCast(){
- return Cast;
- }
- static {
- powerStrings = CardCrawlGame.languagePack.getPowerStrings("SpellcraftPool");
- NAME = powerStrings.NAME;
- DESCRIPTIONS = powerStrings.DESCRIPTIONS;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement