mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 12:48:00 +00:00
*Converted Orim's Prayer to Trigger_AttackersDeclared.
*Added the missed trigger class.
This commit is contained in:
1
.gitattributes
vendored
1
.gitattributes
vendored
@@ -9711,6 +9711,7 @@ src/main/java/forge/card/trigger/TriggerHandler.java svneol=native#text/plain
|
||||
src/main/java/forge/card/trigger/Trigger_Always.java svneol=native#text/plain
|
||||
src/main/java/forge/card/trigger/Trigger_AttackerBlocked.java svneol=native#text/plain
|
||||
src/main/java/forge/card/trigger/Trigger_AttackerUnblocked.java svneol=native#text/plain
|
||||
src/main/java/forge/card/trigger/Trigger_AttackersDeclared.java -text
|
||||
src/main/java/forge/card/trigger/Trigger_Attacks.java svneol=native#text/plain
|
||||
src/main/java/forge/card/trigger/Trigger_BecomesTarget.java svneol=native#text/plain
|
||||
src/main/java/forge/card/trigger/Trigger_Blocks.java svneol=native#text/plain
|
||||
|
||||
@@ -2,8 +2,9 @@ Name:Orim's Prayer
|
||||
ManaCost:1 W W
|
||||
Types:Enchantment
|
||||
Text:no text
|
||||
T:Mode$ Attacks | ValidCard$ Creature.YouDontCtrl | TriggerZones$ Battlefield | Execute$ TrigGainLife | TriggerDescription$ Whenever one or more creatures attack you, you gain 1 life for each attacking creature.
|
||||
SVar:TrigGainLife:AB$GainLife | Cost$ 0 | LifeAmount$ 1 | SpellDescription$ You gain 1 life for each attacking creature.
|
||||
T:Mode$ AttackersDeclared | AttackingPlayer$ Opponent | TriggerZones$ Battlefield | Execute$ TrigGainLife | TriggerDescription$ Whenever one or more creatures attack you, you gain 1 life for each attacking creature.
|
||||
SVar:TrigGainLife:AB$GainLife | Cost$ 0 | LifeAmount$ X
|
||||
SVar:X:Count$Valid Creature.attacking
|
||||
SVar:Rarity:Uncommon
|
||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/orims_prayer.jpg
|
||||
SetInfo:TMP|Uncommon|http://magiccards.info/scans/en/tp/245.jpg
|
||||
|
||||
@@ -429,6 +429,7 @@ public class PhaseUtil {
|
||||
|
||||
HashMap<String,Object> runParams = new HashMap<String,Object>();
|
||||
runParams.put("Attackers", list);
|
||||
runParams.put("AttackingPlayer", AllZone.getCombat().getAttackingPlayer());
|
||||
AllZone.getTriggerHandler().runTrigger("AttackersDeclared", runParams);
|
||||
|
||||
for (Card c : list)
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
package forge.card.trigger;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import forge.AllZone;
|
||||
import forge.Card;
|
||||
import forge.CardList;
|
||||
import forge.card.spellability.SpellAbility;
|
||||
|
||||
/**
|
||||
* TODO: Write javadoc for this type.
|
||||
*
|
||||
*/
|
||||
public class Trigger_AttackersDeclared extends Trigger{
|
||||
public Trigger_AttackersDeclared(HashMap<String, String> params, Card host, boolean intrinsic) {
|
||||
super(params,host,intrinsic);
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public boolean performTest(Map<String,Object> runParams2) {
|
||||
if(mapParams.containsKey("SingleAttacker"))
|
||||
{
|
||||
CardList attackers = (CardList)runParams2.get("Attackers");
|
||||
if(attackers.size() != 1)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if(mapParams.containsKey("AttackingPlayer"))
|
||||
{
|
||||
if(!matchesValid(runParams2.get("AttackingPlayer"), mapParams.get("AttackingPlayer").split(","), hostCard))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public Trigger getCopy() {
|
||||
Trigger copy = new Trigger_AttackersDeclared(this.mapParams,this.hostCard,this.isIntrinsic);
|
||||
|
||||
if(overridingAbility != null)
|
||||
{
|
||||
copy.setOverridingAbility(overridingAbility);
|
||||
}
|
||||
copy.setName(name);
|
||||
copy.setID(ID);
|
||||
|
||||
return copy;
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public void setTriggeringObjects(SpellAbility sa) {
|
||||
sa.setTriggeringObject("Attackers", runParams.get("Attackers"));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user