コード例 #1
0
        protected override void OnClockEnd()
        {
            nCurrentRound += 1;

            if (bEnd)
            {
                EndEvent();
                return;
            }

            var remaining = 0;

            if (QR.Equals("0"))
            {
                CloseRegistration();
                remaining = Users.Count;
            }
            else             // if (nCurrentRound <= MAX_ROUNDS)
            {
                KillRandomPlatform();

                foreach (var user in Users)
                {
                    if (user.Stats.nHP <= 0)
                    {
                        continue;
                    }

                    remaining += 1;

                    user.Modify.GainNX(nCurrentRound * 100);
                }
            }

            if (nCurrentRound > MAX_ROUNDS)
            {
                SetWeather("Congratulations all winners!");
                DistributeRewards(Users.Where(user => user.Stats.nHP > 0).ToList());
                CreateFieldClock(5);                 // warp out timer
                bEnd = true;
            }
            else
            {
                CreateFieldClock(20);
                var sRoundText = nCurrentRound == MAX_ROUNDS ? "Last round!" : $"Round {nCurrentRound} of {MAX_ROUNDS}.";
                SetWeather($"{sRoundText} Pick a stage! Players remaining: " + remaining);
            }
        }