Merge pull request #956 from kevlahnota/master

Manifest Cards & corrections
This commit is contained in:
Anthony Calosa
2017-03-09 09:07:45 +08:00
committed by GitHub
14 changed files with 597 additions and 415 deletions
File diff suppressed because it is too large Load Diff
@@ -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}
+99
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 = ',');
+1
View File
@@ -101,6 +101,7 @@ public:
bool miracle;
bool hasCopiedToken;
bool isBestowed;
bool isFacedown;
int chooseacolor;
string chooseasubtype;
int coinSide;//1 = tails
+3 -3
View File
@@ -1395,11 +1395,11 @@ void ActionStack::Render()
//stack fill
renderer->FillRect(x0 - 7, y0+2, width + 17, height + 14, ARGB(225,5,5,5));
//top stack fill
renderer->FillRect(x0 - 6, y0+37, width + 15, 40.5f, ARGB(60,135,206,235));
renderer->FillRect(x0 - 6, y0+37, width + 15, 40.5f, ARGB(20,135,206,235));
//stack highlight
renderer->FillRect(x0 - 6, y0+3, width + 15, 30, ARGB(255,89,89,89));
renderer->FillRect(x0 - 6, y0+3, width + 15, 31.f, ARGB(255,89,89,89));
//another border
renderer->DrawRect(x0 - 6, y0+33, width + 15, height - 18, ARGB(255,89,89,89));
renderer->DrawRect(x0 - 6, y0+34.5f, width + 15, height - 19.5f, ARGB(255,89,89,89));
//stack border
renderer->DrawRect(x0 - 7, y0+2, width + 17, height + 14, ARGB(255,240,240,240));
+17
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);
}
+3
View File
@@ -315,6 +315,7 @@ void Credits::compute(GameObserver* g, GameApp * _app)
}
playerdata->credits += value;
GameApp::mycredits = playerdata->credits;
PriceList::updateKey();
playerdata->taskList->passOneDay();
if (playerdata->taskList->getTaskCount() < 6)
@@ -464,6 +465,7 @@ void Credits::computeTournament(GameObserver* g, GameApp * _app,bool tournament,
}
playerdata->credits += value;
GameApp::mycredits = playerdata->credits;
PriceList::updateKey();
playerdata->taskList->passOneDay();
if (playerdata->taskList->getTaskCount() < 6)
@@ -675,6 +677,7 @@ int Credits::addCreditBonus(int value)
{
PlayerData * playerdata = NEW PlayerData();
playerdata->credits += value;
GameApp::mycredits = playerdata->credits;
playerdata->save();
SAFE_DELETE(playerdata);
return value;
+1
View File
@@ -1711,6 +1711,7 @@ void GameStateDeckViewer::ButtonPressed(int controllerId, int controlId)
int rnd = (rand() % 25);
int price = pricelist->getSellPrice(card);
playerdata->credits += price;
GameApp::mycredits = playerdata->credits;
price = price - (rnd * price) / 100;
pricelist->setPrice(card->getMTGId(), price);
playerdata->collection->remove(card->getMTGId());
+4 -2
View File
@@ -841,17 +841,19 @@ void GameStateMenu::Render()
renderer->RenderQuad(mBg.get(), SCREEN_WIDTH_F/2, 2, 0, 256 / mBg->mWidth, 166 / mBg->mHeight);
RenderTopMenu();
//credits on lower left if available
std::ostringstream streamC;
streamC << "Credits: " << GameApp::mycredits;
mFont = WResourceManager::Instance()->GetWFont(Fonts::MAIN_FONT);
mFont->SetScale(1.f);
mFont->SetColor(ARGB(200,248,248,255));
mFont->SetScale(0.9f);
mFont->SetColor(ARGB(150,248,248,255));
mFont->DrawString(streamC.str(), 12, SCREEN_HEIGHT - 16);
mFont->SetColor(ARGB(255,255,255,255));
mFont->SetScale(DEFAULT_MAIN_FONT_SCALE);
mFont = WResourceManager::Instance()->GetWFont(Fonts::MENU_FONT);
//end
}
if (subMenuController)
{
+8
View File
@@ -277,6 +277,7 @@ void GameStateShop::purchaseCard(int controlId)
int price = mPrices[controlId];
pricelist->setPrice(c->getMTGId(), price); // In case they changed their minds after cancelling.
playerdata->credits -= price;
GameApp::mycredits = playerdata->credits;
//Update prices
int rnd;
switch (options[Options::ECON_DIFFICULTY].number)
@@ -304,6 +305,7 @@ void GameStateShop::purchaseBooster(int controlId)
if (playerdata->credits - mPrices[controlId] < 0)
return;
playerdata->credits -= mPrices[controlId];
GameApp::mycredits = playerdata->credits;
mInventory[controlId]--;
SAFE_DELETE(booster);
deleteDisplay();
@@ -819,7 +821,10 @@ void GameStateShop::ButtonPressed(int controllerId, int controlId)
if (sel > -1 && sel < SHOP_ITEMS)
{
if (controlId == -2)
{
playerdata->credits += mPrices[sel]; //We stole it.
GameApp::mycredits = playerdata->credits;
}
if (sel < BOOSTER_SLOTS) //Clicked a booster.
purchaseBooster(sel);
else
@@ -860,7 +865,10 @@ void GameStateShop::ButtonPressed(int controllerId, int controlId)
beginFilters();
break;
case -2:
{
playerdata->credits += 2000;
GameApp::mycredits = playerdata->credits;
}
default:
mStage = STAGE_SHOP_SHOP;
}
+2 -2
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;
}
+30
View File
@@ -673,6 +673,12 @@ int AbilityFactory::parseCastRestrictions(MTGCardInstance * card, Player * playe
if(player->game->inPlay->hasName(card->name))
return 0;
}
check = restriction[i].find("before attackers");
if(check != string::npos)
{
if(cPhase > MTG_PHASE_COMBATBEGIN)
return 0;
}
check = restriction[i].find("before battle damage");
if(check != string::npos)
{
@@ -2889,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)
@@ -4013,6 +4034,15 @@ 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);
+1
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;
+11 -1
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
{