Fix Ozolith logic (#1698)

This commit is contained in:
tool4ever
2022-10-17 08:47:56 +02:00
committed by GitHub
parent 8143f68672
commit a75c68e640
18 changed files with 34 additions and 40 deletions

View File

@@ -368,14 +368,20 @@ public class CountersMoveAi extends SpellAbilityAi {
return false;
}
Card lki = CardUtil.getLKICopy(src);
Card lkiWithCounters = CardUtil.getLKICopy(src);
Card lkiWithoutCounters = CardUtil.getLKICopy(src);
if (cType == null) {
lki.clearCounters();
lkiWithoutCounters.clearCounters();
} else {
lki.setCounters(cType, 0);
lkiWithoutCounters.setCounters(cType, 0);
}
// need to fake animate it for P/T
lkiWithCounters.addType("Creature");
lkiWithoutCounters.addType("Creature");
// go for opponent when higher value implies debuff
if (ComputerUtilCard.evaluateCreature(src) > ComputerUtilCard.evaluateCreature(lki)) {
if (ComputerUtilCard.evaluateCreature(lkiWithCounters) > ComputerUtilCard.evaluateCreature(lkiWithoutCounters)) {
List<Card> aiList = CardLists.filterControlledBy(tgtCards, ai);
if (!aiList.isEmpty()) {
List<Card> best = CardLists.filter(aiList, new Predicate<Card>() {

View File

@@ -1004,8 +1004,7 @@ public class ChangeZoneEffect extends SpellAbilityEffect {
final int fetchNum = Math.min(player.getCardsIn(ZoneType.Library).size(), 4);
if (fetchNum == 0) {
searchedLibrary = false;
}
else {
} else {
fetchList.addAll(player.getCardsIn(ZoneType.Library, fetchNum));
}
}

View File

@@ -277,7 +277,7 @@ public class EffectEffect extends SpellAbilityEffect {
// chosen number
if (sa.hasParam("SetChosenNumber")) {
eff.setChosenNumber(AbilityUtils.calculateAmount(sa.getHostCard(),
eff.setChosenNumber(AbilityUtils.calculateAmount(hostCard,
sa.getParam("SetChosenNumber"), sa));
} else if (hostCard.hasChosenNumber()) {
eff.setChosenNumber(hostCard.getChosenNumber());

View File

@@ -59,7 +59,7 @@ public class TwoPilesEffect extends SpellAbilityEffect {
Player separator = card.getController();
if (sa.hasParam("Separator")) {
final FCollectionView<Player> choosers = AbilityUtils.getDefinedPlayers(sa.getHostCard(), sa.getParam("Separator"), sa);
final FCollectionView<Player> choosers = AbilityUtils.getDefinedPlayers(card, sa.getParam("Separator"), sa);
if (!choosers.isEmpty()) {
separator = sa.getActivatingPlayer().getController().chooseSingleEntityForEffect(choosers, null, sa, Localizer.getInstance().getMessage("lblChooser") + ":", false, null, null);
}
@@ -67,7 +67,7 @@ public class TwoPilesEffect extends SpellAbilityEffect {
Player chooser = tgtPlayers.get(0);
if (sa.hasParam("Chooser")) {
final FCollectionView<Player> choosers = AbilityUtils.getDefinedPlayers(sa.getHostCard(), sa.getParam("Chooser"), sa);
final FCollectionView<Player> choosers = AbilityUtils.getDefinedPlayers(card, sa.getParam("Chooser"), sa);
if (!choosers.isEmpty()) {
chooser = sa.getActivatingPlayer().getController().chooseSingleEntityForEffect(choosers, null, sa, Localizer.getInstance().getMessage("lblChooser") + ":", false, null, null);
}

View File

@@ -3,7 +3,7 @@ ManaCost:4 B B
Types:Creature Demon Berserker
PT:6/6
K:Flying
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigChange | OptionalDecider$ You | TriggerDescription$ When CARDNAME enters the battlefield, you may search your library for exactly two cards not named CARDNAME that have different names. If you do, reveal those cards. An opponent chooses one of them. Put the chosen card into your hand and the other into your graveyard, then shuffle.
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigChange | OptionalDecider$ You | TriggerDescription$ When CARDNAME enters the battlefield, you may search your library for exactly two cards not named Burning-Rune Demon that have different names. If you do, reveal those cards. An opponent chooses one of them. Put the chosen card into your hand and the other into your graveyard, then shuffle.
SVar:TrigChange:DB$ ChangeZone | Origin$ Library | Destination$ Library | ChangeType$ Card.notnamedBurning-Rune Demon | ChangeNum$ 2 | DifferentNames$ True | RememberChanged$ True | Reveal$ True | Shuffle$ False | AILogic$ Intuition | SubAbility$ DBChoosePlayer
SVar:DBChoosePlayer:DB$ ChoosePlayer | Defined$ You | Choices$ Player.Opponent | ChoiceTitle$ Choose an opponent | SubAbility$ DBChangeZone1
SVar:DBChangeZone1:DB$ ChangeZone | Origin$ Library | Destination$ Hand | ChangeType$ Card.IsRemembered | Chooser$ ChosenPlayer | ChangeNum$ 1 | Mandatory$ True | NoLooking$ True | SelectPrompt$ Select a card for the hand | Shuffle$ False | SubAbility$ DBChangeZone2 | StackDescription$ None

View File

@@ -1,9 +1,5 @@
Name:Conflux
ManaCost:3 W U B R G
Types:Sorcery
A:SP$ ChangeZone | Cost$ 3 W U B R G | Origin$ Library | Destination$ Hand | ChangeType$ Card.White | ChangeNum$ 1 | SubAbility$ DBBlue | SpellDescription$ Search your library for a white card, a blue card, a black card, a red card, and a green card. Reveal those cards, put them into your hand, then shuffle.
SVar:DBBlue:DB$ ChangeZone | Origin$ Library | Destination$ Hand | ChangeType$ Card.Blue | ChangeNum$ 1 | SubAbility$ DBBlack
SVar:DBBlack:DB$ ChangeZone | Origin$ Library | Destination$ Hand | ChangeType$ Card.Black | ChangeNum$ 1 | SubAbility$ DBRed
SVar:DBRed:DB$ ChangeZone | Origin$ Library | Destination$ Hand | ChangeType$ Card.Red | ChangeNum$ 1 | SubAbility$ DBGreen
SVar:DBGreen:DB$ ChangeZone | Origin$ Library | Destination$ Hand | ChangeType$ Card.Green | ChangeNum$ 1
A:SP$ ChangeZone | Cost$ 3 W U B R G | Origin$ Library | Destination$ Hand | ChangeType$ EACH Card.White & Card.Blue & Card.Black & Card.Red & Card.Green | SpellDescription$ Search your library for a white card, a blue card, a black card, a red card, and a green card. Reveal those cards, put them into your hand, then shuffle.
Oracle:Search your library for a white card, a blue card, a black card, a red card, and a green card. Reveal those cards, put them into your hand, then shuffle.

View File

@@ -4,8 +4,6 @@ Types:Sorcery
A:SP$ RepeatEach | RepeatSubAbility$ DBSearch | RepeatCards$ Creature.YouCtrl | SubAbility$ DBChangeZone | StackDescription$ SpellDescription | SpellDescription$ For each creature you control, you may search your library for a creature card with the same name as that creature. Put those cards onto the battlefield, then shuffle.
SVar:DBSearch:DB$ ChooseCard | ChoiceZone$ Library | QuasiLibrarySearch$ You | Choices$ Card.YouOwn+IsNotImprinted+sharesNameWith Remembered | ImprintChosen$ True | ChoiceTitle$ You may select a card with the same name from your library
SVar:DBChangeZone:DB$ ChangeZone | Defined$ Imprinted | Origin$ Library | Destination$ Battlefield | Searched$ True | Shuffle$ True | StackDescription$ None
#SVar:DBSearch:DB$ ChangeZone | Origin$ Library | Destination$ Battlefield | ChangeType$ Remembered.Creature+sameName | ChangeNum$ 1 | NoShuffle$ True
#SVar:DBShuffle:DB$ Shuffle | Defined$ You | StackDescription$ None
SVar:NeedsToPlayVar:Z GE2
SVar:Z:Count$Valid Creature.YouCtrl
Oracle:For each creature you control, you may search your library for a creature card with the same name as that creature. Put those cards onto the battlefield, then shuffle.

View File

@@ -3,7 +3,7 @@ ManaCost:3 R
Types:Creature Goblin Wizard
PT:1/1
A:AB$ DealDamage | Cost$ T | ValidTgts$ Creature,Player,Planeswalker | TgtPrompt$ Select any target | NumDmg$ 1 | SpellDescription$ CARDNAME deals 1 damage to any target.
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | OptionalDecider$ You | Execute$ TrigChange | TriggerDescription$ When CARDNAME enters the battlefield, you may search your library for a card named CARDNAME, reveal it, put it into your hand, then shuffle.
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | OptionalDecider$ You | Execute$ TrigChange | TriggerDescription$ When CARDNAME enters the battlefield, you may search your library for a card named Embermage Goblin, reveal it, put it into your hand, then shuffle.
SVar:TrigChange:DB$ ChangeZone | Origin$ Library | Destination$ Hand | ChangeType$ Card.namedEmbermage Goblin | ChangeNum$ 1 | ShuffleNonMandatory$ True
DeckHints:Name$Embermage Goblin
Oracle:When Embermage Goblin enters the battlefield, you may search your library for a card named Embermage Goblin, reveal it, put it into your hand, then shuffle.\n{T}: Embermage Goblin deals 1 damage to any target.

View File

@@ -1,9 +1,7 @@
Name:Gem of Becoming
ManaCost:3
Types:Artifact
A:AB$ ChangeZone | Cost$ 3 T Sac<1/CARDNAME> | Origin$ Library | Destination$ Hand | ChangeType$ Island | ChangeNum$ 1 | SubAbility$ DBSwamp | SpellDescription$ Search your library for an Island card, a Swamp card, and a Mountain card. Reveal those cards, put them into your hand, then shuffle.
SVar:DBSwamp:DB$ ChangeZone | Origin$ Library | Destination$ Hand | ChangeType$ Swamp | ChangeNum$ 1 | SubAbility$ DBMountain
SVar:DBMountain:DB$ ChangeZone | Origin$ Library | Destination$ Hand | ChangeType$ Mountain | ChangeNum$ 1
A:AB$ ChangeZone | Cost$ 3 T Sac<1/CARDNAME> | Origin$ Library | Destination$ Hand | ChangeType$ EACH Island & Swamp & Mountain | SpellDescription$ Search your library for an Island card, a Swamp card, and a Mountain card. Reveal those cards, put them into your hand, then shuffle.
AI:RemoveDeck:Random
DeckNeeds:Color$Blue|Black|Red
Oracle:{3}, {T}, Sacrifice Gem of Becoming: Search your library for an Island card, a Swamp card, and a Mountain card. Reveal those cards, put them into your hand, then shuffle.

View File

@@ -3,7 +3,7 @@ ManaCost:1 G
Types:Creature Elf Crab Warrior
PT:2/2
K:Adapt:2:2 G
T:Mode$ CounterAddedOnce | ValidCard$ Card.Self | TriggerZones$ Battlefield | CounterType$ P1P1 | Execute$ TrigSearch | OptionalDecider$ You | TriggerDescription$ Whenever one or more +1/+1 counters are put on CARDNAME, you may search your library for a card named CARDNAME, reveal it, put it into your hand, then shuffle.
T:Mode$ CounterAddedOnce | ValidCard$ Card.Self | TriggerZones$ Battlefield | CounterType$ P1P1 | Execute$ TrigSearch | OptionalDecider$ You | TriggerDescription$ Whenever one or more +1/+1 counters are put on CARDNAME, you may search your library for a card named Growth-Chamber Guardian, reveal it, put it into your hand, then shuffle.
SVar:TrigSearch:DB$ ChangeZone | Origin$ Library | Destination$ Hand | ChangeType$ Card.namedGrowth-Chamber Guardian | ChangeNum$ 1 | ShuffleNonMandatory$ True
DeckHints:Name$Growth-Chamber Guardian
DeckHas:Ability$Counters

View File

@@ -3,6 +3,5 @@ ManaCost:no cost
Types:Land
K:CARDNAME enters the battlefield tapped.
A:AB$ Mana | Cost$ T | Produced$ C | SpellDescription$ Add {C}.
A:AB$ ChangeZone | Cost$ 2 T Sac<1/CARDNAME> | Origin$ Library | Destination$ Battlefield | ChangeType$ Forest | Tapped$ True | ChangeNum$ 1 | Shuffle$ False | SubAbility$ DBPlains | SpellDescription$ Search your library for a Forest card and a Plains card, put them onto the battlefield tapped, then shuffle.
SVar:DBPlains:DB$ ChangeZone | Origin$ Library | Destination$ Battlefield | ChangeType$ Plains | Tapped$ True | ChangeNum$ 1 | Shuffle$ True
A:AB$ ChangeZone | Cost$ 2 T Sac<1/CARDNAME> | Origin$ Library | Destination$ Battlefield | ChangeType$ EACH Forest & Plains | Tapped$ True | SpellDescription$ Search your library for a Forest card and a Plains card, put them onto the battlefield tapped, then shuffle.
Oracle:Krosan Verge enters the battlefield tapped.\n{T}: Add {C}.\n{2}, {T}, Sacrifice Krosan Verge: Search your library for a Forest card and a Plains card, put them onto the battlefield tapped, then shuffle.

View File

@@ -2,7 +2,7 @@ Name:Llanowar Sentinel
ManaCost:2 G
Types:Creature Elf
PT:2/3
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigChange | TriggerDescription$ When CARDNAME enters the battlefield, you may pay {1}{G}. If you do, search your library for a card named CARDNAME, put that card onto the battlefield, then shuffle.
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigChange | TriggerDescription$ When CARDNAME enters the battlefield, you may pay {1}{G}. If you do, search your library for a card named Llanowar Sentinel, put that card onto the battlefield, then shuffle.
SVar:TrigChange:AB$ ChangeZone | Cost$ 1 G | Origin$ Library | Destination$ Battlefield | ChangeType$ Card.namedLlanowar Sentinel | ChangeNum$ 1
DeckHints:Name$Llanowar Sentinel
Oracle:When Llanowar Sentinel enters the battlefield, you may pay {1}{G}. If you do, search your library for a card named Llanowar Sentinel, put that card onto the battlefield, then shuffle.

View File

@@ -3,7 +3,7 @@ ManaCost:4 U
Types:Creature Bird
PT:2/2
K:Flying
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | OptionalDecider$ You | Execute$ TrigChange | TriggerDescription$ When CARDNAME enters the battlefield, you may search your library for a card named CARDNAME, reveal it, put it into your hand, then shuffle.
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | OptionalDecider$ You | Execute$ TrigChange | TriggerDescription$ When CARDNAME enters the battlefield, you may search your library for a card named Screaming Seahawk, reveal it, put it into your hand, then shuffle.
SVar:TrigChange:DB$ ChangeZone | Origin$ Library | Destination$ Hand | ChangeType$ Card.namedScreaming Seahawk | ChangeNum$ 1 | ShuffleNonMandatory$ True
DeckHints:Name$Screaming Seahawk
Oracle:Flying\nWhen Screaming Seahawk enters the battlefield, you may search your library for a card named Screaming Seahawk, reveal it, put it into your hand, then shuffle.

View File

@@ -1,10 +1,7 @@
Name:Shard Convergence
ManaCost:3 G
Types:Sorcery
A:SP$ ChangeZone | Cost$ 3 G | Origin$ Library | Destination$ Hand | ChangeType$ Plains | ChangeNum$ 1 | SubAbility$ DBIsland | SpellDescription$ Search your library for a Plains card, an Island card, a Swamp card, and a Mountain card. Reveal those cards, put them into your hand, then shuffle.
SVar:DBIsland:DB$ ChangeZone | Origin$ Library | Destination$ Hand | ChangeType$ Island | ChangeNum$ 1 | SubAbility$ DBSwamp
SVar:DBSwamp:DB$ ChangeZone | Origin$ Library | Destination$ Hand | ChangeType$ Swamp | ChangeNum$ 1 | SubAbility$ DBMountain
SVar:DBMountain:DB$ ChangeZone | Origin$ Library | Destination$ Hand | ChangeType$ Mountain | ChangeNum$ 1
A:SP$ ChangeZone | Cost$ 3 G | Origin$ Library | Destination$ Hand | ChangeType$ EACH Plains & Island & Swamp & Mountain | SpellDescription$ Search your library for a Plains card, an Island card, a Swamp card, and a Mountain card. Reveal those cards, put them into your hand, then shuffle.
AI:RemoveDeck:Random
DeckNeeds:Color$White|Blue|Black|Red
Oracle:Search your library for a Plains card, an Island card, a Swamp card, and a Mountain card. Reveal those cards, put them into your hand, then shuffle.

View File

@@ -2,7 +2,7 @@ Name:Skyshroud Sentinel
ManaCost:2 G
Types:Creature Elf
PT:1/1
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigChange | OptionalDecider$ You | TriggerDescription$ When CARDNAME enters the battlefield, you may search your library for up to three cards named CARDNAME, reveal them, put them into your hand, then shuffle.
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigChange | OptionalDecider$ You | TriggerDescription$ When CARDNAME enters the battlefield, you may search your library for up to three cards named Skyshroud Sentinel, reveal them, put them into your hand, then shuffle.
SVar:TrigChange:DB$ ChangeZone | Origin$ Library | Destination$ Hand | ChangeType$ Card.namedSkyshroud Sentinel | ChangeNum$ 3 | ShuffleNonMandatory$ True
DeckHints:Name$Skyshroud Sentinel
Oracle:When Skyshroud Sentinel enters the battlefield, you may search your library for up to three cards named Skyshroud Sentinel, reveal them, put them into your hand, then shuffle.

View File

@@ -2,7 +2,7 @@ Name:Whisper Squad
ManaCost:B
Types:Creature Human Soldier
PT:1/1
A:AB$ ChangeZone | Cost$ 1 B | Origin$ Library | Destination$ Battlefield | ChangeType$ Card.namedWhisper Squad | ChangeNum$ 1 | Tapped$ True | StackDescription$ SpellDescription | SpellDescription$ Search your library for a card named CARDNAME, put it onto the battlefield tapped, then shuffle.
A:AB$ ChangeZone | Cost$ 1 B | Origin$ Library | Destination$ Battlefield | ChangeType$ Card.namedWhisper Squad | ChangeNum$ 1 | Tapped$ True | StackDescription$ SpellDescription | SpellDescription$ Search your library for a card named Whisper Squad, put it onto the battlefield tapped, then shuffle.
DeckHints:Type$Human
DeckNeeds:Name$Whisper Squad
Oracle:{1}{B}: Search your library for a card named Whisper Squad, put it onto the battlefield tapped, then shuffle.

View File

@@ -2,9 +2,8 @@ Name:Yasharn, Implacable Earth
ManaCost:2 G W
Types:Legendary Creature Elemental Boar
PT:4/4
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigForest | TriggerDescription$ When NICKNAME enters the battlefield, search your library for a basic Forest card and a basic Plains card, reveal those cards, put them into your hand, then shuffle.
SVar:TrigForest:DB$ ChangeZone | Origin$ Library | Destination$ Hand | ChangeType$ Forest.Basic | ChangeNum$ 1 | SubAbility$ DBPlains
SVar:DBPlains:DB$ ChangeZone | Origin$ Library | Destination$ Hand | ChangeType$ Plains.Basic | ChangeNum$ 1
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigLands | TriggerDescription$ When NICKNAME enters the battlefield, search your library for a basic Forest card and a basic Plains card, reveal those cards, put them into your hand, then shuffle.
SVar:TrigLands:DB$ ChangeZone | Origin$ Library | Destination$ Hand | ChangeType$ EACH Forest.Basic & Plains.Basic
S:Mode$ CantPayLife | ValidPlayer$ Player | ValidCause$ Spell,Activated | ForCost$ True | Description$ Players can't pay life or sacrifice nonland permanents to cast spells or activate abilities.
S:Mode$ CantSacrifice | ValidCard$ Permanent.nonLand | ValidCause$ Spell,Activated | ForCost$ True | Secondary$ True | Description$ Players can't pay life or sacrifice nonland permanents to cast spells or activate abilities.
AI:RemoveDeck:Random

View File

@@ -170,11 +170,13 @@ public class TargetSelection {
//this handles "target opponent" cards, along with any other cards that can only target a single non-card game entity
//note that we don't handle auto-targeting cards this way since it's possible that the result will be undesirable
List<GameEntity> nonCardTargets = tgt.getAllCandidates(this.ability, true, true);
if (nonCardTargets.size() == 1 && minTargets != 0) {
return ability.getTargets().add(nonCardTargets.get(0));
}
if (nonCardTargets.isEmpty()) {
return false;
if (minTargets != 0) {
if (nonCardTargets.size() == 1) {
return ability.getTargets().add(nonCardTargets.get(0));
}
if (nonCardTargets.isEmpty()) {
return false;
}
}
}
else if (validTargets.size() == 1 && minTargets != 0 && ability.isTrigger() && !tgt.canTgtPlayer()) {