Пример #1
0
        public override void ProcessZ()
        {
            if (!(((DescriptionMenuItem)MenuItemList[MenuSelectIndex]).Description != "----------"))
            {
                return;
            }
            StageData.SoundPlay("se_ok00.wav");
            string fileName = ".\\Replay\\thSSS_" + RepIndex + ".rpy";

            StageData.Rep.LoadRpy(fileName);
            ReplayInfo replayInfo = Replay.ReadTitle(fileName);

            StageData.RepInfo = replayInfo;
            int    num;
            string str;

            if (MenuSelectIndex < 6)
            {
                if (replayInfo.StartStage.Contains("St"))
                {
                    num = MenuSelectIndex + 1;
                    str = "St" + num.ToString();
                }
                else
                {
                    num = MenuSelectIndex + 1;
                    str = "Bs" + num.ToString();
                }
            }
            else
            {
                str = "StEx";
            }
            StageData.StateSwitchData = new StateSwitchDataPackage()
            {
                NextState = str,
                NeedInit  = true,
                SDPswitch = new StageDataPackage(StageData.GlobalData)
                {
                    OnReplay   = true,
                    Difficulty = replayInfo.Rank
                }
            };
            int   index = !(str == "StEx") ? (!replayInfo.StartStage.Contains("St") ? MenuSelectIndex - Convert.ToInt32(replayInfo.StartStage.Replace("Bs", "")) + 1 : MenuSelectIndex - Convert.ToInt32(replayInfo.StartStage.Replace("St", "")) + 1) : 0;
            Point point = new Point(192, 398);

            if (index >= 0)
            {
                point = new Point((int)replayInfo.MyPlaneData[index].PosX, (int)replayInfo.MyPlaneData[index].PosY);
            }
            BaseMyPlane baseMyPlane;

            switch (replayInfo.MyPlaneName)
            {
            case "Reimu":
                baseMyPlane = new MyPlane_Reimu(StageData.StateSwitchData.SDPswitch, point);
                break;

            case "Sanae":
                baseMyPlane = new MyPlane_Sanae(StageData.StateSwitchData.SDPswitch, point);
                break;

            case "Marisa":
                baseMyPlane = new MyPlane_Marisa(StageData.StateSwitchData.SDPswitch, point);
                break;

            case "Koishi":
                baseMyPlane = new MyPlane_Koishi(StageData.StateSwitchData.SDPswitch, point);
                break;

            default:
                baseMyPlane = new BaseMyPlane(StageData.StateSwitchData.SDPswitch, point);
                break;
            }
            if (index >= 0)
            {
                baseMyPlane.Life             = replayInfo.MyPlaneData[index].Life;
                baseMyPlane.Spell            = replayInfo.MyPlaneData[index].Spell;
                baseMyPlane.Power            = replayInfo.MyPlaneData[index].Power;
                baseMyPlane.Score            = replayInfo.MyPlaneData[index].Score;
                baseMyPlane.OriginalPosition = new PointF(replayInfo.MyPlaneData[index].PosX, replayInfo.MyPlaneData[index].PosY);
                baseMyPlane.Graze            = replayInfo.MyPlaneData[index].Graze;
                baseMyPlane.LifeUpCount      = replayInfo.MyPlaneData[index].LifeUpCount;
                baseMyPlane.LifeChip         = replayInfo.MyPlaneData[index].LifeChip;
                baseMyPlane.SpellChip        = replayInfo.MyPlaneData[index].SpellChip;
                baseMyPlane.StarPoint        = replayInfo.MyPlaneData[index].StarPoint;
                baseMyPlane.HighItemScore    = replayInfo.MyPlaneData[index].HighItemScore;
                baseMyPlane.Rate             = replayInfo.MyPlaneData[index].Rate;
                baseMyPlane.LastColor        = replayInfo.MyPlaneData[index].LastColor;
                StageData.Rep.DataPosition   = replayInfo.MyPlaneData[index].DataPosition;
            }
            StageData.StateSwitchData.SDPswitch.MyPlane = baseMyPlane;
            StageData.StateSwitchData.SDPswitch.RepInfo = replayInfo;
        }
