Exemple #1
0
        public override void Update()
        {
            switch (this.nowscene)
            {
            case VirusManager.SCENE.fadein:
                if (!this.shopmode)
                {
                    this.alpha += 51;
                    if (this.alpha < byte.MaxValue)
                    {
                        break;
                    }
                    this.alpha    = byte.MaxValue;
                    this.shopmode = true;
                    break;
                }
                this.alpha -= 51;
                if (this.alpha <= 0)
                {
                    this.savedata.selectQuestion = 1;
                    this.nowscene = VirusManager.SCENE.select;
                }
                break;

            case VirusManager.SCENE.select:
                this.FlameControl(1);
                if (this.moveflame)
                {
                    if (this.frame % 10 == 0)
                    {
                        ++this.cursolanime;
                    }
                    if (this.cursolanime >= 3)
                    {
                        this.cursolanime = 0;
                    }
                    if (this.frame % 3 == 0)
                    {
                        this.cursolanime2 = !this.cursolanime2;
                    }
                }
                if (this.release)
                {
                    this.eventmanager.UpDate();
                }
                else
                {
                    this.Control();
                }
                if (!this.release || this.eventmanager.playevent)
                {
                    break;
                }
                this.release = false;
                if (this.savedata.selectQuestion == 0)
                {
                    if (this.right)
                    {
                        this.savedata.stockVirus.RemoveAt(this.Select);
                        if (this.Select >= this.savedata.stockVirus.Count)
                        {
                            if (this.top > 0)
                            {
                                --this.top;
                            }
                            else if (this.cursol > 0)
                            {
                                --this.cursol;
                            }
                            else
                            {
                                this.right = false;
                            }
                        }
                        if (this.selectedCursol >= this.savedata.stockVirus.Count)
                        {
                            this.selected = false;
                        }
                    }
                    else
                    {
                        this.savedata.HaveVirus[this.cursol] = null;
                    }
                }
                break;

            case VirusManager.SCENE.fadeout:
                if (this.shopmode)
                {
                    this.alpha += 51;
                    if (this.alpha < byte.MaxValue)
                    {
                        break;
                    }
                    this.alpha    = byte.MaxValue;
                    this.shopmode = false;
                    break;
                }
                this.alpha -= 51;
                if (this.alpha <= 0)
                {
                    this.nowscene = VirusManager.SCENE.fadein;
                    this.cursol   = 0;
                    this.top      = 0;
                    this.manager.parent.main.FolderReset();
                    this.EndCommand();
                }
                break;
            }
        }
Exemple #2
0
 private void Control()
 {
     if (Input.IsPress(Button._A))
     {
         this.sound.PlaySE(SoundEffect.decide);
         this.Decide();
     }
     else if (Input.IsPress(Button._B))
     {
         this.sound.PlaySE(SoundEffect.cancel);
         if (this.selected)
         {
             this.selected = false;
         }
         else if (this.help)
         {
             this.help = false;
         }
         else
         {
             this.nowscene = VirusManager.SCENE.fadeout;
         }
     }
     if (Input.IsPress(Button._Start))
     {
         this.sound.PlaySE(SoundEffect.decide);
         this.help = !this.help;
     }
     if (Input.IsPress(Button._Select))
     {
         if (!this.right && this.savedata.HaveVirus[this.cursol] == null)
         {
             this.sound.PlaySE(SoundEffect.error);
         }
         else
         {
             this.sound.PlaySE(SoundEffect.decide);
             this.release = true;
             this.MessageMake();
         }
     }
     else if (this.waittime <= 0)
     {
         if (Input.IsPush(Button.Up))
         {
             if (this.right)
             {
                 if (this.Select <= 0)
                 {
                     return;
                 }
                 if (this.cursol > 0)
                 {
                     --this.cursol;
                 }
                 else
                 {
                     --this.top;
                 }
                 this.sound.PlaySE(SoundEffect.movecursol);
                 this.waittime = Input.IsPress(Button.Up) ? 10 : 4;
             }
             else
             {
                 if (this.cursol > 0)
                 {
                     --this.cursol;
                 }
                 this.sound.PlaySE(SoundEffect.movecursol);
                 this.waittime = Input.IsPress(Button.Up) ? 10 : 4;
             }
         }
         else if (Input.IsPush(Button.Down))
         {
             if (this.right)
             {
                 if (this.Select >= this.savedata.stockVirus.Count - 1)
                 {
                     return;
                 }
                 if (this.cursol < 3)
                 {
                     ++this.cursol;
                 }
                 else if (this.right)
                 {
                     ++this.top;
                 }
                 this.sound.PlaySE(SoundEffect.movecursol);
                 this.waittime = Input.IsPress(Button.Down) ? 10 : 4;
             }
             else if (this.Select < this.savedata.haveCaptureBomb - 1)
             {
                 if (this.cursol < this.savedata.haveCaptureBomb)
                 {
                     ++this.cursol;
                 }
                 this.sound.PlaySE(SoundEffect.movecursol);
                 this.waittime = Input.IsPress(Button.Down) ? 10 : 4;
             }
         }
         else if (Input.IsPush(Button.Left))
         {
             if (!this.right)
             {
                 return;
             }
             this.right = false;
             if (this.cursol >= this.savedata.haveCaptureBomb)
             {
                 this.cursol = this.savedata.haveCaptureBomb - 1;
             }
             this.sound.PlaySE(SoundEffect.movecursol);
         }
         else
         {
             if (!Input.IsPush(Button.Right) || (this.right || this.savedata.stockVirus.Count <= 0))
             {
                 return;
             }
             this.right = true;
             this.sound.PlaySE(SoundEffect.movecursol);
         }
     }
     else
     {
         --this.waittime;
     }
 }