Esempio n. 1
0
  /** 圣盾转生后又可用 */
  @Test
  public void test圣盾_转生() {
    SkillTestContext context = prepare(50, 50, "秘银巨石像-15", "混元大师+转生10");
    context.addToField(0, 0);
    CardInfo c混元大师 = context.addToField(1, 1);
    context.startGame();

    context.proceedOneRound();
    Assert.assertEquals(0, 1560 - c混元大师.getHP()); // 被圣盾完全防御

    context.getStage().setActivePlayerNumber(0); // 强制混元大师继续挨打

    context.proceedOneRound();
    Assert.assertEquals(810, 1560 - c混元大师.getHP()); // 圣盾只能用一次

    context.getStage().setActivePlayerNumber(0); // 强制混元大师继续挨打
    random.addNextNumbers(0); // 混元大师转生成功
    context.proceedOneRound();
    Assert.assertEquals(0, context.getPlayer(1).getField().size()); // 混元大师应该被打死了

    c混元大师.setSummonDelay(0);
    context.proceedOneRound();
    Assert.assertEquals(1560 + 300 /* 神圣守护 */, c混元大师.getHP());

    context.proceedOneRound();
    Assert.assertEquals(0, 1560 + 300 - c混元大师.getHP()); // 被圣盾再次完全防御

    context.getStage().setActivePlayerNumber(0); // 强制混元大师继续挨打

    context.proceedOneRound();
    Assert.assertEquals(810, 1560 + 300 - c混元大师.getHP()); // 转生后圣盾也只能用一次
  }
Esempio n. 2
0
 @Test
 public void test逃跑_横扫() {
   SkillTestContext context = prepare(120, 50, "末日预言师+逃跑-15", "占位符", "占位符", "战场女武神");
   CardInfo c末日逃 = context.addToDeck(0, 0);
   context.addToDeck(1, 0);
   context.addToDeck(2, 1);
   context.addToDeck(3, 1);
   context.getEngine().getStage().getRule().setDeckOrder(1);
   context.startGame();
   context.proceedOneRound();
   context.proceedOneRound();
   context.proceedOneRound();
   context.proceedOneRound();
   context.proceedOneRound();
   // 5回合后,逃跑时光下来
   Assert.assertEquals(1, context.getPlayer(0).getField().size());
   Assert.assertEquals(0, context.getPlayer(1).getField().size());
   context.proceedOneRound();
   // 6回合占位符没有攻击力,无法触发逃跑
   Assert.assertEquals(1, context.getPlayer(0).getField().size());
   context.proceedOneRound();
   context.proceedOneRound();
   Assert.assertEquals(2, context.getPlayer(1).getField().size());
   // 6回合被打回手牌
   Assert.assertEquals(1, context.getPlayer(0).getField().size());
   Assert.assertEquals((3 - 1), c末日逃.getSummonDelay());
 }
Esempio n. 3
0
  @Test
  public void test骑士守护_基本() {
    SkillTestContext context = prepare(50, 50, "秘银巨石像", "占位符+骑士守护");
    context.addToField(0, 0);
    CardInfo c占位符 = context.addToField(1, 1);
    context.startGame();

    context.proceedOneRound();
    Assert.assertEquals(660 / 2 /* 骑士守护减半伤害 */, 5000 - c占位符.getHP());
  }
Esempio n. 4
0
  @Test
  public void test骑士守护_物理攻击_致死() {
    SkillTestContext context = prepare(50, 50, "秘银巨石像", "残血王国小兵+骑士守护");
    context.addToField(0, 0);
    CardInfo c残血王国小兵 = context.addToField(1, 1).setBasicHP(10);
    context.startGame();

    context.proceedOneRound();
    Assert.assertTrue(c残血王国小兵.isDead()); // 骑士守护无法防御物理致死攻击
  }
Esempio n. 5
0
  @Test
  public void test反击_灵巧() {
    SkillTestContext context = prepare(50, 50, "圣泉元神", "占位符+反击10");
    CardInfo c圣泉元神 = context.addToField(0, 0);
    context.addToField(1, 1);
    context.startGame();

    context.proceedOneRound();
    Assert.assertEquals(0, 1900 - c圣泉元神.getHP());
  }
