add Clone (from original base Alpha)

This commit is contained in:
jendave
2011-08-06 14:18:51 +00:00
parent d1dd75d73b
commit 5c0f623862
4 changed files with 84 additions and 1 deletions

1
.gitattributes vendored
View File

@@ -890,6 +890,7 @@ res/cardsfolder/cloak_of_feathers.txt -text svneol=native#text/plain
res/cardsfolder/cloak_of_mists.txt -text svneol=native#text/plain
res/cardsfolder/clock_of_omens.txt -text svneol=native#text/plain
res/cardsfolder/clockwork_gnomes.txt -text svneol=native#text/plain
res/cardsfolder/clone.txt -text svneol=native#text/plain
res/cardsfolder/close_quarters.txt -text svneol=native#text/plain
res/cardsfolder/cloud_crusader.txt -text svneol=native#text/plain
res/cardsfolder/cloud_djinn.txt -text svneol=native#text/plain

View File

@@ -0,0 +1,8 @@
Name:Clone
ManaCost:3 U
Types:Creature Shapeshifter
Text:You may have CARDNAME enter the battlefield as a copy of any creature on the battlefield.
PT:0/0
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/clone.jpg
End

View File

@@ -139,6 +139,7 @@ public class Card extends MyObservable {
private String namedCard = "";
private String topCardName = "";
private String reflectableMana = "";
private String cloneOrigin = "";
private ArrayList<Card> gainControlTargets = new ArrayList<Card>();
private ArrayList<Command> gainControlReleaseCommands = new ArrayList<Command>();;
@@ -308,7 +309,15 @@ public class Card extends MyObservable {
public boolean getSirenAttackOrDestroy() {
return sirenAttackOrDestroy;
}
}
public String getCloneOrigin() {
return cloneOrigin;
}
public void setCloneOrigin(String name) {
cloneOrigin = name;
}
public boolean getSacrificeAtEOT() {
return sacrificeAtEOT || getKeyword().contains("At the beginning of the end step, sacrifice CARDNAME.");

View File

@@ -13335,6 +13335,71 @@ public class CardFactory_Creatures {
card.addComesIntoPlayCommand(comesIntoPlay);
}//*************** END ************ END **************************
//*************** START *********** START **************************
else if(cardName.equals("Clone")) {
final CardFactory cfact = cf;
final Card[] copyTarget = new Card[1];
final Card[] cloned = new Card[1];
final SpellAbility copyBack = new Ability(card, "0") {
@Override
public void resolve() {
Card orig = cfact.getCard(cloned[0].getCloneOrigin(), card.getController());
PlayerZone dest = AllZone.getZone(cloned[0]);
AllZone.GameAction.moveTo(dest, orig);
dest.remove(cloned[0]);
}
};//SpellAbility
final Command leaves = new Command() {
private static final long serialVersionUID = 8590474793502538215L;
public void execute() {
StringBuilder sb = new StringBuilder();
sb.append(card.getName()).append(" - reverting "+cloned[0].getName()+" to "+card.getName()+".");
copyBack.setStackDescription(sb.toString());
AllZone.Stack.add(copyBack);
}
};
final SpellAbility copy = new Spell(card) {
private static final long serialVersionUID = 4496978456522751302L;
@Override
public void resolve() {
cloned[0] = cfact.getCard(copyTarget[0].getName(), card.getController());
cloned[0].setCloneOrigin(card.getName());
cloned[0].addLeavesPlayCommand(leaves);
PlayerZone play = AllZone.getZone(Constant.Zone.Battlefield, card.getController());
play.add(cloned[0]);
}
};//SpellAbility
Input runtime = new Input() {
private static final long serialVersionUID = 7615038074569687330L;
@Override
public void showMessage() {
AllZone.Display.showMessage(cardName+" - Select a creature on the battlefield");
}
@Override
public void selectCard(Card c, PlayerZone z) {
if( z.is(Constant.Zone.Battlefield) && c.isCreature()) {
copyTarget[0] = c;
stopSetNext(new Input_PayManaCost(copy));
}
}
};
card.clearSpellAbility();
card.addSpellAbility(copy);
copy.setStackDescription(cardName+" - enters the battlefield as a copy of selected card.");
copy.setBeforePayMana(runtime);
}//*************** END ************ END **************************
if(hasKeyword(card, "Level up") != -1 && hasKeyword(card, "maxLevel") != -1)
{