Esempio n. 1
0
        private void FuncButton_Click(object sender, EventArgs e)
        {
            if (attacknum > 0)
            {
                attacknum--;
                for (int i = 0; i < 3; i++)
                {
                    OtherBox.Top += 10;
                    Thread.Sleep(50);
                    OtherBox.Top -= 10;
                    Thread.Sleep(50);
                    OtherBox.Left += 10;
                    Thread.Sleep(50);
                    OtherBox.Left -= 10;
                    Thread.Sleep(50);
                }

                FuncButton.Text = "攻擊鈕-剩餘" + attacknum + "次";
                monsterHP      -= monsterHP / (attacknum + 1);
                LabelOHP.Text   = "HP: " + monsterHP.ToString();

                if (attacknum == 0)
                {
                    kill++;
                    nextflag = true;
                    AddText("成功消滅怪物!");
                    OtherName.Text = OtherName.Text + "(消滅)";
                    FuncButton.Hide();
                    OtherBox.Image = Image.FromFile(Application.StartupPath + "\\dead.jpg");
                }
            }
        }
Esempio n. 2
0
 private void ResetState(bool subtotalOn)
 {
     foreach (var item in this.Controls)
     {
         FuncButton btn = (FuncButton)item;
         btn.SubtotalOn = subtotalOn;
     }
 }
Esempio n. 3
0
        void FuncKeyGroup_Load(object sender, EventArgs e)
        {
            foreach (var item in this.Controls)
            {
                FuncButton btn = (FuncButton)item;
                int        idx = int.Parse(btn.Name.Substring("button".Length));

                btn.VisibleIndex = idx;
                btn.SubtotalOn   = false;
                btn.AttachEvent();
                btn.KeyEvent += new OPOSKeyEventHandler(btn_KeyEvent);
            }
        }
Esempio n. 4
0
        private void FightButton_Click(object sender, EventArgs e)
        {
            if (monsterDa >= hp)
            {
                MessageBox.Show("勇者,還是快逃吧!");
            }
            else
            {
                EscapeButton.Hide();
                FightButton.Hide();

                FuncButton.Show();
                FuncButton.Text = "攻擊鈕-剩餘" + attacknum + "次";
            }
        }
Esempio n. 5
0
        void btn_Click(object sender, EventArgs e)
        {
            FuncButton fb = (FuncButton)sender;

            if (fb.MappedKey == null)
            {
                return;
            }

            var ev = OPOSKeyEventArgs.FromFuncCode(fb.MappedKey.CdFunc);

            if (ev != null && ev.Key.OPOSKey != OPOSMapKeys.INVALID)
            {
                btn_KeyEvent(ev);
            }
        }
Esempio n. 6
0
 public MainScreen()
 {
     InitializeComponent();
     //Story.SetNext(64);
     TutorialScreen.BringToFront();
     TutorialScreen.Show();
     CharacterName.Text = "";
     LabelODa.Text      = LabelOHP.Text = LabelDa.Text = LabelHP.Text = LabelLv.Text = "";
     kill    = hp = da = 0;
     lv      = 'C';
     Rank[1] = 'C';
     Rank[2] = 'B';
     Rank[3] = 'A';
     Rank[4] = 'S';
     FightButton.Hide();
     EscapeButton.Hide();
     FuncButton.Hide();
     da = 10;
     hp = 10;
     PocDefine();
 }
Esempio n. 7
0
 private void ResetState(bool subtotalOn)
 {
     if (this.InvokeRequired)
     {
         this.Invoke((MethodInvoker) delegate()
         {
             foreach (var item in this.Controls)
             {
                 FuncButton btn = (FuncButton)item;
                 btn.SubtotalOn = subtotalOn;
             }
         });
     }
     else
     {
         foreach (var item in this.Controls)
         {
             FuncButton btn = (FuncButton)item;
             btn.SubtotalOn = subtotalOn;
         }
     }
 }
