コード例 #1
0
 private void Init()
 {
     this.lost         = false;
     this.getend       = false;
     this.thread_1     = new Thread(new ThreadStart(this.GetChip));
     this.nowscene     = Chiptreader.SCENE.fadein;
     this.eventmanager = new EventManager(this.sound);
     this.havechip     = new byte[450, 4];
     for (int index1 = 0; index1 < 450; ++index1)
     {
         for (int index2 = 0; index2 < 4; ++index2)
         {
             this.havechip[index1, index2] = this.savedata.Havechip[index1, index2];
         }
     }
     this.havechips.Clear();
     foreach (ChipS havechip in this.savedata.havechips)
     {
         this.havechips.Add(havechip);
     }
     this.havechips = this.havechips.OrderByDescending <ChipS, int>(n => n.Code).ToList <ChipS>();
     this.havechips = this.havechips.OrderByDescending <ChipS, byte>(n => this.havechip[n.number, n.code]).ToList <ChipS>();
     this.setchips.Clear();
     this.getchips.Clear();
     this.rendChip.Clear();
 }
コード例 #2
0
 private void Control()
 {
     if (Input.IsPress(Button._A))
     {
         this.Decide();
     }
     else if (Input.IsPress(Button._B))
     {
         if (this.setchips.Count > 0)
         {
             this.AddChip(this.setchips[this.setchips.Count - 1].number, this.setchips[this.setchips.Count - 1].code, false);
             this.setchips.RemoveAt(this.setchips.Count - 1);
         }
         else
         {
             this.nowscene = Chiptreader.SCENE.fadeout;
         }
         this.sound.PlaySE(SoundEffect.cancel);
     }
     else if (Input.IsPress(Button._Start))
     {
         if (this.setchips.Count % this.MaxSet == 0 && this.setchips.Count > 0)
         {
             this.Start();
         }
         else
         {
             this.sound.PlaySE(SoundEffect.error);
         }
     }
     else if (this.waittime <= 0)
     {
         if (Input.IsPush(Button.Up))
         {
             if (this.Select > 0)
             {
                 if (this.cursol > 0)
                 {
                     --this.cursol;
                 }
                 else
                 {
                     --this.Topchip;
                 }
                 this.sound.PlaySE(SoundEffect.movecursol);
             }
             this.waittime = Input.IsPress(Button.Up) ? 10 : 4;
         }
         else if (Input.IsPush(Button.Down))
         {
             if (this.Select < this.havechips.Count - 1)
             {
                 if (this.cursol < 6)
                 {
                     ++this.cursol;
                 }
                 else
                 {
                     ++this.Topchip;
                 }
                 this.sound.PlaySE(SoundEffect.movecursol);
             }
             this.waittime = Input.IsPress(Button.Down) ? 10 : 4;
         }
         else if (Input.IsPush(Button._R))
         {
             this.overtop = this.havechips.Count < 7 ? 0 : this.havechips.Count - 7;
             int num = this.overtop - this.Topchip;
             if (num > 7)
             {
                 num = 7;
             }
             if (num > 0)
             {
                 this.sound.PlaySE(SoundEffect.movecursol);
                 this.Topchip += num;
             }
             this.waittime = Input.IsPress(Button._R) ? 10 : 4;
         }
         else
         {
             if (!Input.IsPush(Button._L))
             {
                 return;
             }
             this.overtop = this.havechips.Count < 7 ? 0 : this.havechips.Count - 7;
             int num = this.Topchip;
             if (num > 7)
             {
                 num = 7;
             }
             if (num > 0)
             {
                 this.sound.PlaySE(SoundEffect.movecursol);
                 this.Topchip -= num;
             }
             this.waittime = Input.IsPress(Button._L) ? 10 : 4;
         }
     }
     else
     {
         --this.waittime;
     }
 }
コード例 #3
0
        public override void Update()
        {
            switch (this.nowscene)
            {
            case Chiptreader.SCENE.fadein:
                if (!this.shopmode)
                {
                    if (this.alpha == 0)
                    {
                        this.Init();
                    }
                    this.alpha += 51;
                    if (this.alpha >= byte.MaxValue)
                    {
                        this.alpha    = byte.MaxValue;
                        this.shopmode = true;
                        break;
                    }
                    break;
                }
                this.alpha -= 51;
                if (this.alpha <= 0)
                {
                    this.savedata.selectQuestion = 1;
                    this.nowscene = Chiptreader.SCENE.select;
                }
                break;

            case Chiptreader.SCENE.select:
                if (this.eventmanager.playevent)
                {
                    this.eventmanager.UpDate();
                    break;
                }
                if (this.startflag)
                {
                    if (this.savedata.selectQuestion == 0)
                    {
                        this.thread_1.Start();
                        this.nowscene = Chiptreader.SCENE.fadeout;
                    }
                    else
                    {
                        if (this.setchips.Count / this.MaxSet >= 10)
                        {
                            this.AddChip(this.setchips[this.setchips.Count - 1].number, this.setchips[this.setchips.Count - 1].code, false);
                            this.setchips.RemoveAt(this.setchips.Count - 1);
                        }
                        this.startflag = false;
                    }
                }
                else
                {
                    this.Control();
                }
                break;

            case Chiptreader.SCENE.fadeout:
                if (this.shopmode)
                {
                    if (this.alpha >= byte.MaxValue)
                    {
                        this.alpha = byte.MaxValue;
                        if (this.getend || !this.startflag)
                        {
                            this.savedata.ValList[15] = -1;
                            this.shopmode             = false;
                            break;
                        }
                        break;
                    }
                    this.alpha += 51;
                    break;
                }
                this.alpha -= 51;
                if (this.alpha <= 0)
                {
                    this.nowscene = Chiptreader.SCENE.fadein;
                    this.cursol   = 0;
                    this.topchip  = 0;
                    if (this.startflag)
                    {
                        this.EventMake();
                        this.nowscene = Chiptreader.SCENE.getting;
                    }
                    else
                    {
                        this.Init();
                        this.EndCommand();
                    }
                }
                break;

            case Chiptreader.SCENE.getting:
                if (this.eventmanager.playevent)
                {
                    this.eventmanager.UpDate();
                    break;
                }
                this.Init();
                this.EndCommand();
                break;
            }
            this.FlameControl(10);
            if (!this.moveflame)
            {
                return;
            }
            ++this.cursolanime;
            if (this.cursolanime >= 3)
            {
                this.cursolanime = 0;
            }
        }