Restore fixes (#8800)

This commit is contained in:
tool4ever
2025-09-28 09:09:47 +02:00
committed by GitHub
parent 90ea109a17
commit 4eccfa8177
11 changed files with 22 additions and 38 deletions

View File

@@ -119,7 +119,7 @@ public class ConniveAi extends SpellAbilityAi {
} }
} }
return new AiAbilityDecision( return new AiAbilityDecision(
sa.isTargetNumberValid() && !sa.getTargets().isEmpty() ? 100 : 0, sa.isTargetNumberValid() ? 100 : 0,
sa.isTargetNumberValid() ? AiPlayDecision.WillPlay : AiPlayDecision.TargetingFailed sa.isTargetNumberValid() ? AiPlayDecision.WillPlay : AiPlayDecision.TargetingFailed
); );
} }

View File

@@ -53,17 +53,15 @@ public class ControlExchangeAi extends SpellAbilityAi {
if (mandatory) { if (mandatory) {
return new AiAbilityDecision(100, AiPlayDecision.WillPlay); return new AiAbilityDecision(100, AiPlayDecision.WillPlay);
} }
} else { } else if (mandatory) {
if (mandatory) { AiAbilityDecision decision = chkDrawback(sa, aiPlayer);
AiAbilityDecision decision = chkDrawback(sa, aiPlayer); if (sa.isTargetNumberValid()) {
if (sa.isTargetNumberValid()) { return new AiAbilityDecision(100, AiPlayDecision.WillPlay);
return new AiAbilityDecision(100, AiPlayDecision.WillPlay);
}
return decision;
} else {
return canPlay(aiPlayer, sa);
} }
return decision;
} else {
return canPlay(aiPlayer, sa);
} }
return new AiAbilityDecision(100, AiPlayDecision.WillPlay); return new AiAbilityDecision(100, AiPlayDecision.WillPlay);
} }

View File

