Investigate fixes

This commit is contained in:
tool4EvEr
2023-03-31 20:18:57 +02:00
parent abdae29466
commit beae50cefd
6 changed files with 19 additions and 17 deletions

View File

@@ -37,11 +37,11 @@ public class InvestigateEffect extends TokenEffectBase {
final int amount = AbilityUtils.calculateAmount(card, sa.getParamOrDefault("Num", "1"), sa); final int amount = AbilityUtils.calculateAmount(card, sa.getParamOrDefault("Num", "1"), sa);
// Investigate in Sequence // Investigate in Sequence
for (final Player p : getTargetPlayers(sa)) {
for (int i = 0; i < amount; i++) { for (int i = 0; i < amount; i++) {
for (final Player p : getTargetPlayers(sa)) {
if (sa.hasParam("Optional") && !p.getController().confirmAction(sa, null, if (sa.hasParam("Optional") && !p.getController().confirmAction(sa, null,
Localizer.getInstance().getMessage("lblWouldYouLikeInvestigate"), null)) { Localizer.getInstance().getMessage("lblWouldYouLikeInvestigate"), null)) {
return; continue;
} }
CardZoneTable triggerList = new CardZoneTable(); CardZoneTable triggerList = new CardZoneTable();

View File

@@ -169,8 +169,12 @@ public class RepeatEachEffect extends SpellAbilityEffect {
} }
} }
for (final Player p : repeatPlayers) { for (final Player p : repeatPlayers) {
if (optional && !p.getController().confirmAction(repeat, null, sa.getParam("RepeatOptionalMessage"), null)) { if (optional) {
if (!p.getController().confirmAction(repeat, null, sa.getParam("RepeatOptionalMessage"), null)) {
continue; continue;
} else if (sa.hasParam("RememberDeciders")) {
source.addRemembered(p);
}
} }
if (nextTurn) { if (nextTurn) {
game.getCleanup().addUntil(p, new GameCommand() { game.getCleanup().addUntil(p, new GameCommand() {

View File

@@ -2684,14 +2684,13 @@ public class CardFactoryUtil {
final String[] kw = keyword.split(":"); final String[] kw = keyword.split(":");
String costStr = kw[1]; String costStr = kw[1];
for (SpellAbility sa: host.getBasicSpells()) { for (SpellAbility sa: host.getBasicSpells()) {
final SpellAbility newSA = sa.copy();
newSA.setBasicSpell(false);
if (costStr.equals("ConvertedManaCost")) { if (costStr.equals("ConvertedManaCost")) {
costStr = Integer.toString(host.getCMC()); costStr = Integer.toString(host.getCMC());
} }
final Cost cost = new Cost(costStr, false).add(sa.getPayCosts().copyWithNoMana()); final Cost cost = new Cost(costStr, false).add(sa.getPayCosts().copyWithNoMana());
final SpellAbility newSA = sa.copyWithDefinedCost(cost);
newSA.setBasicSpell(false);
newSA.putParam("Secondary", "True"); newSA.putParam("Secondary", "True");
newSA.setPayCosts(cost);
newSA.setDescription(sa.getDescription() + " (by paying " + cost.toSimpleString() + " instead of its mana cost)"); newSA.setDescription(sa.getDescription() + " (by paying " + cost.toSimpleString() + " instead of its mana cost)");
newSA.setIntrinsic(intrinsic); newSA.setIntrinsic(intrinsic);
@@ -3879,9 +3878,8 @@ public class CardFactoryUtil {
private static SpellAbility makeAltCostAbility(final Card card, final String altCost, final SpellAbility sa) { private static SpellAbility makeAltCostAbility(final Card card, final String altCost, final SpellAbility sa) {
final Map<String, String> params = AbilityFactory.getMapParams(altCost); final Map<String, String> params = AbilityFactory.getMapParams(altCost);
final SpellAbility altCostSA = sa.copy(); final Cost abCost = new Cost(params.get("Cost"), sa.isAbility());
final Cost abCost = new Cost(params.get("Cost"), altCostSA.isAbility()); final SpellAbility altCostSA = sa.copyWithDefinedCost(abCost);
altCostSA.setPayCosts(abCost);
altCostSA.setBasicSpell(false); altCostSA.setBasicSpell(false);
altCostSA.addOptionalCost(OptionalCost.AltCost); altCostSA.addOptionalCost(OptionalCost.AltCost);

View File

@@ -4,8 +4,8 @@ Types:Legendary Creature Zombie Knight
PT:3/3 PT:3/3
S:Mode$ Continuous | Affected$ Card.Self | MayPlay$ True | AffectedZone$ Graveyard | EffectZone$ Graveyard S:Mode$ Continuous | Affected$ Card.Self | MayPlay$ True | AffectedZone$ Graveyard | EffectZone$ Graveyard
S:Mode$ CantBeCast | ValidCard$ Card.Self | Origin$ Exile,Hand,Library,Command | EffectZone$ Graveyard,Hand,Library,Command,Stack | Description$ You may cast CARDNAME from your graveyard, but not from anywhere else. S:Mode$ CantBeCast | ValidCard$ Card.Self | Origin$ Exile,Hand,Library,Command | EffectZone$ Graveyard,Hand,Library,Command,Stack | Description$ You may cast CARDNAME from your graveyard, but not from anywhere else.
S:Mode$ Continuous | Affected$ Knight.YouCtrl | MayPlay$ True | EffectZone$ Battlefield | AffectedZone$ Graveyard | Description$ As long as CARDNAME is on the battlefield, you may play Knight cards from your graveyard. S:Mode$ Continuous | Affected$ Knight.YouCtrl | ValidAfterStack$ Spell.Knight | MayPlay$ True | EffectZone$ Battlefield | AffectedZone$ Graveyard | Description$ As long as NICKNAME is on the battlefield, you may cast Knight spells from your graveyard.
T:Mode$ ChangesZone | Origin$ Battlefield | Destination$ Graveyard | ValidCard$ Card.Self | Execute$ TrigLose | TriggerDescription$ When CARDNAME dies, you lose 2 life. T:Mode$ ChangesZone | Origin$ Battlefield | Destination$ Graveyard | ValidCard$ Card.Self | Execute$ TrigLose | TriggerDescription$ When NICKNAME dies, you lose 2 life.
SVar:TrigLose:DB$ LoseLife | Defined$ You | LifeAmount$ 2 SVar:TrigLose:DB$ LoseLife | Defined$ You | LifeAmount$ 2
AI:RemoveDeck:Random AI:RemoveDeck:Random
SVar:DiscardMe:5 SVar:DiscardMe:5

View File

@@ -2,7 +2,7 @@ Name:Malicious Affliction
ManaCost:B B ManaCost:B B
Types:Instant Types:Instant
A:SP$ Destroy | Cost$ B B | ValidTgts$ Creature.nonBlack | TgtPrompt$ Select target nonblack creature | SpellDescription$ Destroy target nonblack creature. A:SP$ Destroy | Cost$ B B | ValidTgts$ Creature.nonBlack | TgtPrompt$ Select target nonblack creature | SpellDescription$ Destroy target nonblack creature.
T:Mode$ SpellCast | ValidCard$ Card.Self | Execute$ TrigCopy | CheckSVar$ Morbid | SVarCompare$ GE1 | TriggerDescription$ Morbid — When you cast this spell, if a creature died this turn, you may copy CARDNAME and may choose a new target for the copy. T:Mode$ SpellCast | ValidCard$ Card.Self | Execute$ TrigCopy | CheckSVar$ Morbid | SVarCompare$ GE1 | OptionalDecider$ You | TriggerDescription$ Morbid — When you cast this spell, if a creature died this turn, you may copy CARDNAME and may choose a new target for the copy.
SVar:TrigCopy:DB$ CopySpellAbility | Defined$ TriggeredSpellAbility | MayChooseTarget$ True SVar:TrigCopy:DB$ CopySpellAbility | Defined$ TriggeredSpellAbility | MayChooseTarget$ True
SVar:Morbid:Count$ThisTurnEntered_Graveyard_from_Battlefield_Creature SVar:Morbid:Count$ThisTurnEntered_Graveyard_from_Battlefield_Creature
Oracle:Morbid — When you cast this spell, if a creature died this turn, you may copy Malicious Affliction and may choose a new target for the copy.\nDestroy target nonblack creature. Oracle:Morbid — When you cast this spell, if a creature died this turn, you may copy Malicious Affliction and may choose a new target for the copy.\nDestroy target nonblack creature.

View File

@@ -2,10 +2,10 @@ Name:Tempting Contract
ManaCost:4 ManaCost:4
Types:Artifact Types:Artifact
T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | TriggerZones$ Battlefield | Execute$ DBRepeat | SubAbility$ DBToken | TriggerDescription$ At the beginning of your upkeep, each opponent may create a Treasure token. For each opponent who does, you create a Treasure token. T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | TriggerZones$ Battlefield | Execute$ DBRepeat | SubAbility$ DBToken | TriggerDescription$ At the beginning of your upkeep, each opponent may create a Treasure token. For each opponent who does, you create a Treasure token.
SVar:DBRepeat:DB$ RepeatEach | RepeatSubAbility$ DBOppToken | RepeatPlayers$ Player.Opponent | SubAbility$ DBToken | RepeatOptionalForEachPlayer$ True | RepeatOptionalMessage$ Do you want to create a Treasure token? SVar:DBRepeat:DB$ RepeatEach | RepeatSubAbility$ DBOppToken | RepeatPlayers$ Opponent | RepeatOptionalForEachPlayer$ True | RememberDeciders$ True | RepeatOptionalMessage$ Do you want to create a Treasure token? | ChangeZoneTable$ True | SubAbility$ DBToken
SVar:DBOppToken:DB$ Token | TokenScript$ c_a_treasure_sac | TokenOwner$ Player.IsRemembered | RememberTokens$ True SVar:DBOppToken:DB$ Token | TokenScript$ c_a_treasure_sac | TokenOwner$ Player.IsRemembered
SVar:DBToken:DB$ Token | TokenAmount$ X | TokenScript$ c_a_treasure_sac | SubAbility$ DBCleanup SVar:DBToken:DB$ Token | TokenAmount$ X | TokenScript$ c_a_treasure_sac | SubAbility$ DBCleanup
SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True
SVar:X:Remembered$Amount SVar:X:Count$RememberedSize
DeckHas:Ability$Token|Sacrifice DeckHas:Ability$Token|Sacrifice
Oracle:At the beginning of your upkeep, each opponent may create a Treasure token. For each opponent who does, you create a Treasure token. Oracle:At the beginning of your upkeep, each opponent may create a Treasure token. For each opponent who does, you create a Treasure token.