private void button1_Click(object sender, EventArgs e)
        {
            bool bThisAbilityIsOkToAdd = true;

            if (!textBox3.Text.Equals(""))
            {
                if (MapBuilder.gcDB.gameAbilities.Find(a => a.abilityName.Equals(textBox3.Text)) != null)
                {
                    bThisAbilityIsOkToAdd = false;
                    MessageBox.Show("Please create only abilities with UNIQUE names, ability creation cancelled.");
                }
            }
            if (!textBox3.Text.Equals("") && bThisAbilityIsOkToAdd)
            {
                BasicAbility newAbility = new BasicAbility();
                newAbility.AbilityHitChance = 80;
                newAbility.CreateAbility();
                newAbility.abilityName = textBox3.Text;
                selectedAbility        = newAbility;
                MapBuilder.gcDB.AddAbility(selectedAbility);
                // MapBuilder.gcDB.gameAbilities.Add(selectedAbility);
                //AssignValues();
                listBox1.Items.Clear();
                listBox1.Items.AddRange(MapBuilder.gcDB.gameAbilities.ToArray());
                textBox3.Text = "";
            }
        }
 public void Start()
 {
     Show();
     textBox1.Text = "";
     ResetAbilityList();
     selectedAbility = null;
 }
Example #3
0
        private void button2_Click(object sender, EventArgs e)
        {
            BasicAbility tempClone = selectedAbility.Clone();

            MapBuilder.gcDB.AddAbility(tempClone);
            selectedClass.AddAbility(tempClone);
            Close();
        }
 private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (listBox1.SelectedIndex != -1)
     {
         selectedAbility = (BasicAbility)listBox1.SelectedItem;
         AssignValues();
     }
 }
Example #5
0
 private void listBox2_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (listBox2.SelectedIndex != -1 && selectedClass != null && listBox1.SelectedIndex != -1)
     {
         selectedAbility = (BasicAbility)listBox2.SelectedItem;
         listBox3.Items.Clear();
         MapBuilder.gcDB.gameClasses.FindAll(sa => sa.classAbilitiesIDs.Contains(selectedAbility.abilityIdentifier));
     }
 }
        private void button12_Click(object sender, EventArgs e)
        {
            if (listBox1.SelectedIndex != -1)
            {
                BasicAbility ba = (BasicAbility)listBox1.SelectedItem;
                if (ba.abilityIcon.texFileLoc.Equals(""))
                {
                    MessageBox.Show("Please select base texture file.");
                    OpenFileDialog openTex = new OpenFileDialog();
                    openTex.Title = "Open texture file";
                    if (Game1.bIsDebug)
                    {
                        openTex.Filter           = "Texture File|*.jpg;*.png;*.jpeg;*.xnb";
                        openTex.InitialDirectory = Game1.rootContent;
                    }
                    else
                    {
                        openTex.Filter           = "Texture File|*.jpg;*.png;*.jpeg";
                        openTex.InitialDirectory = Game1.rootContentExtra;
                    }

                    bool bDone = false;

                    while (!bDone)
                    {
                        DialogResult dia = openTex.ShowDialog();
                        if (dia == DialogResult.OK && openTex.FileName.Contains(openTex.InitialDirectory))
                        {
                            ba.abilityIcon.texFileLoc = openTex.FileName.Replace(Game1.rootContent, "").Substring(0, openTex.FileName.Replace(Game1.rootContent, "").LastIndexOf("."));
                            Console.WriteLine("Successful item texture selection");
                            bDone = true;
                        }
                        else if (!openTex.FileName.Contains(openTex.InitialDirectory))
                        {
                            MessageBox.Show(@"Please select a file within the application folder under Content\Mods and it's subfolders");
                        }
                        else if (dia == DialogResult.Cancel)
                        {
                            bDone = true;
                        }
                    }
                }

                try
                {
                    ba.ReloadTexture();
                    FrameSelector.StartComplex(ba.abilityIcon, (int)frameWidth.Value, (int)frameHeight.Value, (int)xOffSet.Value, (int)yOffSet.Value);
                }
                catch
                {
                    throw;
                }
            }
        }
