Merge branch 'master' into 'master'

Rankle, Master of Pranks: improve logic a little

See merge request core-developers/forge!3938
This commit is contained in:
Michael Kamensky
2021-02-20 06:25:25 +00:00
3 changed files with 13 additions and 5 deletions

View File

@@ -130,12 +130,20 @@ public class DiscardAi extends SpellAbilityAi {
}
}
// Don't use draw abilities before main 2 if possible
// Don't use discard abilities before main 2 if possible
if (ai.getGame().getPhaseHandler().getPhase().isBefore(PhaseType.MAIN2)
&& !sa.hasParam("ActivationPhases")) {
&& !sa.hasParam("ActivationPhases") && !aiLogic.startsWith("AnyPhase")) {
return false;
}
if (aiLogic.equals("AnyPhaseIfFavored")) {
if (ai.getGame().getCombat() != null) {
if (ai.getCardsIn(ZoneType.Hand).size() < ai.getGame().getCombat().getDefenderPlayerByAttacker(source).getCardsIn(ZoneType.Hand).size()) {
return false;
}
}
}
// Don't tap creatures that may be able to block
if (ComputerUtil.waitForBlocking(sa)) {
return false;

View File

@@ -137,7 +137,7 @@ public class LifeLoseAi extends SpellAbilityAi {
// Don't use loselife before main 2 if possible
if (ai.getGame().getPhaseHandler().getPhase().isBefore(PhaseType.MAIN2) && !sa.hasParam("ActivationPhases")
&& !ComputerUtil.castSpellInMain1(ai, sa)) {
&& !ComputerUtil.castSpellInMain1(ai, sa) && !"AnyPhase".equals(sa.getParam("AILogic"))) {
return false;
}

View File

@@ -6,8 +6,8 @@ K:Flying
K:Haste
T:Mode$ DamageDone | ValidSource$ Card.Self | ValidTarget$ Player | CombatDamage$ True | Execute$ TrigCharm | TriggerDescription$ Whenever CARDNAME deals combat damage to a player, ABILITY
SVar:TrigCharm:DB$ Charm | Choices$ DBDiscard,DBLoseLife,DBSac | MinCharmNum$ 0 | CharmNum$ 3
SVar:DBDiscard:DB$ Discard | NumCards$ 1 | Mode$ TgtChoose | Defined$ Player | SpellDescription$ Each player discards a card.
SVar:DBLoseLife:DB$ LoseLife | LifeAmount$ 1 | Defined$ Player | SubAbility$ DBDraw | SpellDescription$ Each player loses 1 life and draws a card.
SVar:DBDiscard:DB$ Discard | NumCards$ 1 | Mode$ TgtChoose | Defined$ Player | AILogic$ AnyPhaseIfFavored | SpellDescription$ Each player discards a card.
SVar:DBLoseLife:DB$ LoseLife | LifeAmount$ 1 | Defined$ Player | SubAbility$ DBDraw | AILogic$ AnyPhase | SpellDescription$ Each player loses 1 life and draws a card.
SVar:DBDraw:DB$ Draw | Defined$ Player | NumCards$ 1 | StackDescription$ None
SVar:DBSac:DB$ Sacrifice | SacValid$ Creature | Defined$ Player | SpellDescription$ Each player sacrifices a creature.
Oracle:Flying, haste\nWhenever Rankle, Master of Pranks deals combat damage to a player, choose any number —\n• Each player discards a card.\n• Each player loses 1 life and draws a card.\n• Each player sacrifices a creature.