- Added Spelltwine

This commit is contained in:
moomarc
2012-08-13 17:33:21 +00:00
parent 531eefdf46
commit fc128b20c4
5 changed files with 74 additions and 11 deletions

1
.gitattributes vendored
View File

@@ -8862,6 +8862,7 @@ res/cardsfolder/s/spellbreaker_behemoth.txt svneol=native#text/plain
res/cardsfolder/s/spellgorger_barbarian.txt svneol=native#text/plain
res/cardsfolder/s/spellshock.txt svneol=native#text/plain
res/cardsfolder/s/spellstutter_sprite.txt svneol=native#text/plain
res/cardsfolder/s/spelltwine.txt -text
res/cardsfolder/s/spellweaver_helix.txt -text svneol=unset#text/plain
res/cardsfolder/s/spellwild_ouphe.txt -text
res/cardsfolder/s/sphere_of_duty.txt svneol=native#text/plain

View File

@@ -0,0 +1,15 @@
Name:Spelltwine
ManaCost:5 U
Types:Sorcery
Text:no text
A:SP$ ChangeZone | Cost$ 5 U | Origin$ Graveyard | Destination$ Exile | TgtPrompt$ Choose target instant or sorcery card in your graveyard | ValidTgts$ Instant.YouCtrl,Sorcery.YouCtrl | RememberChanged$ True | SubAbility$ TgtOpp | SpellDescription$ Exile target instant or sorcery card from your graveyard and target instant or sorcery from your opponent's graveyard. Copy those cards. Cast the copies if able without paying their mana cost.
SVar:TgtOpp:DB$ ChangeZone | Origin$ Graveyard | Destination$ Exile | TgtPrompt$ Choose target instant or sorcery card in your opponent's graveyard | ValidTgts$ Instant.YouDontCtrl,Sorcery.YouDontCtrl | RememberChanged$ True | SubAbility$ CopyYou
SVar:CopyYou:DB$ CopySpell | Defined$ Remembered | SubAbility$ CopyOpp | CopyMultipleSpells$ 2 | SubAbility$ ExileSelf
SVar:ExileSelf:DB$ ChangeZone | Origin$ Stack | Destination$ Exile | Defined$ Self | SubAbility$ DBCleanup
SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True
SVar:RemAIDeck:True
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/spelltwine.jpg
SetInfo:M13|Rare|http://magiccards.info/scans/en/m13/68.jpg
Oracle:Exile target instant or sorcery card from your graveyard and target instant or sorcery card from an opponent's graveyard. Copy those cards. Cast the copies if able without paying their mana costs. Exile Spelltwine.
End

View File

@@ -2213,6 +2213,13 @@ public class AbilityFactory {
if (o instanceof SpellAbility) {
s = (SpellAbility) o;
}
} else if (defined.equals("Remembered")) {
for (final Object o : card.getRemembered()) {
if (o instanceof Card) {
final Card rem = (Card) o;
sas.addAll(AllZoneUtil.getCardState(rem).getSpellAbilities());
}
}
} else if (defined.equals("Imprinted")) {
for (final Card imp : card.getImprinted()) {
sas.addAll(imp.getSpellAbilities());

View File

@@ -796,18 +796,55 @@ public final class AbilityFactoryCopy {
return;
}
SpellAbility chosenSA = null;
if (tgtSpells.size() == 1) {
chosenSA = tgtSpells.get(0);
} else if (sa.getActivatingPlayer().isHuman()) {
chosenSA = (SpellAbility) GuiUtils.chooseOne("Select a spell to copy", tgtSpells.toArray());
} else {
chosenSA = tgtSpells.get(0);
}
if (params.containsKey("CopyMultipleSpells")) {
final int spellCount = Integer.parseInt(params.get("CopyMultipleSpells"));
ArrayList<SpellAbility> chosenSAs = new ArrayList<SpellAbility>();
SpellAbility chosenSAtmp = null;
for (int multi = 0; multi < spellCount; multi++) {
if (tgtSpells.size() == 1) {
chosenSAs.addAll(tgtSpells);
} else if (sa.getActivatingPlayer().isHuman()) {
String num = "";
if (multi == 1 - 1) {
num = "first";
}
else if (multi == 2 - 1) {
num = "second";
}
else if (multi == 3 - 1) {
num = "third";
} else {
num = Integer.toString(multi - 1) + "th";
}
chosenSAtmp = (SpellAbility) GuiUtils.chooseOne("Select " + num + " spell to copy to stack", tgtSpells.toArray());
chosenSAs.add(chosenSAtmp);
tgtSpells.remove(chosenSAtmp);
} else {
chosenSAs.add(tgtSpells.get(multi));
}
}
chosenSA.setActivatingPlayer(controller);
for (int i = 0; i < amount; i++) {
AllZone.getCardFactory().copySpellontoStack(card, chosenSA.getSourceCard(), chosenSA, true);
for (final SpellAbility chosenSAcopy : chosenSAs) {
chosenSAcopy.setActivatingPlayer(controller);
for (int i = 0; i < amount; i++) {
AllZone.getCardFactory().copySpellontoStack(card, chosenSAcopy.getSourceCard(), chosenSAcopy, true);
}
}
}
else {
SpellAbility chosenSA = null;
if (tgtSpells.size() == 1) {
chosenSA = tgtSpells.get(0);
} else if (sa.getActivatingPlayer().isHuman()) {
chosenSA = (SpellAbility) GuiUtils.chooseOne("Select a spell to copy", tgtSpells.toArray());
} else {
chosenSA = tgtSpells.get(0);
}
chosenSA.setActivatingPlayer(controller);
for (int i = 0; i < amount; i++) {
AllZone.getCardFactory().copySpellontoStack(card, chosenSA.getSourceCard(), chosenSA, true);
}
}
} // end resolve

View File

@@ -151,6 +151,7 @@ public class CardFactory implements CardFactoryInterface {
@Override
public final void copySpellontoStack(final Card source, final Card original, final SpellAbility sa,
final boolean bCopyDetails) {
Player originalController = original.getController();
Player controller = sa.getActivatingPlayer();
/*if (sa.getPayCosts() == null) {
this.copySpellontoStack(source, original, bCopyDetails);
@@ -191,6 +192,8 @@ public class CardFactory implements CardFactoryInterface {
} else if (copySA.canPlayAI()) {
ComputerUtil.playStackFree(copySA);
}
c.addController(originalController);
}
/**