package cfvbaibai.cardfantasy.test;

import org.junit.After;
import org.junit.Assert;
import org.junit.Test;

import cfvbaibai.cardfantasy.StaticRandomizer;
import cfvbaibai.cardfantasy.engine.CardInfo;
import cfvbaibai.cardfantasy.engine.RuneInfo;

public class DefenseTest {
    private static StaticRandomizer random = FeatureValidationTests.getRandom();

    @After
    public void afterTest() {
        random.reset();
    }

    /**
     * 多重冰甲效果只取最强力的那个
     */
    @Test
    public void test冰封_冰甲() {
        FeatureTestContext context = FeatureValidationTests.prepare(50, 50, "金属巨龙-1", "战斗猛犸象", "冰封");
        context.addToField(0, 0);
        CardInfo c战斗猛犸象 = context.addToField(1, 1);
        RuneInfo r冰封 = context.addToRune(0, 1);
        context.getStage().gameStarted();

        r冰封.activate();
        random.addNextNumbers(1000); // 金属巨龙不暴击
        context.getEngine().proceedOneRound();

        Assert.assertEquals(100 /* 猛犸象的冰甲7被冰封的冰甲9覆盖 */, 1220 - c战斗猛犸象.getHP());
    }
}

@@ -758,30 +758,17 @@
 ext.
-getStage().gameStarted
+startGame
 ();%0A
@@ -860,20 +860,8 @@
 ext.
-getEngine().
 proc
@@ -962,10 +962,942 @@
 ;%0A    %7D%0A
+    %0A    @Test%0A    public void test%E6%A0%BC%E6%8C%A1_%E5%86%B0%E5%B0%81() %7B%0A        FeatureTestContext context = FeatureValidationTests.prepare(50, 50, %22%E7%A7%98%E9%93%B6%E5%B7%A8%E7%9F%B3%E5%83%8F%22, %22%E9%87%91%E5%B1%9E%E5%B7%A8%E9%BE%99%22, %22%E5%86%B0%E5%B0%81%22);%0A        context.addToField(0, 0);%0A        CardInfo c%E9%87%91%E5%B1%9E%E5%B7%A8%E9%BE%99 = context.addToField(1, 1);%0A        RuneInfo r%E5%86%B0%E5%B0%81 = context.addToRune(0, 1);%0A        context.startGame();%0A%0A        r%E5%86%B0%E5%B0%81.activate();%0A        context.proceedOneRound();%0A%0A        Assert.assertEquals(100 /* %E9%87%91%E5%B1%9E%E5%B7%A8%E9%BE%99%E7%9A%84%E6%A0%BC%E6%8C%A18%E5%85%88%E7%BB%93%E7%AE%97%EF%BC%8C%E5%86%8D%E7%BB%93%E7%AE%97%E5%86%B0%E5%B0%81%E7%9A%84%E5%86%B0%E7%94%B29 */, 1710 - c%E9%87%91%E5%B1%9E%E5%B7%A8%E9%BE%99.getHP());%0A    %7D%0A%0A    @Test%0A    public void test%E5%B2%A9%E5%A3%81_%E5%86%B0%E7%94%B2() %7B%0A        FeatureTestContext context = FeatureValidationTests.prepare(50, 50, %22%E7%A7%98%E9%93%B6%E5%B7%A8%E7%9F%B3%E5%83%8F%22, %22%E5%87%A4%E5%87%B0+%E5%86%B0%E7%94%B21%22, %22%E5%B2%A9%E5%A3%81-1%22);%0A        context.addToField(0, 0);%0A        CardInfo c%E5%86%B0%E7%94%B2%E5%87%A4%E5%87%B0 = context.addToField(1, 1);%0A        RuneInfo r%E5%B2%A9%E5%A3%81 = context.addToRune(0, 1);%0A        context.startGame();%0A        %0A        r%E5%B2%A9%E5%A3%81.activate();%0A        context.proceedOneRound();%0A        %0A        Assert.assertEquals(180 - 120 /* %E7%8C%9B%E7%8A%B8%E7%9A%84%E5%86%B0%E7%94%B2%E5%85%88%E7%BB%93%E7%AE%97%EF%BC%8C%E7%84%B6%E5%90%8E%E7%BB%93%E7%AE%97%E5%B2%A9%E5%A3%81 */, 1690 - c%E5%86%B0%E7%94%B2%E5%87%A4%E5%87%B0.getHP());%0A    %7D%0A
 %7D%0A

Add test岩壁_冰甲 and test格挡_冰封