예제 #1
0
        private void SetDefaults()
        {
            // items
            randomAbilities     = false;
            randomTanks         = false;
            excludedItems       = new List <int>();
            gameCompletion      = GameCompletion.Beatable;
            iceNotRequired      = false;
            plasmaNotRequired   = false;
            noPBsBeforeChozodia = false;
            chozoStatueHints    = false;
            infiniteBombJump    = true;
            wallJumping         = true;

            // palettes
            tilesetPalettes = false;
            enemyPalettes   = false;
            beamPalettes    = false;
            hueMinimum      = 0;
            hueMaximum      = 180;

            // misc
            enableItemToggle     = true;
            obtainUnkItems       = false;
            hardModeAvailable    = true;
            pauseScreenInfo      = false;
            removeCutscenes      = false;
            removeNorfairVine    = true;
            removeVariaAnimation = false;
            skipSuitless         = false;
        }
예제 #2
0
    private void gameOver(GameCompletion completion)
    {
        //end the game, tell the tiles to stop accepting input
        m_gamestate = GameState.GameOver;
        m_gameboard.setTilesToAcceptInput(m_gamestate);


        if (completion == GameCompletion.Win_Player1 || completion == GameCompletion.Win_Player2)
        {
            int winner_index = -1;
            if (completion == GameCompletion.Win_Player1)
            {
                winner_index = (int)PlayerIndex.Player1;
            }
            else
            {
                winner_index = (int)PlayerIndex.Player2;
            }
            Sprite winners_sprite = m_player_mark_sprites[winner_index];

            m_ui_manager.presentGameOverModal(true, WIN_GAME_OVER_DELAY, m_player_names[winner_index], winners_sprite);
        }
        else if (completion == GameCompletion.Draw)
        {
            m_ui_manager.presentGameOverModal(false, DRAW_GAME_OVER_DELAY);
        }
        else
        {
            Debug.LogError("Invalid completion state at game over");
        }
    }
예제 #3
0
    public void playerTileChoiceComplete()
    {
        //A gameboard tile reports that a mark selection was made. Check to see if the game is over
        GameCompletion completion = m_gameboard.checkForGameCompletion();

        if (completion != GameCompletion.Incomplete)
        {
            gameOver(completion);
            return;
        }

        //Game is not yet over, so advance the gamestate to get input from the other player.
        if (m_gamestate == GameState.Player1_Turn)
        {
            getInputFromPlayer(PlayerIndex.Player2);
        }
        else if (m_gamestate == GameState.Player2_Turn)
        {
            getInputFromPlayer(PlayerIndex.Player1);
        }
        else
        {
            Debug.LogError("Improper gamestate at time of board mark choice");
        }
    }
예제 #4
0
    public void Save()
    {
        BinaryFormatter bf   = new BinaryFormatter();
        FileStream      file = File.Open(Application.persistentDataPath + "/gameCompletion.dat", FileMode.Open);
        GameCompletion  data = new GameCompletion();

        //Save data
        data.items      = items;
        data.clears     = clears;
        data.timeClears = timeClears;
        data.bestTimes  = bestTimes;

        bf.Serialize(file, data);
        file.Close();
    }
예제 #5
0
    public void Load()
    {
        if (File.Exists(Application.persistentDataPath + "/playerInfo.dat"))
        {
            BinaryFormatter bf   = new BinaryFormatter();
            FileStream      file = File.Open(Application.persistentDataPath + "/playerInfo.dat", FileMode.Open);
            GameCompletion  data = (GameCompletion)bf.Deserialize(file);

            file.Close();

            items      = data.items;
            clears     = data.clears;
            timeClears = data.timeClears;
            bestTimes  = data.bestTimes;
        }
    }
