mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-16 10:48:00 +00:00
Some cleanup (#2242)
This commit is contained in:
@@ -179,7 +179,7 @@ public class AiAttackController {
|
|||||||
|
|
||||||
List<Player> opps = Lists.newArrayList(ai.getOpponents());
|
List<Player> opps = Lists.newArrayList(ai.getOpponents());
|
||||||
if (forCombatDmg) {
|
if (forCombatDmg) {
|
||||||
for (Player p : ai.getOpponents().threadSafeIterable()) {
|
for (Player p : ai.getOpponents()) {
|
||||||
if (p.isMonarch() && ai.canBecomeMonarch()) {
|
if (p.isMonarch() && ai.canBecomeMonarch()) {
|
||||||
// just increase the odds for now instead of being fully predictable
|
// just increase the odds for now instead of being fully predictable
|
||||||
// as it could lead to other too complex factors giving this reasoning negative impact
|
// as it could lead to other too complex factors giving this reasoning negative impact
|
||||||
|
|||||||
@@ -45,6 +45,7 @@ import forge.game.combat.CombatUtil;
|
|||||||
import forge.game.cost.Cost;
|
import forge.game.cost.Cost;
|
||||||
import forge.game.cost.CostPayEnergy;
|
import forge.game.cost.CostPayEnergy;
|
||||||
import forge.game.cost.CostRemoveCounter;
|
import forge.game.cost.CostRemoveCounter;
|
||||||
|
import forge.game.cost.CostUntap;
|
||||||
import forge.game.keyword.Keyword;
|
import forge.game.keyword.Keyword;
|
||||||
import forge.game.keyword.KeywordCollection;
|
import forge.game.keyword.KeywordCollection;
|
||||||
import forge.game.keyword.KeywordInterface;
|
import forge.game.keyword.KeywordInterface;
|
||||||
@@ -1417,14 +1418,16 @@ public class ComputerUtilCard {
|
|||||||
double nonCombatChance = 0.0f;
|
double nonCombatChance = 0.0f;
|
||||||
double combatChance = 0.0f;
|
double combatChance = 0.0f;
|
||||||
// non-combat Haste: has an activated ability with tap cost
|
// non-combat Haste: has an activated ability with tap cost
|
||||||
|
if (c.isAbilitySick()) {
|
||||||
for (SpellAbility ab : c.getSpellAbilities()) {
|
for (SpellAbility ab : c.getSpellAbilities()) {
|
||||||
Cost abCost = ab.getPayCosts();
|
Cost abCost = ab.getPayCosts();
|
||||||
if (abCost != null && abCost.hasTapCost()
|
if (abCost != null && (abCost.hasTapCost() || abCost.hasSpecificCostType(CostUntap.class))
|
||||||
&& (!abCost.hasManaCost() || ComputerUtilMana.canPayManaCost(ab, ai, 0, false))) {
|
&& (!abCost.hasManaCost() || ComputerUtilMana.canPayManaCost(ab, ai, sa.getPayCosts().getTotalMana().getCMC(), false))) {
|
||||||
nonCombatChance += 0.5f;
|
nonCombatChance += 0.5f;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
// combat Haste: only grant it if the creature will attack
|
// combat Haste: only grant it if the creature will attack
|
||||||
if (doesSpecifiedCreatureAttackAI(ai, pumped)) {
|
if (doesSpecifiedCreatureAttackAI(ai, pumped)) {
|
||||||
combatChance += 0.5f + (0.5f * ComputerUtilCombat.damageIfUnblocked(pumped, opp, combat, true) / opp.getLife());
|
combatChance += 0.5f + (0.5f * ComputerUtilCombat.damageIfUnblocked(pumped, opp, combat, true) / opp.getLife());
|
||||||
@@ -1917,7 +1920,7 @@ public class ComputerUtilCard {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!canBeBlocked) {
|
if (!canBeBlocked) {
|
||||||
boolean threat = atk.getNetCombatDamage() >= ai.getLife() - lifeInDanger;
|
boolean threat = ComputerUtilCombat.getAttack(atk) >= ai.getLife() - lifeInDanger;
|
||||||
if (!priorityRemovalOnlyInDanger || threat) {
|
if (!priorityRemovalOnlyInDanger || threat) {
|
||||||
priorityCards.add(atk);
|
priorityCards.add(atk);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2054,7 +2054,6 @@ public class ComputerUtilCombat {
|
|||||||
if (block.size() == 1) {
|
if (block.size() == 1) {
|
||||||
final Card blocker = block.getFirst();
|
final Card blocker = block.getFirst();
|
||||||
|
|
||||||
// trample
|
|
||||||
if (hasTrample) {
|
if (hasTrample) {
|
||||||
int dmgToKill = getEnoughDamageToKill(blocker, dmgCanDeal, attacker, true);
|
int dmgToKill = getEnoughDamageToKill(blocker, dmgCanDeal, attacker, true);
|
||||||
|
|
||||||
@@ -2110,7 +2109,7 @@ public class ComputerUtilCombat {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return damageMap;
|
return damageMap;
|
||||||
} // setAssignedDamage()
|
}
|
||||||
|
|
||||||
// how much damage is enough to kill the creature (for AI)
|
// how much damage is enough to kill the creature (for AI)
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -206,12 +206,7 @@ public class GameCopier {
|
|||||||
Card newCard = map.map(origHostCard);
|
Card newCard = map.map(origHostCard);
|
||||||
SpellAbility newSa = null;
|
SpellAbility newSa = null;
|
||||||
if (origSa.isSpell()) {
|
if (origSa.isSpell()) {
|
||||||
for (SpellAbility sa : newCard.getAllSpellAbilities()) {
|
newSa = findSAInCard(origSa, newCard);
|
||||||
if (sa.getDescription().equals(origSa.getDescription())) {
|
|
||||||
newSa = sa;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (newSa != null) {
|
if (newSa != null) {
|
||||||
newSa.setActivatingPlayer(map.map(origSa.getActivatingPlayer()), true);
|
newSa.setActivatingPlayer(map.map(origSa.getActivatingPlayer()), true);
|
||||||
|
|||||||
@@ -768,7 +768,7 @@ public final class GameActionUtil {
|
|||||||
final Game game = sourceCard.getGame();
|
final Game game = sourceCard.getGame();
|
||||||
final Card eff = new Card(game.nextCardId(), game);
|
final Card eff = new Card(game.nextCardId(), game);
|
||||||
eff.setTimestamp(game.getNextTimestamp());
|
eff.setTimestamp(game.getNextTimestamp());
|
||||||
eff.setName(sourceCard.getName() + "'s Effect");
|
eff.setName(sourceCard + "'s Effect");
|
||||||
eff.setOwner(controller);
|
eff.setOwner(controller);
|
||||||
|
|
||||||
eff.setImageKey(sourceCard.getImageKey());
|
eff.setImageKey(sourceCard.getImageKey());
|
||||||
|
|||||||
@@ -2843,11 +2843,7 @@ public class AbilityUtils {
|
|||||||
if (sq[0].startsWith("ColorsCtrl")) {
|
if (sq[0].startsWith("ColorsCtrl")) {
|
||||||
final String restriction = l[0].substring(11);
|
final String restriction = l[0].substring(11);
|
||||||
final CardCollection list = CardLists.getValidCards(player.getCardsIn(ZoneType.Battlefield), restriction, player, c, ctb);
|
final CardCollection list = CardLists.getValidCards(player.getCardsIn(ZoneType.Battlefield), restriction, player, c, ctb);
|
||||||
byte n = 0;
|
return doXMath(CardUtil.getColorsFromCards(list).countColors(), expr, c, ctb);
|
||||||
for (final Card card : list) {
|
|
||||||
n |= card.getColor().getColor();
|
|
||||||
}
|
|
||||||
return doXMath(ColorSet.fromMask(n).countColors(), expr, c, ctb);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO move below to handlePaid
|
// TODO move below to handlePaid
|
||||||
|
|||||||
@@ -7294,4 +7294,11 @@ public class Card extends GameEntity implements Comparable<Card>, IHasSVars {
|
|||||||
public boolean attackVigilance() {
|
public boolean attackVigilance() {
|
||||||
return StaticAbilityAttackVigilance.attackVigilance(this);
|
return StaticAbilityAttackVigilance.attackVigilance(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isAbilitySick() {
|
||||||
|
if (!isSick()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return !StaticAbilityActivateAbilityAsIfHaste.canActivate(this);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -356,9 +356,9 @@ public final class CardUtil {
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ColorSet getColorsYouCtrl(final Player p) {
|
public static ColorSet getColorsFromCards(Iterable<Card> list) {
|
||||||
byte b = 0;
|
byte b = 0;
|
||||||
for (Card c : p.getCardsIn(ZoneType.Battlefield)) {
|
for (Card c : list) {
|
||||||
b |= c.getColor().getColor();
|
b |= c.getColor().getColor();
|
||||||
}
|
}
|
||||||
return ColorSet.fromMask(b);
|
return ColorSet.fromMask(b);
|
||||||
|
|||||||
@@ -20,7 +20,6 @@ package forge.game.cost;
|
|||||||
import forge.game.card.Card;
|
import forge.game.card.Card;
|
||||||
import forge.game.player.Player;
|
import forge.game.player.Player;
|
||||||
import forge.game.spellability.SpellAbility;
|
import forge.game.spellability.SpellAbility;
|
||||||
import forge.game.staticability.StaticAbilityActivateAbilityAsIfHaste;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Class CostTap.
|
* The Class CostTap.
|
||||||
@@ -62,7 +61,7 @@ public class CostTap extends CostPart {
|
|||||||
@Override
|
@Override
|
||||||
public final boolean canPay(final SpellAbility ability, final Player payer, final boolean effect) {
|
public final boolean canPay(final SpellAbility ability, final Player payer, final boolean effect) {
|
||||||
final Card source = ability.getHostCard();
|
final Card source = ability.getHostCard();
|
||||||
return source.isUntapped() && !isAbilitySick(source);
|
return source.isUntapped() && !source.isAbilitySick();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -74,11 +73,4 @@ public class CostTap extends CostPart {
|
|||||||
public <T> T accept(ICostVisitor<T> visitor) {
|
public <T> T accept(ICostVisitor<T> visitor) {
|
||||||
return visitor.visit(this);
|
return visitor.visit(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isAbilitySick(final Card source) {
|
|
||||||
if (!source.isSick()) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return !StaticAbilityActivateAbilityAsIfHaste.canActivate(source);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,7 +20,6 @@ package forge.game.cost;
|
|||||||
import forge.game.card.Card;
|
import forge.game.card.Card;
|
||||||
import forge.game.player.Player;
|
import forge.game.player.Player;
|
||||||
import forge.game.spellability.SpellAbility;
|
import forge.game.spellability.SpellAbility;
|
||||||
import forge.game.staticability.StaticAbilityActivateAbilityAsIfHaste;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Class CostUntap.
|
* The Class CostUntap.
|
||||||
@@ -73,7 +72,7 @@ public class CostUntap extends CostPart {
|
|||||||
@Override
|
@Override
|
||||||
public final boolean canPay(final SpellAbility ability, final Player payer, final boolean effect) {
|
public final boolean canPay(final SpellAbility ability, final Player payer, final boolean effect) {
|
||||||
final Card source = ability.getHostCard();
|
final Card source = ability.getHostCard();
|
||||||
return source.isTapped() && !isAbilitySick(source);
|
return source.isTapped() && !source.isAbilitySick();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -85,11 +84,4 @@ public class CostUntap extends CostPart {
|
|||||||
public <T> T accept(ICostVisitor<T> visitor) {
|
public <T> T accept(ICostVisitor<T> visitor) {
|
||||||
return visitor.visit(this);
|
return visitor.visit(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isAbilitySick(final Card source) {
|
|
||||||
if (!source.isSick()) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return !StaticAbilityActivateAbilityAsIfHaste.canActivate(source);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -286,7 +286,7 @@ public class AbilityManaPart implements java.io.Serializable {
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
TriggerHandler handler = card.getGame().getTriggerHandler();
|
TriggerHandler handler = card.getGame().getTriggerHandler();
|
||||||
Trigger trig = TriggerHandler.parseTrigger(sVarHolder.getSVar(this.triggersWhenSpent), sourceCard, false);
|
Trigger trig = TriggerHandler.parseTrigger(sVarHolder.getSVar(this.triggersWhenSpent), sourceCard, false, sVarHolder);
|
||||||
handler.registerOneTrigger(trig);
|
handler.registerOneTrigger(trig);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1119,7 +1119,7 @@ public abstract class SpellAbility extends CardTraitBase implements ISpellAbilit
|
|||||||
|
|
||||||
clone.setPayCosts(getPayCosts().copy());
|
clone.setPayCosts(getPayCosts().copy());
|
||||||
if (manaPart != null) {
|
if (manaPart != null) {
|
||||||
clone.manaPart = new AbilityManaPart(this, mapParams);
|
clone.manaPart = new AbilityManaPart(clone, mapParams);
|
||||||
}
|
}
|
||||||
|
|
||||||
// need to copy the damage tables
|
// need to copy the damage tables
|
||||||
|
|||||||
@@ -249,7 +249,7 @@ public final class StaticAbilityContinuous {
|
|||||||
}
|
}
|
||||||
// two variants for Red vs. red in keyword
|
// two variants for Red vs. red in keyword
|
||||||
if (input.contains("ColorsYouCtrl") || input.contains("colorsYouCtrl")) {
|
if (input.contains("ColorsYouCtrl") || input.contains("colorsYouCtrl")) {
|
||||||
final ColorSet colorsYouCtrl = CardUtil.getColorsYouCtrl(controller);
|
final ColorSet colorsYouCtrl = CardUtil.getColorsFromCards(controller.getCardsIn(ZoneType.Battlefield));
|
||||||
|
|
||||||
for (byte color : colorsYouCtrl) {
|
for (byte color : colorsYouCtrl) {
|
||||||
final String colorWord = MagicColor.toLongString(color);
|
final String colorWord = MagicColor.toLongString(color);
|
||||||
|
|||||||
@@ -28,9 +28,7 @@ public class GameSimulationTest extends SimulationTest {
|
|||||||
Game game = initAndCreateGame();
|
Game game = initAndCreateGame();
|
||||||
Player p = game.getPlayers().get(1);
|
Player p = game.getPlayers().get(1);
|
||||||
|
|
||||||
addCard("Plains", p);
|
addCards("Plains", 3, p);
|
||||||
addCard("Plains", p);
|
|
||||||
addCard("Plains", p);
|
|
||||||
String heraldCardName = "Herald of Anafenza";
|
String heraldCardName = "Herald of Anafenza";
|
||||||
Card herald = addCard(heraldCardName, p);
|
Card herald = addCard(heraldCardName, p);
|
||||||
herald.setSickness(false);
|
herald.setSickness(false);
|
||||||
@@ -69,9 +67,7 @@ public class GameSimulationTest extends SimulationTest {
|
|||||||
sliver.setSickness(false);
|
sliver.setSickness(false);
|
||||||
Card herald = addCard(heraldCardName, p);
|
Card herald = addCard(heraldCardName, p);
|
||||||
herald.setSickness(false);
|
herald.setSickness(false);
|
||||||
addCard("Plains", p);
|
addCards("Plains", 3, p);
|
||||||
addCard("Plains", p);
|
|
||||||
addCard("Plains", p);
|
|
||||||
addCard("Spear of Heliod", p);
|
addCard("Spear of Heliod", p);
|
||||||
|
|
||||||
game.getPhaseHandler().devModeSet(PhaseType.MAIN1, p);
|
game.getPhaseHandler().devModeSet(PhaseType.MAIN1, p);
|
||||||
@@ -160,8 +156,7 @@ public class GameSimulationTest extends SimulationTest {
|
|||||||
Game game = initAndCreateGame();
|
Game game = initAndCreateGame();
|
||||||
Player p = game.getPlayers().get(1);
|
Player p = game.getPlayers().get(1);
|
||||||
addCard("Black Knight", p);
|
addCard("Black Knight", p);
|
||||||
for (int i = 0; i < 5; i++)
|
addCards("Swamp", 5, p);
|
||||||
addCard("Swamp", p);
|
|
||||||
|
|
||||||
String merchantCardName = "Gray Merchant of Asphodel";
|
String merchantCardName = "Gray Merchant of Asphodel";
|
||||||
Card c = addCardToZone(merchantCardName, p, ZoneType.Hand);
|
Card c = addCardToZone(merchantCardName, p, ZoneType.Hand);
|
||||||
@@ -614,9 +609,7 @@ public class GameSimulationTest extends SimulationTest {
|
|||||||
Game game = initAndCreateGame();
|
Game game = initAndCreateGame();
|
||||||
Player p = game.getPlayers().get(1);
|
Player p = game.getPlayers().get(1);
|
||||||
|
|
||||||
addCard("Forest", p);
|
addCards("Forest", 3, p);
|
||||||
addCard("Forest", p);
|
|
||||||
addCard("Forest", p);
|
|
||||||
Card callTheScionsCard = addCardToZone("Call the Scions", p, ZoneType.Hand);
|
Card callTheScionsCard = addCardToZone("Call the Scions", p, ZoneType.Hand);
|
||||||
|
|
||||||
game.getPhaseHandler().devModeSet(PhaseType.MAIN1, p);
|
game.getPhaseHandler().devModeSet(PhaseType.MAIN1, p);
|
||||||
@@ -692,9 +685,7 @@ public class GameSimulationTest extends SimulationTest {
|
|||||||
String broodName = "Brood Monitor";
|
String broodName = "Brood Monitor";
|
||||||
|
|
||||||
// enough to cast Chandra's Ignition
|
// enough to cast Chandra's Ignition
|
||||||
for (int i = 0; i < 5; ++i) {
|
addCards("Mountain", 5, p1);
|
||||||
addCard("Mountain", p1);
|
|
||||||
}
|
|
||||||
|
|
||||||
Card kalitas = addCard(kalitasName, p1);
|
Card kalitas = addCard(kalitasName, p1);
|
||||||
Card pridemate = addCard(pridemateName, p1);
|
Card pridemate = addCard(pridemateName, p1);
|
||||||
@@ -749,9 +740,7 @@ public class GameSimulationTest extends SimulationTest {
|
|||||||
String broodName = "Brood Monitor";
|
String broodName = "Brood Monitor";
|
||||||
|
|
||||||
// enough to cast Chandra's Ignition
|
// enough to cast Chandra's Ignition
|
||||||
for (int i = 0; i < 5; ++i) {
|
addCards("Mountain", 5, p1);
|
||||||
addCard("Mountain", p1);
|
|
||||||
}
|
|
||||||
|
|
||||||
Card kalitas = addCard(kalitasName, p1);
|
Card kalitas = addCard(kalitasName, p1);
|
||||||
addCard(pridemateName, p1);
|
addCard(pridemateName, p1);
|
||||||
@@ -808,9 +797,7 @@ public class GameSimulationTest extends SimulationTest {
|
|||||||
String palisadeName = "Palisade Giant";
|
String palisadeName = "Palisade Giant";
|
||||||
|
|
||||||
// enough to cast Chandra's Ignition
|
// enough to cast Chandra's Ignition
|
||||||
for (int i = 0; i < 5; ++i) {
|
addCards("Mountain", 5, p1);
|
||||||
addCard("Mountain", p1);
|
|
||||||
}
|
|
||||||
|
|
||||||
Card kalitas = addCard(kalitasName, p1);
|
Card kalitas = addCard(kalitasName, p1);
|
||||||
Card pridemate = addCard(pridemateName, p1);
|
Card pridemate = addCard(pridemateName, p1);
|
||||||
@@ -875,9 +862,7 @@ public class GameSimulationTest extends SimulationTest {
|
|||||||
String meliraName = "Melira, Sylvok Outcast";
|
String meliraName = "Melira, Sylvok Outcast";
|
||||||
|
|
||||||
// enough to cast Cone of Flame
|
// enough to cast Cone of Flame
|
||||||
for (int i = 0; i < 5; ++i) {
|
addCards("Mountain", 5, p1);
|
||||||
addCard("Mountain", p1);
|
|
||||||
}
|
|
||||||
|
|
||||||
addCard(soulfireName, p1);
|
addCard(soulfireName, p1);
|
||||||
addCard(pridemateName, p1);
|
addCard(pridemateName, p1);
|
||||||
@@ -890,10 +875,7 @@ public class GameSimulationTest extends SimulationTest {
|
|||||||
|
|
||||||
coneSA.setTargetCard(bearCard); // one damage to bear
|
coneSA.setTargetCard(bearCard); // one damage to bear
|
||||||
coneSA.getSubAbility().setTargetCard(giantCard); // two damage to giant
|
coneSA.getSubAbility().setTargetCard(giantCard); // two damage to giant
|
||||||
coneSA.getSubAbility().getSubAbility().getTargets().add(p2); // three
|
coneSA.getSubAbility().getSubAbility().getTargets().add(p2); // three damage to player
|
||||||
// damage
|
|
||||||
// to
|
|
||||||
// player
|
|
||||||
|
|
||||||
game.getPhaseHandler().devModeSet(PhaseType.MAIN2, p1);
|
game.getPhaseHandler().devModeSet(PhaseType.MAIN2, p1);
|
||||||
game.getAction().checkStateEffects(true);
|
game.getAction().checkStateEffects(true);
|
||||||
@@ -906,8 +888,7 @@ public class GameSimulationTest extends SimulationTest {
|
|||||||
Card simGiant = findCardWithName(simGame, giantCardName);
|
Card simGiant = findCardWithName(simGame, giantCardName);
|
||||||
Card simPridemate = findCardWithName(simGame, pridemateName);
|
Card simPridemate = findCardWithName(simGame, pridemateName);
|
||||||
|
|
||||||
// spell deals multiple damages to multiple targets, only one cause of
|
// spell deals multiple damages to multiple targets, only one cause of lifegain
|
||||||
// lifegain
|
|
||||||
AssertJUnit.assertNotNull(simPridemate);
|
AssertJUnit.assertNotNull(simPridemate);
|
||||||
AssertJUnit.assertTrue(simPridemate.hasCounters());
|
AssertJUnit.assertTrue(simPridemate.hasCounters());
|
||||||
AssertJUnit.assertEquals(1, simPridemate.getCounters(CounterEnumType.P1P1));
|
AssertJUnit.assertEquals(1, simPridemate.getCounters(CounterEnumType.P1P1));
|
||||||
@@ -1178,9 +1159,7 @@ public class GameSimulationTest extends SimulationTest {
|
|||||||
String bearName = "Runeclaw Bear";
|
String bearName = "Runeclaw Bear";
|
||||||
String greetingName = "Alchemist's Greeting";
|
String greetingName = "Alchemist's Greeting";
|
||||||
|
|
||||||
for (int i = 0; i < 5; ++i) {
|
addCards("Mountain", 5, p);
|
||||||
addCard("Mountain", p);
|
|
||||||
}
|
|
||||||
|
|
||||||
addCard(soulfireName, p);
|
addCard(soulfireName, p);
|
||||||
addCard(pridemateName, p);
|
addCard(pridemateName, p);
|
||||||
@@ -1243,9 +1222,7 @@ public class GameSimulationTest extends SimulationTest {
|
|||||||
String elementalName = "Air Elemental";
|
String elementalName = "Air Elemental";
|
||||||
String shockName = "Shock";
|
String shockName = "Shock";
|
||||||
|
|
||||||
for (int i = 0; i < 2; ++i) {
|
addCards("Mountain", 3, p);
|
||||||
addCard("Mountain", p);
|
|
||||||
}
|
|
||||||
|
|
||||||
addCard(soulfireName, p);
|
addCard(soulfireName, p);
|
||||||
addCard(pridemateName, p);
|
addCard(pridemateName, p);
|
||||||
@@ -1340,9 +1317,7 @@ public class GameSimulationTest extends SimulationTest {
|
|||||||
addCardToZone("Kalitas, Traitor of Ghet", p, ZoneType.Battlefield);
|
addCardToZone("Kalitas, Traitor of Ghet", p, ZoneType.Battlefield);
|
||||||
addCardToZone("Anointed Procession", p, ZoneType.Battlefield);
|
addCardToZone("Anointed Procession", p, ZoneType.Battlefield);
|
||||||
addCardToZone("Swamp", p, ZoneType.Battlefield);
|
addCardToZone("Swamp", p, ZoneType.Battlefield);
|
||||||
for (int i = 0; i < 4; i++) {
|
addCards("Mountain", 4, p);
|
||||||
addCardToZone("Mountain", p, ZoneType.Battlefield);
|
|
||||||
}
|
|
||||||
|
|
||||||
Card goblin = addCardToZone("Raging Goblin", opp, ZoneType.Battlefield);
|
Card goblin = addCardToZone("Raging Goblin", opp, ZoneType.Battlefield);
|
||||||
Card goblin2 = addCardToZone("Raging Goblin", opp, ZoneType.Battlefield);
|
Card goblin2 = addCardToZone("Raging Goblin", opp, ZoneType.Battlefield);
|
||||||
@@ -1599,9 +1574,7 @@ public class GameSimulationTest extends SimulationTest {
|
|||||||
addCard("Teysa Karlov", p);
|
addCard("Teysa Karlov", p);
|
||||||
addCard("Xathrid Necromancer", p);
|
addCard("Xathrid Necromancer", p);
|
||||||
|
|
||||||
for (int i = 0; i < 4; i++) {
|
addCards("Plains", 4, p);
|
||||||
addCardToZone("Plains", p, ZoneType.Battlefield);
|
|
||||||
}
|
|
||||||
|
|
||||||
Card wrathOfGod = addCardToZone("Wrath of God", p, ZoneType.Hand);
|
Card wrathOfGod = addCardToZone("Wrath of God", p, ZoneType.Hand);
|
||||||
game.getPhaseHandler().devModeSet(PhaseType.MAIN2, p);
|
game.getPhaseHandler().devModeSet(PhaseType.MAIN2, p);
|
||||||
@@ -1780,10 +1753,7 @@ public class GameSimulationTest extends SimulationTest {
|
|||||||
AssertJUnit.assertFalse(giant.isDoubleFaced());
|
AssertJUnit.assertFalse(giant.isDoubleFaced());
|
||||||
AssertJUnit.assertFalse(giant.canTransform(null));
|
AssertJUnit.assertFalse(giant.canTransform(null));
|
||||||
|
|
||||||
addCard("Forest", p);
|
addCards("Forest", 4, p);
|
||||||
addCard("Forest", p);
|
|
||||||
addCard("Forest", p);
|
|
||||||
addCard("Forest", p);
|
|
||||||
addCard("Island", p);
|
addCard("Island", p);
|
||||||
|
|
||||||
Card cytoCard = addCardToZone("Cytoshape", p, ZoneType.Hand);
|
Card cytoCard = addCardToZone("Cytoshape", p, ZoneType.Hand);
|
||||||
@@ -1895,12 +1865,8 @@ public class GameSimulationTest extends SimulationTest {
|
|||||||
Player p = game.getPlayers().get(0);
|
Player p = game.getPlayers().get(0);
|
||||||
game.getPhaseHandler().devModeSet(PhaseType.MAIN1, p);
|
game.getPhaseHandler().devModeSet(PhaseType.MAIN1, p);
|
||||||
|
|
||||||
for (int i = 0; i < 7; i++) {
|
addCards("Plains", 7, p);
|
||||||
addCardToZone("Plains", p, ZoneType.Battlefield);
|
addCards("Island", 7, p);
|
||||||
}
|
|
||||||
for (int i = 0; i < 7; i++) {
|
|
||||||
addCardToZone("Island", p, ZoneType.Battlefield);
|
|
||||||
}
|
|
||||||
|
|
||||||
Card gideon = addCardToZone("Gideon Blackblade", p, ZoneType.Hand);
|
Card gideon = addCardToZone("Gideon Blackblade", p, ZoneType.Hand);
|
||||||
Card sparkDouble = addCardToZone("Spark Double", p, ZoneType.Hand);
|
Card sparkDouble = addCardToZone("Spark Double", p, ZoneType.Hand);
|
||||||
@@ -1926,15 +1892,9 @@ public class GameSimulationTest extends SimulationTest {
|
|||||||
Player p = game.getPlayers().get(0);
|
Player p = game.getPlayers().get(0);
|
||||||
game.getPhaseHandler().devModeSet(PhaseType.MAIN1, p);
|
game.getPhaseHandler().devModeSet(PhaseType.MAIN1, p);
|
||||||
|
|
||||||
for (int i = 0; i < 7; i++) {
|
addCards("Plains", 7, p);
|
||||||
addCardToZone("Plains", p, ZoneType.Battlefield);
|
addCards("Island", 7, p);
|
||||||
}
|
addCards("Forest", 7, p);
|
||||||
for (int i = 0; i < 7; i++) {
|
|
||||||
addCardToZone("Island", p, ZoneType.Battlefield);
|
|
||||||
}
|
|
||||||
for (int i = 0; i < 7; i++) {
|
|
||||||
addCardToZone("Forest", p, ZoneType.Battlefield);
|
|
||||||
}
|
|
||||||
|
|
||||||
Card tgtLand = addCardToZone("Wastes", p, ZoneType.Battlefield);
|
Card tgtLand = addCardToZone("Wastes", p, ZoneType.Battlefield);
|
||||||
|
|
||||||
@@ -1967,12 +1927,8 @@ public class GameSimulationTest extends SimulationTest {
|
|||||||
Player p = game.getPlayers().get(0);
|
Player p = game.getPlayers().get(0);
|
||||||
game.getPhaseHandler().devModeSet(PhaseType.MAIN1, p);
|
game.getPhaseHandler().devModeSet(PhaseType.MAIN1, p);
|
||||||
|
|
||||||
for (int i = 0; i < 7; i++) {
|
addCards("Swamp", 7, p);
|
||||||
addCardToZone("Swamp", p, ZoneType.Battlefield);
|
addCards("Forest", 7, p);
|
||||||
}
|
|
||||||
for (int i = 0; i < 7; i++) {
|
|
||||||
addCardToZone("Forest", p, ZoneType.Battlefield);
|
|
||||||
}
|
|
||||||
|
|
||||||
addCardToZone("Basking Rootwalla", p, ZoneType.Graveyard);
|
addCardToZone("Basking Rootwalla", p, ZoneType.Graveyard);
|
||||||
Card ooze = addCardToZone("Necrotic Ooze", p, ZoneType.Hand);
|
Card ooze = addCardToZone("Necrotic Ooze", p, ZoneType.Hand);
|
||||||
@@ -1996,9 +1952,7 @@ public class GameSimulationTest extends SimulationTest {
|
|||||||
Player p = game.getPlayers().get(0);
|
Player p = game.getPlayers().get(0);
|
||||||
game.getPhaseHandler().devModeSet(PhaseType.MAIN2, p);
|
game.getPhaseHandler().devModeSet(PhaseType.MAIN2, p);
|
||||||
|
|
||||||
for (int i = 0; i < 7; i++) {
|
addCards("Swamp", 7, p);
|
||||||
addCardToZone("Swamp", p, ZoneType.Battlefield);
|
|
||||||
}
|
|
||||||
|
|
||||||
Card epo = addCardToZone("Epochrasite", p, ZoneType.Graveyard);
|
Card epo = addCardToZone("Epochrasite", p, ZoneType.Graveyard);
|
||||||
Card animate = addCardToZone("Animate Dead", p, ZoneType.Hand);
|
Card animate = addCardToZone("Animate Dead", p, ZoneType.Hand);
|
||||||
@@ -2145,9 +2099,7 @@ public class GameSimulationTest extends SimulationTest {
|
|||||||
Card serraAngel = addCardToZone("Serra Angel", p1, ZoneType.Battlefield);
|
Card serraAngel = addCardToZone("Serra Angel", p1, ZoneType.Battlefield);
|
||||||
Card actOfTreason = addCardToZone("Act of Treason", p0, ZoneType.Hand);
|
Card actOfTreason = addCardToZone("Act of Treason", p0, ZoneType.Hand);
|
||||||
Card pathToExile = addCardToZone("Path to Exile", p0, ZoneType.Hand);
|
Card pathToExile = addCardToZone("Path to Exile", p0, ZoneType.Hand);
|
||||||
for (int i = 0; i < 4; i++) {
|
addCards("Plateau", 4, p0);
|
||||||
addCardToZone("Plateau", p0, ZoneType.Battlefield);
|
|
||||||
}
|
|
||||||
addCardToZone("Island", p1, ZoneType.Library);
|
addCardToZone("Island", p1, ZoneType.Library);
|
||||||
addCardToZone("Forest", p0, ZoneType.Library);
|
addCardToZone("Forest", p0, ZoneType.Library);
|
||||||
|
|
||||||
@@ -2182,8 +2134,7 @@ public class GameSimulationTest extends SimulationTest {
|
|||||||
Player p = game.getPlayers().get(0);
|
Player p = game.getPlayers().get(0);
|
||||||
String WCname = "Woodland Champion";
|
String WCname = "Woodland Champion";
|
||||||
addCard(WCname, p);
|
addCard(WCname, p);
|
||||||
for (int i = 0; i < 5; i++)
|
addCards("Island", 5, p);
|
||||||
addCard("Island", p);
|
|
||||||
|
|
||||||
String CardName = "Eternal Skylord";
|
String CardName = "Eternal Skylord";
|
||||||
Card c = addCardToZone(CardName, p, ZoneType.Hand);
|
Card c = addCardToZone(CardName, p, ZoneType.Hand);
|
||||||
@@ -2214,8 +2165,7 @@ public class GameSimulationTest extends SimulationTest {
|
|||||||
String waywardServant = "Wayward Servant";
|
String waywardServant = "Wayward Servant";
|
||||||
String goblin = "Raging Goblin";
|
String goblin = "Raging Goblin";
|
||||||
|
|
||||||
for (int i = 0; i < 8; i++)
|
addCards("Swamp", 8, p);
|
||||||
addCard("Swamp", p);
|
|
||||||
|
|
||||||
Card cardEverAfter = addCardToZone(everAfter, p, ZoneType.Hand);
|
Card cardEverAfter = addCardToZone(everAfter, p, ZoneType.Hand);
|
||||||
Card cardWaywardServant = addCardToZone(waywardServant, p, ZoneType.Graveyard);
|
Card cardWaywardServant = addCardToZone(waywardServant, p, ZoneType.Graveyard);
|
||||||
@@ -2296,9 +2246,7 @@ public class GameSimulationTest extends SimulationTest {
|
|||||||
String alphaBrawlName = "Alpha Brawl";
|
String alphaBrawlName = "Alpha Brawl";
|
||||||
|
|
||||||
// enough to cast Alpha Brawl
|
// enough to cast Alpha Brawl
|
||||||
for (int i = 0; i < 8; ++i) {
|
addCards("Mountain", 8, p2);
|
||||||
addCard("Mountain", p2);
|
|
||||||
}
|
|
||||||
|
|
||||||
Card nishoba = addCard(nishobaName, p1);
|
Card nishoba = addCard(nishobaName, p1);
|
||||||
nishoba.addCounterInternal(CounterEnumType.P1P1, 7, p1, false, null, null);
|
nishoba.addCounterInternal(CounterEnumType.P1P1, 7, p1, false, null, null);
|
||||||
@@ -2366,10 +2314,9 @@ public class GameSimulationTest extends SimulationTest {
|
|||||||
|
|
||||||
Card glarecaster = addCard(glarecasterName, p);
|
Card glarecaster = addCard(glarecasterName, p);
|
||||||
// enough to activate Glarecaster and cast Inferno
|
// enough to activate Glarecaster and cast Inferno
|
||||||
for (int i = 0; i < 7; ++i) {
|
addCards("Plains", 7, p);
|
||||||
addCard("Plains", p);
|
addCards("Mountain", 7, p);
|
||||||
addCard("Mountain", p);
|
|
||||||
}
|
|
||||||
Card infernoCard = addCardToZone("Inferno", p, ZoneType.Hand);
|
Card infernoCard = addCardToZone("Inferno", p, ZoneType.Hand);
|
||||||
SpellAbility infernoSA = infernoCard.getFirstSpellAbility();
|
SpellAbility infernoSA = infernoCard.getFirstSpellAbility();
|
||||||
|
|
||||||
@@ -2407,9 +2354,7 @@ public class GameSimulationTest extends SimulationTest {
|
|||||||
addCard(grumName, p);
|
addCard(grumName, p);
|
||||||
Card mowu = addCardToZone(mowuName, p, ZoneType.Hand);
|
Card mowu = addCardToZone(mowuName, p, ZoneType.Hand);
|
||||||
|
|
||||||
for (int i = 0; i < 7; ++i) {
|
addCards("Forest", 7, p);
|
||||||
addCard("Forest", p);
|
|
||||||
}
|
|
||||||
SpellAbility mowuSA = mowu.getFirstSpellAbility();
|
SpellAbility mowuSA = mowu.getFirstSpellAbility();
|
||||||
|
|
||||||
game.getPhaseHandler().devModeSet(PhaseType.MAIN2, p);
|
game.getPhaseHandler().devModeSet(PhaseType.MAIN2, p);
|
||||||
@@ -2437,10 +2382,8 @@ public class GameSimulationTest extends SimulationTest {
|
|||||||
addCard(grumName, p);
|
addCard(grumName, p);
|
||||||
Card corpsejack = addCardToZone(corpsejackName, p, ZoneType.Hand);
|
Card corpsejack = addCardToZone(corpsejackName, p, ZoneType.Hand);
|
||||||
|
|
||||||
for (int i = 0; i < 7; ++i) {
|
addCards("Forest", 7, p);
|
||||||
addCard("Forest", p);
|
addCards("Swamp", 7, p);
|
||||||
addCard("Swamp", p);
|
|
||||||
}
|
|
||||||
SpellAbility corpsejackSA = corpsejack.getFirstSpellAbility();
|
SpellAbility corpsejackSA = corpsejack.getFirstSpellAbility();
|
||||||
|
|
||||||
game.getPhaseHandler().devModeSet(PhaseType.MAIN2, p);
|
game.getPhaseHandler().devModeSet(PhaseType.MAIN2, p);
|
||||||
@@ -2473,9 +2416,7 @@ public class GameSimulationTest extends SimulationTest {
|
|||||||
|
|
||||||
Card everAfter = addCardToZone(everAfterName, p, ZoneType.Hand);
|
Card everAfter = addCardToZone(everAfterName, p, ZoneType.Hand);
|
||||||
|
|
||||||
for (int i = 0; i < 7; ++i) {
|
addCards("Swamp", 7, p);
|
||||||
addCard("Swamp", p);
|
|
||||||
}
|
|
||||||
SpellAbility everSA = everAfter.getFirstSpellAbility();
|
SpellAbility everSA = everAfter.getFirstSpellAbility();
|
||||||
everSA.getTargets().add(corpsejack);
|
everSA.getTargets().add(corpsejack);
|
||||||
everSA.getTargets().add(mentor);
|
everSA.getTargets().add(mentor);
|
||||||
|
|||||||
@@ -140,7 +140,7 @@ public class SimulationTest {
|
|||||||
|
|
||||||
protected void addCards(String name, int count, Player p) {
|
protected void addCards(String name, int count, Player p) {
|
||||||
for (int i = 0; i < count; i++) {
|
for (int i = 0; i < count; i++) {
|
||||||
addCardToZone(name, p, ZoneType.Battlefield);
|
addCard(name, p);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user