Doomsday Confluence and support (#4012)

* Doomsday Confluence and support

* Clean up

* Fix NPE

* +AIhint

---------

Co-authored-by: tool4EvEr <tool4EvEr@192.168.0.60>
This commit is contained in:
tool4ever
2023-10-28 17:54:12 +02:00
committed by GitHub
parent 7a48757083
commit b638d7f35d
12 changed files with 59 additions and 43 deletions

View File

@@ -1,9 +1,8 @@
Name:Braids's Frightful Return
ManaCost:2 B
Types:Enchantment Saga
K:Read ahead:3:DBSacrifice,DBChangeZone,DBSacrificeOpp
SVar:DBSacrifice:DB$ Sacrifice | Optional$ True | Defined$ You | RememberSacrificed$ True | SacValid$ Creature | Amount$ 1 | SubAbility$ DBDiscard | SpellDescription$ You may sacrifice a creature. If you do, each opponent discards a card.
SVar:DBDiscard:DB$ Discard | Mode$ TgtChoose | Defined$ Player.Opponent | ConditionDefined$ Remembered | ConditionPresent$ Card | ConditionCompare$ GE1 | NumCards$ 1 | SubAbility$ DBCleanup
K:Read ahead:3:ABDiscard,DBChangeZone,DBSacrificeOpp
SVar:ABDiscard:AB$ Discard | Cost$ Sac<1/Creature> | CostDesc$ You may sacrifice a creature. | Mode$ TgtChoose | Defined$ Opponent | SpellDescription$ If you do, each opponent discards a card.
SVar:DBChangeZone:DB$ ChangeZone | Origin$ Graveyard | Destination$ Hand | ValidTgts$ Creature.YouOwn | SpellDescription$ Return target creature card from your graveyard to your hand.
SVar:DBSacrificeOpp:DB$ Sacrifice | ValidTgts$ Opponent | Optional$ True | SacValid$ Permanent.nonLand+nonToken | RememberSacrificed$ True | SubAbility$ DBDraw | SpellDescription$ Target opponent may sacrifice a nonland, nontoken permanent. If they don't, they lose 2 life and you draw a card.
SVar:DBDraw:DB$ Draw | ConditionDefined$ Remembered | ConditionPresent$ Card | ConditionCompare$ EQ0 | SubAbility$ DBLoseLife

View File

@@ -4,6 +4,6 @@ Types:Enchantment Aura
K:Enchant creature
A:SP$ Attach | Cost$ R | ValidTgts$ Creature | AILogic$ Curse
S:Mode$ Continuous | Affected$ Creature.EnchantedBy | AddToughness$ -1 | Description$ Enchanted creature gets -0/-1 and can't block creatures with power equal to or greater than the enchanted creature's toughness.
S:Mode$ CantBlockBy | ValidAttackerRelative$ Creature.powerGEIronclawX | ValidBlocker$ Creature.EnchantedBy | Description$ Enchanted creature can't block creatures with power equal to or greater than the enchanted creature's toughness.
S:Mode$ CantBlockBy | ValidAttackerRelative$ Creature.powerGEIronclawX | ValidBlocker$ Creature.EnchantedBy | Secondary$ True | Description$ Enchanted creature can't block creatures with power equal to or greater than the enchanted creature's toughness.
SVar:IronclawX:Count$CardToughness
Oracle:Enchant creature\nEnchanted creature gets -0/-1.\nEnchanted creature can't block creatures with power equal to or greater than the enchanted creature's toughness.

View File

@@ -0,0 +1,11 @@
Name:Doomsday Confluence
ManaCost:X X B
Types:Sorcery
A:SP$ Charm | CharmNum$ X | Choices$ DBSac,DBToken,DBDiscard | CanRepeatModes$ True
SVar:DBSac:DB$ Sacrifice | Defined$ Player | SacValid$ Creature.nonArtifact | SpellDescription$ Each player sacrifices a nonartifact creature.
SVar:DBToken:DB$ Token | TokenScript$ b_3_3_a_dalek_menace | SpellDescription$ Create a 3/3 black Dalek artifact creature token with menace.
SVar:DBDiscard:DB$ Discard | Defined$ Opponent | Mode$ TgtChoose | SpellDescription$ Each opponent discards a card.
SVar:X:Count$xPaid
DeckHas:Ability$Sacrifice|Token|Discard & Type$Artifact|Dalek
AI:RemoveDeck:All
Oracle:Choose X. You may choose the same mode more than once.\n• Each player sacrifices a nonartifact creature.\n• Create a 3/3 black Dalek artifact creature token with menace.\n• Each opponent discards a card.

View File

@@ -1,11 +1,9 @@
Name:The Huntsman's Redemption
ManaCost:2 G
Types:Enchantment Saga
K:Saga:3:DBToken,DBSearch,DBPump
K:Saga:3:DBToken,ABSearch,DBPump
SVar:DBToken:DB$ Token | TokenAmount$ 1 | TokenScript$ g_3_3_beast | TokenOwner$ You | SpellDescription$ Create a 3/3 green Beast creature token.
SVar:DBSearch:DB$ Sacrifice | SacValid$ Creature | SacMessage$ creature | Optional$ True | RememberSacrificed$ True | SubAbility$ DBChangeZone | SpellDescription$ You may sacrifice a creature. If you do, search your library for a creature or basic land card, reveal it, put it into your hand, then shuffle.
SVar:DBChangeZone:DB$ ChangeZone | Origin$ Library | Destination$ Hand | ConditionDefined$ Remembered | ConditionPresent$ Card | ChangeType$ Land.Basic,Creature | SubAbility$ DBCleanup | ChangeNum$ 1
SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True
SVar:ABSearch:AB$ ChangeZone | Cost$ Sac<1/Creature> | CostDesc$ You may sacrifice a creature. | Origin$ Library | Destination$ Hand | ChangeType$ Land.Basic,Creature | ChangeNum$ 1 | SpellDescription$ If you do, search your library for a creature or basic land card, reveal it, put it into your hand, then shuffle.
SVar:DBPump:DB$ Pump | ValidTgts$ Creature | NumAtt$ +2 | NumDef$ +2 | TgtPrompt$ Select up to two target creatures | TargetMin$ 0 | TargetMax$ 2 | KW$ Trample | SpellDescription$ Up to two target creatures each get +2/+2 and gain trample until end of turn
DeckHas:Ability$Token|Sacrifice & Type$Beast
Oracle:I — Create a 3/3 green Beast creature token.\nII — You may sacrifice a creature. If you do, search your library for a creature or basic land card, reveal it, put it into your hand, then shuffle.\nIII — Up to two target creatures each get +2/+2 and gain trample until end of turn

View File

@@ -2,7 +2,7 @@ Name:Yenna, Redtooth Regent
ManaCost:2 G W
Types:Legendary Creature Elf Noble
PT:4/4
A:AB$ CopyPermanent | Cost$ 2 T | Defined$ Targeted | RememberTokens$ True | NonLegendary$ True | ValidTgts$ Enchantment.YouCtrl+doesNotShareNameWith OtherYourBattlefield | TgtPrompt$ Choose target enchantment you control that doesn't have the same name as another permanent you control. | SorcerySpeed$ True | SubAbility$ DBUntap | SpellDescription$ Choose target enchantment you control that doesn't have the same name as another permanent you control. Create a token that's a copy of it, except it isn't legendary. If the token is an Aura, untap Yenna, Redtooth Regent, then scry 2. Activate only as a sorcery.
A:AB$ CopyPermanent | Cost$ 2 T | Defined$ Targeted | RememberTokens$ True | NonLegendary$ True | ValidTgts$ Enchantment.YouCtrl+doesNotShareNameWith OtherYourBattlefield | TgtPrompt$ Choose target enchantment you control that doesn't have the same name as another permanent you control. | SorcerySpeed$ True | SubAbility$ DBUntap | SpellDescription$ Choose target enchantment you control that doesn't have the same name as another permanent you control. Create a token that's a copy of it, except it isn't legendary. If the token is an Aura, untap CARDNAME, then scry 2. Activate only as a sorcery.
SVar:DBUntap:DB$ Untap | Defined$ Self | ConditionDefined$ Remembered | ConditionPresent$ Card.Aura | SubAbility$ DBScry
SVar:DBScry:DB$ Scry | ScryNum$ 2 | ConditionDefined$ Remembered | ConditionPresent$ Card.Aura | SubAbility$ DBCleanup
SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True

View File

@@ -15,8 +15,6 @@ import forge.game.GameActionUtil;
import forge.game.GameEntityView;
import forge.game.GameEntityViewMap;
import forge.game.ability.AbilityUtils;
import forge.game.ability.ApiType;
import forge.game.ability.effects.CharmEffect;
import forge.game.card.Card;
import forge.game.card.CardCollection;
import forge.game.card.CardCollectionView;
@@ -101,13 +99,6 @@ public class HumanPlay {
source.forceTurnFaceUp();
}
if (sa.getApi() == ApiType.Charm && !CharmEffect.makeChoices(sa)) {
// 603.3c If no mode is chosen, the ability is removed from the stack.
return false;
}
sa = AbilityUtils.addSpliceEffects(sa);
final HumanPlaySpellAbility req = new HumanPlaySpellAbility(controller, sa);
if (!req.playAbility(true, false, false)) {
Card rollback = p.getGame().getCardState(source);
@@ -165,15 +156,6 @@ public class HumanPlay {
source.setSplitStateToPlayAbility(sa);
if (sa.getApi() == ApiType.Charm && !CharmEffect.makeChoices(sa)) {
// 603.3c If no mode is chosen, the ability is removed from the stack.
return;
}
if (!sa.isCopied()) {
sa = AbilityUtils.addSpliceEffects(sa);
}
final HumanPlaySpellAbility req = new HumanPlaySpellAbility(controller, sa);
req.playAbility(mayChooseNewTargets, true, false);
}

View File

@@ -30,6 +30,8 @@ import forge.game.GameActionUtil;
import forge.game.GameObject;
import forge.game.ability.AbilityKey;
import forge.game.ability.AbilityUtils;
import forge.game.ability.ApiType;
import forge.game.ability.effects.CharmEffect;
import forge.game.card.Card;
import forge.game.card.CardPlayOption;
import forge.game.cost.Cost;
@@ -53,6 +55,7 @@ import forge.util.Localizer;
public class HumanPlaySpellAbility {
private final PlayerControllerHuman controller;
private SpellAbility ability;
private boolean needX = true;
public HumanPlaySpellAbility(final PlayerControllerHuman controller0, final SpellAbility ability0) {
controller = controller0;
@@ -63,9 +66,25 @@ public class HumanPlaySpellAbility {
final Player human = ability.getActivatingPlayer();
final Game game = human.getGame();
// CR 401.5: freeze top library cards until cast/activated so player can't cheat and see the next
if (!skipStack) {
// CR 401.5: freeze top library cards until cast/activated so player can't cheat and see the next
game.setTopLibsCast();
if (ability.getApi() == ApiType.Charm) {
if ("X".equals(ability.getParam("CharmNum"))) {
// CR 601.4
if (!announceValuesLikeX()) {
return false;
}
needX = false;
}
if (!CharmEffect.makeChoices(ability)) {
// 603.3c If no mode is chosen, the ability is removed from the stack.
return false;
}
}
ability = AbilityUtils.addSpliceEffects(ability);
}
// used to rollback
@@ -191,9 +210,7 @@ public class HumanPlaySpellAbility {
private boolean announceValuesLikeX() {
if (ability.isCopied() || ability.isWrapper()) { return true; } //don't re-announce for spell copies
boolean needX = true;
final Cost cost = ability.getPayCosts();
final PlayerController controller = ability.getActivatingPlayer().getController();
final Card card = ability.getHostCard();
// Announcing Requirements like Choosing X or Multikicker