- Hermit Druid: added AILogic$ DontMillSelf

This commit is contained in:
Agetian
2017-09-02 16:31:07 +00:00
parent 905b469515
commit f9569895b4
2 changed files with 13 additions and 2 deletions

View File

@@ -21,6 +21,7 @@ public class DigUntilAi extends SpellAbilityAi {
@Override
protected boolean canPlayAI(Player ai, SpellAbility sa) {
Card source = sa.getHostCard();
final String logic = sa.getParamOrDefault("AILogic", "");
double chance = .4; // 40 percent chance with instant speed stuff
if (SpellAbilityAi.isSorcerySpeed(sa)) {
chance = .667; // 66.7% chance for sorcery speed (since it will
@@ -32,6 +33,16 @@ public class DigUntilAi extends SpellAbilityAi {
Player libraryOwner = ai;
Player opp = ComputerUtil.getOpponentFor(ai);
if ("DontMillSelf".equals(logic)) {
// A card that digs for specific things and puts everything revealed before it into graveyard
// (e.g. Hermit Druid) - don't use it to mill itself and also make sure there's enough playable
// material in the library after using it several times.
// TODO: maybe this should happen for any DigUntil SA with RevealedDestination$ Graveyard?
if (ai.getCardsIn(ZoneType.Library).size() < 20) {
return false;
}
}
if (sa.usesTargeting()) {
sa.resetTargets();
if (!sa.canTarget(opp)) {

View File

@@ -2,7 +2,7 @@ Name:Hermit Druid
ManaCost:1 G
Types:Creature Human Druid
PT:1/1
A:AB$ DigUntil | Cost$ G T | Valid$ Land.Basic | ValidDescription$ basic land | FoundDestination$ Hand | RevealedDestination$ Graveyard | SpellDescription$ Reveal cards from the top of your library until you reveal a basic land card. Put that card into your hand and all other cards revealed this way into your graveyard.
A:AB$ DigUntil | Cost$ G T | Valid$ Land.Basic | ValidDescription$ basic land | FoundDestination$ Hand | RevealedDestination$ Graveyard | AILogic$ DontMillSelf | SpellDescription$ Reveal cards from the top of your library until you reveal a basic land card. Put that card into your hand and all other cards revealed this way into your graveyard.
SVar:RemRandomDeck:True
SVar:Picture:http://www.wizards.com/global/images/magic/general/hermit_druid.jpg
Oracle:{G}, {T}: Reveal cards from the top of your library until you reveal a basic land card. Put that card into your hand and all other cards revealed this way into your graveyard.