manifest support

also fix guiplay
This commit is contained in:
Anthony Calosa
2017-03-09 07:44:06 +08:00
parent 01d46615a7
commit 53f0c2421d
9 changed files with 230 additions and 67 deletions

View File

@@ -37165,6 +37165,13 @@ power=1
toughness=3
[/card]
[card]
name=Ethereal Ambush
auto=manifest all(*[zpos<=2]|mylibrary)
text=Manifest the top two cards of your library. (To manifest a card, put it onto the battlefield face down as a 2/2 creature. Turn it face up any time for its mana cost if it's a creature card.)
mana={3}{G}{U}
type=Instant
[/card]
[card]
name=Ethereal Armor
target=creature
auto=first strike
@@ -40255,6 +40262,13 @@ mana={R}
type=Instant
[/card]
[card]
name=Fierce Invocation
auto=manifest and!( counter(1/1,2) )! all(*[zpos=1]|mylibrary)
text=Manifest the top card of your library, then put two +1/+1 counters on it. (To manifest a card, put it onto the battlefield face down as a 2/2 creature. Turn it face up any time for its mana cost if it's a creature card.)
mana={4}{R}
type=Sorcery
[/card]
[card]
name=Fiery Mantle
target=creature
autograveyard=@movedTo(this|graveyard) from(battlefield):moveTo(ownerhand)
@@ -42887,6 +42901,13 @@ mana={4}{R}{R}{R}
type=Enchantment
[/card]
[card]
name=Formless Nurturing
auto=manifest and!( counter(1/1,1) )! all(*[zpos=1]|mylibrary)
text=Manifest the top card of your library, then put a +1/+1 counter on it. (To manifest a card, put it onto the battlefield face down as a 2/2 creature. Turn it face up any time for its mana cost if it's a creature card.)
mana={3}{G}
type=Sorcery
[/card]
[card]
name=Forsaken City
abilities=doesnotuntap
auto={0}:untap all(this) && moveto(exile) target(*|myHand) limit:1 myUpkeepOnly
@@ -71802,6 +71823,14 @@ power=3
toughness=2
[/card]
[card]
name=Mastery of the Unseen
auto=@facedup(*|mybattlefield):life:type:creature:battlefield controller
auto={3}{W}:manifest all(*[zpos=1]|mylibrary)
text=Whenever a permanent you control is turned face up, you gain 1 life for each creature you control. -- {3}{W}: Manifest the top card of your library. (Put it onto the battlefield face down as a 2/2 creature. Turn it face up any time for its mana cost if it's a creature card.)
mana={1}{W}
type=Enchantment
[/card]
[card]
name=Master's Call
auto=token(Myr,Artifact Creature Myr,1/1)*2
text=Put two 1/1 colorless Myr artifact creature tokens onto the battlefield.
@@ -90154,6 +90183,16 @@ power=5
toughness=5
[/card]
[card]
name=Qarsi High Priest
auto={1}{B}{T}{S(other creature|mybattlefield)}:manifest all(*[zpos=1]|mylibrary)
text={1}{B}, {T}, Sacrifice another creature: Manifest the top card of your library. (Put that card onto the battlefield face down as a 2/2 creature. Turn it face up any time for its mana cost if it's a creature card.)
mana={B}
type=Creature
subtype=Human Cleric
power=0
toughness=2
[/card]
[card]
name=Qarsi Sadist
auto=may name(Exploit) sacrifice notatarget(creature|mybattlefield) && transforms((,newability[target(opponent) life:-2],newability[life:2 controller])) forever
text=Exploit (When this creature enters the battlefield, you may sacrifice a creature.) -- When Qarsi Sadist exploits a creature, target opponent loses 2 life and you gain 2 life.
@@ -109695,6 +109734,13 @@ mana={B}
type=Enchantment
[/card]
[card]
name=Soul Summons
auto=manifest all(*[zpos=1]|mylibrary)
text=Manifest the top card of your library. (Put it onto the battlefield face down as a 2/2 creature. Turn it face up any time for its mana cost if it's a creature card.)
mana={1}{W}
type=Sorcery
[/card]
[card]
name=Soul Swallower
abilities=trample
auto=@each my upkeep restriction{delirium}:counter(1/1,3)
@@ -115190,6 +115236,16 @@ mana={B}{G}{U}
type=Instant
[/card]
[card]
name=Sultai Emissary
auto=@movedTo(this|graveyard) from(battlefield):manifest all(*[zpos=1]|mylibrary)
text=When Sultai Emissary dies, manifest the top card of your library. (Put that card onto the battlefield face down as a 2/2 creature. Turn it face up any time for its mana cost if it's a creature card.)
mana={1}{B}
type=Creature
subtype=Zombie Warrior
power=1
toughness=1
[/card]
[card]
name=Sultai Flayer
auto=@movedTo(creature[toughness>=4]|graveyard) from(myBattlefield):life:4 controller
text=Whenever a creature you control with toughness 4 or greater dies, you gain 4 life.
@@ -118782,6 +118838,17 @@ power=4
toughness=3
[/card]
[card]
name=Temur War Shaman
auto=manifest all(*[zpos=1]|mylibrary)
auto=@facedup(creature|mybattlefield):may name(fight) all(trigger[to]) transforms((,newability[target(creature|opponentbattlefield) dynamicability<!powerstrike eachother!>])) ueot
text=When Temur War Shaman enters the battlefield, manifest the top card of your library. (Put that card onto the battlefield face down as a 2/2 creature. Turn it face up any time for its mana cost if it's a creature card.) -- Whenever a permanent you control is turned face up, if it's a creature, you may have it fight target creature you don't control.
mana={4}{G}{G}
type=Creature
subtype=Human Shaman
power=4
toughness=5
[/card]
[card]
name=Tenacious Dead
autograveyard=@movedto(this|mygraveyard) from(mybattlefield):all(trigger) transforms((,newability[name(Pay 1B) pay[[{1}{B}]] name(pay 1B mana) moveto(ownerbattlefield} && tap?name(cancel) donothing])) oneshot
text=When Tenacious Dead dies, you may pay {1}{B}. If you do, return it to the battlefield tapped under its owner's control.
@@ -133775,6 +133842,13 @@ power=5
toughness=5
[/card]
[card]
name=Wildcall
auto=manifest and!( counter(1/1,x) )! all(*[zpos=1]|mylibrary)
text=Manifest the top card of your library, then put X +1/+1 counters on it. (To manifest a card, put it onto the battlefield face down as a 2/2 creature. Turn it face up any time for its mana cost if it's a creature card.)
mana={X}{G}{G}
type=Sorcery
[/card]
[card]
name=Wilderness Elemental
abilities=trample
anyzone=type:land[-basic]:opponentbattlefield/3 cdaactive

View File

@@ -4553,12 +4553,6 @@ power=6
toughness=6
[/card]
[card]
name=Ethereal Ambush
text=Manifest the top two cards of your library. (To manifest a card, put it onto the battlefield face down as a 2/2 creature. Turn it face up any time for its mana cost if it's a creature card.)
mana={3}{G}{U}
type=Instant
[/card]
[card]
name=Eureka
text=Starting with you, each player may put a permanent card from his or her hand onto the battlefield. Repeat this process until no one puts a card onto the battlefield.
mana={2}{G}{G}
@@ -4933,12 +4927,6 @@ power=3
toughness=3
[/card]
[card]
name=Fierce Invocation
text=Manifest the top card of your library, then put two +1/+1 counters on it. (To manifest a card, put it onto the battlefield face down as a 2/2 creature. Turn it face up any time for its mana cost if it's a creature card.)
mana={4}{R}
type=Sorcery
[/card]
[card]
name=Fiery Bombardment
text=Chroma — {2}, Sacrifice a creature: Fiery Bombardment deals damage to target creature or player equal to the number of red mana symbols in the sacrificed creature's mana cost.
mana={1}{R}
@@ -5285,12 +5273,6 @@ mana={3}{R}
type=Sorcery
[/card]
[card]
name=Formless Nurturing
text=Manifest the top card of your library, then put a +1/+1 counter on it. (To manifest a card, put it onto the battlefield face down as a 2/2 creature. Turn it face up any time for its mana cost if it's a creature card.)
mana={3}{G}
type=Sorcery
[/card]
[card]
name=Fortified Area
text=Wall creatures you control get +1/+0 and have banding. (Any creatures with banding, and up to one without, can attack in a band. Bands are blocked as a group. If any creatures with banding you control are blocking or being blocked by a creature, you divide that creature's combat damage, not its controller, among any of the creatures it's being blocked by or is blocking.)
mana={1}{W}{W}
@@ -9347,12 +9329,6 @@ type=Artifact
subtype=Equipment
[/card]
[card]
name=Mastery of the Unseen
text=Whenever a permanent you control is turned face up, you gain 1 life for each creature you control. -- {3}{W}: Manifest the top card of your library. (Put it onto the battlefield face down as a 2/2 creature. Turn it face up any time for its mana cost if it's a creature card.)
mana={1}{W}
type=Enchantment
[/card]
[card]
name=Matsu-Tribe Decoy
text={2}{G}: Target creature blocks Matsu-Tribe Decoy this turn if able. -- Whenever Matsu-Tribe Decoy deals combat damage to a creature, tap that creature and it doesn't untap during its controller's next untap step.
mana={2}{G}
@@ -12093,15 +12069,6 @@ power=0
toughness=4
[/card]
[card]
name=Qarsi High Priest
text={1}{B}, {T}, Sacrifice another creature: Manifest the top card of your library. (Put that card onto the battlefield face down as a 2/2 creature. Turn it face up any time for its mana cost if it's a creature card.)
mana={B}
type=Creature
subtype=Human Cleric
power=0
toughness=2
[/card]
[card]
name=Qasali Ambusher
text=Reach -- If a creature is attacking you and you control a Forest and a Plains, you may cast Qasali Ambusher without paying its mana cost and as though it had flash.
mana={1}{G}{W}
@@ -14734,12 +14701,6 @@ mana={X}{B}
type=Sorcery
[/card]
[card]
name=Soul Summons
text=Manifest the top card of your library. (Put it onto the battlefield face down as a 2/2 creature. Turn it face up any time for its mana cost if it's a creature card.)
mana={1}{W}
type=Sorcery
[/card]
[card]
name=Soulfire Grand Master
text=Lifelink -- Instant and sorcery spells you control have lifelink. -- {2}{UR}{UR}: The next time you cast an instant or sorcery spell from your hand this turn, put that card into your hand instead of into your graveyard as it resolves.
mana={1}{W}
@@ -15557,15 +15518,6 @@ mana={3}{R}
type=Enchantment
[/card]
[card]
name=Sultai Emissary
text=When Sultai Emissary dies, manifest the top card of your library. (Put that card onto the battlefield face down as a 2/2 creature. Turn it face up any time for its mana cost if it's a creature card.)
mana={1}{B}
type=Creature
subtype=Zombie Warrior
power=1
toughness=1
[/card]
[card]
name=Summary Dismissal
text=Exile all other spells and counter all abilities.
mana={2}{U}{U}
@@ -16017,15 +15969,6 @@ power=3
toughness=1
[/card]
[card]
name=Temur War Shaman
text=When Temur War Shaman enters the battlefield, manifest the top card of your library. (Put that card onto the battlefield face down as a 2/2 creature. Turn it face up any time for its mana cost if it's a creature card.) -- Whenever a permanent you control is turned face up, if it's a creature, you may have it fight target creature you don't control.
mana={4}{G}{G}
type=Creature
subtype=Human Shaman
power=4
toughness=5
[/card]
[card]
name=Teremko Griffin
text=Flying; banding (Any creatures with banding, and up to one without, can attack in a band. Bands are blocked as a group. If any creatures with banding you control are blocking or being blocked by a creature, you divide that creature's combat damage, not its controller, among any of the creatures it's being blocked by or is blocking.)
mana={3}{W}
@@ -17822,12 +17765,6 @@ mana={3}{R}
type=Sorcery
[/card]
[card]
name=Wildcall
text=Manifest the top card of your library, then put X +1/+1 counters on it. (To manifest a card, put it onto the battlefield face down as a 2/2 creature. Turn it face up any time for its mana cost if it's a creature card.)
mana={X}{G}{G}
type=Sorcery
[/card]
[card]
name=Willbender
text=Morph {1}{U} (You may cast this card face down as a 2/2 creature for {3}. Turn it face up any time for its morph cost.) -- When Willbender is turned face up, change the target of target spell or ability with a single target.
mana={1}{U}

View File

@@ -4748,6 +4748,7 @@ class AAMorph: public ActivatedAbility
{
public:
vector<MTGAbility *> currentAbilities;
bool face;
AAMorph(GameObserver* observer, int id, MTGCardInstance * card, MTGCardInstance * _target, ManaCost * _cost = NULL);
int resolve();
int testDestroy();
@@ -7067,6 +7068,104 @@ public:
~GenericPaidAbility();
};
//--------manifest
class AManifest: public InstantAbility
{
public:
MTGAbility * andAbility;
AManifest(GameObserver* observer, int _id, MTGCardInstance * _source, MTGCardInstance * _target) :
InstantAbility(observer, _id, _source)
{
target = _target;
andAbility = NULL;
}
int resolve()
{
MTGCardInstance * card = (MTGCardInstance *) target;
if (card)
{
bool isCreature = card->isCreature();
string mt = card->magicTexts["facedown"];
card->morphed = true;
card->isMorphed = true;
MTGCardInstance * copy = card->controller()->game->putInZone(card, card->currentZone, card->controller()->game->battlefield);
copy->getManaCost()->resetCosts();
copy->setColor(0,1);
copy->types.clear();
string cre = "Creature";
copy->setType(cre.c_str());
copy->basicAbilities.reset();
copy->name = "Morph";
copy->morphed = true;
copy->isMorphed = true;
copy->setPower(2);
copy->setToughness(2);
copy->isFacedown = true;
AbilityFactory af(game);
MTGAbility * aam = af.parseMagicLine("{mycost}:manafaceup", GetId(), NULL, copy);
if(aam && isCreature)
{
aam->target = copy;
if(aam->oneShot)
{
aam->resolve();
SAFE_DELETE(aam);
}
else
{
aam->addToGame();
}
}
if(mt.size())
{
MTGAbility * fd = af.parseMagicLine(mt, GetId(), NULL, copy);
if(fd && isCreature)
{
fd->target = copy;
if(fd->oneShot)
{
fd->resolve();
SAFE_DELETE(fd);
}
else
{
fd->addToGame();
}
}
}
if(andAbility)
{
MTGAbility * andAbilityClone = andAbility->clone();
andAbilityClone->target = copy;
if(andAbility->oneShot)
{
andAbilityClone->resolve();
SAFE_DELETE(andAbilityClone);
}
else
{
andAbilityClone->addToGame();
}
}
}
return 1;
}
const string getMenuText()
{
return "Manifest";
}
virtual ostream& toString(ostream& out) const
{
out << "AAManifest ::: (";
return InstantAbility::toString(out) << ")";
}
AManifest * clone() const
{
return NEW AManifest(*this);
}
};
//------------------
// utility functions
void PopulateColorIndexVector(list<int>& colors, const string& colorsString, char delimiter = ',');

View File

@@ -101,6 +101,7 @@ public:
bool miracle;
bool hasCopiedToken;
bool isBestowed;
bool isFacedown;
int chooseacolor;
string chooseasubtype;
int coinSide;//1 = tails

View File

@@ -3243,6 +3243,7 @@ AAMorph::AAMorph(GameObserver* observer, int id, MTGCardInstance * card, MTGCard
ActivatedAbility(observer, id, card, _cost, restrictions)
{
target = _target;
face = false;
}
int AAMorph::resolve()
@@ -3288,6 +3289,7 @@ int AAMorph::resolve()
}
}
}
_target->isFacedown = false;
WEvent * e = NEW WEventCardFaceUp(_target);
game->receiveEvent(e);
currentAbilities.clear();
@@ -3312,6 +3314,16 @@ int AAMorph::testDestroy()
const string AAMorph::getMenuText()
{
if(face && target)
{
MTGCardInstance * _target = (MTGCardInstance *) target;
if(_target && _target->model)
{
std::ostringstream abname;
abname << "Face Up " << _target->model->data->getManaCost()->toString();
return abname.str();
}
}
return "Morph";
}
@@ -3544,6 +3556,11 @@ int AAFlip::resolve()
_target->mPropertiesChangedSinceLastUpdate = true;
if(!isflipcard)
{
if(_target->isFacedown)
_target->isFacedown = false;
else
_target->isFacedown = true;
WEvent * e = NEW WEventCardTransforms(_target);
game->receiveEvent(e);
}

View File

@@ -447,12 +447,12 @@ int GuiPlay::receiveEventPlus(WEvent * e)
Replace();
else if (dynamic_cast<WEventCardControllerChange*> (e))
Replace();
else if (dynamic_cast<WEventCardTransforms*> (e))
/*else if (dynamic_cast<WEventCardTransforms*> (e))
Replace();
else if (dynamic_cast<WEventCardCopiedACard*> (e))
Replace();
else if (dynamic_cast<WEventCardFaceUp*> (e))
Replace();
Replace();*/
Replace();
return 0;
}

View File

@@ -2895,6 +2895,21 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
return a;
}
//manifest
found = s.find("manifest");
if (found != string::npos)
{
MTGAbility * a = NEW AManifest(observer, id, card, target);
a->oneShot = 1;
if(storedAndAbility.size())
{
string stored = storedAndAbility;
storedAndAbility.clear();
((AManifest*)a)->andAbility = parseMagicLine(stored, id, spell, card);
}
return a;
}
//clone
found = s.find("clone");
if (found != string::npos)
@@ -4019,7 +4034,16 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
a->oneShot = 1;
return a;
}
//morph
found = s.find("manafaceup");
if (found != string::npos)
{
MTGAbility * a = NEW AAMorph(observer, id, card, target);
a->oneShot = 1;
((AAMorph*)a)->face = true;
return a;
}
//identify what a leveler creature will max out at.
vector<string> splitMaxlevel = parseBetween(s, "maxlevel:", " ", false);
if (splitMaxlevel.size())

View File

@@ -246,6 +246,7 @@ void MTGCardInstance::initMTGCI()
isDualWielding = false;
suspended = false;
isBestowed = false;
isFacedown = false;
castMethod = Constants::NOT_CAST;
mPropertiesChangedSinceLastUpdate = false;
stillNeeded = true;

View File

@@ -217,7 +217,17 @@ ManaCost * ManaCost::parseManaCost(string s, ManaCost * _manaCost, MTGCardInstan
}
break;
case 'm': //Mill yourself as a cost
manaCost->addExtraCost(NEW MillCost(tc));
{
if (value == "mycost")
{
if(c && c->model)
manaCost->add(c->model->data->getManaCost());
else
break;
}
else
manaCost->addExtraCost(NEW MillCost(tc));
}
break;
case 'n': //return unblocked attacker cost
{