megapatch contents

added
"whenever a creature enters the battlefield you may pay {1}, if you do gain one life"
conditional may pay({cost}) effect 
this version is a super type ability, and can only be used in certain combos.

to nest you will need to use it in its subtype pay[[{cost}]] effect
pay keyword can have sideeffects coded as follows
pay[[{1}]] life:1?life:-1
pay one mana and gain 1 life, if you dont then you lose one life. notice no space between the abilities and the question mark.

added castcard()
a method to cast a targeted card, this contains the following subkeywords which can be used in combinations
(normal)
(restricted)
(copied)
(noevent)
castcard(restricted copied noevent) for example will cast a card that is a copy or the spell without sending a cast event only when the spell is castable.
"normal" subkeyword cast the actual spell, not a copy.

extended the use of exiledeath to everyzone, any card going from any zone to graveyard is placed in exile if it has exiledeath.

limited swipe left to open hand only when hand is closed view.

"moveto(" can now be named.
This commit is contained in:
omegablast2002@yahoo.com
2013-06-18 01:41:34 +00:00
parent ece78395f4
commit b61cd2f69a
22 changed files with 937 additions and 101 deletions

View File

@@ -87,7 +87,17 @@ TargetChooser * TargetChooserFactory::createTargetChooser(string s, MTGCardInsta
if (s.length() > 7 && s.find("[") == 7)
{
string s1 = s.substr(7, s.find("]"));
if (s1.find("to") != string::npos) return NEW TriggerTargetChooser(observer, WEvent::TARGET_TO);
if (s1.find("to") != string::npos)
{
if(s1.find("<1>") != string::npos)
{
TriggerTargetChooser * ttc = NEW TriggerTargetChooser(observer, WEvent::TARGET_TO);
ttc->maxtargets = 1;
return ttc;
}
else
return NEW TriggerTargetChooser(observer, WEvent::TARGET_TO);
}
if (s1.find("from") != string::npos) return NEW TriggerTargetChooser(observer, WEvent::TARGET_FROM);
}
return NEW TriggerTargetChooser(observer, 1);
@@ -606,6 +616,16 @@ TargetChooser * TargetChooserFactory::createTargetChooser(string s, MTGCardInsta
}
}
if (attribute.find("iscolorless") != string::npos)
{
attributefound = 1;
for (int cid = 1; cid < Constants::NB_Colors; cid++)
{
cd->SetExclusionColor(cid);
}
cd->mode = CD_OR;
}
if (attribute.find("chosencolor") != string::npos)
{
attributefound = 1;
@@ -688,6 +708,12 @@ TargetChooser * TargetChooserFactory::createTargetChooser(string s, MTGCardInsta
{
return NEW CardTargetChooser(observer, card, card, zones, nbzones);
}
else if (typeName.compare("sourcecard") == 0)
{
CardTargetChooser * ctc = NEW CardTargetChooser(observer, card, card, zones, nbzones);
ctc->setAllZones();
return ctc;
}
else if (typeName.compare("mystored") == 0)
{
return NEW CardTargetChooser(observer, card->storedSourceCard, card, zones, nbzones);
@@ -1488,6 +1514,13 @@ bool TriggerTargetChooser::targetsZone(MTGGameZone *)
bool TriggerTargetChooser::canTarget(Targetable * _target,bool)
{
//something is wrong with trigger[to] not allowing us to target stack.
if(Spell * spell = dynamic_cast<Spell *>(_target))
{
MTGCardInstance * card = spell->source;
if(card == target)
return true;
}
if (_target == target) return true;
return false;
}