Example #7
0
        public override void CreateItemData(Dictionary <string, string> itemData)
        {
            if (itemData != null)
            {
                this.BasicAbility   = new List <string>();
                this.RefineAbility  = new List <string>();
                this.SpecialAbility = new List <string>();
                this.AbilityPattern = new List <string>();

                this.Name           = itemData[Utility.HEADER_DEFINE_NAME];
                this.Url            = itemData[Utility.HEADER_DEFINE_URL];
                this.Description    = itemData[Utility.HEADER_DEFINE_ABILITY];
                this.RequireLevel   = (!itemData.ContainsKey(Utility.HEADER_DEFINE_LV) || itemData[Utility.HEADER_DEFINE_LV] == "-") ? 1 : int.Parse(itemData[Utility.HEADER_DEFINE_LV]);
                this.Classification = itemData[Utility.HEADER_DEFINE_CLASSIFICATION];
                this.EquipableJobs  = (!itemData.ContainsKey(Utility.HEADER_DEFINE_EQUIPABLE_JOBS) || itemData[Utility.HEADER_DEFINE_EQUIPABLE_JOBS] == Utility.ALL_JOBS) ? allJobs : itemData[Utility.HEADER_DEFINE_EQUIPABLE_JOBS].Replace(" ", "").Split(new char[] { ',' });
                AbilityList         = AbilityCalc(BasicAbility.Concat(RefineAbility).Concat(SpecialAbility).ToList());
            }
        }
Example #8
0
        private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (listBox1.SelectedIndex != -1)
            {
                selectedAbility = (BasicAbility)listBox1.SelectedItem;
                if (selectedClass.classAbilities.Find(ba => ba.abilityIdentifier == selectedAbility.abilityIdentifier) == default(BasicAbility))
                {
                    button1.Enabled = true;
                }
                else
                {
                    button1.Enabled = false;
                }

                button2.Enabled = true;
            }
            else
            {
                button1.Enabled = false;
                button2.Enabled = false;
            }
        }
        private void button4_Click_1(object sender, EventArgs e)
        {
            if (listBox1.SelectedIndex != -1)
            {
                BasicAbility ba = (BasicAbility)listBox1.SelectedItem;

                MessageBox.Show("Please select sound file.");
                OpenFileDialog openTex = new OpenFileDialog();
                openTex.Title = "Open sound file";

                openTex.Filter           = "Sound File|*.wav;*.wma;*.ogg;*.xnb";
                openTex.InitialDirectory = Game1.rootContent;


                bool bDone = false;

                while (!bDone)
                {
                    DialogResult dia = openTex.ShowDialog();
                    if (dia == DialogResult.OK && openTex.FileName.Contains(openTex.InitialDirectory))
                    {
                        ba.soundEffectLoc = openTex.FileName.Replace(Game1.rootContent, "").Substring(0, openTex.FileName.Replace(Game1.rootContent, "").LastIndexOf("."));
                        Console.WriteLine("Successful item texture selection");
                        bDone = true;
                    }
                    else if (dia == DialogResult.Cancel)
                    {
                        bDone = true;
                    }
                    else if (!openTex.FileName.Contains(openTex.InitialDirectory))
                    {
                        MessageBox.Show(@"Please select a file within the application folder under Content\Mods and it's subfolders");
                    }
                }
            }
        }
