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

@@ -10,8 +10,8 @@
SUPPORT_OBJECT_ANALYTICS(ExtraCost)
ExtraCost::ExtraCost(const std::string& inCostRenderString, TargetChooser *_tc)
: tc(_tc), source(NULL), target(NULL), mCostRenderString(inCostRenderString)
ExtraCost::ExtraCost(const std::string& inCostRenderString, TargetChooser *_tc, ManaCost * _costToPay)
: tc(_tc),costToPay(_costToPay), source(NULL), target(NULL), mCostRenderString(inCostRenderString)
{
if (tc)
tc->targetter = NULL;
@@ -19,6 +19,7 @@ ExtraCost::ExtraCost(const std::string& inCostRenderString, TargetChooser *_tc)
ExtraCost::~ExtraCost()
{
SAFE_DELETE(costToPay);
SAFE_DELETE(tc);
}
@@ -61,8 +62,56 @@ int ExtraCost::setPayment(MTGCardInstance * card)
target = card;
}
}
if (costToPay && source->controller()->getManaPool()->canAfford(costToPay))
{
result = 1;
}
return result;
}
//extra added manacost, or add a manacost as the cost of extra
extraManaCost * extraManaCost::clone() const
{
extraManaCost * ec = NEW extraManaCost(*this);
return ec;
}
extraManaCost::extraManaCost(ManaCost * costToPay)
: ExtraCost("Pay The Cost",NULL, costToPay)
{
}
int extraManaCost::tryToSetPayment(MTGCardInstance * card)
{
return 1;
}
int extraManaCost::isPaymentSet()
{
if (!source->controller()->getManaPool()->canAfford(costToPay))
{
return 0;
}
return 1;
}
int extraManaCost::canPay()
{
MTGCardInstance * _target = (MTGCardInstance *) target;
if(!source->controller()->getManaPool()->canAfford(costToPay))
{
return 0;
}
return 1;
}
int extraManaCost::doPay()
{
if (!source->controller()->getManaPool()->canAfford(costToPay))
return 0;
source->controller()->getManaPool()->pay(costToPay);
return 1;
}
//life cost
LifeCost * LifeCost::clone() const