- Added the optional parameter "Attacked" to the "Attacks" trigger. If set to player it won't trigger when a planeswalker is attacked.

This commit is contained in:
Sloth
2011-10-31 19:50:45 +00:00
parent b8d5758770
commit 435914c62e
5 changed files with 13 additions and 3 deletions

View File

@@ -2096,6 +2096,7 @@ public class CombatUtil {
CardList otherAttackers = new CardList(AllZone.getCombat().getAttackers());
otherAttackers.remove(c);
runParams.put("OtherAttackers", otherAttackers);
runParams.put("Attacked", AllZone.getCombat().getDefenderByAttacker(c));
AllZone.getTriggerHandler().runTrigger("Attacks", runParams);
// Annihilator:

View File

@@ -3,8 +3,11 @@ package forge.card.trigger;
import java.util.HashMap;
import java.util.Map;
import org.apache.commons.lang3.StringUtils;
import forge.Card;
import forge.CardList;
import forge.Player;
import forge.card.spellability.SpellAbility;
/**
@@ -41,6 +44,12 @@ public class Trigger_Attacks extends Trigger {
return false;
}
}
if (mapParams.containsKey("Attacked")) {
if (mapParams.get("Attacked").equals("Player") && StringUtils.isNumeric(runParams2.get("Attacked").toString())
&& Integer.parseInt(runParams2.get("Attacked").toString()) > 0)
return false;
}
if (mapParams.containsKey("Alone")) {
CardList otherAttackers = (CardList) runParams2.get("OtherAttackers");