mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 20:28:00 +00:00
AttackerBlocked = Attacker,Blocker AttackerUnblocked = Attacker Attacks = Attacker Blocks = Attacker,Blocker ChangesZone = Card(The card that was moved) CounterAdded = Card(The card that got the counter(s)) Cycled = Card(The card that was cycled) DamageDone = Source(The card that dealt the damage),Target(The card or player who recieved the damage),DamageAmount(The amount of damage that was dealt) [BEWARE: Since Target can be both a card or a player object, you must take care to match it with your ValidTarget parameter!] Discarded = Card(The card that was discarded) Drawn = Card(The card that was drawn) LandPlayed = Card(The card that was played) LifeGained = Player(The player who gained life),LifeAmount(The amount of life that was gained) LifeLost = Player(The player who lost life),LifeAmount(The amount of life that was lost) Phase = Player(The player whose turn it is) Sacrificed = Card(The card that was sacrificed) SpellAbilityCast = Card(The card of the spell or ability) Taps = Card(The card that was tapped) TurnFaceUp = Card(The card that was turned face up) Untaps = Card(The card that was untapped) To use a parameter, simply call it like this: "Triggered<Parameter Name>". To get the controller or owner of a card parameter, append Controller or Owner. For example: "TriggeredAttackerController". Parameters that don't return an integer (i.e. the ones that have "Amount" in their name) can be used for Defined$ parameters or to get additional info from, a'la "SVar:X:TriggeredBlocker$CardPower". Parameters that DO return an integer can only be accessed via Count$ like this: "Count$TriggeredLifeAmount". *Updated all cards that use Triggered to their new respective parameters.
45 lines
894 B
Java
45 lines
894 B
Java
package forge;
|
|
|
|
import java.util.HashMap;
|
|
|
|
public class Trigger_Taps extends Trigger {
|
|
|
|
public Trigger_Taps(HashMap<String, String> params, Card host) {
|
|
super(params, host);
|
|
}
|
|
|
|
@Override
|
|
public boolean performTest(HashMap<String, Object> runParams)
|
|
{
|
|
Card tapper = (Card)runParams.get("Card");
|
|
|
|
if(mapParams.containsKey("ValidCard"))
|
|
{
|
|
if(!tapper.isValidCard(mapParams.get("ValidCard").split(","), hostCard.getController(), hostCard))
|
|
{
|
|
return false;
|
|
}
|
|
}
|
|
|
|
return true;
|
|
}
|
|
|
|
@Override
|
|
public Trigger getCopy() {
|
|
Trigger copy = new Trigger_Taps(mapParams,hostCard);
|
|
if(overridingAbility != null)
|
|
{
|
|
copy.setOverridingAbility(overridingAbility);
|
|
}
|
|
copy.setName(name);
|
|
|
|
return copy;
|
|
}
|
|
|
|
@Override
|
|
public void setTriggeringObjects(Card c)
|
|
{
|
|
c.setTriggeringObject("Card",runParams.get("Card"));
|
|
}
|
|
}
|