Beispiel #1
0
        private void MemberMouse_Over(object sender, EventArgs e)
        {
            //if (sender.GetType() == typeof(MemberBox))
            //{
            //MemberBox M;
            //    try
            //    {
            //    M = (MemberBox)sender;
            //    DescriptionBox.Text = M.host.Name + "\r\nLevel: " +
            //       M.host.Level.ToString() + "\r\n" +
            //       "STATS\r\nStrength: " +
            //       M.host.Strength.ToString() + "\r\nSkill: " +
            //       M.host.Skill.ToString() + "\r\nResistence: " +
            //       M.host.Resistence.ToString() + "\r\nIntelligence: " +
            //       M.host.intelligence.ToString() + "\r\n" +
            //       "SKILLS\r\nWeapon Arts: " +
            //       M.host.weaponArts.ToString() + "\r\nCombat Arts: " +
            //       M.host.combatArts.ToString() + "\r\nMage Tech: " +
            //       M.host.MageTech.ToString() + "\r\nTech: " +
            //       M.host.Tech.ToString() + "\r\n" +
            //       "TRAINING\r\n";

            //    foreach (string s in M.host.Training)
            //        DescriptionBox.Text += s + "\r\n";
            //    }
            //catch(Exception ex)
            //{
            //    DescriptionBox.Text = ex.Message;
            //}
            // }
            MemberBox M = (MemberBox)sender;

            DescriptionBox.Text = M.Display_Text;
        }
Beispiel #2
0
        private void End_Turn(object sender, EventArgs e)
        {//automatically scrolls to the bottom
            int x = 0;

            foreach (Character c in QuestParty)
            {
                if (c.NPC == false)
                {
                    members[x].END_TURN(Saturization);
                    if (members[x].Gathering)
                    {
                        Saturization -= 2;
                    }
                    if (members[x].Bursting)
                    {
                        CombatBox.Text += c.Name + " is Bursting!";
                    }
                    if (NarrowBox.Checked)
                    {
                        Saturization -= 2;
                    }
                    else
                    {
                        Saturization--;
                    }
                    x++;
                }
                else
                {
                    foreach (TabPage T in NPC_TabControl.TabPages)
                    {
                        MemberBox M = (MemberBox)T.Controls[0];
                        M.END_TURN(Saturization);
                    }
                }
                //navigate NPC tab
            }

            fill_Chart();
            Turn_Count++;
            TurnCount.Text = "Turn Count: " + Turn_Count.ToString();
            //update party stats and Saturation chart...
            //update turn count
        }
Beispiel #3
0
        private void Add_Tab(Character c, int[] stats, bool alive)
        {
            TabPage   New_T = new TabPage();
            MemberBox M     = new MemberBox();

            // int x = 0;
            // bool B = false;
            M.buildCurrentMember(c, stats, alive);
            //while (B == false)
            //{
            //    if (NPCMembers[x] == null)
            //        B = true;
            //    x++;
            //}
            // NPCMembers[x] = M;
            New_T.Name = c.Name;
            New_T.Text = c.Name;
            New_T.Controls.Add(M);
            NPC_TabControl.TabPages.Add(New_T);
        }
Beispiel #4
0
        private void SaveButton_Click(object sender, EventArgs e)
        {
            if (File.Exists(PartyPath + P_Name + ".GENPAR"))
            {
                File.Delete(PartyPath + P_Name + ".GENPAR");
            }

            if (!ReadFromFile)
            {
                P = new Party();
            }

            // int[] Reserves;
            int x = 0;
            int y = 0;

            //P.constructParty(QuestParty, P_Name);
            //debugging function
            P.inBattle    = battle;
            P.turnCount   = Turn_Count;
            P.Environment = Saturization;
            P.dayCount    = Day_Count;
            //P.Members.Clear();  //not set to instance of object //= new List<Character>();
            P.Members = QuestParty;
            P.clearMembers();

            //retrieve party energy and health information from member boxes and NPC member boxes to save into party
            foreach (Character c in QuestParty)
            {
                if (c.NPC)
                {
                    if (typeof(MemberBox) == NPC_TabControl.TabPages[y].Controls[0].GetType())
                    {
                        MemberBox NPC = (MemberBox)NPC_TabControl.TabPages[y].Controls[0];
                        //Reserves = NPC.get_energyStatus();
                        P.Save_Party_member(NPC.get_energyStatus(), NPC.get_healthStatus());
                        y++;    //cycle through NPC tabs
                    }
                }
                else
                {
                    //Reserves = members[x].get_energyStatus();
                    P.Save_Party_member(members[x].get_energyStatus(), members[x].get_healthStatus());
                    x++;     //cycle through party members
                }
            }
            //name and write party file
            P.Partyname = P_Name;
            FileStream fs = new FileStream(PartyPath + P_Name + ".GENPAR", FileMode.Create);

            // Construct a BinaryFormatter and use it to serialize the data to the stream.
            BinaryFormatter formatter = new BinaryFormatter();

            try
            {
                formatter.Serialize(fs, P);
            }
            catch (SerializationException SE)
            {
                Console.WriteLine("Failed to serialize. Reason: " + SE.Message);
                //throw;
            }
            finally
            {
                MessageBox.Show("Quest Saved!");
            }//END TRY/CATCH
        }
Beispiel #5
0
 private void Add_Status(MemberBox M)
 {
 }