mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 19:28:01 +00:00
Re-enabled all the tests and added missing conditions for spellAbilityWithNoStack
This commit is contained in:
@@ -20,7 +20,7 @@ import forge.gamesimulationtests.util.playeractions.testactions.EndTestAction;
|
||||
import forge.gamesimulationtests.util.playeractions.testactions.PlayerAssertAction;
|
||||
|
||||
public class ComprehensiveRulesSection104 extends BaseGameSimulationTest {
|
||||
@Test(enabled = false)
|
||||
@Test
|
||||
public void test_104_2a_player_wins_if_all_opponents_left_even_if_he_couldnt_win() {
|
||||
/*Due to 1's Abyssal Persecutor, he can't win and 2 can't lose (despite the fact that he attempts to draw from an empty deck on turn 2)
|
||||
2 concedes during turn 3 (after 1 drew his last card), and 1 wins after all...*/
|
||||
@@ -36,7 +36,7 @@ public class ComprehensiveRulesSection104 extends BaseGameSimulationTest {
|
||||
runGame( gameWrapper, PlayerSpecification.PLAYER_1, 3 );
|
||||
}
|
||||
|
||||
@Test(enabled = false)
|
||||
@Test
|
||||
public void test_104_2b_effect_may_state_that_player_wins() {
|
||||
GameWrapper gameWrapper = new GameWrapper(
|
||||
new GameStateSpecificationBuilder()
|
||||
@@ -48,7 +48,7 @@ public class ComprehensiveRulesSection104 extends BaseGameSimulationTest {
|
||||
runGame( gameWrapper, PlayerSpecification.PLAYER_2, 2 );
|
||||
}
|
||||
|
||||
@Test(enabled = false)
|
||||
@Test
|
||||
public void test_104_3b_player_with_zero_life_loses_the_game() {
|
||||
GameWrapper gameWrapper = new GameWrapper(
|
||||
new GameStateSpecificationBuilder()
|
||||
@@ -59,7 +59,7 @@ public class ComprehensiveRulesSection104 extends BaseGameSimulationTest {
|
||||
runGame( gameWrapper, PlayerSpecification.PLAYER_1, 1 );
|
||||
}
|
||||
|
||||
@Test(enabled = false)
|
||||
@Test
|
||||
public void test_104_3b_player_with_less_than_zero_life_loses_the_game() {
|
||||
GameWrapper gameWrapper = new GameWrapper(
|
||||
new GameStateSpecificationBuilder()
|
||||
@@ -70,7 +70,7 @@ public class ComprehensiveRulesSection104 extends BaseGameSimulationTest {
|
||||
runGame( gameWrapper, PlayerSpecification.PLAYER_1, 1 );
|
||||
}
|
||||
|
||||
@Test(enabled = false)
|
||||
@Test
|
||||
public void test_104_3b_player_with_less_than_zero_life_loses_the_game_only_when_a_player_receives_priority() {
|
||||
//The Lightning Helix targeting himself theoretically drops him to -1, but he's back up to 2 before he could lose
|
||||
GameWrapper gameWrapper = new GameWrapper(
|
||||
@@ -89,7 +89,7 @@ public class ComprehensiveRulesSection104 extends BaseGameSimulationTest {
|
||||
runGame( gameWrapper, PlayerSpecification.PLAYER_1, 1 );
|
||||
}
|
||||
|
||||
@Test(enabled = false)
|
||||
@Test
|
||||
public void test_104_3b_player_with_less_than_zero_life_loses_the_game_only_when_a_player_receives_priority_variant_with_combat() {
|
||||
//Player 2 has 2 life, then takes 3 combat damage but also gains 2 life from lifelink
|
||||
//TODO: is it actually this rule that makes this situation work, or is combat damage handled simultaneously due to another rule?
|
||||
@@ -114,13 +114,13 @@ public class ComprehensiveRulesSection104 extends BaseGameSimulationTest {
|
||||
runGame( gameWrapper, PlayerSpecification.PLAYER_2, 1 );
|
||||
}
|
||||
|
||||
@Test(enabled = false)
|
||||
@Test
|
||||
public void test_104_3c_player_who_draws_card_with_empty_library_loses() {
|
||||
GameWrapper gameWrapper = new GameWrapper( null, null );
|
||||
runGame( gameWrapper, PlayerSpecification.PLAYER_1, 2 );
|
||||
}
|
||||
|
||||
@Test(enabled = false)
|
||||
@Test
|
||||
public void test_104_3c_player_who_draws_more_cards_than_library_contains_draw_as_much_as_possible_and_loses() {
|
||||
GameWrapper gameWrapper = new GameWrapper(
|
||||
new GameStateSpecificationBuilder()
|
||||
@@ -138,7 +138,7 @@ public class ComprehensiveRulesSection104 extends BaseGameSimulationTest {
|
||||
);
|
||||
}
|
||||
|
||||
@Test(enabled = false)
|
||||
@Test
|
||||
public void test_104_3d_player_with_ten_poison_counters_loses() {
|
||||
GameWrapper gameWrapper = new GameWrapper(
|
||||
new GameStateSpecificationBuilder()
|
||||
@@ -149,7 +149,7 @@ public class ComprehensiveRulesSection104 extends BaseGameSimulationTest {
|
||||
runGame( gameWrapper, PlayerSpecification.PLAYER_1, 1 );
|
||||
}
|
||||
|
||||
@Test(enabled = false)
|
||||
@Test
|
||||
public void test_104_3d_player_with_more_than_ten_poison_counters_loses() {
|
||||
GameWrapper gameWrapper = new GameWrapper(
|
||||
new GameStateSpecificationBuilder()
|
||||
@@ -160,7 +160,7 @@ public class ComprehensiveRulesSection104 extends BaseGameSimulationTest {
|
||||
runGame( gameWrapper, PlayerSpecification.PLAYER_1, 1 );
|
||||
}
|
||||
|
||||
@Test(enabled = false)
|
||||
@Test
|
||||
public void test_104_3e_effect_may_state_that_player_loses() {
|
||||
GameWrapper gameWrapper = new GameWrapper(
|
||||
new GameStateSpecificationBuilder()
|
||||
|
||||
@@ -1,19 +1,9 @@
|
||||
package forge.gamesimulationtests.util;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.commons.lang3.tuple.ImmutablePair;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
import org.testng.collections.Lists;
|
||||
|
||||
import com.google.common.base.Predicate;
|
||||
import com.google.common.collect.Iterables;
|
||||
import com.google.common.collect.ListMultimap;
|
||||
import com.google.common.collect.Multimap;
|
||||
|
||||
import forge.LobbyPlayer;
|
||||
import forge.ai.ComputerUtil;
|
||||
import forge.ai.ComputerUtilMana;
|
||||
@@ -21,6 +11,7 @@ import forge.ai.SpellAbilityAi;
|
||||
import forge.ai.SpellApiToAi;
|
||||
import forge.ai.ability.ChangeZoneAi;
|
||||
import forge.ai.ability.DrawAi;
|
||||
import forge.ai.ability.GameLossAi;
|
||||
import forge.ai.ability.GameWinAi;
|
||||
import forge.card.ColorSet;
|
||||
import forge.card.ICardFace;
|
||||
@@ -33,12 +24,7 @@ import forge.game.GameEntity;
|
||||
import forge.game.GameObject;
|
||||
import forge.game.GameType;
|
||||
import forge.game.ability.AbilityUtils;
|
||||
import forge.game.card.Card;
|
||||
import forge.game.card.CardCollection;
|
||||
import forge.game.card.CardCollectionView;
|
||||
import forge.game.card.CardView;
|
||||
import forge.game.card.CounterEnumType;
|
||||
import forge.game.card.CounterType;
|
||||
import forge.game.card.*;
|
||||
import forge.game.combat.Combat;
|
||||
import forge.game.combat.CombatUtil;
|
||||
import forge.game.cost.Cost;
|
||||
@@ -48,34 +34,29 @@ import forge.game.keyword.KeywordInterface;
|
||||
import forge.game.mana.Mana;
|
||||
import forge.game.mana.ManaConversionMatrix;
|
||||
import forge.game.mana.ManaCostBeingPaid;
|
||||
import forge.game.player.DelayedReveal;
|
||||
import forge.game.player.Player;
|
||||
import forge.game.player.PlayerActionConfirmMode;
|
||||
import forge.game.player.PlayerController;
|
||||
import forge.game.player.PlayerView;
|
||||
import forge.game.player.*;
|
||||
import forge.game.replacement.ReplacementEffect;
|
||||
import forge.game.spellability.AbilitySub;
|
||||
import forge.game.spellability.OptionalCostValue;
|
||||
import forge.game.spellability.Spell;
|
||||
import forge.game.spellability.SpellAbility;
|
||||
import forge.game.spellability.SpellAbilityStackInstance;
|
||||
import forge.game.spellability.TargetChoices;
|
||||
import forge.game.spellability.*;
|
||||
import forge.game.trigger.WrappedAbility;
|
||||
import forge.game.zone.ZoneType;
|
||||
import forge.gamesimulationtests.util.card.CardSpecification;
|
||||
import forge.gamesimulationtests.util.card.CardSpecificationHandler;
|
||||
import forge.gamesimulationtests.util.player.PlayerSpecification;
|
||||
import forge.gamesimulationtests.util.player.PlayerSpecificationHandler;
|
||||
import forge.gamesimulationtests.util.playeractions.ActivateAbilityAction;
|
||||
import forge.gamesimulationtests.util.playeractions.CastSpellFromHandAction;
|
||||
import forge.gamesimulationtests.util.playeractions.DeclareAttackersAction;
|
||||
import forge.gamesimulationtests.util.playeractions.DeclareBlockersAction;
|
||||
import forge.gamesimulationtests.util.playeractions.PlayerActions;
|
||||
import forge.gamesimulationtests.util.playeractions.*;
|
||||
import forge.item.PaperCard;
|
||||
import forge.player.HumanPlay;
|
||||
import forge.util.ITriggerEvent;
|
||||
import forge.util.MyRandom;
|
||||
import forge.util.collect.FCollectionView;
|
||||
import org.apache.commons.lang3.tuple.ImmutablePair;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
import org.testng.collections.Lists;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Default harmless implementation for tests.
|
||||
@@ -120,7 +101,9 @@ public class PlayerControllerForTests extends PlayerController {
|
||||
if (
|
||||
(effectSA.getHostCard().getName().equals("Nefarious Lich") && sai instanceof DrawAi) ||
|
||||
(effectSA.getHostCard().getName().equals("Laboratory Maniac") && sai instanceof GameWinAi) ||
|
||||
(effectSA.getHostCard().getName().equals("Nefarious Lich") && sai instanceof ChangeZoneAi)
|
||||
(effectSA.getHostCard().getName().equals("Nefarious Lich") && sai instanceof ChangeZoneAi) ||
|
||||
(effectSA.getHostCard().getName().equals("Near-Death Experience") && sai instanceof GameWinAi) ||
|
||||
(effectSA.getHostCard().getName().equals("Final Fortune") && sai instanceof GameLossAi)
|
||||
) {//test_104_3f_if_a_player_would_win_and_lose_simultaneously_he_loses
|
||||
HumanPlay.playSpellAbilityNoStack(null, player, effectSA, !mayChoseNewTargets);
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user