Add Expert-Level Safe (#4856)

This commit is contained in:
Chris H
2024-03-25 02:50:37 -04:00
committed by GitHub
parent c7f69aea83
commit 7c616c536d
4 changed files with 25 additions and 1 deletions

View File

@@ -1859,6 +1859,8 @@ public class AiController {
maxCreatures = Math.max(maxCreatures, opp.getCreaturesInPlay().size());
}
return Math.min(choiceLimit, Math.max(minAllowedChoice, maxCreatures));
} else if ("Random".equals(logic)) {
return MyRandom.getRandom().nextInt((max - min) + 1) + min;
}
return max;
}

View File

@@ -53,7 +53,7 @@ public final class AbilityFactory {
public static final List<String> additionalAbilityKeys = Lists.newArrayList(
"WinSubAbility", "OtherwiseSubAbility", // Clash
"BidSubAbility", // BidLifeEffect
"ChooseNumberSubAbility", "Lowest", "Highest", "NotLowest", "GuessCorrect", "GuessWrong", // ChooseNumber
"ChooseNumberSubAbility", "Lowest", "Highest", "NotLowest", "GuessCorrect", "GuessWrong", "MatchedAbility", "UnmatchedAbility", // ChooseNumber
"HeadsSubAbility", "TailsSubAbility", "LoseSubAbility", // FlipCoin
"TrueSubAbility", "FalseSubAbility", // Branch
"ChosenPile", "UnchosenPile", // MultiplePiles & TwoPiles

View File

@@ -141,6 +141,7 @@ public class ChooseNumberEffect extends SpellAbilityEffect {
lowestNum.add(player);
}
}
boolean matched = highestNum.size() == chooseMap.size();
card.getGame().getAction().notifyOfValue(sa, card, sb.toString(), null);
if (sa.hasParam("ChooseNumberSubAbility")) {
SpellAbility sub = sa.getAdditionalAbility("ChooseNumberSubAbility");
@@ -208,6 +209,16 @@ public class ChooseNumberEffect extends SpellAbilityEffect {
card.clearChosenNumber();
card.removeRemembered(guessPair.getKey());
}
if (matched && sa.hasParam("MatchedAbility")) {
SpellAbility sub = sa.getAdditionalAbility("MatchedAbility");
AbilityUtils.resolve(sub);
}
if (!matched && sa.hasParam("UnmatchedAbility")) {
SpellAbility sub = sa.getAdditionalAbility("UnmatchedAbility");
AbilityUtils.resolve(sub);
}
}
if (sa.hasParam("RememberChosen")) card.addRemembered(chooseMap.values());

View File

@@ -0,0 +1,11 @@
Name:Expert-Level Safe
ManaCost:2
Types:Artifact
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigExile | TriggerDescription$ When CARDNAME enters the battlefield, exile the top two cards of your library face down.
SVar:TrigExile:DB$ Dig | Defined$ You | DigNum$ 2 | ChangeNum$ All | DestinationZone$ Exile | ExileFaceDown$ True | NoReveal$ True
A:AB$ Pump | Cost$ 1 T | ValidTgts$ Opponent | TgtPrompt$ Target an opponent to choose a number 1, 2, or 3 | SubAbility$ ChooseNumber | StackDescription$ SpellDescription | SpellDescription$ You and target opponent each secretly choose 1, 2, or 3. Then those choices are revealed. If they match, sacrifice CARDNAME and put all cards exiled with it into their owners hands. Otherwise, exile the top card of your library face down.
SVar:ChooseNumber:DB$ ChooseNumber | Defined$ TargetedAndYou | Min$ 1 | Max$ 3 | AILogic$ Random | MatchedAbility$ DBSacrifice | UnmatchedAbility$ DBFillSafe | SecretlyChoose$ True | SpellDescription$ None
SVar:DBSacrifice:DB$ Sacrifice | Defined$ You | ValidCard$ Card.Self | SubAbility$ DBOpenSafe
SVar:DBOpenSafe:DB$ ChangeZoneAll | ChangeNum$ All | Origin$ Exile | Destination$ Hand | ChangeType$ Card.ExiledWithSource
SVar:DBFillSafe:DB$ Dig | Defined$ You | DigNum$ 1 | ChangeNum$ All | DestinationZone$ Exile | ExileFaceDown$ True | NoReveal$ True
Oracle:When Expert-Level Safe enters the battlefield, exile the top two cards of your library face down.\n{1}, {T}: You and target opponent each secretly choose 1, 2, or 3. Then those choices are revealed. If they match, sacrifice Expert-Level Safe and put all cards exiled with it into their owners hands. Otherwise, exile the top card of your library face down.