diff --git a/projects/mtg/bin/Res/sets/primitives/mtg.txt b/projects/mtg/bin/Res/sets/primitives/mtg.txt index 2a72f40bc..d4f56462c 100644 --- a/projects/mtg/bin/Res/sets/primitives/mtg.txt +++ b/projects/mtg/bin/Res/sets/primitives/mtg.txt @@ -59072,21 +59072,21 @@ toughness=2 name=Mage-Ring Network auto={T}:add{1} auto={1}{T}:counter(0/0,1,Storage) -auto={T}{C(0/0,-1,Storage)}:name(Remove 1 Counters) add{B} -auto={T}{C(0/0,-2,Storage)}:name(Remove 2 Counters) add{B}{B} -auto={T}{C(0/0,-3,Storage)}:name(Remove 3 Counters) add{B}{B}{B} -auto={T}{C(0/0,-4,Storage)}:name(Remove 4 Counters) add{B}{B}{B}{B} -auto={T}{C(0/0,-5,Storage)}:name(Remove 5 Counters) add{B}{B}{B}{B}{B} -auto={T}{C(0/0,-6,Storage)}:name(Remove 6 Counters) add{B}{B}{B}{B}{B}{B} -auto={T}{C(0/0,-7,Storage)}:name(Remove 7 Counters) add{B}{B}{B}{B}{B}{B}{B} -auto={T}{C(0/0,-8,Storage)}:name(Remove 8 Counters) add{B}{B}{B}{B}{B}{B}{B}{B} -auto={T}{C(0/0,-9,Storage)}:name(Remove 9 Counters) add{B}{B}{B}{B}{B}{B}{B}{B}{B} -auto={T}{C(0/0,-10,Storage)}:name(Remove 10 Counters) add{B}{B}{B}{B}{B}{B}{B}{B}{B}{B} -auto={T}{C(0/0,-11,Storage)}:name(Remove 11 Counters) add{B}{B}{B}{B}{B}{B}{B}{B}{B}{B}{B} -auto={T}{C(0/0,-12,Storage)}:name(Remove 12 Counters) add{B}{B}{B}{B}{B}{B}{B}{B}{B}{B}{B}{B} -auto={T}{C(0/0,-13,Storage)}:name(Remove 13 Counters) add{B}{B}{B}{B}{B}{B}{B}{B}{B}{B}{B}{B}{B} -auto={T}{C(0/0,-14,Storage)}:name(Remove 14 Counters) add{B}{B}{B}{B}{B}{B}{B}{B}{B}{B}{B}{B}{B}{B} -auto={T}{C(0/0,-15,Storage)}:name(Remove 15 Counters) add{B}{B}{B}{B}{B}{B}{B}{B}{B}{B}{B}{B}{B}{B}{B} +auto={T}{C(0/0,-1,Storage)}:name(Remove 1 Counters) add{C} +auto={T}{C(0/0,-2,Storage)}:name(Remove 2 Counters) add{C}{C} +auto={T}{C(0/0,-3,Storage)}:name(Remove 3 Counters) add{C}{C}{C} +auto={T}{C(0/0,-4,Storage)}:name(Remove 4 Counters) add{C}{C}{C}{C} +auto={T}{C(0/0,-5,Storage)}:name(Remove 5 Counters) add{C}{C}{C}{C}{C} +auto={T}{C(0/0,-6,Storage)}:name(Remove 6 Counters) add{C}{C}{C}{C}{C}{C} +auto={T}{C(0/0,-7,Storage)}:name(Remove 7 Counters) add{C}{C}{C}{C}{C}{C}{C} +auto={T}{C(0/0,-8,Storage)}:name(Remove 8 Counters) add{C}{C}{C}{C}{C}{C}{C}{C} +auto={T}{C(0/0,-9,Storage)}:name(Remove 9 Counters) add{C}{C}{C}{C}{C}{C}{C}{C}{C} +auto={T}{C(0/0,-10,Storage)}:name(Remove 10 Counters) add{C}{C}{C}{C}{C}{C}{C}{C}{C}{C} +auto={T}{C(0/0,-11,Storage)}:name(Remove 11 Counters) add{C}{C}{C}{C}{C}{C}{C}{C}{C}{C}{C} +auto={T}{C(0/0,-12,Storage)}:name(Remove 12 Counters) add{C}{C}{C}{C}{C}{C}{C}{C}{C}{C}{C}{C} +auto={T}{C(0/0,-13,Storage)}:name(Remove 13 Counters) add{C}{C}{C}{C}{C}{C}{C}{C}{C}{C}{C}{C}{C} +auto={T}{C(0/0,-14,Storage)}:name(Remove 14 Counters) add{C}{C}{C}{C}{C}{C}{C}{C}{C}{C}{C}{C}{C}{C} +auto={T}{C(0/0,-15,Storage)}:name(Remove 15 Counters) add{C}{C}{C}{C}{C}{C}{C}{C}{C}{C}{C}{C}{C}{C}{C} text={T}: Add {1} to your mana pool. -- {1}, {T}: Put a storage counter on Mage-Ring Network. -- {T}, Remove X storage counters from Mage-Ring Network: Add {X} to your mana pool. type=Land [/card] @@ -118674,8 +118674,8 @@ type=Sorcery [/card] [card] name=Part the Waterveil -auto=turns+1 controller -auto=moveto(exile) all(this) +auto=turns:+1 controller +auto=moveTo(exile) other={6}{U}{U}{U} name(Awaken) auto=if paid(alternative) then target(land|mybattlefield) transforms((Elemental Creature,newability[counter(1/1.6)],newability[haste])) forever text=Take an extra turn after this one. Exile Part the Waterveil. -- Awaken 6?{6}{U}{U}{U} (If you cast this spell for {6}{U}{U}{U}, also put six +1/+1 counters on target land you control and it becomes a 0/0 Elemental creature with haste. It's still a land.) @@ -120032,8 +120032,7 @@ toughness=1 [/card] [card] name=Engulf the Shore -target=creature[toughness<=type:island:mybattlefield] -auto=moveto(ownerhand) +auto=moveto(ownerhand) all(creature[toughness<=type:island:mybattlefield]|battlefield) text=Return to their owners' hands all creatures with toughness less than or equal to the number of Islands you control. mana={3}{U} type=Instant diff --git a/projects/mtg/src/AllAbilities.cpp b/projects/mtg/src/AllAbilities.cpp index c74b0bc06..44c99b139 100644 --- a/projects/mtg/src/AllAbilities.cpp +++ b/projects/mtg/src/AllAbilities.cpp @@ -503,6 +503,8 @@ int MTGRevealingCards::receiveEvent(WEvent* e) CardView* t; if (event->card->view) t = NEW CardView(CardView::nullZone, event->card, *(event->card->view)); + else + t = NEW CardView(CardView::nullZone, event->card, (float)x, (float)y); //we store copies of the card view since moving to and from card displays also deletes the guis stored in cards. //GuiLayer::resetObjects() is the main reason we need to back them up. card views are set to NULL maybe more often than //they should be, possibly someone being to over cautious. @@ -510,6 +512,7 @@ int MTGRevealingCards::receiveEvent(WEvent* e) t->actY = SCREEN_HEIGHT * -2; //correct cards x and y, last known location was the reveal display. cards.push_back(t); + return 1; } } return 0; @@ -832,6 +835,8 @@ int MTGScryCards::receiveEvent(WEvent* e) CardView* t; if (event->card->view) t = NEW CardView(CardView::nullZone, event->card, *(event->card->view)); + else + t = NEW CardView(CardView::nullZone, event->card, (float)x, (float)y); //we store copies of the card view since moving to and from card displays also deletes the guis stored in cards. //GuiLayer::resetObjects() is the main reason we need to back them up. card views are set to NULL maybe more often than //they should be, possibly someone being to over cautious. @@ -839,6 +844,7 @@ int MTGScryCards::receiveEvent(WEvent* e) t->actY = SCREEN_HEIGHT * -2; //correct cards x and y, last known location was the reveal display. cards.push_back(t); + return 1; } } return 0; @@ -4298,19 +4304,19 @@ ABestow::ABestow(GameObserver* observer, int id, MTGCardInstance * card, MTGCard _card = card; } -int ABestow::resolve() -{ - if (target) - { - if (_card->hasType("creature")) - { - _card->removeType("creature"); - _card->addType("aura"); - } - _card->target = (MTGCardInstance*)target; - _card->isBestowed = true; - } - return 1; +int ABestow::resolve() +{ + if (target) + { + if (_card->hasType("creature")) + { + _card->removeType("creature"); + _card->addType("aura"); + } + _card->target = (MTGCardInstance*)target; + _card->isBestowed = true; + } + return 1; } const string ABestow::getMenuText() diff --git a/projects/mtg/src/GameObserver.cpp b/projects/mtg/src/GameObserver.cpp index 908ce9606..f3c4bf2ab 100644 --- a/projects/mtg/src/GameObserver.cpp +++ b/projects/mtg/src/GameObserver.cpp @@ -32,7 +32,8 @@ void GameObserver::cleanup() SAFE_DELETE(replacementEffects); for (size_t i = 0; i < players.size(); ++i) { - SAFE_DELETE(players[i]); + if(players[i]) + SAFE_DELETE(players[i]); } players.clear(); @@ -60,7 +61,8 @@ GameObserver::~GameObserver() for (size_t i = 0; i < players.size(); ++i) { - players[i]->End(); + if(players[i]) + players[i]->End(); } SAFE_DELETE(targetChooser); SAFE_DELETE(mLayers); @@ -68,7 +70,8 @@ GameObserver::~GameObserver() SAFE_DELETE(replacementEffects); for (size_t i = 0; i < players.size(); ++i) { - SAFE_DELETE(players[i]); + if(players[i]) + SAFE_DELETE(players[i]); } players.clear(); delete[] ExtraRules;