mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-16 18:58:00 +00:00
- Convert Bazaar of Wonders to script
This commit is contained in:
@@ -1,9 +1,13 @@
|
|||||||
Name:Bazaar of Wonders
|
Name:Bazaar of Wonders
|
||||||
ManaCost:3 U U
|
ManaCost:3 U U
|
||||||
Types:World Enchantment
|
Types:World Enchantment
|
||||||
Text:Whenever a player casts a spell, counter it if a card with the same name is in a graveyard or a nontoken permanent with the same name is on the battlefield.
|
|
||||||
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ ExileAll | TriggerDescription$ When CARDNAME enters the battlefield, exile all cards from all graveyards.
|
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ ExileAll | TriggerDescription$ When CARDNAME enters the battlefield, exile all cards from all graveyards.
|
||||||
SVar:ExileAll:AB$ ChangeZoneAll | Cost$ 0 | Origin$ Graveyard | Destination$ Exile | ChangeType$ Card
|
SVar:ExileAll:AB$ ChangeZoneAll | Cost$ 0 | Origin$ Graveyard | Destination$ Exile | ChangeType$ Card
|
||||||
|
T:Mode$ SpellCast | ValidCard$ Card | Execute$ TrigCounterSameGrave | TriggerZones$ Battlefield | TriggerDescription$ Whenever a player casts a spell, counter it if a card with the same name is in a graveyard or a nontoken permanent with the same name is on the battlefield.
|
||||||
|
SVar:TrigCounterSameGrave:DB$ Counter | Defined$ TriggeredSpellAbility | SubAbility$ DBCounterSamePermanent | ConditionCheckSVar$ SharesNameGrave | ConditionSVarCompare$ GE1
|
||||||
|
SVar:DBCounterSamePermanent:DB$ Counter | Defined$ TriggeredSpellAbility | ConditionCheckSVar$ SharesNameBattlefield | ConditionSVarCompare$ GE1
|
||||||
|
SVar:SharesNameGrave:TriggeredCard$Valid Card.sharesNameWith Graveyard
|
||||||
|
SVar:SharesNameBattlefield:TriggeredCard$Valid Card.sharesNameWith NonToken
|
||||||
SVar:RemRandomDeck:True
|
SVar:RemRandomDeck:True
|
||||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/bazaar_of_wonders.jpg
|
SVar:Picture:http://www.wizards.com/global/images/magic/general/bazaar_of_wonders.jpg
|
||||||
Oracle:When Bazaar of Wonders enters the battlefield, exile all cards from all graveyards.\nWhenever a player casts a spell, counter it if a card with the same name is in a graveyard or a nontoken permanent with the same name is on the battlefield.
|
Oracle:When Bazaar of Wonders enters the battlefield, exile all cards from all graveyards.\nWhenever a player casts a spell, counter it if a card with the same name is in a graveyard or a nontoken permanent with the same name is on the battlefield.
|
||||||
|
|||||||
@@ -6693,6 +6693,13 @@ public class Card extends GameEntity implements Comparable<Card> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
} else if (restriction.equals(ZoneType.Graveyard.toString())) {
|
||||||
|
for (final Card card : Singletons.getModel().getGame().getCardsIn(ZoneType.Graveyard)) {
|
||||||
|
if (this.getName().equals(card.getName())) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
} else if (restriction.equals(ZoneType.Battlefield.toString())) {
|
} else if (restriction.equals(ZoneType.Battlefield.toString())) {
|
||||||
for (final Card card : Singletons.getModel().getGame().getCardsIn(ZoneType.Battlefield)) {
|
for (final Card card : Singletons.getModel().getGame().getCardsIn(ZoneType.Battlefield)) {
|
||||||
if (this.getName().equals(card.getName())) {
|
if (this.getName().equals(card.getName())) {
|
||||||
|
|||||||
@@ -2119,7 +2119,7 @@ public class CardFactoryUtil {
|
|||||||
final String[] splitString = string.split("/", 2);
|
final String[] splitString = string.split("/", 2);
|
||||||
String valid = splitString[0].substring(6);
|
String valid = splitString[0].substring(6);
|
||||||
final List<Card> list = CardLists.getValidCards(paidList, valid, source.getController(), source);
|
final List<Card> list = CardLists.getValidCards(paidList, valid, source.getController(), source);
|
||||||
return CardFactoryUtil.doXMath(list.size(), splitString[1], source);
|
return CardFactoryUtil.doXMath(list.size(), splitString.length > 1 ? splitString[1] : null, source);
|
||||||
}
|
}
|
||||||
|
|
||||||
int tot = 0;
|
int tot = 0;
|
||||||
|
|||||||
@@ -516,43 +516,6 @@ public class MagicStack extends MyObservable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Whenever a player casts a spell, counter it if a card with the same
|
|
||||||
* name is in a graveyard or a nontoken permanent with the same name is
|
|
||||||
* on the battlefield.
|
|
||||||
*/
|
|
||||||
if (sp.isSpell() && game.isCardInPlay("Bazaar of Wonders")) {
|
|
||||||
boolean found = false;
|
|
||||||
List<Card> all = CardLists.filter(game.getCardsIn(ZoneType.Battlefield), Presets.NON_TOKEN);
|
|
||||||
final List<Card> graves = game.getCardsIn(ZoneType.Graveyard);
|
|
||||||
all.addAll(graves);
|
|
||||||
|
|
||||||
for (final Card c : all) {
|
|
||||||
if (sp.getSourceCard().getName().equals(c.getName())) {
|
|
||||||
found = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (found) {
|
|
||||||
final List<Card> bazaars = CardLists.filter(game.getCardsIn(ZoneType.Battlefield), CardPredicates.nameEquals("Bazaar of Wonders")); // should
|
|
||||||
// only
|
|
||||||
// be
|
|
||||||
// 1...
|
|
||||||
for (final Card bazaar : bazaars) {
|
|
||||||
final SpellAbility counter = new Ability(bazaar, ManaCost.ZERO) {
|
|
||||||
@Override
|
|
||||||
public void resolve() {
|
|
||||||
if (game.getStack().size() > 0) {
|
|
||||||
game.getStack().pop();
|
|
||||||
}
|
|
||||||
} // resolve()
|
|
||||||
}; // SpellAbility
|
|
||||||
counter.setStackDescription(bazaar.getName() + " - counter " + sp.getSourceCard().getName() + ".");
|
|
||||||
this.add(counter);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.getSimultaneousStackEntryList().size() > 0) {
|
if (this.getSimultaneousStackEntryList().size() > 0) {
|
||||||
game.getPhaseHandler().passPriority();
|
game.getPhaseHandler().passPriority();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -186,7 +186,7 @@ public enum VStack implements IVDoc<CStack> {
|
|||||||
parentCell.getBody().add(tar, "w 98%!");
|
parentCell.getBody().add(tar, "w 98%!");
|
||||||
stackTARs.add(tar);
|
stackTARs.add(tar);
|
||||||
|
|
||||||
if (stack.peekInstance(i).isOptionalTrigger()) {
|
if (spell != null && spell.isOptionalTrigger()) {
|
||||||
tar.addMouseListener(new MouseAdapter() {
|
tar.addMouseListener(new MouseAdapter() {
|
||||||
@Override
|
@Override
|
||||||
public void mousePressed(final MouseEvent e) {
|
public void mousePressed(final MouseEvent e) {
|
||||||
|
|||||||
Reference in New Issue
Block a user