Ejemplo n.º 1
0
 public PLAYDATA(
     Texture2D blackbox,
     Sprite crapwise,
     Sprite playdata,
     Sprite playerdata,
     Sprite leveldata)
 {
     this.black          = blackbox;
     this.crapwise       = crapwise;
     this.playdata       = playdata;
     this.playerdata     = playerdata;
     this.leveldata      = leveldata;
     this.blackpos       = new Vector2(9f, 170f);
     this.blackscale     = new Vector2(6.22f, 2.3f);
     this.blackalpha     = 0.0f;
     playdata.position   = new Vector2(210f, 408f);
     crapwise.scale      = new Vector2(0.8f, 0.8f);
     crapwise.origin     = new Vector2(10f, 16f);
     this.crapwisepos    = new Vector2[4];
     this.crapwisepos[0] = new Vector2(22f, 146f);
     this.crapwisepos[1] = new Vector2(173f, 146f);
     this.crapwisepos[2] = new Vector2(323f, 123f);
     this.crapwisepos[3] = new Vector2(323f, 159f);
     this.player         = this.level = this.scpage = 0;
     playerdata.position = new Vector2(39f, 131f);
     leveldata.position  = new Vector2(263f, 128f);
     this.pdata          = this.Load("Content/Data/4.xna");
 }
Ejemplo n.º 2
0
Archivo: SPECIAL.cs Proyecto: THSJF/sjf
 public SPECIAL(
     PracticeData pdata,
     Sprite[] character,
     Texture2D blackbox,
     params Texture2D[] button)
 {
     for (int index = 0; index < 4; ++index)
     {
         if (pdata.clear[index])
         {
             this.cleared = true;
             break;
         }
     }
     if (!this.cleared)
     {
         this.selection = 1;
     }
     this.character   = character;
     this.black       = new Sprite(blackbox);
     this.black.scale = new Vector2(6.4f, 4.8f);
     this.button      = new Sprite[4];
     this.buttonon    = new Sprite[4];
     for (int index = 0; index < button.Length / 2; ++index)
     {
         this.button[index]          = new Sprite(button[index]);
         this.button[index].position = new Vector2((float)(44 + 20 * index - 30), (float)(285 + 30 * index));
     }
     for (int index = button.Length / 2; index < button.Length; ++index)
     {
         this.buttonon[index - button.Length / 2]          = new Sprite(button[index]);
         this.buttonon[index - button.Length / 2].position = new Vector2((float)(44 + 20 * (index - button.Length / 2) - 30), (float)(285 + 30 * (index - button.Length / 2)));
     }
     if (Main.SkiptoSCChanllenges)
     {
         this.step      = true;
         this.selection = 2;
     }
     this.pdata      = this.LoadPlayData();
     this.prdata     = this.LoadPracticeData();
     this.sdata      = this.Load("Content/Data/8.xna");
     this.achivrates = new int[3];
     for (int index1 = 0; index1 < 3; ++index1)
     {
         float num = 0.0f;
         for (int index2 = 0; index2 < this.sdata.ach[index1].achiv.Length; ++index2)
         {
             if (this.sdata.ach[index1].achiv[index2].get)
             {
                 ++num;
             }
         }
         this.achivrates[index1] = (int)((double)num / (double)this.sdata.ach[index1].achiv.Length * 100.0);
     }
     for (int index = 0; index < 4; ++index)
     {
         character[index].position = new Vector2(0.0f, 0.0f);
     }
 }
Ejemplo n.º 3
0
Archivo: SPECIAL.cs Proyecto: THSJF/sjf
        private PlayData LoadPlayData()
        {
            Stream   serializationStream = Cry.Decry("Content\\Data\\4.xna", 2);
            PlayData playData            = (PlayData) new BinaryFormatter().Deserialize(serializationStream);

            serializationStream.Close();
            return(playData);
        }
Ejemplo n.º 4
0
Archivo: ED.cs Proyecto: THSJF/sjf
        private void SavePlayData(PlayData data)
        {
            FileStream fileStream = new FileStream("Content\\Data\\4.xna", FileMode.Create);

            new BinaryFormatter().Serialize((Stream)fileStream, (object)data);
            fileStream.Close();
            Cry.Encry("Content\\Data\\4.xna", 2);
        }
Ejemplo n.º 5
0
        private PlayData Load(string filename)
        {
            Stream   serializationStream = Cry.Decry(filename, 2);
            PlayData playData            = (PlayData) new BinaryFormatter().Deserialize(serializationStream);

            serializationStream.Close();
            return(playData);
        }
