Improved explores ability, added new trigger to handle the explores event from a card, added/fixed primitives from older sets, fixed RIX dat file.
This commit is contained in:
@@ -1023,6 +1023,42 @@ AAAlterPoison::~AAAlterPoison()
|
||||
{
|
||||
}
|
||||
|
||||
//AA Explores Event
|
||||
AAExploresEvent::AAExploresEvent(GameObserver* observer, int _id, MTGCardInstance * _source, Targetable * _target, ManaCost * _cost,
|
||||
int who) :
|
||||
ActivatedAbilityTP(observer, _id, _source, _target, _cost, who), card(_source)
|
||||
{
|
||||
}
|
||||
|
||||
int AAExploresEvent::resolve()
|
||||
{
|
||||
Damageable * _target = (Damageable *) getTarget();
|
||||
if (_target)
|
||||
{
|
||||
Player * pTarget = (Player*)_target;
|
||||
if(pTarget)
|
||||
{
|
||||
WEvent * e = NEW WEventCardExplored(card);
|
||||
game->receiveEvent(e);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
const string AAExploresEvent::getMenuText()
|
||||
{
|
||||
return "Explores event called";
|
||||
}
|
||||
|
||||
AAExploresEvent * AAExploresEvent::clone() const
|
||||
{
|
||||
return NEW AAExploresEvent(*this);
|
||||
}
|
||||
|
||||
AAExploresEvent::~AAExploresEvent()
|
||||
{
|
||||
}
|
||||
|
||||
//AA Surveil Event
|
||||
AASurveilEvent::AASurveilEvent(GameObserver* observer, int _id, MTGCardInstance * _source, Targetable * _target, ManaCost * _cost,
|
||||
int who) :
|
||||
|
||||
@@ -1222,6 +1222,10 @@ TriggeredAbility * AbilityFactory::parseTrigger(string s, string, int id, Spell
|
||||
if (TargetChooser * tc = parseSimpleTC(s, "surveiled", card))
|
||||
return NEW TrCardSurveiled(observer, id, card, tc, once, limitOnceATurn);
|
||||
|
||||
//Esplores has been performed from controller
|
||||
if (TargetChooser * tc = parseSimpleTC(s, "explored", card))
|
||||
return NEW TrCardExplored(observer, id, card, tc, once, limitOnceATurn);
|
||||
|
||||
//Roll die has been performed from a card
|
||||
if (TargetChooser * tc = parseSimpleTC(s, "dierolled", card)){
|
||||
int rollresult = 0;
|
||||
@@ -3474,6 +3478,16 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
|
||||
return a;
|
||||
}
|
||||
|
||||
//perform explores
|
||||
found = s.find("explores");
|
||||
if (found != string::npos)
|
||||
{
|
||||
Targetable * t = spell ? spell->getNextTarget() : NULL;
|
||||
MTGAbility * a = NEW AAExploresEvent(observer, id, card, t, NULL, who);
|
||||
a->oneShot = 1;
|
||||
return a;
|
||||
}
|
||||
|
||||
//set surveil offset controller (eg. Enhanced Surveillance)
|
||||
vector<string> splitSurveilOffset = parseBetween(s, "altersurvoffset:", " ", false);
|
||||
if (splitSurveilOffset.size())
|
||||
|
||||
@@ -128,7 +128,7 @@ TargetChooser * TargetChooserFactory::createTargetChooser(string s, MTGCardInsta
|
||||
string tmp = s.substr(several+1,idx-1);
|
||||
WParsedInt* parser = NEW WParsedInt(tmp, card);
|
||||
maxtargets = parser->intValue;
|
||||
SAFE_DELETE(parser);
|
||||
SAFE_DELETE(parser);
|
||||
}
|
||||
}
|
||||
several = s.find("<anyamount>");
|
||||
|
||||
@@ -297,6 +297,11 @@ WEventCardSurveiled::WEventCardSurveiled(MTGCardInstance * card) :
|
||||
{
|
||||
}
|
||||
|
||||
WEventCardExplored::WEventCardExplored(MTGCardInstance * card) :
|
||||
WEventCardUpdate(card)
|
||||
{
|
||||
}
|
||||
|
||||
WEventCardRollDie::WEventCardRollDie(MTGCardInstance * card, string playerName) :
|
||||
WEventCardUpdate(card), playerName(playerName)
|
||||
{
|
||||
@@ -526,6 +531,12 @@ Targetable * WEventCardSurveiled::getTarget(int target)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Targetable * WEventCardExplored::getTarget(int target)
|
||||
{
|
||||
if (target) return card;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Targetable * WEventCardRollDie::getTarget(int target)
|
||||
{
|
||||
if (target) return card;
|
||||
|
||||
Reference in New Issue
Block a user