fixed a reported issue, find it a bit strange tho, as everything else can be adressed in this method without being so specific ie: using hasColor(blah) as in the way "fear" was added in here without addressing "this"....just to be on the safe side im going to specify "this->" becuase doing it without it was returning as tho it could not block even tho the creature did not have "weak"
i suspect this could be true with the intemidate and fear...
This commit is contained in:
@@ -583,18 +583,18 @@ int MTGCardInstance::canBlock(MTGCardInstance * opponent)
|
|||||||
return 0;
|
return 0;
|
||||||
if(opponent->basicAbilities[Constants::STRONG] && power < opponent->power)
|
if(opponent->basicAbilities[Constants::STRONG] && power < opponent->power)
|
||||||
return 0;
|
return 0;
|
||||||
if(has(basicAbilities[Constants::WEAK]) && power < opponent->power)
|
if(this->basicAbilities[Constants::WEAK] && power < opponent->power)
|
||||||
return 0;
|
return 0;
|
||||||
if (opponent->basicAbilities[Constants::FEAR] && !(hasType(Subtypes::TYPE_ARTIFACT) || hasColor(Constants::MTG_COLOR_BLACK)))
|
if (opponent->basicAbilities[Constants::FEAR] && !(this->hasType(Subtypes::TYPE_ARTIFACT) || this->hasColor(Constants::MTG_COLOR_BLACK)))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
//intimidate
|
//intimidate
|
||||||
if (opponent->basicAbilities[Constants::INTIMIDATE] && !(hasType(Subtypes::TYPE_ARTIFACT)))
|
if (opponent->basicAbilities[Constants::INTIMIDATE] && !(this->hasType(Subtypes::TYPE_ARTIFACT)))
|
||||||
{
|
{
|
||||||
int canblock = 0;
|
int canblock = 0;
|
||||||
for (int i = Constants::MTG_COLOR_GREEN; i <= Constants::MTG_COLOR_WHITE; ++i)
|
for (int i = Constants::MTG_COLOR_GREEN; i <= Constants::MTG_COLOR_WHITE; ++i)
|
||||||
{
|
{
|
||||||
if (hasColor(i) && opponent->hasColor(i))
|
if (this->hasColor(i) && opponent->hasColor(i))
|
||||||
{
|
{
|
||||||
canblock = 1;
|
canblock = 1;
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user