changed the target checking function of lifer in Ai training, sometimes it would return the creature as the target and Ai would refuse to use it.

This commit is contained in:
omegablast2002@yahoo.com
2010-11-27 18:53:52 +00:00
parent 6467ab5aa8
commit 01d46fd0d1

View File

@@ -472,17 +472,20 @@ int AIAction::getEfficiency()
if (_target && !_target->isTapped() && p != _target->controller())
{
efficiency = 100;
}
break;
}
case MTGAbility::LIFER:
{
//use life abilities whenever possible.
AALifer * alife = (AALifer *) a;
Targetable * _t = alife->getTarget();
efficiency = 100;
AbilityFactory af;
int suggestion = af.abilityEfficiency(a, p, MODE_ABILITY);
if ((suggestion == BAKA_EFFECT_BAD && p == a->target) || (suggestion == BAKA_EFFECT_GOOD && p
!= a->target))
if ((suggestion == BAKA_EFFECT_BAD && _t == p && p->isAI()) || (suggestion == BAKA_EFFECT_GOOD && _t == p && !p->isAI()))
{
efficiency = 0;
}