*Added AttackersDeclared trigger.

*Converted Lighmine Field.
This commit is contained in:
Hellfish
2011-09-17 07:59:40 +00:00
parent 09e2618db3
commit 5824a78ee5
5 changed files with 16 additions and 9 deletions

View File

@@ -15,15 +15,9 @@
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>net.sf.eclipsecs.core.CheckstyleBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>net.sf.eclipsecs.core.CheckstyleNature</nature>
</natures>
</projectDescription>

View File

@@ -2,8 +2,8 @@ Name:Lightmine Field
ManaCost:2 W W
Types:Enchantment
Text:no text
T:Mode$ Attacks | ValidCard$ Creature | Execute$ TrigDamage | TriggerZones$ Battlefield | TriggerDescription$ Whenever one or more creatures attack, CARDNAME deals damage to each of those creatures equal to the number of attacking creatures.
SVar:TrigDamage:AB$DealDamage | Cost$ 0 | Defined$ TriggeredAttacker | NumDmg$ X
T:Mode$ AttackersDeclared | Execute$ TrigDamage | TriggerZones$ Battlefield | TriggerDescription$ Whenever one or more creatures attack, CARDNAME deals damage to each of those creatures equal to the number of attacking creatures.
SVar:TrigDamage:AB$DealDamage | Cost$ 0 | Defined$ TriggeredAttackers | NumDmg$ X
SVar:X:Count$Valid Creature.attacking
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/lightmine_field.jpg

View File

@@ -4,6 +4,7 @@ import forge.card.cardFactory.CardFactoryUtil;
import forge.gui.input.Input;
import java.util.ArrayList;
import java.util.HashMap;
/**
* <p>PhaseUtil class.</p>
@@ -425,7 +426,11 @@ public class PhaseUtil {
// Make sure exalted effects get applied only once per combat
}
HashMap<String,Object> runParams = new HashMap<String,Object>();
runParams.put("Attackers", list);
AllZone.getTriggerHandler().runTrigger("AttackersDeclared", runParams);
for (Card c : list)
CombatUtil.checkDeclareAttackers(c);
AllZone.getStack().unfreezeStack();

View File

@@ -1343,6 +1343,12 @@ public class AbilityFactory {
if (crd instanceof Card) {
c = AllZoneUtil.getCardState((Card) crd);
}
else if (crd instanceof CardList) {
for(Card cardItem : (CardList)crd)
{
cards.add(cardItem);
}
}
} else if (defined.equals("Remembered")) {
for (Object o : hostCard.getRemembered()) {
if (o instanceof Card) {

View File

@@ -106,6 +106,8 @@ public class TriggerHandler {
ret = new Trigger_Always(mapParams, host, intrinsic);
} else if (mode.equals("AttackerBlocked")) {
ret = new Trigger_AttackerBlocked(mapParams, host, intrinsic);
} else if (mode.equals("AttackersDeclared")) {
ret = new Trigger_AttackersDeclared(mapParams, host, intrinsic);
} else if (mode.equals("AttackerUnblocked")) {
ret = new Trigger_AttackerUnblocked(mapParams, host, intrinsic);
} else if (mode.equals("Attacks")) {