mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 19:28:01 +00:00
inlined the getMapParams() member for all the descendants of Trigger class, the field mapParams is now protected final.
TriggerChangesZone - adding a new check on triggered card (for Tunnel Ignus) Trigger - commented out requirementsCheck on triggered objects, 'cause they are specific for each trigger
This commit is contained in:
@@ -97,7 +97,7 @@ public abstract class Trigger extends TriggerReplacementBase {
|
||||
}
|
||||
|
||||
/** The map params. */
|
||||
private HashMap<String, String> mapParams = new HashMap<String, String>();
|
||||
protected final HashMap<String, String> mapParams = new HashMap<String, String>();
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -110,16 +110,6 @@ public abstract class Trigger extends TriggerReplacementBase {
|
||||
return this.mapParams;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the map params.
|
||||
*
|
||||
* @param mapParams0
|
||||
* the mapParams to set
|
||||
*/
|
||||
public final void setMapParams(final HashMap<String, String> mapParams0) {
|
||||
this.mapParams = mapParams0;
|
||||
}
|
||||
|
||||
/** The run params. */
|
||||
private Map<String, Object> runParams;
|
||||
|
||||
@@ -174,7 +164,7 @@ public abstract class Trigger extends TriggerReplacementBase {
|
||||
public Trigger(final String n, final Map<String, String> params, final Card host, final boolean intrinsic) {
|
||||
this.name = n;
|
||||
this.setRunParams(new HashMap<String, Object>());
|
||||
this.getMapParams().putAll(params);
|
||||
this.mapParams.putAll(params);
|
||||
this.setHostCard(host);
|
||||
|
||||
this.setIntrinsic(intrinsic);
|
||||
@@ -194,7 +184,7 @@ public abstract class Trigger extends TriggerReplacementBase {
|
||||
*/
|
||||
public Trigger(final Map<String, String> params, final Card host, final boolean intrinsic) {
|
||||
this.setRunParams(new HashMap<String, Object>());
|
||||
this.getMapParams().putAll(params);
|
||||
this.mapParams.putAll(params);
|
||||
this.setHostCard(host);
|
||||
|
||||
this.setIntrinsic(intrinsic);
|
||||
@@ -209,8 +199,8 @@ public abstract class Trigger extends TriggerReplacementBase {
|
||||
*/
|
||||
@Override
|
||||
public final String toString() {
|
||||
if (this.getMapParams().containsKey("TriggerDescription") && !this.isSuppressed()) {
|
||||
return this.getMapParams().get("TriggerDescription").replace("CARDNAME", this.getHostCard().getName());
|
||||
if (this.mapParams.containsKey("TriggerDescription") && !this.isSuppressed()) {
|
||||
return this.mapParams.get("TriggerDescription").replace("CARDNAME", this.getHostCard().getName());
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
@@ -231,19 +221,19 @@ public abstract class Trigger extends TriggerReplacementBase {
|
||||
}
|
||||
}
|
||||
|
||||
if (this.getMapParams().containsKey("PlayerTurn")) {
|
||||
if (this.mapParams.containsKey("PlayerTurn")) {
|
||||
if (!phaseHandler.isPlayerTurn(this.getHostCard().getController())) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (this.getMapParams().containsKey("OpponentTurn")) {
|
||||
if (this.mapParams.containsKey("OpponentTurn")) {
|
||||
if (!phaseHandler.getPlayerTurn().isOpponentOf(this.getHostCard().getController())) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (this.getMapParams().containsKey("FirstCombat")) {
|
||||
if (this.mapParams.containsKey("FirstCombat")) {
|
||||
if (!phaseHandler.isFirstCombat()) {
|
||||
return false;
|
||||
}
|
||||
@@ -275,7 +265,7 @@ public abstract class Trigger extends TriggerReplacementBase {
|
||||
*/
|
||||
public final boolean requirementsCheck(GameState game, final Map<String, Object> runParams) {
|
||||
|
||||
if (this.getMapParams().containsKey("APlayerHasMoreLifeThanEachOther")) {
|
||||
if (this.mapParams.containsKey("APlayerHasMoreLifeThanEachOther")) {
|
||||
int highestLife = -50; // Negative base just in case a few Lich's or Platinum Angels are running around
|
||||
final List<Player> healthiest = new ArrayList<Player>();
|
||||
for (final Player p : game.getPlayers()) {
|
||||
@@ -295,7 +285,7 @@ public abstract class Trigger extends TriggerReplacementBase {
|
||||
}
|
||||
}
|
||||
|
||||
if (this.getMapParams().containsKey("APlayerHasMostCardsInHand")) {
|
||||
if (this.mapParams.containsKey("APlayerHasMostCardsInHand")) {
|
||||
int largestHand = 0;
|
||||
final List<Player> withLargestHand = new ArrayList<Player>();
|
||||
for (final Player p : game.getPlayers()) {
|
||||
@@ -315,13 +305,13 @@ public abstract class Trigger extends TriggerReplacementBase {
|
||||
}
|
||||
}
|
||||
|
||||
if ( !meetsCommonRequirements(getMapParams()))
|
||||
if ( !meetsCommonRequirements(this.mapParams))
|
||||
return false;
|
||||
|
||||
if ( !meetsRequirementsOnTriggeredObjects(runParams) )
|
||||
return false;
|
||||
// if ( !meetsRequirementsOnTriggeredObjects(runParams) )
|
||||
// return false;
|
||||
|
||||
if ("True".equals(getMapParams().get("EvolveCondition"))) {
|
||||
if ("True".equals(this.mapParams.get("EvolveCondition"))) {
|
||||
final Card moved = (Card) runParams.get("Card");
|
||||
if (moved == null) {
|
||||
return false;
|
||||
@@ -336,7 +326,7 @@ public abstract class Trigger extends TriggerReplacementBase {
|
||||
}
|
||||
}
|
||||
|
||||
String condition = getMapParams().get("Condition");
|
||||
String condition = this.mapParams.get("Condition");
|
||||
if( "AltCost".equals(condition) ) {
|
||||
final Card moved = (Card) runParams.get("Card");
|
||||
if( null != moved && !moved.isOptionalCostPaid(OptionalCost.AltCost))
|
||||
@@ -348,10 +338,10 @@ public abstract class Trigger extends TriggerReplacementBase {
|
||||
}
|
||||
|
||||
|
||||
private boolean meetsRequirementsOnTriggeredObjects(Map<String, Object> runParams) {
|
||||
// Check number of lands ETB this turn on triggered card's controller
|
||||
return true;
|
||||
}
|
||||
// private boolean meetsRequirementsOnTriggeredObjects(Map<String, Object> runParams) {
|
||||
//
|
||||
// return true;
|
||||
// }
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -361,8 +351,8 @@ public abstract class Trigger extends TriggerReplacementBase {
|
||||
* @return a boolean.
|
||||
*/
|
||||
public final boolean isSecondary() {
|
||||
if (this.getMapParams().containsKey("Secondary")) {
|
||||
if (this.getMapParams().get("Secondary").equals("True")) {
|
||||
if (this.mapParams.containsKey("Secondary")) {
|
||||
if (this.mapParams.get("Secondary").equals("True")) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -548,7 +538,7 @@ public abstract class Trigger extends TriggerReplacementBase {
|
||||
}
|
||||
|
||||
public boolean isStatic() {
|
||||
return getMapParams().containsKey("Static"); // && params.get("Static").equals("True") [always true if present]
|
||||
return this.mapParams.containsKey("Static"); // && params.get("Static").equals("True") [always true if present]
|
||||
}
|
||||
|
||||
public void setTriggerPhases(List<PhaseType> phases) {
|
||||
|
||||
@@ -57,7 +57,7 @@ public class TriggerAlways extends Trigger {
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public final Trigger getCopy() {
|
||||
final Trigger copy = new TriggerAlways(this.getMapParams(), this.getHostCard(), this.isIntrinsic());
|
||||
final Trigger copy = new TriggerAlways(this.mapParams, this.getHostCard(), this.isIntrinsic());
|
||||
if (this.getOverridingAbility() != null) {
|
||||
copy.setOverridingAbility(this.getOverridingAbility());
|
||||
}
|
||||
|
||||
@@ -52,15 +52,15 @@ public class TriggerAttached extends Trigger {
|
||||
final Card src = (Card) runParams2.get("AttachSource");
|
||||
final Object tgt = runParams2.get("AttachTarget");
|
||||
|
||||
if (this.getMapParams().containsKey("ValidSource")) {
|
||||
if (!src.isValid(this.getMapParams().get("ValidSource").split(","), this.getHostCard().getController(),
|
||||
if (this.mapParams.containsKey("ValidSource")) {
|
||||
if (!src.isValid(this.mapParams.get("ValidSource").split(","), this.getHostCard().getController(),
|
||||
this.getHostCard())) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (this.getMapParams().containsKey("ValidTarget")) {
|
||||
if (!matchesValid(tgt, this.getMapParams().get("ValidTarget").split(","), this.getHostCard())) {
|
||||
if (this.mapParams.containsKey("ValidTarget")) {
|
||||
if (!matchesValid(tgt, this.mapParams.get("ValidTarget").split(","), this.getHostCard())) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -71,7 +71,7 @@ public class TriggerAttached extends Trigger {
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public final Trigger getCopy() {
|
||||
final Trigger copy = new TriggerAttached(this.getMapParams(), this.getHostCard(), this.isIntrinsic());
|
||||
final Trigger copy = new TriggerAttached(this.mapParams, this.getHostCard(), this.isIntrinsic());
|
||||
if (this.getOverridingAbility() != null) {
|
||||
copy.setOverridingAbility(this.getOverridingAbility());
|
||||
}
|
||||
|
||||
@@ -51,14 +51,14 @@ public class TriggerAttackerBlocked extends Trigger {
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public final boolean performTest(final Map<String, Object> runParams2) {
|
||||
if (this.getMapParams().containsKey("ValidCard")) {
|
||||
if (!matchesValid(runParams2.get("Attacker"), this.getMapParams().get("ValidCard").split(","),
|
||||
if (this.mapParams.containsKey("ValidCard")) {
|
||||
if (!matchesValid(runParams2.get("Attacker"), this.mapParams.get("ValidCard").split(","),
|
||||
this.getHostCard())) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (this.getMapParams().containsKey("ValidBlocker")) {
|
||||
if (!matchesValid(runParams2.get("Blocker"), this.getMapParams().get("ValidBlocker").split(","),
|
||||
if (this.mapParams.containsKey("ValidBlocker")) {
|
||||
if (!matchesValid(runParams2.get("Blocker"), this.mapParams.get("ValidBlocker").split(","),
|
||||
this.getHostCard())) {
|
||||
return false;
|
||||
}
|
||||
@@ -70,7 +70,7 @@ public class TriggerAttackerBlocked extends Trigger {
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public final Trigger getCopy() {
|
||||
final Trigger copy = new TriggerAttackerBlocked(this.getMapParams(), this.getHostCard(), this.isIntrinsic());
|
||||
final Trigger copy = new TriggerAttackerBlocked(this.mapParams, this.getHostCard(), this.isIntrinsic());
|
||||
if (this.getOverridingAbility() != null) {
|
||||
copy.setOverridingAbility(this.getOverridingAbility());
|
||||
}
|
||||
|
||||
@@ -51,14 +51,14 @@ public class TriggerAttackerUnblocked extends Trigger {
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public final boolean performTest(final Map<String, Object> runParams2) {
|
||||
if (this.getMapParams().containsKey("ValidCard")) {
|
||||
if (!matchesValid(runParams2.get("Attacker"), this.getMapParams().get("ValidCard").split(","),
|
||||
if (this.mapParams.containsKey("ValidCard")) {
|
||||
if (!matchesValid(runParams2.get("Attacker"), this.mapParams.get("ValidCard").split(","),
|
||||
this.getHostCard())) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (this.getMapParams().containsKey("ValidDefender")) {
|
||||
if (!matchesValid(runParams2.get("Defender"), this.getMapParams().get("ValidDefender").split(","),
|
||||
if (this.mapParams.containsKey("ValidDefender")) {
|
||||
if (!matchesValid(runParams2.get("Defender"), this.mapParams.get("ValidDefender").split(","),
|
||||
this.getHostCard())) {
|
||||
return false;
|
||||
}
|
||||
@@ -69,7 +69,7 @@ public class TriggerAttackerUnblocked extends Trigger {
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public final Trigger getCopy() {
|
||||
final Trigger copy = new TriggerAttackerUnblocked(this.getMapParams(), this.getHostCard(), this.isIntrinsic());
|
||||
final Trigger copy = new TriggerAttackerUnblocked(this.mapParams, this.getHostCard(), this.isIntrinsic());
|
||||
if (this.getOverridingAbility() != null) {
|
||||
copy.setOverridingAbility(this.getOverridingAbility());
|
||||
}
|
||||
|
||||
@@ -46,16 +46,16 @@ public class TriggerAttackersDeclared extends Trigger {
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public final boolean performTest(final Map<String, Object> runParams2) {
|
||||
if (this.getMapParams().containsKey("SingleAttacker")) {
|
||||
if (this.mapParams.containsKey("SingleAttacker")) {
|
||||
@SuppressWarnings("unchecked")
|
||||
final List<Card> attackers = (List<Card>) runParams2.get("Attackers");
|
||||
if (attackers.size() != 1) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (this.getMapParams().containsKey("AttackingPlayer")) {
|
||||
if (this.mapParams.containsKey("AttackingPlayer")) {
|
||||
if (!matchesValid(runParams2.get("AttackingPlayer"),
|
||||
this.getMapParams().get("AttackingPlayer").split(","), this.getHostCard())) {
|
||||
this.mapParams.get("AttackingPlayer").split(","), this.getHostCard())) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -65,7 +65,7 @@ public class TriggerAttackersDeclared extends Trigger {
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public final Trigger getCopy() {
|
||||
final Trigger copy = new TriggerAttackersDeclared(this.getMapParams(), this.getHostCard(), this.isIntrinsic());
|
||||
final Trigger copy = new TriggerAttackersDeclared(this.mapParams, this.getHostCard(), this.isIntrinsic());
|
||||
|
||||
if (this.getOverridingAbility() != null) {
|
||||
copy.setOverridingAbility(this.getOverridingAbility());
|
||||
|
||||
@@ -53,28 +53,28 @@ public class TriggerAttacks extends Trigger {
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public final boolean performTest(final Map<String, Object> runParams2) {
|
||||
if (this.getMapParams().containsKey("ValidCard")) {
|
||||
if (!matchesValid(runParams2.get("Attacker"), this.getMapParams().get("ValidCard").split(","),
|
||||
if (this.mapParams.containsKey("ValidCard")) {
|
||||
if (!matchesValid(runParams2.get("Attacker"), this.mapParams.get("ValidCard").split(","),
|
||||
this.getHostCard())) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (this.getMapParams().containsKey("Attacked")) {
|
||||
if (this.mapParams.containsKey("Attacked")) {
|
||||
GameEntity attacked = (GameEntity) runParams2.get("Attacked");
|
||||
if (!attacked.isValid(this.getMapParams().get("Attacked").split(",")
|
||||
if (!attacked.isValid(this.mapParams.get("Attacked").split(",")
|
||||
, this.getHostCard().getController(), this.getHostCard())) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (this.getMapParams().containsKey("Alone")) {
|
||||
if (this.mapParams.containsKey("Alone")) {
|
||||
@SuppressWarnings("unchecked")
|
||||
final List<Card> otherAttackers = (List<Card>) runParams2.get("OtherAttackers");
|
||||
if (otherAttackers == null) {
|
||||
return false;
|
||||
}
|
||||
if (this.getMapParams().get("Alone").equals("True")) {
|
||||
if (this.mapParams.get("Alone").equals("True")) {
|
||||
if (otherAttackers.size() != 0) {
|
||||
return false;
|
||||
}
|
||||
@@ -85,7 +85,7 @@ public class TriggerAttacks extends Trigger {
|
||||
}
|
||||
}
|
||||
|
||||
if (this.getMapParams().containsKey("FirstAttack")) {
|
||||
if (this.mapParams.containsKey("FirstAttack")) {
|
||||
Card attacker = (Card) runParams2.get("Attacker");
|
||||
if (attacker.getDamageHistory().getCreatureAttacksThisTurn() > 1) {
|
||||
return false;
|
||||
@@ -98,7 +98,7 @@ public class TriggerAttacks extends Trigger {
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public final Trigger getCopy() {
|
||||
final Trigger copy = new TriggerAttacks(this.getMapParams(), this.getHostCard(), this.isIntrinsic());
|
||||
final Trigger copy = new TriggerAttacks(this.mapParams, this.getHostCard(), this.isIntrinsic());
|
||||
if (this.getOverridingAbility() != null) {
|
||||
copy.setOverridingAbility(this.getOverridingAbility());
|
||||
}
|
||||
|
||||
@@ -52,26 +52,26 @@ public class TriggerBecomesTarget extends Trigger {
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public final boolean performTest(final Map<String, Object> runParams2) {
|
||||
if (this.getMapParams().containsKey("SourceType")) {
|
||||
if (this.mapParams.containsKey("SourceType")) {
|
||||
final SpellAbility sa = (SpellAbility) runParams2.get("SourceSA");
|
||||
if (this.getMapParams().get("SourceType").equalsIgnoreCase("spell")) {
|
||||
if (this.mapParams.get("SourceType").equalsIgnoreCase("spell")) {
|
||||
if (!sa.isSpell()) {
|
||||
return false;
|
||||
}
|
||||
} else if (this.getMapParams().get("SourceType").equalsIgnoreCase("ability")) {
|
||||
} else if (this.mapParams.get("SourceType").equalsIgnoreCase("ability")) {
|
||||
if (!sa.isAbility()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (this.getMapParams().containsKey("ValidSource")) {
|
||||
if (!matchesValid(((SpellAbility) runParams2.get("SourceSA")).getSourceCard(), this.getMapParams()
|
||||
if (this.mapParams.containsKey("ValidSource")) {
|
||||
if (!matchesValid(((SpellAbility) runParams2.get("SourceSA")).getSourceCard(), this.mapParams
|
||||
.get("ValidSource").split(","), this.getHostCard())) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (this.getMapParams().containsKey("ValidTarget")) {
|
||||
if (!matchesValid(runParams2.get("Target"), this.getMapParams().get("ValidTarget").split(","),
|
||||
if (this.mapParams.containsKey("ValidTarget")) {
|
||||
if (!matchesValid(runParams2.get("Target"), this.mapParams.get("ValidTarget").split(","),
|
||||
this.getHostCard())) {
|
||||
return false;
|
||||
}
|
||||
@@ -83,7 +83,7 @@ public class TriggerBecomesTarget extends Trigger {
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public final Trigger getCopy() {
|
||||
final Trigger copy = new TriggerBecomesTarget(this.getMapParams(), this.getHostCard(), this.isIntrinsic());
|
||||
final Trigger copy = new TriggerBecomesTarget(this.mapParams, this.getHostCard(), this.isIntrinsic());
|
||||
if (this.getOverridingAbility() != null) {
|
||||
copy.setOverridingAbility(this.getOverridingAbility());
|
||||
}
|
||||
|
||||
@@ -51,14 +51,14 @@ public class TriggerBlocks extends Trigger {
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public final boolean performTest(final Map<String, Object> runParams2) {
|
||||
if (this.getMapParams().containsKey("ValidCard")) {
|
||||
if (!matchesValid(runParams2.get("Blocker"), this.getMapParams().get("ValidCard").split(","),
|
||||
if (this.mapParams.containsKey("ValidCard")) {
|
||||
if (!matchesValid(runParams2.get("Blocker"), this.mapParams.get("ValidCard").split(","),
|
||||
this.getHostCard())) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (this.getMapParams().containsKey("ValidBlocked")) {
|
||||
if (!matchesValid(runParams2.get("Attacker"), this.getMapParams().get("ValidBlocked").split(","),
|
||||
if (this.mapParams.containsKey("ValidBlocked")) {
|
||||
if (!matchesValid(runParams2.get("Attacker"), this.mapParams.get("ValidBlocked").split(","),
|
||||
this.getHostCard())) {
|
||||
return false;
|
||||
}
|
||||
@@ -70,7 +70,7 @@ public class TriggerBlocks extends Trigger {
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public final Trigger getCopy() {
|
||||
final Trigger copy = new TriggerBlocks(this.getMapParams(), this.getHostCard(), this.isIntrinsic());
|
||||
final Trigger copy = new TriggerBlocks(this.mapParams, this.getHostCard(), this.isIntrinsic());
|
||||
if (this.getOverridingAbility() != null) {
|
||||
copy.setOverridingAbility(this.getOverridingAbility());
|
||||
}
|
||||
|
||||
@@ -52,8 +52,8 @@ public class TriggerChampioned extends Trigger {
|
||||
public final boolean performTest(final java.util.Map<String, Object> runParams2) {
|
||||
final Card championed = (Card) runParams2.get("Championed");
|
||||
|
||||
if (this.getMapParams().containsKey("ValidCard")) {
|
||||
if (!championed.isValid(this.getMapParams().get("ValidCard").split(","),
|
||||
if (this.mapParams.containsKey("ValidCard")) {
|
||||
if (!championed.isValid(this.mapParams.get("ValidCard").split(","),
|
||||
this.getHostCard().getController(), this.getHostCard())) {
|
||||
return false;
|
||||
}
|
||||
@@ -65,7 +65,7 @@ public class TriggerChampioned extends Trigger {
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public final Trigger getCopy() {
|
||||
final Trigger copy = new TriggerChampioned(this.getMapParams(), this.getHostCard(), this.isIntrinsic());
|
||||
final Trigger copy = new TriggerChampioned(this.mapParams, this.getHostCard(), this.isIntrinsic());
|
||||
if (this.getOverridingAbility() != null) {
|
||||
copy.setOverridingAbility(this.getOverridingAbility());
|
||||
}
|
||||
|
||||
@@ -51,8 +51,8 @@ public class TriggerChangesController extends Trigger {
|
||||
public final boolean performTest(final java.util.Map<String, Object> runParams2) {
|
||||
final Card moved = (Card) runParams2.get("Card");
|
||||
|
||||
if (this.getMapParams().containsKey("ValidCard")) {
|
||||
if (!moved.isValid(this.getMapParams().get("ValidCard").split(","), this.getHostCard().getController(),
|
||||
if (this.mapParams.containsKey("ValidCard")) {
|
||||
if (!moved.isValid(this.mapParams.get("ValidCard").split(","), this.getHostCard().getController(),
|
||||
this.getHostCard())) {
|
||||
return false;
|
||||
}
|
||||
@@ -64,7 +64,7 @@ public class TriggerChangesController extends Trigger {
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public final Trigger getCopy() {
|
||||
final Trigger copy = new TriggerChangesZone(this.getMapParams(), this.getHostCard(), this.isIntrinsic());
|
||||
final Trigger copy = new TriggerChangesZone(this.mapParams, this.getHostCard(), this.isIntrinsic());
|
||||
if (this.getOverridingAbility() != null) {
|
||||
copy.setOverridingAbility(this.getOverridingAbility());
|
||||
}
|
||||
|
||||
@@ -20,7 +20,10 @@ package forge.card.trigger;
|
||||
import java.util.Map;
|
||||
|
||||
import forge.Card;
|
||||
import forge.card.ability.AbilityUtils;
|
||||
import forge.card.cardfactory.CardFactoryUtil;
|
||||
import forge.card.spellability.SpellAbility;
|
||||
import forge.util.Expressions;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -51,40 +54,57 @@ public class TriggerChangesZone extends Trigger {
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public final boolean performTest(final java.util.Map<String, Object> runParams2) {
|
||||
if (this.getMapParams().containsKey("Origin")) {
|
||||
if (!this.getMapParams().get("Origin").equals("Any")) {
|
||||
if (this.getMapParams().get("Origin") == null) {
|
||||
if (this.mapParams.containsKey("Origin")) {
|
||||
if (!this.mapParams.get("Origin").equals("Any")) {
|
||||
if (this.mapParams.get("Origin") == null) {
|
||||
return false;
|
||||
}
|
||||
if (!this.getMapParams().get("Origin").equals(runParams2.get("Origin"))) {
|
||||
if (!this.mapParams.get("Origin").equals(runParams2.get("Origin"))) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (this.getMapParams().containsKey("Destination")) {
|
||||
if (!this.getMapParams().get("Destination").equals("Any")) {
|
||||
if (!this.getMapParams().get("Destination").equals(runParams2.get("Destination"))) {
|
||||
if (this.mapParams.containsKey("Destination")) {
|
||||
if (!this.mapParams.get("Destination").equals("Any")) {
|
||||
if (!this.mapParams.get("Destination").equals(runParams2.get("Destination"))) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (this.getMapParams().containsKey("ValidCard")) {
|
||||
if (this.mapParams.containsKey("ValidCard")) {
|
||||
final Card moved = (Card) runParams2.get("Card");
|
||||
if (!moved.isValid(this.getMapParams().get("ValidCard").split(","), this.getHostCard().getController(),
|
||||
if (!moved.isValid(this.mapParams.get("ValidCard").split(","), this.getHostCard().getController(),
|
||||
this.getHostCard())) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Check number of lands ETB this turn on triggered card's controller
|
||||
if (mapParams.containsKey("CheckOnTriggeredCard")) {
|
||||
final String[] condition = mapParams.get("CheckOnTriggeredCard").split(" ", 2);
|
||||
|
||||
final Card host = hostCard.getGame().getCardState(hostCard);
|
||||
final String comparator = condition.length < 2 ? "GE1" : condition[1];
|
||||
final int referenceValue = AbilityUtils.calculateAmount(host, comparator.substring(2), null);
|
||||
final Object triggered = runParams2.get("Card");
|
||||
if(!(triggered instanceof Card))
|
||||
throw new IllegalArgumentException( host + " - CheckOnTriggeredCard being checked for a trigger that has no card!");
|
||||
|
||||
final int actualValue = CardFactoryUtil.xCount((Card)triggered, host.getSVar(condition[0]));
|
||||
if (!Expressions.compare(actualValue, comparator.substring(0, 2), referenceValue)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public final Trigger getCopy() {
|
||||
final Trigger copy = new TriggerChangesZone(this.getMapParams(), this.getHostCard(), this.isIntrinsic());
|
||||
final Trigger copy = new TriggerChangesZone(this.mapParams, this.getHostCard(), this.isIntrinsic());
|
||||
if (this.getOverridingAbility() != null) {
|
||||
copy.setOverridingAbility(this.getOverridingAbility());
|
||||
}
|
||||
|
||||
@@ -51,15 +51,15 @@ public class TriggerClashed extends Trigger {
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public final boolean performTest(final java.util.Map<String, Object> runParams2) {
|
||||
if (this.getMapParams().containsKey("ValidPlayer")) {
|
||||
if (!matchesValid(runParams2.get("Player"), this.getMapParams().get("ValidPlayer").split(","),
|
||||
if (this.mapParams.containsKey("ValidPlayer")) {
|
||||
if (!matchesValid(runParams2.get("Player"), this.mapParams.get("ValidPlayer").split(","),
|
||||
this.getHostCard())) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (this.getMapParams().containsKey("Won")) {
|
||||
if (!this.getMapParams().get("Won").equals(runParams2.get("Won"))) {
|
||||
if (this.mapParams.containsKey("Won")) {
|
||||
if (!this.mapParams.get("Won").equals(runParams2.get("Won"))) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -70,7 +70,7 @@ public class TriggerClashed extends Trigger {
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public final Trigger getCopy() {
|
||||
final Trigger copy = new TriggerClashed(this.getMapParams(), this.getHostCard(), this.isIntrinsic());
|
||||
final Trigger copy = new TriggerClashed(this.mapParams, this.getHostCard(), this.isIntrinsic());
|
||||
if (this.getOverridingAbility() != null) {
|
||||
copy.setOverridingAbility(this.getOverridingAbility());
|
||||
}
|
||||
|
||||
@@ -53,15 +53,15 @@ public class TriggerCounterAdded extends Trigger {
|
||||
final Card addedTo = (Card) runParams2.get("Card");
|
||||
final CounterType addedType = (CounterType) runParams2.get("CounterType");
|
||||
|
||||
if (this.getMapParams().containsKey("ValidCard")) {
|
||||
if (!addedTo.isValid(this.getMapParams().get("ValidCard").split(","), this.getHostCard().getController(),
|
||||
if (this.mapParams.containsKey("ValidCard")) {
|
||||
if (!addedTo.isValid(this.mapParams.get("ValidCard").split(","), this.getHostCard().getController(),
|
||||
this.getHostCard())) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (this.getMapParams().containsKey("CounterType")) {
|
||||
final String type = this.getMapParams().get("CounterType");
|
||||
if (this.mapParams.containsKey("CounterType")) {
|
||||
final String type = this.mapParams.get("CounterType");
|
||||
if (!type.equals(addedType.toString())) {
|
||||
return false;
|
||||
}
|
||||
@@ -73,7 +73,7 @@ public class TriggerCounterAdded extends Trigger {
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public final Trigger getCopy() {
|
||||
final Trigger copy = new TriggerCounterAdded(this.getMapParams(), this.getHostCard(), this.isIntrinsic());
|
||||
final Trigger copy = new TriggerCounterAdded(this.mapParams, this.getHostCard(), this.isIntrinsic());
|
||||
if (this.getOverridingAbility() != null) {
|
||||
copy.setOverridingAbility(this.getOverridingAbility());
|
||||
}
|
||||
|
||||
@@ -53,15 +53,15 @@ public class TriggerCounterRemoved extends Trigger {
|
||||
final Card addedTo = (Card) runParams2.get("Card");
|
||||
final CounterType addedType = (CounterType) runParams2.get("CounterType");
|
||||
|
||||
if (this.getMapParams().containsKey("ValidCard")) {
|
||||
if (!addedTo.isValid(this.getMapParams().get("ValidCard").split(","), this.getHostCard().getController(),
|
||||
if (this.mapParams.containsKey("ValidCard")) {
|
||||
if (!addedTo.isValid(this.mapParams.get("ValidCard").split(","), this.getHostCard().getController(),
|
||||
this.getHostCard())) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (this.getMapParams().containsKey("CounterType")) {
|
||||
final String type = this.getMapParams().get("CounterType");
|
||||
if (this.mapParams.containsKey("CounterType")) {
|
||||
final String type = this.mapParams.get("CounterType");
|
||||
if (!type.equals(addedType.toString())) {
|
||||
return false;
|
||||
}
|
||||
@@ -73,7 +73,7 @@ public class TriggerCounterRemoved extends Trigger {
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public final Trigger getCopy() {
|
||||
final Trigger copy = new TriggerCounterRemoved(this.getMapParams(), this.getHostCard(), this.isIntrinsic());
|
||||
final Trigger copy = new TriggerCounterRemoved(this.mapParams, this.getHostCard(), this.isIntrinsic());
|
||||
if (this.getOverridingAbility() != null) {
|
||||
copy.setOverridingAbility(this.getOverridingAbility());
|
||||
}
|
||||
|
||||
@@ -49,25 +49,25 @@ public class TriggerCountered extends Trigger {
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public final boolean performTest(final java.util.Map<String, Object> runParams2) {
|
||||
if (this.getMapParams().containsKey("ValidCard")) {
|
||||
if (!matchesValid(runParams2.get("Card"), this.getMapParams().get("ValidCard").split(","),
|
||||
if (this.mapParams.containsKey("ValidCard")) {
|
||||
if (!matchesValid(runParams2.get("Card"), this.mapParams.get("ValidCard").split(","),
|
||||
this.getHostCard())) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (this.getMapParams().containsKey("ValidPlayer")) {
|
||||
if (!matchesValid(runParams2.get("Player"), this.getMapParams().get("ValidPlayer").split(","),
|
||||
if (this.mapParams.containsKey("ValidPlayer")) {
|
||||
if (!matchesValid(runParams2.get("Player"), this.mapParams.get("ValidPlayer").split(","),
|
||||
this.getHostCard())) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (this.getMapParams().containsKey("ValidCause")) {
|
||||
if (this.mapParams.containsKey("ValidCause")) {
|
||||
if (runParams2.get("Cause") == null) {
|
||||
return false;
|
||||
}
|
||||
if (!matchesValid(runParams2.get("Cause"), this.getMapParams().get("ValidCause").split(","),
|
||||
if (!matchesValid(runParams2.get("Cause"), this.mapParams.get("ValidCause").split(","),
|
||||
this.getHostCard())) {
|
||||
return false;
|
||||
}
|
||||
@@ -78,7 +78,7 @@ public class TriggerCountered extends Trigger {
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public final Trigger getCopy() {
|
||||
final Trigger copy = new TriggerCountered(this.getMapParams(), this.getHostCard(), this.isIntrinsic());
|
||||
final Trigger copy = new TriggerCountered(this.mapParams, this.getHostCard(), this.isIntrinsic());
|
||||
if (this.getOverridingAbility() != null) {
|
||||
copy.setOverridingAbility(this.getOverridingAbility());
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ public class TriggerCycled extends Trigger {
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public final Trigger getCopy() {
|
||||
final Trigger copy = new TriggerCycled(this.getMapParams(), this.getHostCard(), this.isIntrinsic());
|
||||
final Trigger copy = new TriggerCycled(this.mapParams, this.getHostCard(), this.isIntrinsic());
|
||||
if (this.getOverridingAbility() != null) {
|
||||
copy.setOverridingAbility(this.getOverridingAbility());
|
||||
}
|
||||
@@ -67,8 +67,8 @@ public class TriggerCycled extends Trigger {
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public final boolean performTest(final java.util.Map<String, Object> runParams2) {
|
||||
if (this.getMapParams().containsKey("ValidCard")) {
|
||||
if (!matchesValid(runParams2.get("Card"), this.getMapParams().get("ValidCard").split(","),
|
||||
if (this.mapParams.containsKey("ValidCard")) {
|
||||
if (!matchesValid(runParams2.get("Card"), this.mapParams.get("ValidCard").split(","),
|
||||
this.getHostCard())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -53,33 +53,33 @@ public class TriggerDamageDone extends Trigger {
|
||||
final Card src = (Card) runParams2.get("DamageSource");
|
||||
final Object tgt = runParams2.get("DamageTarget");
|
||||
|
||||
if (this.getMapParams().containsKey("ValidSource")) {
|
||||
if (!src.isValid(this.getMapParams().get("ValidSource").split(","), this.getHostCard().getController(),
|
||||
if (this.mapParams.containsKey("ValidSource")) {
|
||||
if (!src.isValid(this.mapParams.get("ValidSource").split(","), this.getHostCard().getController(),
|
||||
this.getHostCard())) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (this.getMapParams().containsKey("ValidTarget")) {
|
||||
if (!matchesValid(tgt, this.getMapParams().get("ValidTarget").split(","), this.getHostCard())) {
|
||||
if (this.mapParams.containsKey("ValidTarget")) {
|
||||
if (!matchesValid(tgt, this.mapParams.get("ValidTarget").split(","), this.getHostCard())) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (this.getMapParams().containsKey("CombatDamage")) {
|
||||
if (this.getMapParams().get("CombatDamage").equals("True")) {
|
||||
if (this.mapParams.containsKey("CombatDamage")) {
|
||||
if (this.mapParams.get("CombatDamage").equals("True")) {
|
||||
if (!((Boolean) runParams2.get("IsCombatDamage"))) {
|
||||
return false;
|
||||
}
|
||||
} else if (this.getMapParams().get("CombatDamage").equals("False")) {
|
||||
} else if (this.mapParams.get("CombatDamage").equals("False")) {
|
||||
if (((Boolean) runParams2.get("IsCombatDamage"))) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (this.getMapParams().containsKey("DamageAmount")) {
|
||||
final String fullParam = this.getMapParams().get("DamageAmount");
|
||||
if (this.mapParams.containsKey("DamageAmount")) {
|
||||
final String fullParam = this.mapParams.get("DamageAmount");
|
||||
|
||||
final String operator = fullParam.substring(0, 2);
|
||||
final int operand = Integer.parseInt(fullParam.substring(2));
|
||||
@@ -101,7 +101,7 @@ public class TriggerDamageDone extends Trigger {
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public final Trigger getCopy() {
|
||||
final Trigger copy = new TriggerDamageDone(this.getMapParams(), this.getHostCard(), this.isIntrinsic());
|
||||
final Trigger copy = new TriggerDamageDone(this.mapParams, this.getHostCard(), this.isIntrinsic());
|
||||
if (this.getOverridingAbility() != null) {
|
||||
copy.setOverridingAbility(this.getOverridingAbility());
|
||||
}
|
||||
|
||||
@@ -49,14 +49,14 @@ public class TriggerDestroyed extends Trigger {
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public final boolean performTest(final java.util.Map<String, Object> runParams2) {
|
||||
if (this.getMapParams().containsKey("ValidCauser")) {
|
||||
if (!matchesValid(runParams2.get("Causer"), this.getMapParams().get("ValidCauser").split(","),
|
||||
if (this.mapParams.containsKey("ValidCauser")) {
|
||||
if (!matchesValid(runParams2.get("Causer"), this.mapParams.get("ValidCauser").split(","),
|
||||
this.getHostCard())) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (this.getMapParams().containsKey("ValidCard")) {
|
||||
if (!matchesValid(runParams2.get("Card"), this.getMapParams().get("ValidCard").split(","),
|
||||
if (this.mapParams.containsKey("ValidCard")) {
|
||||
if (!matchesValid(runParams2.get("Card"), this.mapParams.get("ValidCard").split(","),
|
||||
this.getHostCard())) {
|
||||
return false;
|
||||
}
|
||||
@@ -67,7 +67,7 @@ public class TriggerDestroyed extends Trigger {
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public final Trigger getCopy() {
|
||||
final Trigger copy = new TriggerDestroyed(this.getMapParams(), this.getHostCard(), this.isIntrinsic());
|
||||
final Trigger copy = new TriggerDestroyed(this.mapParams, this.getHostCard(), this.isIntrinsic());
|
||||
if (this.getOverridingAbility() != null) {
|
||||
copy.setOverridingAbility(this.getOverridingAbility());
|
||||
}
|
||||
|
||||
@@ -50,8 +50,8 @@ public class TriggerDevoured extends Trigger {
|
||||
@Override
|
||||
public final boolean performTest(final java.util.Map<String, Object> runParams2) {
|
||||
final Card sac = (Card) runParams2.get("Devoured");
|
||||
if (this.getMapParams().containsKey("ValidDevoured")) {
|
||||
if (!sac.isValid(this.getMapParams().get("ValidDevoured").split(","), this.getHostCard().getController(),
|
||||
if (this.mapParams.containsKey("ValidDevoured")) {
|
||||
if (!sac.isValid(this.mapParams.get("ValidDevoured").split(","), this.getHostCard().getController(),
|
||||
this.getHostCard())) {
|
||||
return false;
|
||||
}
|
||||
@@ -62,7 +62,7 @@ public class TriggerDevoured extends Trigger {
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public final Trigger getCopy() {
|
||||
final Trigger copy = new TriggerDevoured(this.getMapParams(), this.getHostCard(), this.isIntrinsic());
|
||||
final Trigger copy = new TriggerDevoured(this.mapParams, this.getHostCard(), this.isIntrinsic());
|
||||
if (this.getOverridingAbility() != null) {
|
||||
copy.setOverridingAbility(this.getOverridingAbility());
|
||||
}
|
||||
|
||||
@@ -49,25 +49,25 @@ public class TriggerDiscarded extends Trigger {
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public final boolean performTest(final java.util.Map<String, Object> runParams2) {
|
||||
if (this.getMapParams().containsKey("ValidCard")) {
|
||||
if (!matchesValid(runParams2.get("Card"), this.getMapParams().get("ValidCard").split(","),
|
||||
if (this.mapParams.containsKey("ValidCard")) {
|
||||
if (!matchesValid(runParams2.get("Card"), this.mapParams.get("ValidCard").split(","),
|
||||
this.getHostCard())) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (this.getMapParams().containsKey("ValidPlayer")) {
|
||||
if (!matchesValid(runParams2.get("Player"), this.getMapParams().get("ValidPlayer").split(","),
|
||||
if (this.mapParams.containsKey("ValidPlayer")) {
|
||||
if (!matchesValid(runParams2.get("Player"), this.mapParams.get("ValidPlayer").split(","),
|
||||
this.getHostCard())) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (this.getMapParams().containsKey("ValidCause")) {
|
||||
if (this.mapParams.containsKey("ValidCause")) {
|
||||
if (runParams2.get("Cause") == null) {
|
||||
return false;
|
||||
}
|
||||
if (!matchesValid(runParams2.get("Cause"), this.getMapParams().get("ValidCause").split(","),
|
||||
if (!matchesValid(runParams2.get("Cause"), this.mapParams.get("ValidCause").split(","),
|
||||
this.getHostCard())) {
|
||||
return false;
|
||||
}
|
||||
@@ -78,7 +78,7 @@ public class TriggerDiscarded extends Trigger {
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public final Trigger getCopy() {
|
||||
final Trigger copy = new TriggerDiscarded(this.getMapParams(), this.getHostCard(), this.isIntrinsic());
|
||||
final Trigger copy = new TriggerDiscarded(this.mapParams, this.getHostCard(), this.isIntrinsic());
|
||||
if (this.getOverridingAbility() != null) {
|
||||
copy.setOverridingAbility(this.getOverridingAbility());
|
||||
}
|
||||
|
||||
@@ -52,15 +52,15 @@ public class TriggerDrawn extends Trigger {
|
||||
final Card draw = ((Card) runParams2.get("Card"));
|
||||
final int number = ((Integer) runParams2.get("Number"));
|
||||
|
||||
if (this.getMapParams().containsKey("ValidCard")) {
|
||||
if (!draw.isValid(this.getMapParams().get("ValidCard").split(","), this.getHostCard().getController(),
|
||||
if (this.mapParams.containsKey("ValidCard")) {
|
||||
if (!draw.isValid(this.mapParams.get("ValidCard").split(","), this.getHostCard().getController(),
|
||||
this.getHostCard())) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (this.getMapParams().containsKey("Number")) {
|
||||
if (number != Integer.parseInt(this.getMapParams().get("Number"))) {
|
||||
if (this.mapParams.containsKey("Number")) {
|
||||
if (number != Integer.parseInt(this.mapParams.get("Number"))) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -70,7 +70,7 @@ public class TriggerDrawn extends Trigger {
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public final Trigger getCopy() {
|
||||
final Trigger copy = new TriggerDrawn(this.getMapParams(), this.getHostCard(), this.isIntrinsic());
|
||||
final Trigger copy = new TriggerDrawn(this.mapParams, this.getHostCard(), this.isIntrinsic());
|
||||
if (this.getOverridingAbility() != null) {
|
||||
copy.setOverridingAbility(this.getOverridingAbility());
|
||||
}
|
||||
|
||||
@@ -50,8 +50,8 @@ public class TriggerEvolved extends Trigger {
|
||||
@Override
|
||||
public final boolean performTest(final java.util.Map<String, Object> runParams2) {
|
||||
final Card sac = (Card) runParams2.get("Card");
|
||||
if (this.getMapParams().containsKey("ValidCard")) {
|
||||
if (!sac.isValid(this.getMapParams().get("ValidCard").split(","), this.getHostCard().getController(),
|
||||
if (this.mapParams.containsKey("ValidCard")) {
|
||||
if (!sac.isValid(this.mapParams.get("ValidCard").split(","), this.getHostCard().getController(),
|
||||
this.getHostCard())) {
|
||||
return false;
|
||||
}
|
||||
@@ -62,7 +62,7 @@ public class TriggerEvolved extends Trigger {
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public final Trigger getCopy() {
|
||||
final Trigger copy = new TriggerEvolved(this.getMapParams(), this.getHostCard(), this.isIntrinsic());
|
||||
final Trigger copy = new TriggerEvolved(this.mapParams, this.getHostCard(), this.isIntrinsic());
|
||||
if (this.getOverridingAbility() != null) {
|
||||
copy.setOverridingAbility(this.getOverridingAbility());
|
||||
}
|
||||
|
||||
@@ -49,15 +49,15 @@ public class TriggerFlipped extends Trigger {
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public final boolean performTest(final java.util.Map<String, Object> runParams2) {
|
||||
if (this.getMapParams().containsKey("ValidPlayer")) {
|
||||
if (!matchesValid(runParams2.get("Player"), this.getMapParams().get("ValidPlayer").split(","),
|
||||
if (this.mapParams.containsKey("ValidPlayer")) {
|
||||
if (!matchesValid(runParams2.get("Player"), this.mapParams.get("ValidPlayer").split(","),
|
||||
this.getHostCard())) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (this.getMapParams().containsKey("ValidResult")) {
|
||||
if (this.mapParams.containsKey("ValidResult")) {
|
||||
final boolean result = (Boolean) runParams2.get("Result");
|
||||
final boolean valid = "Win".equals(this.getMapParams().get("ValidResult"));
|
||||
final boolean valid = "Win".equals(this.mapParams.get("ValidResult"));
|
||||
if (result ^ valid) {
|
||||
return false;
|
||||
}
|
||||
@@ -69,7 +69,7 @@ public class TriggerFlipped extends Trigger {
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public final Trigger getCopy() {
|
||||
final Trigger copy = new TriggerFlipped(this.getMapParams(), this.getHostCard(), this.isIntrinsic());
|
||||
final Trigger copy = new TriggerFlipped(this.mapParams, this.getHostCard(), this.isIntrinsic());
|
||||
if (this.getOverridingAbility() != null) {
|
||||
copy.setOverridingAbility(this.getOverridingAbility());
|
||||
}
|
||||
|
||||
@@ -299,7 +299,7 @@ public class TriggerHandler {
|
||||
// runs it if so.
|
||||
// Return true if the trigger went off, false otherwise.
|
||||
private boolean runSingleTrigger(final Trigger regtrig, final TriggerType mode, final Map<String, Object> runParams) {
|
||||
final Map<String, String> triggerParams = regtrig.getMapParams();
|
||||
final Map<String, String> triggerParams = regtrig.mapParams;
|
||||
|
||||
if (regtrig.getMode() != mode) {
|
||||
return false; // Not the right mode.
|
||||
|
||||
@@ -70,7 +70,7 @@ public class TriggerLandPlayed extends Trigger {
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public final Trigger getCopy() {
|
||||
final Trigger copy = new TriggerLandPlayed(this.getName(), this.getMapParams(), this.getHostCard(),
|
||||
final Trigger copy = new TriggerLandPlayed(this.getName(), this.mapParams, this.getHostCard(),
|
||||
this.isIntrinsic());
|
||||
|
||||
if (this.getOverridingAbility() != null) {
|
||||
@@ -90,8 +90,8 @@ public class TriggerLandPlayed extends Trigger {
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public final boolean performTest(final java.util.Map<String, Object> runParams2) {
|
||||
if (this.getMapParams().containsKey("ValidCard")) {
|
||||
if (!matchesValid(runParams2.get("Card"), this.getMapParams().get("ValidCard").split(","),
|
||||
if (this.mapParams.containsKey("ValidCard")) {
|
||||
if (!matchesValid(runParams2.get("Card"), this.mapParams.get("ValidCard").split(","),
|
||||
this.getHostCard())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -49,8 +49,8 @@ public class TriggerLifeGained extends Trigger {
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public final boolean performTest(final java.util.Map<String, Object> runParams2) {
|
||||
if (this.getMapParams().containsKey("ValidPlayer")) {
|
||||
if (!matchesValid(runParams2.get("Player"), this.getMapParams().get("ValidPlayer").split(","),
|
||||
if (this.mapParams.containsKey("ValidPlayer")) {
|
||||
if (!matchesValid(runParams2.get("Player"), this.mapParams.get("ValidPlayer").split(","),
|
||||
this.getHostCard())) {
|
||||
return false;
|
||||
}
|
||||
@@ -62,7 +62,7 @@ public class TriggerLifeGained extends Trigger {
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public final Trigger getCopy() {
|
||||
final Trigger copy = new TriggerLifeGained(this.getMapParams(), this.getHostCard(), this.isIntrinsic());
|
||||
final Trigger copy = new TriggerLifeGained(this.mapParams, this.getHostCard(), this.isIntrinsic());
|
||||
if (this.getOverridingAbility() != null) {
|
||||
copy.setOverridingAbility(this.getOverridingAbility());
|
||||
}
|
||||
|
||||
@@ -49,8 +49,8 @@ public class TriggerLifeLost extends Trigger {
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public final boolean performTest(final java.util.Map<String, Object> runParams2) {
|
||||
if (this.getMapParams().containsKey("ValidPlayer")) {
|
||||
if (!matchesValid(runParams2.get("Player"), this.getMapParams().get("ValidPlayer").split(","),
|
||||
if (this.mapParams.containsKey("ValidPlayer")) {
|
||||
if (!matchesValid(runParams2.get("Player"), this.mapParams.get("ValidPlayer").split(","),
|
||||
this.getHostCard())) {
|
||||
return false;
|
||||
}
|
||||
@@ -62,7 +62,7 @@ public class TriggerLifeLost extends Trigger {
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public final Trigger getCopy() {
|
||||
final Trigger copy = new TriggerLifeLost(this.getMapParams(), this.getHostCard(), this.isIntrinsic());
|
||||
final Trigger copy = new TriggerLifeLost(this.mapParams, this.getHostCard(), this.isIntrinsic());
|
||||
if (this.getOverridingAbility() != null) {
|
||||
copy.setOverridingAbility(this.getOverridingAbility());
|
||||
}
|
||||
|
||||
@@ -27,8 +27,8 @@ public class TriggerLosesGame extends Trigger {
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public final boolean performTest(final java.util.Map<String, Object> runParams2) {
|
||||
if (this.getMapParams().containsKey("ValidPlayer")) {
|
||||
if (!matchesValid(runParams2.get("Player"), this.getMapParams().get("ValidPlayer").split(","),
|
||||
if (this.mapParams.containsKey("ValidPlayer")) {
|
||||
if (!matchesValid(runParams2.get("Player"), this.mapParams.get("ValidPlayer").split(","),
|
||||
this.getHostCard())) {
|
||||
return false;
|
||||
}
|
||||
@@ -40,7 +40,7 @@ public class TriggerLosesGame extends Trigger {
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public final Trigger getCopy() {
|
||||
final Trigger copy = new TriggerLosesGame(this.getMapParams(), this.getHostCard(), this.isIntrinsic());
|
||||
final Trigger copy = new TriggerLosesGame(this.mapParams, this.getHostCard(), this.isIntrinsic());
|
||||
if (this.getOverridingAbility() != null) {
|
||||
copy.setOverridingAbility(this.getOverridingAbility());
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ public class TriggerNewGame extends Trigger {
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public final Trigger getCopy() {
|
||||
final Trigger copy = new TriggerNewGame(this.getMapParams(), this.getHostCard(), this.isIntrinsic());
|
||||
final Trigger copy = new TriggerNewGame(this.mapParams, this.getHostCard(), this.isIntrinsic());
|
||||
if (this.getOverridingAbility() != null) {
|
||||
copy.setOverridingAbility(this.getOverridingAbility());
|
||||
}
|
||||
|
||||
@@ -49,8 +49,8 @@ public class TriggerPhase extends Trigger {
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public final boolean performTest(final java.util.Map<String, Object> runParams2) {
|
||||
if (this.getMapParams().containsKey("ValidPlayer")) {
|
||||
if (!matchesValid(runParams2.get("Player"), this.getMapParams().get("ValidPlayer").split(","),
|
||||
if (this.mapParams.containsKey("ValidPlayer")) {
|
||||
if (!matchesValid(runParams2.get("Player"), this.mapParams.get("ValidPlayer").split(","),
|
||||
this.getHostCard())) {
|
||||
return false;
|
||||
}
|
||||
@@ -61,7 +61,7 @@ public class TriggerPhase extends Trigger {
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public final Trigger getCopy() {
|
||||
final Trigger copy = new TriggerPhase(this.getMapParams(), this.getHostCard(), this.isIntrinsic());
|
||||
final Trigger copy = new TriggerPhase(this.mapParams, this.getHostCard(), this.isIntrinsic());
|
||||
if (this.getOverridingAbility() != null) {
|
||||
copy.setOverridingAbility(this.getOverridingAbility());
|
||||
}
|
||||
|
||||
@@ -33,15 +33,15 @@ public class TriggerPlanarDice extends Trigger {
|
||||
*/
|
||||
@Override
|
||||
public boolean performTest(Map<String, Object> runParams2) {
|
||||
if (this.getMapParams().containsKey("ValidPlayer")) {
|
||||
if (!matchesValid(runParams2.get("Player"), this.getMapParams().get("ValidPlayer").split(","),
|
||||
if (this.mapParams.containsKey("ValidPlayer")) {
|
||||
if (!matchesValid(runParams2.get("Player"), this.mapParams.get("ValidPlayer").split(","),
|
||||
this.getHostCard())) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (this.getMapParams().containsKey("Result")) {
|
||||
PlanarDice cond = PlanarDice.smartValueOf(this.getMapParams().get("Result"));
|
||||
if (this.mapParams.containsKey("Result")) {
|
||||
PlanarDice cond = PlanarDice.smartValueOf(this.mapParams.get("Result"));
|
||||
if (cond != ((PlanarDice) runParams2.get("Result"))) {
|
||||
return false;
|
||||
}
|
||||
@@ -55,7 +55,7 @@ public class TriggerPlanarDice extends Trigger {
|
||||
*/
|
||||
@Override
|
||||
public Trigger getCopy() {
|
||||
final Trigger copy = new TriggerPlanarDice(this.getMapParams(), this.getHostCard(), this.isIntrinsic());
|
||||
final Trigger copy = new TriggerPlanarDice(this.mapParams, this.getHostCard(), this.isIntrinsic());
|
||||
if (this.getOverridingAbility() != null) {
|
||||
copy.setOverridingAbility(this.getOverridingAbility());
|
||||
}
|
||||
|
||||
@@ -32,9 +32,9 @@ public class TriggerPlaneswalkedFrom extends Trigger {
|
||||
*/
|
||||
@Override
|
||||
public boolean performTest(Map<String, Object> runParams2) {
|
||||
if (this.getMapParams().containsKey("ValidCard")) {
|
||||
if (this.mapParams.containsKey("ValidCard")) {
|
||||
final Card moved = (Card) runParams2.get("Card");
|
||||
if (!moved.isValid(this.getMapParams().get("ValidCard").split(","), this.getHostCard().getController(),
|
||||
if (!moved.isValid(this.mapParams.get("ValidCard").split(","), this.getHostCard().getController(),
|
||||
this.getHostCard())) {
|
||||
return false;
|
||||
}
|
||||
@@ -48,7 +48,7 @@ public class TriggerPlaneswalkedFrom extends Trigger {
|
||||
*/
|
||||
@Override
|
||||
public Trigger getCopy() {
|
||||
final Trigger copy = new TriggerPlaneswalkedFrom(this.getMapParams(), this.getHostCard(), this.isIntrinsic());
|
||||
final Trigger copy = new TriggerPlaneswalkedFrom(this.mapParams, this.getHostCard(), this.isIntrinsic());
|
||||
if (this.getOverridingAbility() != null) {
|
||||
copy.setOverridingAbility(this.getOverridingAbility());
|
||||
}
|
||||
|
||||
@@ -32,9 +32,9 @@ public class TriggerPlaneswalkedTo extends Trigger {
|
||||
*/
|
||||
@Override
|
||||
public boolean performTest(Map<String, Object> runParams2) {
|
||||
if (this.getMapParams().containsKey("ValidCard")) {
|
||||
if (this.mapParams.containsKey("ValidCard")) {
|
||||
final Card moved = (Card) runParams2.get("Card");
|
||||
if (!moved.isValid(this.getMapParams().get("ValidCard").split(","), this.getHostCard().getController(),
|
||||
if (!moved.isValid(this.mapParams.get("ValidCard").split(","), this.getHostCard().getController(),
|
||||
this.getHostCard())) {
|
||||
return false;
|
||||
}
|
||||
@@ -48,7 +48,7 @@ public class TriggerPlaneswalkedTo extends Trigger {
|
||||
*/
|
||||
@Override
|
||||
public Trigger getCopy() {
|
||||
final Trigger copy = new TriggerPlaneswalkedTo(this.getMapParams(), this.getHostCard(), this.isIntrinsic());
|
||||
final Trigger copy = new TriggerPlaneswalkedTo(this.mapParams, this.getHostCard(), this.isIntrinsic());
|
||||
if (this.getOverridingAbility() != null) {
|
||||
copy.setOverridingAbility(this.getOverridingAbility());
|
||||
}
|
||||
|
||||
@@ -50,14 +50,14 @@ public class TriggerSacrificed extends Trigger {
|
||||
@Override
|
||||
public final boolean performTest(final java.util.Map<String, Object> runParams2) {
|
||||
final Card sac = (Card) runParams2.get("Card");
|
||||
if (this.getMapParams().containsKey("ValidPlayer")) {
|
||||
if (!matchesValid(sac.getController(), this.getMapParams().get("ValidPlayer").split(","),
|
||||
if (this.mapParams.containsKey("ValidPlayer")) {
|
||||
if (!matchesValid(sac.getController(), this.mapParams.get("ValidPlayer").split(","),
|
||||
this.getHostCard())) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (this.getMapParams().containsKey("ValidCard")) {
|
||||
if (!sac.isValid(this.getMapParams().get("ValidCard").split(","), this.getHostCard().getController(),
|
||||
if (this.mapParams.containsKey("ValidCard")) {
|
||||
if (!sac.isValid(this.mapParams.get("ValidCard").split(","), this.getHostCard().getController(),
|
||||
this.getHostCard())) {
|
||||
return false;
|
||||
}
|
||||
@@ -68,7 +68,7 @@ public class TriggerSacrificed extends Trigger {
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public final Trigger getCopy() {
|
||||
final Trigger copy = new TriggerSacrificed(this.getMapParams(), this.getHostCard(), this.isIntrinsic());
|
||||
final Trigger copy = new TriggerSacrificed(this.mapParams, this.getHostCard(), this.isIntrinsic());
|
||||
if (this.getOverridingAbility() != null) {
|
||||
copy.setOverridingAbility(this.getOverridingAbility());
|
||||
}
|
||||
|
||||
@@ -49,8 +49,8 @@ public class TriggerSetInMotion extends Trigger {
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public final boolean performTest(final java.util.Map<String, Object> runParams2) {
|
||||
if (this.getMapParams().containsKey("ValidCard")) {
|
||||
if (!matchesValid(runParams2.get("Scheme"), this.getMapParams().get("ValidCard").split(","),
|
||||
if (this.mapParams.containsKey("ValidCard")) {
|
||||
if (!matchesValid(runParams2.get("Scheme"), this.mapParams.get("ValidCard").split(","),
|
||||
this.getHostCard())) {
|
||||
return false;
|
||||
}
|
||||
@@ -62,7 +62,7 @@ public class TriggerSetInMotion extends Trigger {
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public final Trigger getCopy() {
|
||||
final Trigger copy = new TriggerSetInMotion(this.getMapParams(), this.getHostCard(), this.isIntrinsic());
|
||||
final Trigger copy = new TriggerSetInMotion(this.mapParams, this.getHostCard(), this.isIntrinsic());
|
||||
if (this.getOverridingAbility() != null) {
|
||||
copy.setOverridingAbility(this.getOverridingAbility());
|
||||
}
|
||||
|
||||
@@ -49,8 +49,8 @@ public class TriggerShuffled extends Trigger {
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public final boolean performTest(final java.util.Map<String, Object> runParams2) {
|
||||
if (this.getMapParams().containsKey("ValidPlayer")) {
|
||||
if (!matchesValid(runParams2.get("Player"), this.getMapParams().get("ValidPlayer").split(","),
|
||||
if (this.mapParams.containsKey("ValidPlayer")) {
|
||||
if (!matchesValid(runParams2.get("Player"), this.mapParams.get("ValidPlayer").split(","),
|
||||
this.getHostCard())) {
|
||||
return false;
|
||||
}
|
||||
@@ -62,7 +62,7 @@ public class TriggerShuffled extends Trigger {
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public final Trigger getCopy() {
|
||||
final Trigger copy = new TriggerShuffled(this.getMapParams(), this.getHostCard(), this.isIntrinsic());
|
||||
final Trigger copy = new TriggerShuffled(this.mapParams, this.getHostCard(), this.isIntrinsic());
|
||||
if (this.getOverridingAbility() != null) {
|
||||
copy.setOverridingAbility(this.getOverridingAbility());
|
||||
}
|
||||
|
||||
@@ -71,39 +71,39 @@ public class TriggerSpellAbilityCast extends Trigger {
|
||||
// Empty block for readability.
|
||||
}
|
||||
|
||||
if (this.getMapParams().containsKey("ActivatedOnly")) {
|
||||
if (this.mapParams.containsKey("ActivatedOnly")) {
|
||||
if (spellAbility.isTrigger()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (this.getMapParams().containsKey("AltCostSpellAbility")) {
|
||||
if (this.mapParams.containsKey("AltCostSpellAbility")) {
|
||||
if (!spellAbility.isOptionalCostPaid(OptionalCost.AltCost)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (this.getMapParams().containsKey("ValidControllingPlayer")) {
|
||||
if (!matchesValid(cast.getController(), this.getMapParams().get("ValidControllingPlayer").split(","),
|
||||
if (this.mapParams.containsKey("ValidControllingPlayer")) {
|
||||
if (!matchesValid(cast.getController(), this.mapParams.get("ValidControllingPlayer").split(","),
|
||||
this.getHostCard())) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (this.getMapParams().containsKey("ValidActivatingPlayer")) {
|
||||
if (si == null || !matchesValid(si.getActivatingPlayer(), this.getMapParams().get("ValidActivatingPlayer")
|
||||
if (this.mapParams.containsKey("ValidActivatingPlayer")) {
|
||||
if (si == null || !matchesValid(si.getActivatingPlayer(), this.mapParams.get("ValidActivatingPlayer")
|
||||
.split(","), this.getHostCard())) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (this.getMapParams().containsKey("ValidCard")) {
|
||||
if (!matchesValid(cast, this.getMapParams().get("ValidCard").split(","), this.getHostCard())) {
|
||||
if (this.mapParams.containsKey("ValidCard")) {
|
||||
if (!matchesValid(cast, this.mapParams.get("ValidCard").split(","), this.getHostCard())) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (this.getMapParams().containsKey("TargetsValid")) {
|
||||
if (this.mapParams.containsKey("TargetsValid")) {
|
||||
SpellAbility sa = spellAbility;
|
||||
if (si != null) {
|
||||
sa = si.getSpellAbility();
|
||||
@@ -114,12 +114,12 @@ public class TriggerSpellAbilityCast extends Trigger {
|
||||
return false;
|
||||
} else {
|
||||
if (!matchesValid(sa.getTargetPlayer(),
|
||||
this.getMapParams().get("TargetsValid").split(","), this.getHostCard())) {
|
||||
this.mapParams.get("TargetsValid").split(","), this.getHostCard())) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (!matchesValid(sa.getTargetCard(), this.getMapParams().get("TargetsValid").split(","),
|
||||
if (!matchesValid(sa.getTargetCard(), this.mapParams.get("TargetsValid").split(","),
|
||||
this.getHostCard())) {
|
||||
return false;
|
||||
}
|
||||
@@ -128,7 +128,7 @@ public class TriggerSpellAbilityCast extends Trigger {
|
||||
if (sa.getTarget().doesTarget()) {
|
||||
boolean validTgtFound = false;
|
||||
for (final Card tgt : sa.getTarget().getTargetCards()) {
|
||||
if (tgt.isValid(this.getMapParams().get("TargetsValid").split(","), this.getHostCard()
|
||||
if (tgt.isValid(this.mapParams.get("TargetsValid").split(","), this.getHostCard()
|
||||
.getController(), this.getHostCard())) {
|
||||
validTgtFound = true;
|
||||
break;
|
||||
@@ -136,7 +136,7 @@ public class TriggerSpellAbilityCast extends Trigger {
|
||||
}
|
||||
|
||||
for (final Player p : sa.getTarget().getTargetPlayers()) {
|
||||
if (matchesValid(p, this.getMapParams().get("TargetsValid").split(","), this.getHostCard())) {
|
||||
if (matchesValid(p, this.mapParams.get("TargetsValid").split(","), this.getHostCard())) {
|
||||
validTgtFound = true;
|
||||
break;
|
||||
}
|
||||
@@ -151,21 +151,21 @@ public class TriggerSpellAbilityCast extends Trigger {
|
||||
}
|
||||
}
|
||||
|
||||
if (this.getMapParams().containsKey("NonTapCost")) {
|
||||
if (this.mapParams.containsKey("NonTapCost")) {
|
||||
final Cost cost = (Cost) (runParams2.get("Cost"));
|
||||
if (cost.hasTapCost()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (this.getMapParams().containsKey("Conspire")) {
|
||||
if (this.mapParams.containsKey("Conspire")) {
|
||||
if (!spellAbility.isOptionalCostPaid(OptionalCost.Conspire)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (this.getMapParams().containsKey("SpellSpeed")) {
|
||||
if (this.getMapParams().get("SpellSpeed").equals("NotSorcerySpeed")) {
|
||||
if (this.mapParams.containsKey("SpellSpeed")) {
|
||||
if (this.mapParams.get("SpellSpeed").equals("NotSorcerySpeed")) {
|
||||
if (this.getHostCard().getController().couldCastSorcery(spellAbility)) {
|
||||
return false;
|
||||
}
|
||||
@@ -188,7 +188,7 @@ public class TriggerSpellAbilityCast extends Trigger {
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public final Trigger getCopy() {
|
||||
final Trigger copy = new TriggerSpellAbilityCast(this.getMapParams(), this.getHostCard(), this.isIntrinsic());
|
||||
final Trigger copy = new TriggerSpellAbilityCast(this.mapParams, this.getHostCard(), this.isIntrinsic());
|
||||
if (this.getOverridingAbility() != null) {
|
||||
copy.setOverridingAbility(this.getOverridingAbility());
|
||||
}
|
||||
|
||||
@@ -53,8 +53,8 @@ public class TriggerTaps extends Trigger {
|
||||
public final boolean performTest(final java.util.Map<String, Object> runParams2) {
|
||||
final Card tapper = (Card) runParams2.get("Card");
|
||||
|
||||
if (this.getMapParams().containsKey("ValidCard")) {
|
||||
if (!tapper.isValid(this.getMapParams().get("ValidCard").split(","), this.getHostCard().getController(),
|
||||
if (this.mapParams.containsKey("ValidCard")) {
|
||||
if (!tapper.isValid(this.mapParams.get("ValidCard").split(","), this.getHostCard().getController(),
|
||||
this.getHostCard())) {
|
||||
return false;
|
||||
}
|
||||
@@ -66,7 +66,7 @@ public class TriggerTaps extends Trigger {
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public final Trigger getCopy() {
|
||||
final Trigger copy = new TriggerTaps(this.getMapParams(), this.getHostCard(), this.isIntrinsic());
|
||||
final Trigger copy = new TriggerTaps(this.mapParams, this.getHostCard(), this.isIntrinsic());
|
||||
if (this.getOverridingAbility() != null) {
|
||||
copy.setOverridingAbility(this.getOverridingAbility());
|
||||
}
|
||||
|
||||
@@ -51,8 +51,8 @@ public class TriggerTapsForMana extends Trigger {
|
||||
public final boolean performTest(final java.util.Map<String, Object> runParams2) {
|
||||
final Card tapper = (Card) runParams2.get("Card");
|
||||
|
||||
if (this.getMapParams().containsKey("ValidCard")) {
|
||||
if (!tapper.isValid(this.getMapParams().get("ValidCard").split(","), this.getHostCard().getController(),
|
||||
if (this.mapParams.containsKey("ValidCard")) {
|
||||
if (!tapper.isValid(this.mapParams.get("ValidCard").split(","), this.getHostCard().getController(),
|
||||
this.getHostCard())) {
|
||||
return false;
|
||||
}
|
||||
@@ -64,7 +64,7 @@ public class TriggerTapsForMana extends Trigger {
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public final Trigger getCopy() {
|
||||
final Trigger copy = new TriggerTapsForMana(this.getMapParams(), this.getHostCard(), this.isIntrinsic());
|
||||
final Trigger copy = new TriggerTapsForMana(this.mapParams, this.getHostCard(), this.isIntrinsic());
|
||||
if (this.getOverridingAbility() != null) {
|
||||
copy.setOverridingAbility(this.getOverridingAbility());
|
||||
}
|
||||
|
||||
@@ -44,8 +44,8 @@ public class TriggerTransformed extends Trigger {
|
||||
*/
|
||||
@Override
|
||||
public boolean performTest(Map<String, Object> runParams2) {
|
||||
if (this.getMapParams().containsKey("ValidCard")) {
|
||||
if (!matchesValid(runParams2.get("Transformer"), this.getMapParams().get("ValidCard").split(","),
|
||||
if (this.mapParams.containsKey("ValidCard")) {
|
||||
if (!matchesValid(runParams2.get("Transformer"), this.mapParams.get("ValidCard").split(","),
|
||||
this.getHostCard())) {
|
||||
return false;
|
||||
}
|
||||
@@ -59,7 +59,7 @@ public class TriggerTransformed extends Trigger {
|
||||
*/
|
||||
@Override
|
||||
public final Trigger getCopy() {
|
||||
final Trigger copy = new TriggerTransformed(this.getMapParams(), this.getHostCard(), this.isIntrinsic());
|
||||
final Trigger copy = new TriggerTransformed(this.mapParams, this.getHostCard(), this.isIntrinsic());
|
||||
|
||||
if (this.getOverridingAbility() != null) {
|
||||
copy.setOverridingAbility(this.getOverridingAbility());
|
||||
|
||||
@@ -49,8 +49,8 @@ public class TriggerTurnFaceUp extends Trigger {
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public final boolean performTest(final java.util.Map<String, Object> runParams2) {
|
||||
if (this.getMapParams().containsKey("ValidCard")) {
|
||||
if (!matchesValid(runParams2.get("Card"), this.getMapParams().get("ValidCard").split(","),
|
||||
if (this.mapParams.containsKey("ValidCard")) {
|
||||
if (!matchesValid(runParams2.get("Card"), this.mapParams.get("ValidCard").split(","),
|
||||
this.getHostCard())) {
|
||||
return false;
|
||||
}
|
||||
@@ -62,7 +62,7 @@ public class TriggerTurnFaceUp extends Trigger {
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public final Trigger getCopy() {
|
||||
final Trigger copy = new TriggerTurnFaceUp(this.getMapParams(), this.getHostCard(), this.isIntrinsic());
|
||||
final Trigger copy = new TriggerTurnFaceUp(this.mapParams, this.getHostCard(), this.isIntrinsic());
|
||||
if (this.getOverridingAbility() != null) {
|
||||
copy.setOverridingAbility(this.getOverridingAbility());
|
||||
}
|
||||
|
||||
@@ -52,15 +52,15 @@ public class TriggerUnequip extends Trigger {
|
||||
final Card equipped = (Card) runParams2.get("Card");
|
||||
final Card equipment = (Card) runParams2.get("Equipment");
|
||||
|
||||
if (this.getMapParams().containsKey("ValidCard")) {
|
||||
if (!equipped.isValid(this.getMapParams().get("ValidCard").split(","), this.getHostCard().getController(),
|
||||
if (this.mapParams.containsKey("ValidCard")) {
|
||||
if (!equipped.isValid(this.mapParams.get("ValidCard").split(","), this.getHostCard().getController(),
|
||||
this.getHostCard())) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (this.getMapParams().containsKey("ValidEquipment")) {
|
||||
if (!equipment.isValid(this.getMapParams().get("ValidEquipment").split(","), this.getHostCard()
|
||||
if (this.mapParams.containsKey("ValidEquipment")) {
|
||||
if (!equipment.isValid(this.mapParams.get("ValidEquipment").split(","), this.getHostCard()
|
||||
.getController(), this.getHostCard())) {
|
||||
return false;
|
||||
}
|
||||
@@ -72,7 +72,7 @@ public class TriggerUnequip extends Trigger {
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public final Trigger getCopy() {
|
||||
final Trigger copy = new TriggerUnequip(this.getMapParams(), this.getHostCard(), this.isIntrinsic());
|
||||
final Trigger copy = new TriggerUnequip(this.mapParams, this.getHostCard(), this.isIntrinsic());
|
||||
if (this.getOverridingAbility() != null) {
|
||||
copy.setOverridingAbility(this.getOverridingAbility());
|
||||
}
|
||||
|
||||
@@ -53,8 +53,8 @@ public class TriggerUntaps extends Trigger {
|
||||
public final boolean performTest(final java.util.Map<String, Object> runParams2) {
|
||||
final Card untapper = (Card) runParams2.get("Card");
|
||||
|
||||
if (this.getMapParams().containsKey("ValidCard")) {
|
||||
if (!untapper.isValid(this.getMapParams().get("ValidCard").split(","), this.getHostCard().getController(),
|
||||
if (this.mapParams.containsKey("ValidCard")) {
|
||||
if (!untapper.isValid(this.mapParams.get("ValidCard").split(","), this.getHostCard().getController(),
|
||||
this.getHostCard())) {
|
||||
return false;
|
||||
}
|
||||
@@ -66,7 +66,7 @@ public class TriggerUntaps extends Trigger {
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public final Trigger getCopy() {
|
||||
final Trigger copy = new TriggerUntaps(this.getMapParams(), this.getHostCard(), this.isIntrinsic());
|
||||
final Trigger copy = new TriggerUntaps(this.mapParams, this.getHostCard(), this.isIntrinsic());
|
||||
if (this.getOverridingAbility() != null) {
|
||||
copy.setOverridingAbility(this.getOverridingAbility());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user