Ejemplo n.º 1
0
        private void RunSetting()
        {
            this.savedata.AddonReset();
            this.savedata.equipAddon = ((IEnumerable <bool>) this.setAddOn).ToList <bool>();
            this.savedata.AddonSkillReset();
            foreach (var data in this.savedata.haveAddon.Select((v, i) => new
            {
                v,
                i
            }))
            {
                if (this.setAddOn[data.i])
                {
                    this.savedata.addonNames.Add(data.v.name);
                    data.v.Running(this.savedata);
                }
            }
            if (this.savedata.HPNow > this.savedata.HPMax)
            {
                this.savedata.HPNow = this.savedata.HPMax;
            }

            this.savedata.AddonSet();
            this.massage      = !this.OneSet() ? "NONE...           " : this.savedata.addonNames[0] + "...           ";
            this.printedItems = 0;
            this.printfonts   = 0;
            this.printedItems = 0;
            this.barprint     = 0;
            this.shortmassage = "";
            this.nowscene     = AddOnManager.SCENE.runnning;
            this.sound.PlaySE(SoundEffect.charge);
        }
Ejemplo n.º 2
0
        private void Running()
        {
            bool flag1 = false;
            bool flag2 = false;

            if (!this.runend)
            {
                if (this.alphaminas)
                {
                    if (this.barAlpha < 40)
                    {
                        this.alphaminas = false;
                    }
                    else
                    {
                        --this.barAlpha;
                    }
                }
                else if (this.barAlpha > 140)
                {
                    this.alphaminas = true;
                }
                else
                {
                    ++this.barAlpha;
                }
                if (this.barprint < this.barlong)
                {
                    ++this.barprint;
                }
                else
                {
                    flag1 = true;
                }
                if (this.OneSet())
                {
                    if (this.frame % 1 == 0)
                    {
                        ++this.printfonts;
                        if (this.printfonts > this.massage.Length)
                        {
                            ++this.printedItems;
                            if (this.printedItems >= this.savedata.addonNames.Count)
                            {
                                flag2 = true;
                            }
                            else
                            {
                                this.massage      = this.savedata.addonNames.Count <= 8 ? this.savedata.addonNames[this.printedItems] + "...           " : this.savedata.addonNames[this.printedItems] + "...";
                                this.shortmassage = "";
                                this.printfonts   = 0;
                            }
                        }
                        else
                        {
                            this.shortmassage += this.ToDecomposition(this.massage)[this.printfonts - 1];
                            if (this.printfonts - 1 < this.savedata.addonNames[this.printedItems].Length)
                            {
                                this.sound.PlaySE(SoundEffect.openchip);
                            }
                        }
                    }
                }
                else
                {
                    flag2 = true;
                }
                if (!(flag1 & flag2))
                {
                    return;
                }
                this.sound.PlaySE(SoundEffect.bright);
                this.shortmassage = "OK!";
                this.runend       = true;
            }
            else if (this.barAlpha > 0)
            {
                --this.barAlpha;
            }
            else
            {
                this.runend   = false;
                this.nowscene = AddOnManager.SCENE.select;
            }
        }