Example #10
0
    static public void LoadAbilityData()
    {
        BasicAbility TAbility = new BasicAbility();

        Ability [0].AbilitySize = 0;
        TAbility.AbilitySize    = 2;
        TAbility.Pos            = new AbilityPosition [2];
        TAbility.Pos [0].x      = -1;
        TAbility.Pos [0].y      = 0;
        TAbility.Pos [1].x      = 1;
        TAbility.Pos [1].y      = 0;
        Ability [1]             = TAbility;
        TAbility.AbilitySize    = 2;
        TAbility.Pos            = new AbilityPosition [2];
        TAbility.Pos [0].x      = 0;
        TAbility.Pos [0].y      = -1;
        TAbility.Pos [1].x      = 0;
        TAbility.Pos [1].y      = 1;
        Ability [2]             = TAbility;
        TAbility.AbilitySize    = 4;
        TAbility.Pos            = new AbilityPosition [4];
        TAbility.Pos [0].x      = -1;
        TAbility.Pos [0].y      = 0;
        TAbility.Pos [1].x      = 1;
        TAbility.Pos [1].y      = 0;
        TAbility.Pos [2].x      = 0;
        TAbility.Pos [2].y      = -1;
        TAbility.Pos [3].x      = 0;
        TAbility.Pos [3].y      = 1;
        Ability [3]             = TAbility;
        TAbility.AbilitySize    = 2;
        TAbility.Pos            = new AbilityPosition [2];
        TAbility.Pos [0].x      = -1;
        TAbility.Pos [0].y      = -1;
        TAbility.Pos [1].x      = 1;
        TAbility.Pos [1].y      = 1;
        Ability [4]             = TAbility;
        TAbility.AbilitySize    = 2;
        TAbility.Pos            = new AbilityPosition [2];
        TAbility.Pos [0].x      = -1;
        TAbility.Pos [0].y      = 1;
        TAbility.Pos [1].x      = 1;
        TAbility.Pos [1].y      = -1;
        Ability [5]             = TAbility;
        TAbility.AbilitySize    = 4;
        TAbility.Pos            = new AbilityPosition [4];
        TAbility.Pos [0].x      = -1;
        TAbility.Pos [0].y      = -1;
        TAbility.Pos [1].x      = 1;
        TAbility.Pos [1].y      = 1;
        TAbility.Pos [2].x      = -1;
        TAbility.Pos [2].y      = 1;
        TAbility.Pos [3].x      = 1;
        TAbility.Pos [3].y      = -1;
        Ability [6]             = TAbility;
        TAbility.AbilitySize    = 8;
        TAbility.Pos            = new AbilityPosition [8];
        TAbility.Pos [0].x      = -1;
        TAbility.Pos [0].y      = 0;
        TAbility.Pos [1].x      = 1;
        TAbility.Pos [1].y      = 0;
        TAbility.Pos [2].x      = 0;
        TAbility.Pos [2].y      = -1;
        TAbility.Pos [3].x      = 0;
        TAbility.Pos [3].y      = 1;
        TAbility.Pos [4].x      = -1;
        TAbility.Pos [4].y      = -1;
        TAbility.Pos [5].x      = 1;
        TAbility.Pos [5].y      = 1;
        TAbility.Pos [6].x      = -1;
        TAbility.Pos [6].y      = 1;
        TAbility.Pos [7].x      = 1;
        TAbility.Pos [7].y      = -1;
        Ability [7]             = TAbility;
        TAbility.AbilitySize    = 8;
        TAbility.Pos            = new AbilityPosition [8];
        TAbility.Pos [0].x      = -2;
        TAbility.Pos [0].y      = 0;
        TAbility.Pos [1].x      = -1;
        TAbility.Pos [1].y      = 0;
        TAbility.Pos [2].x      = 1;
        TAbility.Pos [2].y      = 0;
        TAbility.Pos [3].x      = 2;
        TAbility.Pos [3].y      = 0;
        TAbility.Pos [4].x      = 0;
        TAbility.Pos [4].y      = -2;
        TAbility.Pos [5].x      = 0;
        TAbility.Pos [5].y      = -1;
        TAbility.Pos [6].x      = 0;
        TAbility.Pos [6].y      = 1;
        TAbility.Pos [7].x      = 0;
        TAbility.Pos [7].y      = 2;
        Ability [8]             = TAbility;
        TAbility.AbilitySize    = 8;
        TAbility.Pos            = new AbilityPosition [8];
        TAbility.Pos [0].x      = -2;
        TAbility.Pos [0].y      = -2;
        TAbility.Pos [1].x      = -1;
        TAbility.Pos [1].y      = -1;
        TAbility.Pos [2].x      = 1;
        TAbility.Pos [2].y      = 1;
        TAbility.Pos [3].x      = 2;
        TAbility.Pos [3].y      = 2;
        TAbility.Pos [4].x      = 2;
        TAbility.Pos [4].y      = -2;
        TAbility.Pos [5].x      = 1;
        TAbility.Pos [5].y      = -1;
        TAbility.Pos [6].x      = -1;
        TAbility.Pos [6].y      = 1;
        TAbility.Pos [7].x      = -2;
        TAbility.Pos [7].y      = 2;
        Ability [9]             = TAbility;
    }