Пример #2
0
        public override void ProcessZ()
        {
            switch (MenuItemList[MenuSelectIndex].Name)
            {
            case "Menu_继续游戏":
                StageData.StateSwitchData = new StateSwitchDataPackage()
                {
                    NextState = StageData.GlobalData.LastState.StageName,
                    NeedInit  = false
                };
                ((BaseGameState)StageData.GlobalData.LastState).TimeSycn();
                break;

            case "Menu_再试一次":
                if (StageData.GlobalData.LastState == null)
                {
                    break;
                }
                ++StageData.GlobalData.LastState.StageData.ContinueTimes;
                StageData.GlobalData.LastState.StageData.MyPlane.RetryClear();
                StageData.StateSwitchData = new StateSwitchDataPackage()
                {
                    NextState = StageData.GlobalData.LastState.StageName,
                    NeedInit  = false
                };
                StageData.Rep.Dispose();
                StageData.Rep.CreatRpy();
                break;

            case "Menu_保存录像":
                StageData.MenuGroupList.Add(new MenuGroup_ReplaySaver(StageData, new PointF(36f, 16f)));
                break;

            case "Menu_从头开始":
                if (StageData.GlobalData.LastState == null)
                {
                    break;
                }
                bool       onReplay   = StageData.GlobalData.LastState.StageData.OnReplay;
                bool       onPractice = StageData.GlobalData.LastState.StageData.OnPractice;
                ReplayInfo repInfo    = StageData.GlobalData.LastState.StageData.RepInfo;
                StageData.StateSwitchData = new StateSwitchDataPackage()
                {
                    NextState = StageData.GlobalData.LastState.StageData.RepInfo.StartStage,
                    NeedInit  = true,
                    SDPswitch = new StageDataPackage(StageData.GlobalData)
                    {
                        Difficulty = repInfo.Rank,
                        OnReplay   = onReplay
                    }
                };
                int   index = 0;
                Point point = new Point(192, 398);
                if (index >= 0)
                {
                    point = new Point((int)repInfo.MyPlaneData[index].PosX, (int)repInfo.MyPlaneData[index].PosY);
                }
                BaseMyPlane baseMyPlane;
                switch (repInfo.MyPlaneName)
                {
                case "Reimu":
                    baseMyPlane = new MyPlane_Reimu(StageData.StateSwitchData.SDPswitch, point);
                    break;

                case "Sanae":
                    baseMyPlane = new MyPlane_Sanae(StageData.StateSwitchData.SDPswitch, point);
                    break;

                case "Marisa":
                    baseMyPlane = new MyPlane_Marisa(StageData.StateSwitchData.SDPswitch, point);
                    break;

                case "Koishi":
                    baseMyPlane = new MyPlane_Koishi(StageData.StateSwitchData.SDPswitch, point);
                    break;

                default:
                    baseMyPlane = new MyPlane_Reimu(StageData.StateSwitchData.SDPswitch, point);
                    break;
                }
                if (index >= 0)
                {
                    baseMyPlane.LifeUpCount   = SourseForm.lifeUpCount;
                    baseMyPlane.Life          = SourseForm.life;
                    baseMyPlane.LifeChip      = SourseForm.lifeChip;
                    baseMyPlane.Spell         = SourseForm.spell;
                    baseMyPlane.SpellChip     = SourseForm.spellChip;
                    baseMyPlane.Power         = SourseForm.power;
                    baseMyPlane.HighItemScore = SourseForm.highItemScore;
                    baseMyPlane.StarPoint     = SourseForm.starPoint;
                    baseMyPlane.LastColor     = SourseForm.starColor;
                    baseMyPlane.Score         = SourseForm.score;

                    //  baseMyPlane.Life = repInfo.MyPlaneData[index].Life;
                    //  baseMyPlane.Spell = repInfo.MyPlaneData[index].Spell;
                    //  baseMyPlane.Power = repInfo.MyPlaneData[index].Power;
                    //  baseMyPlane.Score = repInfo.MyPlaneData[index].Score;
                    //  baseMyPlane.OriginalPosition = new PointF(repInfo.MyPlaneData[index].PosX, repInfo.MyPlaneData[index].PosY);
                    StageData.Rep.DataPosition = repInfo.MyPlaneData[index].DataPosition;
                }
                StageData.StateSwitchData.SDPswitch.MyPlane    = baseMyPlane;
                StageData.StateSwitchData.SDPswitch.OnPractice = onPractice;
                if (!onReplay)
                {
                    StageData.Rep.Dispose();
                    StageData.Rep.CreatRpy();
                }
                else
                {
                    StageData.Rep.DataPosition = 0L;
                }
                if (!onReplay)
                {
                    StageData.StateSwitchData.SDPswitch.SetReplayInfo(StageData.StateSwitchData.NextState);
                }
                else
                {
                    StageData.StateSwitchData.SDPswitch.RepInfo = repInfo;
                }
                break;

            case "Menu_返回主菜单":
                StageData.StateSwitchData = new StateSwitchDataPackage()
                {
                    NextState = "MainMenu",
                    NeedInit  = true,
                    SDPswitch = new StageDataPackage(StageData.GlobalData)
                };
                StageData.Rep.CloseRpy();
                break;
            }
        }