コード例 #1
0
        public void TestGreatStridesDuration()
        {
            GreatStrides   greatStrides = new GreatStrides();
            BasicSynthesis basicSynth   = new BasicSynthesis();

            State state = Utility.CreateDefaultState();

            state.Quality       = 142;
            state.MaxQuality    = 726;
            state.Progress      = 0;
            state.MaxProgress   = 100;
            state.Durability    = 100;
            state.MaxDurability = 100;
            state.CrafterLevel  = 16;
            state.SynthLevel    = 13;
            state.Craftsmanship = 105;
            state.Control       = 102;
            state.Condition     = Condition.Normal;
            state.CP            = 55;
            state.MaxCP         = 233;

            Assert.IsTrue(greatStrides.CanUse(state));
            state = greatStrides.Activate(state, true);
            for (uint i = greatStrides.Duration; i > 0; --i)
            {
                Assert.AreEqual <uint>(i, GreatStrides.GetTurnsRemaining(state));
                state = basicSynth.Activate(state, true);
            }
            Assert.AreEqual <uint>(0U, GreatStrides.GetTurnsRemaining(state));
        }
コード例 #2
0
        public void TestGreatStridesRemovedImmediatelyOnTouch()
        {
            GreatStrides greatStrides = new GreatStrides();
            BasicTouch   basicTouch   = new BasicTouch();

            State state = Utility.CreateDefaultState();

            state.Quality       = 142;
            state.MaxQuality    = 726;
            state.Progress      = 0;
            state.MaxProgress   = 100;
            state.Durability    = 20;
            state.MaxDurability = 40;
            state.CrafterLevel  = 16;
            state.SynthLevel    = 13;
            state.Craftsmanship = 105;
            state.Control       = 102;
            state.Condition     = Condition.Normal;
            state.CP            = 55;
            state.MaxCP         = 233;

            Assert.IsTrue(greatStrides.CanUse(state));

            state = greatStrides.Activate(state, true);
            Assert.AreEqual <uint>(3U, GreatStrides.GetTurnsRemaining(state));
            state = basicTouch.Activate(state, true);
            Assert.AreEqual <uint>(0U, GreatStrides.GetTurnsRemaining(state));
        }
コード例 #3
0
        public void TestSubsequentAbilitiesStillTickAfterOneWearsOff()
        {
            Manipulation manipulation = new Manipulation();
            GreatStrides strides      = new GreatStrides();
            BasicTouch   touch        = new BasicTouch();

            State state = Utility.CreateDefaultState();

            state.Durability = 20;
            State s2 = strides.Activate(state, true);

            s2 = manipulation.Activate(s2, true);

            GreatStrides.SetTurnsRemaining(s2, 1);

            s2 = touch.Activate(s2, true);
            // Make sure Manipulation still ticked even though great strides wore off.
            Assert.AreEqual <uint>(20, s2.Durability);
        }