- 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

@@ -2,7 +2,7 @@ Name:Briar Patch
ManaCost:1 G G ManaCost:1 G G
Types:Enchantment Types:Enchantment
Text:no text Text:no text
T:Mode$ Attacks | ValidCard$ Creature.YouDontCtrl | TriggerZones$ Battlefield | Execute$ TrigPump | TriggerDescription$ Whenever a creature attacks you, it gets -1/-0 until end of turn. T:Mode$ Attacks | ValidCard$ Creature.YouDontCtrl | Attacked$ Player | TriggerZones$ Battlefield | Execute$ TrigPump | TriggerDescription$ Whenever a creature attacks you, it gets -1/-0 until end of turn.
SVar:TrigPump:AB$Pump | Cost$ 0 | Defined$ TriggeredAttacker | NumAtt$ -1 SVar:TrigPump:AB$Pump | Cost$ 0 | Defined$ TriggeredAttacker | NumAtt$ -1
SVar:Rarity:Uncommon SVar:Rarity:Uncommon
SVar:Picture:http://www.wizards.com/global/images/magic/general/briar_patch.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/briar_patch.jpg

View File

@@ -2,7 +2,7 @@ Name:Hissing Miasma
ManaCost:1 B B ManaCost:1 B B
Types:Enchantment Types:Enchantment
Text:no text Text:no text
T:Mode$ Attacks | ValidCard$ Creature.YouDontCtrl | TriggerZones$ Battlefield | Execute$ TrigLoseLife | TriggerDescription$ Whenever a creature attacks you, its controller loses 1 life. T:Mode$ Attacks | ValidCard$ Creature.YouDontCtrl | Attacked$ Player | TriggerZones$ Battlefield | Execute$ TrigLoseLife | TriggerDescription$ Whenever a creature attacks you, its controller loses 1 life.
SVar:TrigLoseLife:AB$LoseLife | Cost$ 0 | Defined$ Opponent | LifeAmount$ 1 | SpellDescription$ Whenever a creature attacks you, its controller loses 1 life. SVar:TrigLoseLife:AB$LoseLife | Cost$ 0 | Defined$ Opponent | LifeAmount$ 1 | SpellDescription$ Whenever a creature attacks you, its controller loses 1 life.
SVar:Rarity:Uncommon SVar:Rarity:Uncommon
SVar:Picture:http://www.wizards.com/global/images/magic/general/hissing_miasma.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/hissing_miasma.jpg

View File

@@ -2,7 +2,7 @@ Name:Raking Canopy
ManaCost:1 G G ManaCost:1 G G
Types:Enchantment Types:Enchantment
Text:no text Text:no text
T:Mode$ Attacks | ValidCard$ Creature.YouDontCtrl+withFlying | TriggerZones$ Battlefield | Execute$ TrigDamage | TriggerDescription$ Whenever a creature with flying attacks you, CARDNAME deals 4 damage to it. T:Mode$ Attacks | ValidCard$ Creature.YouDontCtrl+withFlying | Attacked$ Player | TriggerZones$ Battlefield | Execute$ TrigDamage | TriggerDescription$ Whenever a creature with flying attacks you, CARDNAME deals 4 damage to it.
SVar:TrigDamage:AB$DealDamage | Cost$ 0 | Defined$ TriggeredAttacker | NumDmg$ 4 SVar:TrigDamage:AB$DealDamage | Cost$ 0 | Defined$ TriggeredAttacker | NumDmg$ 4
SVar:Rarity:Uncommon SVar:Rarity:Uncommon
SVar:Picture:http://www.wizards.com/global/images/magic/general/raking_canopy.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/raking_canopy.jpg

View File

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

View File

@@ -3,8 +3,11 @@ package forge.card.trigger;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import org.apache.commons.lang3.StringUtils;
import forge.Card; import forge.Card;
import forge.CardList; import forge.CardList;
import forge.Player;
import forge.card.spellability.SpellAbility; import forge.card.spellability.SpellAbility;
/** /**
@@ -41,6 +44,12 @@ public class Trigger_Attacks extends Trigger {
return false; 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")) { if (mapParams.containsKey("Alone")) {
CardList otherAttackers = (CardList) runParams2.get("OtherAttackers"); CardList otherAttackers = (CardList) runParams2.get("OtherAttackers");