added Hedron Matrix from Rise of the Eldrazi. First attempt at Equipment.

This commit is contained in:
jendave
2011-08-06 04:03:22 +00:00
parent e6cf06beb3
commit 90ef80ce69
3 changed files with 123 additions and 0 deletions

View File

@@ -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_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_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 snow_covered_mountain3.jpg http://www.magickartenmarkt.de/img/cards/Ice_Age/snow_covered_mountain.jpg
hedron_matrix.jpg http://www.wizards.com/global/images/magic/general/hedron_matrix.jpg
perish_the_thought.jpg http://www.wizards.com/global/images/magic/general/perish_the_thought.jpg perish_the_thought.jpg http://www.wizards.com/global/images/magic/general/perish_the_thought.jpg
khalni_heart_expedition.jpg http://www.wizards.com/global/images/magic/general/khalni_heart_expedition.jpg khalni_heart_expedition.jpg http://www.wizards.com/global/images/magic/general/khalni_heart_expedition.jpg
suffer_the_past.jpg http://www.wizards.com/global/images/magic/general/suffer_the_past.jpg suffer_the_past.jpg http://www.wizards.com/global/images/magic/general/suffer_the_past.jpg

View File

@@ -1,3 +1,8 @@
Hedron Matrix
4
Artifact Equipment
Equipped creature gets +X/+X, where X is its converted mana cost.
Perish the Thought Perish the Thought
2 B 2 B
Sorcery Sorcery

View File

@@ -486,6 +486,123 @@ class CardFactory_Equipment {
} //*************** END ************ END ************************** } //*************** END ************ END **************************
//*************** START *********** START **************************
if(cardName.equals("Hedron Matrix")) {
/*
* Equipped creature gets +X/+X, where X is its converted mana cost.
*/
final Ability equip = new Ability(card, "4") {
//not changed
@Override
public void resolve() {
if(AllZone.GameAction.isCardInPlay(getTargetCard())
&& CardFactoryUtil.canTarget(card, getTargetCard())) {
if(card.isEquipping()) {
Card crd = card.getEquipping().get(0);
if(crd.equals(getTargetCard())) return;
card.unEquipCard(crd);
}
card.equipCard(getTargetCard());
}
}
//not changed
@Override
public boolean canPlay() {
return AllZone.getZone(card).is(Constant.Zone.Play)
&& AllZone.Phase.getActivePlayer().equals(card.getController())
&& (AllZone.Phase.getPhase().equals("Main1") || AllZone.Phase.getPhase().equals(
"Main2"));
}
//not changed
@Override
public boolean canPlayAI() {
return getCreature().size() != 0 && !card.isEquipping();
}
//not changed
@Override
public void chooseTargetAI() {
Card target = CardFactoryUtil.AI_getBestCreature(getCreature());
setTargetCard(target);
}
//not changed
CardList getCreature() {
CardList list = new CardList(AllZone.Computer_Play.getCards());
list = list.filter(new CardListFilter() {
public boolean addCard(Card c) {
return c.isCreature() && (!CardFactoryUtil.AI_doesCreatureAttack(c))
&& CardFactoryUtil.canTarget(card, c)
&& (!c.getKeyword().contains("Defender"));
}
});
// is there at least 1 Loxodon Punisher to target
CardList equipMagnetList = list.getName("Loxodon Punisher");
if (equipMagnetList.size() != 0) {
return equipMagnetList;
}
return list;
}//getCreature()
};//equip ability
Command onEquip = new Command() {
public void execute() {
if(card.isEquipping()) {
Card crd = card.getEquipping().get(0);
int pump = CardUtil.getConvertedManaCost(crd.getManaCost());
crd.addSemiPermanentAttackBoost(pump);
crd.addSemiPermanentDefenseBoost(pump);
}
}//execute()
};//Command
Command onUnEquip = new Command() {
public void execute() {
if(card.isEquipping()) {
Card crd = card.getEquipping().get(0);
int pump = CardUtil.getConvertedManaCost(crd.getManaCost());
crd.addSemiPermanentAttackBoost(-pump);
crd.addSemiPermanentDefenseBoost(-pump);
}
}//execute()
};//Command
Input runtime = new Input() {
@Override
public void showMessage() {
//get all creatures you control
CardList list = new CardList();
list.addAll(AllZone.Human_Play.getCards());
list = list.getType("Creature");
stopSetNext(CardFactoryUtil.input_targetSpecific(equip, list,
"Select target creature to equip", true, false));
}
};//Input
equip.setBeforePayMana(runtime);
equip.setDescription("Equip: 4");
card.addSpellAbility(equip);
card.addEquipCommand(onEquip);
card.addUnEquipCommand(onUnEquip);
} //*************** END ************ END **************************
if (shouldEquip(card) != -1) { if (shouldEquip(card) != -1) {
int n = shouldEquip(card); int n = shouldEquip(card);