示例#1
0
        public void Set(EngineInitialization init)
        {
            if (init == null)
            {
                throw new ArgumentNullException(nameof(init));
            }

            Initialization = init;

            Stage = new Stage(this, init.Stage);

            Team1.CreatePlayers(init.Team1Mode, init.Team1P1, init.Team1P2);
            Team2.CreatePlayers(init.Team2Mode, init.Team2P1, init.Team2P2);

            GetSubSystem <Random>().Seed(init.Seed);

            Reset();
        }
示例#2
0
        public void Set(EngineInitialization init)
        {
            if (init == null)
            {
                throw new ArgumentNullException("init");
            }

            m_init = init;

            m_stage = new Stage(this, init.Stage);

            Team1.CreatePlayers(init.P1, null);
            Team2.CreatePlayers(init.P2, null);

            GetSubSystem <Random>().Seed(init.Seed);

            Reset();
        }
示例#3
0
        private void UpdateLogic()
        {
            m_logic.Update();

            if (m_logic.IsFinished())
            {
                if (m_logic is Logic.PreIntro)
                {
                    m_logic = new Logic.ShowCharacterIntro(this);
                    return;
                }

                if (m_logic is Logic.ShowCharacterIntro)
                {
                    m_logic = new Logic.DisplayRoundNumber(this);
                    return;
                }

                if (m_logic is Logic.DisplayRoundNumber)
                {
                    m_logic = new Logic.ShowFight(this);
                    return;
                }

                if (m_logic is Logic.ShowFight)
                {
                    m_logic = new Logic.Fighting(this);
                    return;
                }

                if (m_logic is Logic.Fighting)
                {
                    m_logic = new Logic.CombatOver(this);
                    return;
                }

                if (m_logic is Logic.CombatOver)
                {
                    m_logic = new Logic.ShowWinPose(this);
                    return;
                }

                if (!(m_logic is Logic.ShowWinPose))
                {
                    return;
                }

                if (Team1.Wins.Count >= RoundInformation.NumberOfRounds || Team2.Wins.Count >= RoundInformation.NumberOfRounds)
                {
                    if (Initialization.Mode == CombatMode.Arcade)
                    {
                        var index = Team2.MainPlayer.BasePlayer.Profile.ProfileLoader.PlayerProfiles
                                    .Select(o => o.Profile).ToList()
                                    .IndexOf(Team2.MainPlayer.BasePlayer.Profile) + 1;
                        if (index == Team2.MainPlayer.BasePlayer.Profile.ProfileLoader.PlayerProfiles.Count)
                        {
                            GetMainSystem <Menus.MenuSystem>().PostEvent(new Events.SwitchScreen(ScreenType.Title));
                            m_logic = new Logic.NoMoreFighting(this);
                            return;
                        }

                        RoundNumber = 1;
                        MatchNumber++;

                        // same team 1
                        Team1.Clear();
                        Team1.CreatePlayers(Initialization.Team1Mode, Initialization.Team1P1, Initialization.Team1P2);

                        // update team 2
                        var profile = Team2.MainPlayer.BasePlayer.Profile.ProfileLoader.PlayerProfiles[index].Profile;
                        Team2.Clear();
                        Team2.CreatePlayers(Initialization.Team2Mode,
                                            new PlayerCreation(profile, 0, PlayerMode.Ai),
                                            null);
                        m_logic = new Logic.PreIntro(this);
                        return;
                    }

                    GetMainSystem <Menus.MenuSystem>().PostEvent(new Events.SwitchScreen(ScreenType.Title));
                    m_logic = new Logic.NoMoreFighting(this);
                    return;
                }

                RoundNumber++;
                m_logic = new Logic.PreIntro(this);
            }
        }