Package smack.down

Examples of smack.down.Base


  public WayOfDeception() {
    super("Way of Deception", Faction.Ninjas, Target.Minion);
  }
 
  public void play(final Minion minion, Callback callback) {
    Base base = callback.selectBaseInPlay("Select destination", true, new Callback.Predicate<Base>() {
      public boolean eval(Base arg) {
        return arg != minion.getBase();
      }
    });
   
    minion.getBase().removeMinion(minion);
    minion.setBase(base);
    base.addMinion(minion);
  }
View Full Code Here


    m3.setOwner(player1);
    Minion m4 = new Minion("TestMinion4", Faction.Aliens, 3);
    m4.setOwner(player1);
    Minion m5 = new Minion("TestMinion5", Faction.Aliens, 6);
    m5.setOwner(player1);
    Base base1 = new Base("TestBase", Faction.Aliens, 50, 3, 2, 1);
    Base base2 = new Base("TestBase", Faction.Aliens, 40, 3, 2, 1);
    base1.addMinion(m1);
    base1.addMinion(m2);
    base1.addMinion(m5);
    base2.addMinion(m3);
    base2.addMinion(m4);
    Table table = new Table(Arrays.asList(player1), new ArrayList<Base>(), Arrays.asList(base1, base2));
    player1.setTable(table);
    Action action = new Howl();
    action.setOwner(player1);
   
View Full Code Here

  }
 
  @Test
  public void testWarRaptor() {
    Player player1 = new Player("TestPlayer", new CardList(), new CardSet(), new CardSet());
    Base base1 = new Base("TestBase", Faction.Aliens, 50, 3, 2, 1);
    Minion m1 = (Minion) new WarRaptor().setOwner(player1);
    Minion m2 = (Minion) new WarRaptor().setOwner(player1);
    Minion m3 = (Minion) new WarRaptor().setOwner(player1);
    Minion m4 = (Minion) new WarRaptor().setOwner(player1);
   
    assertEquals(2, m1.getStrength());
    assertEquals(2, m2.getStrength());
    assertEquals(2, m3.getStrength());
    assertEquals(2, m4.getStrength());
    assertEquals(0, base1.getTotalStrength(player1));
   
    base1.addMinion(m1);
    m1.setBase(base1);
   
    assertEquals(3, m1.getStrength());
    assertEquals(2, m2.getStrength());
    assertEquals(2, m3.getStrength());
    assertEquals(2, m4.getStrength());
    assertEquals(3, base1.getTotalStrength(player1));
   
    base1.addMinion(m2);
    m2.setBase(base1);
   
    assertEquals(4, m1.getStrength());
    assertEquals(4, m2.getStrength());
    assertEquals(2, m3.getStrength());
    assertEquals(2, m4.getStrength());
    assertEquals(8, base1.getTotalStrength(player1));
   
    base1.addMinion(m3);
    m3.setBase(base1);
   
    assertEquals(5, m1.getStrength());
    assertEquals(5, m2.getStrength());
    assertEquals(5, m3.getStrength());
    assertEquals(2, m4.getStrength());
    assertEquals(15, base1.getTotalStrength(player1));
   
    base1.addMinion(m4);
    m4.setBase(base1);
   
    assertEquals(6, m1.getStrength());
    assertEquals(6, m2.getStrength());
    assertEquals(6, m3.getStrength());
    assertEquals(6, m4.getStrength());
    assertEquals(24, base1.getTotalStrength(player1));
   
    base1.removeMinion(m1);
    m1.setBase(null);
   
    assertEquals(2, m1.getStrength());
    assertEquals(5, m2.getStrength());
    assertEquals(5, m3.getStrength());
    assertEquals(5, m4.getStrength());
    assertEquals(15, base1.getTotalStrength(player1));
  }
View Full Code Here

 
  @Test
  public void testArmorStego() {
    Player player1 = new Player("TestPlayer1", new CardList(), new CardSet(), new CardSet());
    Player player2 = new Player("TestPlayer2", new CardList(), new CardSet(), new CardSet());
    Base base1 = new Base("TestBase", Faction.Aliens, 50, 3, 2, 1);
    Minion m1 = (Minion) new ArmorStego().setOwner(player1);
   
    Table table = new Table(Arrays.asList(player1, player2), new ArrayList<Base>(), Arrays.asList(base1));
    player1.setTable(table);
    player2.setTable(table);
   
    assertEquals(3, m1.getStrength());
   
    base1.addMinion(m1);
    m1.setBase(base1);
   
    assertEquals(3, m1.getStrength());
   
    table.nextPlayer();
View Full Code Here

 
  @Test
  public void testLaseratops() {
    Player player1 = new Player("TestPlayer1", new CardList(), new CardSet(), new CardSet());
    Player player2 = new Player("TestPlayer2", new CardList(), new CardSet(), new CardSet());
    Base base1 = new Base("TestBase", Faction.Aliens, 50, 3, 2, 1);
    Table table = new Table(Arrays.asList(player1, player2), new ArrayList<Base>(), Arrays.asList(base1));
    player1.setTable(table);
    player2.setTable(table);
    Minion m1 = (Minion) new Laseratops().setOwner(player1);
    final Minion m2 = (Minion) new Minion("TestMinion1", Faction.Aliens, 2).setOwner(player2);
    base1.addMinion(m2);
    m2.setBase(base1);
   
    assertEquals(1, base1.getMinions().size());
    assertTrue(base1.getMinions().contains(m2));
    assertFalse(player2.getDiscardPile().contains(m2));
   
    m1.play(base1, new Callback() {
      public Minion selectMinionInPlay(Base base, int strengthLimit) {
        return m2;
      }
    });
   
    assertEquals(0, base1.getMinions().size());
    assertTrue(player2.getDiscardPile().contains(m2));
  }
View Full Code Here

    super("Sea Dogs", Faction.Pirates, Target.Base);
  }
 
  public void play(Base base, Callback callback) {
    Faction faction = callback.selectFaction();
    Base destBase = callback.selectBaseInPlay("Select destination Base", false, Callback.anyOtherBase(base));
   
    for (Minion minion : base.getMinions())
      if (minion.getFaction() == faction)
        minion.setBase(destBase);
  }
View Full Code Here

    return false;
  }
 
  public void play(Player player, Callback callback) {
    Minion minion = (Minion) callback.selectFromDiscard("Select Minion", false, Callback.minionPredicate(strengthLimit));
    Base base = callback.selectBaseInPlay("Select Base", false, Callback.truePredicate(new Base[0]));
    base.addMinion(minion);
  }
View Full Code Here

    return false;
  }
 
  public void play(Player player, Callback callback) {
    Minion minion = (Minion) callback.selectCardFromHand("Select Minion", false, Callback.minionPredicate(strengthLimit));
    Base base = callback.selectBaseInPlay("Select Base", false, Callback.truePredicate(new Base[0]));
    base.addMinion(minion);
  }
View Full Code Here

TOP

Related Classes of smack.down.Base

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.