Esempio n. 6
0
  @Test
  public void test逃跑_基本() {
    SkillTestContext context = prepare(50, 50, "秘银巨石像", "占位符+逃跑");
    context.addToField(0, 0);
    context.addToField(1, 1);
    context.startGame();

    context.proceedOneRound();
    Assert.assertEquals(0, context.getPlayer(1).getField().size());
    Assert.assertEquals(1, context.getPlayer(1).getHand().size());
  }
Esempio n. 7
0
 @Test
 public void test水流护甲_未超额() {
   SkillTestContext context = prepare(50, 50, "魔剑士", "占位符+水流护甲10");
   context.addToField(0, 0);
   CardInfo c占位符 = context.addToField(1, 1);
   context.getPlayer(1).setHP(100);
   context.startGame();
   context.proceedOneRound();
   Assert.assertEquals(150, 5000 - c占位符.getHP());
   Assert.assertEquals(100 + (225 - 150), context.getPlayer(1).getHP());
 }
Esempio n. 8
0
  @Test
  public void test骑士守护_魔法攻击_杀死() {
    SkillTestContext context = prepare(50, 50, "占位符+血炼10", "残血王国小兵+骑士守护");
    context.addToField(0, 0);
    CardInfo c残血王国小兵 = context.addToField(1, 1).setBasicHP(1);
    context.startGame();

    random.addNextPicks(0); // 血炼10
    context.proceedOneRound();
    Assert.assertTrue(c残血王国小兵.isDead());
  }
Esempio n. 9
0
 /*
  * 弱点攻击无法破解水流护甲
  */
 @Test
 public void test水流护甲_弱点攻击() throws HeroDieSignal {
   SkillTestContext context = prepare(50, 50, "秘银巨石像+弱点攻击", "占位符+水流护甲1");
   context.addToField(0, 0);
   CardInfo c占位符 = context.addToField(1, 1);
   context.getPlayer(1).setHP(100);
   context.startGame();
   context.proceedOneRound();
   Assert.assertEquals(600, 5000 - c占位符.getHP());
   Assert.assertEquals(100 + 50, context.getPlayer(1).getHP());
 }
Esempio n. 10
0
 @Test
 public void test守护_残血() throws HeroDieSignal {
   SkillTestContext context = prepare(50, 50, "占位符", "秘银巨石像", "占位符+守护");
   context.addToField(0, 0);
   context.addToField(1, 0);
   CardInfo c守护占位符 = context.addToField(2, 1);
   context.getPlayer(1).setHP(10);
   context.startGame();
   context.proceedOneRound();
   Assert.assertEquals(10, 5000 - c守护占位符.getHP());
 }
Esempio n. 11
0
  /** 骑士守护无法减少燕返伤害 */
  @Test
  public void test骑士守护_燕返() {
    SkillTestContext context = prepare(50, 50, "秘银巨石像+骑士守护", "魔剑士+燕返");
    CardInfo c秘银巨石像 = context.addToField(0, 0);
    CardInfo c魔剑士 = context.addToField(1, 1);
    c魔剑士.setBasicHP(2);
    context.startGame();

    context.proceedOneRound();
    Assert.assertEquals(275 * 2 /* 燕返伤害无法被减免 */, 1550 - c秘银巨石像.getHP());
  }
Esempio n. 12
0
  /** 骑士守护无法防御斩杀 */
  @Test
  public void test骑士守护_斩杀() {
    SkillTestContext context = prepare(50, 50, "秘银巨石像+斩杀", "占位符+骑士守护");
    context.addToField(0, 0);
    CardInfo c占位符 = context.addToField(1, 1);
    c占位符.setBasicHP(1000);
    context.startGame();

    context.proceedOneRound();
    Assert.assertTrue(c占位符.isDead());
  }
