mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 12:48:00 +00:00
- Added some AI checks to make better use of Steel Overseer.
This commit is contained in:
@@ -33,6 +33,7 @@ import forge.Constant;
|
|||||||
import forge.Constant.Zone;
|
import forge.Constant.Zone;
|
||||||
import forge.Counters;
|
import forge.Counters;
|
||||||
import forge.MyRandom;
|
import forge.MyRandom;
|
||||||
|
import forge.Phase;
|
||||||
import forge.Player;
|
import forge.Player;
|
||||||
import forge.PlayerZone;
|
import forge.PlayerZone;
|
||||||
import forge.card.cardfactory.CardFactoryUtil;
|
import forge.card.cardfactory.CardFactoryUtil;
|
||||||
@@ -1688,6 +1689,24 @@ public class AbilityFactoryCounters {
|
|||||||
if (hList.size() >= cList.size()) {
|
if (hList.size() >= cList.size()) {
|
||||||
return false;
|
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();
|
final AbilitySub subAb = sa.getSubAbility();
|
||||||
@@ -1695,6 +1714,10 @@ public class AbilityFactoryCounters {
|
|||||||
chance &= subAb.chkAIDrawback();
|
chance &= subAb.chkAIDrawback();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (AbilityFactory.playReusable(sa)) {
|
||||||
|
return chance;
|
||||||
|
}
|
||||||
|
|
||||||
return ((r.nextFloat() < .6667) && chance);
|
return ((r.nextFloat() < .6667) && chance);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user