From ac721780f7e47cb7fb322c6f9788096bf9110ddc Mon Sep 17 00:00:00 2001 From: Northmoc Date: Fri, 22 Nov 2024 19:05:27 -0500 Subject: [PATCH 1/2] YDSK: improvising_aerialist.txt + support --- forge-game/src/main/java/forge/game/card/CardProperty.java | 4 ++++ forge-gui/res/cardsfolder/i/improvising_aerialist.txt | 7 +++++++ 2 files changed, 11 insertions(+) create mode 100644 forge-gui/res/cardsfolder/i/improvising_aerialist.txt diff --git a/forge-game/src/main/java/forge/game/card/CardProperty.java b/forge-game/src/main/java/forge/game/card/CardProperty.java index 2570a8a36ee..70068787441 100644 --- a/forge-game/src/main/java/forge/game/card/CardProperty.java +++ b/forge-game/src/main/java/forge/game/card/CardProperty.java @@ -650,6 +650,10 @@ public class CardProperty { if (cards.isEmpty() || !card.equals(cards.get(0))) { return false; } + } else if (property.startsWith("TopLibrary_")) { + CardCollection cards = new CardCollection(card.getOwner().getCardsIn(ZoneType.Library)); + cards = CardLists.getValidCards(cards, property.substring(11), sourceController, source, spellAbility); + if (cards.isEmpty() || !card.equals(cards.get(0))) return false; } else if (property.startsWith("TopLibraryLand")) { CardCollection cards = CardLists.filter(card.getOwner().getCardsIn(ZoneType.Library), CardPredicates.Presets.LANDS); if (cards.isEmpty() || !card.equals(cards.get(0))) { diff --git a/forge-gui/res/cardsfolder/i/improvising_aerialist.txt b/forge-gui/res/cardsfolder/i/improvising_aerialist.txt new file mode 100644 index 00000000000..56117666c89 --- /dev/null +++ b/forge-gui/res/cardsfolder/i/improvising_aerialist.txt @@ -0,0 +1,7 @@ +Name:Improvising Aerialist +ManaCost:1 W +Types:Creature Human Survivor +PT:3/2 +T:Mode$ Phase | Phase$ Main | PhaseCount$ 2 | ValidPlayer$ You | PresentDefined$ Self | IsPresent$ Card.tapped | Execute$ TrigPerpetual | TriggerDescription$ Survival — At the beginning of your second main phase, if CARDNAME is tapped, CARDNAME and the top creature card in your library without flying perpetually gain flying. +SVar:TrigPerpetual:DB$ Pump | PumpZone$ Battlefield,Library | Defined$ Self & ValidLibrary Creature.YouOwn+TopLibrary_Creature.withoutFlying | KW$ Flying | Duration$ Perpetual +Oracle:Survival — At the beginning of your second main phase, if Improvising Aerialist is tapped, Improvising Aerialist and the top creature card in your library without flying perpetually gain flying. From bd55cc330e21d234ff9a1cb94117b318851e1797 Mon Sep 17 00:00:00 2001 From: Northmoc Date: Sat, 23 Nov 2024 16:14:12 -0500 Subject: [PATCH 2/2] tidy up CardProperty.cardHasProperty for Top/BottomLibrary --- .../java/forge/game/card/CardProperty.java | 30 +++++-------------- 1 file changed, 8 insertions(+), 22 deletions(-) diff --git a/forge-game/src/main/java/forge/game/card/CardProperty.java b/forge-game/src/main/java/forge/game/card/CardProperty.java index 70068787441..05b982e2b08 100644 --- a/forge-game/src/main/java/forge/game/card/CardProperty.java +++ b/forge-game/src/main/java/forge/game/card/CardProperty.java @@ -650,29 +650,15 @@ public class CardProperty { if (cards.isEmpty() || !card.equals(cards.get(0))) { return false; } - } else if (property.startsWith("TopLibrary_")) { - CardCollection cards = new CardCollection(card.getOwner().getCardsIn(ZoneType.Library)); - cards = CardLists.getValidCards(cards, property.substring(11), sourceController, source, spellAbility); + } else if (property.startsWith("TopLibrary") || property.startsWith("BottomLibrary")) { + CardCollection cards = (CardCollection) card.getOwner().getCardsIn(ZoneType.Library); + if (!property.equals("TopLibrary")) { + if (property.equals("TopLibraryLand")) cards = CardLists.filter(cards, Presets.LANDS); + else if (property.contains("_")) cards = CardLists.getValidCards(cards, property.split("_")[1], + sourceController, source, spellAbility); + if (property.startsWith("Bottom")) Collections.reverse(cards); + } if (cards.isEmpty() || !card.equals(cards.get(0))) return false; - } else if (property.startsWith("TopLibraryLand")) { - CardCollection cards = CardLists.filter(card.getOwner().getCardsIn(ZoneType.Library), CardPredicates.Presets.LANDS); - if (cards.isEmpty() || !card.equals(cards.get(0))) { - return false; - } - } else if (property.startsWith("TopLibrary")) { - final CardCollectionView cards = card.getOwner().getCardsIn(ZoneType.Library); - if (cards.isEmpty() || !card.equals(cards.get(0))) { - return false; - } - } else if (property.startsWith("BottomLibrary")) { - CardCollection cards = new CardCollection(card.getOwner().getCardsIn(ZoneType.Library)); - if (property.startsWith("BottomLibrary_")) { - cards = CardLists.getValidCards(cards, property.substring(14), sourceController, source, spellAbility); - } - Collections.reverse(cards); - if (cards.isEmpty() || !card.equals(cards.get(0))) { - return false; - } } else if (property.startsWith("Cloned")) { if (card.getCloneOrigin() == null || !card.getCloneOrigin().equals(source)) { return false;