mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 11:18:01 +00:00
- 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:
@@ -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()) {
|
||||
|
||||
@@ -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<Card>() {
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user