Skip to content

Commit

Permalink
Add Central elevator (#6292)
Browse files Browse the repository at this point in the history
  • Loading branch information
tehdiplomat authored Oct 13, 2024
1 parent 0bf92af commit 6b03f69
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
17 changes: 17 additions & 0 deletions forge-game/src/main/java/forge/game/ability/AbilityUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -2526,6 +2526,23 @@ public static int xCount(Card c, final String s, final CardTraitBase ctb) {
return doXMath(unlocked, expr, c, ctb);
}

// Count$DistinctUnlockedDoors <Valid>
// Counts the distinct names of unlocked doors. Used for the "Promising Stairs"
if (sq[0].startsWith("DistinctUnlockedDoors")) {
final String[] workingCopy = l[0].split(" ", 2);
final String validFilter = workingCopy[1];

Set<String> viewedNames = new HashSet<>();
for (Card doorCard : CardLists.getValidCards(player.getCardsIn(ZoneType.Battlefield), validFilter, player, c, ctb)) {
for(CardStateName stateName : doorCard.getUnlockedRooms()) {
viewedNames.add(doorCard.getState(stateName).getName());
}
}
int distinctUnlocked = viewedNames.size();

return doXMath(distinctUnlocked, expr, c, ctb);
}

// Manapool
if (sq[0].startsWith("ManaPool")) {
final String color = l[0].split(":")[1];
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Name:Central Elevator
ManaCost:3 U
Types:Enchantment Room
T:Mode$ UnlockDoor | ValidPlayer $ You | ValidCard$ Card.Self | ThisDoor$ True | Execute$ TrigSearch | TriggerDescription$ When you unlock this door, search your library for a Room card that doesn't have the same name as a Room you control, reveal it, put it into your hand, then shuffle.
SVar:TrigSearch:DB$ ChangeZone | ChangeType$ Room.doesNotShareNameWith Room.YouCtrl | ChangeNum$ 1 | Origin$ Library | Destination$ Hand
AlternateMode:Split
Oracle:When you unlock this door, search your library for a Room card that doesn't have the same name as a Room you control, reveal it, put it into your hand, then shuffle.

ALTERNATE

Name:Promising Stairs
ManaCost:2 U
Types:Enchantment Room
T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | TriggerZones$ Battlefield | Execute$ TrigSurveil | TriggerDescription$ At the beginning of your upkeep, surveil 1. You win the game if there are eight or more different names among unlocked doors of Rooms you control.
SVar:TrigSurveil:DB$ Surveil | SubAbility$ DBWin
SVar:DBWin:DB$ WinsGame | Defined$ You | ConditionCheckSVar$ RoomsUnlocked | ConditionSVarCompare$ GE8
SVar:RoomsUnlocked:Count$DistinctUnlockedDoors Card.Room+YouCtrl
Oracle:At the beginning of your upkeep, surveil 1. You win the game if there are eight or more different names among unlocked doors of Rooms you control.

0 comments on commit 6b03f69

Please sign in to comment.