Example #1
0
 private void Form_Main_FormClosing(object sender, FormClosingEventArgs e)
 {
     if (this.LoadingThread != null && this.LoadingThread.IsAlive)
     {
         this.LoadingThread.Abort();
     }
     this.GlobalData.PData.SaveData();
     this.GlobalData.Dispose();
     if (!this.useDirectInput)
     {
         this.GlobalData.DeviceMain.Dispose();
     }
     if (this.GameStatesDictionary != null)
     {
         foreach (IGameState gameState in this.GameStatesDictionary.Values)
         {
             gameState.Dispose();
         }
     }
     try
     {
         INI_RW iniRw = new INI_RW(".\\Setting.INI");
         if (iniRw.ExistINIFile())
         {
             iniRw.IniWriteValue("Volume", "BGMVolume", this.GlobalData.BGMVolume.ToString());
             iniRw.IniWriteValue("Volume", "SEVolume", this.GlobalData.SEVolume.ToString());
         }
     }
     catch
     {
     }
 }
Example #2
0
File: EndBoss.cs Project: THSJF/sjf
 public override void Shoot()
 {
     if (this.Time == 1)
     {
         this.StageData.SoundPlay("se_enep01.wav");
         for (int index = 0; index < 16; ++index)
         {
             ParticleSmaller particleSmaller = new ParticleSmaller(this.StageData, "光点", this.Position, (float)(2.0 + (double)this.Ran.Next(30) / 10.0), (double)this.Ran.Next(360) / 180.0 * Math.PI);
             particleSmaller.Scale      = (float)this.Ran.Next(10, 20) / 10f;
             particleSmaller.ColorValue = Color.FromArgb((int)byte.MaxValue, this.Ran.Next(20, 240), this.Ran.Next(200, (int)byte.MaxValue));
         }
         this.StageData.VibrateStart(50);
     }
     else if (this.Time == 100)
     {
         this.StageData.SoundPlay("se_enep01.wav");
         for (int index = 0; index < 60; ++index)
         {
             ParticleSmaller particleSmaller = new ParticleSmaller(this.StageData, "光点", this.Position, (float)(1.0 + (double)this.Ran.Next(50) / 10.0), (double)this.Ran.Next(360) / 180.0 * Math.PI);
             particleSmaller.Scale      = (float)this.Ran.Next(10, 20) / 10f;
             particleSmaller.ColorValue = Color.FromArgb((int)byte.MaxValue, this.Ran.Next(20, 240), this.Ran.Next(220, (int)byte.MaxValue));
         }
         this.StageData.VibrateStart(50);
         this.MyBulletList.Clear();
         this.Boss = (BaseBossTouhou)null;
     }
     else
     {
         if (this.Time != 250)
         {
             return;
         }
         EndStage      endStage      = new EndStage(this.StageData, "在世界的某个角落", true);
         TransitionOut transitionOut = new TransitionOut(this.StageData);
         try
         {
             INI_RW iniRw = new INI_RW(".\\Setting.INI");
             if (iniRw.ExistINIFile())
             {
                 iniRw.IniWriteValue("Mode", "Clear", "yes");
             }
         }
         catch
         {
         }
     }
 }