mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 04:38:00 +00:00
- 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:
@@ -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:
|
||||
|
||||
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user