Ejemplo n.º 1
0
 private void button8_Click(object sender, EventArgs e)
 {
     p = p.another;
     if (placechk == 1)
     {
         placechk = 0;
     }
     mode = 1;
     storyvis(p.surroundings);
 }
Ejemplo n.º 2
0
 private void storyload()
 {
     string[] txt  = File.ReadAllLines(path + "storypage.txt", Encoding.Default);
     string[] way1 = File.ReadAllLines(path + "1.txt", Encoding.Default);
     string[] way2 = File.ReadAllLines(path + "2.txt", Encoding.Default);
     way2list.Append(way2[0], way2[1], way2[2], way2[3], way2[4], way2[5], Convert.ToInt32(way2[6]), Convert.ToInt32(way2[7]), Convert.ToInt32(way2[8]), Convert.ToInt32(way2[9]));
     for (int a = 1; a < (way2.Length / 10); a++)
     {
         way2list.Append(way2[a * 10], way2[a * 10 + 1], way2[a * 10 + 2], way2[a * 10 + 3], way2[a * 10 + 4], way2[a * 10 + 5], Convert.ToInt32(way2[a * 10 + 6]), Convert.ToInt32(way2[a * 10 + 7]), Convert.ToInt32(way2[a * 10 + 8]), Convert.ToInt32(way2[a * 10 + 9]));
     }
     way1list.Append(way1[0], way1[1], way1[2], way1[3], way1[4], way1[5], Convert.ToInt32(way1[6]), Convert.ToInt32(way1[7]), Convert.ToInt32(way1[8]), Convert.ToInt32(way1[9]));
     p = way1list.head;
     for (int a = 1; a < (way1.Length / 10); a++)
     {
         way1list.Append(way1[a * 10], way1[a * 10 + 1], way1[a * 10 + 2], way1[a * 10 + 3], way1[a * 10 + 4], way1[a * 10 + 5], Convert.ToInt32(way1[a * 10 + 6]), Convert.ToInt32(way1[a * 10 + 7]), Convert.ToInt32(way1[a * 10 + 8]), Convert.ToInt32(way1[a * 10 + 9]));
         p = p.next;
         if (p.anotherway == 2)
         {
             p.another = way2list.head;
         }
         if (p.anotherway == 3)
         {
             p.another = end1.head;
         }
     }
     estory.Append(txt[0], txt[1], txt[2], txt[3], txt[4], txt[5], Convert.ToInt32(txt[6]), Convert.ToInt32(txt[7]), Convert.ToInt32(txt[8]), Convert.ToInt32(txt[9]));
     p = estory.head;
     for (int a = 1; a < (txt.Length / 10); a++)
     {
         estory.Append(txt[a * 10], txt[a * 10 + 1], txt[a * 10 + 2], txt[a * 10 + 3], txt[a * 10 + 4], txt[a * 10 + 5], Convert.ToInt32(txt[a * 10 + 6]), Convert.ToInt32(txt[a * 10 + 7]), Convert.ToInt32(txt[a * 10 + 8]), Convert.ToInt32(txt[a * 10 + 9]));
         p = p.next;
         if (p.anotherway == 1)
         {
             p.another = way1list.head;
         }
         if (p.anotherway == 3)
         {
             p.another = end1.head;
         }
     }
     p = estory.head;
     p = p.next;
     p = p.next;
     truehead.head.next.next = p;
     if (generation == 0)
     {
         p = estory.head;
     }
     for (int a = 0; a < place; a++)
     {
         p = p.next;
     }
 }
Ejemplo n.º 3
0
 public story(string srod, string npc, string npcna, string says, string planame, string emychk, int hp, int atk, int interval, int way)
 {
     this.surroundings     = srod;
     this.npccheck         = npc;
     this.npcname          = npcna;
     this.npcsays          = says;
     this.placename        = planame;
     this.enemycheck       = emychk;
     this.enemymaxhp       = hp;
     this.enemyatk         = atk;
     this.enemyatkinterval = interval;
     this.anotherway       = way;
     this.next             = null;
     this.another          = null;
 }
Ejemplo n.º 4
0
        public void Append(string srod, string npc, string npcna, string says, string planame, string emychk, int hp, int atk, int interval, int way)
        {
            story foot = new story(srod, npc, npcna, says, planame, emychk, hp, atk, interval, way);
            story A    = new story();

            if (head == null)
            {
                head = foot;
                return;
            }
            A = head;
            while (A.next != null)
            {
                A = A.next;
            }
            A.next = foot;
        }
Ejemplo n.º 5
0
 private void timer2_Tick(object sender, EventArgs e)         //敌人攻击时间
 {
     enemyval -= 10;
     if (enemyval > 1000)
     {
         label11.ForeColor = Color.DeepSkyBlue;
     }
     else if (enemyval > 600)
     {
         label11.ForeColor = Color.Goldenrod;
     }
     else if (enemyval > 0)
     {
         label11.ForeColor = Color.Red;
     }
     else
     {
         truedamage      = p.enemyatk + rand.Next(-10, 11);
         label25.Text    = "-" + truedamage.ToString();
         hp             -= truedamage;
         label3.Text     = hp.ToString();
         label25.Visible = true;
         timer3.Start();
         if (hp <= 0)
         {
             timer1.Stop();
             timer2.Stop();
             label11.Text = enemyval.ToString();
             MessageBox.Show("复仇的机械永不停止,而你只是其中崩坏的一小块齿轮。你不知道你构成的机械最终铸造了什么,你只知道,你不能停下来。");
             hp = maxhp;
             p  = truehead.head;
             generation++;
             label23.Visible = false;
             storyvis(p.surroundings);
             return;
         }
         label11.ForeColor = Color.DeepSkyBlue;
         atkdirection      = rand.Next(0, 4);
         label14.Text      = enemyattack[atkdirection];
         enemyval          = p.enemyatkinterval;
     }
     label11.Text = enemyval.ToString();
 }
Ejemplo n.º 6
0
 public story()
 {
     this.next    = null;
     this.another = null;
 }
Ejemplo n.º 7
0
        private void button7_Click(object sender, EventArgs e)                           //每次按下一页的处理
        {
            switch (mode)
            {
            case 1:
            {
                if (p.npccheck == "1")
                {
                    mode            = 2;
                    label23.Text    = p.npcname;
                    label23.Visible = true;
                    storyvis(p.npcsays);
                }
                else
                {
                    if (p.next == null)
                    {
                        p     = truehead.head;
                        place = 0;
                        generation++;
                    }
                    else
                    {
                        p = p.next;
                    }
                    if (placechk == 1)
                    {
                        place++;
                    }
                    mode            = 1;
                    label23.Visible = false;
                    storyvis(p.surroundings);
                }
                break;
            }

            case 2:
            {
                if (p.enemycheck == "1")
                {
                    fightvis();
                }
                else
                {
                    if (p.next == null)
                    {
                        p     = truehead.head;
                        place = 0;
                        generation++;
                    }
                    else
                    {
                        p = p.next;
                    }
                    if (placechk == 1)
                    {
                        place++;
                    }
                    mode            = 1;
                    label23.Visible = false;
                    storyvis(p.surroundings);
                }
                break;
            }

            case 3:
            {
                if (p.next == null)
                {
                    p = truehead.head;
                }
                else
                {
                    if (placechk == 1)
                    {
                        place++;
                    }
                    p = p.next;
                }
                mode            = 1;
                label23.Visible = false;
                storyvis(p.surroundings);
                break;
            }
            }
        }
Ejemplo n.º 8
0
 public storylist()
 {
     head = null;
 }