- Added support for mandatory targeting in AF Play.

This commit is contained in:
Sloth
2012-02-22 09:20:44 +00:00
parent 34453c981a
commit ccf0ba63d7
3 changed files with 12 additions and 10 deletions

View File

@@ -5,13 +5,11 @@ Text:no text
K:Players can't draw cards. K:Players can't draw cards.
T:Mode$ Phase | Phase$ Draw | ValidPlayer$ You | Execute$ TrigOmenExileCardYou | TriggerZones$ Battlefield | TriggerDescription$ At the beginning of each player's draw step, that player exiles the top card of his or her library. If it's a land card, the player puts it onto the battlefield. Otherwise, the player casts it without paying its mana cost if able. T:Mode$ Phase | Phase$ Draw | ValidPlayer$ You | Execute$ TrigOmenExileCardYou | TriggerZones$ Battlefield | TriggerDescription$ At the beginning of each player's draw step, that player exiles the top card of his or her library. If it's a land card, the player puts it onto the battlefield. Otherwise, the player casts it without paying its mana cost if able.
SVar:TrigOmenExileCardYou:AB$ Mill | Cost$ 0 | NumCards$ 1 | Defined$ You | Destination$ Exile | RememberMilled$ True | SubAbility$ DBOmenPlayYou SVar:TrigOmenExileCardYou:AB$ Mill | Cost$ 0 | NumCards$ 1 | Defined$ You | Destination$ Exile | RememberMilled$ True | SubAbility$ DBOmenPlayYou
SVar:DBOmenPlayYou:DB$ Play | ValidZone$ Exile | Controller$ TriggeredPlayer | Valid$ Remembered | WithoutManaCost$ True | SubAbility$ DBOmenCleanupYou SVar:DBOmenPlayYou:DB$ Play | ValidZone$ Exile | Controller$ TriggeredPlayer | Valid$ Remembered | WithoutManaCost$ True | SubAbility$ DBOmenCleanup
SVar:DBOmenCleanupYou:DB$ Cleanup | ClearRemembered$ True SVar:DBOmenCleanup:DB$ Cleanup | ClearRemembered$ True
T:Mode$ Phase | Phase$ Draw | ValidPlayer$ Opponent | Execute$ TrigOmenExileCardOpp | TriggerZones$ Battlefield | Secondary$ True | TriggerDescription$ At the beginning of each player's draw step, that player exiles the top card of his or her library. If it's a land card, the player puts it onto the battlefield. Otherwise, the player casts it without paying its mana cost if able. T:Mode$ Phase | Phase$ Draw | ValidPlayer$ Opponent | Execute$ TrigOmenExileCardOpp | TriggerZones$ Battlefield | Secondary$ True | TriggerDescription$ At the beginning of each player's draw step, that player exiles the top card of his or her library. If it's a land card, the player puts it onto the battlefield. Otherwise, the player casts it without paying its mana cost if able.
SVar:TrigOmenExileCardOpp:AB$ Mill | Cost$ 0 | NumCards$ 1 | Destination$ Exile | Defined$ Opponent | RememberMilled$ True | SubAbility$ DBOmenPlayOpp SVar:TrigOmenExileCardOpp:AB$ Mill | Cost$ 0 | NumCards$ 1 | Destination$ Exile | Defined$ Opponent | RememberMilled$ True | SubAbility$ DBOmenPlayOpp
SVar:DBOmenPlayOpp:DB$ Play | ValidZone$ Exile | Controller$ TriggeredPlayer | Valid$ Remembered | WithoutManaCost$ True | SubAbility$ DBOmenCleanupOpp SVar:DBOmenPlayOpp:DB$ Play | ValidZone$ Exile | Controller$ TriggeredPlayer | Valid$ Remembered | WithoutManaCost$ True | SubAbility$ DBOmenCleanup
SVar:DBOmenCleanupOpp:DB$ Cleanup | ClearRemembered$ True
SVar:RemAIDeck:True
SVar:RemRandomDeck:True SVar:RemRandomDeck:True
SVar:Rarity:Rare SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/omen_machine.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/omen_machine.jpg

View File

@@ -364,9 +364,9 @@ public final class AbilityFactoryPlay {
tgtCards = tgtCards.filter(new CardListFilter() { tgtCards = tgtCards.filter(new CardListFilter() {
@Override @Override
public boolean addCard(final Card c) { public boolean addCard(final Card c) {
ArrayList<SpellAbility> SpellAbilities = c.getBasicSpells(); ArrayList<SpellAbility> spellAbilities = c.getBasicSpells();
ArrayList<SpellAbility> sas = new ArrayList<SpellAbility>(); ArrayList<SpellAbility> sas = new ArrayList<SpellAbility>();
for (SpellAbility s : SpellAbilities) { for (SpellAbility s : spellAbilities) {
Spell spell = (Spell) s; Spell spell = (Spell) s;
s.setActivatingPlayer(controller); s.setActivatingPlayer(controller);
SpellAbilityRestriction res = s.getRestrictions(); SpellAbilityRestriction res = s.getRestrictions();
@@ -397,9 +397,9 @@ public final class AbilityFactoryPlay {
} }
// get basic spells (no flashback, etc.) // get basic spells (no flashback, etc.)
ArrayList<SpellAbility> SpellAbilities = tgtCard.getBasicSpells(); ArrayList<SpellAbility> spellAbilities = tgtCard.getBasicSpells();
ArrayList<SpellAbility> sas = new ArrayList<SpellAbility>(); ArrayList<SpellAbility> sas = new ArrayList<SpellAbility>();
for (SpellAbility s : SpellAbilities) { for (SpellAbility s : spellAbilities) {
s.setActivatingPlayer(controller); s.setActivatingPlayer(controller);
SpellAbilityRestriction res = s.getRestrictions(); SpellAbilityRestriction res = s.getRestrictions();
// timing restrictions still apply // timing restrictions still apply
@@ -420,6 +420,10 @@ public final class AbilityFactoryPlay {
tgtSA = sas.get(0); tgtSA = sas.get(0);
} }
if (tgtSA.getTarget() != null && !params.containsKey("Optional")) {
tgtSA.getTarget().setMandatory(true);
}
if (params.containsKey("WithoutManaCost")) { if (params.containsKey("WithoutManaCost")) {
if (controller.isHuman()) { if (controller.isHuman()) {
final SpellAbility newSA = tgtSA.copy(); final SpellAbility newSA = tgtSA.copy();