Пример #1
0
        public static void MakeStep(Game g, bool needRoll = true)
        {
            //g.logp("rolls {0} {1}", g.LastRoll);
            if (g.State != GameState.BeginStep) return;

            var p = g.Curr;

            if (p.IsBot && BotBrain.BeforeRollMakeBotAction(g)) return;

            g.CleanTimeOut();

            if (needRoll)
                GameManager.MakeRoll(g);

            bool CanGo = true;

            if (p.Pos == 10 && p.Police > 0)
            {
                CanGo = CanOutFromPolice(g);
                if (p.Police == 4) return;
            }

            if (CanGo)
            {
                var NotTrippleRoll = g.Curr.Step();

                if (NotTrippleRoll)
                {
                    ProcessPosition(g);
                }
                else
                {
                    g.Tlogp("step.TripleRoll", "вы выкинули тройной дубль, вас задержала милиция", "you roll triple, go to POLICE");
                    g.FinishStep();
                }
            }
            else
            {
                g.FinishStep();
            }
        }
Пример #2
0
        public static void MakeAuctionYes(Game g, string userName)
        {
            var pl = g.GetPlayer(userName);

            if (pl == null) return;

            //StartAction(g);
            g.CleanTimeOut();

            var mm = g.GetPlayerCash(pl.Id);

            var LastBiddedPlayer = g.currAuction.LastBiddedPlayer;

            if (LastBiddedPlayer != null)
            {
                if (LastBiddedPlayer.Id == pl.Id) return;
            }

            if (mm >= g.currAuction.nextBid)
            {
                g.currAuction.currBid += 50000;
                g.Tlog("Auction.Yes", "@p{0} дает {1}", "@p{0} bid {1}", pl.Id, g.currAuction.currBid.PrintMoney());
                g.currAuction.LastBiddedPlayer = pl;

            }
            else
            {
                g.Tlog("PlayerAction.AuctionYes.NoMoney", "@p{0} не хватает денег ", "@p{0} no money", pl.Id);
                pl.InAuction = false;
            }
            //GameManager.CheckAuctionWinner(g);
        }