Esempio n. 8
0
        private void PocDefine()
        {
            if (endflag)
            {
                this.Close();
                return;
            }
            int type = Story.GetStoryType();

            Addflag = true;
            //0 as Normal Story Line
            //1 as chararcter Screen
            //2 as Request
            if (type == 0)
            {
                onType = 0;
                TutorialScreen.Show();
                CharacterScreen.Hide();
                SetTutorialPic(Story.GetPicID());
                AddText(Story.GetStoryText());
            }
            if (type == 99)
            {
                onType = 0;
                CreateHero c = new CreateHero();
                AddText(Story.GetStoryText());
                c.ShowDialog();
                Story.next++;
                PocDefine();
                return;
            }
            if (type == 98)
            {
                onType = 1;
                TutorialScreen.Hide();
                CharacterScreen.Show();
                MainCharacter.Image = Image.FromFile(Application.StartupPath + "\\myHero.jpg");
                HandleEventString(Story.GetEventID());
                SetOtherPic(Story.GetPicID());
                AddText(Story.GetStoryText());
                Request r = new Request(Story.GetRequestID());
                r.ShowDialog();
                name = r.name;
            }
            if (type == 97)
            {
                onType = 1;
                TutorialScreen.Hide();
                CharacterScreen.Show();
                MainCharacter.Image = Image.FromFile(Application.StartupPath + "\\myHero.jpg");
                HandleEventString(Story.GetEventID());
                SetOtherPic(Story.GetPicID());
                AddText(Story.GetStoryText());
                nextflag        = false;
                attacknum       = 3;
                FuncButton.Text = "攻擊鈕-剩餘3次";
                FuncButton.Show();
            }
            if (type == 96)
            {
                onType = 1;
                TutorialScreen.Hide();
                CharacterScreen.Show();
                MainCharacter.Image = Image.FromFile(Application.StartupPath + "\\myHero.jpg");
                HandleEventString(Story.GetEventID());
                SetOtherPic(Story.GetPicID());
                AddText(Story.GetStoryText());
                LevelUP u = new LevelUP(1, 1, 2, "請使用++這個運算子來為想要提升之能力升級,請注意項目名稱和別忘了加上分號。打完後記得按ENTER確認唷!");
                u.ShowDialog();
                SetCharacter(u);
                Story.next++;
                PocDefine();
                return;
            }
            if (type == 95)
            {
                onType = 1;
                TutorialScreen.Hide();
                CharacterScreen.Show();
                MainCharacter.Image = Image.FromFile(Application.StartupPath + "\\myHero.jpg");
                HandleEventString(Story.GetEventID());
                SetOtherPic(Story.GetPicID());
                AddText(Story.GetStoryText());
                HandleEventString(Story.GetEventID());
                nextflag = false;
                FightButton.Show();
                EscapeButton.Show();
                Story.next++;
                return;
            }
            if (type == 1)
            {
                onType = 1;
                TutorialScreen.Hide();
                CharacterScreen.Show();
                MainCharacter.Image = Image.FromFile(Application.StartupPath + "\\myHero.jpg");
                HandleEventString(Story.GetEventID());
                SetOtherPic(Story.GetPicID());
                if (Addflag)
                {
                    AddText(Story.GetStoryText());
                }
            }

            if (type == 2)
            {
                onType = 1;
                TutorialScreen.Hide();
                CharacterScreen.Show();
                SetOtherPic(Story.GetPicID());
                HandleEventString(Story.GetEventID());
                AddText(Story.GetStoryText());
                MainCharacter.Image = Image.FromFile(Application.StartupPath + "\\myHero.jpg");
                Request r = new Request(Story.GetRequestID());
                r.ShowDialog();
                Story.next++;
                PocDefine();
                return;
            }
            if (type == 999)
            {
                onType = 0;
                TutorialScreen.Show();
                CharacterScreen.Hide();
                SetTutorialPic(Story.GetPicID());
                AddText(Story.GetStoryText());
                endflag = true;
            }
            Story.next++;
        }