mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-16 18:58:00 +00:00
added support for adding additional characteristics. started converting clones to scripts.
This commit is contained in:
@@ -1,8 +1,12 @@
|
|||||||
Name:Clone
|
Name:Clone
|
||||||
ManaCost:3 U
|
ManaCost:3 U
|
||||||
Types:Creature Shapeshifter
|
Types:Creature Shapeshifter
|
||||||
Text:You may have CARDNAME enter the battlefield as a copy of any creature on the battlefield.
|
Text:no text
|
||||||
PT:0/0
|
PT:0/0
|
||||||
|
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ ChooseCreature | Static$ True | TriggerDescription$ You may have CARDNAME enter the battlefield as a copy of any creature on the battlefield.
|
||||||
|
SVar:ChooseCreature:AB$ ChooseCard | Cost$ 0 | Defined$ You | Amount$ 1 | Choices$ Creature.Other | SubAbility$ DBCopy | RememberChosen$ True
|
||||||
|
SVar:DBCopy:DB$ Clone | Defined$ Self | CloneSource$ Remembered | SubAbility$ DBCleanup
|
||||||
|
SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True
|
||||||
SVar:Rarity:Rare
|
SVar:Rarity:Rare
|
||||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/clone.jpg
|
SVar:Picture:http://www.wizards.com/global/images/magic/general/clone.jpg
|
||||||
SetInfo:LEA|Uncommon|http://magiccards.info/scans/en/al/52.jpg
|
SetInfo:LEA|Uncommon|http://magiccards.info/scans/en/al/52.jpg
|
||||||
|
|||||||
@@ -1,8 +1,13 @@
|
|||||||
Name:Evil Twin
|
Name:Evil Twin
|
||||||
ManaCost:2 U B
|
ManaCost:2 U B
|
||||||
Types:Creature Shapeshifter
|
Types:Creature Shapeshifter
|
||||||
Text:You may have CARDNAME enter the battlefield as a copy of any creature on the battlefield except it gains "U B, T: Destroy target creature with the same name as this creature."
|
Text:no text
|
||||||
PT:0/0
|
PT:0/0
|
||||||
|
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ ChooseCreature | Static$ True | TriggerDescription$ You may have CARDNAME enter the battlefield as a copy of any creature on the battlefield except it gains "U B, T: Destroy target creature with the same name as this creature."
|
||||||
|
SVar:ChooseCreature:AB$ ChooseCard | Cost$ 0 | Defined$ You | Amount$ 1 | Choices$ Creature.Other | SubAbility$ DBCopy | RememberChosen$ True
|
||||||
|
SVar:DBCopy:DB$ Clone | Defined$ Self | CloneSource$ Remembered | AddAbilities$ EvilTwin | SubAbility$ DBCleanup
|
||||||
|
SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True
|
||||||
|
SVar:EvilTwin:AB$Destroy | Cost$ U B T | ValidTgts$ Creature.sameName | TgtPrompt$ Select target creature with the same name. | SpellDescription$ Destroy target creature with the same name as this creature.
|
||||||
SVar:Rarity:Rare
|
SVar:Rarity:Rare
|
||||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/evil_twin.jpg
|
SVar:Picture:http://www.wizards.com/global/images/magic/general/evil_twin.jpg
|
||||||
SetInfo:ISD|Rare|http://magiccards.info/scans/en/isd/212.jpg
|
SetInfo:ISD|Rare|http://magiccards.info/scans/en/isd/212.jpg
|
||||||
|
|||||||
@@ -1,8 +1,12 @@
|
|||||||
Name:Jwari Shapeshifter
|
Name:Jwari Shapeshifter
|
||||||
ManaCost:1 U
|
ManaCost:1 U
|
||||||
Types:Creature Shapeshifter Ally
|
Types:Creature Shapeshifter Ally
|
||||||
Text:You may have CARDNAME enter the battlefield as a copy of any Ally creature on the battlefield.
|
Text:no text
|
||||||
PT:0/0
|
PT:0/0
|
||||||
|
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ ChooseCreature | Static$ True | TriggerDescription$ You may have CARDNAME enter the battlefield as a copy of any Ally creature on the battlefield.
|
||||||
|
SVar:ChooseCreature:AB$ ChooseCard | Cost$ 0 | Defined$ You | Amount$ 1 | Choices$ Creature.Ally+Other | SubAbility$ DBCopy | RememberChosen$ True
|
||||||
|
SVar:DBCopy:DB$ Clone | Defined$ Self | CloneSource$ Remembered | SubAbility$ DBCleanup
|
||||||
|
SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True
|
||||||
SVar:RemRandomDeck:True
|
SVar:RemRandomDeck:True
|
||||||
SVar:Rarity:Rare
|
SVar:Rarity:Rare
|
||||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/jwari_shapeshifter.jpg
|
SVar:Picture:http://www.wizards.com/global/images/magic/general/jwari_shapeshifter.jpg
|
||||||
|
|||||||
@@ -1,8 +1,14 @@
|
|||||||
Name:Phantasmal Image
|
Name:Phantasmal Image
|
||||||
ManaCost:1 U
|
ManaCost:1 U
|
||||||
Types:Creature Illusion
|
Types:Creature Illusion
|
||||||
Text:You may have Phantasmal Image enter the battlefield as a copy of any creature on the battlefield, except it's an Illusion in addition to its other types and it gains "When this creature becomes the target of a spell or ability, sacrifice it."
|
Text:no text
|
||||||
PT:0/0
|
PT:0/0
|
||||||
|
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ ChooseCreature | Static$ True | TriggerDescription$ You may have CARDNAME enter the battlefield as a copy of any creature on the battlefield, except it's an Illusion in addition to its other types and it gains "When this creature becomes the target of a spell or ability, sacrifice it."
|
||||||
|
SVar:ChooseCreature:AB$ ChooseCard | Cost$ 0 | Defined$ You | Amount$ 1 | Choices$ Creature.Other | SubAbility$ DBCopy | RememberChosen$ True
|
||||||
|
SVar:DBCopy:DB$ Clone | Defined$ Self | CloneSource$ Remembered | AddTypes$ Illusion | AddTriggers$ TgtTrig | AddSVars$ TrigSac | SubAbility$ DBCleanup
|
||||||
|
SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True
|
||||||
|
SVar:TgtTrig:Mode$ BecomesTarget | ValidTarget$ Card.Self | Execute$ TrigSac | TriggerDescription$ When this creature becomes the target of a spell or ability, sacrifice it.
|
||||||
|
SVar:TrigSac:AB$Sacrifice | Cost$ 0 | Defined$ Self
|
||||||
SVar:Rarity:Rare
|
SVar:Rarity:Rare
|
||||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/phantasmal_image.jpg
|
SVar:Picture:http://www.wizards.com/global/images/magic/general/phantasmal_image.jpg
|
||||||
SetInfo:M12|Rare|http://magiccards.info/scans/en/m12/72.jpg
|
SetInfo:M12|Rare|http://magiccards.info/scans/en/m12/72.jpg
|
||||||
|
|||||||
@@ -1,8 +1,12 @@
|
|||||||
Name:Phyrexian Metamorph
|
Name:Phyrexian Metamorph
|
||||||
ManaCost:3 PU
|
ManaCost:3 PU
|
||||||
Types:Artifact Creature Shapeshifter
|
Types:Artifact Creature Shapeshifter
|
||||||
Text:You may have CARDNAME enter the battlefield as a copy of any artifact or creature on the battlefield, except it's an artifact in addition to its other types.
|
Text:no text
|
||||||
PT:0/0
|
PT:0/0
|
||||||
|
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ ChooseCreature | Static$ True | TriggerDescription$ You may have CARDNAME enter the battlefield as a copy of any artifact or creature on the battlefield, except it's an artifact in addition to its other types.
|
||||||
|
SVar:ChooseCreature:AB$ ChooseCard | Cost$ 0 | Defined$ You | Amount$ 1 | Choices$ Creature.Other,Artifact.Other | SubAbility$ DBCopy | RememberChosen$ True
|
||||||
|
SVar:DBCopy:DB$ Clone | Defined$ Self | CloneSource$ Remembered | AddTypes$ Artifact | SubAbility$ DBCleanup
|
||||||
|
SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True
|
||||||
SVar:Rarity:Rare
|
SVar:Rarity:Rare
|
||||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/phyrexian_metamorph.jpg
|
SVar:Picture:http://www.wizards.com/global/images/magic/general/phyrexian_metamorph.jpg
|
||||||
SetInfo:NPH|Rare|http://magiccards.info/scans/en/nph/42.jpg
|
SetInfo:NPH|Rare|http://magiccards.info/scans/en/nph/42.jpg
|
||||||
|
|||||||
@@ -1,8 +1,12 @@
|
|||||||
Name:Quicksilver Gargantuan
|
Name:Quicksilver Gargantuan
|
||||||
ManaCost:5 U U
|
ManaCost:5 U U
|
||||||
Types:Creature Shapeshifter
|
Types:Creature Shapeshifter
|
||||||
Text:You may have CARDNAME enter the battlefield as a copy of any creature on the battlefield. It's still 7/7.
|
Text:no text
|
||||||
PT:7/7
|
PT:7/7
|
||||||
|
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ ChooseCreature | Static$ True | TriggerDescription$ You may have CARDNAME enter the battlefield as a copy of any creature on the battlefield. It's still 7/7.
|
||||||
|
SVar:ChooseCreature:AB$ ChooseCard | Cost$ 0 | Defined$ You | Amount$ 1 | Choices$ Creature.Other | SubAbility$ DBCopy | RememberChosen$ True
|
||||||
|
SVar:DBCopy:DB$ Clone | Defined$ Self | CloneSource$ Remembered | SetPower$ 7 | SetToughness$ 7 | SubAbility$ DBCleanup
|
||||||
|
SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True
|
||||||
SVar:Rarity:Rare
|
SVar:Rarity:Rare
|
||||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/quicksilver_gargantuan.jpg
|
SVar:Picture:http://www.wizards.com/global/images/magic/general/quicksilver_gargantuan.jpg
|
||||||
SetInfo:SOM|Mythic|http://magiccards.info/scans/en/som/39.jpg
|
SetInfo:SOM|Mythic|http://magiccards.info/scans/en/som/39.jpg
|
||||||
|
|||||||
@@ -34,6 +34,8 @@ import forge.card.spellability.AbilitySub;
|
|||||||
import forge.card.spellability.Spell;
|
import forge.card.spellability.Spell;
|
||||||
import forge.card.spellability.SpellAbility;
|
import forge.card.spellability.SpellAbility;
|
||||||
import forge.card.spellability.Target;
|
import forge.card.spellability.Target;
|
||||||
|
import forge.card.trigger.Trigger;
|
||||||
|
import forge.card.trigger.TriggerHandler;
|
||||||
import forge.card.trigger.TriggerType;
|
import forge.card.trigger.TriggerType;
|
||||||
import forge.game.phase.PhaseType;
|
import forge.game.phase.PhaseType;
|
||||||
import forge.game.player.ComputerUtil;
|
import forge.game.player.ComputerUtil;
|
||||||
@@ -484,6 +486,7 @@ public final class AbilityFactoryClone {
|
|||||||
final HashMap<String, String> params = af.getMapParams();
|
final HashMap<String, String> params = af.getMapParams();
|
||||||
Card tgtCard;
|
Card tgtCard;
|
||||||
final Card host = sa.getSourceCard();
|
final Card host = sa.getSourceCard();
|
||||||
|
Map<String, String> origSVars = host.getSVars();
|
||||||
|
|
||||||
|
|
||||||
// find target of cloning
|
// find target of cloning
|
||||||
@@ -499,8 +502,12 @@ public final class AbilityFactoryClone {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// find cloning source i.e. thing to be copied
|
// find cloning source i.e. thing to be copied
|
||||||
Card cardToCopy = AbilityFactory.getDefinedCards(host, params.get("CloneSource"), sa).get(0);
|
ArrayList<Card> cloneSources = AbilityFactory.getDefinedCards(host, params.get("CloneSource"), sa);
|
||||||
if (cardToCopy == null) {
|
Card cardToCopy;
|
||||||
|
if (!cloneSources.isEmpty()) {
|
||||||
|
cardToCopy = cloneSources.get(0);
|
||||||
|
}
|
||||||
|
else {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -508,6 +515,7 @@ public final class AbilityFactoryClone {
|
|||||||
|
|
||||||
Card cloned;
|
Card cloned;
|
||||||
|
|
||||||
|
//boolean keepName = params.containsKey("KeepName");
|
||||||
AllZone.getTriggerHandler().suppressMode(TriggerType.Transformed);
|
AllZone.getTriggerHandler().suppressMode(TriggerType.Transformed);
|
||||||
|
|
||||||
if (cardToCopy.isToken()) {
|
if (cardToCopy.isToken()) {
|
||||||
@@ -548,6 +556,7 @@ public final class AbilityFactoryClone {
|
|||||||
tgtCard.addStaticAbility(tgtCard.getStaticAbilityStrings().get(i));
|
tgtCard.addStaticAbility(tgtCard.getStaticAbilityStrings().get(i));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
addExtraCharacteristics(tgtCard, params, origSVars);
|
||||||
// If target is a flipped card, also copy the flipped
|
// If target is a flipped card, also copy the flipped
|
||||||
// state.
|
// state.
|
||||||
if (cardToCopy.isFlip()) {
|
if (cardToCopy.isFlip()) {
|
||||||
@@ -560,7 +569,7 @@ public final class AbilityFactoryClone {
|
|||||||
for (int i = 0; i < tgtCard.getStaticAbilityStrings().size(); i++) {
|
for (int i = 0; i < tgtCard.getStaticAbilityStrings().size(); i++) {
|
||||||
tgtCard.addStaticAbility(tgtCard.getStaticAbilityStrings().get(i));
|
tgtCard.addStaticAbility(tgtCard.getStaticAbilityStrings().get(i));
|
||||||
}
|
}
|
||||||
|
addExtraCharacteristics(tgtCard, params, origSVars);
|
||||||
tgtCard.setFlip(true);
|
tgtCard.setFlip(true);
|
||||||
|
|
||||||
tgtCard.setState(CardCharactersticName.Original);
|
tgtCard.setState(CardCharactersticName.Original);
|
||||||
@@ -574,4 +583,72 @@ public final class AbilityFactoryClone {
|
|||||||
tgtCard.setImageFilename(imageFileName);
|
tgtCard.setImageFilename(imageFileName);
|
||||||
} // cloneResolve
|
} // cloneResolve
|
||||||
|
|
||||||
|
private static void addExtraCharacteristics(final Card tgtCard, final HashMap<String, String> params, final Map<String, String> origSVars) {
|
||||||
|
// additional types to clone
|
||||||
|
if (params.containsKey("AddTypes")) {
|
||||||
|
for (final String type : Arrays.asList(params.get("AddTypes").split(","))) {
|
||||||
|
tgtCard.addType(type);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// triggers to add to clone
|
||||||
|
final ArrayList<String> triggers = new ArrayList<String>();
|
||||||
|
if (params.containsKey("AddTriggers")) {
|
||||||
|
triggers.addAll(Arrays.asList(params.get("AddTriggers").split(",")));
|
||||||
|
for (final String s : triggers) {
|
||||||
|
if (origSVars.containsKey(s)) {
|
||||||
|
final String actualTrigger = origSVars.get(s);
|
||||||
|
final Trigger parsedTrigger = TriggerHandler.parseTrigger(actualTrigger, tgtCard, true);
|
||||||
|
tgtCard.addTrigger(parsedTrigger);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// SVars to add to clone
|
||||||
|
if (params.containsKey("AddSVars")) {
|
||||||
|
for (final String s : Arrays.asList(params.get("AddSVars").split(","))) {
|
||||||
|
if (origSVars.containsKey(s)) {
|
||||||
|
final String actualsVar = origSVars.get(s);
|
||||||
|
tgtCard.setSVar(s, actualsVar);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// abilities to add to clone
|
||||||
|
if (params.containsKey("AddAbilities")) {
|
||||||
|
for (final String s : Arrays.asList(params.get("AddAbilities").split(","))) {
|
||||||
|
if (origSVars.containsKey(s)) {
|
||||||
|
final AbilityFactory newAF = new AbilityFactory();
|
||||||
|
final String actualAbility = origSVars.get(s);
|
||||||
|
final SpellAbility grantedAbility = newAF.getAbility(actualAbility, tgtCard);
|
||||||
|
tgtCard.addSpellAbility(grantedAbility);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// set power of clone
|
||||||
|
if (params.containsKey("SetPower")) {
|
||||||
|
String rhs = params.get("SetPower");
|
||||||
|
int power = -1;
|
||||||
|
try {
|
||||||
|
power = Integer.parseInt(rhs);
|
||||||
|
} catch (final NumberFormatException e) {
|
||||||
|
power = CardFactoryUtil.xCount(tgtCard, tgtCard.getSVar(rhs));
|
||||||
|
}
|
||||||
|
tgtCard.setBaseAttack(power);
|
||||||
|
}
|
||||||
|
|
||||||
|
// set toughness of clone
|
||||||
|
if (params.containsKey("SetToughness")) {
|
||||||
|
String rhs = params.get("SetToughness");
|
||||||
|
int toughness = -1;
|
||||||
|
try {
|
||||||
|
toughness = Integer.parseInt(rhs);
|
||||||
|
} catch (final NumberFormatException e) {
|
||||||
|
toughness = CardFactoryUtil.xCount(tgtCard, tgtCard.getSVar(rhs));
|
||||||
|
}
|
||||||
|
tgtCard.setBaseDefense(toughness);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
} // end class AbilityFactoryClone
|
} // end class AbilityFactoryClone
|
||||||
|
|||||||
@@ -1962,10 +1962,14 @@ public class CardFactoryCreatures {
|
|||||||
getCard_YoseiTheMorningStar(card, cardName);
|
getCard_YoseiTheMorningStar(card, cardName);
|
||||||
} else if (cardName.equals("Phyrexian Dreadnought")) {
|
} else if (cardName.equals("Phyrexian Dreadnought")) {
|
||||||
getCard_PhyrexianDreadnought(card, cardName);
|
getCard_PhyrexianDreadnought(card, cardName);
|
||||||
} else if (cardName.equals("Clone") || cardName.equals("Vesuvan Doppelganger")
|
// } else if (cardName.equals("Clone") || cardName.equals("Vesuvan Doppelganger")
|
||||||
|| cardName.equals("Quicksilver Gargantuan") || cardName.equals("Jwari Shapeshifter")
|
// || cardName.equals("Quicksilver Gargantuan") || cardName.equals("Jwari Shapeshifter")
|
||||||
|| cardName.equals("Phyrexian Metamorph") || cardName.equals("Phantasmal Image")
|
// || cardName.equals("Phyrexian Metamorph") || cardName.equals("Phantasmal Image")
|
||||||
|| cardName.equals("Body Double") || cardName.equals("Evil Twin")
|
// || cardName.equals("Body Double") || cardName.equals("Evil Twin")
|
||||||
|
// || cardName.equals("Sakashima the Impostor")) {
|
||||||
|
} else if (cardName.equals("Vesuvan Doppelganger")
|
||||||
|
|| cardName.equals("Jwari Shapeshifter")
|
||||||
|
|| cardName.equals("Body Double")
|
||||||
|| cardName.equals("Sakashima the Impostor")) {
|
|| cardName.equals("Sakashima the Impostor")) {
|
||||||
getCard_ClonesSeries(card, cardName);
|
getCard_ClonesSeries(card, cardName);
|
||||||
} else if (cardName.equals("Nebuchadnezzar")) {
|
} else if (cardName.equals("Nebuchadnezzar")) {
|
||||||
|
|||||||
Reference in New Issue
Block a user