Exemple #1
0
        private void btCreate_Click(object sender, EventArgs e)
        {
            Function.SoundManager.PlayButtonSound();
            if (textBoxCharacterName.Text != "" && GeneralFunctions.CheckTextForNonLetters(textBoxCharacterName.Text))
            {
                if (!this.player.ControlledCharacters.Any(x => x.UnitName.ToLower().Equals(textBoxCharacterName.Text.ToLower())))
                {
                    returnedCharacter          = new Core.Units.Character(textBoxCharacterName.Text, 1, 10, 10, finalclass, 0, 1, 1, 1, 1, 0, 0, null);
                    returnedCharacter.CharGear = GiveCharGear(returnedCharacter);
                    returnedCharacter.AddActiveAbility(new Core.Abilities.MeleeAttack(returnedCharacter, "", "", null, EnumAbilityClassReq.ANY));
                    returnedCharacter.AddPassiveAbility(new Core.Abilities.MeleeAttack(returnedCharacter, "", "", null, EnumAbilityClassReq.ANY));

                    this.DialogResult = System.Windows.Forms.DialogResult.OK;
                    this.Close();
                }
                else
                {
                    RPG.UI.MessageForm mes = new RPG.UI.MessageForm("You already have a character with that name!");
                    mes.ShowDialog();
                }
            }
            else if (textBoxCharacterName.Text != "")
            {
                RPG.UI.MessageForm mes = new RPG.UI.MessageForm("Please only use Letters for you Character Name");
                mes.ShowDialog();
            }
            else
            {
                RPG.UI.MessageForm mes = new RPG.UI.MessageForm("Please choose a suitable name!");
                mes.ShowDialog();
            }
        }