diff --git a/forge-game/src/main/java/forge/game/trigger/TriggerHandler.java b/forge-game/src/main/java/forge/game/trigger/TriggerHandler.java index c05bf6d815a..d16f309e8f7 100644 --- a/forge-game/src/main/java/forge/game/trigger/TriggerHandler.java +++ b/forge-game/src/main/java/forge/game/trigger/TriggerHandler.java @@ -348,12 +348,7 @@ public class TriggerHandler { // Static triggers for (final Trigger t : Lists.newArrayList(activeTriggers)) { if (t.isStatic() && canRunTrigger(t, mode, runParams)) { - int x = 1; - int p = t.getHostCard().getController().getAmountOfKeyword("Panharmonicon"); - - if (p > 0 && handlePanharmonicon(t, runParams)) { - x += p; - } + int x = 1 + handlePanharmonicon(t, runParams); for (int i = 0; i < x; ++i) { runSingleTrigger(t, runParams); @@ -425,12 +420,7 @@ public class TriggerHandler { } } - int x = 1; - int p = t.getHostCard().getController().getAmountOfKeyword("Panharmonicon"); - - if (p > 0 && handlePanharmonicon(t, runParams)) { - x += p; - } + int x = 1 + handlePanharmonicon(t, runParams);; for (int i = 0; i < x; ++i) { runSingleTrigger(t, runParams); @@ -674,28 +664,36 @@ public class TriggerHandler { } } - private boolean handlePanharmonicon(final Trigger t, final Map runParams) { + private int handlePanharmonicon(final Trigger t, final Map runParams) { + final Card host = t.getHostCard(); + final Player p = host.getController(); + // not a changesZone trigger if (t.getMode() != TriggerType.ChangesZone) { - return false; + return 0; } // not a Permanent you control - if (!t.getHostCard().isPermanent() || !t.getHostCard().isInZone(ZoneType.Battlefield)) { - return false; + if (!host.isPermanent() || !host.isInZone(ZoneType.Battlefield)) { + return 0; } - // its not an ETB trigger or the card is not a Artifact or Creature - if (runParams.get("Destination") instanceof String) { - final String dest = (String) runParams.get("Destination"); - if (dest.equals("Battlefield") && runParams.get("Card") instanceof Card) { - final Card card = (Card) runParams.get("Card"); - if (card.isCreature() || card.isArtifact()) { - return true; + int n = 0; + for (final String kw : p.getKeywords()) { + if (kw.startsWith("Panharmonicon")) { + if (runParams.get("Destination") instanceof String) { + final String dest = (String) runParams.get("Destination"); + if (dest.equals("Battlefield") && runParams.get("Card") instanceof Card) { + final Card card = (Card) runParams.get("Card"); + final String valid = kw.split(":")[1]; + if (card.isValid(valid.split(","), p, host, null)) { + n++; + } + } } } } - return false; + return n; } } diff --git a/forge-gui/res/cardsfolder/p/naban_dean_of_iteration.txt b/forge-gui/res/cardsfolder/p/naban_dean_of_iteration.txt new file mode 100644 index 00000000000..cbd17299770 --- /dev/null +++ b/forge-gui/res/cardsfolder/p/naban_dean_of_iteration.txt @@ -0,0 +1,7 @@ +Name:Naban, Dean of Iteration +ManaCost:1 U +Types:Legendary Creature Human Wizard +PT:2/1 +S:Mode$ Continuous | Affected$ You | AddKeyword$ Panharmonicon:Wizard.YouCtrl | Description$ If a Wizard entering the battlefield under your control causes a triggered ability of a permanent you control to trigger, that ability triggers an additional time. +SVar:Picture:http://www.wizards.com/global/images/magic/general/naban_dean_of_iteration.jpg +Oracle:If a Wizard entering the battlefield under your control causes a triggered ability of a permanent you control to trigger, that ability triggers an additional time. diff --git a/forge-gui/res/cardsfolder/p/panharmonicon.txt b/forge-gui/res/cardsfolder/p/panharmonicon.txt index 368ab7e0eca..ebe29c22590 100644 --- a/forge-gui/res/cardsfolder/p/panharmonicon.txt +++ b/forge-gui/res/cardsfolder/p/panharmonicon.txt @@ -1,6 +1,6 @@ Name:Panharmonicon ManaCost:4 Types:Artifact -S:Mode$ Continuous | Affected$ You | AddKeyword$ Panharmonicon | Description$ If an artifact or creature entering the battlefield causes a triggered ability of a permanent you control to trigger, that ability triggers an additional time. +S:Mode$ Continuous | Affected$ You | AddKeyword$ Panharmonicon:Creature,Artifact | Description$ If an artifact or creature entering the battlefield causes a triggered ability of a permanent you control to trigger, that ability triggers an additional time. SVar:Picture:http://www.wizards.com/global/images/magic/general/panharmonicon.jpg Oracle:If an artifact or creature entering the battlefield causes a triggered ability of a permanent you control to trigger, that ability triggers an additional time.