Ejemplo n.º 1
0
        public override void UpDate()
        {
            if (this.bootAddon)
            {
                this.manager.UpDate();
            }
            else
            {
                switch (this.nowscene)
                {
                case Virus.SCENE.fadein:
                    if (this.Alpha > 0)
                    {
                        this.Alpha -= 51;
                        break;
                    }
                    this.nowscene = Virus.SCENE.select;
                    break;

                case Virus.SCENE.select:
                    if (this.selectstyle && !this.eventmanager.playevent)
                    {
                        if (this.cursol == 0)
                        {
                            this.cursolOld = this.savedata.selectQuestion;
                            if (this.savedata.havePeace[this.savedata.selectQuestion] > 0)
                            {
                                switch (this.savedata.selectQuestion)
                                {
                                case 0:
                                    if (this.savedata.HaveVirus[this.page].eatBug < 40)
                                    {
                                        ++this.savedata.HaveVirus[this.page].eatBug;
                                        if (this.savedata.HaveVirus[this.page].eatBug % 20 == 0)
                                        {
                                            this.sound.PlaySE(SoundEffect.bright);
                                            this.savedata.HaveVirus[this.page].ReturnVirus(this.savedata.HaveVirus[this.page].type);
                                        }
                                        --this.savedata.havePeace[this.savedata.selectQuestion];
                                        this.sound.PlaySE(SoundEffect.repair);
                                        break;
                                    }
                                    this.eventmanager.events.Clear();
                                    var dialogue = ShanghaiEXE.Translate("Virus.FeedFailedDialogue1");
                                    this.eventmanager.AddEvent(new CommandMessage(this.sound, this.eventmanager, dialogue[0], dialogue[1], dialogue[2], dialogue.Face, this.savedata));
                                    break;

                                case 1:
                                    ++this.savedata.HaveVirus[this.page].eatFreeze;
                                    --this.savedata.havePeace[this.savedata.selectQuestion];
                                    this.sound.PlaySE(SoundEffect.repair);
                                    break;

                                case 2:
                                    ++this.savedata.HaveVirus[this.page].eatError;
                                    --this.savedata.havePeace[this.savedata.selectQuestion];
                                    this.sound.PlaySE(SoundEffect.repair);
                                    break;
                                }
                            }
                            else
                            {
                                this.sound.PlaySE(SoundEffect.error);
                                this.eventmanager.events.Clear();
                                var dialogue = ShanghaiEXE.Translate("Virus.FeedFailedNoItemsDialogue1");
                                this.eventmanager.AddEvent(new CommandMessage(this.sound, this.eventmanager, dialogue[0], dialogue[1], dialogue[2], dialogue.Face, this.savedata));
                            }
                            this.selectstyle = false;
                        }
                        else
                        {
                            if (this.savedata.selectQuestion == 0)
                            {
                                this.sound.PlaySE(SoundEffect.warp);
                                this.eventmanager.events.Clear();
                                var dialogue = ShanghaiEXE.Translate("Virus.DismissDialogue1");
                                this.eventmanager.AddEvent(new CommandMessage(this.sound, this.eventmanager, dialogue[0], dialogue[1], dialogue[2], dialogue.Face, this.savedata));
                                this.savedata.stockVirus.Add(this.savedata.HaveVirus[this.page]);
                                this.savedata.HaveVirus[this.page] = null;
                            }
                            this.selectstyle = false;
                        }
                    }
                    this.Control();
                    if (this.eventmanager.playevent)
                    {
                        this.eventmanager.UpDate();
                    }
                    this.FlamePlus();
                    break;

                case Virus.SCENE.fadeout:
                    if (this.Alpha < byte.MaxValue)
                    {
                        this.Alpha += 51;
                        break;
                    }
                    if (!this.boot)
                    {
                        this.player.parent.main.FolderReset();
                        this.topmenu.Return();
                    }
                    else
                    {
                        this.bootAddon = true;
                    }
                    break;
                }
            }
        }
Ejemplo n.º 2
0
        public void Control()
        {
            if (!this.eventmanager.playevent && this.savedata.HaveVirus[this.page] != null)
            {
                if (Input.IsPress(Button._A))
                {
                    var question = new Dialogue();
                    var options  = new Dialogue();
                    switch (this.cursol)
                    {
                    case 0:
                        if (this.savedata.HaveVirus[this.page].eatSum < 50)
                        {
                            this.sound.PlaySE(SoundEffect.decide);
                            this.selectstyle = true;
                            question         = ShanghaiEXE.Translate("Virus.FeedQuestion");
                            options          = ShanghaiEXE.Translate("Virus.FeedOptionsFormat").Format(this.savedata.havePeace[0], this.savedata.havePeace[1], this.savedata.havePeace[2]);
                            Question question1 = new Question(this.sound, this.eventmanager, options[0], options[1], options[2], true, true, question.Face, this.savedata);
                            question1.MoveCursol(this.cursolOld);
                            this.eventmanager.events.Clear();
                            this.eventmanager.AddEvent(question1);
                            break;
                        }
                        this.sound.PlaySE(SoundEffect.error);
                        break;

                    case 1:
                        this.sound.PlaySE(SoundEffect.decide);
                        this.selectstyle = true;
                        question         = ShanghaiEXE.Translate("Virus.DismissQuestion");
                        options          = ShanghaiEXE.Translate("Virus.DismissOptions");
                        Question question2 = new Question(this.sound, this.eventmanager, question[0], options[0], options[1], true, true, true, question.Face, this.savedata, true);
                        question2.MoveCursol(this.cursolOld);
                        this.eventmanager.events.Clear();
                        this.eventmanager.AddEvent(question2);
                        break;
                    }
                }
                if (Input.IsPress(Button.Up))
                {
                    this.sound.PlaySE(SoundEffect.movecursol);
                    --this.cursol;
                    if (this.cursol < 0)
                    {
                        this.cursol = 1;
                    }
                }
                if (Input.IsPress(Button.Down))
                {
                    this.sound.PlaySE(SoundEffect.movecursol);
                    ++this.cursol;
                    if (this.cursol > 1)
                    {
                        this.cursol = 0;
                    }
                }
            }
            if (Input.IsPress(Button._B))
            {
                this.sound.PlaySE(SoundEffect.cancel);
                if (this.selectstyle)
                {
                    this.selectstyle = false;
                    this.eventmanager.ClearEvent();
                }
                else if (!this.eventmanager.playevent)
                {
                    this.boot     = false;
                    this.nowscene = Virus.SCENE.fadeout;
                }
            }
            if (!this.eventmanager.playevent)
            {
                if (Input.IsPress(Button._R) && this.RightOK)
                {
                    this.sound.PlaySE(SoundEffect.movecursol);
                    ++this.page;
                }
                if (!Input.IsPress(Button._L) || !this.LeftOK)
                {
                    return;
                }
                this.sound.PlaySE(SoundEffect.movecursol);
                --this.page;
            }
            else if (this.waittime > 0)
            {
                --this.waittime;
            }
        }