Exemplo n.º 1
0
        private static BuyReelSummaryData BuyReel(int level, int purchaseReel, ReelGemResult priorSpinResult)
        {
            var summData = new BuyReelSummaryData {
                TotalBet           = 0,
                IsContinuosBuyReel = true,
                SpinCounter        = 1
            };
            var user = new UserGameKey(-1, GameId)
            {
                Level = level
            };
            var requestContext      = user.CreateRequestContext <SpinArgs>("monkeysmash");
            var bonusRequestcontext = user.CreateRequestContext <BonusArgs>("monkeysmash");

            requestContext.Parameters = new SpinArgs {
                LineBet    = 1,
                Multiplier = 1
            };
            summData.TotalBet = priorSpinResult.ReelRespinCredits[purchaseReel];
            var result = ReelGemsEngine.BuyReel(level, purchaseReel, priorSpinResult, requestContext);

            summData.TotalWin = result.Win;
            if (result.HasBonus)
            {
                var freeSpinResult = ExecuteFreeSpin(level, bonusRequestcontext, result);
                summData.FSTotalWin        += freeSpinResult.TotalWin;
                summData.IsContinuosBuyReel = false;
            }
            return(summData);
        }
Exemplo n.º 2
0
        public void ReSpinMode(int level, int purchaseReel, int numItrPerUser, string stringWheel)
        {
            var sdt      = DateTime.Now;
            var summData = new SummaryData {
                SpinCounter = numItrPerUser,
                TotalBet    = 0
            };
            var spin = new SpinArgs {
                LineBet    = 1,
                Multiplier = 1
            };
            var user = new UserGameKey(-1, GameId)
            {
                Level = level
            };
            var requestContext = user.CreateRequestContext <SpinArgs>("monkeysmash");

            requestContext.Parameters = spin;
            var bonusRequestcontext = user.CreateRequestContext <BonusArgs>("monkeysmash");
            var reels           = Utilities.Encoding(stringWheel);
            var priorSpinResult = new ReelGemResult()
            {
                Wheel             = Utilities.Encoding(stringWheel, 5, 3),
                ReelRespinCredits = ReelGemsEngine.CalcWagerCost(level, reels)
            };

            foreach (var item in new sbyte[numItrPerUser])
            {
                summData.TotalBet += priorSpinResult.ReelRespinCredits[purchaseReel];
                var result = ReelGemsEngine.BuyReel(level, purchaseReel, priorSpinResult, requestContext);
                Assert.NotNull(result);
                summData.TotalWin += result.Win;
                if (result.HasBonus)
                {
                    var freeSpinResult = ExecuteFreeSpin(level, bonusRequestcontext, result);
                    summData.FSTotalWin += freeSpinResult.TotalWin;
                }
            }
            PrintResult(level, sdt, DateTime.Now, summData, TestContext.CurrentContext.Test.Name);
        }
