M21: add Sanctum of All

This commit is contained in:
Hans Mackowiak
2020-06-27 14:53:01 +02:00
parent 015bb428e4
commit 51fdf21d1e
3 changed files with 31 additions and 3 deletions

View File

@@ -1629,7 +1629,7 @@ public class Card extends GameEntity implements Comparable<Card> {
} }
} }
if (keyword.startsWith("CantBeCounteredBy") || keyword.startsWith("Panharmonicon") if (keyword.startsWith("CantBeCounteredBy") || keyword.startsWith("Panharmonicon")
|| keyword.startsWith("Dieharmonicon")) { || keyword.startsWith("Dieharmonicon") || keyword.startsWith("Shrineharmonicon")) {
final String[] p = keyword.split(":"); final String[] p = keyword.split(":");
sbLong.append(p[2]).append("\r\n"); sbLong.append(p[2]).append("\r\n");
} else if (keyword.startsWith("etbCounter")) { } else if (keyword.startsWith("etbCounter")) {
@@ -4192,6 +4192,7 @@ public class Card extends GameEntity implements Comparable<Card> {
public final boolean isFortification() { return getType().hasSubtype("Fortification"); } public final boolean isFortification() { return getType().hasSubtype("Fortification"); }
public final boolean isCurse() { return getType().hasSubtype("Curse"); } public final boolean isCurse() { return getType().hasSubtype("Curse"); }
public final boolean isAura() { return getType().hasSubtype("Aura"); } public final boolean isAura() { return getType().hasSubtype("Aura"); }
public final boolean isShrine() { return getType().hasSubtype("Shrine"); }
public final boolean isAttachment() { return isAura() || isEquipment() || isFortification(); } public final boolean isAttachment() { return isAura() || isEquipment() || isFortification(); }
public final boolean isHistoric() {return getType().isLegendary() || isArtifact() || getType().hasSubtype("Saga");} public final boolean isHistoric() {return getType().isLegendary() || isArtifact() || getType().hasSubtype("Saga");}

View File

@@ -26,6 +26,7 @@ import forge.game.ability.AbilityKey;
import forge.game.ability.effects.CharmEffect; import forge.game.ability.effects.CharmEffect;
import forge.game.card.Card; import forge.game.card.Card;
import forge.game.card.CardLists; import forge.game.card.CardLists;
import forge.game.card.CardPredicates;
import forge.game.card.CardUtil; import forge.game.card.CardUtil;
import forge.game.card.CardZoneTable; import forge.game.card.CardZoneTable;
import forge.game.keyword.KeywordInterface; import forge.game.keyword.KeywordInterface;
@@ -618,10 +619,29 @@ public class TriggerHandler {
private int handlePanharmonicon(final Trigger t, final Map<AbilityKey, Object> runParams, final Player p) { private int handlePanharmonicon(final Trigger t, final Map<AbilityKey, Object> runParams, final Player p) {
Card host = t.getHostCard(); Card host = t.getHostCard();
int n = 0;
// Sanctum of All
if (host.isShrine() && host.isInZone(ZoneType.Battlefield) && p.equals(host.getController())) {
int shrineCount = CardLists.count(p.getCardsIn(ZoneType.Battlefield), CardPredicates.isType("Shrine"));
if (shrineCount >= 6) {
for (final Card ck : p.getCardsIn(ZoneType.Battlefield)) {
for (final KeywordInterface ki : ck.getKeywords()) {
final String kw = ki.getOriginal();
if (kw.startsWith("Shrineharmonicon")) {
final String valid = kw.split(":")[1];
if (host.isValid(valid.split(","), p, ck, null)) {
n++;
}
}
}
}
}
}
// not a changesZone trigger or changesZoneAll // not a changesZone trigger or changesZoneAll
if (t.getMode() != TriggerType.ChangesZone && t.getMode() != TriggerType.ChangesZoneAll) { if (t.getMode() != TriggerType.ChangesZone && t.getMode() != TriggerType.ChangesZoneAll) {
return 0; return n;
} }
// leave battlefield trigger, might be dying // leave battlefield trigger, might be dying
@@ -636,7 +656,6 @@ public class TriggerHandler {
return 0; return 0;
} }
int n = 0;
if (t.getMode() == TriggerType.ChangesZone) { if (t.getMode() == TriggerType.ChangesZone) {
// iterate over all cards // iterate over all cards
final List<Card> lastCards = CardLists.filterControlledBy(p.getGame().getLastStateBattlefield(), p); final List<Card> lastCards = CardLists.filterControlledBy(p.getGame().getLastStateBattlefield(), p);

View File

@@ -0,0 +1,8 @@
Name:Sanctum of All
ManaCost:W U B R G
Types:Legendary Enchantment Shrine
T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | TriggerZones$ Battlefield | OptionalDecider$ You | Execute$ TrigSearch | TriggerDescription$ At the beginning of your upkeep, you may search your library and/or graveyard for a Shrine card and put it onto the battlefield. If you search your library this way, shuffle it.
SVar:TrigSearch:DB$ ChangeZone | Origin$ Library | OriginChoice$ True | OriginAlternative$ Graveyard | AlternativeMessage$ Would you like to search your library with this ability? If you do, your library will be shuffled. | Destination$ Battlefield | ChangeType$ Card.Shrine
K:Shrineharmonicon:Shrine.Other+YouCtrl:If an ability of another Shrine you control triggers while you control six or more Shrines, that ability triggers an additional time.
DeckHints:Type$Shrine
Oracle:At the beginning of your upkeep, you may search your library and/or graveyard for a Shrine card and put it onto the battlefield. If you search your library this way, shuffle it.\nIf an ability of another Shrine you control triggers while you control six or more Shrines, that ability triggers an additional time.