mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 03:38:01 +00:00
added Hedron Matrix from Rise of the Eldrazi. First attempt at Equipment.
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_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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|||||||
Reference in New Issue
Block a user