Switching PT, Token Indicator

Added Switching PT like Layer 7e, Token Indicator for cloned Cards
This commit is contained in:
Anthony Calosa
2015-09-19 23:25:33 +08:00
parent 8e15ad7ed0
commit c372ffa111
9 changed files with 150 additions and 43 deletions
+21
View File
@@ -55,6 +55,7 @@ MTGCardInstance::MTGCardInstance(MTGCard * card, MTGPlayerCards * arg_belongs_to
castMethod = Constants::NOT_CAST;
isSettingBase = 0;
isCDA = false;
isSwitchedPT = false;
}
MTGCardInstance * MTGCardInstance::createSnapShot()
@@ -695,6 +696,26 @@ void MTGCardInstance::cdaPT(int p, int t)
applyPTbonus();
}
void MTGCardInstance::switchPT(bool apply)
{
stripPTbonus();
swapP = power;
swapT = toughness;
power += origpower;
power -= swapP;
addToToughness(origtoughness);
addToToughness(-swapT);
applyPTbonus();
if(apply)
{
swapP = toughness;
swapT = power;
addToToughness(swapT);
addToToughness(-swapP);
setPower(swapP);
}
}
int MTGCardInstance::canBlock()
{
if (tapped)