- Added some AI checks to make better use of Steel Overseer.

This commit is contained in:
Sloth
2012-01-07 22:58:37 +00:00
parent 9e0b9f8d78
commit 8fb52e9cb5

View File

@@ -33,6 +33,7 @@ import forge.Constant;
import forge.Constant.Zone;
import forge.Counters;
import forge.MyRandom;
import forge.Phase;
import forge.Player;
import forge.PlayerZone;
import forge.card.cardfactory.CardFactoryUtil;
@@ -1688,6 +1689,24 @@ public class AbilityFactoryCounters {
if (hList.size() >= cList.size()) {
return false;
}
//Check for cards that could profit from the ability
Phase phase = AllZone.getPhase();
if (type.equals("P1P1") && sa.isAbility() && source.isCreature()
&& sa.getPayCosts() != null && sa.getPayCosts().getTap()
&& (phase.isNextTurn(AllZone.getHumanPlayer())
|| phase.isBefore(Constant.Phase.COMBAT_DECLARE_BLOCKERS_INSTANT_ABILITY))) {
boolean combatants = false;
for (Card c : hList) {
if (!c.equals(source) && c.isUntapped()) {
combatants = true;
break;
}
}
if (!combatants) {
return false;
}
}
}
final AbilitySub subAb = sa.getSubAbility();
@@ -1695,6 +1714,10 @@ public class AbilityFactoryCounters {
chance &= subAb.chkAIDrawback();
}
if (AbilityFactory.playReusable(sa)) {
return chance;
}
return ((r.nextFloat() < .6667) && chance);
}