mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 20:28:00 +00:00
add An-Zerrin Ruins (from Homelands)
This commit is contained in:
1
.gitattributes
vendored
1
.gitattributes
vendored
@@ -117,6 +117,7 @@ res/cardsfolder/amrou_seekers.txt -text svneol=native#text/plain
|
||||
res/cardsfolder/amulet_of_vigor.txt -text svneol=native#text/plain
|
||||
res/cardsfolder/an_havva_inn.txt -text svneol=native#text/plain
|
||||
res/cardsfolder/an_havva_township.txt -text svneol=native#text/plain
|
||||
res/cardsfolder/an_zerrin_ruins.txt -text svneol=native#text/plain
|
||||
res/cardsfolder/anaba_bodyguard.txt -text svneol=native#text/plain
|
||||
res/cardsfolder/anaba_shaman.txt -text svneol=native#text/plain
|
||||
res/cardsfolder/anaba_spirit_crafter.txt -text svneol=native#text/plain
|
||||
|
||||
7
res/cardsfolder/an_zerrin_ruins.txt
Normal file
7
res/cardsfolder/an_zerrin_ruins.txt
Normal file
@@ -0,0 +1,7 @@
|
||||
Name:An-Zerrin Ruins
|
||||
ManaCost:2 R R
|
||||
Types:Enchantment
|
||||
Text:As An-Zerrin Ruins enters the battlefield, choose a creature type.\r\nCreatures of the chosen type don't untap during their controllers' untap steps.
|
||||
SVar:Rarity:Rare
|
||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/an_zerrin_ruins.jpg
|
||||
End
|
||||
@@ -10442,7 +10442,36 @@ public class CardFactory implements NewConstants {
|
||||
card.addSpellAbility(ability);
|
||||
ability.setBeforePayMana(CardFactoryUtil.input_targetPlayer(ability));
|
||||
}//*************** END ************ END **************************
|
||||
|
||||
//*************** START *********** START **************************
|
||||
else if (cardName.equals("An-Zerrin Ruins")) {
|
||||
|
||||
final SpellAbility comesIntoPlayAbility = new Ability(card, "0") {
|
||||
@Override
|
||||
public void resolve() {
|
||||
String chosenType = "";
|
||||
if(card.getController().equals(Constant.Player.Human)) {
|
||||
chosenType = JOptionPane.showInputDialog(null, "Enter a creature type:", card.getName(),
|
||||
JOptionPane.QUESTION_MESSAGE);
|
||||
}
|
||||
else {
|
||||
//not implemented for AI
|
||||
}
|
||||
card.setChosenType(chosenType);
|
||||
}//resolve()
|
||||
}; //comesIntoPlayAbility
|
||||
|
||||
Command intoPlay = new Command() {
|
||||
private static final long serialVersionUID = 2985015252466920757L;
|
||||
|
||||
public void execute() {
|
||||
comesIntoPlayAbility.setStackDescription(card.getName()+" - choose a creature type. Creatures of that type do not untap during their controller's untap step.");
|
||||
AllZone.Stack.add(comesIntoPlayAbility);
|
||||
}
|
||||
};
|
||||
|
||||
card.addComesIntoPlayCommand(intoPlay);
|
||||
}//*************** END ************ END **************************
|
||||
|
||||
// Cards with Cycling abilities
|
||||
// -1 means keyword "Cycling" not found
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
|
||||
package forge;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
|
||||
public class Input_Untap extends Input {
|
||||
private static final long serialVersionUID = 3452595801560263386L;
|
||||
@@ -99,6 +101,9 @@ public class Input_Untap extends Input {
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(isAnZerrinRuinsType(getAnZerrinRuinsTypes(), c)) {
|
||||
//nothing to do, just doesn't let the card untap
|
||||
}
|
||||
else if((c.getCounters(Counters.WIND)>0) && AllZoneUtil.isCardInPlay("Freyalise's Winds")) {
|
||||
//remove a WIND counter instead of untapping
|
||||
c.subtractCounter(Counters.WIND, 1);
|
||||
@@ -168,5 +173,22 @@ public class Input_Untap extends Input {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private ArrayList<String> getAnZerrinRuinsTypes() {
|
||||
ArrayList<String> types = new ArrayList<String>();
|
||||
CardList ruins = AllZoneUtil.getCardsInPlay("An-Zerrin Ruins");
|
||||
for(Card ruin:ruins) {
|
||||
types.add(ruin.getChosenType());
|
||||
}
|
||||
return types;
|
||||
}
|
||||
|
||||
private boolean isAnZerrinRuinsType(ArrayList<String> types, Card card) {
|
||||
ArrayList<String> cardTypes = card.getType();
|
||||
for(String type:cardTypes) {
|
||||
if(types.contains(type)) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user