mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 20:28:00 +00:00
1) fix Crumble to be destroyNoRegeneration
2) add Divine Offering via the same code block
This commit is contained in:
@@ -38,6 +38,7 @@ snow_covered_mountain.jpg http://www.wizards.com/global/images/magic/gene
|
||||
snow_covered_mountain1.jpg http://www.wizards.com/global/images/magic/general/snow_covered_mountain.jpg
|
||||
snow_covered_mountain2.jpg http://www.magickartenmarkt.de/img/cards/Ice_Age/snow_covered_mountain.jpg
|
||||
snow_covered_mountain3.jpg http://www.magickartenmarkt.de/img/cards/Ice_Age/snow_covered_mountain.jpg
|
||||
divine_offering.jpg http://www.wizards.com/global/images/magic/general/divine_offering.jpg
|
||||
argothian_pixies.jpg http://www.wizards.com/global/images/magic/general/argothian_pixies.jpg
|
||||
arc_slogger.jpg http://www.wizards.com/global/images/magic/general/arc_slogger.jpg
|
||||
fireball.jpg http://www.wizards.com/global/images/magic/general/fireball.jpg
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
Divine Offering
|
||||
1 W
|
||||
Instant
|
||||
Destroy target artifact. You gain life equal to its converted mana cost.
|
||||
|
||||
Argothian Pixies
|
||||
1 G
|
||||
Creature Faerie
|
||||
|
||||
@@ -17404,48 +17404,62 @@ public class CardFactory implements NewConstants {
|
||||
card.addSpellAbility(spell);
|
||||
}//*************** END ************ END **************************
|
||||
|
||||
//*************** START *********** START **************************
|
||||
else if(cardName.equals("Crumble")) {
|
||||
SpellAbility spell = new Spell(card) {
|
||||
private static final long serialVersionUID = 4752943254606319269L;
|
||||
|
||||
@Override
|
||||
public void resolve() {
|
||||
if(AllZone.GameAction.isCardInPlay(getTargetCard())
|
||||
&& CardFactoryUtil.canTarget(card, getTargetCard())) {
|
||||
//add life
|
||||
String player = getTargetCard().getController();
|
||||
PlayerLife life = AllZone.GameAction.getPlayerLife(player);
|
||||
life.addLife(CardUtil.getConvertedManaCost(getTargetCard()));
|
||||
|
||||
//remove card from play
|
||||
AllZone.GameAction.removeFromGame(getTargetCard());
|
||||
}
|
||||
}//resolve()
|
||||
|
||||
@Override
|
||||
public boolean canPlayAI() {
|
||||
CardList artifacts = new CardList(AllZone.Human_Play.getCards());
|
||||
artifacts = artifacts.getType("Artifact");
|
||||
artifacts = artifacts.filter(new CardListFilter() {
|
||||
public boolean addCard(Card c) {
|
||||
return CardFactoryUtil.canTarget(card, c);
|
||||
}
|
||||
});
|
||||
return artifacts.size() != 0 && (AllZone.Phase.getTurn() > 4);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void chooseTargetAI() {
|
||||
CardList play = new CardList(AllZone.Human_Play.getCards());
|
||||
Card target = CardFactoryUtil.AI_getBestArtifact(play);
|
||||
if(target != null) setTargetCard(target);
|
||||
}
|
||||
};
|
||||
spell.setBeforePayMana(CardFactoryUtil.input_targetType(spell, "Artifact"));
|
||||
|
||||
card.clearSpellAbility();
|
||||
card.addSpellAbility(spell);
|
||||
//*************** START *********** START **************************
|
||||
else if(cardName.equals("Crumble") || cardName.equals("Divine Offering")) {
|
||||
/*
|
||||
* Destroy target artifact. It can't be regenerated. That artifact's controller
|
||||
* gains life equal to its converted mana cost.
|
||||
*/
|
||||
SpellAbility spell = new Spell(card) {
|
||||
private static final long serialVersionUID = 4752943254606319269L;
|
||||
|
||||
@Override
|
||||
public void resolve() {
|
||||
Card target = getTargetCard();
|
||||
if(AllZone.GameAction.isCardInPlay(target)
|
||||
&& CardFactoryUtil.canTarget(card, target)) {
|
||||
//add life
|
||||
String player;
|
||||
if(cardName.equals("Crumble")) {
|
||||
player = target.getController();
|
||||
}
|
||||
else {
|
||||
player = card.getController();
|
||||
}
|
||||
PlayerLife life = AllZone.GameAction.getPlayerLife(player);
|
||||
life.addLife(CardUtil.getConvertedManaCost(target));
|
||||
|
||||
if(cardName.equals("Crumble")) {
|
||||
AllZone.GameAction.destroyNoRegeneration(target);
|
||||
}
|
||||
else { //Divine Offering
|
||||
AllZone.GameAction.destroy(target);
|
||||
}
|
||||
}
|
||||
}//resolve()
|
||||
|
||||
@Override
|
||||
public boolean canPlayAI() {
|
||||
CardList artifacts = new CardList(AllZone.Human_Play.getCards());
|
||||
artifacts = artifacts.getType("Artifact");
|
||||
artifacts = artifacts.filter(new CardListFilter() {
|
||||
public boolean addCard(Card c) {
|
||||
return CardFactoryUtil.canTarget(card, c);
|
||||
}
|
||||
});
|
||||
return artifacts.size() != 0 && (AllZone.Phase.getTurn() > 4);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void chooseTargetAI() {
|
||||
CardList play = new CardList(AllZone.Human_Play.getCards());
|
||||
Card target = CardFactoryUtil.AI_getBestArtifact(play);
|
||||
if(target != null) setTargetCard(target);
|
||||
}
|
||||
};
|
||||
spell.setBeforePayMana(CardFactoryUtil.input_targetType(spell, "Artifact"));
|
||||
card.clearSpellAbility();
|
||||
card.addSpellAbility(spell);
|
||||
}//*************** END ************ END **************************
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user