예제 #6
0
        private void SetDefaults()
        {
            // items
            AbilitySwap         = Swap.Unchanged;
            TankSwap            = Swap.Unchanged;
            NumItemsRemoved     = 0;
            NumAbilitiesRemoved = null;
            Completion          = GameCompletion.Beatable;
            IceNotRequired      = false;
            PlasmaNotRequired   = false;
            NoPBsBeforeChozodia = false;
            ChozoStatueHints    = false;
            InfiniteBombJump    = true;
            WallJumping         = true;

            // locations
            CustomAssignments = new Dictionary <int, ItemType>();

            // enemies
            RandoEnemies = false;

            // palettes
            TilesetPalettes = false;
            EnemyPalettes   = false;
            SamusPalettes   = false;
            BeamPalettes    = false;
            HueMinimum      = 0;
            HueMaximum      = 180;

            // music
            MusicChange = Change.Unchanged;
            MusicRooms  = Swap.Unchanged;
            MusicBosses = Swap.Unchanged;
            MusicOthers = Swap.Unchanged;

            // misc
            EnableItemToggle    = true;
            ObtainUnkItems      = false;
            HardModeAvailable   = true;
            PauseScreenInfo     = false;
            RemoveCutscenes     = true;
            SkipSuitless        = false;
            SkipDoorTransitions = false;
        }
예제 #7
0
        private void LoadSettings(BinaryTextReader btr)
        {
            // items
            randomAbilities = btr.ReadBool();
            randomTanks     = btr.ReadBool();

            // excluded items
            excludedItems = new List <int>();
            for (int i = 0; i < 100; i++)
            {
                bool excluded = btr.ReadBool();
                if (excluded)
                {
                    excludedItems.Add(i);
                }
            }

            gameCompletion      = (GameCompletion)btr.ReadNumber(2);
            iceNotRequired      = btr.ReadBool();
            plasmaNotRequired   = btr.ReadBool();
            noPBsBeforeChozodia = btr.ReadBool();
            chozoStatueHints    = btr.ReadBool();
            infiniteBombJump    = btr.ReadBool();
            wallJumping         = btr.ReadBool();

            // palettes
            tilesetPalettes = btr.ReadBool();
            enemyPalettes   = btr.ReadBool();
            beamPalettes    = btr.ReadBool();
            hueMinimum      = btr.ReadNumber(8);
            hueMaximum      = btr.ReadNumber(8);

            // misc
            enableItemToggle     = btr.ReadBool();
            obtainUnkItems       = btr.ReadBool();
            hardModeAvailable    = btr.ReadBool();
            pauseScreenInfo      = btr.ReadBool();
            removeCutscenes      = btr.ReadBool();
            removeNorfairVine    = btr.ReadBool();
            removeVariaAnimation = btr.ReadBool();
            skipSuitless         = btr.ReadBool();
        }
        public MoveResult ApplyMove(GameMove move)
        {
            if (move.Location >= GameState.GameBoard.Length || GameState.GameBoard[move.Location] != GameSymbol.Blank)
            {
                return(MoveResult.Illegal);
            }

            GameState.GameBoard[move.Location] = move.GameSymbol;
            GameState.SwitchSymbol();

            GameCompletion gameCompletion = GetGameCompletion();

            if (gameCompletion == GameCompletion.Won)
            {
                return(MoveResult.Win);
            }
            if (gameCompletion == GameCompletion.Draw)
            {
                return(MoveResult.Draw);
            }
            return(MoveResult.Success);
        }
