diff --git a/projects/mtg/bin/Res/rules/Blitzkrieg.txt b/projects/mtg/bin/Res/rules/Blitzkrieg.txt index 15f48cd95..8b914995e 100644 --- a/projects/mtg/bin/Res/rules/Blitzkrieg.txt +++ b/projects/mtg/bin/Res/rules/Blitzkrieg.txt @@ -32,6 +32,7 @@ auto=lifelinkrule auto=deathtouchrule auto=soulbondrule auto=dredgerule +auto=bestowrule [PLAYERS] life:20 @@ -48,11 +49,11 @@ auto=maxPlay(land)1000 #Lands Mana Rules -auto=lord(Plains|MyBattlefield) {T}:Add{W} -auto=lord(Island|MyBattlefield) {T}:Add{U} -auto=lord(Swamp|MyBattlefield) {T}:Add{B} -auto=lord(Mountain|MyBattlefield) {T}:Add{R} -auto=lord(Forest|MyBattlefield) {T}:Add{G} +auto=lord(Plains[-noactivatedability;-nomanaability;-notapability;land]|MyBattlefield) {T}:Add{W} +auto=lord(Island[-noactivatedability;-nomanaability;-notapability;land]|MyBattlefield) {T}:Add{U} +auto=lord(Swamp[-noactivatedability;-nomanaability;-notapability;land]|MyBattlefield) {T}:Add{B} +auto=lord(Mountain[-noactivatedability;-nomanaability;-notapability;land]|MyBattlefield) {T}:Add{R} +auto=lord(Forest[-noactivatedability;-nomanaability;-notapability;land]|MyBattlefield) {T}:Add{G} #Mana Empties from manapool at the end of each phase diff --git a/projects/mtg/bin/Res/rules/hermit.txt b/projects/mtg/bin/Res/rules/hermit.txt index 8cf5a7139..fb48ef064 100644 --- a/projects/mtg/bin/Res/rules/hermit.txt +++ b/projects/mtg/bin/Res/rules/hermit.txt @@ -31,6 +31,7 @@ auto=lifelinkrule auto=deathtouchrule auto=soulbondrule auto=dredgerule +auto=bestowrule [PLAYERS] life:18 @@ -43,11 +44,11 @@ auto=maxPlay(land)1 #Lands Mana Rules -auto=lord(Plains[land]|MyBattlefield) {T}:Add{W} -auto=lord(Island[land]|MyBattlefield) {T}:Add{U} -auto=lord(Swamp[land]|MyBattlefield) {T}:Add{B} -auto=lord(Mountain[land]|MyBattlefield) {T}:Add{R} -auto=lord(Forest[land]|MyBattlefield) {T}:Add{G} +auto=lord(Plains[-noactivatedability;-nomanaability;-notapability;land]|MyBattlefield) {T}:Add{W} +auto=lord(Island[-noactivatedability;-nomanaability;-notapability;land]|MyBattlefield) {T}:Add{U} +auto=lord(Swamp[-noactivatedability;-nomanaability;-notapability;land]|MyBattlefield) {T}:Add{B} +auto=lord(Mountain[-noactivatedability;-nomanaability;-notapability;land]|MyBattlefield) {T}:Add{R} +auto=lord(Forest[-noactivatedability;-nomanaability;-notapability;land]|MyBattlefield) {T}:Add{G} #Mana Empties from manapool at the end of each phase diff --git a/projects/mtg/bin/Res/sets/primitives/mtg.txt b/projects/mtg/bin/Res/sets/primitives/mtg.txt index 89a8b1d46..b2cc56edf 100644 --- a/projects/mtg/bin/Res/sets/primitives/mtg.txt +++ b/projects/mtg/bin/Res/sets/primitives/mtg.txt @@ -30517,7 +30517,7 @@ toughness=4 name=Docent of Perfection abilities=flying auto=@movedto(instant,sorcery|mystack):token(Wizard,Creature Human Wizard,1/1,blue) -auto=while(restriction{type(wizard|myBattlefield)~morethan~3}) flip(Final Iteration) +auto=aslongas(wizard|myBattlefield) flip(Final Iteration) while >2 text=Flying -- Whenever you cast an instant or sorcery spell, put a 1/1 blue Human Wizard creature token onto the battlefield. Then if you control three or more Wizards, transform Docent of Perfection. mana={3}{U}{U} type=Creature @@ -52420,8 +52420,8 @@ toughness=4 [card] name=Harbor Serpent abilities=islandwalk -auto=while(restriction{type(island|battlefield)~lessthan~5}) cantattack -auto=while(restriction{type(island|battlefield)~lessthan~5}) cantpwattack +auto=aslongas(island|battlefield) cantattack <5 +auto=aslongas(island|battlefield) cantpwattack <5 text=Islandwalk -- Harbor Serpent can't attack unless there are five or more Islands on the battlefield. mana={4}{U}{U} type=Creature @@ -69163,7 +69163,8 @@ toughness=4 [/card] [card] name=Lupine Prototype -auto=while(restriction{type(*|hand)~morethan~0}) transforms((,cantattack,cantpwattack,cantblock)) +auto=this(variable{phandcount}>0) transforms((,cantattack,cantpwattack,cantblock)) +auto=this(variable{ohandcount}>0) transforms((,cantattack,cantpwattack,cantblock)) text=Lupine Prototype can't attack or block unless a player has no cards in hand. mana={2} type=Artifact Creature @@ -100390,7 +100391,7 @@ type=Instant [/card] [card] name=Scourge Devil -auto=1/0 lord(creature|myBattlefield) +auto=1/0 all(creature|myBattlefield) autograveyard={2}{R}:moveto(mybattlefield) && transforms((,unearth,haste)) asSorcery forever text=When Scourge Devil enters the battlefield, creatures you control get +1/+0 until end of turn. -- Unearth {2}{R} ({2}{R}: Return this card from your graveyard to the battlefield. It gains haste. Exile it at the beginning of the next end step or if it would leave the battlefield. Unearth only as a sorcery.) mana={4}{R} @@ -104852,7 +104853,7 @@ type=Instant [/card] [card] name=Shrivel -auto=-1/-1 lord(creature) +auto=-1/-1 all(creature) text=All creatures get -1/-1 until end of turn. mana={1}{B} type=Sorcery @@ -112741,7 +112742,7 @@ subtype=Aura [/card] [card] name=Stampede Driver -auto={1}{G}{T}{D(*|myhand)}:all(creature|myBattlefield) 1/1 && lord(creature|mybattlefield) trample +auto={1}{G}{T}{D(*|myhand)}:all(creature|myBattlefield) 1/1 && all(creature|mybattlefield) trample text={1}{G}, {T}, Discard a card: Creatures you control get +1/+1 and gain trample until end of turn. mana={G} type=Creature @@ -122831,7 +122832,7 @@ type=Sorcery [/card] [card] name=Torrent of Souls -auto=if spent({R}) then target(player) ability$!name(2/0 & haste) 2/0 lord(creature|mybattlefield) && haste lord(creature|mybattlefield)!$ targetedplayer +auto=if spent({R}) then target(player) ability$!name(2/0 & haste) 2/0 all(creature|mybattlefield) && haste all(creature|mybattlefield)!$ targetedplayer auto=if spent({B}) then ability$!name(reanimate) target(creature|mygraveyard) moveto(mybattlefield)!$ controller text=Return up to one target creature card from your graveyard to the battlefield if {B} was spent to cast Torrent of Souls. Creatures target player controls get +2/+0 and gain haste until end of turn if {R} was spent to cast Torrent of Souls. (Do both if {B}{R} was spent.) mana={4}{BR} @@ -126361,8 +126362,8 @@ type=Sorcery [/card] [card] name=Unnerving Assault -auto=if spent({U}) then -1/0 lord(creature|opponentbattlefield) -auto=if spent({R}) then 1/0 lord(creature|mybattlefield) +auto=if spent({U}) then -1/0 all(creature|opponentbattlefield) +auto=if spent({R}) then 1/0 all(creature|mybattlefield) text=Creatures your opponents control get -1/-0 until end of turn if {U} was spent to cast Unnerving Assault, and creatures you control get +1/+0 until end of turn if {R} was spent to cast it. (Do both if {U}{R} was spent.) mana={2}{UR} type=Instant diff --git a/projects/mtg/include/MTGCardInstance.h b/projects/mtg/include/MTGCardInstance.h index a29ac5c2e..afaa2e261 100644 --- a/projects/mtg/include/MTGCardInstance.h +++ b/projects/mtg/include/MTGCardInstance.h @@ -273,10 +273,6 @@ public: int copiedSetID; bool canPlayFromLibrary(); bool StackIsEmptyandSorcerySpeed(); - bool isTargetted(); - int cardistargetted; - bool isTargetter(); - int cardistargetter; int forcedBorderA; int forcedBorderB; int myconvertedcost; diff --git a/projects/mtg/src/AIHints.cpp b/projects/mtg/src/AIHints.cpp index f819344c2..0482a77d7 100644 --- a/projects/mtg/src/AIHints.cpp +++ b/projects/mtg/src/AIHints.cpp @@ -1,5 +1,5 @@ #include "PrecompiledHeader.h" - + #include "AIHints.h" #include "AIPlayerBaka.h" #include "utils.h" diff --git a/projects/mtg/src/ActionStack.cpp b/projects/mtg/src/ActionStack.cpp index b79f4868b..c6b96d4cf 100644 --- a/projects/mtg/src/ActionStack.cpp +++ b/projects/mtg/src/ActionStack.cpp @@ -1521,6 +1521,7 @@ void ActionStack::Render() ((Interruptible *) mObjects[i])->y = currenty + 40; currenty += ((Interruptible *) mObjects[i])->mHeight + 40; } + current->mHasFocus = false;//fix stack display mObjects[i]->Render(); } } diff --git a/projects/mtg/src/AllAbilities.cpp b/projects/mtg/src/AllAbilities.cpp index fa4119461..a15499006 100644 --- a/projects/mtg/src/AllAbilities.cpp +++ b/projects/mtg/src/AllAbilities.cpp @@ -8149,7 +8149,8 @@ MTGCardInstance * AACastCard::makeCard() card = NEW MTGCardInstance(cardData, source->controller()->game); card->owner = source->controller(); card->lastController = source->controller(); - source->controller()->game->temp->addCard(card); + //source->controller()->game->temp->addCard(card); + source->controller()->game->sideboard->addCard(card); return card; } diff --git a/projects/mtg/src/CardGui.cpp b/projects/mtg/src/CardGui.cpp index 43150b45f..ee300dfe3 100644 --- a/projects/mtg/src/CardGui.cpp +++ b/projects/mtg/src/CardGui.cpp @@ -497,7 +497,17 @@ void CardGui::Render() renderer->DrawRect(actX - 10 * actZ, actY - (1 * actZ), 6.f,6.f,ARGB(180,10,10,10)); } } - if(!alternate && buff != "" && game && game->gameType() == GAME_TYPE_CLASSIC)//it seems that other game modes makes cards as tokens!!! hmmm... + if(card->chooseasubtype.size() && !alternate && game) + { + mFont->SetScale(DEFAULT_MAIN_FONT_SCALE); + char buffer[200]; + sprintf(buffer, "%s", card->chooseasubtype.c_str()); + mFont->SetColor(ARGB(static_cast(actA),255,215,0));//Gold indicator + mFont->SetScale(0.8f); + mFont->DrawString(buffer, actX - 10 * actZ, actY - (25.3f * actZ)); + mFont->SetScale(1); + } + if(!alternate && buff != "" && game) { mFont->SetScale(DEFAULT_MAIN_FONT_SCALE); char buffer[200]; diff --git a/projects/mtg/src/GameObserver.cpp b/projects/mtg/src/GameObserver.cpp index caa157a3f..a7809ce97 100644 --- a/projects/mtg/src/GameObserver.cpp +++ b/projects/mtg/src/GameObserver.cpp @@ -652,8 +652,6 @@ void GameObserver::gameStateBasedEffects() { for (int c = zone->nb_cards - 1; c >= 0; c--) { - zone->cards[c]->cardistargetted = 0; - zone->cards[c]->cardistargetter = 0; zone->cards[c]->forcedBorderA = 0; zone->cards[c]->forcedBorderB = 0; } diff --git a/projects/mtg/src/MTGAbility.cpp b/projects/mtg/src/MTGAbility.cpp index 997edf751..c60f27e76 100644 --- a/projects/mtg/src/MTGAbility.cpp +++ b/projects/mtg/src/MTGAbility.cpp @@ -551,14 +551,6 @@ int AbilityFactory::parseCastRestrictions(MTGCardInstance * card, Player * playe if(!card->discarded) return 0; } - - check = restriction[i].find("cardistargeted"); - if(check != string::npos) - { - bool istarget = card->isTargetted(); - if(!istarget) - return 0; - } check = restriction[i].find("copiedacard"); if(check != string::npos) diff --git a/projects/mtg/src/MTGCardInstance.cpp b/projects/mtg/src/MTGCardInstance.cpp index 81d6c68ae..4aac767b7 100644 --- a/projects/mtg/src/MTGCardInstance.cpp +++ b/projects/mtg/src/MTGCardInstance.cpp @@ -69,8 +69,6 @@ MTGCardInstance::MTGCardInstance(MTGCard * card, MTGPlayerCards * arg_belongs_to copiedSetID = 0; LKIpower = power; LKItoughness = toughness; - cardistargetted = 0; - cardistargetter = 0; forcedBorderA = 0; forcedBorderB = 0; myconvertedcost = getManaCost()->getConvertedCost(); @@ -951,62 +949,6 @@ bool MTGCardInstance::StackIsEmptyandSorcerySpeed() return false; } -//check targetted? -bool MTGCardInstance::isTargetted() -{ - if(controller()->game->reveal->cards.size() || controller()->opponent()->game->reveal->cards.size()) - return false; - - if(getObserver()->mLayers->stackLayer()->count(0, NOT_RESOLVED) != 0) - { - ActionStack * stack = observer->mLayers->stackLayer(); - for (int i = stack->mObjects.size() - 1; i >= 0; i--) - { - Interruptible * current = ((Interruptible *) stack->mObjects[i]); - if ((current->type == ACTION_SPELL || current->type == ACTION_ABILITY) && current->state == NOT_RESOLVED) - { - if(current->type == ACTION_SPELL) - { - Spell * spell = (Spell *) current; - if(spell->getNextTarget() && spell->getNextTarget() == (Targetable*)this) - return true; - } - } - } - } - if(cardistargetted) - return true; - return false; -} - -//check targetter? -bool MTGCardInstance::isTargetter() -{ - if(controller()->game->reveal->cards.size() || controller()->opponent()->game->reveal->cards.size()) - return false; - - if(getObserver()->mLayers->stackLayer()->count(0, NOT_RESOLVED) != 0) - { - ActionStack * stack = observer->mLayers->stackLayer(); - for (int i = stack->mObjects.size() - 1; i >= 0; i--) - { - Interruptible * current = ((Interruptible *) stack->mObjects[i]); - if ((current->type == ACTION_SPELL || current->type == ACTION_ABILITY) && current->state == NOT_RESOLVED) - { - if(current->type == ACTION_SPELL) - { - Spell * spell = (Spell *) current; - if(spell && spell->source == this) - return true; - } - } - } - } - if(cardistargetter) - return true; - return false; -} - int MTGCardInstance::canBlock() { if (tapped && !has(Constants::CANBLOCKTAPPED)) diff --git a/projects/mtg/src/ManaCost.cpp b/projects/mtg/src/ManaCost.cpp index 04d015a57..05ee90278 100644 --- a/projects/mtg/src/ManaCost.cpp +++ b/projects/mtg/src/ManaCost.cpp @@ -435,7 +435,7 @@ ManaCost::ManaCost(ManaCost * manaCost) hybrids = manaCost->hybrids; kicker = NEW ManaCost(manaCost->kicker); if (kicker) - kicker->isMulti = manaCost->isMulti; + kicker->isMulti = manaCost->isMulti; Retrace = NEW ManaCost( manaCost->Retrace ); BuyBack = NEW ManaCost( manaCost->BuyBack ); alternative = NEW ManaCost( manaCost->alternative ); diff --git a/projects/mtg/src/WEvent.cpp b/projects/mtg/src/WEvent.cpp index 3a2af3a68..21923024f 100644 --- a/projects/mtg/src/WEvent.cpp +++ b/projects/mtg/src/WEvent.cpp @@ -129,9 +129,6 @@ WEventVampire::WEventVampire(MTGCardInstance * card,MTGCardInstance * source,MTG WEventTarget::WEventTarget(MTGCardInstance * card,MTGCardInstance * source) : WEventCardUpdate(card),card(card),source(source) { - card->cardistargetted = 1; - if(source) - source->cardistargetter = 1; } WEventCardChangeType::WEventCardChangeType(MTGCardInstance * card, int type, bool before, bool after) :