mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 20:28:00 +00:00
TriggerHandler: add extra Logic for Panharmonicon
This commit is contained in:
1
.gitattributes
vendored
1
.gitattributes
vendored
@@ -11337,6 +11337,7 @@ forge-gui/res/cardsfolder/p/pandemonium.txt -text
|
||||
forge-gui/res/cardsfolder/p/pang_tong_young_phoenix.txt svneol=native#text/plain
|
||||
forge-gui/res/cardsfolder/p/panglacial_wurm.txt -text
|
||||
forge-gui/res/cardsfolder/p/pangosaur.txt svneol=native#text/plain
|
||||
forge-gui/res/cardsfolder/p/panharmonicon.txt -text svneol=unset#text/plain
|
||||
forge-gui/res/cardsfolder/p/panic.txt svneol=native#text/plain
|
||||
forge-gui/res/cardsfolder/p/panic_attack.txt svneol=native#text/plain
|
||||
forge-gui/res/cardsfolder/p/panic_spellbomb.txt svneol=native#text/plain
|
||||
|
||||
@@ -327,7 +327,16 @@ public class TriggerHandler {
|
||||
// Static triggers
|
||||
for (final Trigger t : Lists.newArrayList(activeTriggers)) {
|
||||
if (t.isStatic() && canRunTrigger(t, mode, runParams)) {
|
||||
runSingleTrigger(t, runParams);
|
||||
int x = 1;
|
||||
|
||||
if (handlePanharmonicon(t, runParams)) {
|
||||
x += t.getHostCard().getController().getAmountOfKeyword("Panharmonicon");
|
||||
}
|
||||
|
||||
for (int i = 0; i < x; ++i) {
|
||||
runSingleTrigger(t, runParams);
|
||||
}
|
||||
|
||||
checkStatics = true;
|
||||
}
|
||||
}
|
||||
@@ -387,7 +396,15 @@ public class TriggerHandler {
|
||||
}
|
||||
}
|
||||
|
||||
runSingleTrigger(t, runParams);
|
||||
int x = 1;
|
||||
|
||||
if (handlePanharmonicon(t, runParams)) {
|
||||
x += t.getHostCard().getController().getAmountOfKeyword("Panharmonicon");
|
||||
}
|
||||
|
||||
for (int i = 0; i < x; ++i) {
|
||||
runSingleTrigger(t, runParams);
|
||||
}
|
||||
checkStatics = true;
|
||||
}
|
||||
}
|
||||
@@ -610,4 +627,29 @@ public class TriggerHandler {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private boolean handlePanharmonicon(final Trigger t, final Map<String, Object> runParams) {
|
||||
// not a changesZone trigger
|
||||
if (t.getMode() != TriggerType.ChangesZone) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// not a Permanent you control
|
||||
if (!t.getHostCard().isPermanent() || !t.getHostCard().isInZone(ZoneType.Battlefield)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
6
forge-gui/res/cardsfolder/p/panharmonicon.txt
Normal file
6
forge-gui/res/cardsfolder/p/panharmonicon.txt
Normal file
@@ -0,0 +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.
|
||||
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.
|
||||
Reference in New Issue
Block a user