@@ -6,10 +6,10 @@ 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.CardLists; import forge.game.card.CardLists;
import forge.game.card.CardUtil;
import forge.game.combat.Combat; import forge.game.combat.Combat;
import forge.game.combat.CombatUtil; import forge.game.combat.CombatUtil;
import forge.game.keyword.Keyword; import forge.game.keyword.Keyword;
import forge.game.phase.PhaseType;
import forge.game.player.Player; import forge.game.player.Player;
import forge.game.spellability.SpellAbility; import forge.game.spellability.SpellAbility;
@@ -38,9 +38,6 @@ public class MustBlockAi extends SpellAbilityAi {
if (!list.isEmpty()) { if (!list.isEmpty()) {
final Card blocker = ComputerUtilCard.getBestCreatureAI(list); final Card blocker = ComputerUtilCard.getBestCreatureAI(list);
if (blocker == null) {
return new AiAbilityDecision(0, AiPlayDecision.CantPlayAi);
}
sa.getTargets().add(blocker); sa.getTargets().add(blocker);
return new AiAbilityDecision(100, AiPlayDecision.WillPlay); return new AiAbilityDecision(100, AiPlayDecision.WillPlay);
} }
@@ -63,11 +60,6 @@ public class MustBlockAi extends SpellAbilityAi {
protected AiAbilityDecision doTriggerNoCost(final Player ai, SpellAbility sa, boolean mandatory) { protected AiAbilityDecision doTriggerNoCost(final Player ai, SpellAbility sa, boolean mandatory) {
final Card source = sa.getHostCard(); final Card source = sa.getHostCard();
// only use on creatures that can attack
if (!ai.getGame().getPhaseHandler().getPhase().isBefore(PhaseType.MAIN2)) {
return new AiAbilityDecision(0, AiPlayDecision.CantPlayAi);
}
Card attacker = source; Card attacker = source;
if (sa.hasParam("DefinedAttacker")) { if (sa.hasParam("DefinedAttacker")) {
final List<Card> cards = AbilityUtils.getDefinedCards(source, sa.getParam("DefinedAttacker"), sa); final List<Card> cards = AbilityUtils.getDefinedCards(source, sa.getParam("DefinedAttacker"), sa);
@@ -81,13 +73,9 @@ public class MustBlockAi extends SpellAbilityAi {
boolean chance = false; boolean chance = false;
if (sa.usesTargeting()) { if (sa.usesTargeting()) {
final List<Card> list = determineGoodBlockers(attacker, ai, ai.getWeakestOpponent(), sa, true, true); List<Card> list = determineGoodBlockers(attacker, ai, ai.getWeakestOpponent(), sa, true, true);
if (list.isEmpty()) { if (list.isEmpty() && mandatory) {
if (sa.isTargetNumberValid()) { list = CardUtil.getValidCardsToTarget(sa);
return new AiAbilityDecision(100, AiPlayDecision.WillPlay);
} else {
return new AiAbilityDecision(0, AiPlayDecision.TargetingFailed);
}
} }
final Card blocker = ComputerUtilCard.getBestCreatureAI(list); final Card blocker = ComputerUtilCard.getBestCreatureAI(list);
if (blocker == null) { if (blocker == null) {

View File

@@ -33,10 +33,8 @@ public class PhasesAi extends SpellAbilityAi {
final boolean isThreatened = ComputerUtil.predictThreatenedObjects(aiPlayer, null, true).contains(source); final boolean isThreatened = ComputerUtil.predictThreatenedObjects(aiPlayer, null, true).contains(source);
if (isThreatened) { if (isThreatened) {
return new AiAbilityDecision(100, AiPlayDecision.WillPlay); return new AiAbilityDecision(100, AiPlayDecision.WillPlay);
} else {
return new AiAbilityDecision(0, AiPlayDecision.CantPlayAi);
} }
return new AiAbilityDecision(0, AiPlayDecision.CantPlayAi);
} }
return new AiAbilityDecision(0, AiPlayDecision.CantPlayAi); return new AiAbilityDecision(0, AiPlayDecision.CantPlayAi);

View File

@@ -3,7 +3,7 @@ ManaCost:4 B B R R
Types:Legendary Creature Giant Types:Legendary Creature Giant
PT:5/5 PT:5/5
K:Trample K:Trample
T:Mode$ ChangesZone | Origin$ Any | Destination$ Graveyard | ValidCard$ Creature.DamagedBy | Execute$ DBGainLife | TriggerDescription$ Whenever a creature dealt damage by CARDNAME this turn dies, you gain 1 life and NICKNAME deals 1 damage to target player or planeswalker. T:Mode$ ChangesZone | Origin$ Battlefield | Destination$ Graveyard | ValidCard$ Creature.DamagedBy | Execute$ DBGainLife | TriggerDescription$ Whenever a creature dealt damage by CARDNAME this turn dies, you gain 1 life and NICKNAME deals 1 damage to target player or planeswalker.
SVar:DBGainLife:DB$ GainLife | Defined$ You | LifeAmount$ 1 | SubAbility$ DBDealDamage SVar:DBGainLife:DB$ GainLife | Defined$ You | LifeAmount$ 1 | SubAbility$ DBDealDamage
SVar:DBDealDamage:DB$ DealDamage | ValidTgts$ Player,Planeswalker | TgtPrompt$ Select target player or planeswalker | NumDmg$ 1 SVar:DBDealDamage:DB$ DealDamage | ValidTgts$ Player,Planeswalker | TgtPrompt$ Select target player or planeswalker | NumDmg$ 1
DeckHas:Ability$LifeGain DeckHas:Ability$LifeGain

View File

@@ -7,6 +7,6 @@ SVar:PlayMain1:TRUE
T:Mode$ Phase | Phase$ BeginCombat | ValidPlayer$ You | TriggerZones$ Battlefield | Execute$ TrigToken | TriggerDescription$ At the beginning of combat on your turn, create a 2/1 blue Phyrexian Myr artifact creature token. Then you may choose a token you control. If you do, each other token you control becomes a copy of that token. T:Mode$ Phase | Phase$ BeginCombat | ValidPlayer$ You | TriggerZones$ Battlefield | Execute$ TrigToken | TriggerDescription$ At the beginning of combat on your turn, create a 2/1 blue Phyrexian Myr artifact creature token. Then you may choose a token you control. If you do, each other token you control becomes a copy of that token.
SVar:TrigToken:DB$ Token | TokenScript$ u_2_1_a_phyrexian_myr | SubAbility$ DBClone SVar:TrigToken:DB$ Token | TokenScript$ u_2_1_a_phyrexian_myr | SubAbility$ DBClone
SVar:DBClone:DB$ Clone | Choices$ Card.token+YouCtrl | ChoiceTitle$ You may choose a token you control | ChoiceOptional$ True | ExcludeChosen$ True | CloneTarget$ Valid Card.token+YouCtrl SVar:DBClone:DB$ Clone | Choices$ Card.token+YouCtrl | ChoiceTitle$ You may choose a token you control | ChoiceOptional$ True | ExcludeChosen$ True | CloneTarget$ Valid Card.token+YouCtrl
DeckHints:Type$Token DeckHints:Ability$Token
DeckHas:Type$Token & Type$Artifact|Myr DeckHas:Ability$Token & Type$Artifact|Myr
Oracle:Creature tokens you control have haste.\nAt the beginning of combat on your turn, create a 2/1 blue Phyrexian Myr artifact creature token. Then you may choose a token you control. If you do, each other token you control becomes a copy of that token. Oracle:Creature tokens you control have haste.\nAt the beginning of combat on your turn, create a 2/1 blue Phyrexian Myr artifact creature token. Then you may choose a token you control. If you do, each other token you control becomes a copy of that token.

View File

@@ -11,5 +11,5 @@ SVar:DBLoseLife:DB$ LoseLife | LifeAmount$ 1
SVar:DBDamage:DB$ DealDamage | ValidTgts$ Opponent | TgtPrompt$ Select target opponent | NumDmg$ X | SpellDescription$ CARDNAME deals damage equal to the number of creature tokens you control to target opponent. SVar:DBDamage:DB$ DealDamage | ValidTgts$ Opponent | TgtPrompt$ Select target opponent | NumDmg$ X | SpellDescription$ CARDNAME deals damage equal to the number of creature tokens you control to target opponent.
SVar:X:Count$Valid Creature.token+YouCtrl SVar:X:Count$Valid Creature.token+YouCtrl
DeckHas:Ability$Token|Sacrifice DeckHas:Ability$Token|Sacrifice
DeckHints:Type$Token DeckHints:Ability$Token
Oracle:Whenever you attack, you may sacrifice another creature. When you do, choose two —\n• Create two 1/1 red and white Soldier creature tokens with haste that are tapped and attacking.\n• You draw a card and you lose 1 life.\n• Caesar, Legion's Emperor deals damage equal to the number of creature tokens you control to target opponent. Oracle:Whenever you attack, you may sacrifice another creature. When you do, choose two —\n• Create two 1/1 red and white Soldier creature tokens with haste that are tapped and attacking.\n• You draw a card and you lose 1 life.\n• Caesar, Legion's Emperor deals damage equal to the number of creature tokens you control to target opponent.

View File

@@ -4,5 +4,5 @@ Types:Sorcery
A:SP$ Charm | Choices$ DBDestroyAllTokens,DBDestroyAllNonlandNontokenPermanents | CharmNum$ 1 A:SP$ Charm | Choices$ DBDestroyAllTokens,DBDestroyAllNonlandNontokenPermanents | CharmNum$ 1
SVar:DBDestroyAllTokens:DB$ DestroyAll | ValidCards$ Card.token | SpellDescription$ Destroy all tokens. SVar:DBDestroyAllTokens:DB$ DestroyAll | ValidCards$ Card.token | SpellDescription$ Destroy all tokens.
SVar:DBDestroyAllNonlandNontokenPermanents:DB$ DestroyAll | ValidCards$ Permanent.nonLand+!token | SpellDescription$ Destroy all nonland, nontoken permanents. SVar:DBDestroyAllNonlandNontokenPermanents:DB$ DestroyAll | ValidCards$ Permanent.nonLand+!token | SpellDescription$ Destroy all nonland, nontoken permanents.
DeckHints:Type$Token DeckHints:Ability$Token
Oracle:Choose one —\n• Destroy all tokens.\n• Destroy all nonland, nontoken permanents. Oracle:Choose one —\n• Destroy all tokens.\n• Destroy all nonland, nontoken permanents.

View File

@@ -9,5 +9,5 @@ SVar:TrigGainControl:DB$ GainControl | ValidTgts$ Creature.nonLegendary+powerLEX
SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True
SVar:X:TriggerRemembered$CardPower SVar:X:TriggerRemembered$CardPower
DeckHas:Ability$Token|Counters & Type$Orc|Army DeckHas:Ability$Token|Counters & Type$Orc|Army
DeckHints:Type$Token DeckHints:Ability$Token
Oracle:When Grishnákh, Brash Instigator enters, amass Orcs 2. When you do, until end of turn, gain control of target nonlegendary creature an opponent controls with power less than or equal to the amassed Army's power. Untap that creature. It gains haste until end of turn. Oracle:When Grishnákh, Brash Instigator enters, amass Orcs 2. When you do, until end of turn, gain control of target nonlegendary creature an opponent controls with power less than or equal to the amassed Army's power. Untap that creature. It gains haste until end of turn.

View File

@@ -7,5 +7,5 @@ SVar:TrigToken:DB$ Token | TokenAmount$ 1 | TokenScript$ r_1_1_mercenary_tappump
A:AB$ Pump | Cost$ 2 Sac<1/Card.token/token> | Defined$ Self | KW$ Indestructible | SubAbility$ DBTap | SpellDescription$ CARDNAME gains indestructible until end of turn. Tap it. (Damage and effects that say "destroy" don't destroy it.) A:AB$ Pump | Cost$ 2 Sac<1/Card.token/token> | Defined$ Self | KW$ Indestructible | SubAbility$ DBTap | SpellDescription$ CARDNAME gains indestructible until end of turn. Tap it. (Damage and effects that say "destroy" don't destroy it.)
SVar:DBTap:DB$ Tap | Defined$ Self SVar:DBTap:DB$ Tap | Defined$ Self
DeckHas:Ability$Token|Sacrifice & Type$Mercenary DeckHas:Ability$Token|Sacrifice & Type$Mercenary
DeckHints:Type$Token DeckHints:Ability$Token
Oracle:When Prosperity Tycoon enters, create a 1/1 red Mercenary creature token with "{T}: Target creature you control gets +1/+0 until end of turn. Activate only as a sorcery."\n{2}, Sacrifice a token: Prosperity Tycoon gains indestructible until end of turn. Tap it. (Damage and effects that say "destroy" don't destroy it.) Oracle:When Prosperity Tycoon enters, create a 1/1 red Mercenary creature token with "{T}: Target creature you control gets +1/+0 until end of turn. Activate only as a sorcery."\n{2}, Sacrifice a token: Prosperity Tycoon gains indestructible until end of turn. Tap it. (Damage and effects that say "destroy" don't destroy it.)

View File

@@ -4,6 +4,6 @@ Types:Creature Vampire
PT:3/4 PT:3/4
K:Flying K:Flying
K:Morph:B B B K:Morph:B B B
T:Mode$ ChangesZone | Origin$ Any | Destination$ Graveyard | ValidCard$ Creature.DamagedBy | Execute$ TrigBounce | TriggerDescription$ Whenever a creature dealt damage by CARDNAME this turn dies, return that card to the battlefield under your control. T:Mode$ ChangesZone | Origin$ Battlefield | Destination$ Graveyard | ValidCard$ Creature.DamagedBy | Execute$ TrigBounce | TriggerDescription$ Whenever a creature dealt damage by CARDNAME this turn dies, return that card to the battlefield under your control.
SVar:TrigBounce:DB$ ChangeZone | Origin$ Graveyard | Destination$ Battlefield | GainControl$ True | Defined$ TriggeredCardLKICopy SVar:TrigBounce:DB$ ChangeZone | Origin$ Graveyard | Destination$ Battlefield | GainControl$ True | Defined$ TriggeredCardLKICopy
Oracle:Flying\nWhenever a creature dealt damage by Soul Collector this turn dies, return that card to the battlefield under your control.\nMorph {B}{B}{B} (You may cast this card face down as a 2/2 creature for {3}. Turn it face up any time for its morph cost.) Oracle:Flying\nWhenever a creature dealt damage by Soul Collector this turn dies, return that card to the battlefield under your control.\nMorph {B}{B}{B} (You may cast this card face down as a 2/2 creature for {3}. Turn it face up any time for its morph cost.)