add some cards
also added countb() - countedbamount..
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
#include "PrecompiledHeader.h"
|
||||
|
||||
|
||||
#include "AIHints.h"
|
||||
#include "AIPlayerBaka.h"
|
||||
#include "utils.h"
|
||||
|
||||
@@ -5209,6 +5209,30 @@ AACountObject * AACountObject::clone() const
|
||||
{
|
||||
return NEW AACountObject(*this);
|
||||
}
|
||||
//count objects on field before doing an effect
|
||||
AACountObjectB::AACountObjectB(GameObserver* observer, int id, MTGCardInstance * card, MTGCardInstance *, ManaCost * _cost, string value) :
|
||||
ActivatedAbility(observer, id, card, _cost, 0), value(value)
|
||||
{
|
||||
}
|
||||
|
||||
int AACountObjectB::resolve()
|
||||
{
|
||||
|
||||
if (source)
|
||||
{
|
||||
int amount = 0;
|
||||
WParsedInt * use = NEW WParsedInt(value, NULL, source);
|
||||
amount = use->getValue();
|
||||
source->CountedObjectsB = amount;
|
||||
SAFE_DELETE(use);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
AACountObjectB * AACountObjectB::clone() const
|
||||
{
|
||||
return NEW AACountObjectB(*this);
|
||||
}
|
||||
|
||||
// Win Game
|
||||
AAWinGame::AAWinGame(GameObserver* observer, int _id, MTGCardInstance * card, Targetable * _target, ManaCost * _cost, int who) :
|
||||
|
||||
@@ -4118,6 +4118,14 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
|
||||
return a;
|
||||
}
|
||||
|
||||
vector<string> splitCountObjectB = parseBetween(s, "countb(", ")", false);
|
||||
if (splitCountObjectB.size())
|
||||
{
|
||||
MTGAbility * a = NEW AACountObjectB(observer, id, card, card, NULL, splitCountObjectB[1]);
|
||||
a->oneShot = 1;
|
||||
return a;
|
||||
}
|
||||
|
||||
//switch targest power with toughness
|
||||
found = s.find("swap");
|
||||
if (found != string::npos)
|
||||
|
||||
@@ -286,6 +286,7 @@ void MTGCardInstance::initMTGCI()
|
||||
currentimprintName = "";
|
||||
imprintedNames.clear();
|
||||
CountedObjects = 0;
|
||||
CountedObjectsB = 0;
|
||||
|
||||
for (int i = 0; i < ManaCost::MANA_PAID_WITH_SUSPEND +1; i++)
|
||||
alternateCostPaid[i] = 0;
|
||||
|
||||
Reference in New Issue
Block a user