@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()); }
@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()); // 骑士守护无法防御物理致死攻击 }
@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()); }
/** 骑士守护无法防御斩杀 */ @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()); }
/** 骑士守护无法减少燕返伤害 */ @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()); }
@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()); }
@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()); }
/** 零伤害不会触发大地之盾 */ @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.晕眩)); }
@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()); /* 光明之龙的横扫被正面圣盾抵挡,无法溅射 */ }
@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()); }
/** 如果鲜血盛宴被反弹怎无法加血,被弹死的话就死了 */ @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()); }
/** 大地之盾能被脱困 */ @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()); }
/** 横扫为溅射 */ @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()); }
/** 连锁攻击能够被冰甲阻挡 */ @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()); }
/** 横扫为溅射 */ @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()); }
/** 骑士守护无法防御精神狂乱 */ @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()); }
/** 燕返不会触发逃跑 */ @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()); }
@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()); }
@Test public void test骑士守护_魔法_烈焰风暴() { SkillTestContext context = prepare(50, 50, "占位符+烈焰风暴10", "占位符+骑士守护*2"); context.addToField(0, 0); CardInfo c占位符2 = context.addToField(1, 1); CardInfo c占位符3 = context.addToField(2, 1); context.startGame(); random.addNextPicks(0, 1).addNextNumbers(0, 0); // 烈焰风暴10 context.proceedOneRound(); int damage = 250 / 2 /* 烈焰风暴被挡住一半伤害 */; Assert.assertEquals(damage, 5000 - c占位符2.getHP()); Assert.assertEquals(damage, 5000 - c占位符3.getHP()); }
/** 连锁攻击被正面闪避的话就无法触发 */ @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(); random.addNextNumbers(0); // 大剑圣1闪避麒麟兽攻击成功 random.addNextNumbers(1000); // 假设大剑圣2闪避麒麟兽攻击失败 context.proceedOneRound(); Assert.assertEquals(0, 995 - c大剑圣1.getHP()); Assert.assertEquals(0, 995 - c大剑圣2.getHP()); }
@Test public void test逃跑_多只() { SkillTestContext context = prepare(50, 50, "秘银巨石像*3", "占位符+逃跑*6"); context.addToField(0, 0); context.addToField(1, 0); context.addToField(2, 0); context.addToField(3, 1); context.addToField(4, 1); context.addToField(5, 1); context.addToHand(6, 1); context.addToHand(7, 1); context.addToHand(8, 1); context.startGame(); context.proceedOneRound(); Assert.assertEquals(0, context.getPlayer(1).getField().size()); Assert.assertEquals(5, context.getPlayer(1).getHand().size()); Assert.assertEquals(1, context.getPlayer(1).getDeck().size()); Assert.assertEquals(0, context.getPlayer(1).getGrave().size()); }
/* * 弱点攻击无法破解水流护甲 */ @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()); }
@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()); }
/* * 水流护甲和格挡是相同发动时机,结算顺序按技能顺序来 */ @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()); }
/* * 水流护甲无法防御燕返 */ @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()); }
/* * 即使英雄在回合中被杀死,仍能在本回合被水流护甲救回 */ @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()); }
@Test public void test逃跑_杀死_圣炎() { SkillTestContext context = prepare(50, 50, "秘银巨石像+圣炎", "占位符+逃跑"); context.addToField(0, 0); context.addToField(1, 1).setBasicHP(2); context.startGame(); context.proceedOneRound(); Assert.assertEquals(0, context.getPlayer(1).getField().size()); Assert.assertEquals(0, context.getPlayer(1).getHand().size()); Assert.assertEquals(0, context.getPlayer(1).getDeck().size()); Assert.assertEquals(1, context.getPlayer(1).getGrave().size()); Assert.assertEquals(0, context.getPlayer(1).getOutField().size()); }
@Test public void test圣盾_基本() { SkillTestContext context = prepare(50, 50, "秘银巨石像", "混元大师"); context.addToField(0, 0); CardInfo c混元大师 = context.addToHand(1, 1).setSummonDelay(0); context.startGame(); context.proceedOneRound(); context.proceedOneRound(); context.proceedOneRound(); Assert.assertEquals(0, 1690 - c混元大师.getHP()); // 被圣盾完全防御 context.proceedOneRound(); context.proceedOneRound(); Assert.assertEquals(660, 1690 - c混元大师.getHP()); // 圣盾只能用一次 }
@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()); }
@Test public void test逃跑_转生() { SkillTestContext context = prepare(50, 50, "秘银巨石像", "淘气灯灵+逃跑"); context.addToField(0, 0); context.addToField(1, 1).setBasicHP(2); context.startGame(); random.addNextNumbers(0); // 灯灵转生 context.proceedOneRound(); Assert.assertEquals(0, context.getPlayer(1).getField().size()); Assert.assertEquals(1, context.getPlayer(1).getHand().size()); Assert.assertEquals(0, context.getPlayer(1).getDeck().size()); Assert.assertEquals(0, context.getPlayer(1).getGrave().size()); Assert.assertEquals(0, context.getPlayer(1).getOutField().size()); }