Ejemplo n.º 6
0
Archivo: Main.cs Proyecto: THSJF/sjf
 protected override void Initialize()
 {
     try {
         Main.fpstimer = new System.Threading.Timer(new TimerCallback(this.FpsRecord), (object)null, 0, 1000);
         if (!File.Exists("Content/Music/00.xna"))
         {
             StreamWriter streamWriter = new StreamWriter("Content/Music/00.xna", false);
             streamWriter.WriteLine("Fantasy Danmaku Festival");
             streamWriter.WriteLine("0");
             streamWriter.Close();
             Cry.Encry("Content/Music/00.xna", 2);
         }
         if (!File.Exists("Content/Data/4.xna"))
         {
             PlayData   playData   = new PlayData();
             FileStream fileStream = new FileStream("Content/Data/4.xna", FileMode.Create);
             new BinaryFormatter().Serialize((Stream)fileStream, (object)playData);
             fileStream.Close();
             Cry.Encry("Content/Data/4.xna", 2);
         }
         if (!File.Exists("Content/Data/5.xna"))
         {
             PracticeData practiceData = new PracticeData();
             FileStream   fileStream   = new FileStream("Content/Data/5.xna", FileMode.Create);
             new BinaryFormatter().Serialize((Stream)fileStream, (object)practiceData);
             fileStream.Close();
             Cry.Encry("Content/Data/5.xna", 2);
         }
         if (!File.Exists("Content/Data/8.xna"))
         {
             SpecialData specialData = new SpecialData();
             FileStream  fileStream  = new FileStream("Content/Data/8.xna", FileMode.Create);
             new BinaryFormatter().Serialize((Stream)fileStream, (object)specialData);
             fileStream.Close();
             Cry.Encry("Content/Data/8.xna", 2);
         }
         if (!File.Exists("Content/Music/10.xna"))
         {
             new StreamWriter("Content/Data/10.xna", false).Close();
             Cry.Encry("Content/Data/10.xna", 2);
         }
         Main.rand    = new Random();
         Main.font    = new SpriteFontX(new Font("宋体", 12f, FontStyle.Regular, GraphicsUnit.Pixel), (IGraphicsDeviceService)this.graphics, TextRenderingHint.ClearTypeGridFit);
         Main.dfont   = new SpriteFontX(new Font("微软雅黑", 16f, FontStyle.Bold, GraphicsUnit.Pixel), (IGraphicsDeviceService)this.graphics, TextRenderingHint.AntiAlias);
         Main.scfont  = new SpriteFontX(new Font("宋体", 16f, FontStyle.Bold, GraphicsUnit.Pixel), (IGraphicsDeviceService)this.graphics, TextRenderingHint.AntiAlias);
         Main.scdfont = new SpriteFontX(new Font("宋体", 10f, FontStyle.Bold, GraphicsUnit.Pixel), (IGraphicsDeviceService)this.graphics, TextRenderingHint.SingleBitPerPixelGridFit);
         PadState.InitPad(Main.ini);
         Main.WindowSizeType = int.Parse(Main.ini.ReadValue("Graphics", "WindowSize"));
         Main.Fullorwindow   = int.Parse(Main.ini.ReadValue("Mode", "Full/Window"));
         Main.BackGround     = int.Parse(Main.ini.ReadValue("Graphics", "BackGround")) == 1;
         Main.VSync          = int.Parse(Main.ini.ReadValue("Graphics", "VSync")) == 1;
         this.graphics.SynchronizeWithVerticalRetrace = Main.VSync;
         this.IsFixedTimeStep = false;
         Main.ResizeWindow(this, Main.WindowSizeType);
         if (Main.Fullorwindow == 1)
         {
             this.graphics.ToggleFullScreen();
         }
         Sound.Init();
         Music.Init();
         Main.stage = "ENTRANCE";
         base.Initialize();
     } catch (Exception ex) {
         StreamWriter streamWriter = new StreamWriter("Error.txt");
         DateTime     now          = DateTime.Now;
         streamWriter.Write("[" + now.Hour.ToString("00") + ":" + now.Minute.ToString("00") + ":" + now.Second.ToString("00") + "]\n" + ex.ToString());
         streamWriter.Close();
         Main.Message(ex.ToString());
     }
 }
