From 6f4cf9e941b542a9aa147f363957809483b4694d Mon Sep 17 00:00:00 2001 From: Anthony Calosa Date: Sat, 7 Nov 2015 19:16:31 +0800 Subject: [PATCH] Aluren & Omniscience MayAbility + resolve instead of MenuAbility + addtogame for dredge??? --- projects/mtg/bin/Res/sets/primitives/mtg.txt | 15 +++++++ .../bin/Res/sets/primitives/unsupported.txt | 10 ++--- projects/mtg/include/MTGRules.h | 16 +++---- projects/mtg/src/MTGRules.cpp | 42 ++++++++++--------- 4 files changed, 50 insertions(+), 33 deletions(-) diff --git a/projects/mtg/bin/Res/sets/primitives/mtg.txt b/projects/mtg/bin/Res/sets/primitives/mtg.txt index bb577a278..31a52ec1f 100644 --- a/projects/mtg/bin/Res/sets/primitives/mtg.txt +++ b/projects/mtg/bin/Res/sets/primitives/mtg.txt @@ -2405,6 +2405,14 @@ mana={1}{B}{S(creature|mybattlefield)} type=Instant [/card] [card] +name=Aluren +auto=lord(creature[manacost<=3]|hand,exile,graveyard) zerocast forcedalive +auto=lord(creature[manacost<=3]|hand,exile,graveyard) spellmastery forcedalive +text=Any player may play creature cards with converted mana cost 3 or less without paying their mana cost and as though they had flash. +mana={2}{G}{G} +type=Enchantment +[/card] +[card] name=Amass the Components auto=draw:3 controller auto=bottomoflibrary notatarget(*|myhand) @@ -69047,6 +69055,13 @@ power=3 toughness=3 [/card] [card] +name=Omniscience +auto=lord(*[-land]|myhand) zerocast forcedalive +text=You may cast nonland cards from your hand without paying their mana costs. +mana={7}{U}{U}{U} +type=Enchantment +[/card] +[card] name=Ondu Cleric auto=may life:type:ally:mybattlefield controller auto=@movedTo(other ally|myBattlefield):may life:type:ally:mybattlefield controller diff --git a/projects/mtg/bin/Res/sets/primitives/unsupported.txt b/projects/mtg/bin/Res/sets/primitives/unsupported.txt index be4eec13f..be85531ce 100644 --- a/projects/mtg/bin/Res/sets/primitives/unsupported.txt +++ b/projects/mtg/bin/Res/sets/primitives/unsupported.txt @@ -224,12 +224,6 @@ mana={1}{U} type=Instant [/card] [card] -name=Aluren -text=Any player may play creature cards with converted mana cost 3 or less without paying their mana cost and as though they had flash. -mana={2}{G}{G} -type=Enchantment -[/card] -[card] name=Amber Prison text=You may choose not to untap Amber Prison during your untap step. -- {4}, {T}: Tap target artifact, creature, or land. That permanent doesn't untap during its controller's untap step for as long as Amber Prison remains tapped. mana={4} @@ -3954,6 +3948,7 @@ subtype=Djinn power=3 toughness=5 [/card] +#needs alias borderline [card] name=Djinn of Wishes text=Flying -- Djinn of Wishes enters the battlefield with three wish counters on it. -- {2}{U}{U}, Remove a wish counter from Djinn of Wishes: Reveal the top card of your library. You may play that card without paying its mana cost. If you don't, exile it. @@ -8742,6 +8737,7 @@ text=Look at the top five cards of your library. You may reveal any number of cr mana={2}{G} type=Sorcery [/card] +#needs alias borderline [card] name=Leaf-Crowned Elder text=Kinship - At the beginning of your upkeep, you may look at the top card of your library. If it shares a creature type with Leaf-Crowned Elder, you may reveal it. If you do, you may play that card without paying its mana cost. @@ -9863,6 +9859,7 @@ text=Each opponent reveals cards from the top of his or her library until he or mana={X}{U}{B} type=Sorcery [/card] +#needs alias [card] name=Mind's Desire text=Shuffle your library. Then exile the top card of your library. Until end of turn, you may play that card without paying its mana cost. (If it has X in its mana cost, X is 0.) -- Storm (When you cast this spell, copy it for each spell cast before it this turn.) @@ -11075,6 +11072,7 @@ text=Look at the top three cards of your library, then put them back in any orde mana={1}{U} type=Sorcery [/card] +#needs alias [card] name=Omen Machine mana={6} diff --git a/projects/mtg/include/MTGRules.h b/projects/mtg/include/MTGRules.h index f617f556a..19fc9775c 100644 --- a/projects/mtg/include/MTGRules.h +++ b/projects/mtg/include/MTGRules.h @@ -298,15 +298,15 @@ public: class MTGDredgeRule: public PermanentAbility, public ReplacementEffect { public: - vectorsoulbonders; + //vectorsoulbonders; TargetChooser * tcb; - MTGAbility * dredgeAbility; - MTGAbility * targetAbility; - MTGAbility * targetAbilityAdder; - MTGAbility * targetAbility1; - MTGAbility * mod; - MTGAbility * activateDredge; - vectorpairing; + //MTGAbility * dredgeAbility; + //MTGAbility * targetAbility; + //MTGAbility * targetAbilityAdder; + //MTGAbility * targetAbility1; + //MTGAbility * mod; + //MTGAbility * activateDredge; + //vectorpairing; MTGDredgeRule(GameObserver* observer, int _id); WEvent * replace(WEvent *e); virtual ostream& toString(ostream& out) const; diff --git a/projects/mtg/src/MTGRules.cpp b/projects/mtg/src/MTGRules.cpp index d43c870ac..d2bd12990 100644 --- a/projects/mtg/src/MTGRules.cpp +++ b/projects/mtg/src/MTGRules.cpp @@ -1189,6 +1189,10 @@ int MTGPayZeroRule::reactToClick(MTGCardInstance * card) return 0; ManaCost * cost = NEW ManaCost(ManaCost::parseManaCost("{0}",NULL,NULL)); + if(card->getIncreasedManaCost()->getConvertedCost()) + cost->add(card->getIncreasedManaCost()); + if(card->getReducedManaCost()->getConvertedCost()) + cost->remove(card->getReducedManaCost()); card->paymenttype = MTGAbility::PAYZERO_COST; @@ -2190,9 +2194,9 @@ MTGDredgeRule::MTGDredgeRule(GameObserver* observer, int _id) : PermanentAbility(observer, _id) { tcb = NULL; - dredgeAbility = NULL; - targetAbility = NULL; - mod = NULL; + //dredgeAbility = NULL; + //targetAbility = NULL; + //mod = NULL; } ; @@ -2249,26 +2253,26 @@ WEvent * MTGDredgeRule::replace(WEvent * event) } //there is a memleak here that i have no idea what causes it. - dredgeAbility = NEW dredgeCard(game, game->mLayers->actionLayer()->getMaxId(), card,NULL); - dredgeAbility->oneShot = true; - targetAbility = NEW GenericTargetAbility(game, "Dredge A Card","",game->mLayers->actionLayer()->getMaxId(), card,tcb->clone(),dredgeAbility->clone()); - targetAbility->oneShot = true; - SAFE_DELETE(dredgeAbility); + dredgeCard *dc = NEW dredgeCard(game, game->mLayers->actionLayer()->getMaxId(), card,NULL); + dc->oneShot = true; + GenericTargetAbility *gta = NEW GenericTargetAbility(game, "Dredge A Card","",game->mLayers->actionLayer()->getMaxId(), card,tcb->clone(),dc->clone()); + gta->oneShot = true; + //SAFE_DELETE(dredgeAbility); - targetAbilityAdder = NEW GenericAddToGame(game, game->mLayers->actionLayer()->getMaxId(), card,NULL,targetAbility->clone()); - targetAbilityAdder->oneShot = true; - SAFE_DELETE(targetAbility); - MTGAbility * setDredge = targetAbilityAdder->clone(); - SAFE_DELETE(targetAbilityAdder); - setDredge->oneShot = true; + GenericAddToGame *gatg = NEW GenericAddToGame(game, game->mLayers->actionLayer()->getMaxId(), card,NULL,gta->clone()); + gatg->oneShot = true; + //SAFE_DELETE(targetAbility); + //MTGAbility * setDredge = targetAbilityAdder->clone(); + //SAFE_DELETE(targetAbilityAdder); + //setDredge->oneShot = true; - selection.push_back(setDredge); - targetAbility1 = NEW AADrawer(game, this->GetId(), card,card,NULL, "1",TargetChooser::CONTROLLER,true); - selection.push_back(targetAbility1); - MTGAbility * menuChoice = NEW MenuAbility(game, this->GetId(), card, card,true,selection,card->controller(),"Dredge or Draw"); + selection.push_back(gatg); + AADrawer *ad = NEW AADrawer(game, game->mLayers->actionLayer()->getMaxId(), card,card,NULL, "1",TargetChooser::CONTROLLER,true); + selection.push_back(ad); + MenuAbility * menuChoice = NEW MenuAbility(game, game->mLayers->actionLayer()->getMaxId(), card, card,true,selection,card->controller(),"Dredge or Draw"); menuChoice->addToGame(); - SAFE_DELETE(tcb); + //SAFE_DELETE(tcb); } SAFE_DELETE(event);