Esempio n. 13
0
  @Test
  public void test种族之盾_基本() {
    SkillTestContext context = prepare(50, 50, "金属巨龙", "恶灵之剑");
    context.addToField(0, 0);
    CardInfo c恶灵之剑 = context.addToField(1, 1);
    context.startGame();

    random.addNextNumbers(1000); // 金属巨龙暴击失败
    context.proceedOneRound();
    Assert.assertEquals(328 /* 被地狱之盾挡住50%伤害 */, 1350 - c恶灵之剑.getHP());
  }
Esempio n. 14
0
  /** 零伤害不会触发大地之盾 */
  @Test
  public void test大地之盾_零伤害() {
    SkillTestContext context = prepare(50, 50, "占位符", "占位符+大地之盾");
    CardInfo c占位符1 = context.addToField(0, 0);
    context.addToField(1, 1);
    context.startGame();

    context.proceedOneRound();
    Assert.assertEquals(5000, c占位符1.getHP());
    Assert.assertFalse(c占位符1.getStatus().containsStatus(CardStatusType.晕眩));
  }
Esempio n. 15
0
  @Test
  public void test圣盾_横扫_完全抵挡() {
    SkillTestContext context = prepare(50, 50, "光明之龙", "混元大师-15", "占位符");
    context.addToField(0, 0);
    context.addToField(1, 1);
    CardInfo c占位符 = context.addToField(2, 1);
    context.startGame();

    context.proceedOneRound();
    Assert.assertEquals(0, 5000 - c占位符.getHP()); /* 光明之龙的横扫被正面圣盾抵挡,无法溅射 */
  }
Esempio n. 16
0
  /** 横扫为溅射 */
  @Test
  public void test横扫_格挡() {
    SkillTestContext context = prepare(50, 50, "光明之龙", "牛头人酋长*2");
    context.addToField(0, 0);
    CardInfo c牛头人酋长1 = context.addToField(1, 1);
    CardInfo c牛头人酋长2 = context.addToField(2, 1);
    context.startGame();

    context.proceedOneRound();
    Assert.assertEquals(630 - 140 /* 格挡 */, 1050 - c牛头人酋长1.getHP());
    Assert.assertEquals((630 - 140) /* 先算溅射伤害 */ - 140 /* 2号位酋长的格挡 */, 1050 - c牛头人酋长2.getHP());
  }
Esempio n. 17
0
  @Test
  public void test圣盾_横扫_溅射破盾() {
    SkillTestContext context = prepare(50, 50, "光明之龙", "秘银巨石像", "占位符", "混元大师-15");
    context.addToField(0, 0);
    context.addToField(1, 0);
    context.addToField(2, 1);
    CardInfo c混元大师 = context.addToField(3, 1);
    context.startGame();

    context.proceedOneRound();
    Assert.assertEquals(660, 1560 - c混元大师.getHP()); /* 光明之龙的横扫被圣盾抵挡破盾,秘银巨石像的攻击有效 */
  }
Esempio n. 18
0
  /** 横扫的溅射伤害按照被格挡后的伤害算 */
  @Test
  public void test种族之盾_横扫() {
    SkillTestContext context = prepare(50, 50, "震源岩蟾", "半鹿人号角手", "占位符");
    context.addToField(0, 0);
    CardInfo c半鹿人号角手 = context.addToField(1, 1);
    CardInfo c占位符 = context.addToField(2, 1);
    context.startGame();

    context.proceedOneRound();
    Assert.assertEquals(620 * 60 / 100, 1270 - c半鹿人号角手.getHP());
    Assert.assertEquals(620 * 60 / 100, 5000 - c占位符.getHP());
  }
Esempio n. 19
0
  /** 大地之盾能被脱困 */
  @Test
  public void test大地之盾_脱困() {
    SkillTestContext context = prepare(50, 50, "皇室舞者-1", "怒雪咆哮-1");
    CardInfo c皇室舞者 = context.addToField(0, 0);
    CardInfo c怒雪咆哮 = context.addToField(1, 1);
    context.startGame();

    random.addNextNumbers(1000); // 金属巨龙不暴击
    context.proceedOneRound();
    Assert.assertFalse(c皇室舞者.getStatus().containsStatus(CardStatusType.晕眩));
    Assert.assertEquals(234, 1703 - c怒雪咆哮.getHP());
  }
