diff --git a/forge-ai/src/main/java/forge/ai/ability/DamageDealAi.java b/forge-ai/src/main/java/forge/ai/ability/DamageDealAi.java index ae994fafa77..8a3a358a8d6 100644 --- a/forge-ai/src/main/java/forge/ai/ability/DamageDealAi.java +++ b/forge-ai/src/main/java/forge/ai/ability/DamageDealAi.java @@ -37,6 +37,10 @@ public class DamageDealAi extends DamageAiBase { Card source = sa.getHostCard(); + if ("MadSarkhanDigDmg".equals(logic)) { + return source.getCounters(CounterType.LOYALTY) == 1; + } + if (damage.equals("X") && sa.getSVar(damage).equals("Count$ChosenNumber")) { int energy = ai.getCounters(CounterType.ENERGY); for (SpellAbility s : source.getSpellAbilities()) { diff --git a/forge-ai/src/main/java/forge/ai/ability/DestroyAi.java b/forge-ai/src/main/java/forge/ai/ability/DestroyAi.java index 8a57983c5b5..3e44a27b3a9 100644 --- a/forge-ai/src/main/java/forge/ai/ability/DestroyAi.java +++ b/forge-ai/src/main/java/forge/ai/ability/DestroyAi.java @@ -75,7 +75,7 @@ public class DestroyAi extends SpellAbilityAi { sa.setTargetingPlayer(targetingPlayer); return targetingPlayer.getController().chooseTargetsFor(sa); } - if ("SarkhanDragon".equals(logic)) { + if ("MadSarkhanDragon".equals(logic)) { // TODO: expand this logic to make the AI force the opponent to sacrifice a big threat bigger than a 5/5 flier? CardCollection creatures = CardLists.filter(ai.getCardsIn(ZoneType.Battlefield), CardPredicates.Presets.CREATURES); boolean hasValidTgt = !CardLists.filter(creatures, new Predicate() { diff --git a/forge-ai/src/main/java/forge/ai/ability/DigAi.java b/forge-ai/src/main/java/forge/ai/ability/DigAi.java index 7426fff4788..a5b4c853c5e 100644 --- a/forge-ai/src/main/java/forge/ai/ability/DigAi.java +++ b/forge-ai/src/main/java/forge/ai/ability/DigAi.java @@ -8,6 +8,7 @@ import forge.ai.SpellAbilityAi; import forge.game.Game; import forge.game.ability.AbilityUtils; import forge.game.card.Card; +import forge.game.card.CounterType; import forge.game.phase.PhaseType; import forge.game.player.Player; import forge.game.player.PlayerActionConfirmMode; @@ -92,6 +93,10 @@ public class DigAi extends SpellAbilityAi { return false; } + if ("MadSarkhanDigDmg".equals(sa.getParam("AILogic"))) { + return host.getCounters(CounterType.LOYALTY) == 1; + } + return !ComputerUtil.preventRunAwayActivations(sa); } diff --git a/forge-gui/res/cardsfolder/s/sarkhan_the_mad.txt b/forge-gui/res/cardsfolder/s/sarkhan_the_mad.txt index 1c50f5e3526..9673d4a5b81 100644 --- a/forge-gui/res/cardsfolder/s/sarkhan_the_mad.txt +++ b/forge-gui/res/cardsfolder/s/sarkhan_the_mad.txt @@ -2,11 +2,11 @@ Name:Sarkhan the Mad ManaCost:3 B R Types:Planeswalker Sarkhan Loyalty:7 -A:AB$ Dig | Cost$ AddCounter<0/LOYALTY> | DigNum$ 1 | Reveal$ True | ChangeNum$ All | ChangeValid$ Card | DestinationZone$ Hand | RememberChanged$ True | SubAbility$ DBDamage | Planeswalker$ True | SpellDescription$ Reveal the top card of your library and put it into your hand. CARDNAME deals damage to himself equal to that card's converted mana cost. -SVar:DBDamage:DB$ DealDamage | Defined$ Self | NumDmg$ Y | SubAbility$ DBCleanup | References$ Y +A:AB$ Dig | Cost$ AddCounter<0/LOYALTY> | DigNum$ 1 | Reveal$ True | ChangeNum$ All | ChangeValid$ Card | DestinationZone$ Hand | RememberChanged$ True | SubAbility$ DBDamage | Planeswalker$ True | AILogic$ MadSarkhanDigDmg | SpellDescription$ Reveal the top card of your library and put it into your hand. CARDNAME deals damage to himself equal to that card's converted mana cost. +SVar:DBDamage:DB$ DealDamage | Defined$ Self | NumDmg$ Y | SubAbility$ DBCleanup | References$ Y | AILogic$ MadSarkhanDigDmg SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True SVar:Y:Remembered$CardManaCost -A:AB$ Destroy | Cost$ SubCounter<2/LOYALTY> | ValidTgts$ Creature | TgtPrompt$ Select target creature | Sacrifice$ True | SubAbility$ DBToken | Planeswalker$ True | AILogic$ SarkhanDragon | SpellDescription$ Target creature's controller sacrifices it, then that player creates a 5/5 red Dragon creature token with flying. +A:AB$ Destroy | Cost$ SubCounter<2/LOYALTY> | ValidTgts$ Creature | TgtPrompt$ Select target creature | Sacrifice$ True | SubAbility$ DBToken | Planeswalker$ True | AILogic$ MadSarkhanDragon | SpellDescription$ Target creature's controller sacrifices it, then that player creates a 5/5 red Dragon creature token with flying. SVar:DBToken:DB$ Token | TokenAmount$ 1 | TokenName$ Dragon | TokenTypes$ Creature,Dragon | TokenOwner$ TargetedController | TokenColors$ Red | TokenPower$ 5 | TokenToughness$ 5 | TokenImage$ r 5 5 dragon WWK | TokenKeywords$ Flying #for this AF, the DefinedCards$ Self is the target for Each damaging. They EachDamage themselves. A:AB$ EachDamage | Cost$ SubCounter<4/LOYALTY> | ValidCards$ Dragon.Creature+YouCtrl | ValidDescription$ Dragon creature you control | NumDmg$ X | DamageDesc$ damage equal to its power | ValidTgts$ Player | TgtPrompt$ Select target player | Planeswalker$ True | Ultimate$ True | References$ X | SpellDescription$ Each Dragon creature you control deals damage equal to its power to target player.