Exemplo n.º 1
0
        public FightEngine(SubSystems subsystems)
            : base(subsystems)
        {
            var textfile    = GetSubSystem <IO.FileSystem>().OpenTextFile(@"data/fight.def");
            var filesection = textfile.GetSection("Files");
            var basepath    = GetSubSystem <IO.FileSystem>().GetDirectory(textfile.Filepath);

            Entities         = new EntityCollection(this);
            Pause            = new Pause(this, false);
            SuperPause       = new Pause(this, true);
            Assertions       = new EngineAssertions();
            Camera           = new Camera(this);
            EnvironmentColor = new EnvironmentColor(this);
            EnvironmentShake = new EnvironmentShake(this);
            Speed            = GameSpeed.Normal;
            Fonts            = BuildFontMap(filesection);
            FightSounds      = GetSubSystem <Audio.SoundSystem>().CreateManager(BuildPath(basepath, filesection.GetAttribute <string>("snd")));
            CommonSounds     = GetSubSystem <Audio.SoundSystem>().CreateManager(BuildPath(basepath, filesection.GetAttribute <string>("common.snd")));
            FightSprites     = GetSubSystem <Drawing.SpriteSystem>().CreateManager(BuildPath(basepath, filesection.GetAttribute <string>("sff")));
            FxSprites        = GetSubSystem <Drawing.SpriteSystem>().CreateManager(BuildPath(basepath, filesection.GetAttribute <string>("fightfx.sff")));
            FightAnimations  = GetSubSystem <Animations.AnimationSystem>().CreateManager(textfile.Filepath);
            FxAnimations     = GetSubSystem <Animations.AnimationSystem>().CreateManager(BuildPath(basepath, filesection.GetAttribute <string>("fightfx.air")));
            Elements         = new Elements.Collection(FightSprites, FightAnimations, FightSounds, Fonts);
            RoundInformation = new RoundInformation(this, textfile);
            Team1            = new Team(this, TeamSide.Left);
            Team2            = new Team(this, TeamSide.Right);
            m_combatcheck    = new CombatChecker(this);
            m_logic          = new Logic.PreIntro(this);
            Clock            = new Clock(this);
        }
Exemplo n.º 2
0
        void UpdateLogic()
        {
            m_logic.Update();

            if (m_logic.IsFinished() == true)
            {
                if (m_logic is Logic.PreIntro)
                {
                    m_logic = new Logic.ShowCharacterIntro(this);
                }
                else if (m_logic is Logic.ShowCharacterIntro)
                {
                    m_logic = new Logic.DisplayRoundNumber(this);
                }
                else if (m_logic is Logic.DisplayRoundNumber)
                {
                    m_logic = new Logic.ShowFight(this);
                }
                else if (m_logic is Logic.ShowFight)
                {
                    m_logic = new Logic.Fighting(this);
                }
                else if (m_logic is Logic.Fighting)
                {
                    m_logic = new Logic.CombatOver(this);
                }
                else if (m_logic is Logic.CombatOver)
                {
                    m_logic = new Logic.ShowWinPose(this);
                }
                else if (m_logic is Logic.ShowWinPose)
                {
                    if (Team1.Wins.Count >= RoundInformation.NumberOfRounds || Team2.Wins.Count >= RoundInformation.NumberOfRounds)
                    {
                        GetMainSystem <Menus.MenuSystem>().PostEvent(new Events.SwitchScreen(ScreenType.Title));
                        m_logic = new Logic.NoMoreFighting(this);
                    }
                    else
                    {
                        RoundNumber += 1;
                        m_logic      = new Logic.PreIntro(this);
                    }
                }
            }
        }
Exemplo n.º 3
0
        public void Reset()
        {
            m_logic           = new Logic.PreIntro(this);
            m_slowspeedbuffer = 0;
            TickCount         = 0;
            Speed             = GameSpeed.Normal;

            MatchNumber = 1;
            RoundNumber = 1;

            FightSounds.Stop();
            CommonSounds.Stop();

            Stage.Reset();
            Camera.Reset();
            Pause.Reset();
            SuperPause.Reset();
            Assertions.Reset();
            EnvironmentColor.Reset();
            EnvironmentShake.Reset();
            Elements.Reset();
        }
Exemplo n.º 4
0
        public void Reset()
        {
            m_logic = new Logic.PreIntro(this);
            m_slowspeedbuffer = 0;
            m_tickcount = 0;
            Speed = GameSpeed.Normal;

            RoundNumber = 1;

            FightSounds.Stop();
            CommonSounds.Stop();

			Stage.Reset();
            Camera.Reset();
            Pause.Reset();
            SuperPause.Reset();
            Assertions.Reset();
            EnvironmentColor.Reset();
            EnvironmentShake.Reset();
            //Team1.Clear();
            //Team2.Clear();
            Elements.Reset();
        }
