Teysa Karlov: add Dieharmonicon to TriggerHandler

This commit is contained in:
Hanmac
2019-01-06 11:33:27 +01:00
parent b17edd31ac
commit d0b569a07f
2 changed files with 25 additions and 2 deletions

View File

@@ -693,7 +693,8 @@ public class TriggerHandler {
}
private int handlePanharmonicon(final Trigger t, final Map<String, Object> runParams) {
final Card host = t.getHostCard();
// Need to get the last info from the trigger host
final Card host = game.getChangeZoneLKIInfo(t.getHostCard());
final Player p = host.getController();
// not a changesZone trigger
@@ -709,9 +710,10 @@ public class TriggerHandler {
int n = 0;
for (final String kw : p.getKeywords()) {
if (kw.startsWith("Panharmonicon")) {
// Enter the Battlefield Trigger
if (runParams.get("Destination") instanceof String) {
final String dest = (String) runParams.get("Destination");
if (dest.equals("Battlefield") && runParams.get("Card") instanceof Card) {
if ("Battlefield".equals(dest) && 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)) {
@@ -719,6 +721,20 @@ public class TriggerHandler {
}
}
}
} else if (kw.startsWith("Dieharmonicon")) {
// 700.4. The term dies means “is put into a graveyard from the battlefield.”
if (runParams.get("Origin") instanceof String) {
final String origin = (String) runParams.get("Origin");
if ("Battlefield".equals(origin) && runParams.get("Destination") instanceof String) {
final String dest = (String) runParams.get("Destination");
if ("Graveyard".equals(dest) && runParams.get("Card") instanceof Card) {
final Card card = (Card) runParams.get("Card");
if (card.isCreature()) {
n++;
}
}
}
}
}
}

View File

@@ -0,0 +1,7 @@
Name:Teysa Karlov
ManaCost:2 W B
Types:Legendary Creature Human Advisor
PT:2/4
S:Mode$ Continuous | Affected$ You | AddKeyword$ Dieharmonicon | Description$ If a creature dying causes a triggered ability of a permanent you control to trigger, that ability triggers an additional time.
S:Mode$ Continuous | Affected$ Creature.token+YouCtrl | AddKeyword$ Vigilance & Lifelink | Description$ Creature tokens you control have vigilance and lifelink.
Oracle:If a creature dying causes a triggered ability of a permanent you control to trigger, that ability triggers an additional time.\nCreature tokens you control have vigilance and lifelink.