mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 19:58:00 +00:00
find and replace this.mapParams.get to getParam
Using Intellij's structural search.
This commit is contained in:
@@ -201,7 +201,7 @@ public class StaticAbility extends CardTraitBase implements IIdentifiable, Clone
|
||||
|
||||
private void buildCommonAttributes(Card host) {
|
||||
if (hasParam("References")) {
|
||||
for (String svar : mapParams.get("References").split(",")) {
|
||||
for (String svar : getParam("References").split(",")) {
|
||||
if (host.hasSVar(svar)) {
|
||||
this.setSVar(svar, host.getSVar(svar));
|
||||
}
|
||||
|
||||
@@ -144,7 +144,7 @@ public abstract class Trigger extends TriggerReplacementBase {
|
||||
if (hasParam("TriggerDescription") && !this.isSuppressed()) {
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
String desc = this.mapParams.get("TriggerDescription");
|
||||
String desc = getParam("TriggerDescription");
|
||||
if(active)
|
||||
desc = TextUtil.fastReplace(desc, "CARDNAME", getHostCard().toString());
|
||||
else
|
||||
@@ -283,7 +283,7 @@ public abstract class Trigger extends TriggerReplacementBase {
|
||||
}
|
||||
|
||||
if (hasParam("TurnCount")) {
|
||||
int turn = Integer.parseInt(this.mapParams.get("TurnCount"));
|
||||
int turn = Integer.parseInt(getParam("TurnCount"));
|
||||
if (phaseHandler.getTurn() != turn) {
|
||||
return false;
|
||||
}
|
||||
@@ -346,7 +346,7 @@ public abstract class Trigger extends TriggerReplacementBase {
|
||||
// make this check more general if possible
|
||||
boolean bFlag = true;
|
||||
for (Object o : getTriggerRemembered()) {
|
||||
if (o instanceof Card && ((Card) o).isInZone(ZoneType.smartValueOf(this.mapParams.get("TriggerRememberedInZone")))) {
|
||||
if (o instanceof Card && ((Card) o).isInZone(ZoneType.smartValueOf(getParam("TriggerRememberedInZone")))) {
|
||||
bFlag = false;
|
||||
break;
|
||||
}
|
||||
@@ -364,7 +364,7 @@ public abstract class Trigger extends TriggerReplacementBase {
|
||||
|
||||
|
||||
public boolean meetsRequirementsOnTriggeredObjects(Game game, final Map<AbilityKey, Object> runParams) {
|
||||
if ("True".equals(this.mapParams.get("EvolveCondition"))) {
|
||||
if ("True".equals(getParam("EvolveCondition"))) {
|
||||
final Card moved = (Card) runParams.get(AbilityKey.Card);
|
||||
if (moved == null) {
|
||||
return false;
|
||||
@@ -379,7 +379,7 @@ public abstract class Trigger extends TriggerReplacementBase {
|
||||
}
|
||||
}
|
||||
|
||||
String condition = this.mapParams.get("Condition");
|
||||
String condition = getParam("Condition");
|
||||
if ("AltCost".equals(condition)) {
|
||||
final Card moved = (Card) runParams.get(AbilityKey.Card);
|
||||
if( null != moved && !moved.isOptionalCostPaid(OptionalCost.AltCost))
|
||||
|
||||
@@ -53,7 +53,7 @@ public class TriggerAbandoned extends Trigger {
|
||||
@Override
|
||||
public final boolean performTest(final Map<AbilityKey, Object> runParams) {
|
||||
if (hasParam("ValidCard")) {
|
||||
if (!matchesValid(runParams.get(AbilityKey.Scheme), this.mapParams.get("ValidCard").split(","),
|
||||
if (!matchesValid(runParams.get(AbilityKey.Scheme), getParam("ValidCard").split(","),
|
||||
this.getHostCard())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -57,14 +57,14 @@ public class TriggerAttached extends Trigger {
|
||||
final Object tgt = runParams.get(AbilityKey.AttachTarget);
|
||||
|
||||
if (hasParam("ValidSource")) {
|
||||
if (!src.isValid(this.mapParams.get("ValidSource").split(","), this.getHostCard().getController(),
|
||||
if (!src.isValid(getParam("ValidSource").split(","), this.getHostCard().getController(),
|
||||
this.getHostCard(), null)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (hasParam("ValidTarget")) {
|
||||
if (!matchesValid(tgt, this.mapParams.get("ValidTarget").split(","), this.getHostCard())) {
|
||||
if (!matchesValid(tgt, getParam("ValidTarget").split(","), this.getHostCard())) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ public class TriggerAttackerBlockedByCreature extends Trigger {
|
||||
final Card attacker = (Card) a,
|
||||
blocker = (Card) b;
|
||||
if (hasParam("ValidCard")) {
|
||||
final String validCard = this.mapParams.get("ValidCard");
|
||||
final String validCard = getParam("ValidCard");
|
||||
if (validCard.equals("LessPowerThanBlocker")) {
|
||||
if (attacker.getNetPower() >= blocker.getNetPower()) {
|
||||
return false;
|
||||
@@ -73,7 +73,7 @@ public class TriggerAttackerBlockedByCreature extends Trigger {
|
||||
}
|
||||
|
||||
if (hasParam("ValidBlocker")) {
|
||||
final String validBlocker = this.mapParams.get("ValidBlocker");
|
||||
final String validBlocker = getParam("ValidBlocker");
|
||||
if (validBlocker.equals("LessPowerThanAttacker")) {
|
||||
if (blocker.getNetPower() >= attacker.getNetPower()) {
|
||||
return false;
|
||||
|
||||
@@ -54,13 +54,13 @@ public class TriggerAttackerUnblocked extends Trigger {
|
||||
@Override
|
||||
public final boolean performTest(final Map<AbilityKey, Object> runParams) {
|
||||
if (hasParam("ValidCard")) {
|
||||
if (!matchesValid(runParams.get(AbilityKey.Attacker), this.mapParams.get("ValidCard").split(","),
|
||||
if (!matchesValid(runParams.get(AbilityKey.Attacker), getParam("ValidCard").split(","),
|
||||
this.getHostCard())) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (hasParam("ValidDefender")) {
|
||||
if (!matchesValid(runParams.get(AbilityKey.Defender), this.mapParams.get("ValidDefender").split(","),
|
||||
if (!matchesValid(runParams.get(AbilityKey.Defender), getParam("ValidDefender").split(","),
|
||||
this.getHostCard())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ public class TriggerAttackerUnblockedOnce extends Trigger {
|
||||
|
||||
final List<GameEntity> srcs = (List<GameEntity>) runParams.get(AbilityKey.Defenders);
|
||||
for (GameEntity c : srcs) {
|
||||
if (c.isValid(this.mapParams.get("ValidDefenders").split(","), this.getHostCard().getController(), this.getHostCard(), null)) {
|
||||
if (c.isValid(getParam("ValidDefenders").split(","), this.getHostCard().getController(), this.getHostCard(), null)) {
|
||||
valid = true;
|
||||
}
|
||||
}
|
||||
@@ -76,7 +76,7 @@ public class TriggerAttackerUnblockedOnce extends Trigger {
|
||||
}
|
||||
if (hasParam("ValidAttackingPlayer")) {
|
||||
if (!matchesValid(runParams.get(AbilityKey.AttackingPlayer),
|
||||
this.mapParams.get("ValidAttackingPlayer").split(","), this.getHostCard())) {
|
||||
getParam("ValidAttackingPlayer").split(","), this.getHostCard())) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ public class TriggerAttackersDeclared extends Trigger {
|
||||
public final boolean performTest(final Map<AbilityKey, Object> runParams) {
|
||||
if (hasParam("AttackingPlayer")) {
|
||||
if (!matchesValid(runParams.get(AbilityKey.AttackingPlayer),
|
||||
this.mapParams.get("AttackingPlayer").split(","), this.getHostCard())) {
|
||||
getParam("AttackingPlayer").split(","), this.getHostCard())) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -60,7 +60,7 @@ public class TriggerAttackersDeclared extends Trigger {
|
||||
boolean valid = false;
|
||||
List<GameEntity> list = (List<GameEntity>) runParams.get(AbilityKey.AttackedTarget);
|
||||
for (GameEntity b : list) {
|
||||
if (matchesValid(b, this.mapParams.get("AttackedTarget").split(","), this.getHostCard())) {
|
||||
if (matchesValid(b, getParam("AttackedTarget").split(","), this.getHostCard())) {
|
||||
valid = true;
|
||||
break;
|
||||
}
|
||||
@@ -74,7 +74,7 @@ public class TriggerAttackersDeclared extends Trigger {
|
||||
|
||||
final Iterable<Card> srcs = (Iterable<Card>) runParams.get(AbilityKey.Attackers);
|
||||
for (Card c : srcs) {
|
||||
if (c.isValid(this.mapParams.get("ValidAttackers").split(","), this.getHostCard().getController(), this.getHostCard(), null)) {
|
||||
if (c.isValid(getParam("ValidAttackers").split(","), this.getHostCard().getController(), this.getHostCard(), null)) {
|
||||
valid = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ public class TriggerAttacks extends Trigger {
|
||||
@Override
|
||||
public final boolean performTest(final Map<AbilityKey, Object> runParams) {
|
||||
if (hasParam("ValidCard")) {
|
||||
if (!matchesValid(runParams.get(AbilityKey.Attacker), this.mapParams.get("ValidCard").split(","),
|
||||
if (!matchesValid(runParams.get(AbilityKey.Attacker), getParam("ValidCard").split(","),
|
||||
this.getHostCard())) {
|
||||
return false;
|
||||
}
|
||||
@@ -65,7 +65,7 @@ public class TriggerAttacks extends Trigger {
|
||||
|
||||
if (hasParam("Attacked")) {
|
||||
GameEntity attacked = (GameEntity) runParams.get(AbilityKey.Attacked);
|
||||
if (!attacked.isValid(this.mapParams.get("Attacked").split(",")
|
||||
if (!attacked.isValid(getParam("Attacked").split(",")
|
||||
, this.getHostCard().getController(), this.getHostCard(), null)) {
|
||||
return false;
|
||||
}
|
||||
@@ -77,7 +77,7 @@ public class TriggerAttacks extends Trigger {
|
||||
if (otherAttackers == null) {
|
||||
return false;
|
||||
}
|
||||
if (this.mapParams.get("Alone").equals("True")) {
|
||||
if (getParam("Alone").equals("True")) {
|
||||
if (otherAttackers.size() != 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -18,14 +18,14 @@ public class TriggerBecomeMonarch extends Trigger {
|
||||
final Card host = this.getHostCard();
|
||||
final Game game = host.getGame();
|
||||
if (hasParam("ValidPlayer")) {
|
||||
if (!matchesValid(runParams.get(AbilityKey.Player), this.mapParams.get("ValidPlayer").split(","),
|
||||
if (!matchesValid(runParams.get(AbilityKey.Player), getParam("ValidPlayer").split(","),
|
||||
host)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (hasParam("BeginTurn")) {
|
||||
if (!matchesValid(game.getMonarchBeginTurn(), this.mapParams.get("BeginTurn").split(","),
|
||||
if (!matchesValid(game.getMonarchBeginTurn(), getParam("BeginTurn").split(","),
|
||||
host)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ public class TriggerBecomeRenowned extends Trigger {
|
||||
@Override
|
||||
public final boolean performTest(final Map<AbilityKey, Object> runParams) {
|
||||
if (hasParam("ValidCard")) {
|
||||
if (!matchesValid(runParams.get(AbilityKey.Card), this.mapParams.get("ValidCard").split(","),
|
||||
if (!matchesValid(runParams.get(AbilityKey.Card), getParam("ValidCard").split(","),
|
||||
this.getHostCard())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -56,24 +56,23 @@ public class TriggerBecomesTarget extends Trigger {
|
||||
public final boolean performTest(final Map<AbilityKey, Object> runParams) {
|
||||
if (hasParam("SourceType")) {
|
||||
final SpellAbility sa = (SpellAbility) runParams.get(AbilityKey.SourceSA);
|
||||
if (this.mapParams.get("SourceType").equalsIgnoreCase("spell")) {
|
||||
if (getParam("SourceType").equalsIgnoreCase("spell")) {
|
||||
if (!sa.isSpell()) {
|
||||
return false;
|
||||
}
|
||||
} else if (this.mapParams.get("SourceType").equalsIgnoreCase("ability")) {
|
||||
} else if (getParam("SourceType").equalsIgnoreCase("ability")) {
|
||||
if (!sa.isAbility()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (hasParam("ValidSource")) {
|
||||
if (!matchesValid(((SpellAbility) runParams.get(AbilityKey.SourceSA)).getHostCard(), this.mapParams
|
||||
.get("ValidSource").split(","), this.getHostCard())) {
|
||||
if (!matchesValid(((SpellAbility) runParams.get(AbilityKey.SourceSA)).getHostCard(), getParam("ValidSource").split(","), this.getHostCard())) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (hasParam("ValidTarget")) {
|
||||
if (!matchesValid(runParams.get(AbilityKey.Target), this.mapParams.get("ValidTarget").split(","),
|
||||
if (!matchesValid(runParams.get(AbilityKey.Target), getParam("ValidTarget").split(","),
|
||||
this.getHostCard())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -58,8 +58,7 @@ public class TriggerBecomesTargetOnce extends Trigger {
|
||||
@Override
|
||||
public final boolean performTest(final Map<AbilityKey, Object> runParams) {
|
||||
if (hasParam("ValidSource")) {
|
||||
if (!matchesValid(((SpellAbility) runParams.get(AbilityKey.SourceSA)).getHostCard(), this.mapParams
|
||||
.get("ValidSource").split(","), this.getHostCard())) {
|
||||
if (!matchesValid(((SpellAbility) runParams.get(AbilityKey.SourceSA)).getHostCard(), getParam("ValidSource").split(","), this.getHostCard())) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -67,7 +66,7 @@ public class TriggerBecomesTargetOnce extends Trigger {
|
||||
List<GameObject> targets = (List<GameObject>) runParams.get(AbilityKey.Targets);
|
||||
boolean valid = false;
|
||||
for (GameObject b : targets) {
|
||||
if (matchesValid(b, this.mapParams.get("ValidTarget").split(","), this.getHostCard())) {
|
||||
if (matchesValid(b, getParam("ValidTarget").split(","), this.getHostCard())) {
|
||||
valid = true;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -54,14 +54,14 @@ public class TriggerBlocks extends Trigger {
|
||||
@Override
|
||||
public final boolean performTest(final Map<AbilityKey, Object> runParams) {
|
||||
if (hasParam("ValidCard")) {
|
||||
String validBlocker = this.mapParams.get("ValidCard");
|
||||
String validBlocker = getParam("ValidCard");
|
||||
if (!matchesValid(runParams.get(AbilityKey.Blocker), validBlocker.split(","), this.getHostCard())) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (hasParam("ValidBlocked")) {
|
||||
final String[] validBlockedSplit = this.mapParams.get("ValidBlocked").split(",");
|
||||
final String[] validBlockedSplit = getParam("ValidBlocked").split(",");
|
||||
final Object a = runParams.get(AbilityKey.Attackers);
|
||||
if (!(a instanceof Iterable<?>)) {
|
||||
return false;
|
||||
|
||||
@@ -58,13 +58,13 @@ public class TriggerChampioned extends Trigger {
|
||||
final Card source = (Card) runParams.get(AbilityKey.Card);
|
||||
|
||||
if (hasParam("ValidCard")) {
|
||||
if (!championed.isValid(this.mapParams.get("ValidCard").split(","),
|
||||
if (!championed.isValid(getParam("ValidCard").split(","),
|
||||
this.getHostCard().getController(), this.getHostCard(), null)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (hasParam("ValidSource")) {
|
||||
if (!source.isValid(this.mapParams.get("ValidSource").split(","),
|
||||
if (!source.isValid(getParam("ValidSource").split(","),
|
||||
this.getHostCard().getController(), this.getHostCard(), null)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -56,13 +56,13 @@ public class TriggerChangesController extends Trigger {
|
||||
final Card moved = (Card) runParams.get(AbilityKey.Card);
|
||||
|
||||
if (hasParam("ValidCard")) {
|
||||
if (!moved.isValid(this.mapParams.get("ValidCard").split(","), this.getHostCard().getController(),
|
||||
if (!moved.isValid(getParam("ValidCard").split(","), this.getHostCard().getController(),
|
||||
this.getHostCard(), null)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (hasParam("ValidOriginalController")) {
|
||||
if (!matchesValid(runParams.get(AbilityKey.OriginalController), this.mapParams.get("ValidOriginalController").split(","),
|
||||
if (!matchesValid(runParams.get(AbilityKey.OriginalController), getParam("ValidOriginalController").split(","),
|
||||
this.getHostCard())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -54,14 +54,14 @@ public class TriggerClashed extends Trigger {
|
||||
@Override
|
||||
public final boolean performTest(final Map<AbilityKey, Object> runParams) {
|
||||
if (hasParam("ValidPlayer")) {
|
||||
if (!matchesValid(runParams.get(AbilityKey.Player), this.mapParams.get("ValidPlayer").split(","),
|
||||
if (!matchesValid(runParams.get(AbilityKey.Player), getParam("ValidPlayer").split(","),
|
||||
this.getHostCard())) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (hasParam("Won")) {
|
||||
if (!this.mapParams.get("Won").equals(runParams.get(AbilityKey.Won))) {
|
||||
if (!getParam("Won").equals(runParams.get(AbilityKey.Won))) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,14 +54,14 @@ public class TriggerCountered extends Trigger {
|
||||
@Override
|
||||
public final boolean performTest(final Map<AbilityKey, Object> runParams) {
|
||||
if (hasParam("ValidCard")) {
|
||||
if (!matchesValid(runParams.get(AbilityKey.Card), this.mapParams.get("ValidCard").split(","),
|
||||
if (!matchesValid(runParams.get(AbilityKey.Card), getParam("ValidCard").split(","),
|
||||
this.getHostCard())) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (hasParam("ValidPlayer")) {
|
||||
if (!matchesValid(runParams.get(AbilityKey.Player), this.mapParams.get("ValidPlayer").split(","),
|
||||
if (!matchesValid(runParams.get(AbilityKey.Player), getParam("ValidPlayer").split(","),
|
||||
this.getHostCard())) {
|
||||
return false;
|
||||
}
|
||||
@@ -71,7 +71,7 @@ public class TriggerCountered extends Trigger {
|
||||
if (runParams.get(AbilityKey.Cause) == null) {
|
||||
return false;
|
||||
}
|
||||
if (!matchesValid(runParams.get(AbilityKey.Cause), this.mapParams.get("ValidCause").split(","),
|
||||
if (!matchesValid(runParams.get(AbilityKey.Cause), getParam("ValidCause").split(","),
|
||||
this.getHostCard())) {
|
||||
return false;
|
||||
}
|
||||
@@ -80,7 +80,7 @@ public class TriggerCountered extends Trigger {
|
||||
if (hasParam("ValidType")) {
|
||||
// TODO: if necessary, expand the syntax to account for multiple valid types (e.g. Spell,Ability)
|
||||
SpellAbility ctrdSA = (SpellAbility) runParams.get(AbilityKey.CounteredSA);
|
||||
String validType = this.mapParams.get("ValidType");
|
||||
String validType = getParam("ValidType");
|
||||
if (ctrdSA != null) {
|
||||
if (validType.equals("Spell") && !ctrdSA.isSpell()) {
|
||||
return false;
|
||||
|
||||
@@ -67,7 +67,7 @@ public class TriggerCycled extends Trigger {
|
||||
@Override
|
||||
public final boolean performTest(final Map<AbilityKey, Object> runParams) {
|
||||
if (hasParam("ValidCard")) {
|
||||
return matchesValid(runParams.get(AbilityKey.Card), this.mapParams.get("ValidCard").split(","),
|
||||
return matchesValid(runParams.get(AbilityKey.Card), getParam("ValidCard").split(","),
|
||||
this.getHostCard());
|
||||
}
|
||||
return true;
|
||||
|
||||
@@ -61,11 +61,11 @@ public class TriggerDamageDealtOnce extends Trigger {
|
||||
final Set<GameEntity> tgt = (Set<GameEntity>) runParams.get(AbilityKey.DamageTargets);
|
||||
|
||||
if (hasParam("CombatDamage")) {
|
||||
if (this.mapParams.get("CombatDamage").equals("True")) {
|
||||
if (getParam("CombatDamage").equals("True")) {
|
||||
if (!((Boolean) runParams.get(AbilityKey.IsCombatDamage))) {
|
||||
return false;
|
||||
}
|
||||
} else if (this.mapParams.get("CombatDamage").equals("False")) {
|
||||
} else if (getParam("CombatDamage").equals("False")) {
|
||||
if (((Boolean) runParams.get(AbilityKey.IsCombatDamage))) {
|
||||
return false;
|
||||
}
|
||||
@@ -75,7 +75,7 @@ public class TriggerDamageDealtOnce extends Trigger {
|
||||
if (hasParam("ValidTarget")) {
|
||||
boolean valid = false;
|
||||
for (GameEntity c : tgt) {
|
||||
if (c.isValid(this.mapParams.get("ValidTarget").split(","), this.getHostCard().getController(),this.getHostCard(), null)) {
|
||||
if (c.isValid(getParam("ValidTarget").split(","), this.getHostCard().getController(),this.getHostCard(), null)) {
|
||||
valid = true;
|
||||
}
|
||||
}
|
||||
@@ -85,13 +85,13 @@ public class TriggerDamageDealtOnce extends Trigger {
|
||||
}
|
||||
|
||||
if (hasParam("ValidSource")) {
|
||||
if (!matchesValid(srcs, this.mapParams.get("ValidSource").split(","), this.getHostCard())) {
|
||||
if (!matchesValid(srcs, getParam("ValidSource").split(","), this.getHostCard())) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (hasParam("DamageAmount")) {
|
||||
final String fullParam = this.mapParams.get("DamageAmount");
|
||||
final String fullParam = getParam("DamageAmount");
|
||||
|
||||
final String operator = fullParam.substring(0, 2);
|
||||
final int operand = Integer.parseInt(fullParam.substring(2));
|
||||
|
||||
@@ -60,24 +60,24 @@ public class TriggerDamageDone extends Trigger {
|
||||
final Object tgt = runParams.get(AbilityKey.DamageTarget);
|
||||
|
||||
if (hasParam("ValidSource")) {
|
||||
if (!src.isValid(this.mapParams.get("ValidSource").split(","), this.getHostCard().getController(),
|
||||
if (!src.isValid(getParam("ValidSource").split(","), this.getHostCard().getController(),
|
||||
this.getHostCard(), null)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (hasParam("ValidTarget")) {
|
||||
if (!matchesValid(tgt, this.mapParams.get("ValidTarget").split(","), this.getHostCard())) {
|
||||
if (!matchesValid(tgt, getParam("ValidTarget").split(","), this.getHostCard())) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (hasParam("CombatDamage")) {
|
||||
if (this.mapParams.get("CombatDamage").equals("True")) {
|
||||
if (getParam("CombatDamage").equals("True")) {
|
||||
if (!((Boolean) runParams.get(AbilityKey.IsCombatDamage))) {
|
||||
return false;
|
||||
}
|
||||
} else if (this.mapParams.get("CombatDamage").equals("False")) {
|
||||
} else if (getParam("CombatDamage").equals("False")) {
|
||||
if (((Boolean) runParams.get(AbilityKey.IsCombatDamage))) {
|
||||
return false;
|
||||
}
|
||||
@@ -85,7 +85,7 @@ public class TriggerDamageDone extends Trigger {
|
||||
}
|
||||
|
||||
if (hasParam("DamageAmount")) {
|
||||
final String fullParam = this.mapParams.get("DamageAmount");
|
||||
final String fullParam = getParam("DamageAmount");
|
||||
|
||||
final String operator = fullParam.substring(0, 2);
|
||||
final int operand = Integer.parseInt(fullParam.substring(2));
|
||||
|
||||
@@ -22,11 +22,11 @@ public class TriggerDamageDoneOnce extends Trigger {
|
||||
final GameEntity tgt = (GameEntity) runParams.get(AbilityKey.DamageTarget);
|
||||
|
||||
if (hasParam("CombatDamage")) {
|
||||
if (this.mapParams.get("CombatDamage").equals("True")) {
|
||||
if (getParam("CombatDamage").equals("True")) {
|
||||
if (!((Boolean) runParams.get(AbilityKey.IsCombatDamage))) {
|
||||
return false;
|
||||
}
|
||||
} else if (this.mapParams.get("CombatDamage").equals("False")) {
|
||||
} else if (getParam("CombatDamage").equals("False")) {
|
||||
if (((Boolean) runParams.get(AbilityKey.IsCombatDamage))) {
|
||||
return false;
|
||||
}
|
||||
@@ -36,7 +36,7 @@ public class TriggerDamageDoneOnce extends Trigger {
|
||||
if (hasParam("ValidSource")) {
|
||||
boolean valid = false;
|
||||
for (Card c : srcs) {
|
||||
if (c.isValid(this.mapParams.get("ValidSource").split(","), this.getHostCard().getController(),this.getHostCard(), null)) {
|
||||
if (c.isValid(getParam("ValidSource").split(","), this.getHostCard().getController(),this.getHostCard(), null)) {
|
||||
valid = true;
|
||||
}
|
||||
}
|
||||
@@ -46,7 +46,7 @@ public class TriggerDamageDoneOnce extends Trigger {
|
||||
}
|
||||
|
||||
if (hasParam("ValidTarget")) {
|
||||
if (!matchesValid(tgt, this.mapParams.get("ValidTarget").split(","), this.getHostCard())) {
|
||||
if (!matchesValid(tgt, getParam("ValidTarget").split(","), this.getHostCard())) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,24 +59,24 @@ public class TriggerDamagePrevented extends Trigger {
|
||||
final Object tgt = runParams.get(AbilityKey.DamageTarget);
|
||||
|
||||
if (hasParam("ValidSource")) {
|
||||
if (!src.isValid(this.mapParams.get("ValidSource").split(","), this.getHostCard().getController(),
|
||||
if (!src.isValid(getParam("ValidSource").split(","), this.getHostCard().getController(),
|
||||
this.getHostCard(), null)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (hasParam("ValidTarget")) {
|
||||
if (!matchesValid(tgt, this.mapParams.get("ValidTarget").split(","), this.getHostCard())) {
|
||||
if (!matchesValid(tgt, getParam("ValidTarget").split(","), this.getHostCard())) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (hasParam("CombatDamage")) {
|
||||
if (this.mapParams.get("CombatDamage").equals("True")) {
|
||||
if (getParam("CombatDamage").equals("True")) {
|
||||
if (!((Boolean) runParams.get(AbilityKey.IsCombatDamage))) {
|
||||
return false;
|
||||
}
|
||||
} else if (this.mapParams.get("CombatDamage").equals("False")) {
|
||||
} else if (getParam("CombatDamage").equals("False")) {
|
||||
if (((Boolean) runParams.get(AbilityKey.IsCombatDamage))) {
|
||||
return false;
|
||||
}
|
||||
@@ -84,7 +84,7 @@ public class TriggerDamagePrevented extends Trigger {
|
||||
}
|
||||
|
||||
if (hasParam("DamageAmount")) {
|
||||
final String fullParam = this.mapParams.get("DamageAmount");
|
||||
final String fullParam = getParam("DamageAmount");
|
||||
|
||||
final String operator = fullParam.substring(0, 2);
|
||||
final int operand = Integer.parseInt(fullParam.substring(2));
|
||||
|
||||
@@ -57,17 +57,17 @@ public class TriggerDamagePreventedOnce extends Trigger {
|
||||
final Object tgt = runParams.get(AbilityKey.DamageTarget);
|
||||
|
||||
if (hasParam("ValidTarget")) {
|
||||
if (!matchesValid(tgt, this.mapParams.get("ValidTarget").split(","), this.getHostCard())) {
|
||||
if (!matchesValid(tgt, getParam("ValidTarget").split(","), this.getHostCard())) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (hasParam("CombatDamage")) {
|
||||
if (this.mapParams.get("CombatDamage").equals("True")) {
|
||||
if (getParam("CombatDamage").equals("True")) {
|
||||
if (!((Boolean) runParams.get(AbilityKey.IsCombatDamage))) {
|
||||
return false;
|
||||
}
|
||||
} else if (this.mapParams.get("CombatDamage").equals("False")) {
|
||||
} else if (getParam("CombatDamage").equals("False")) {
|
||||
if (((Boolean) runParams.get(AbilityKey.IsCombatDamage))) {
|
||||
return false;
|
||||
}
|
||||
@@ -75,7 +75,7 @@ public class TriggerDamagePreventedOnce extends Trigger {
|
||||
}
|
||||
|
||||
if (hasParam("DamageAmount")) {
|
||||
final String fullParam = this.mapParams.get("DamageAmount");
|
||||
final String fullParam = getParam("DamageAmount");
|
||||
|
||||
final String operator = fullParam.substring(0, 2);
|
||||
final int operand = Integer.parseInt(fullParam.substring(2));
|
||||
|
||||
@@ -55,7 +55,7 @@ public class TriggerDevoured extends Trigger {
|
||||
public final boolean performTest(final Map<AbilityKey, Object> runParams) {
|
||||
final Card sac = (Card) runParams.get(AbilityKey.Devoured);
|
||||
if (hasParam("ValidDevoured")) {
|
||||
return sac.isValid(this.mapParams.get("ValidDevoured").split(","), this.getHostCard().getController(),
|
||||
return sac.isValid(getParam("ValidDevoured").split(","), this.getHostCard().getController(),
|
||||
this.getHostCard(), null);
|
||||
}
|
||||
return true;
|
||||
|
||||
@@ -54,14 +54,14 @@ public class TriggerDiscarded extends Trigger {
|
||||
@Override
|
||||
public final boolean performTest(final Map<AbilityKey, Object> runParams) {
|
||||
if (hasParam("ValidCard")) {
|
||||
if (!matchesValid(runParams.get(AbilityKey.Card), this.mapParams.get("ValidCard").split(","),
|
||||
if (!matchesValid(runParams.get(AbilityKey.Card), getParam("ValidCard").split(","),
|
||||
this.getHostCard())) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (hasParam("ValidPlayer")) {
|
||||
if (!matchesValid(runParams.get(AbilityKey.Player), this.mapParams.get("ValidPlayer").split(","),
|
||||
if (!matchesValid(runParams.get(AbilityKey.Player), getParam("ValidPlayer").split(","),
|
||||
this.getHostCard())) {
|
||||
return false;
|
||||
}
|
||||
@@ -71,14 +71,14 @@ public class TriggerDiscarded extends Trigger {
|
||||
if (runParams.get(AbilityKey.Cause) == null) {
|
||||
return false;
|
||||
}
|
||||
if (!matchesValid(runParams.get(AbilityKey.Cause), this.mapParams.get("ValidCause").split(","),
|
||||
if (!matchesValid(runParams.get(AbilityKey.Cause), getParam("ValidCause").split(","),
|
||||
this.getHostCard())) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (hasParam("IsMadness")) {
|
||||
Boolean madness = (Boolean) runParams.get(AbilityKey.IsMadness);
|
||||
if (this.mapParams.get("IsMadness").equals("True") ^ madness) {
|
||||
if (getParam("IsMadness").equals("True") ^ madness) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ public class TriggerExerted extends Trigger {
|
||||
public boolean performTest(Map<AbilityKey, Object> runParams) {
|
||||
final Card exerter = (Card) runParams.get(AbilityKey.Card);
|
||||
if (hasParam("ValidCard")) {
|
||||
return exerter.isValid(this.mapParams.get("ValidCard").split(","), this.getHostCard().getController(),
|
||||
return exerter.isValid(getParam("ValidCard").split(","), this.getHostCard().getController(),
|
||||
this.getHostCard(), null);
|
||||
}
|
||||
return true;
|
||||
|
||||
@@ -58,13 +58,13 @@ public class TriggerExploited extends Trigger {
|
||||
final Card source = (Card) runParams.get(AbilityKey.Card);
|
||||
|
||||
if (hasParam("ValidCard")) {
|
||||
if (!exploited.isValid(this.mapParams.get("ValidCard").split(","),
|
||||
if (!exploited.isValid(getParam("ValidCard").split(","),
|
||||
this.getHostCard().getController(), this.getHostCard(), null)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (hasParam("ValidSource")) {
|
||||
if (!source.isValid(this.mapParams.get("ValidSource").split(","),
|
||||
if (!source.isValid(getParam("ValidSource").split(","),
|
||||
this.getHostCard().getController(), this.getHostCard(), null)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ public class TriggerExplores extends Trigger {
|
||||
@Override
|
||||
public final boolean performTest(final Map<AbilityKey, Object> runParams) {
|
||||
if (hasParam("ValidCard")) {
|
||||
return matchesValid(runParams.get(AbilityKey.Card), this.mapParams.get("ValidCard").split(","),
|
||||
return matchesValid(runParams.get(AbilityKey.Card), getParam("ValidCard").split(","),
|
||||
this.getHostCard());
|
||||
}
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@ public class TriggerFight extends Trigger {
|
||||
final Card fighter = (Card) runParams.get(AbilityKey.Fighter);
|
||||
|
||||
if (hasParam("ValidCard")) {
|
||||
return fighter.isValid(this.mapParams.get("ValidCard").split(","),
|
||||
return fighter.isValid(getParam("ValidCard").split(","),
|
||||
this.getHostCard().getController(), this.getHostCard(), null);
|
||||
}
|
||||
return true;
|
||||
|
||||
@@ -54,14 +54,14 @@ public class TriggerFlippedCoin extends Trigger {
|
||||
@Override
|
||||
public final boolean performTest(final Map<AbilityKey, Object> runParams) {
|
||||
if (hasParam("ValidPlayer")) {
|
||||
if (!matchesValid(runParams.get(AbilityKey.Player), this.mapParams.get("ValidPlayer").split(","),
|
||||
if (!matchesValid(runParams.get(AbilityKey.Player), getParam("ValidPlayer").split(","),
|
||||
this.getHostCard())) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (hasParam("ValidResult")) {
|
||||
final boolean result = (Boolean) runParams.get(AbilityKey.Result);
|
||||
final boolean valid = "Win".equals(this.mapParams.get("ValidResult"));
|
||||
final boolean valid = "Win".equals(getParam("ValidResult"));
|
||||
if (result ^ valid) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ public class TriggerInvestigated extends Trigger {
|
||||
public final boolean performTest(final Map<AbilityKey, Object> runParams) {
|
||||
Player p = (Player) runParams.get(AbilityKey.Player);
|
||||
if (hasParam("ValidPlayer")) {
|
||||
if (!matchesValid(p, this.mapParams.get("ValidPlayer").split(","), this.getHostCard())) {
|
||||
if (!matchesValid(p, getParam("ValidPlayer").split(","), this.getHostCard())) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ public class TriggerLandPlayed extends Trigger {
|
||||
public final boolean performTest(final Map<AbilityKey, Object> runParams) {
|
||||
Card land = (Card) runParams.get(AbilityKey.Card);
|
||||
if (hasParam("ValidCard")) {
|
||||
if (!matchesValid(land, this.mapParams.get("ValidCard").split(","), this.getHostCard())) {
|
||||
if (!matchesValid(land, getParam("ValidCard").split(","), this.getHostCard())) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ public class TriggerLifeLost extends Trigger {
|
||||
@Override
|
||||
public final boolean performTest(final Map<AbilityKey, Object> runParams) {
|
||||
if (hasParam("ValidPlayer")) {
|
||||
if (!matchesValid(runParams.get(AbilityKey.Player), this.mapParams.get("ValidPlayer").split(","),
|
||||
if (!matchesValid(runParams.get(AbilityKey.Player), getParam("ValidPlayer").split(","),
|
||||
this.getHostCard())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ public class TriggerLosesGame extends Trigger {
|
||||
@Override
|
||||
public final boolean performTest(final Map<AbilityKey, Object> runParams) {
|
||||
if (hasParam("ValidPlayer")) {
|
||||
return matchesValid(runParams.get(AbilityKey.Player), this.mapParams.get("ValidPlayer").split(","),
|
||||
return matchesValid(runParams.get(AbilityKey.Player), getParam("ValidPlayer").split(","),
|
||||
this.getHostCard());
|
||||
}
|
||||
|
||||
|
||||
@@ -55,13 +55,13 @@ public class TriggerPayCumulativeUpkeep extends Trigger {
|
||||
public final boolean performTest(final Map<AbilityKey, Object> runParams) {
|
||||
if (hasParam("Paid")) {
|
||||
Boolean paid = (Boolean) runParams.get(AbilityKey.CumulativeUpkeepPaid);
|
||||
if (this.mapParams.get("Paid").equals("True") ^ paid) {
|
||||
if (getParam("Paid").equals("True") ^ paid) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
final Card card = (Card) runParams.get(AbilityKey.Card);
|
||||
if (hasParam("ValidCard")) {
|
||||
if (!card.isValid(this.mapParams.get("ValidCard").split(","), this.getHostCard().getController(),
|
||||
if (!card.isValid(getParam("ValidCard").split(","), this.getHostCard().getController(),
|
||||
this.getHostCard(), null)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -55,13 +55,13 @@ public class TriggerPayEcho extends Trigger {
|
||||
public final boolean performTest(final Map<AbilityKey, Object> runParams) {
|
||||
if (hasParam("Paid")) {
|
||||
Boolean paid = (Boolean) runParams.get(AbilityKey.EchoPaid);
|
||||
if (this.mapParams.get("Paid").equals("True") ^ paid) {
|
||||
if (getParam("Paid").equals("True") ^ paid) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
final Card card = (Card) runParams.get(AbilityKey.Card);
|
||||
if (hasParam("ValidCard")) {
|
||||
if (!card.isValid(this.mapParams.get("ValidCard").split(","), this.getHostCard().getController(),
|
||||
if (!card.isValid(getParam("ValidCard").split(","), this.getHostCard().getController(),
|
||||
this.getHostCard(), null)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ public class TriggerPhase extends Trigger {
|
||||
@Override
|
||||
public final boolean performTest(final Map<AbilityKey, Object> runParams) {
|
||||
if (hasParam("ValidPlayer")) {
|
||||
return matchesValid(runParams.get(AbilityKey.Player), this.mapParams.get("ValidPlayer").split(","),
|
||||
return matchesValid(runParams.get(AbilityKey.Player), getParam("ValidPlayer").split(","),
|
||||
this.getHostCard());
|
||||
}
|
||||
return true;
|
||||
|
||||
@@ -19,7 +19,7 @@ public class TriggerPhaseIn extends Trigger {
|
||||
final Card phaser = (Card) runParams.get(AbilityKey.Card);
|
||||
|
||||
if (hasParam("ValidCard")) {
|
||||
return phaser.isValid(this.mapParams.get("ValidCard").split(","), this.getHostCard().getController(),
|
||||
return phaser.isValid(getParam("ValidCard").split(","), this.getHostCard().getController(),
|
||||
this.getHostCard(), null);
|
||||
}
|
||||
|
||||
|
||||
@@ -19,13 +19,13 @@ public class TriggerPhaseOut extends Trigger {
|
||||
final Card phaser = (Card) runParams.get(AbilityKey.Card);
|
||||
|
||||
if (hasParam("ValidCard")) {
|
||||
if (this.mapParams.get("ValidCard").equals("Card.Self")) {
|
||||
if (getParam("ValidCard").equals("Card.Self")) {
|
||||
// Since Phased out cards aren't visible in .isValid, use a special check here.
|
||||
// NOTE: All Phase Out Triggers should use ValidCard$ Card.Self
|
||||
if (phaser != this.getHostCard()) {
|
||||
return false;
|
||||
}
|
||||
} else if (!phaser.isValid(this.mapParams.get("ValidCard").split(","), this.getHostCard().getController(),
|
||||
} else if (!phaser.isValid(getParam("ValidCard").split(","), this.getHostCard().getController(),
|
||||
this.getHostCard(), null)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -35,14 +35,14 @@ public class TriggerPlanarDice extends Trigger {
|
||||
@Override
|
||||
public boolean performTest(Map<AbilityKey, Object> runParams) {
|
||||
if (hasParam("ValidPlayer")) {
|
||||
if (!matchesValid(runParams.get(AbilityKey.Player), this.mapParams.get("ValidPlayer").split(","),
|
||||
if (!matchesValid(runParams.get(AbilityKey.Player), getParam("ValidPlayer").split(","),
|
||||
this.getHostCard())) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (hasParam("Result")) {
|
||||
PlanarDice cond = PlanarDice.smartValueOf(this.mapParams.get("Result"));
|
||||
PlanarDice cond = PlanarDice.smartValueOf(getParam("Result"));
|
||||
if (cond != runParams.get(AbilityKey.Result)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ public class TriggerPlaneswalkedFrom extends Trigger {
|
||||
if (hasParam("ValidCard")) {
|
||||
final CardCollection moved = (CardCollection) runParams.get(AbilityKey.Cards);
|
||||
for(Card c : moved) {
|
||||
if (c.isValid(this.mapParams.get("ValidCard").split(","), this
|
||||
if (c.isValid(getParam("ValidCard").split(","), this
|
||||
.getHostCard().getController(), this.getHostCard(), null)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ public class TriggerPlaneswalkedTo extends Trigger {
|
||||
if (hasParam("ValidCard")) {
|
||||
for(Card moved : (Iterable<Card>) runParams.get(AbilityKey.Cards))
|
||||
{
|
||||
if (moved.isValid(this.mapParams.get("ValidCard").split(","), this.getHostCard().getController(),
|
||||
if (moved.isValid(getParam("ValidCard").split(","), this.getHostCard().getController(),
|
||||
this.getHostCard(), null)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ public class TriggerRevealed extends Trigger {
|
||||
public boolean performTest(Map<AbilityKey, Object> runParams) {
|
||||
if (hasParam("ValidCard")) {
|
||||
final Card moved = (Card) runParams.get(AbilityKey.Card);
|
||||
if (!moved.isValid(this.mapParams.get("ValidCard").split(","), this.getHostCard().getController(),
|
||||
if (!moved.isValid(getParam("ValidCard").split(","), this.getHostCard().getController(),
|
||||
this.getHostCard(), null)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -60,19 +60,19 @@ public class TriggerSacrificed extends Trigger {
|
||||
final Player player = (Player) runParams.get(AbilityKey.Player);
|
||||
final SpellAbility sourceSA = (SpellAbility) runParams.get(AbilityKey.Cause);
|
||||
if (hasParam("ValidPlayer")) {
|
||||
if (!matchesValid(player, this.mapParams.get("ValidPlayer").split(","),
|
||||
if (!matchesValid(player, getParam("ValidPlayer").split(","),
|
||||
this.getHostCard())) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (hasParam("ValidCard")) {
|
||||
if (!sac.isValid(this.mapParams.get("ValidCard").split(","), this.getHostCard().getController(),
|
||||
if (!sac.isValid(getParam("ValidCard").split(","), this.getHostCard().getController(),
|
||||
this.getHostCard(), null)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (hasParam("ValidSourceController")) {
|
||||
if (sourceSA == null || !sourceSA.getActivatingPlayer().isValid(this.mapParams.get("ValidSourceController"),
|
||||
if (sourceSA == null || !sourceSA.getActivatingPlayer().isValid(getParam("ValidSourceController"),
|
||||
this.getHostCard().getController(), this.getHostCard(), null)) {
|
||||
return false;
|
||||
}
|
||||
@@ -88,7 +88,7 @@ public class TriggerSacrificed extends Trigger {
|
||||
}
|
||||
|
||||
if (hasParam("WhileKeyword")) {
|
||||
final String keyword = this.mapParams.get("WhileKeyword");
|
||||
final String keyword = getParam("WhileKeyword");
|
||||
boolean withKeyword = false;
|
||||
|
||||
// When cast with Emerge, the cost instance is there
|
||||
|
||||
@@ -54,7 +54,7 @@ public class TriggerScry extends Trigger {
|
||||
@Override
|
||||
public final boolean performTest(final Map<AbilityKey, Object> runParams) {
|
||||
if (hasParam("ValidPlayer")) {
|
||||
return matchesValid(runParams.get(AbilityKey.Player), this.mapParams.get("ValidPlayer").split(","),
|
||||
return matchesValid(runParams.get(AbilityKey.Player), getParam("ValidPlayer").split(","),
|
||||
this.getHostCard());
|
||||
}
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ public class TriggerSearchedLibrary extends Trigger {
|
||||
@Override
|
||||
public final boolean performTest(final Map<AbilityKey, Object> runParams) {
|
||||
if (hasParam("ValidPlayer")) {
|
||||
if (!matchesValid(runParams.get(AbilityKey.Player), this.mapParams.get("ValidPlayer").split(","),
|
||||
if (!matchesValid(runParams.get(AbilityKey.Player), getParam("ValidPlayer").split(","),
|
||||
this.getHostCard())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -55,18 +55,18 @@ public class TriggerSetInMotion extends Trigger {
|
||||
@Override
|
||||
public final boolean performTest(final Map<AbilityKey, Object> runParams) {
|
||||
if (hasParam("ValidCard")) {
|
||||
if (!matchesValid(runParams.get(AbilityKey.Scheme), this.mapParams.get("ValidCard").split(","),
|
||||
if (!matchesValid(runParams.get(AbilityKey.Scheme), getParam("ValidCard").split(","),
|
||||
this.getHostCard())) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (hasParam("SchemeType")) {
|
||||
if (this.mapParams.get("SchemeType").equals("NonOngoing")) {
|
||||
if (getParam("SchemeType").equals("NonOngoing")) {
|
||||
if (((Card) runParams.get(AbilityKey.Scheme)).getType().hasSupertype(CardType.Supertype.Ongoing)) {
|
||||
return false;
|
||||
}
|
||||
} else if (this.mapParams.get("SchemeType").equals("Ongoing")) {
|
||||
} else if (getParam("SchemeType").equals("Ongoing")) {
|
||||
if (((Card) runParams.get(AbilityKey.Scheme)).getType().hasSupertype(CardType.Supertype.Ongoing)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ public class TriggerShuffled extends Trigger {
|
||||
@Override
|
||||
public final boolean performTest(final Map<AbilityKey, Object> runParams) {
|
||||
if (hasParam("ValidPlayer")) {
|
||||
if (!matchesValid(runParams.get(AbilityKey.Player), this.mapParams.get("ValidPlayer").split(","),
|
||||
if (!matchesValid(runParams.get(AbilityKey.Player), getParam("ValidPlayer").split(","),
|
||||
this.getHostCard())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -180,7 +180,7 @@ public class TriggerSpellAbilityCast extends Trigger {
|
||||
}
|
||||
}
|
||||
candidates.removeAll(targetedSA.getTargets().getTargetCards());
|
||||
String valid = this.mapParams.get("CanTargetOtherCondition");
|
||||
String valid = getParam("CanTargetOtherCondition");
|
||||
if (CardLists.getValidCards(candidates, valid, spellAbility.getActivatingPlayer(), spellAbility.getHostCard()).isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ public class TriggerTapsForMana extends Trigger {
|
||||
|
||||
if (hasParam("ValidCard")) {
|
||||
final Card tapper = (Card) runParams.get(AbilityKey.Card);
|
||||
if (!tapper.isValid(this.mapParams.get("ValidCard").split(","), this.getHostCard().getController(),
|
||||
if (!tapper.isValid(getParam("ValidCard").split(","), this.getHostCard().getController(),
|
||||
this.getHostCard(), null)) {
|
||||
return false;
|
||||
}
|
||||
@@ -74,7 +74,7 @@ public class TriggerTapsForMana extends Trigger {
|
||||
|
||||
if (hasParam("Player")) {
|
||||
final Player player = (Player) runParams.get(AbilityKey.Player);
|
||||
if (!player.isValid(this.mapParams.get("Player").split(","), this.getHostCard().getController(), this.getHostCard(), null)) {
|
||||
if (!player.isValid(getParam("Player").split(","), this.getHostCard().getController(), this.getHostCard(), null)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -83,7 +83,7 @@ public class TriggerTapsForMana extends Trigger {
|
||||
final SpellAbility sa = (SpellAbility) runParams.get(AbilityKey.AbilityMana);
|
||||
if (sa == null) return false;
|
||||
final Player activator = sa.getActivatingPlayer();
|
||||
if (!activator.isValid(this.mapParams.get("Activator").split(","), this.getHostCard().getController(), this.getHostCard(), null)) {
|
||||
if (!activator.isValid(getParam("Activator").split(","), this.getHostCard().getController(), this.getHostCard(), null)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -94,7 +94,7 @@ public class TriggerTapsForMana extends Trigger {
|
||||
return false;
|
||||
}
|
||||
String produced = (String) prod;
|
||||
if ("ChosenColor".equals(mapParams.get("Produced"))) {
|
||||
if ("ChosenColor".equals(getParam("Produced"))) {
|
||||
if (!this.getHostCard().hasChosenColor() || !produced.contains(MagicColor.toShortString(this.getHostCard().getChosenColor()))) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ public class TriggerTransformed extends Trigger {
|
||||
@Override
|
||||
public boolean performTest(Map<AbilityKey, Object> runParams) {
|
||||
if (hasParam("ValidCard")) {
|
||||
return matchesValid(runParams.get(AbilityKey.Transformer), this.mapParams.get("ValidCard").split(","),
|
||||
return matchesValid(runParams.get(AbilityKey.Transformer), getParam("ValidCard").split(","),
|
||||
this.getHostCard());
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ public class TriggerTurnBegin extends Trigger {
|
||||
@Override
|
||||
public final boolean performTest(final Map<AbilityKey, Object> runParams) {
|
||||
if (hasParam("ValidPlayer")) {
|
||||
return matchesValid(runParams.get(AbilityKey.Player), this.mapParams.get("ValidPlayer").split(","),
|
||||
return matchesValid(runParams.get(AbilityKey.Player), getParam("ValidPlayer").split(","),
|
||||
this.getHostCard());
|
||||
}
|
||||
return true;
|
||||
|
||||
@@ -54,7 +54,7 @@ public class TriggerTurnFaceUp extends Trigger {
|
||||
@Override
|
||||
public final boolean performTest(final Map<AbilityKey, Object> runParams) {
|
||||
if (hasParam("ValidCard")) {
|
||||
return matchesValid(runParams.get(AbilityKey.Card), this.mapParams.get("ValidCard").split(","),
|
||||
return matchesValid(runParams.get(AbilityKey.Card), getParam("ValidCard").split(","),
|
||||
this.getHostCard());
|
||||
}
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ public class TriggerUntaps extends Trigger {
|
||||
final Card untapper = (Card) runParams.get(AbilityKey.Card);
|
||||
|
||||
if (hasParam("ValidCard")) {
|
||||
if (!untapper.isValid(this.mapParams.get("ValidCard").split(","), this.getHostCard().getController(),
|
||||
if (!untapper.isValid(getParam("ValidCard").split(","), this.getHostCard().getController(),
|
||||
this.getHostCard(), null)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user