added a new aihint #HINT:dontattackwith(targetchooser)
which tells the ai not to use the targetible cards as attackers, this can be card names, and CD modes.
modified the way ai handles multikicker. it will not be casting 1/1 joragas anymore :D
made WParsedInt ignore "+" signs....
added a new affinity ability...autohand=affinity(creature[vampire]|mygraveyard) ....
this is essentially affinity for creatures in your grave.
added supkeyword to clone clone addtype(zombie)....it adds the type listed to the cards types on clone...
reparse PT bonus on resolve.
reworked bushido, it should now work correctly...aside from that it now excepts word variables...fumiko is now bushido(type:creature[attacking]:battlefield/type:creature[attacking]:battlefield)
added a keyword to access acontrolsteal..the keyword is "steal"
auto=ueot steal target(creature)
reworked persist to handle undying..added the new counter handling rules intruduced by wotc in ISD
added a vector cardsAbilities to mtgcardinstance...this keeps the abilities added to the game for a card to use stored where we can easly alter or remove them.
added an automatic increase to geteff return if the ability is a putinplay ability.
finished coding support for flip and double sided cards, though viewing the "other side" is still not possible yet.
the ability follows the mtg rules.
the ability syntax is flip(card name)...a card can flip into any other card by name...even flip into itself.
added a "canPay() call for Ninja cost...to prevent it from coming up in a menu unless you're in blockers....
added 3 new restriction types that work very similar to type(
thisturn(tc)~morethan~2
lastturn(tc)~lessthan~thisturn(tc)
compare(wordvarible)~equalto~compare(wordvarible)
these are pretty self explanitory.
moved "&&" ability parsing below "this(" allowing "this(" to grant abilities now which contain &&...enclave egologist bug is fixed by this.
fixed an issue with combatspirit link for some reason the way i was doing the bool was not always working.
took care of the todo for AProtectionFrom...you can now give a protection from(blah) in a instant or ueot ability.
added altho very limited right now a "targetedplayer" tc word. i hope to increase this with time.
as always my sidekick doc already has some cards coded for this and test will follow the addition of the cards.
This commit is contained in:
@@ -80,8 +80,8 @@ MTGPlayerCards::~MTGPlayerCards()
|
||||
|
||||
void MTGPlayerCards::beforeBeginPhase()
|
||||
{
|
||||
delete garbage;
|
||||
garbage = NEW MTGGameZone();
|
||||
SAFE_DELETE(garbageLastTurn);
|
||||
garbageLastTurn = garbage = NEW MTGGameZone();
|
||||
garbage->setOwner(this->owner);
|
||||
|
||||
library->beforeBeginPhase();
|
||||
@@ -104,6 +104,7 @@ void MTGPlayerCards::setOwner(Player * player)
|
||||
removedFromGame->setOwner(player);
|
||||
stack->setOwner(player);
|
||||
garbage->setOwner(player);
|
||||
garbageLastTurn->setOwner(player);
|
||||
temp->setOwner(player);
|
||||
}
|
||||
|
||||
@@ -243,7 +244,8 @@ void MTGPlayerCards::drawFromLibrary()
|
||||
}
|
||||
}
|
||||
|
||||
putInZone(toMove, library, hand);
|
||||
if(putInZone(toMove, library, hand))
|
||||
toMove->currentZone = hand;
|
||||
}
|
||||
|
||||
void MTGPlayerCards::resetLibrary()
|
||||
@@ -264,6 +266,7 @@ void MTGPlayerCards::init()
|
||||
removedFromGame = NEW MTGRemovedFromGame();
|
||||
exile = removedFromGame;
|
||||
garbage = NEW MTGGameZone();
|
||||
garbageLastTurn = garbage;
|
||||
temp = NEW MTGGameZone();
|
||||
|
||||
playRestrictions = NEW PlayRestrictions();
|
||||
@@ -298,7 +301,6 @@ MTGCardInstance * MTGPlayerCards::putInHand(MTGCardInstance * card)
|
||||
return putInZone(card, card->currentZone, card->owner->game->hand);
|
||||
}
|
||||
|
||||
|
||||
// Moves a card from one zone to another
|
||||
// If the card is not actually in the expected "from" zone, does nothing and returns null
|
||||
MTGCardInstance * MTGPlayerCards::putInZone(MTGCardInstance * card, MTGGameZone * from, MTGGameZone * to)
|
||||
@@ -410,6 +412,8 @@ MTGGameZone::~MTGGameZone()
|
||||
{
|
||||
for (size_t i = 0; i < cards.size(); i++)
|
||||
{
|
||||
cards[i]->stillNeeded = false;
|
||||
SAFE_DELETE(cards[i]->previous);
|
||||
SAFE_DELETE( cards[i] );
|
||||
}
|
||||
cards.clear();
|
||||
@@ -419,6 +423,11 @@ MTGGameZone::~MTGGameZone()
|
||||
|
||||
void MTGGameZone::beforeBeginPhase()
|
||||
{
|
||||
cardsSeenLastTurn.clear();
|
||||
for(size_t k = 0; k < cardsSeenThisTurn.size(); k++)
|
||||
{
|
||||
cardsSeenLastTurn.push_back(cardsSeenThisTurn[k]);
|
||||
}
|
||||
cardsSeenThisTurn.clear();
|
||||
};
|
||||
|
||||
@@ -631,18 +640,30 @@ bool MTGGameZone::hasAbility(int ability)
|
||||
return false;
|
||||
}
|
||||
|
||||
int MTGGameZone::seenThisTurn(TargetChooser * tc, int castMethod)
|
||||
int MTGGameZone::seenThisTurn(TargetChooser * tc, int castMethod, bool lastTurn)
|
||||
{
|
||||
//The following 2 lines modify the passed TargetChooser. Call this function with care :/
|
||||
tc->setAllZones(); // This is to allow targetting cards without caring about the actual zone
|
||||
tc->targetter = NULL;
|
||||
|
||||
int count = 0;
|
||||
for (vector<MTGCardInstance *>::iterator iter = cardsSeenThisTurn.begin(); iter != cardsSeenThisTurn.end(); ++iter)
|
||||
if (lastTurn)
|
||||
{
|
||||
MTGCardInstance * c = (*iter);
|
||||
if (c->matchesCastFilter(castMethod) && tc->canTarget(c))
|
||||
count++;
|
||||
for (vector<MTGCardInstance *>::iterator iter = cardsSeenLastTurn.begin(); iter != cardsSeenLastTurn.end(); ++iter)
|
||||
{
|
||||
MTGCardInstance * c = (*iter);
|
||||
if (c && c->matchesCastFilter(castMethod) && tc->canTarget(c))
|
||||
count++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (vector<MTGCardInstance *>::iterator iter = cardsSeenThisTurn.begin(); iter != cardsSeenThisTurn.end(); ++iter)
|
||||
{
|
||||
MTGCardInstance * c = (*iter);
|
||||
if (c->matchesCastFilter(castMethod) && tc->canTarget(c))
|
||||
count++;
|
||||
}
|
||||
}
|
||||
return count;
|
||||
}
|
||||
@@ -651,11 +672,19 @@ int MTGGameZone::seenThisTurn(string targetChooserDefinition, int castMethod)
|
||||
{
|
||||
TargetChooserFactory tcf(owner->getObserver());
|
||||
TargetChooser *tc = tcf.createTargetChooser(targetChooserDefinition, NULL);
|
||||
int result = seenThisTurn(tc, castMethod);
|
||||
delete(tc);
|
||||
int result = seenThisTurn(tc, castMethod,false);
|
||||
SAFE_DELETE(tc);
|
||||
return result;
|
||||
}
|
||||
|
||||
int MTGGameZone::seenLastTurn(string targetChooserDefinition, int castMethod)
|
||||
{
|
||||
TargetChooserFactory tcf(owner->getObserver());
|
||||
TargetChooser *tc = tcf.createTargetChooser(targetChooserDefinition, NULL);
|
||||
int result = seenThisTurn(tc, castMethod,true);
|
||||
SAFE_DELETE(tc);
|
||||
return result;
|
||||
}
|
||||
|
||||
void MTGGameZone::cleanupPhase()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user