mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 12:48:00 +00:00
add Clone (from original base Alpha)
This commit is contained in:
1
.gitattributes
vendored
1
.gitattributes
vendored
@@ -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/cloak_of_mists.txt -text svneol=native#text/plain
|
||||||
res/cardsfolder/clock_of_omens.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/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/close_quarters.txt -text svneol=native#text/plain
|
||||||
res/cardsfolder/cloud_crusader.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
|
res/cardsfolder/cloud_djinn.txt -text svneol=native#text/plain
|
||||||
|
|||||||
8
res/cardsfolder/clone.txt
Normal file
8
res/cardsfolder/clone.txt
Normal 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
|
||||||
@@ -139,6 +139,7 @@ public class Card extends MyObservable {
|
|||||||
private String namedCard = "";
|
private String namedCard = "";
|
||||||
private String topCardName = "";
|
private String topCardName = "";
|
||||||
private String reflectableMana = "";
|
private String reflectableMana = "";
|
||||||
|
private String cloneOrigin = "";
|
||||||
private ArrayList<Card> gainControlTargets = new ArrayList<Card>();
|
private ArrayList<Card> gainControlTargets = new ArrayList<Card>();
|
||||||
private ArrayList<Command> gainControlReleaseCommands = new ArrayList<Command>();;
|
private ArrayList<Command> gainControlReleaseCommands = new ArrayList<Command>();;
|
||||||
|
|
||||||
@@ -308,7 +309,15 @@ public class Card extends MyObservable {
|
|||||||
|
|
||||||
public boolean getSirenAttackOrDestroy() {
|
public boolean getSirenAttackOrDestroy() {
|
||||||
return sirenAttackOrDestroy;
|
return sirenAttackOrDestroy;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getCloneOrigin() {
|
||||||
|
return cloneOrigin;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCloneOrigin(String name) {
|
||||||
|
cloneOrigin = name;
|
||||||
|
}
|
||||||
|
|
||||||
public boolean getSacrificeAtEOT() {
|
public boolean getSacrificeAtEOT() {
|
||||||
return sacrificeAtEOT || getKeyword().contains("At the beginning of the end step, sacrifice CARDNAME.");
|
return sacrificeAtEOT || getKeyword().contains("At the beginning of the end step, sacrifice CARDNAME.");
|
||||||
|
|||||||
@@ -13335,6 +13335,71 @@ public class CardFactory_Creatures {
|
|||||||
card.addComesIntoPlayCommand(comesIntoPlay);
|
card.addComesIntoPlayCommand(comesIntoPlay);
|
||||||
}//*************** END ************ END **************************
|
}//*************** 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)
|
if(hasKeyword(card, "Level up") != -1 && hasKeyword(card, "maxLevel") != -1)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user