Ejemplo n.º 3
0
 private void Control()
 {
     if (Input.IsPress(Button._A))
     {
         this.AButton();
     }
     if (Input.IsPress(Button._B))
     {
         this.sound.PlaySE(SoundEffect.cancel);
         if (this.change)
         {
             this.nowscene = AddOnManager.SCENE.eroor;
             this.eventmanager.events.Clear();
             this.eventmanager.AddEvent(new OpenMassageWindow(this.sound, this.eventmanager));
             var question = ShanghaiEXE.Translate("AddOnManager.ExitQuestion");
             var options  = ShanghaiEXE.Translate("AddOnManager.ExitOptions");
             this.eventmanager.AddEvent(new Question(this.sound, this.eventmanager, question[0], question[1], options[0], options[1], true, true, question.Face, this.savedata, true));
             this.eventmanager.AddEvent(new CloseMassageWindow(this.sound, this.eventmanager));
         }
         else
         {
             this.nowscene = AddOnManager.SCENE.fadeout;
         }
     }
     if (this.waittime <= 0)
     {
         int num1 = this.savedata.haveAddon.Count - 5;
         if (Input.IsPush(Button.Up))
         {
             if (this.select > 0)
             {
                 --this.select;
                 if (this.cursol > 0)
                 {
                     --this.cursol;
                 }
                 else
                 {
                     --this.top;
                 }
                 this.sound.PlaySE(SoundEffect.movecursol);
                 this.waittime = Input.IsPress(Button.Up) ? 10 : 4;
             }
         }
         else if (Input.IsPush(Button.Down))
         {
             if (this.select < this.savedata.haveAddon.Count - 1)
             {
                 ++this.select;
                 if (this.cursol < 5)
                 {
                     ++this.cursol;
                 }
                 else
                 {
                     ++this.top;
                 }
                 this.sound.PlaySE(SoundEffect.movecursol);
                 this.waittime = Input.IsPress(Button.Down) ? 10 : 4;
             }
         }
         else if (Input.IsPush(Button._R))
         {
             int num2 = this.select + 5 < this.savedata.haveAddon.Count ? 5 : this.savedata.haveAddon.Count - this.select - 1;
             if (num2 > 5)
             {
                 num2 = 5;
             }
             if (num2 > 0)
             {
                 this.sound.PlaySE(SoundEffect.movecursol);
                 this.top    += num2;
                 this.select += num2;
             }
             this.waittime = Input.IsPress(Button._R) ? 10 : 4;
         }
         else if (Input.IsPush(Button._L))
         {
             int num2 = this.top;
             if (num2 > num1)
             {
                 num2 = num1;
             }
             if (num2 > 5)
             {
                 num2 = 5;
             }
             if (num2 > 0)
             {
                 this.sound.PlaySE(SoundEffect.movecursol);
                 this.top    -= num2;
                 this.select -= num2;
             }
             this.waittime = Input.IsPress(Button._L) ? 10 : 4;
         }
     }
     else
     {
         --this.waittime;
     }
     if (Input.IsPush(Button._Select))
     {
         this.sound.PlaySE(SoundEffect.decide);
         this.sortflag = true;
         this.upper    = false;
     }
     if (!Input.IsPush(Button._Start))
     {
         return;
     }
     this.sound.PlaySE(SoundEffect.decide);
     this.change = false;
     this.RunSetting();
 }
Ejemplo n.º 4
0
        public override void UpDate()
        {
            switch (this.nowscene)
            {
            case AddOnManager.SCENE.fadein:
                if (this.Alpha > 0)
                {
                    this.Alpha -= 51;
                    break;
                }
                this.Tutorial();
                this.nowscene = AddOnManager.SCENE.select;
                break;

            case AddOnManager.SCENE.select:
                if (this.eventmanager.playevent)
                {
                    this.eventmanager.UpDate();
                    break;
                }
                if (!this.sortflag)
                {
                    this.Control();
                }
                else
                {
                    this.SortControl();
                }
                break;

            case AddOnManager.SCENE.runnning:
                this.Running();
                break;

            case AddOnManager.SCENE.eroor:
                if (this.eventmanager.playevent)
                {
                    this.eventmanager.UpDate();
                    break;
                }
                this.nowscene = this.savedata.selectQuestion != 0 ? AddOnManager.SCENE.select : AddOnManager.SCENE.fadeout;
                break;

            case AddOnManager.SCENE.fadeout:
                if (this.Alpha < byte.MaxValue)
                {
                    this.Alpha += 51;
                    break;
                }
                this.navi.Back();
                break;
            }
            if (this.frame % 5 == 0)
            {
                this.flash = !this.flash;
            }
            if (this.frame % 10 == 0)
            {
                ++this.cursolanime;
            }
            if (this.cursolanime >= 3)
            {
                this.cursolanime = 0;
            }
            this.MoveAlpha();
            this.FlamePlus();
        }