- Allow Sarkhan the Mad AI to use the 0 ability as a source of card advantage when Sarkhan is low on loyalty.

This commit is contained in:
Agetian
2017-06-24 14:06:26 +00:00
parent adefa11d3a
commit 174444e3b5
4 changed files with 13 additions and 4 deletions

View File

@@ -37,6 +37,10 @@ public class DamageDealAi extends DamageAiBase {
Card source = sa.getHostCard(); Card source = sa.getHostCard();
if ("MadSarkhanDigDmg".equals(logic)) {
return source.getCounters(CounterType.LOYALTY) == 1;
}
if (damage.equals("X") && sa.getSVar(damage).equals("Count$ChosenNumber")) { if (damage.equals("X") && sa.getSVar(damage).equals("Count$ChosenNumber")) {
int energy = ai.getCounters(CounterType.ENERGY); int energy = ai.getCounters(CounterType.ENERGY);
for (SpellAbility s : source.getSpellAbilities()) { for (SpellAbility s : source.getSpellAbilities()) {

View File

@@ -75,7 +75,7 @@ public class DestroyAi extends SpellAbilityAi {
sa.setTargetingPlayer(targetingPlayer); sa.setTargetingPlayer(targetingPlayer);
return targetingPlayer.getController().chooseTargetsFor(sa); 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? // 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); CardCollection creatures = CardLists.filter(ai.getCardsIn(ZoneType.Battlefield), CardPredicates.Presets.CREATURES);
boolean hasValidTgt = !CardLists.filter(creatures, new Predicate<Card>() { boolean hasValidTgt = !CardLists.filter(creatures, new Predicate<Card>() {

View File

@@ -8,6 +8,7 @@ import forge.ai.SpellAbilityAi;
import forge.game.Game; import forge.game.Game;
import forge.game.ability.AbilityUtils; import forge.game.ability.AbilityUtils;
import forge.game.card.Card; import forge.game.card.Card;
import forge.game.card.CounterType;
import forge.game.phase.PhaseType; import forge.game.phase.PhaseType;
import forge.game.player.Player; import forge.game.player.Player;
import forge.game.player.PlayerActionConfirmMode; import forge.game.player.PlayerActionConfirmMode;
@@ -92,6 +93,10 @@ public class DigAi extends SpellAbilityAi {
return false; return false;
} }
if ("MadSarkhanDigDmg".equals(sa.getParam("AILogic"))) {
return host.getCounters(CounterType.LOYALTY) == 1;
}
return !ComputerUtil.preventRunAwayActivations(sa); return !ComputerUtil.preventRunAwayActivations(sa);
} }

View File

@@ -2,11 +2,11 @@ Name:Sarkhan the Mad
ManaCost:3 B R ManaCost:3 B R
Types:Planeswalker Sarkhan Types:Planeswalker Sarkhan
Loyalty:7 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. 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 SVar:DBDamage:DB$ DealDamage | Defined$ Self | NumDmg$ Y | SubAbility$ DBCleanup | References$ Y | AILogic$ MadSarkhanDigDmg
SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True
SVar:Y:Remembered$CardManaCost 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 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. #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. 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.