mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-15 10:18:01 +00:00
- Hopefully the final fix for Nomad Mythmaker
This commit is contained in:
@@ -3,9 +3,7 @@ ManaCost:2 W
|
||||
Types:Creature Human Nomad Cleric
|
||||
Text:no text
|
||||
PT:2/2
|
||||
A:AB$ ChooseCard | Cost$ W T | Defined$ You | Amount$ 1 | Choices$ Creature.YouCtrl | RememberChosen$ True | SubAbility$ MakeMyth | AILogic$ AtLeast1 | SpellDescription$ Put target Aura card from a graveyard onto the battlefield under your control attached to a creature you control.
|
||||
SVar:MakeMyth:DB$ ChangeZone | Origin$ Graveyard | Destination$ Battlefield | ValidTgts$ Aura | AttachedTo$ Remembered | GainControl$ True | SubAbility$ DBCleanup
|
||||
SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True
|
||||
A:AB$ ChangeZone | Cost$ W T | Origin$ Graveyard | Destination$ Battlefield | ValidTgts$ Aura | GainControl$ True | AttachedTo$ Creature.CanBeEnchantedBySource+YouCtrl | SpellDescription$ Put target Aura card from a graveyard onto the battlefield under your control attached to a creature you control.
|
||||
SVar:Rarity:Rare
|
||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/nomad_mythmaker.jpg
|
||||
SetInfo:JUD|Rare|http://magiccards.info/scans/en/ju/15.jpg
|
||||
|
||||
@@ -6541,6 +6541,10 @@ public class Card extends GameEntity implements Comparable<Card> {
|
||||
if (!source.canBeEnchantedBy(this)) {
|
||||
return false;
|
||||
}
|
||||
} else if (property.startsWith("CanBeEnchantedBySource")) {
|
||||
if (!this.canBeEnchantedBy(source)) {
|
||||
return false;
|
||||
}
|
||||
} else if (property.startsWith("EquippedBy")) {
|
||||
if (!this.equippedBy.contains(source)) {
|
||||
return false;
|
||||
|
||||
@@ -1226,13 +1226,17 @@ public class ChangeZoneAi extends SpellAiLogic {
|
||||
}
|
||||
|
||||
if (sa.hasParam("AttachedTo")) {
|
||||
final ArrayList<Card> list = AbilityFactory.getDefinedCards(sa.getSourceCard(),
|
||||
List<Card> list = AbilityFactory.getDefinedCards(sa.getSourceCard(),
|
||||
sa.getParam("AttachedTo"), sa);
|
||||
if (list.isEmpty()) {
|
||||
list = Singletons.getModel().getGame().getCardsIn(ZoneType.Battlefield);
|
||||
list = CardLists.getValidCards(list, sa.getParam("AttachedTo"), c.getController(), c);
|
||||
}
|
||||
if (!list.isEmpty()) {
|
||||
final Card attachedTo = list.get(0);
|
||||
final Card attachedTo = CardFactoryUtil.getBestAI(list);
|
||||
if (c.isEnchanting()) {
|
||||
// If this Card is already Enchanting something
|
||||
// Need to unenchant it, then clear out the commands
|
||||
// If this Card is already Enchanting something, need
|
||||
// to unenchant it, then clear out the commands
|
||||
final GameEntity oldEnchanted = c.getEnchanting();
|
||||
c.removeEnchanting(oldEnchanted);
|
||||
c.clearEnchantCommand();
|
||||
|
||||
@@ -15,6 +15,7 @@ import forge.Singletons;
|
||||
import forge.card.abilityfactory.AbilityFactory;
|
||||
import forge.card.abilityfactory.SpellEffect;
|
||||
import forge.card.abilityfactory.ai.ChangeZoneAi;
|
||||
import forge.card.cardfactory.CardFactoryUtil;
|
||||
import forge.card.spellability.AbilitySub;
|
||||
import forge.card.spellability.SpellAbility;
|
||||
import forge.card.spellability.SpellAbilityStackInstance;
|
||||
@@ -413,15 +414,26 @@ public class ChangeZoneEffect extends SpellEffect {
|
||||
tgtC.addController(sa.getSourceCard());
|
||||
}
|
||||
if (sa.hasParam("AttachedTo")) {
|
||||
final ArrayList<Card> list = AbilityFactory.getDefinedCards(sa.getSourceCard(),
|
||||
List<Card> list = AbilityFactory.getDefinedCards(sa.getSourceCard(),
|
||||
sa.getParam("AttachedTo"), sa);
|
||||
if (list.isEmpty()) {
|
||||
list = Singletons.getModel().getGame().getCardsIn(ZoneType.Battlefield);
|
||||
list = CardLists.getValidCards(list, sa.getParam("AttachedTo"), tgtC.getController(), tgtC);
|
||||
}
|
||||
if (!list.isEmpty()) {
|
||||
final Card attachedTo = list.get(0);
|
||||
Card attachedTo = null;
|
||||
if (player.isHuman()) {
|
||||
if (list.size() > 1) {
|
||||
attachedTo = GuiChoose.one(tgtC + " - Select a card to attach to.", list);
|
||||
} else {
|
||||
attachedTo = list.get(0);
|
||||
}
|
||||
} else { // AI player
|
||||
attachedTo = CardFactoryUtil.getBestAI(list);
|
||||
}
|
||||
if (tgtC.isEnchanting()) {
|
||||
// If this Card is already Enchanting
|
||||
// something
|
||||
// Need to unenchant it, then clear out the
|
||||
// commands
|
||||
// If this Card is already Enchanting something, need
|
||||
// to unenchant it, then clear out the commands
|
||||
final GameEntity oldEnchanted = tgtC.getEnchanting();
|
||||
tgtC.removeEnchanting(oldEnchanted);
|
||||
tgtC.clearEnchantCommand();
|
||||
@@ -666,16 +678,23 @@ public class ChangeZoneEffect extends SpellEffect {
|
||||
}
|
||||
|
||||
if (sa.hasParam("AttachedTo")) {
|
||||
final ArrayList<Card> list = AbilityFactory.getDefinedCards(sa.getSourceCard(),
|
||||
List<Card> list = AbilityFactory.getDefinedCards(sa.getSourceCard(),
|
||||
sa.getParam("AttachedTo"), sa);
|
||||
if (list.isEmpty()) {
|
||||
list = Singletons.getModel().getGame().getCardsIn(ZoneType.Battlefield);
|
||||
list = CardLists.getValidCards(list, sa.getParam("AttachedTo"), c.getController(), c);
|
||||
}
|
||||
if (!list.isEmpty()) {
|
||||
final Card attachedTo = list.get(0);
|
||||
Card attachedTo = null;
|
||||
if (list.size() > 1) {
|
||||
attachedTo = GuiChoose.one(c + " - Select a card to attach to.", list);
|
||||
} else {
|
||||
attachedTo = list.get(0);
|
||||
}
|
||||
if (c.isEnchanting()) {
|
||||
// If this Card is already Enchanting something
|
||||
// Need to unenchant it, then clear out the
|
||||
// commands
|
||||
// If this Card is already Enchanting something, need
|
||||
// to unenchant it, then clear out the commands
|
||||
final GameEntity oldEnchanted = c.getEnchanting();
|
||||
oldEnchanted.removeEnchantedBy(c);
|
||||
c.removeEnchanting(oldEnchanted);
|
||||
c.clearEnchantCommand();
|
||||
c.clearUnEnchantCommand();
|
||||
|
||||
Reference in New Issue
Block a user