Example #1
0
    public void TestExtraPrizeCardEffect()
    {
        Fortune fortune = new Fortune(Fortune.FortuneId.EXTRA_PRIZE_CARD);

        fortune.applyEffect();
        Assert.AreEqual(0, Player.chanceExtraCard);

        fortune.level = 1; fortune.applyEffect();
        Assert.AreEqual(0.25f, Player.chanceExtraCard);

        fortune.level = 2; fortune.applyEffect();
        Assert.AreEqual(0.5f, Player.chanceExtraCard);

        fortune.level = 3; fortune.applyEffect();
        Assert.AreEqual(0.625f, Player.chanceExtraCard);

        fortune.level = 10; fortune.applyEffect();
        Assert.AreEqual(0.863f, Player.chanceExtraCard, 0.001f);

        /*for (int i=0; i <100; i++)
         * {
         *  fortune.level = i; fortune.applyEffect();
         *  Debug.Log(Player.chanceExtraCard);
         * }*/
    }
Example #2
0
    public void TestQuickStartEffect()
    {
        Fortune fortune = new Fortune(Fortune.FortuneId.QUICK_START);

        for (int i = 0; i <= 10; i++)
        {
            fortune.level = i; fortune.applyEffect();
            Assert.AreEqual(i + 1, Player.firstTurnDiceMultiplier);
        }

        fortune.level = 20; fortune.applyEffect();
        Assert.AreEqual(24, Player.firstTurnDiceMultiplier);

        fortune.level = 100; fortune.applyEffect();
        Assert.AreEqual(10101, Player.firstTurnDiceMultiplier, 1d);
    }
Example #3
0
    public void TestLowerCeilEffect()
    {
        Fortune fortune = new Fortune(Fortune.FortuneId.LOWER_CEIL);

        /*for (int i=0; i < 500; i++)
         * {
         *  fortune.level = i; fortune.applyEffect();
         *  Debug.Log(Player.maxRoll);
         * }*/

        fortune.level = 0; fortune.applyEffect();
        Assert.AreEqual(1000, Player.maxRoll);

        fortune.level = 1; fortune.applyEffect();
        Assert.AreEqual(950, Player.maxRoll);

        fortune.level = 5; fortune.applyEffect();
        Assert.AreEqual(833, Player.maxRoll);

        fortune.level = 50; fortune.applyEffect();
        Assert.AreEqual(470, Player.maxRoll);

        fortune.level = 100; fortune.applyEffect();
        Assert.AreEqual(301, Player.maxRoll);

        fortune.level = 200; fortune.applyEffect();
        Assert.AreEqual(100, Player.maxRoll);

        fortune.level = 500; fortune.applyEffect();
        Assert.AreEqual(100, Player.maxRoll);
    }
Example #4
0
    public void TestRegenEffect()
    {
        Fortune fortune = new Fortune(Fortune.FortuneId.REGEN);

        Player.initialHealth = 150;

        fortune.level = 0; Player.health = 150; fortune.applyEffect(); Player.applyRegen();
        Assert.AreEqual(150, Player.health);

        fortune.level = 1; Player.health = 150; fortune.applyEffect(); Player.applyRegen();
        Assert.AreEqual(153, Player.health);

        fortune.level = 2; Player.health = 150; fortune.applyEffect(); Player.applyRegen();
        Assert.AreEqual(157, Player.health);

        fortune.level = 5; Player.health = 150; fortune.applyEffect(); Player.applyRegen();
        Assert.AreEqual(168, Player.health);
    }
Example #5
0
    public void TestEnduranceEffect()
    {
        Fortune fortune = new Fortune(Fortune.FortuneId.ENDURANCE);

        fortune.level = 0; fortune.applyEffect();
        Assert.AreEqual(30, Player.initialHealth);

        fortune.level = 1; fortune.applyEffect();
        Assert.AreEqual(35, Player.initialHealth);

        fortune.level = 5; fortune.applyEffect();
        Assert.AreEqual(64, Player.initialHealth);

        fortune.level = 10; fortune.applyEffect();
        Assert.AreEqual(140, Player.initialHealth);

        fortune.level = 50; fortune.applyEffect();
        Assert.AreEqual(66751, Player.initialHealth);
    }
Example #6
0
    public void TestShieldEffect()
    {
        Fortune fortune = new Fortune(Fortune.FortuneId.SHIELD);

        fortune.level = 0; fortune.applyEffect();
        Assert.AreEqual(0, Player.shields);
        Assert.AreEqual(150, Player.applyShieldDamageReduction(150));

        fortune.level = 1; fortune.applyEffect();
        Assert.AreEqual(.051f, Player.shields, 1E-3f);
        Assert.AreEqual(142, Player.applyShieldDamageReduction(150));

        fortune.level = 2; fortune.applyEffect();
        Assert.AreEqual(.1f, Player.shields, 1E-5f);
        Assert.AreEqual(135, Player.applyShieldDamageReduction(150));

        fortune.level = 3; fortune.applyEffect();
        Assert.AreEqual(.146f, Player.shields, 1E-3f);
        Assert.AreEqual(128, Player.applyShieldDamageReduction(150));

        fortune.level = 10; fortune.applyEffect();
        Assert.AreEqual(.409f, Player.shields, 1E-3f);
        Assert.AreEqual(89, Player.applyShieldDamageReduction(150));
    }