Refactored PW Attack Rule

This commit is contained in:
Anthony Calosa
2017-03-01 17:53:40 +08:00
parent 7627a00dce
commit b7dae1025b
7 changed files with 48 additions and 15 deletions
+13 -5
View File
@@ -671,12 +671,20 @@ Player * MTGCardInstance::controller()
return lastController;
}
int MTGCardInstance::canAttack()
int MTGCardInstance::canAttack( bool pwcheck )
{
if (has(Constants::CANTATTACK))
return 0;
if (has(Constants::FLYERSONLY) && !has(Constants::FLYING))
return 0;
if(!pwcheck)
{
if (has(Constants::CANTATTACK))
return 0;
if (has(Constants::FLYERSONLY) && !has(Constants::FLYING))
return 0;
}
else
{
if (has(Constants::CANTPWATTACK))
return 0;
}
if (tapped)
return 0;
if (hasSummoningSickness())