mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 19:58:00 +00:00
- Added Naban, Dean of Iteration (the Changetext effect was tested)
This commit is contained in:
@@ -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<String, Object> runParams) {
|
||||
private int handlePanharmonicon(final Trigger t, final Map<String, Object> 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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user