add some cards

also added countb() - countedbamount..
This commit is contained in:
Anthony Calosa
2017-03-19 21:57:59 +08:00
parent fa69686f0a
commit eb8370b86b
9 changed files with 91 additions and 23 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
#include "PrecompiledHeader.h"
#include "AIHints.h"
#include "AIPlayerBaka.h"
#include "utils.h"
+24
View File
@@ -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) :
+8
View File
@@ -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)
+1
View File
@@ -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;