- Archenemy Nicol Bolas: Add a scheme

- Update scripts and add codes for C17 leaks
This commit is contained in:
swordshine
2017-06-10 14:07:13 +00:00
parent 33ac16eba6
commit dd2e76ec65
9 changed files with 41 additions and 11 deletions

View File

@@ -663,6 +663,10 @@ public class AbilityUtils {
list = null;
}
}
else if (calcX[0].startsWith("TriggerObjects")) {
final SpellAbility root = sa.getRootAbility();
list = (CardCollection) root.getTriggeringObject(calcX[0].substring(14));
}
else if (calcX[0].startsWith("Triggered")) {
final SpellAbility root = sa.getRootAbility();
list = new CardCollection((Card) root.getTriggeringObject(calcX[0].substring(9)));

View File

@@ -1071,13 +1071,15 @@ public class CardFactoryUtil {
}
if (sq[0].contains("ColorsCtrl")) {
final CardCollectionView list = cc.getCardsIn(ZoneType.Battlefield);
int n = 0;
for (final byte col : MagicColor.WUBRG) {
if (!CardLists.getColor(list, col).isEmpty()) {
n++;
}
final String restriction = l[0].substring(11);
final String[] rest = restriction.split(",");
final CardCollection list = CardLists.getValidCards(cc.getGame().getCardsInGame(), rest, cc, c, null);
int n = 0;
for (final byte col : MagicColor.WUBRG) {
if (!CardLists.getColor(list, col).isEmpty()) {
n++;
}
}
return doXMath(n, m, c);
}

View File

@@ -23,6 +23,7 @@ import forge.game.spellability.SpellAbility;
import java.util.List;
import java.util.Map;
import java.util.Set;
/**
* TODO Write javadoc for this type.
@@ -45,6 +46,7 @@ public class TriggerAttackersDeclared extends Trigger {
}
/** {@inheritDoc} */
@SuppressWarnings("unchecked")
@Override
public final boolean performTest(final Map<String, Object> runParams2) {
if (this.mapParams.containsKey("AttackingPlayer")) {
@@ -55,7 +57,6 @@ public class TriggerAttackersDeclared extends Trigger {
}
if (this.mapParams.containsKey("AttackedTarget")) {
boolean valid = false;
@SuppressWarnings("unchecked")
List<GameEntity> list = (List<GameEntity>) runParams2.get("AttackedTarget");
for (GameEntity b : list) {
if (matchesValid(b, this.mapParams.get("AttackedTarget").split(","), this.getHostCard())) {
@@ -67,6 +68,19 @@ public class TriggerAttackersDeclared extends Trigger {
return false;
}
}
if (this.mapParams.containsKey("ValidAttackers")) {
boolean valid = false;
final Set<Card> srcs = (Set<Card>) runParams2.get("Attackers");
for (Card c : srcs) {
if (c.isValid(this.mapParams.get("ValidAttackers").split(","), this.getHostCard().getController(), this.getHostCard(), null)) {
valid = true;
}
}
if (!valid) {
return false;
}
}
return true;
}