Beispiel #1
0
        public SkillChallengeSkillForm(SkillChallengeData scd)
        {
            InitializeComponent();

            List <string> skills = Skills.GetSkillNames();

            foreach (string skill in skills)
            {
                SkillBox.Items.Add(skill);
            }

            DiffBox.Items.Add(Difficulty.Easy);
            DiffBox.Items.Add(Difficulty.Moderate);
            DiffBox.Items.Add(Difficulty.Hard);

            TypeBox.Items.Add(PRIMARY);
            TypeBox.Items.Add(SECONDARY);
            TypeBox.Items.Add(AUTOFAIL);

            fSkillData = scd.Copy();

            SkillBox.Text = fSkillData.SkillName;

            switch (fSkillData.Type)
            {
            case SkillType.Primary:
                TypeBox.SelectedIndex = 0;
                break;

            case SkillType.Secondary:
                TypeBox.SelectedIndex = 1;
                break;

            case SkillType.AutoFail:
                TypeBox.SelectedIndex = 2;
                break;
            }

            DiffBox.SelectedItem = fSkillData.Difficulty;
            ModBox.Value         = fSkillData.DCModifier;

            DetailsBox.Text = fSkillData.Details;
            SuccessBox.Text = fSkillData.Success;
            FailureBox.Text = fSkillData.Failure;

            SuccessCountBox.Value = fSkillData.Results.Successes;
            FailureCountBox.Value = fSkillData.Results.Fails;
        }
        void add_skill(string skill_name)
        {
            SkillChallengeData scd = new SkillChallengeData();

            scd.SkillName = skill_name;

            SkillChallengeSkillForm dlg = new SkillChallengeSkillForm(scd);

            if (dlg.ShowDialog() == DialogResult.OK)
            {
                fChallenge.Skills.Add(dlg.SkillData);
                fChallenge.Skills.Sort();

                update_view();
                update_skills();
            }
        }
        public SkillChallengeSkillForm(SkillChallengeData scd)
        {
            this.InitializeComponent();
            foreach (string skillName in Skills.GetSkillNames())
            {
                this.SkillBox.Items.Add(skillName);
            }
            this.DiffBox.Items.Add(Difficulty.Easy);
            this.DiffBox.Items.Add(Difficulty.Moderate);
            this.DiffBox.Items.Add(Difficulty.Hard);
            this.TypeBox.Items.Add("This is a primary skill for this challenge");
            this.TypeBox.Items.Add("This is a secondary skill for this challenge");
            this.TypeBox.Items.Add("This skill incurs an automatic failure");
            this.fSkillData    = scd.Copy();
            this.SkillBox.Text = this.fSkillData.SkillName;
            switch (this.fSkillData.Type)
            {
            case SkillType.Primary:
            {
                this.TypeBox.SelectedIndex = 0;
                break;
            }

            case SkillType.Secondary:
            {
                this.TypeBox.SelectedIndex = 1;
                break;
            }

            case SkillType.AutoFail:
            {
                this.TypeBox.SelectedIndex = 2;
                break;
            }
            }
            this.DiffBox.SelectedItem  = this.fSkillData.Difficulty;
            this.ModBox.Value          = this.fSkillData.DCModifier;
            this.DetailsBox.Text       = this.fSkillData.Details;
            this.SuccessBox.Text       = this.fSkillData.Success;
            this.FailureBox.Text       = this.fSkillData.Failure;
            this.SuccessCountBox.Value = this.fSkillData.Results.Successes;
            this.FailureCountBox.Value = this.fSkillData.Results.Fails;
        }