Exemple #1
0
        protected override SceneBase CreateIntroSceneFromNetwork(CutsceneStartProtocol netData)
        {
            var set = IntroMovieSet.Create(
                ref this._ShipExterior,
                ref this._ShipInterior,
                out Rectangle chunkRange,
                out string result
                );

            if (set != null)
            {
                return(new Intro00_SettingScene(set));
            }

            if (result != "Found null tile.")                   //result == "Success."
            {
                set = IntroMovieSet.Create((IntroCutsceneStartProtocol)netData);
                return(new Intro00_SettingScene(set));
            }

            // Request and await tile chunks from server
            if (this._MovieSetChunksRequestRetryTimer-- <= 0)
            {
                this._MovieSetChunksRequestRetryTimer = 60 * 2;                 // Retry every 2s until timeout

                LogHelpers.Log("Requesting chunks from range " + chunkRange);
                TileWorldHelpers.RequestChunksFromServer(chunkRange);
            }

            return(null);
        }
Exemple #2
0
        protected override SceneBase CreateNextSceneFromNetwork(SceneID sceneId, CutsceneUpdateProtocol netData)
        {
            IntroMovieSet set = this.UpdateMovieSetFromNetwork(netData);

            if (sceneId.Equals(this.FirstSceneId))
            {
                return(new Intro00_SettingScene(set));
            }
            else if (sceneId.Equals(this.SecondSceneId))
            {
                return(Intro01_PiratesScene.Create(this));
            }

            return(null);
        }
        internal static IntroMovieSet Create(
            ref TileStructure shipExterior,
            ref TileStructure shipInterior,
            out Rectangle chunkRange,
            out string result)
        {
            if (shipInterior == null)
            {
                char d = Path.DirectorySeparatorChar;
                shipExterior = TileStructure.Load(
                    mod: CutsceneLibMod.Instance,
                    pathOfModFile: "ExampleCutscene" + d + "IntroCutscene" + d + "Ship Exterior.dat"
                    );
                shipInterior = TileStructure.Load(
                    mod: CutsceneLibMod.Instance,
                    pathOfModFile: "ExampleCutscene" + d + "IntroCutscene" + d + "Ship Interior.dat"
                    );
                //LogHelpers.Log( "interior: "+ shipInterior.Bounds.ToString()+" ("+shipInterior.TileCount+")"
                //	+", exterior: "+shipExterior.Bounds.ToString()+" ("+shipExterior.TileCount+")");
            }

            int  extTileLeft, extTileTop;
            int  intTileLeft, intTileTop;
            bool isFlipped;
            bool isOcean;

            isOcean = IntroMovieSet.GetSceneCoordinates(shipExterior.Bounds.Width, out extTileLeft, out extTileTop, out isFlipped, out result);
            isOcean = IntroMovieSet.GetSceneCoordinates(shipInterior.Bounds.Width, out intTileLeft, out intTileTop, out isFlipped, out result);

            if (!isOcean)
            {
                chunkRange = new Rectangle(
                    intTileLeft,
                    41,
                    Math.Max(shipExterior.Bounds.Width, shipInterior.Bounds.Width),
                    shipExterior.Bounds.Height + shipInterior.Bounds.Height + 20
                    );
                return(null);
            }

            //extLeft += shipExterior.Bounds.Width / 2;
            //intLeft += shipInterior.Bounds.Width / 2;
            //extTop -= 8;
            intTileTop = Math.Max(intTileTop - 160, 41);

            chunkRange = default(Rectangle);
            return(new IntroMovieSet(shipExterior, shipInterior, extTileLeft, extTileTop, intTileLeft, intTileTop, isFlipped));
        }
Exemple #4
0
        ////////////////

        protected override SceneBase CreateNextScene(SceneID sceneId)
        {
            var           currScene = this.CurrentScene as Intro00_SettingScene;
            IntroMovieSet set       = currScene.Set;

            if (sceneId.Equals(this.FirstSceneId))
            {
                return(new Intro00_SettingScene(set));
            }
            else if (sceneId.Equals(this.SecondSceneId))
            {
                return(Intro01_PiratesScene.Create(this));
            }

            return(null);
        }