コード例 #1
0
 public void CheckStealCuffs_StealRareUncommon()
 {
     Assert.AreEqual(
         "Rare + Uncommon",
         Steal.CheckStealCuffs(0, 0, 99));
 }
コード例 #2
0
 public void CheckStealCuffs_StealNone()
 {
     Assert.AreEqual(
         "None",
         Steal.CheckStealCuffs(99, 99, 99));
 }
コード例 #3
0
 public void CheckStealCuffs_StealRare()
 {
     Assert.AreEqual(
         "Rare",
         Steal.CheckStealCuffs(0, 99, 99));
 }
コード例 #4
0
 public void CheckStealCuffs_StealCommon()
 {
     Assert.AreEqual(
         "Common",
         Steal.CheckStealCuffs(99, 99, 0));
 }
コード例 #5
0
 public void CheckStealCuffs_StealUncommonCommon()
 {
     Assert.AreEqual(
         "Uncommon + Common",
         Steal.CheckStealCuffs(99, 0, 0));
 }
コード例 #6
0
 public void CheckStealCuffs_StealRareCommon()
 {
     Assert.AreEqual(
         "Rare + Common",
         Steal.CheckStealCuffs(0, 99, 0));
 }
コード例 #7
0
        /// <summary>
        /// The purpose of this method is to display to chest information for the future
        /// based on our current location in the RNG
        /// </summary>
        /// <param name="displayRNG">RNG numbers to use</param>
        /// <param name="start">index where our first matching heal is</param>
        /// <param name="rowsToRender">How many rows to display</param>
        private void displayRNGHelper(int start, int rowsToRender, bool firstLoad)
        {
            //Clear datagridview
            mRngGridData.Clear();

            uint firstRNGVal  = mDispRng.genrand();
            uint secondRNGVal = mDispRng.genrand();
            uint thirdRNGVal  = mDispRng.genrand();
            // We want to preserve the character index, since this loop is just for display:
            int indexStatic = mGroup.GetIndex();

            mGroup.ResetIndex();

            int end = start + rowsToRender;

            for (int index = start; index < end; index++)
            {
                // Index starting at 0
                int loopIndex = index - start;

                // Get the heal value once:
                int currentHeal = mGroup.GetHealValue(firstRNGVal);
                int nextHeal    = mGroup.PeekHealValue(secondRNGVal);

                // Put the next expected heal in the text box
                if (index == start + mHealVals.Count - 1)
                {
                    LastHeal = nextHeal;
                }

                // Advance the RNG before starting the loop in case we want to skip an entry
                uint firstRNGVal_temp  = firstRNGVal;
                uint secondRNGVal_temp = secondRNGVal;
                uint thirdRNGVal_temp  = thirdRNGVal;

                firstRNGVal  = secondRNGVal;
                secondRNGVal = thirdRNGVal;
                thirdRNGVal  = mDispRng.genrand();

                // Skip the entry if it's too long ago
                if (loopIndex < mHealVals.Count - HISTORY_TO_DISPLAY)
                {
                    continue;
                }

                RngDataViewModel rngData = new RngDataViewModel
                {
                    Position   = index,
                    Value      = currentHeal,
                    Percent    = firstRNGVal_temp % 100,
                    Steal      = Steal.CheckSteal(firstRNGVal_temp, secondRNGVal_temp, thirdRNGVal_temp),
                    StealCuffs = Steal.CheckStealCuffs(firstRNGVal_temp, secondRNGVal_temp, thirdRNGVal_temp),
                    OneIn256   = firstRNGVal_temp < 0x1000000
                };
                //Start actually displaying
                RngGridData.Add(rngData);
            }
            mGroup.SetIndex(indexStatic);
            if (RngGridData.Count > 0)
            {
                if (firstLoad)
                {
                    SelectedGridRow = RngGridData.Where(x => x.Position == start).FirstOrDefault();
                }
            }
        }
コード例 #8
0
ファイル: FormSteal.cs プロジェクト: lostlsend/RNGHelper
 private void handleStealCuffs(uint PRNG0, uint PRNG1, uint PRNG2, int column)
 {
     dataGridView1.Rows[dataGridView1.Rows.Count - 1].Cells[column].Value = Steal.CheckStealCuffs(PRNG0, PRNG1, PRNG2);
 }