Exemplo n.º 3
0
        public void FullCycle(int level, decimal spinBet)
        {
            var strips = Slot.Games.FortuneChimes.Configuration.Config.MainGameReelStrip[0];
            var reel1  = strips[0];
            var reel2  = strips[1];
            var reel3  = strips[2];
            var reel4  = strips[3];
            var reel5  = strips[4];
            var user   = new UserGameKey(-1, 109)
            {
                Level = level
            };
            var summData = new SummaryData();
            var sdt      = DateTime.Now;
            var spinArgs = new SpinArgs
            {
                LineBet    = spinBet,
                Multiplier = 1
            };
            var request = user.CreateRequestContext <SpinArgs>("fortunechimes");

            for (int i1 = 0; i1 < reel1.Count; i1++)
            {
                for (int i2 = 0; i2 < reel2.Count; i2++)
                {
                    for (int i3 = 0; i3 < reel3.Count; i3++)
                    {
                        for (int i4 = 0; i4 < reel4.Count; i4++)
                        {
                            for (int i5 = 0; i5 < reel5.Count; i5++)
                            {
                                request.Parameters = spinArgs;
                                var r1 = reel1.TakeCircular(i1, 3).ToArray();
                                var r2 = reel2.TakeCircular(i2, 3).ToArray();
                                var r3 = reel3.TakeCircular(i3, 3).ToArray();
                                var r4 = reel4.TakeCircular(i4, 3).ToArray();
                                var r5 = reel5.TakeCircular(i5, 3).ToArray();
                                if (i1 == 2 && i2 == i3 && i3 == i4 && i4 == 9)
                                {
                                }
                                var wheel = new FortuneChimesWheel
                                {
                                    Reels = new List <int[]> {
                                        r1, r2, r3, r4, r5
                                    },
                                    Indices = new int[] { i1, i2, i3, i4, i5 }
                                };
                                summData.SpinCounter++;
                                summData.TotalBet += Slot.Games.FortuneChimes.Configuration.Config.Lines * spinBet;
                                var result        = GameReduce.DoSpin(level, request, wheel);
                                var scatterPayout = result.WinPositions.Where(ele => ele.Line == 0 && ele.Symbol == 10).Sum(item => item.Win);
                                summData.MainGameScatterWin     += scatterPayout;
                                summData.MainGameNoneScatterWin += result.Win - scatterPayout;
                                if (scatterPayout > 0)
                                {
                                    summData.MgFHit++;
                                }
                                if (result.HasBonus)
                                {
                                    var bonus        = result.Bonus;
                                    var bonusRequest = user.CreateRequestContext <BonusArgs>("fortunechimes");
                                    var typeOfBonus  = bonus.ClientId;
                                    switch (typeOfBonus)
                                    {
                                    case 4:
                                    case 5:
                                        summData.MgExplodingHit++;
                                        break;

                                    case 3:
                                        summData.MgFHit++;
                                        break;

                                    default:
                                        throw new Exception();
                                    }
                                    summData += ExecuteBonus(level, bonusRequest, result);
                                }
                            }
                        }
                    }
                }
            }

            var edt        = DateTime.Now;
            var oldOut     = Console.Out;
            var fileStream = new FileStream($@"..\..\..\Results\FortuneChimes\{TestContext.CurrentContext.Test.Name}.txt", FileMode.OpenOrCreate, FileAccess.Write);
            var writer     = new StreamWriter(fileStream);

            Console.SetOut(writer);
            Console.WriteLine(String.Format("Test.Level                  : {0}", level));
            Console.WriteLine(String.Format("Test.TimeStart              : {0} {1}", sdt.ToShortDateString(), sdt.ToLongTimeString()));
            Console.WriteLine(String.Format("Test.TimeEnd                : {0} {1}", edt.ToShortDateString(), edt.ToLongTimeString()));
            Console.WriteLine(String.Format("SpinCount                   : {0}", summData.SpinCounter));
            Console.WriteLine(String.Format("TotalBet                    : {0,12:0.00}", summData.TotalBet));
            Console.WriteLine("----------------------------------------");
            Console.WriteLine(String.Format("Exploding Hit Rate     (MG) : {0,12:0.00}", summData.MgExplodingHitRate));
            Console.WriteLine(String.Format("MG Feature Hit Rate         : {0,12:0.00}", summData.MgFHitRate));
            Console.WriteLine(String.Format("MG Scatter ReSpin Hit       : {0,12:0.00}", summData.MgScatterReSpinFHit));
            Console.WriteLine(String.Format("MG None Scatter ReSpin Hit  : {0,12:0.00}", summData.MgNoneScatterReSpinFHit));
            Console.WriteLine(String.Format("MG ReSpin Feature Hit Rate  : {0,12:0.00}", summData.MgReSpinFHitRate));

            //Console.WriteLine(String.Format("MG Avg Feature Hit Rate     : {0,12:0.00}", summData));
            Console.WriteLine(String.Format("Exploding Feature Hit Rate  : {0,12:0.00}", summData.MgExplodingFHitRate));
            Console.WriteLine(String.Format("Exploding Hit Rate     (FG) : {0,12:0.00}", summData.FgExplodingHitRate));
            Console.WriteLine(String.Format("Reveal Hit Rate        (FG) : {0,12:0.00}", summData.FgRevealHitRate));
            Console.WriteLine(String.Format("MG Scatter Win              : {0,12:0.00}", summData.MainGameScatterWin));
            Console.WriteLine(String.Format("MG None Scatter Win         : {0,12:0.00}", summData.MainGameNoneScatterWin));
            Console.WriteLine(String.Format("MG ReSpin Scatter Win       : {0,12:0.00}", summData.MgScatterExplodingWin));
            Console.WriteLine(String.Format("MG ReSpin None Scatter Win  : {0,12:0.00}", summData.MgNonScatterExplodingWin));
            Console.WriteLine(String.Format("MG Reveal Win               : {0,12:0.00}", summData.MgRevealWin));
            Console.WriteLine(String.Format("FG Win                      : {0,12:0.00}", summData.FSTotalWin));
            Console.WriteLine(String.Format("FG Exploding Win            : {0,12:0.00}", summData.FgExplodingWin));
            Console.WriteLine(String.Format("FG Reveal Win               : {0,12:0.00}", summData.FgRevealWin));
            Console.WriteLine("----------------------------------------");
            if (summData.TotalBet > 0)
            {
                Console.WriteLine(String.Format("MG Scatter RTP             : {0,11:0.00000000000000000000000000}%", 100 * summData.MainGameScatterWin / summData.TotalBet));
                Console.WriteLine(String.Format("MG None Scatter RTP        : {0,11:0.00000000000000000000000000}%", 100 * summData.MainGameNoneScatterWin / summData.TotalBet));
                Console.WriteLine(String.Format("MG ReSpin Scatter RTP      : {0,11:0.00000000000000000000000000}%", 100 * summData.MgScatterExplodingWin / summData.TotalBet));
                Console.WriteLine(String.Format("MG ReSpin None Scatter RTP : {0,11:0.00000000000000000000000000}%", 100 * summData.MgNonScatterExplodingWin / summData.TotalBet));
                Console.WriteLine(String.Format("MG Reveal  RTP             : {0,11:0.00000000000000000000000000}%", 100 * summData.MgRevealWin / summData.TotalBet));

                Console.WriteLine(String.Format("FG RTP                     : {0,11:0.00}%", 100 * summData.FSTotalWin / summData.TotalBet));
                Console.WriteLine(String.Format("FG Exploding RTP           : {0,11:0.00}%", 100 * summData.FgExplodingWin / summData.TotalBet));
                Console.WriteLine(String.Format("FG Reveal RTP              : {0,11:0.00}%", 100 * summData.FgRevealWin / summData.TotalBet));
            }
            Console.WriteLine("--- RTP.OverAll ------------------------");
            Console.WriteLine(String.Format("RTP.Total (Over All)      : {0,11:0.0000}%", 100 * summData.RTPOverAll));

            Console.SetOut(oldOut);
            writer.Close();
            fileStream.Close();

            Console.WriteLine($"Max Collapse {maxCollapse}");
            Console.WriteLine("Done");
        }