예제 #9
0
        private void LoadSettings_1_3_2(BinaryTextReader btr)
        {
            // items
            bool randAbilities = btr.ReadBool();
            bool randTanks     = btr.ReadBool();

            if (randAbilities && randTanks)
            {
                AbilitySwap = Swap.GlobalPool;
                TankSwap    = Swap.GlobalPool;
            }
            else if (randAbilities)
            {
                AbilitySwap = Swap.LocalPool;
            }
            else if (randTanks)
            {
                TankSwap = Swap.LocalPool;
            }

            if (btr.ReadBool())
            {
                NumItemsRemoved = btr.ReadNumber(7);
            }
            if (SwapOrRemoveItems)
            {
                Completion          = (GameCompletion)btr.ReadNumber(2);
                IceNotRequired      = btr.ReadBool();
                PlasmaNotRequired   = btr.ReadBool();
                NoPBsBeforeChozodia = btr.ReadBool();
                ChozoStatueHints    = btr.ReadBool();
                InfiniteBombJump    = btr.ReadBool();
                WallJumping         = btr.ReadBool();
            }

            // locations
            if (btr.ReadBool())
            {
                int count = btr.ReadNumber(7);
                for (int i = 0; i < count; i++)
                {
                    int      locNum = btr.ReadNumber(7);
                    ItemType item   = (ItemType)btr.ReadNumber(5);
                    CustomAssignments[locNum] = item;
                }
            }

            // enemies
            RandoEnemies = btr.ReadBool();

            // palettes
            TilesetPalettes = btr.ReadBool();
            EnemyPalettes   = btr.ReadBool();
            BeamPalettes    = btr.ReadBool();
            if (RandomPalettes)
            {
                if (btr.ReadBool())
                {
                    HueMinimum = btr.ReadNumber(8);
                }
                if (btr.ReadBool())
                {
                    HueMaximum = btr.ReadNumber(8);
                }
            }

            // misc
            EnableItemToggle    = btr.ReadBool();
            ObtainUnkItems      = btr.ReadBool();
            HardModeAvailable   = btr.ReadBool();
            PauseScreenInfo     = btr.ReadBool();
            RemoveCutscenes     = btr.ReadBool();
            SkipSuitless        = btr.ReadBool();
            SkipDoorTransitions = btr.ReadBool();
        }
예제 #10
0
        private void LoadSettings(BinaryTextReader btr)
        {
            // items
            AbilitySwap = (Swap)btr.ReadNumber(2);
            TankSwap    = (Swap)btr.ReadNumber(2);
            if (btr.ReadBool())
            {
                NumItemsRemoved = btr.ReadNumber(7);
                if (btr.ReadBool())
                {
                    NumAbilitiesRemoved = btr.ReadNumber(4);
                }
            }
            if (SwapOrRemoveItems)
            {
                Completion          = (GameCompletion)btr.ReadNumber(2);
                IceNotRequired      = btr.ReadBool();
                PlasmaNotRequired   = btr.ReadBool();
                NoPBsBeforeChozodia = btr.ReadBool();
                ChozoStatueHints    = btr.ReadBool();
                InfiniteBombJump    = btr.ReadBool();
                WallJumping         = btr.ReadBool();
            }

            // locations
            if (btr.ReadBool())
            {
                int count = btr.ReadNumber(7);
                for (int i = 0; i < count; i++)
                {
                    int      locNum = btr.ReadNumber(7);
                    ItemType item   = (ItemType)btr.ReadNumber(5);
                    CustomAssignments[locNum] = item;
                }
            }

            // enemies
            RandoEnemies = btr.ReadBool();

            // palettes
            TilesetPalettes = btr.ReadBool();
            EnemyPalettes   = btr.ReadBool();
            SamusPalettes   = btr.ReadBool();
            BeamPalettes    = btr.ReadBool();
            if (RandomPalettes)
            {
                if (btr.ReadBool())
                {
                    HueMinimum = btr.ReadNumber(8);
                }
                if (btr.ReadBool())
                {
                    HueMaximum = btr.ReadNumber(8);
                }
            }

            // music
            MusicChange = (Change)btr.ReadNumber(2);
            if (MusicChange != Change.Unchanged)
            {
                MusicRooms  = (Swap)btr.ReadNumber(2);
                MusicBosses = (Swap)btr.ReadNumber(2);
                MusicOthers = (Swap)btr.ReadNumber(2);
            }

            // misc
            EnableItemToggle    = btr.ReadBool();
            ObtainUnkItems      = btr.ReadBool();
            HardModeAvailable   = btr.ReadBool();
            PauseScreenInfo     = btr.ReadBool();
            RemoveCutscenes     = btr.ReadBool();
            SkipSuitless        = btr.ReadBool();
            SkipDoorTransitions = btr.ReadBool();
        }