forcing eff of ability modifying to 0 if creature already has it.
This commit is contained in:
@@ -429,12 +429,6 @@ int AIAction::getEfficiency()
|
||||
efficiency = 10;
|
||||
MTGCardInstance * _target = (MTGCardInstance *) (a->target);
|
||||
//ensuring that Ai grants abilities to creatures during first main, so it can actually use them in combat.
|
||||
if (_target && !_target->has(a->abilitygranted) && g->getCurrentGamePhase() == Constants::MTG_PHASE_FIRSTMAIN)
|
||||
{
|
||||
//trying to avoid Ai giving ie:flying creatures ie:flying twice.
|
||||
efficiency += (15 * _target->DangerRanking());
|
||||
|
||||
}
|
||||
if (target)
|
||||
{
|
||||
AbilityFactory af;
|
||||
@@ -446,10 +440,20 @@ int AIAction::getEfficiency()
|
||||
efficiency = 0;
|
||||
//stop giving trample to the players creatures.
|
||||
}
|
||||
if (suggestion == BAKA_EFFECT_BAD && p != target->controller() && target->has(a->abilitygranted))
|
||||
if (suggestion == BAKA_EFFECT_BAD && p != _target->controller() && _target->has(a->abilitygranted))
|
||||
{
|
||||
efficiency += (15 * _target->DangerRanking());
|
||||
}
|
||||
}
|
||||
if (_target && !_target->has(a->abilitygranted) && g->getCurrentGamePhase() == Constants::MTG_PHASE_FIRSTMAIN)
|
||||
{
|
||||
efficiency += (15 * _target->DangerRanking());
|
||||
|
||||
}
|
||||
if (_target && _target->has(a->abilitygranted))
|
||||
{
|
||||
//trying to avoid Ai giving ie:flying creatures ie:flying twice.
|
||||
efficiency = 0;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user