private void cmdDefaultPlayer_Click(object sender, EventArgs e)
        {
            frmPlayerEditor NewForm = new frmPlayerEditor(ThisPlayer, world.Count);
            NewForm.ShowDialog();

            ThisPlayer = NewForm.Player;
        }
Ejemplo n.º 2
0
 public void LoadCampaign()
 {
     if (!this.InvokeRequired)
     {
         DataTypes.PlayerProfile newPlayer = LegendOfDrongoEngine.MainMenu(0);
         if (!string.IsNullOrEmpty(newPlayer.name))
         {
             pnlWarning.Visible         = false;
             txtConsoleOutput.TextAlign = HorizontalAlignment.Left;
             lblSkipIntro.Visible       = false;
             lblOptions.Visible         = true;
             tkbVolume.Visible          = true;
             lblVolume.Visible          = true;
             LegendOfDrongoEngine.StartGame(newPlayer);
             txtInput.Visible = true;
             txtInput.Focus();
             txtConsoleOutput.TextAlign = HorizontalAlignment.Left;
         }
     }
     else
     {
         BeginCampaign d = new BeginCampaign(LoadCampaign);
         this.Invoke(d);
     }
 }
Ejemplo n.º 3
0
        private void MainMenuChoice(int Choice)
        {
            if (Choice == 0)
            {
                txtConsoleOutput.TextAlign = HorizontalAlignment.Left;
                lblOptions.Visible         = false;
                tkbVolume.Visible          = false;
                lblVolume.Visible          = false;

                pnlWarning.Visible   = true;
                lblOkay.Visible      = false;
                lblSkipIntro.Visible = true;

                pnlMainMenu.Visible = false;

                thr.Start();
            }
            else
            {
                DataTypes.PlayerProfile newPlayer = LegendOfDrongoEngine.MainMenu(Choice);

                if (!string.IsNullOrEmpty(newPlayer.name))
                {
                    LegendOfDrongoEngine.StartGame(newPlayer);
                    txtInput.Visible = true;
                    txtInput.Focus();
                    txtConsoleOutput.TextAlign = HorizontalAlignment.Left;
                }
            }
        }
        public frmPlayerEditor(DataTypes.PlayerProfile ThisPlayer, int NumOfFloors)
        {
            InitializeComponent();
            ChangesMade = false;
            Player      = ThisPlayer;
            cmbFloor.Items.Clear();
            for (int i = 0; i < NumOfFloors; i++)
            {
                cmbFloor.Items.Add("Level " + (i + 1));
            }

            PopulatePlayer();
        }
        public static DataTypes.PlayerProfile DefaultPlayer()
        {
            DataTypes.PlayerProfile Player = new DataTypes.PlayerProfile();
            Player.name = "Drongo";
            Player.HPBonus = 100;
            Player.ArmorBonus = 0;

            //Set up starter inventory
            Player.inventory = new List<DataTypes.itemInfo>();
            Player.MaxItems = 10;
            Player.invspace = Player.MaxItems;

            //Set up game parameters
            Player.CurrentPos = new int[3] { 1, 1, 0 }; //Row, Column, Floor
            Player.Objective = "";
            Player.Money = 100;
            Player.DaysSinceSleep = 0;

            //Set up starter weapon
            Player.WeaponHeld.Name = "Fists";
            Player.WeaponHeld.BadHit = "Your Knuckles lightly graze your enemies cheek";
            Player.WeaponHeld.MedHit = "You hit your enemy with a quick jab to the ribs";
            Player.WeaponHeld.GoodHit = "A sound of crunching bone can be heard as your fist hits your enemy in the jaw";
            Player.WeaponHeld.AttackMod = 1;
            Player.WeaponHeld.CanPickUp = true;
            Player.WeaponHeld.InteractionName = new List<string>();
            Player.WeaponHeld.InteractionName.Add("fists");
            Player.WeaponHeld.InteractionName.Add("hands");
            Player.WeaponHeld.Class = "Weapon";
            Player.WeaponHeld.Examine = "Your own hands, how they got on the floor I will never know...";
            Player.ArmorWorn = new DataTypes.itemInfo[5];

            //Set Up Stats
            Player.Level = 1;
            Player.MaxHp = 100;
            Player.Speed = 1;
            Player.Resitence = 0;
            Player.Strength = 0;

            return Player;
        }
        public frmWorldDesigner(bool LoadWorld, string WorldName)
        {

            InitializeComponent();

            //Check If New World
            if (LoadWorld == true)
            {
                string LoadPath = string.Concat(Directory.GetCurrentDirectory(), "\\Worlds\\", WorldName);
                //MessageBox.Show(LoadPath);


                DataTypes.WorldFile WorldState = new DataTypes.WorldFile();
                using (Stream stream = File.Open(LoadPath, FileMode.Open))
                {
                    BinaryFormatter bin = new BinaryFormatter();
                    WorldState = (DataTypes.WorldFile)bin.Deserialize(stream);

                }
                txtWorldName.Text = WorldState.WorldName;
                txtAuthor.Text = WorldState.WorldAuthor;
                world = WorldState.WorldState;

                if (WorldState.Credits != null) foreach (string credit in WorldState.Credits) { Credits.Add(credit); }

                ThisFloor = world[0];
                txtFloorName.Text = ThisFloor.FloorName;
                txtMusicPath.Text = ThisFloor.FloorSong;
                ThisPlayer = WorldState.DefaultPlayer;
                cmbLevelSelect.Items.Clear();
                for (int i = 1; i <= world.Count; i++)
                {
                    cmbLevelSelect.Items.Add("Level " + i);
                }
                cmbLevelSelect.Items.Add("Add New Level...");
                this.tblWorldLevel.CellPaint += new TableLayoutCellPaintEventHandler(tblWorldLevel_CellPaint);
                lblEditor.Text = "Default Starting Position is B:2";
            }
            else
            {
                world = new List<DataTypes.Floor>();
                ThisFloor = new DataTypes.Floor();
                ThisFloor.CurrentFloor = new DataTypes.roomInfo[10, 10];

                for (int x = 0; x < 10; x++)
                {
                    for (int y = 0; y < 10; y++)
                    {
                        ThisFloor.CurrentFloor[x, y].CanMove = true;
                    }
                }

                for (int x = 0; x < 10; x++)
                {
                    ThisFloor.CurrentFloor[x, 0].CanMove = false;
                    ThisFloor.CurrentFloor[x, 9].CanMove = false;
                }

                for (int y = 0; y < 10; y++)
                {
                    ThisFloor.CurrentFloor[0, y].CanMove = false;
                    ThisFloor.CurrentFloor[9, y].CanMove = false;
                }
                ThisFloor.CurrentFloor[1, 1].Description = "This is the starting position. When the player spawns this is the first thing they will read";

                world.Add(ThisFloor);
                this.tblWorldLevel.CellPaint += new TableLayoutCellPaintEventHandler(tblWorldLevel_CellPaint);
                txtFloorName.Text = "Level 1";
                lblEditor.Text = "Default Starting Position is B:2";
                ThisPlayer = DefaultPlayer();
            }
            SetWorldSize();
            AddTableLabels();
        }