@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()); }
@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水流护甲_弱点攻击() 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, "秘银巨石像", "叹惋之歌+格挡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逃跑_物理伤害_杀死() { 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()); }
/* * 即使英雄在回合中被杀死,仍能在本回合被水流护甲救回 */ @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水流护甲_燕返() 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, "秘银巨石像", "淘气灯灵+逃跑"); 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()); }
/** 圣盾转生后又可用 */ @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()); // 转生后圣盾也只能用一次 }
/** 手牌满时送回卡堆 */ @Test public void test逃跑_手牌满() { SkillTestContext context = prepare(50, 50, "秘银巨石像", "占位符+逃跑", "金属巨龙*5"); context.addToField(0, 0); context.addToField(1, 1); context.addToHand(2, 1); context.addToHand(3, 1); context.addToHand(4, 1); context.addToHand(5, 1); context.addToHand(6, 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()); }
@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, "时光女神+逃跑-15", "末日预言师"); CardInfo c时光女神逃 = context.addToDeck(0, 0); context.addToDeck(1, 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(); Assert.assertEquals(1, context.getPlayer(1).getField().size()); // 6回合被打回手牌 Assert.assertEquals(0, context.getPlayer(0).getField().size()); Assert.assertEquals((4 - 1), c时光女神逃.getSummonDelay()); }
/** 燕返不会触发逃跑 */ @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, "秘银巨石像+火球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()); }
/** 魔法伤害不会触发逃跑 */ @Test public void test逃跑_魔法伤害() { SkillTestContext context = prepare(50, 50, "秘银巨石像+火球1", "占位符", "占位符+逃跑"); context.addToField(0, 0); context.addToField(1, 1); CardInfo c占位符2 = context.addToField(2, 1); context.startGame(); random.addNextPicks(1).addNextNumbers(0); // 火球1 context.proceedOneRound(); Assert.assertEquals(2, context.getPlayer(1).getField().size()); Assert.assertEquals(0, context.getPlayer(1).getHand().size()); Assert.assertEquals(25, 5000 - c占位符2.getHP()); }
/** 鲜血盛宴可能发动到一半被弹死,这时候剩余的对象不发动 */ @Test public void test鲜血盛宴_法力反射_多对象() { SkillTestContext context = prepare(50, 50, "占位符+鲜血盛宴1", "秘银巨石像*2", "占位符"); CardInfo c占位符1 = context.addToField(0, 0).setBasicHP(200); CardInfo c秘银巨石像1 = context.addToField(1, 1); CardInfo c秘银巨石像2 = context.addToField(2, 1); CardInfo c占位符2 = context.addToField(3, 1); context.startGame(); random.addNextPicks(0, 1, 2); context.proceedOneRound(); Assert.assertEquals(1400, c秘银巨石像1.getHP()); Assert.assertEquals(1400, c秘银巨石像2.getHP()); // 占位符1已经被第二个秘银巨石像弹死,无法继续发动鲜血盛宴到占位符2 Assert.assertEquals(5000, c占位符2.getHP()); Assert.assertEquals(0, context.getPlayer(0).getField().size()); Assert.assertTrue(c占位符1.isDead()); }