Ejemplo n.º 7
0
        public RecordSave(PlayData data, int stagenow, long scorenow)
        {
            this.playdata  = data;
            this.stage     = stagenow;
            this.score     = scorenow;
            this.selection = 0;
            for (int index1 = 0; index1 < this.playdata.players[(int)(Main.Character - 1)].ranks[(int)(Main.Level - 1)].data.Length; ++index1)
            {
                if (this.playdata.players[(int)(Main.Character - 1)].ranks[(int)(Main.Level - 1)].data[index1] != null && this.playdata.players[(int)(Main.Character - 1)].ranks[(int)(Main.Level - 1)].data[index1].score > scorenow)
                {
                    this.selection = index1 + 1;
                }
                else if (this.playdata.players[(int)(Main.Character - 1)].ranks[(int)(Main.Level - 1)].data[index1] != null)
                {
                    this.selection = index1;
                    for (int index2 = this.playdata.players[(int)(Main.Character - 1)].ranks[(int)(Main.Level - 1)].data.Length - 1; index2 >= index1; --index2)
                    {
                        if (index2 + 1 <= 9)
                        {
                            if (this.playdata.players[(int)(Main.Character - 1)].ranks[(int)(Main.Level - 1)].data[index2] != null)
                            {
                                this.playdata.players[(int)(Main.Character - 1)].ranks[(int)(Main.Level - 1)].data[index2 + 1]       = new PlayRank();
                                this.playdata.players[(int)(Main.Character - 1)].ranks[(int)(Main.Level - 1)].data[index2 + 1].name  = this.playdata.players[(int)(Main.Character - 1)].ranks[(int)(Main.Level - 1)].data[index2].name;
                                this.playdata.players[(int)(Main.Character - 1)].ranks[(int)(Main.Level - 1)].data[index2 + 1].score = this.playdata.players[(int)(Main.Character - 1)].ranks[(int)(Main.Level - 1)].data[index2].score;
                                this.playdata.players[(int)(Main.Character - 1)].ranks[(int)(Main.Level - 1)].data[index2 + 1].stage = this.playdata.players[(int)(Main.Character - 1)].ranks[(int)(Main.Level - 1)].data[index2].stage;
                                this.playdata.players[(int)(Main.Character - 1)].ranks[(int)(Main.Level - 1)].data[index2 + 1].time  = this.playdata.players[(int)(Main.Character - 1)].ranks[(int)(Main.Level - 1)].data[index2].time;
                            }
                            else
                            {
                                this.playdata.players[(int)(Main.Character - 1)].ranks[(int)(Main.Level - 1)].data[index2 + 1] = (PlayRank)null;
                            }
                        }
                    }
                    break;
                }
            }
            if (this.selection > 9)
            {
                this.ok = true;
            }
            if (this.ok)
            {
                return;
            }
            if (this.playdata.players[(int)(Main.Character - 1)].ranks[(int)(Main.Level - 1)].data[this.selection] != null)
            {
                this.recovery       = new PlayRank();
                this.recovery.name  = this.playdata.players[(int)(Main.Character - 1)].ranks[(int)(Main.Level - 1)].data[this.selection].name;
                this.recovery.score = this.playdata.players[(int)(Main.Character - 1)].ranks[(int)(Main.Level - 1)].data[this.selection].score;
                this.recovery.stage = this.playdata.players[(int)(Main.Character - 1)].ranks[(int)(Main.Level - 1)].data[this.selection].stage;
                this.recovery.time  = this.playdata.players[(int)(Main.Character - 1)].ranks[(int)(Main.Level - 1)].data[this.selection].time;
            }
            this.playdata.players[(int)(Main.Character - 1)].ranks[(int)(Main.Level - 1)].data[this.selection]       = new PlayRank();
            this.playdata.players[(int)(Main.Character - 1)].ranks[(int)(Main.Level - 1)].data[this.selection].name  = "_";
            this.playdata.players[(int)(Main.Character - 1)].ranks[(int)(Main.Level - 1)].data[this.selection].score = this.score;
            this.playdata.players[(int)(Main.Character - 1)].ranks[(int)(Main.Level - 1)].data[this.selection].stage = this.stage;
            DateTime now = DateTime.Now;

            this.playdata.players[(int)(Main.Character - 1)].ranks[(int)(Main.Level - 1)].data[this.selection].time = new DateTime(now.Year, now.Month, now.Day, now.Hour, now.Minute, now.Second);
            this.step       = true;
            this.selection2 = 64;
            this.nametemp   = Main.nametemp;
            if (this.nametemp == "")
            {
                this.selection2 = 0;
            }
            this.playdata.players[(int)(Main.Character - 1)].ranks[(int)(Main.Level - 1)].data[this.selection].name = this.nametemp + "_";
        }