Improve Crackling Doom logic

This commit is contained in:
tool4EvEr
2021-07-28 07:15:10 +02:00
parent ef7ff4dd66
commit 9a621f2179
3 changed files with 7 additions and 2 deletions

View File

@@ -162,6 +162,12 @@ public class DamageDealAi extends DamageAiBase {
String logic = sa.getParamOrDefault("AILogic", "");
if ("DiscardLands".equals(logic)) {
dmg = 2;
} else if ("OpponentHasCreatures".equals(logic)) {
for (Player opp : ai.getOpponents()) {
if (!opp.getCreaturesInPlay().isEmpty()){
return true;
}
}
} else if (logic.startsWith("ProcRaid.")) {
if (ai.getGame().getPhaseHandler().isPlayerTurn(ai) && ai.getGame().getPhaseHandler().getPhase().isBefore(PhaseType.COMBAT_DECLARE_BLOCKERS)) {
for (Card potentialAtkr : ai.getCreaturesInPlay()) {

View File

@@ -47,7 +47,6 @@ public class DamageEachAi extends DamageAiBase {
*/
@Override
protected boolean doTriggerAINoCost(Player ai, SpellAbility sa, boolean mandatory) {
return mandatory || canPlayAI(ai, sa);
}

View File

@@ -1,7 +1,7 @@
Name:Crackling Doom
ManaCost:R W B
Types:Instant
A:SP$ DealDamage | Cost$ R B W | Defined$ Player.Opponent | NumDmg$ 2 | SubAbility$ DBRepeat | SpellDescription$ CARDNAME deals 2 damage to each opponent. Each opponent sacrifices a creature with the greatest power among creatures that player controls.
A:SP$ DealDamage | Cost$ R B W | Defined$ Player.Opponent | NumDmg$ 2 | SubAbility$ DBRepeat | AILogic$ OpponentHasCreatures | SpellDescription$ CARDNAME deals 2 damage to each opponent. Each opponent sacrifices a creature with the greatest power among creatures that player controls.
SVar:DBRepeat:DB$ RepeatEach | RepeatPlayers$ Player.Opponent | RepeatSubAbility$ DBChooseCard | SubAbility$ DBSac
SVar:DBChooseCard:DB$ ChooseCard | Defined$ Player.IsRemembered | Choices$ Creature.greatestPowerControlledByRemembered | ChoiceTitle$ Choose a creature you control with the greatest power | Mandatory$ True | RememberChosen$ True
SVar:DBSac:DB$ SacrificeAll | ValidCards$ Card.IsRemembered | SubAbility$ DBCleanup | StackDescription$ Each opponent sacrifices a creature with the greatest power among creatures they control.