Esempio n. 20
0
  /** 骑士守护无法防御精神狂乱 */
  @Test
  public void test骑士守护_精神狂乱() {
    SkillTestContext context = prepare(50, 50, "占位符+精神狂乱", "秘银巨石像", "占位符+骑士守护");
    context.addToField(0, 0);
    context.addToField(1, 1);
    CardInfo c占位符2 = context.addToField(2, 1);
    context.startGame();

    random.addNextPicks(0); // 精神狂乱
    context.proceedOneRound();
    Assert.assertEquals(660, 5000 - c占位符2.getHP());
  }
Esempio n. 21
0
  /** 如果鲜血盛宴被反弹怎无法加血,被弹死的话就死了 */
  @Test
  public void test鲜血盛宴_法力反射() {
    SkillTestContext context = prepare(50, 50, "占位符+鲜血盛宴1", "秘银巨石像");
    CardInfo c占位符 = context.addToField(0, 0).setBasicHP(500);
    CardInfo c秘银巨石像 = context.addToField(1, 1);
    context.startGame();

    random.addNextPicks(0);
    context.proceedOneRound();
    Assert.assertEquals(1400, c秘银巨石像.getHP());
    Assert.assertEquals(500 - 180 /* 法力反射6 */, c占位符.getHP());
  }
Esempio n. 22
0
  /*
   * 水流护甲和格挡是相同发动时机,结算顺序按技能顺序来
   */
  @Test
  public void test水流护甲_格挡() {
    SkillTestContext context = prepare(50, 50, "秘银巨石像", "叹惋之歌+格挡5");
    context.addToField(0, 0);
    CardInfo c叹惋之歌 = context.addToField(1, 1);
    context.getPlayer(1).setHP(100);
    context.startGame();
    context.proceedOneRound();

    Assert.assertEquals(100 + 300 /* 水流护甲6,格挡掉的部分不会影响水流护甲的回复量 */, context.getPlayer(1).getHP());
    Assert.assertEquals(350 /* 水流护甲6 */ - 100 /* 格挡5 */, 2205 - c叹惋之歌.getHP());
  }
Esempio n. 23
0
  /** 连锁攻击能够被冰甲阻挡 */
  @Test
  public void test连锁攻击_冰甲() {
    SkillTestContext context = prepare(50, 50, "麒麟兽", "战斗猛犸象*2");
    context.addToField(0, 0);
    CardInfo c战斗猛犸象1 = context.addToField(1, 1);
    CardInfo c战斗猛犸象2 = context.addToField(2, 1);
    context.startGame();

    context.proceedOneRound();
    Assert.assertEquals(120 /* 冰甲 */, 1220 - c战斗猛犸象1.getHP());
    Assert.assertEquals(120 /* 冰甲 */, 1220 - c战斗猛犸象2.getHP());
  }
Esempio n. 24
0
  /** 横扫为溅射 */
  @Test
  public void test横扫_冰甲() {
    SkillTestContext context = prepare(50, 50, "光明之龙", "战斗猛犸象", "秘银巨石像");
    context.addToField(0, 0);
    CardInfo c战斗猛犸象 = context.addToField(1, 1);
    CardInfo c秘银巨石像 = context.addToField(2, 1);
    context.startGame();

    context.proceedOneRound();
    Assert.assertEquals(120 /* 冰甲 */, 1220 - c战斗猛犸象.getHP());
    Assert.assertEquals(120 /* 溅射 */, 1400 - c秘银巨石像.getHP());
  }
