corrected my logic, for some reason i remember clearly already having moved this line, but i guess it didn't make it into the last change i did to choosecard function. THIS is what it was meant to do...

also corrected an issue with the changed logic of ALife eff return. you have to take into account that "{cost}:life:200" <---is not targeted so there is no player targeting involved with such code, making the eff return always 0 in cases where you don't have {cost}:target(player) life:200...i might need to review the eff returns to check that there are not other cases similar to this, :P my original code there was messy but took that into account. so careful with refactors in this area.
to see how this function was intended to work, try the following lines on any card

auto={t(creature|opponentbattlefield)}:life:233
auto={s(creature|mybattlefield)}:damage:4 target(player)
This commit is contained in:
omegablast2002@yahoo.com
2011-10-11 11:14:55 +00:00
parent e1620c0a5f
commit 6fa016ca54

View File

@@ -408,7 +408,12 @@ int OrderedAIAction::getEfficiency()
AbilityFactory af(g);
int suggestion = af.abilityEfficiency(a, p, MODE_ABILITY);
if ((suggestion == BAKA_EFFECT_BAD && _t == p) || (suggestion == BAKA_EFFECT_GOOD && _t != p))
if(_t->typeAsTarget() == TARGET_CARD)
{
if((suggestion == BAKA_EFFECT_BAD && ((MTGCardInstance*)_t)->controller() == p) || (suggestion == BAKA_EFFECT_GOOD && ((MTGCardInstance*)_t)->controller() != p))
efficiency = 0;
}
else if ((suggestion == BAKA_EFFECT_BAD && _t == p) || (suggestion == BAKA_EFFECT_GOOD && _t != p))
{
efficiency = 0;
}
@@ -617,9 +622,9 @@ int AIPlayerBaka::getEfficiency(OrderedAIAction * action)
MTGCardInstance * AIPlayerBaka::chooseCard(TargetChooser * tc, MTGCardInstance * source, int random)
{
MTGPlayerCards * playerZones = source->controller()->game;
MTGGameZone * zones[] = { playerZones->hand, playerZones->library, playerZones->inPlay, playerZones->graveyard,playerZones->stack };
for(int players = 0; players < 2;++players)
{
MTGGameZone * zones[] = { playerZones->hand, playerZones->library, playerZones->inPlay, playerZones->graveyard,playerZones->stack };
for (int j = 0; j < 5; j++)
{
MTGGameZone * zone = zones[j];