Exemplo n.º 5
0
        public FightEngine(SubSystems subsystems)
            : base(subsystems)
        {
            IO.TextFile textfile = GetSubSystem<IO.FileSystem>().OpenTextFile(@"data/fight.def");
            IO.TextSection filesection = textfile.GetSection("Files");
            String basepath = GetSubSystem<IO.FileSystem>().GetDirectory(textfile.Filepath);

			m_init = null;
            m_entities = new EntityCollection(this);
            m_roundnumber = 0;
            m_stage = null;
            m_idcounter = 0;
            m_tickcount = 0;
            m_pause = new Pause(this, false);
            m_superpause = new Pause(this, true);
            m_asserts = new EngineAssertions();
            m_camera = new Camera(this);
            m_envcolor = new EnvironmentColor(this);
            m_envshake = new EnvironmentShake(this);
            m_speed = GameSpeed.Normal;
            m_slowspeedbuffer = 0;
            m_fontmap = BuildFontMap(filesection);
            m_fightsounds = GetSubSystem<Audio.SoundSystem>().CreateManager(BuildPath(basepath, filesection.GetAttribute<String>("snd")));
            m_commonsounds = GetSubSystem<Audio.SoundSystem>().CreateManager(BuildPath(basepath, filesection.GetAttribute<String>("common.snd")));
            m_fightsprites = GetSubSystem<Drawing.SpriteSystem>().CreateManager(BuildPath(basepath, filesection.GetAttribute<String>("sff")));
            m_fxsprites = GetSubSystem<Drawing.SpriteSystem>().CreateManager(BuildPath(basepath, filesection.GetAttribute<String>("fightfx.sff")));
            m_fightanimations = GetSubSystem<Animations.AnimationSystem>().CreateManager(textfile.Filepath);
            m_fxanimations = GetSubSystem<Animations.AnimationSystem>().CreateManager(BuildPath(basepath, filesection.GetAttribute<String>("fightfx.air")));
            m_elements = new Elements.Collection(FightSprites, FightAnimations, FightSounds, Fonts);
            m_roundinfo = new RoundInformation(this, textfile);
            m_team1 = new Team(this, TeamSide.Left);
            m_team2 = new Team(this, TeamSide.Right);
            m_combatcheck = new CombatChecker(this);
            m_logic = new Logic.PreIntro(this);
			m_clock = new Clock(this);
        }
Exemplo n.º 6
0
        public FightEngine(SubSystems subsystems)
            : base(subsystems)
        {
            IO.TextFile    textfile    = GetSubSystem <IO.FileSystem>().OpenTextFile(@"data/fight.def");
            IO.TextSection filesection = textfile.GetSection("Files");
            String         basepath    = GetSubSystem <IO.FileSystem>().GetDirectory(textfile.Filepath);

            m_init            = null;
            m_entities        = new EntityCollection(this);
            m_roundnumber     = 0;
            m_stage           = null;
            m_idcounter       = 0;
            m_tickcount       = 0;
            m_pause           = new Pause(this, false);
            m_superpause      = new Pause(this, true);
            m_asserts         = new EngineAssertions();
            m_camera          = new Camera(this);
            m_envcolor        = new EnvironmentColor(this);
            m_envshake        = new EnvironmentShake(this);
            m_speed           = GameSpeed.Normal;
            m_slowspeedbuffer = 0;
            m_fontmap         = BuildFontMap(filesection);
            m_fightsounds     = GetSubSystem <Audio.SoundSystem>().CreateManager(BuildPath(basepath, filesection.GetAttribute <String>("snd")));
            m_commonsounds    = GetSubSystem <Audio.SoundSystem>().CreateManager(BuildPath(basepath, filesection.GetAttribute <String>("common.snd")));
            m_fightsprites    = GetSubSystem <Drawing.SpriteSystem>().CreateManager(BuildPath(basepath, filesection.GetAttribute <String>("sff")));
            m_fxsprites       = GetSubSystem <Drawing.SpriteSystem>().CreateManager(BuildPath(basepath, filesection.GetAttribute <String>("fightfx.sff")));
            m_fightanimations = GetSubSystem <Animations.AnimationSystem>().CreateManager(textfile.Filepath);
            m_fxanimations    = GetSubSystem <Animations.AnimationSystem>().CreateManager(BuildPath(basepath, filesection.GetAttribute <String>("fightfx.air")));
            m_elements        = new Elements.Collection(FightSprites, FightAnimations, FightSounds, Fonts);
            m_roundinfo       = new RoundInformation(this, textfile);
            m_team1           = new Team(this, TeamSide.Left);
            m_team2           = new Team(this, TeamSide.Right);
            m_combatcheck     = new CombatChecker(this);
            m_logic           = new Logic.PreIntro(this);
            m_clock           = new Clock(this);
        }
Exemplo n.º 7
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);
            }
        }
Exemplo n.º 8
0
        void UpdateLogic()
        {
            m_logic.Update();

            if (m_logic.IsFinished() == true)
            {
                if (m_logic is Logic.PreIntro)
                {
                    m_logic = new Logic.ShowCharacterIntro(this);
                }
                else if (m_logic is Logic.ShowCharacterIntro)
                {
                    m_logic = new Logic.DisplayRoundNumber(this);
                }
                else if (m_logic is Logic.DisplayRoundNumber)
                {
                    m_logic = new Logic.ShowFight(this);
                }
                else if (m_logic is Logic.ShowFight)
                {
                    m_logic = new Logic.Fighting(this);
                }
                else if (m_logic is Logic.Fighting)
                {
                    m_logic = new Logic.CombatOver(this);
                }
                else if (m_logic is Logic.CombatOver)
                {
                    m_logic = new Logic.ShowWinPose(this);
                }
                else if (m_logic is Logic.ShowWinPose)
                {
                    if (Team1.Wins.Count >= RoundInformation.NumberOfRounds || Team2.Wins.Count >= RoundInformation.NumberOfRounds)
                    {
                        GetMainSystem<Menus.MenuSystem>().PostEvent(new Events.SwitchScreen(ScreenType.Title));
                        m_logic = new Logic.NoMoreFighting(this);
                    }
                    else
                    {
                        RoundNumber += 1;
                        m_logic = new Logic.PreIntro(this);
                    }
                }
            }
        }