Esempio n. 25
0
  @Test
  public void test盾刺_灵巧() {
    SkillTestContext context = prepare(50, 50, "圣泉元神", "秘银巨石像", "占位符+盾刺10", "占位符+盾刺10");
    CardInfo c圣泉元神 = context.addToField(0, 0);
    CardInfo c秘银巨石像 = context.addToField(1, 0);
    context.addToField(2, 1);
    context.addToField(3, 1);
    context.startGame();

    context.proceedOneRound();
    Assert.assertEquals(0, 1900 - c圣泉元神.getHP());
    Assert.assertEquals(400 /* 圣泉横扫被盾刺 */ + 200 /* 秘银自己攻击被盾刺 */, 1400 - c秘银巨石像.getHP());
  }
Esempio n. 26
0
 /*
  * 水流护甲无法防御燕返
  */
 @Test
 public void test水流护甲_燕返() throws HeroDieSignal {
   SkillTestContext context = prepare(50, 50, "秘银巨石像+水流护甲1", "魔剑士+燕返");
   CardInfo c秘银巨石像 = context.addToField(0, 0);
   CardInfo c魔剑士 = context.addToField(1, 1);
   c魔剑士.setBasicHP(1);
   context.getPlayer(1).setHP(100);
   context.startGame();
   context.proceedOneRound();
   Assert.assertTrue(c魔剑士.isDead());
   Assert.assertEquals(100 /* 水流护甲面对燕返无效 */, context.getPlayer(1).getHP());
   Assert.assertEquals(275 * 2, 1550 - c秘银巨石像.getHP());
 }
Esempio n. 27
0
  @Test
  public void test骑士守护_魔法攻击_致死() {
    SkillTestContext context = prepare(50, 50, "占位符+血炼10*2", "残血王国小兵+骑士守护");
    context.addToField(0, 0);
    context.addToField(1, 0);
    CardInfo c残血王国小兵 = context.addToField(2, 1).setBasicHP(7);
    context.startGame();

    random.addNextPicks(0, 0); // 血炼10
    context.proceedOneRound();
    Assert.assertEquals(1 /* 法术致死伤害按剩余血量一半算 */, c残血王国小兵.getHP());
    Assert.assertFalse(c残血王国小兵.isDead());
  }
Esempio n. 28
0
  /** 魔法伤害能杀死逃跑卡 */
  @Test
  public void test逃跑_魔法伤害_杀死() {
    SkillTestContext context = prepare(50, 50, "秘银巨石像+火球1", "占位符+逃跑");
    context.addToField(0, 0);
    CardInfo c占位符 = context.addToField(1, 1).setBasicHP(2);
    context.startGame();

    random.addNextPicks(0).addNextNumbers(0); // 火球1
    context.proceedOneRound();
    Assert.assertEquals(0, context.getPlayer(1).getField().size());
    Assert.assertEquals(0, context.getPlayer(1).getHand().size());
    Assert.assertTrue(c占位符.isDead());
  }
Esempio n. 29
0
  /** 燕返不会触发逃跑 */
  @Test
  public void test逃跑_燕返() {
    SkillTestContext context = prepare(50, 50, "秘银巨石像+逃跑", "秘银巨石像+燕返");
    CardInfo c秘银巨石像1 = context.addToField(0, 0).setBasicHP(2);
    CardInfo c秘银巨石像2 = context.addToField(1, 1).setBasicHP(2);
    context.startGame();

    context.proceedOneRound();
    Assert.assertEquals(0, context.getPlayer(0).getField().size());
    Assert.assertEquals(0, context.getPlayer(0).getHand().size());
    Assert.assertTrue(c秘银巨石像1.isDead());
    Assert.assertTrue(c秘银巨石像2.isDead());
  }
Esempio n. 30
0
  /*
   * 即使英雄在回合中被杀死,仍能在本回合被水流护甲救回
   */
  @Test
  public void test水流护甲_复活英雄() {
    SkillTestContext context = prepare(50, 50, "秘银巨石像+魔神之咒10", "占位符+水流护甲10");
    context.addToField(0, 0);
    CardInfo c占位符 = context.addToField(1, 1);
    context.getPlayer(1).setHP(100);
    context.startGame();
    context.proceedOneRound();

    random.addNextPicks(0);
    Assert.assertEquals(500, context.getPlayer(1).getHP());
    Assert.assertEquals(150, 5000 - c占位符.getHP());
  }