From dbf78e2bae8e2bcdf154153718111aa3ddc5690c Mon Sep 17 00:00:00 2001 From: Anthony Calosa Date: Tue, 14 Jun 2016 10:06:37 +0800 Subject: [PATCH 1/4] Split Cant pay life and Cant sacrifice --- projects/mtg/bin/Res/sets/primitives/mtg.txt | 3 +- projects/mtg/include/MTGDefinitions.h | 5 ++-- projects/mtg/src/ExtraCost.cpp | 30 +++++++------------- projects/mtg/src/MTGDefinitions.cpp | 3 +- 4 files changed, 18 insertions(+), 23 deletions(-) diff --git a/projects/mtg/bin/Res/sets/primitives/mtg.txt b/projects/mtg/bin/Res/sets/primitives/mtg.txt index af1f5be8e..9d8364692 100644 --- a/projects/mtg/bin/Res/sets/primitives/mtg.txt +++ b/projects/mtg/bin/Res/sets/primitives/mtg.txt @@ -3076,8 +3076,9 @@ toughness=6 [/card] [card] name=Angel of Jubilation -abilities=flying,cantpaylifeorsaccreatures +abilities=flying,cantpaylife auto=lord(other creature[-black]|mybattlefield) 1/1 +auto=lord(creature) cantbesacrified text=Flying -- Other nonblack creatures you control get +1/+1. -- Players can't pay life or sacrifice creatures to cast spells or activate abilities. mana={1}{W}{W}{W} type=Creature diff --git a/projects/mtg/include/MTGDefinitions.h b/projects/mtg/include/MTGDefinitions.h index d11f06148..ef9547b56 100644 --- a/projects/mtg/include/MTGDefinitions.h +++ b/projects/mtg/include/MTGDefinitions.h @@ -244,8 +244,9 @@ class Constants DEVOID = 123, CANTCHANGELIFE = 124, COMBATTOUGHNESS = 125, - CANTPAYLIFEORSACCREATURES = 126, - NB_BASIC_ABILITIES = 127, + CANTPAYLIFE = 126, + CANTBESACRIFIED = 127, + NB_BASIC_ABILITIES = 128, RARITY_S = 'S', //Special Rarity diff --git a/projects/mtg/src/ExtraCost.cpp b/projects/mtg/src/ExtraCost.cpp index 31c772b84..e6940f0d7 100644 --- a/projects/mtg/src/ExtraCost.cpp +++ b/projects/mtg/src/ExtraCost.cpp @@ -246,8 +246,8 @@ int LifeCost::canPay() { MTGCardInstance * _target = (MTGCardInstance *) target; if (_target->controller()->life <= 0 || _target->controller()->inPlay()->hasAbility(Constants::CANTCHANGELIFE) || - _target->controller()->opponent()->game->battlefield->hasAbility(Constants::CANTPAYLIFEORSACCREATURES) || - _target->controller()->game->battlefield->hasAbility(Constants::CANTPAYLIFEORSACCREATURES)) + _target->controller()->opponent()->game->battlefield->hasAbility(Constants::CANTPAYLIFE) || + _target->controller()->game->battlefield->hasAbility(Constants::CANTPAYLIFE)) { return 0; } @@ -286,8 +286,8 @@ int SpecificLifeCost::canPay() { MTGCardInstance * _target = (MTGCardInstance *) target; if(_target->controller()->life >= slc && !_target->controller()->inPlay()->hasAbility(Constants::CANTCHANGELIFE) && - !_target->controller()->opponent()->game->battlefield->hasAbility(Constants::CANTPAYLIFEORSACCREATURES) && - !_target->controller()->game->battlefield->hasAbility(Constants::CANTPAYLIFEORSACCREATURES)) + !_target->controller()->opponent()->game->battlefield->hasAbility(Constants::CANTPAYLIFE) && + !_target->controller()->game->battlefield->hasAbility(Constants::CANTPAYLIFE)) { return 1; } @@ -336,15 +336,15 @@ int LifeorManaCost::canPay() { MTGCardInstance * _target = (MTGCardInstance *) target; if ( _target->controller()->life <= 1 || _target->controller()->inPlay()->hasAbility(Constants::CANTCHANGELIFE) || - _target->controller()->opponent()->game->battlefield->hasAbility(Constants::CANTPAYLIFEORSACCREATURES) || - _target->controller()->game->battlefield->hasAbility(Constants::CANTPAYLIFEORSACCREATURES)) + _target->controller()->opponent()->game->battlefield->hasAbility(Constants::CANTPAYLIFE) || + _target->controller()->game->battlefield->hasAbility(Constants::CANTPAYLIFE)) { return _target->controller()->getManaPool()->canAfford(getManaCost()); } else if((_target->controller()->life > 1 || _target->controller()->getManaPool()->canAfford(getManaCost())) && (!_target->controller()->inPlay()->hasAbility(Constants::CANTCHANGELIFE) && - !_target->controller()->opponent()->game->battlefield->hasAbility(Constants::CANTPAYLIFEORSACCREATURES) && - !_target->controller()->game->battlefield->hasAbility(Constants::CANTPAYLIFEORSACCREATURES))) + !_target->controller()->opponent()->game->battlefield->hasAbility(Constants::CANTPAYLIFE) && + !_target->controller()->game->battlefield->hasAbility(Constants::CANTPAYLIFE))) { return 1; } @@ -936,11 +936,8 @@ ExtraCost("Select creature to offer", _tc) int Offering::canPay() { - if(source->controller()->opponent()->game->battlefield->hasAbility(Constants::CANTPAYLIFEORSACCREATURES) || - source->controller()->game->battlefield->hasAbility(Constants::CANTPAYLIFEORSACCREATURES)) - { + if (target && target->has(Constants::CANTBESACRIFIED)) return 0; - } if (target && (!source->controller()->getManaPool()->canAfford(source->getManaCost()->Diff(target->getManaCost())))) { @@ -1001,13 +998,8 @@ SacrificeCost::SacrificeCost(TargetChooser *_tc) int SacrificeCost::canPay() { - if(source->controller()->opponent()->game->battlefield->hasAbility(Constants::CANTPAYLIFEORSACCREATURES) || - source->controller()->game->battlefield->hasAbility(Constants::CANTPAYLIFEORSACCREATURES)) - { - if (target && target->isCreature()) - return 0; - } - + if (target && target->has(Constants::CANTBESACRIFIED)) + return 0; return 1; } diff --git a/projects/mtg/src/MTGDefinitions.cpp b/projects/mtg/src/MTGDefinitions.cpp index 8199569b6..543493675 100644 --- a/projects/mtg/src/MTGDefinitions.cpp +++ b/projects/mtg/src/MTGDefinitions.cpp @@ -156,7 +156,8 @@ const char* Constants::MTGBasicAbilities[] = { "devoid", "cantchangelife", "combattoughness", - "cantpaylifeorsaccreatures" + "cantpaylife", + "cantbesacrified" }; map Constants::MTGBasicAbilitiesMap; From 1f54c7933b54a9a02af4bb4c0062439d2520367a Mon Sep 17 00:00:00 2001 From: Anthony Calosa Date: Tue, 14 Jun 2016 19:40:02 +0800 Subject: [PATCH 2/4] Attack Cost Rule Update your rules folder --- projects/mtg/bin/Res/rules/Blitzkrieg.txt | 1 + projects/mtg/bin/Res/rules/hermit.txt | 1 + projects/mtg/bin/Res/rules/mtg.txt | 1 + .../bin/Res/sets/primitives/borderline.txt | 13 ++++ .../bin/Res/sets/primitives/unsupported.txt | 6 -- projects/mtg/include/AllAbilities.h | 13 ++++ projects/mtg/include/MTGAbility.h | 2 + projects/mtg/include/MTGCardInstance.h | 3 + projects/mtg/include/MTGRules.h | 12 ++++ projects/mtg/src/AllAbilities.cpp | 45 ++++++++++++ projects/mtg/src/MTGAbility.cpp | 13 ++++ projects/mtg/src/MTGCardInstance.cpp | 3 + projects/mtg/src/MTGRules.cpp | 68 ++++++++++++++++++- 13 files changed, 172 insertions(+), 9 deletions(-) diff --git a/projects/mtg/bin/Res/rules/Blitzkrieg.txt b/projects/mtg/bin/Res/rules/Blitzkrieg.txt index 38ac460df..ac5692b10 100644 --- a/projects/mtg/bin/Res/rules/Blitzkrieg.txt +++ b/projects/mtg/bin/Res/rules/Blitzkrieg.txt @@ -16,6 +16,7 @@ auto=morphrule auto=payzerorule auto=overloadrule auto=attackrule +auto=attackcostrule auto=blockrule auto=combattriggerrule auto=legendrule diff --git a/projects/mtg/bin/Res/rules/hermit.txt b/projects/mtg/bin/Res/rules/hermit.txt index 6bd9d460a..7d08bdcbb 100644 --- a/projects/mtg/bin/Res/rules/hermit.txt +++ b/projects/mtg/bin/Res/rules/hermit.txt @@ -15,6 +15,7 @@ auto=morphrule auto=payzerorule auto=overloadrule auto=attackrule +auto=attackcostrule auto=blockrule auto=combattriggerrule auto=legendrule diff --git a/projects/mtg/bin/Res/rules/mtg.txt b/projects/mtg/bin/Res/rules/mtg.txt index eec78cfb1..44beaae5d 100644 --- a/projects/mtg/bin/Res/rules/mtg.txt +++ b/projects/mtg/bin/Res/rules/mtg.txt @@ -19,6 +19,7 @@ auto=morphrule auto=payzerorule auto=overloadrule auto=attackrule +auto=attackcostrule auto=blockrule auto=combattriggerrule auto=legendrule diff --git a/projects/mtg/bin/Res/sets/primitives/borderline.txt b/projects/mtg/bin/Res/sets/primitives/borderline.txt index 8f95f9539..b7c085302 100644 --- a/projects/mtg/bin/Res/sets/primitives/borderline.txt +++ b/projects/mtg/bin/Res/sets/primitives/borderline.txt @@ -1,4 +1,17 @@ grade=borderline +#planeswalker and creature attack cost... +[card] +name=Archangel of Tithes +abilities=flying +auto=this(untapped) lord(creature|opponentbattlefield) transforms((,newability[@each mycombatbegins:pay[[{1}]] name(pay 1 mana) donothing?cantattack all(this)])) +auto=@combat(attacking) source(this):all(creature|opponentbattlefield) transforms((,newability[pay[[{1}]] name(pay 1 mana) donothing?cantblock all(this)])) +text=Flying -- As long as Archangel of Tithes is untapped, creatures can't attack you or a planeswalker you control unless their controller pays {1} for each of those creatures. -- As long as Archangel of Tithes is attacking, creatures can't block unless their controller pays {1} for each of those creatures. +mana={1}{W}{W}{W} +type=Creature +subtype=Angel +power=3 +toughness=5 +[/card] [card] name=Autumn Willow abilities=opponentshroud,shroud diff --git a/projects/mtg/bin/Res/sets/primitives/unsupported.txt b/projects/mtg/bin/Res/sets/primitives/unsupported.txt index dfc7dbd30..60c8029f3 100644 --- a/projects/mtg/bin/Res/sets/primitives/unsupported.txt +++ b/projects/mtg/bin/Res/sets/primitives/unsupported.txt @@ -12123,12 +12123,6 @@ power=* toughness=* [/card] [card] -name=Koskun Falls -text=At the beginning of your upkeep, sacrifice Koskun Falls unless you tap an untapped creature you control. -- Creatures can't attack you unless their controller pays {2} for each creature he or she controls that's attacking you. -mana={2}{B}{B} -type=World Enchantment -[/card] -[card] name=Kozilek's Channeler text={T}: Add {C}{C} to your mana pool. mana={5} diff --git a/projects/mtg/include/AllAbilities.h b/projects/mtg/include/AllAbilities.h index 3d8b6e376..a1d78ee48 100644 --- a/projects/mtg/include/AllAbilities.h +++ b/projects/mtg/include/AllAbilities.h @@ -4863,6 +4863,19 @@ public: }; +//AAttackSetCost +class AAttackSetCost: public MTGAbility +{ +public: + string number; + AAttackSetCost(GameObserver* observer, int _id, MTGCardInstance * _source, string number); + void Update(float dt); + int addToGame(); + int destroy(); + const string getMenuText(); + AAttackSetCost * clone() const; +}; + //ABlink class ABlink: public MTGAbility { diff --git a/projects/mtg/include/MTGAbility.h b/projects/mtg/include/MTGAbility.h index 01565899f..973a9246e 100644 --- a/projects/mtg/include/MTGAbility.h +++ b/projects/mtg/include/MTGAbility.h @@ -216,6 +216,8 @@ public: PAYZERO_COST = 33, OVERLOAD_COST = 34, BESTOW_COST = 35, + ATTACK_COST = 36, + ATTACKPLANESWALKER_COST = 37, }; }; diff --git a/projects/mtg/include/MTGCardInstance.h b/projects/mtg/include/MTGCardInstance.h index 09e36e535..cb5786293 100644 --- a/projects/mtg/include/MTGCardInstance.h +++ b/projects/mtg/include/MTGCardInstance.h @@ -258,6 +258,9 @@ public: ManaCost * computeNewCost(MTGCardInstance * card,ManaCost * oldCost, ManaCost * refCost,bool noTrinisphere = false); int countTrini; vectorimprintedCards; + int attackCost; + int attackCostBackup; + int attackPlaneswalkerCost; int imprintG; int imprintU; int imprintR; diff --git a/projects/mtg/include/MTGRules.h b/projects/mtg/include/MTGRules.h index f111efaf3..4a477f169 100644 --- a/projects/mtg/include/MTGRules.h +++ b/projects/mtg/include/MTGRules.h @@ -219,6 +219,18 @@ public: virtual MTGSuspendRule * clone() const; }; +class MTGAttackCostRule: public PermanentAbility +{ +public: + string scost; + int isReactingToClick(MTGCardInstance * card, ManaCost * mana = NULL); + int reactToClick(MTGCardInstance * card); + virtual ostream& toString(ostream& out) const; + MTGAttackCostRule(GameObserver* observer, int _id); + const string getMenuText(); + virtual MTGAttackCostRule * clone() const; +}; + class MTGAttackRule: public PermanentAbility, public Limitor { public: diff --git a/projects/mtg/src/AllAbilities.cpp b/projects/mtg/src/AllAbilities.cpp index 0ec831632..46ab2ad83 100644 --- a/projects/mtg/src/AllAbilities.cpp +++ b/projects/mtg/src/AllAbilities.cpp @@ -5371,6 +5371,51 @@ APhaseActionGeneric::~APhaseActionGeneric() SAFE_DELETE(ability); } +//AAttackSetCost +AAttackSetCost::AAttackSetCost(GameObserver* observer, int _id, MTGCardInstance * _source, string number) : + MTGAbility(observer, _id, _source), number(number) +{ +} + +void AAttackSetCost::Update(float dt) +{ + if(game->getCurrentGamePhase() != MTG_PHASE_COMBATATTACKERS) + { + source->attackCost = source->attackCostBackup; + MTGAbility::Update(dt); + } +} + +int AAttackSetCost::addToGame() +{ + WParsedInt attackcost(number, NULL, source); + source->attackCost += attackcost.getValue(); + source->attackCostBackup += attackcost.getValue(); + + return MTGAbility::addToGame(); +} + +int AAttackSetCost::destroy() +{ + + WParsedInt attackcost(number, NULL, source); + source->attackCost -= attackcost.getValue(); + source->attackCostBackup -= attackcost.getValue(); + + return 1; +} + +const string AAttackSetCost::getMenuText() +{ + return "Attack Cost"; +} + +AAttackSetCost * AAttackSetCost::clone() const +{ + return NEW AAttackSetCost(*this); +} + + //a blink ABlink::ABlink(GameObserver* observer, int _id, MTGCardInstance * card, MTGCardInstance * _target, bool blinkueot, bool blinkForSource, bool blinkhand, MTGAbility * stored) : MTGAbility(observer, _id, card),blinkueot(blinkueot),blinkForSource(blinkForSource),blinkhand(blinkhand),stored(stored) diff --git a/projects/mtg/src/MTGAbility.cpp b/projects/mtg/src/MTGAbility.cpp index d4bfefcc1..808723055 100644 --- a/projects/mtg/src/MTGAbility.cpp +++ b/projects/mtg/src/MTGAbility.cpp @@ -1179,6 +1179,13 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG observer->addObserver(NEW MTGAttackRule(observer, -1)); return NULL; } + //this rule handles attacking cost ability during attacker phase + found = s.find("attackcostrule"); + if(found != string::npos) + { + observer->addObserver(NEW MTGAttackCostRule(observer, -1)); + return NULL; + } //this rule handles blocking ability during blocker phase found = s.find("blockrule"); if(found != string::npos) @@ -2829,6 +2836,12 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG return NEW AReduceToAbility(observer, id, card,s.substr(9)); } + //attack cost + if (s.find("attackcost:") != string::npos) + { + return NEW AAttackSetCost(observer, id, card, s.substr(11)); + } + //flanking if (s.find("flanker") != string::npos) { diff --git a/projects/mtg/src/MTGCardInstance.cpp b/projects/mtg/src/MTGCardInstance.cpp index 7888be843..3987c578b 100644 --- a/projects/mtg/src/MTGCardInstance.cpp +++ b/projects/mtg/src/MTGCardInstance.cpp @@ -209,6 +209,9 @@ void MTGCardInstance::initMTGCI() miracle = false; countTrini = 0; imprintedCards.clear(); + attackCost = 0; + attackCostBackup = 0; + attackPlaneswalkerCost = 0; imprintG = 0; imprintU = 0; imprintR = 0; diff --git a/projects/mtg/src/MTGRules.cpp b/projects/mtg/src/MTGRules.cpp index 85231f7b3..13f4c3954 100644 --- a/projects/mtg/src/MTGRules.cpp +++ b/projects/mtg/src/MTGRules.cpp @@ -1348,12 +1348,74 @@ MTGOverloadRule * MTGOverloadRule::clone() const /////////////////////////////////////////////////////////////////////////////////////////////////// +MTGAttackCostRule::MTGAttackCostRule(GameObserver* observer, int _id) : + PermanentAbility(observer, _id) +{ + aType = MTGAbility::ATTACK_COST; + scost = "Pay to attack"; +} + +int MTGAttackCostRule::isReactingToClick(MTGCardInstance * card, ManaCost *) +{ + + if (currentPhase == MTG_PHASE_COMBATATTACKERS && card->controller() == game->currentPlayer && card->controller() == game->currentlyActing())//on my turn and when I am the acting player. + { + if(card->isPhased) + return 0; + if(card->attackCost < 1) + return 0; + ManaCost * playerMana = card->controller()->getManaPool(); + ManaCost * attackcost = NEW ManaCost(ManaCost::parseManaCost("{0}",NULL,NULL)); + attackcost->add(0,card->attackCostBackup); + if(attackcost->extraCosts) + for(unsigned int i = 0; i < attackcost->extraCosts->costs.size();i++) + { + attackcost->extraCosts->costs[i]->setSource(card); + } + scost = attackcost->getConvertedCost(); + if (playerMana->canAfford(attackcost)) + return 1; + } + return 0; +} + +int MTGAttackCostRule::reactToClick(MTGCardInstance * card) +{ + if (!isReactingToClick(card)) + return 0; + Player * player = game->currentlyActing(); + ManaCost * attackcost = NEW ManaCost(ManaCost::parseManaCost("{0}",NULL,NULL)); + attackcost->add(0,card->attackCostBackup); + ManaCost * playerMana = player->getManaPool(); + player->getManaPool()->pay(attackcost); + card->attackCost = 0; + return 1; +} + +ostream& MTGAttackCostRule::toString(ostream& out) const +{ + out << "MTGAttackCostRule ::: ("; + return MTGAbility::toString(out) << ")"; +} + +const string MTGAttackCostRule::getMenuText() +{ + sprintf(menuText, "Pay to attack"); + return menuText; +} + +MTGAttackCostRule * MTGAttackCostRule::clone() const +{ + return NEW MTGAttackCostRule(*this); +} + +/////////////////////////////////////////////////////////////////////////////////////////////////// bool MTGAttackRule::select(Target* t) { if (CardView* c = dynamic_cast(t)) { MTGCardInstance * card = c->getCard(); - if (card->canAttack() && !card->isPhased) + if (card->canAttack() && !card->isPhased && card->attackCost < 1) return true; } return false; @@ -1377,7 +1439,7 @@ int MTGAttackRule::isReactingToClick(MTGCardInstance * card, ManaCost *) return 0; if (card->isAttacker()) return 1; - if (card->canAttack()) + if (card->canAttack() && card->attackCost < 1) return 1; } return 0; @@ -1453,7 +1515,7 @@ int MTGPlaneswalkerAttackRule::isReactingToClick(MTGCardInstance * card, ManaCos return 0; if (card->isAttacker()) return 1; - if (card->canAttack()) + if (card->canAttack() && card->attackPlaneswalkerCost < 1) return 1; } return 0; From b33ae0c92f36ec0d2d972e00db96491811e52829 Mon Sep 17 00:00:00 2001 From: Anthony Calosa Date: Tue, 14 Jun 2016 19:40:28 +0800 Subject: [PATCH 3/4] Revised --- projects/mtg/bin/Res/sets/primitives/mtg.txt | 29 +++++++++----------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/projects/mtg/bin/Res/sets/primitives/mtg.txt b/projects/mtg/bin/Res/sets/primitives/mtg.txt index 9d8364692..fe472d015 100644 --- a/projects/mtg/bin/Res/sets/primitives/mtg.txt +++ b/projects/mtg/bin/Res/sets/primitives/mtg.txt @@ -4301,18 +4301,6 @@ power=3 toughness=4 [/card] [card] -name=Archangel of Tithes -abilities=flying -auto=this(untapped) lord(creature|opponentbattlefield) transforms((,newability[@each mycombatbegins:pay[[{1}]] name(pay 1 mana) donothing?cantattack all(this)])) -auto=@combat(attacking) source(this):all(creature|opponentbattlefield) transforms((,newability[pay[[{1}]] name(pay 1 mana) donothing?cantblock all(this)])) -text=Flying -- As long as Archangel of Tithes is untapped, creatures can't attack you or a planeswalker you control unless their controller pays {1} for each of those creatures. -- As long as Archangel of Tithes is attacking, creatures can't block unless their controller pays {1} for each of those creatures. -mana={1}{W}{W}{W} -type=Creature -subtype=Angel -power=3 -toughness=5 -[/card] -[card] name=Archangel's Light auto=life:twicetype:*:mygraveyard auto=moveto(myLibrary) all(*|myGraveyard) && shuffle @@ -29330,7 +29318,7 @@ type=Instant name=Elephant Grass auto=cumulativeupcost[{1}] sacrifice auto=lord(creature[black]|opponentbattlefield) cantattack -auto=lord(creature[-black]|opponentbattlefield) transforms((,newability[@each mycombatbegins:pay[[{2}]] name(pay 2 mana) donothing?cantattack all(this)])) +auto=lord(creature|opponentbattlefield) transforms((,newability[attackcost:2])) text=Cumulative upkeep {1} (At the beginning of your upkeep, put an age counter on this permanent, then sacrifice it unless you pay its upkeep cost for each age counter on it.) -- Black creatures can't attack you. -- Nonblack creatures can't attack you unless their controller pays {2} for each creature he or she controls that's attacking you. mana={G} type=Enchantment @@ -38882,7 +38870,7 @@ subtype=Aura [/card] [card] name=Ghostly Prison -auto=lord(creature|opponentbattlefield) transforms((,newability[@each mycombatbegins:pay[[{2}]] name(pay 2 mana) donothing?cantattack all(this)])) +auto=lord(creature|opponentbattlefield) transforms((,newability[attackcost:2])) text=Creatures can't attack you unless their controller pays {2} for each creature he or she controls that's attacking you. mana={2}{W} type=Enchantment @@ -54505,6 +54493,15 @@ power=3 toughness=3 [/card] [card] +name=Koskun Falls +auto=upcost[{T(creature|mybattlefield)}] sacrifice +auto=lord(creature|opponentbattlefield) transforms((,newability[attackcost:2])) +auto=@movedTo(enchantment[world]|battlefield):sacrifice all(this) +text=At the beginning of your upkeep, sacrifice Koskun Falls unless you tap an untapped creature you control. -- Creatures can't attack you unless their controller pays {2} for each creature he or she controls that's attacking you. +mana={2}{B}{B} +type=World Enchantment +[/card] +[card] name=Koskun Keep auto={T}:Add{1} auto={1}{T}:Add{R} @@ -75631,7 +75628,7 @@ toughness=1 [/card] [card] name=Propaganda -auto=lord(creature|opponentbattlefield) transforms((,newability[@each mycombatbegins:pay[[{2}]] name(pay 2 mana) donothing?cantattack all(this)])) +auto=lord(creature|opponentbattlefield) transforms((,newability[attackcost:2])) text=Creatures can't attack you unless their controller pays {2} for each creature he or she controls that's attacking you. mana={2}{U} type=Enchantment @@ -114261,7 +114258,7 @@ subtype=Aura [card] name=Windborn Muse abilities=flying -auto=lord(creature|opponentbattlefield) transforms((,newability[@each mycombatbegins:pay[[{2}]] name(pay 2 mana) donothing?cantattack all(this)])) +auto=lord(creature|opponentbattlefield) transforms((,newability[attackcost:2])) text=Flying (This creature can't be blocked except by creatures with flying or reach.) -- Creatures can't attack you unless their controller pays {2} for each creature he or she controls that's attacking you. mana={3}{W} type=Creature From 149af25d2290672c65d3f2851f369335fec1d690 Mon Sep 17 00:00:00 2001 From: Anthony Calosa Date: Tue, 14 Jun 2016 20:50:31 +0800 Subject: [PATCH 4/4] fix unused variable error --- projects/mtg/src/MTGRules.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/mtg/src/MTGRules.cpp b/projects/mtg/src/MTGRules.cpp index 13f4c3954..e7d291dee 100644 --- a/projects/mtg/src/MTGRules.cpp +++ b/projects/mtg/src/MTGRules.cpp @@ -1387,7 +1387,7 @@ int MTGAttackCostRule::reactToClick(MTGCardInstance * card) ManaCost * attackcost = NEW ManaCost(ManaCost::parseManaCost("{0}",NULL,NULL)); attackcost->add(0,card->attackCostBackup); ManaCost * playerMana = player->getManaPool(); - player->getManaPool()->pay(attackcost); + playerMana->pay(attackcost); card->attackCost = 0; return 1; }